mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 10:02:59 +08:00
Merge pull request #2222 from TriliumNext/feature/share_theme
Integrate Trilium Rocks share theme
This commit is contained in:
commit
94cd0fc5d1
@ -25,6 +25,7 @@
|
||||
"@triliumnext/codemirror": "workspace:*",
|
||||
"@triliumnext/commons": "workspace:*",
|
||||
"@triliumnext/highlightjs": "workspace:*",
|
||||
"@triliumnext/share-theme": "workspace:*",
|
||||
"autocomplete.js": "0.38.1",
|
||||
"bootstrap": "5.3.6",
|
||||
"boxicons": "2.1.4",
|
||||
|
@ -109,39 +109,6 @@ function isClipboardEmpty() {
|
||||
return clipboardBranchIds.length === 0;
|
||||
}
|
||||
|
||||
export function copyText(text: string) {
|
||||
if (!text) {
|
||||
return;
|
||||
}
|
||||
|
||||
let succeeded = false;
|
||||
|
||||
try {
|
||||
if (navigator.clipboard) {
|
||||
navigator.clipboard.writeText(text);
|
||||
succeeded = true;
|
||||
} else {
|
||||
// Fallback method: https://stackoverflow.com/a/72239825
|
||||
const textArea = document.createElement("textarea");
|
||||
textArea.value = text;
|
||||
document.body.appendChild(textArea);
|
||||
textArea.focus();
|
||||
textArea.select();
|
||||
succeeded = document.execCommand('copy');
|
||||
document.body.removeChild(textArea);
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn(e);
|
||||
succeeded = false;
|
||||
}
|
||||
|
||||
if (succeeded) {
|
||||
toast.showMessage(t("clipboard.copy_success"));
|
||||
} else {
|
||||
toast.showError(t("clipboard.copy_failed"));
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
pasteAfter,
|
||||
pasteInto,
|
||||
|
37
apps/client/src/services/clipboard_ext.ts
Normal file
37
apps/client/src/services/clipboard_ext.ts
Normal file
@ -0,0 +1,37 @@
|
||||
export function copyText(text: string) {
|
||||
if (!text) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
if (navigator.clipboard) {
|
||||
navigator.clipboard.writeText(text);
|
||||
return true;
|
||||
} else {
|
||||
// Fallback method: https://stackoverflow.com/a/72239825
|
||||
const textArea = document.createElement("textarea");
|
||||
textArea.value = text;
|
||||
try {
|
||||
document.body.appendChild(textArea);
|
||||
textArea.focus();
|
||||
textArea.select();
|
||||
return document.execCommand('copy');
|
||||
} finally {
|
||||
document.body.removeChild(textArea);
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn(e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
export async function copyTextWithToast(text: string) {
|
||||
const t = (await import("./i18n.js")).t;
|
||||
const toast = (await import("./toast.js")).default;
|
||||
|
||||
if (copyText(text)) {
|
||||
toast.showMessage(t("clipboard.copy_success"));
|
||||
} else {
|
||||
toast.showError(t("clipboard.copy_failed"));
|
||||
}
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
import server from "./server.js";
|
||||
import { isShare } from "./utils.js";
|
||||
|
||||
type OptionValue = number | string;
|
||||
|
||||
@ -7,7 +8,11 @@ class Options {
|
||||
private arr!: Record<string, OptionValue>;
|
||||
|
||||
constructor() {
|
||||
if (!isShare) {
|
||||
this.initializedPromise = server.get<Record<string, OptionValue>>("options").then((data) => this.load(data));
|
||||
} else {
|
||||
this.initializedPromise = Promise.resolve();
|
||||
}
|
||||
}
|
||||
|
||||
load(arr: Record<string, OptionValue>) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import utils from "./utils.js";
|
||||
import utils, { isShare } from "./utils.js";
|
||||
import ValidationError from "./validation_error.js";
|
||||
|
||||
type Headers = Record<string, string | null | undefined>;
|
||||
@ -28,6 +28,10 @@ export interface StandardResponse {
|
||||
}
|
||||
|
||||
async function getHeaders(headers?: Headers) {
|
||||
if (isShare) {
|
||||
return {};
|
||||
}
|
||||
|
||||
const appContext = (await import("../components/app_context.js")).default;
|
||||
const activeNoteContext = appContext.tabManager ? appContext.tabManager.getActiveContext() : null;
|
||||
|
||||
|
@ -2,7 +2,9 @@ import { ensureMimeTypes, highlight, highlightAuto, loadTheme, Themes, type Auto
|
||||
import mime_types from "./mime_types.js";
|
||||
import options from "./options.js";
|
||||
import { t } from "./i18n.js";
|
||||
import { copyText } from "./clipboard.js";
|
||||
import { copyText, copyTextWithToast } from "./clipboard_ext.js";
|
||||
import { isShare } from "./utils.js";
|
||||
import { MimeType } from "@triliumnext/commons";
|
||||
|
||||
let highlightingLoaded = false;
|
||||
|
||||
@ -14,9 +16,6 @@ let highlightingLoaded = false;
|
||||
*/
|
||||
export async function formatCodeBlocks($container: JQuery<HTMLElement>) {
|
||||
const syntaxHighlightingEnabled = isSyntaxHighlightEnabled();
|
||||
if (syntaxHighlightingEnabled) {
|
||||
await ensureMimeTypesForHighlighting();
|
||||
}
|
||||
|
||||
const codeBlocks = $container.find("pre code");
|
||||
for (const codeBlock of codeBlocks) {
|
||||
@ -37,7 +36,13 @@ export function applyCopyToClipboardButton($codeBlock: JQuery<HTMLElement>) {
|
||||
const $copyButton = $("<button>")
|
||||
.addClass("bx component icon-action tn-tool-button bx-copy copy-button")
|
||||
.attr("title", t("code_block.copy_title"))
|
||||
.on("click", () => copyText($codeBlock.text()));
|
||||
.on("click", () => {
|
||||
if (!isShare) {
|
||||
copyTextWithToast($codeBlock.text());
|
||||
} else {
|
||||
copyText($codeBlock.text());
|
||||
}
|
||||
});
|
||||
$codeBlock.parent().append($copyButton);
|
||||
}
|
||||
|
||||
@ -49,11 +54,11 @@ export async function applySingleBlockSyntaxHighlight($codeBlock: JQuery<HTMLEle
|
||||
const text = $codeBlock.text();
|
||||
|
||||
let highlightedText: HighlightResult | AutoHighlightResult | null = null;
|
||||
if (normalizedMimeType === mime_types.MIME_TYPE_AUTO) {
|
||||
if (normalizedMimeType === mime_types.MIME_TYPE_AUTO && !isShare) {
|
||||
await ensureMimeTypesForHighlighting();
|
||||
highlightedText = highlightAuto(text);
|
||||
} else if (normalizedMimeType) {
|
||||
await ensureMimeTypesForHighlighting();
|
||||
await ensureMimeTypesForHighlighting(normalizedMimeType);
|
||||
highlightedText = highlight(text, { language: normalizedMimeType });
|
||||
}
|
||||
|
||||
@ -62,7 +67,7 @@ export async function applySingleBlockSyntaxHighlight($codeBlock: JQuery<HTMLEle
|
||||
}
|
||||
}
|
||||
|
||||
export async function ensureMimeTypesForHighlighting() {
|
||||
export async function ensureMimeTypesForHighlighting(mimeTypeHint?: string) {
|
||||
if (highlightingLoaded) {
|
||||
return;
|
||||
}
|
||||
@ -72,7 +77,20 @@ export async function ensureMimeTypesForHighlighting() {
|
||||
loadHighlightingTheme(currentThemeName);
|
||||
|
||||
// Load mime types.
|
||||
const mimeTypes = mime_types.getMimeTypes();
|
||||
let mimeTypes: MimeType[];
|
||||
|
||||
if (mimeTypeHint) {
|
||||
mimeTypes = [
|
||||
{
|
||||
title: mimeTypeHint,
|
||||
enabled: true,
|
||||
mime: mimeTypeHint.replace("-", "/")
|
||||
}
|
||||
]
|
||||
} else {
|
||||
mimeTypes = mime_types.getMimeTypes();
|
||||
}
|
||||
|
||||
await ensureMimeTypes(mimeTypes);
|
||||
|
||||
highlightingLoaded = true;
|
||||
@ -96,8 +114,12 @@ export function loadHighlightingTheme(themeName: string) {
|
||||
* @returns whether syntax highlighting should be enabled for code blocks.
|
||||
*/
|
||||
export function isSyntaxHighlightEnabled() {
|
||||
if (!isShare) {
|
||||
const theme = options.get("codeBlockTheme");
|
||||
return !!theme && theme !== "none";
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -4,6 +4,8 @@ import type { ViewScope } from "./link.js";
|
||||
|
||||
const SVG_MIME = "image/svg+xml";
|
||||
|
||||
export const isShare = !window.glob;
|
||||
|
||||
function reloadFrontendApp(reason?: string) {
|
||||
if (reason) {
|
||||
logInfo(`Frontend app reload: ${reason}`);
|
||||
|
@ -1,5 +1,33 @@
|
||||
import "normalize.css";
|
||||
import "boxicons/css/boxicons.min.css";
|
||||
import "@triliumnext/ckeditor5/content.css";
|
||||
import "@triliumnext/share-theme/styles/index.css";
|
||||
import "@triliumnext/share-theme/scripts/index.js";
|
||||
|
||||
async function ensureJQuery() {
|
||||
const $ = (await import("jquery")).default;
|
||||
(window as any).$ = $;
|
||||
}
|
||||
|
||||
async function applyMath() {
|
||||
const anyMathBlock = document.querySelector("#content .math-tex");
|
||||
if (!anyMathBlock) {
|
||||
return;
|
||||
}
|
||||
|
||||
const renderMathInElement = (await import("./services/math.js")).renderMathInElement;
|
||||
renderMathInElement(document.getElementById("content"));
|
||||
}
|
||||
|
||||
async function formatCodeBlocks() {
|
||||
const anyCodeBlock = document.querySelector("#content pre");
|
||||
if (!anyCodeBlock) {
|
||||
return;
|
||||
}
|
||||
await ensureJQuery();
|
||||
const { formatCodeBlocks } = await import("./services/syntax_highlight.js");
|
||||
await formatCodeBlocks($("#content"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch note with given ID from backend
|
||||
@ -19,6 +47,9 @@ async function fetchNote(noteId: string | null = null) {
|
||||
document.addEventListener(
|
||||
"DOMContentLoaded",
|
||||
() => {
|
||||
formatCodeBlocks();
|
||||
applyMath();
|
||||
|
||||
const toggleMenuButton = document.getElementById("toggleMenuButton");
|
||||
const layout = document.getElementById("layout");
|
||||
|
||||
|
2
apps/client/src/types-assets.d.ts
vendored
2
apps/client/src/types-assets.d.ts
vendored
@ -7,3 +7,5 @@ declare module "@triliumnext/ckeditor5/emoji_definitions/en.json?url" {
|
||||
var path: string;
|
||||
export default path;
|
||||
}
|
||||
|
||||
declare module "boxicons/css/boxicons.min.css" { }
|
||||
|
@ -6,7 +6,7 @@ import options from "../../../services/options.js";
|
||||
import { ensureMimeTypesForHighlighting, isSyntaxHighlightEnabled } from "../../../services/syntax_highlight.js";
|
||||
import utils from "../../../services/utils.js";
|
||||
import emojiDefinitionsUrl from "@triliumnext/ckeditor5/emoji_definitions/en.json?url";
|
||||
import { copyText } from "../../../services/clipboard.js";
|
||||
import { copyTextWithToast } from "../../../services/clipboard_ext.js";
|
||||
|
||||
const TEXT_FORMATTING_GROUP = {
|
||||
label: "Text formatting",
|
||||
@ -116,7 +116,7 @@ export function buildConfig(): EditorConfig {
|
||||
enabled: isSyntaxHighlightEnabled()
|
||||
},
|
||||
clipboard: {
|
||||
copy: copyText
|
||||
copy: copyTextWithToast
|
||||
},
|
||||
// This value must be kept in sync with the language defined in webpack.config.js.
|
||||
language: "en"
|
||||
|
@ -34,14 +34,17 @@
|
||||
"src/**/*.ts"
|
||||
],
|
||||
"references": [
|
||||
{
|
||||
"path": "../../packages/share-theme"
|
||||
},
|
||||
{
|
||||
"path": "../../packages/highlightjs/tsconfig.lib.json"
|
||||
},
|
||||
{
|
||||
"path": "../../packages/codemirror/tsconfig.lib.json"
|
||||
"path": "../../packages/commons/tsconfig.lib.json"
|
||||
},
|
||||
{
|
||||
"path": "../../packages/commons/tsconfig.lib.json"
|
||||
"path": "../../packages/codemirror/tsconfig.lib.json"
|
||||
},
|
||||
{
|
||||
"path": "../../packages/ckeditor5/tsconfig.lib.json"
|
||||
|
@ -3,14 +3,17 @@
|
||||
"files": [],
|
||||
"include": [],
|
||||
"references": [
|
||||
{
|
||||
"path": "../../packages/share-theme"
|
||||
},
|
||||
{
|
||||
"path": "../../packages/highlightjs"
|
||||
},
|
||||
{
|
||||
"path": "../../packages/codemirror"
|
||||
"path": "../../packages/commons"
|
||||
},
|
||||
{
|
||||
"path": "../../packages/commons"
|
||||
"path": "../../packages/codemirror"
|
||||
},
|
||||
{
|
||||
"path": "../../packages/ckeditor5"
|
||||
|
@ -8,11 +8,3 @@ test("Goes to share root", async ({ page, context }) => {
|
||||
await expect(page).toHaveTitle(noteTitle);
|
||||
await expect(page.locator("h1")).toHaveText(noteTitle);
|
||||
});
|
||||
|
||||
test("Goes to parent share root page", async ({ page, context }) => {
|
||||
const app = new App(page, context);
|
||||
await app.goto({ url: "/share/bKMn5EFv9KS2" });
|
||||
await expect(page.locator("h1")).toHaveText("Child note");
|
||||
await page.locator("#parentLink a").click();
|
||||
await page.waitForURL("/share/");
|
||||
});
|
||||
|
@ -111,6 +111,9 @@
|
||||
},
|
||||
"nx": {
|
||||
"name": "server",
|
||||
"implicitDependencies": [
|
||||
"share-theme"
|
||||
],
|
||||
"targets": {
|
||||
"serve": {
|
||||
"executor": "@nx/js:node",
|
||||
@ -236,23 +239,25 @@
|
||||
],
|
||||
"esbuildOptions": {
|
||||
"loader": {
|
||||
".css": "text"
|
||||
".css": "text",
|
||||
".ejs": "text"
|
||||
}
|
||||
},
|
||||
"declarationRootDir": "apps/server/src"
|
||||
},
|
||||
"configurations": {
|
||||
"development": {
|
||||
"declarationRootDir": "apps/server/src",
|
||||
"minify": false,
|
||||
"assets": [
|
||||
{
|
||||
"glob": "**/*",
|
||||
"input": "apps/server/src/assets",
|
||||
"output": "assets"
|
||||
},
|
||||
{
|
||||
"glob": "**/*",
|
||||
"input": "packages/share-theme/src/templates",
|
||||
"output": "share-theme/templates"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"build": {
|
||||
"executor": "@nx/esbuild:esbuild",
|
||||
@ -285,7 +290,8 @@
|
||||
"esbuildOptions": {
|
||||
"splitting": false,
|
||||
"loader": {
|
||||
".css": "text"
|
||||
".css": "text",
|
||||
".ejs": "text"
|
||||
}
|
||||
},
|
||||
"additionalEntryPoints": [
|
||||
@ -297,6 +303,11 @@
|
||||
"input": "apps/server/src/assets",
|
||||
"output": "assets"
|
||||
},
|
||||
{
|
||||
"glob": "**/*",
|
||||
"input": "packages/share-theme/src/templates",
|
||||
"output": "share-theme/templates"
|
||||
},
|
||||
{
|
||||
"glob": "**/*",
|
||||
"input": "apps/client/dist",
|
||||
|
@ -294,5 +294,14 @@
|
||||
},
|
||||
"modals": {
|
||||
"error_title": "Error"
|
||||
},
|
||||
"share_theme": {
|
||||
"site-theme": "Site Theme",
|
||||
"search_placeholder": "Search...",
|
||||
"image_alt": "Article Image",
|
||||
"last-updated": "Last updated on {{- date}}",
|
||||
"subpages": "Subpages:",
|
||||
"on-this-page": "On This Page",
|
||||
"expand": "Expand"
|
||||
}
|
||||
}
|
||||
|
@ -50,6 +50,7 @@
|
||||
<% } %>
|
||||
|
||||
<link href="<%= assetPath %>/stylesheets/style.css" rel="stylesheet">
|
||||
<link href="<%= assetPath %>/src/boxicons.css" rel="stylesheet">
|
||||
<link href="<%= assetPath %>/stylesheets/print.css" rel="stylesheet" media="print">
|
||||
|
||||
<script src="<%= appPath %>/runtime.js" crossorigin type="module"></script>
|
||||
|
@ -128,6 +128,7 @@
|
||||
<% } %>
|
||||
|
||||
<link href="<%= assetPath %>/stylesheets/style.css" rel="stylesheet">
|
||||
<link href="<%= assetPath %>/src/boxicons.css" rel="stylesheet">
|
||||
<link href="<%= assetPath %>/stylesheets/print.css" rel="stylesheet" media="print">
|
||||
|
||||
</body>
|
||||
|
@ -1,94 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<% if (note.hasLabel("shareDescription")) { %>
|
||||
<meta name="description" content="<%= note.getLabelValue("shareDescription") %>">
|
||||
<% } %>
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<% if (note.hasRelation("shareFavicon")) { %>
|
||||
<link rel="shortcut icon" href="api/notes/<%= note.getRelation("shareFavicon").value %>/download">
|
||||
<% } else { %>
|
||||
<link rel="shortcut icon" href="../favicon.ico">
|
||||
<% } %>
|
||||
<script src="<%= appPath %>/share.js" type="module"></script>
|
||||
<link href="<%= assetPath %>/src/share.css" rel="stylesheet">
|
||||
<% if (!note.isLabelTruthy("shareOmitDefaultCss")) { %>
|
||||
<link href="<%= assetPath %>/stylesheets/share.css" rel="stylesheet">
|
||||
<% } %>
|
||||
<% for (const cssRelation of note.getRelations("shareCss")) { %>
|
||||
<link href="api/notes/<%= cssRelation.value %>/download" rel="stylesheet">
|
||||
<% } %>
|
||||
<% for (const jsRelation of note.getRelations("shareJs")) { %>
|
||||
<script type="module" src="api/notes/<%= jsRelation.value %>/download"></script>
|
||||
<% } %>
|
||||
<% if (note.isLabelTruthy('shareDisallowRobotIndexing')) { %>
|
||||
<meta name="robots" content="noindex,follow" />
|
||||
<% } %>
|
||||
<%- header %>
|
||||
<title><%= note.title %></title>
|
||||
</head>
|
||||
<body data-note-id="<%= note.noteId %>" data-ancestor-note-id="<%= subRoot.note.noteId %>">
|
||||
<div id="layout">
|
||||
<div id="main">
|
||||
<% if (note.parents[0].noteId !== '_share' && note.parents.length !== 0) { %>
|
||||
<nav id="parentLink">
|
||||
<%= t("share_page.parent") %> <a href="./<%= note.parents[0].shareId %>"
|
||||
class="type-<%= note.parents[0].type %>"><%= note.parents[0].title %></a>
|
||||
</nav>
|
||||
<% } %>
|
||||
|
||||
<h1 id="title"><%= note.title %></h1>
|
||||
|
||||
<% if (note.hasLabel("pageUrl")) { %>
|
||||
<div id="noteClippedFrom"><%- t("share_page.clipped-from", { url: `<a href="${note.getLabelValue("pageUrl")}">${note.getLabelValue("pageUrl")}</a>` }) %></div>
|
||||
<% } %>
|
||||
|
||||
<% if (!isEmpty) { %>
|
||||
<div id="content" class="type-<%= note.type %><% if (note.type === 'text') { %> ck-content<% } %>">
|
||||
<%- content %>
|
||||
</div>
|
||||
<% } %>
|
||||
|
||||
<% if (note.hasVisibleChildren()) { %>
|
||||
<nav id="childLinks" class="<% if (isEmpty) { %>grid<% } else { %>list<% } %>">
|
||||
<% if (!isEmpty) { %>
|
||||
<hr>
|
||||
<span><%= t("share_page.child-notes") %> </span>
|
||||
<% } %>
|
||||
|
||||
<ul>
|
||||
<%
|
||||
for (const childNote of note.getVisibleChildNotes()) {
|
||||
const isExternalLink = childNote.hasLabel('shareExternalLink');
|
||||
const linkHref = isExternalLink ? childNote.getLabelValue('shareExternalLink') : `./${childNote.shareId}`;
|
||||
const target = isExternalLink ? `target="_blank" rel="noopener noreferrer"` : '';
|
||||
%>
|
||||
<li>
|
||||
<a href="<%= linkHref %>" <%= target %>
|
||||
class="type-<%= childNote.type %>"><%= childNote.title %></a>
|
||||
</li>
|
||||
<% } %>
|
||||
</ul>
|
||||
</nav>
|
||||
<% } else if (isEmpty) { %>
|
||||
<p><%= t("share_page.no-content") %></p>
|
||||
<% } %>
|
||||
</div>
|
||||
|
||||
<% if (subRoot.note.hasVisibleChildren()) { %>
|
||||
<button id="toggleMenuButton"></button>
|
||||
|
||||
<nav id="menu">
|
||||
<%- include('tree_item', {note: subRoot.note, branch: subRoot.branch, activeNote: note}) %>
|
||||
</nav>
|
||||
<% } %>
|
||||
</div>
|
||||
<footer>
|
||||
<% if (showLoginInShareTheme === 'true') { %>
|
||||
<p><a href="/login" class="login-link">Login</a></p>
|
||||
<% } %>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
@ -1,24 +0,0 @@
|
||||
<%
|
||||
const isExternalLink = note.hasLabel('shareExternalLink');
|
||||
const linkHref = isExternalLink ? note.getLabelValue('shareExternalLink') : `./${note.shareId}`;
|
||||
const target = isExternalLink ? ` target="_blank" rel="noopener noreferrer"` : '';
|
||||
%>
|
||||
<p>
|
||||
<% const titleWithPrefix = (branch.prefix ? `${branch.prefix} - ` : '') + note.title; %>
|
||||
|
||||
<% if (activeNote.noteId === note.noteId) { %>
|
||||
<strong><%= titleWithPrefix %></strong>
|
||||
<% } else { %>
|
||||
<a class="type-<%= note.type %>" href="<%= linkHref %>"<%= target %>><%= titleWithPrefix %></a>
|
||||
<% } %>
|
||||
</p>
|
||||
|
||||
<% if (note.hasChildren()) { %>
|
||||
<ul>
|
||||
<% note.getVisibleChildBranches().forEach(function (branch) { %>
|
||||
<li>
|
||||
<%- include('tree_item', {branch: branch, note: branch.getNote()}) %>
|
||||
</li>
|
||||
<% }) %>
|
||||
</ul>
|
||||
<% } %>
|
@ -28,7 +28,7 @@ const LABEL = "label";
|
||||
const RELATION = "relation";
|
||||
|
||||
// TODO: Deduplicate with fnote
|
||||
const NOTE_TYPE_ICONS = {
|
||||
export const NOTE_TYPE_ICONS = {
|
||||
file: "bx bx-file",
|
||||
image: "bx bx-image",
|
||||
code: "bx bx-code",
|
||||
|
@ -6,7 +6,7 @@ import shaca from "./shaca/shaca.js";
|
||||
import shacaLoader from "./shaca/shaca_loader.js";
|
||||
import shareRoot from "./share_root.js";
|
||||
import contentRenderer from "./content_renderer.js";
|
||||
import assetPath from "../services/asset_path.js";
|
||||
import assetPath, { assetUrlFragment } from "../services/asset_path.js";
|
||||
import appPath from "../services/app_path.js";
|
||||
import searchService from "../services/search/services/search.js";
|
||||
import SearchContext from "../services/search/search_context.js";
|
||||
@ -17,6 +17,7 @@ import type SAttachment from "./shaca/entities/sattachment.js";
|
||||
import utils, { isDev, safeExtractMessageAndStackFromError } from "../services/utils.js";
|
||||
import options from "../services/options.js";
|
||||
import { t } from "i18next";
|
||||
import ejs from "ejs";
|
||||
|
||||
function getSharedSubTreeRoot(note: SNote): { note?: SNote; branch?: SBranch } {
|
||||
if (note.noteId === shareRoot.SHARE_ROOT_NOTE_ID) {
|
||||
@ -107,7 +108,8 @@ function renderImageAttachment(image: SNote, res: Response, attachmentName: stri
|
||||
let svgString = "<svg/>";
|
||||
const attachment = image.getAttachmentByTitle(attachmentName);
|
||||
if (!attachment) {
|
||||
res.status(404).render("share/404");
|
||||
res.status(404);
|
||||
renderDefault(res, "404");
|
||||
return;
|
||||
}
|
||||
const content = attachment.getContent();
|
||||
@ -136,10 +138,11 @@ function renderImageAttachment(image: SNote, res: Response, attachmentName: stri
|
||||
}
|
||||
|
||||
function register(router: Router) {
|
||||
async function renderNote(note: SNote, req: Request, res: Response) {
|
||||
function renderNote(note: SNote, req: Request, res: Response) {
|
||||
if (!note) {
|
||||
console.log("Unable to find note ", note);
|
||||
res.status(404).render("share/404");
|
||||
res.status(404);
|
||||
renderDefault(res, "404");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -167,9 +170,11 @@ function register(router: Router) {
|
||||
isEmpty,
|
||||
subRoot,
|
||||
assetPath: isDev ? assetPath : `../${assetPath}`,
|
||||
assetUrlFragment,
|
||||
appPath: isDev ? appPath : `../${appPath}`,
|
||||
showLoginInShareTheme,
|
||||
t
|
||||
t,
|
||||
isDev
|
||||
};
|
||||
let useDefaultView = true;
|
||||
|
||||
@ -197,7 +202,6 @@ function register(router: Router) {
|
||||
try {
|
||||
const content = templateNote.getContent();
|
||||
if (typeof content === "string") {
|
||||
const ejs = await import("ejs");
|
||||
const ejsResult = ejs.render(content, opts, { includer });
|
||||
res.send(ejsResult);
|
||||
useDefaultView = false; // Rendering went okay, don't use default view
|
||||
@ -210,7 +214,7 @@ function register(router: Router) {
|
||||
}
|
||||
|
||||
if (useDefaultView) {
|
||||
res.render("share/page", opts);
|
||||
renderDefault(res, "page", opts);
|
||||
}
|
||||
}
|
||||
|
||||
@ -395,6 +399,12 @@ function register(router: Router) {
|
||||
});
|
||||
}
|
||||
|
||||
function renderDefault(res: Response<any, Record<string, any>>, template: "page" | "404", opts: any = {}) {
|
||||
// Path is relative to apps/server/dist/assets/views
|
||||
const shareThemePath = `../../share-theme/templates/${template}.ejs`;
|
||||
res.render(shareThemePath, opts);
|
||||
}
|
||||
|
||||
export default {
|
||||
register
|
||||
};
|
||||
|
@ -9,6 +9,7 @@ import type SAttachment from "./sattachment.js";
|
||||
import type SAttribute from "./sattribute.js";
|
||||
import type SBranch from "./sbranch.js";
|
||||
import type { SNoteRow } from "./rows.js";
|
||||
import { NOTE_TYPE_ICONS } from "../../../becca/entities/bnote.js";
|
||||
|
||||
const LABEL = "label";
|
||||
const RELATION = "relation";
|
||||
@ -530,6 +531,33 @@ class SNote extends AbstractShacaEntity {
|
||||
childNoteIds: this.children.map((child) => child.noteId)
|
||||
};
|
||||
}
|
||||
|
||||
getIcon() {
|
||||
const iconClassLabels = this.getLabels("iconClass");
|
||||
|
||||
if (iconClassLabels && iconClassLabels.length > 0) {
|
||||
return iconClassLabels[0].value;
|
||||
} else if (this.noteId === "root") {
|
||||
return "bx bx-home-alt-2";
|
||||
}
|
||||
if (this.noteId === "_share") {
|
||||
return "bx bx-share-alt";
|
||||
} else if (this.type === "text") {
|
||||
if (this.isFolder()) {
|
||||
return "bx bx-folder";
|
||||
} else {
|
||||
return "bx bx-note";
|
||||
}
|
||||
} else if (this.type === "code" && this.mime.startsWith("text/x-sql")) {
|
||||
return "bx bx-data";
|
||||
} else {
|
||||
return NOTE_TYPE_ICONS[this.type];
|
||||
}
|
||||
}
|
||||
|
||||
isFolder() {
|
||||
return this.getChildBranches().length > 0;
|
||||
}
|
||||
}
|
||||
|
||||
export default SNote;
|
||||
|
11
apps/server/src/types.d.ts
vendored
11
apps/server/src/types.d.ts
vendored
@ -27,3 +27,14 @@ declare module "@triliumnext/ckeditor5/content.css" {
|
||||
const content: string;
|
||||
export default content;
|
||||
}
|
||||
|
||||
|
||||
declare module "@triliumnext/share-theme/*.ejs" {
|
||||
const content: string;
|
||||
export default content;
|
||||
}
|
||||
|
||||
declare module "@triliumnext/share-theme/styles.css" {
|
||||
const content: string;
|
||||
export default content;
|
||||
}
|
||||
|
94
packages/share-theme/.eslintrc
Normal file
94
packages/share-theme/.eslintrc
Normal file
@ -0,0 +1,94 @@
|
||||
{
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/recommended-type-checked",
|
||||
"plugin:@typescript-eslint/stylistic-type-checked"
|
||||
],
|
||||
"env": {
|
||||
"es2020": true,
|
||||
"browser": true
|
||||
},
|
||||
"plugins": ["@typescript-eslint"],
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"ignorePatterns": ["legacy/", "dist/"],
|
||||
"parserOptions": {
|
||||
"project": ["./tsconfig.eslint.json"],
|
||||
"tsconfigRootDir": ".",
|
||||
"ecmaVersion": 2022,
|
||||
"sourceType": "module"
|
||||
},
|
||||
"rules": {
|
||||
"accessor-pairs": "error",
|
||||
"block-spacing": ["error", "never"],
|
||||
"brace-style": ["error", "stroustrup", {"allowSingleLine": true}],
|
||||
"curly": ["error", "multi-line", "consistent"],
|
||||
"dot-location": ["error", "property"],
|
||||
"dot-notation": "error",
|
||||
"func-call-spacing": "error",
|
||||
"handle-callback-err": "error",
|
||||
"key-spacing": "error",
|
||||
"keyword-spacing": "error",
|
||||
"new-cap": ["error", {"newIsCap": true}],
|
||||
"no-array-constructor": "error",
|
||||
"no-caller": "error",
|
||||
"no-console": "error",
|
||||
"no-duplicate-imports": "error",
|
||||
"no-else-return": "error",
|
||||
"no-eval": "error",
|
||||
"no-floating-decimal": "error",
|
||||
"no-implied-eval": "error",
|
||||
"no-iterator": "error",
|
||||
"no-label-var": "error",
|
||||
"no-labels": "error",
|
||||
"no-lone-blocks": "error",
|
||||
"no-mixed-spaces-and-tabs": "error",
|
||||
"no-multi-spaces": "error",
|
||||
"no-multi-str": "error",
|
||||
"no-new": "error",
|
||||
"no-new-func": "error",
|
||||
"no-new-object": "error",
|
||||
"no-new-wrappers": "error",
|
||||
"no-octal-escape": "error",
|
||||
"no-path-concat": "error",
|
||||
"no-proto": "error",
|
||||
"no-prototype-builtins": "off",
|
||||
"no-redeclare": ["error", {"builtinGlobals": true}],
|
||||
"no-self-compare": "error",
|
||||
"no-sequences": "error",
|
||||
"no-shadow": ["warn", {"builtinGlobals": false, "hoist": "functions"}],
|
||||
"no-tabs": "error",
|
||||
"no-template-curly-in-string": "error",
|
||||
"no-throw-literal": "error",
|
||||
"no-undef": "error",
|
||||
"no-undef-init": "error",
|
||||
"no-unmodified-loop-condition": "error",
|
||||
"no-unneeded-ternary": "error",
|
||||
"no-useless-call": "error",
|
||||
"no-useless-computed-key": "error",
|
||||
"no-useless-constructor": "error",
|
||||
"no-useless-rename": "error",
|
||||
"no-var": "error",
|
||||
"no-whitespace-before-property": "error",
|
||||
"object-curly-spacing": ["error", "never", {"objectsInObjects": false}],
|
||||
"object-property-newline": ["error", {"allowAllPropertiesOnSameLine": true}],
|
||||
"operator-linebreak": ["error", "none", {"overrides": {"?": "before", ":": "before", "&&": "before"}}],
|
||||
"prefer-const": "error",
|
||||
"quote-props": ["error", "consistent-as-needed", {"keywords": true}],
|
||||
"quotes": ["error", "double", {"allowTemplateLiterals": true}],
|
||||
"rest-spread-spacing": "error",
|
||||
"semi": "error",
|
||||
"semi-spacing": "error",
|
||||
"space-before-blocks": "error",
|
||||
"space-in-parens": "error",
|
||||
"space-infix-ops": "error",
|
||||
"space-unary-ops": ["error", {"words": true, "nonwords": false, "overrides": {"typeof": false}}],
|
||||
"spaced-comment": ["error", "always", {"exceptions": ["-", "*"]}],
|
||||
"template-curly-spacing": "error",
|
||||
"wrap-iife": ["error", "inside"],
|
||||
"yield-star-spacing": "error",
|
||||
"yoda": "error"
|
||||
},
|
||||
"globals": {
|
||||
"NodeJS": "readonly"
|
||||
}
|
||||
}
|
4
packages/share-theme/.gitignore
vendored
Normal file
4
packages/share-theme/.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
node_modules/
|
||||
legacy/
|
||||
dist/
|
||||
.env
|
201
packages/share-theme/LICENSE
Normal file
201
packages/share-theme/LICENSE
Normal file
@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
21
packages/share-theme/README.md
Normal file
21
packages/share-theme/README.md
Normal file
@ -0,0 +1,21 @@
|
||||
# [Trilium Rocks!](https://trilium.rocks/) [](https://discord.gg/eTaTXUgcBr)
|
||||
|
||||
[Trilium Notes](https://github.com/zadam/trilium) really does rock! Don't believe me? Well I created the entire [trilium.rocks](https://trilium.rocks) website using the shared notes feature inside Trilium with a little bit of extra CSS and JS also contained in Trilium. That JS and CSS? That's what you'll find here in this repository.
|
||||
|
||||
**Disclaimer:** This project and website is not at all affiliated with Trilium Notes or its creator(s).
|
||||
|
||||
## Why?
|
||||
|
||||
I love Trilium, it has made me the most organized I have ever been in my many many years of digital storage. The only thing I found lacking was the centralization of information. The [wiki](https://github.com/zadam/trilium/wiki) is a great resource, but it's outdated in some areas, and lacking in many many others—especially in regards to developing addons for Trilium. I also don't personally use gitter so the [official Trilium gitter](https://gitter.im/trilium-notes/Lobby) is not useful for me, and last time I checked it was _very_ inactive. So I made the website [trilium.rocks](https://trilium.rocks) and [a Discord server](https://discord.gg/eTaTXUgcBr) to try and help with each of those respectively.
|
||||
|
||||
With the website, I want to at least provide supplementary knowledge to the wiki by adding extended guides for users and developers. I also want to try and make it a more user-friendly central place to browse addons.
|
||||
|
||||
With the Discord server, I wanted to interact with the community and see what kind of addons people may be interested in. It also provides a quick and easy way to provide support to people, or even get support from others. And hopefully, it lets the community's developers come together to share information and make all of our addons even better.
|
||||
|
||||
## About The Site
|
||||
|
||||
Rather than saying some specific goals of what this site strives to be, I'll say what it strives not to be. This site is not meant to be a complete recreation of the Wiki with every detail and page included. It is meant to be a (mostly) one-stop shop for users and developers alike looking to supplement their knowledge. It may at some point expand and include everything from the wiki because users tend to prefer a fancier UI like this, but it is not the end-goal. It also may move in that direction if [zadam](https://github.com/zadam) wants to use this (or parts of this) project as part of the in-app documentation.
|
||||
|
||||
## Contributing
|
||||
|
||||
Since the entire site is just a share from my personal Trilium instance, there is no easy way to contribute new pages or fixes for typos. For now, this GitHub repo's issues and discussion can be used as places to contribute bug reports, feature requests, and even documentation contributions. But who knows, maybe soon I'll think of some clever way to introduce contributions directly to my Trilium instance.
|
29
packages/share-theme/TODO.md
Normal file
29
packages/share-theme/TODO.md
Normal file
@ -0,0 +1,29 @@
|
||||
# TODOs
|
||||
|
||||
This doc contains a list of TODOs taken from the code and organized. This _does not_ includes things like upcoming features or fixes.
|
||||
|
||||
## Scripts
|
||||
|
||||
- Create a logger
|
||||
- Modify esbuild to allow for a development build to contain debug logs
|
||||
- Modify custom highlight.js plugin to include highlighting for jQuery global functions
|
||||
- Either move highlight.js inclusion to template or use a mapping of note IDs to files
|
||||
- Adjust search to use separate function (clean code)
|
||||
- Consider never removing the search results from the page and update container instead
|
||||
- Consolidate theme initialization (DRY)
|
||||
|
||||
## Styles
|
||||
|
||||
-
|
||||
|
||||
## Templates
|
||||
|
||||
- Consider adding highlight.js into the templates instead of scripts
|
||||
- Find a better way to integrate ts/js to templates (maybe via includes?)
|
||||
|
||||
## Other
|
||||
|
||||
- Create a logical set of attributes for setting open-graph/twitter metadata
|
||||
- Consider making book type notes explicitly required for full-link category
|
||||
- This lets text type notes still have content but require clicking arrow to expand
|
||||
- Find a way to better map template to notes and allow for automatically creating new ones
|
2523
packages/share-theme/package-lock.json
generated
Normal file
2523
packages/share-theme/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
35
packages/share-theme/package.json
Normal file
35
packages/share-theme/package.json
Normal file
@ -0,0 +1,35 @@
|
||||
{
|
||||
"name": "@triliumnext/share-theme",
|
||||
"version": "1.0.3",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"build": "esrun scripts/build.ts",
|
||||
"build-scripts": "esrun scripts/build.ts -- --module=scripts",
|
||||
"build-styles": "esrun scripts/build.ts -- --module=styles",
|
||||
"dist": "esrun scripts/build.ts -- --minify",
|
||||
"test": "esrun src/scripts/test.ts"
|
||||
},
|
||||
"exports": {
|
||||
"./templates/*": "./src/templates/*",
|
||||
"./styles/*": "./src/styles/*",
|
||||
"./scripts/*": "./src/scripts/*",
|
||||
"./*": "./dist/*"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"@digitak/esrun": "^3.2.24",
|
||||
"@types/swagger-ui": "^3.52.0",
|
||||
"@typescript-eslint/eslint-plugin": "^6.7.2",
|
||||
"@typescript-eslint/parser": "^6.7.2",
|
||||
"dotenv": "^16.3.1",
|
||||
"esbuild": "^0.19.3",
|
||||
"eslint": "^8.49.0",
|
||||
"highlight.js": "^11.8.0",
|
||||
"typescript": "^5.2.2"
|
||||
},
|
||||
"nx": {
|
||||
"name": "share-theme"
|
||||
}
|
||||
}
|
9
packages/share-theme/scripts/.eslintrc
Normal file
9
packages/share-theme/scripts/.eslintrc
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"extends": "../.eslintrc",
|
||||
"env": {
|
||||
"node": true
|
||||
},
|
||||
"rules": {
|
||||
"no-console": "off"
|
||||
}
|
||||
}
|
77
packages/share-theme/scripts/build.ts
Normal file
77
packages/share-theme/scripts/build.ts
Normal file
@ -0,0 +1,77 @@
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
// import {fileURLToPath} from "node:url";
|
||||
|
||||
import dotenv from "dotenv";
|
||||
import * as esbuild from "esbuild";
|
||||
|
||||
|
||||
// const fileURL = fileURLToPath(import.meta.url);
|
||||
// let baseDir = path.dirname(fileURL);
|
||||
// if (fileURL.includes("esrun-")) baseDir = path.join(baseDir, "..", "..", "scripts");
|
||||
// const rootDir = path.join(baseDir, "..");
|
||||
// console.log(process.env.npm_package_json);
|
||||
const rootDir = path.dirname(process.env.npm_package_json!);
|
||||
|
||||
dotenv.config();
|
||||
|
||||
const modules = ["scripts", "styles", "templates"];
|
||||
const entryPoints: {in: string, out: string}[] = [];
|
||||
|
||||
function makeEntry(mod: string) {
|
||||
let entrypoint: string;
|
||||
switch (mod) {
|
||||
case "styles":
|
||||
entrypoint = "index.css";
|
||||
break;
|
||||
case "scripts":
|
||||
entrypoint = "index.ts";
|
||||
break;
|
||||
case "templates":
|
||||
entrypoint = "page.ejs";
|
||||
break;
|
||||
default:
|
||||
throw new Error(`Unknown module type ${mod}.`);
|
||||
}
|
||||
|
||||
return {
|
||||
"in": path.join(rootDir, "src", mod, entrypoint),
|
||||
"out": mod
|
||||
};
|
||||
}
|
||||
|
||||
const modulesRequested = process.argv.filter(a => a.startsWith("--module="));
|
||||
for (const mod of modulesRequested) {
|
||||
const module = mod?.replace("--module=", "") ?? "";
|
||||
if (modules.includes(module)) entryPoints.push(makeEntry(module));
|
||||
}
|
||||
|
||||
if (!entryPoints.length) for (const mod of modules) entryPoints.push(makeEntry(mod));
|
||||
|
||||
|
||||
async function runBuild() {
|
||||
const before = performance.now();
|
||||
await esbuild.build({
|
||||
entryPoints: entryPoints,
|
||||
bundle: true,
|
||||
outdir: path.join(rootDir, "dist"),
|
||||
format: "cjs",
|
||||
target: ["chrome96"],
|
||||
loader: {
|
||||
".png": "dataurl",
|
||||
".gif": "dataurl",
|
||||
".woff": "dataurl",
|
||||
".woff2": "dataurl",
|
||||
".ttf": "dataurl",
|
||||
".html": "text",
|
||||
".css": "css"
|
||||
},
|
||||
logLevel: "info",
|
||||
metafile: true,
|
||||
minify: process.argv.includes("--minify")
|
||||
});
|
||||
const after = performance.now();
|
||||
console.log(`Build actually took ${(after - before).toFixed(2)}ms`);
|
||||
}
|
||||
|
||||
runBuild().catch(console.error);
|
11
packages/share-theme/src/scripts/common/debounce.ts
Normal file
11
packages/share-theme/src/scripts/common/debounce.ts
Normal file
@ -0,0 +1,11 @@
|
||||
export default function debounce<T extends (...args: unknown[]) => unknown>(executor: T, delay: number) {
|
||||
let timeout: NodeJS.Timeout | null;
|
||||
return function(...args: Parameters<T>): void {
|
||||
const callback = () => {
|
||||
timeout = null;
|
||||
Reflect.apply(executor, null, args);
|
||||
};
|
||||
if (timeout) clearTimeout(timeout);
|
||||
timeout = setTimeout(callback, delay);
|
||||
};
|
||||
}
|
7
packages/share-theme/src/scripts/common/parents.ts
Normal file
7
packages/share-theme/src/scripts/common/parents.ts
Normal file
@ -0,0 +1,7 @@
|
||||
export default function parents<T extends HTMLElement>(el: T, selector: string) {
|
||||
const result = [];
|
||||
for (let p = el && el.parentElement; p; p = p.parentElement) {
|
||||
if (p.matches(selector)) result.push(p);
|
||||
}
|
||||
return result;
|
||||
}
|
7
packages/share-theme/src/scripts/common/parsehtml.ts
Normal file
7
packages/share-theme/src/scripts/common/parsehtml.ts
Normal file
@ -0,0 +1,7 @@
|
||||
export default function parseHTML(html: string, fragment = false) {
|
||||
const template = document.createElement("template");
|
||||
template.innerHTML = html;
|
||||
const node = template.content.cloneNode(true);
|
||||
if (fragment) return node;
|
||||
return node.childNodes.length > 1 ? node.childNodes : node.childNodes[0];
|
||||
}
|
20
packages/share-theme/src/scripts/index.ts
Normal file
20
packages/share-theme/src/scripts/index.ts
Normal file
@ -0,0 +1,20 @@
|
||||
import setupToC from "./modules/toc";
|
||||
import setupExpanders from "./modules/expanders";
|
||||
import setupMobileMenu from "./modules/mobile";
|
||||
import setupSearch from "./modules/search";
|
||||
import setupThemeSelector from "./modules/theme";
|
||||
|
||||
function $try<T extends (...a: unknown[]) => unknown>(func: T, ...args: Parameters<T>) {
|
||||
try {
|
||||
func.apply(func, args);
|
||||
}
|
||||
catch (e) {
|
||||
console.error(e); // eslint-disable-line no-console
|
||||
}
|
||||
}
|
||||
|
||||
$try(setupThemeSelector);
|
||||
$try(setupToC);
|
||||
$try(setupExpanders);
|
||||
$try(setupMobileMenu);
|
||||
$try(setupSearch);
|
32
packages/share-theme/src/scripts/modules/expanders.ts
Normal file
32
packages/share-theme/src/scripts/modules/expanders.ts
Normal file
@ -0,0 +1,32 @@
|
||||
// In case a linked article lead to a new tree
|
||||
// const activeLink = document.querySelector("#menu a.active");
|
||||
// if (activeLink) {
|
||||
// let parent = activeLink.parentElement;
|
||||
// const mainMenu = document.getElementById("#menu");
|
||||
// while (parent && parent !== mainMenu) {
|
||||
// if (parent.matches(".submenu-item") && !parent.classList.contains("expanded")) {
|
||||
// parent.classList.add("expanded");
|
||||
// }
|
||||
// parent = parent.parentElement;
|
||||
// }
|
||||
// }
|
||||
|
||||
export default function setupExpanders() {
|
||||
const expanders = Array.from(document.querySelectorAll("#menu .submenu-item .collapse-button"));
|
||||
for (const expander of expanders) {
|
||||
const li = expander.parentElement?.parentElement;
|
||||
if (!li) {
|
||||
continue;
|
||||
}
|
||||
|
||||
expander.addEventListener("click", e => {
|
||||
if ((e.target as Element).closest(".submenu-item,.item") !== li) return;
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
const ul = li.querySelector("ul")!;
|
||||
ul.style.height = `${ul.scrollHeight}px`;
|
||||
setTimeout(() => li.classList.toggle("expanded"), 1);
|
||||
setTimeout(() => ul.style.height = ``, 200);
|
||||
});
|
||||
}
|
||||
}
|
25
packages/share-theme/src/scripts/modules/mobile.ts
Normal file
25
packages/share-theme/src/scripts/modules/mobile.ts
Normal file
@ -0,0 +1,25 @@
|
||||
import parents from "../common/parents";
|
||||
|
||||
|
||||
export default function setupMobileMenu() {
|
||||
function toggleMobileMenu(event: MouseEvent) {
|
||||
event.stopPropagation(); // Don't prevent default for links
|
||||
|
||||
const isOpen = document.body.classList.contains("menu-open");
|
||||
if (isOpen) return document.body.classList.remove("menu-open");
|
||||
return document.body.classList.add("menu-open");
|
||||
}
|
||||
|
||||
const showMenuButton = document.getElementById("show-menu-button");
|
||||
showMenuButton?.addEventListener("click", toggleMobileMenu);
|
||||
|
||||
window.addEventListener("click", e => {
|
||||
const isOpen = document.body.classList.contains("menu-open");
|
||||
if (!isOpen) return; // This listener is only to close
|
||||
|
||||
// If the click was anywhere in the mobile nav, don't close
|
||||
if (parents(e.target as HTMLElement, "#left-pane").length) return;
|
||||
return toggleMobileMenu(e);
|
||||
});
|
||||
|
||||
}
|
64
packages/share-theme/src/scripts/modules/search.ts
Normal file
64
packages/share-theme/src/scripts/modules/search.ts
Normal file
@ -0,0 +1,64 @@
|
||||
import debounce from "../common/debounce";
|
||||
import parents from "../common/parents";
|
||||
import parseHTML from "../common/parsehtml";
|
||||
|
||||
|
||||
interface SearchResults {
|
||||
results: SearchResult[];
|
||||
}
|
||||
|
||||
interface SearchResult {
|
||||
id: string;
|
||||
title: string;
|
||||
score: number;
|
||||
path: string;
|
||||
}
|
||||
|
||||
function buildResultItem(result: SearchResult) {
|
||||
return `<a class="search-result-item" href="./${result.id}">
|
||||
<div class="search-result-title">${result.title}</div>
|
||||
<div class="search-result-note">${result.path || "Home"}</div>
|
||||
</a>`;
|
||||
}
|
||||
|
||||
|
||||
export default function setupSearch() {
|
||||
const searchInput: HTMLInputElement | null = document.querySelector(".search-input");
|
||||
if (!searchInput) {
|
||||
return;
|
||||
}
|
||||
|
||||
searchInput.addEventListener("keyup", debounce(async () => {
|
||||
// console.log("CHANGE EVENT");
|
||||
const ancestor = document.body.dataset.ancestorNoteId;
|
||||
const query = searchInput.value;
|
||||
if (query.length < 3) return;
|
||||
const resp = await fetch(`api/notes?search=${query}&ancestorNoteId=${ancestor}`);
|
||||
const json = await resp.json() as SearchResults;
|
||||
const results = json.results.slice(0, 5);
|
||||
const lines = [`<div class="search-results">`];
|
||||
for (const result of results) {
|
||||
lines.push(buildResultItem(result));
|
||||
}
|
||||
lines.push("</div>");
|
||||
|
||||
const container = parseHTML(lines.join("")) as HTMLDivElement;
|
||||
// console.log(container, lines);
|
||||
const rect = searchInput.getBoundingClientRect();
|
||||
container.style.top = `${rect.bottom}px`;
|
||||
container.style.left = `${rect.left}px`;
|
||||
container.style.minWidth = `${rect.width}px`;
|
||||
|
||||
const existing = document.querySelector(".search-results");
|
||||
if (existing) existing.replaceWith(container);
|
||||
else document.body.append(container);
|
||||
}, 500));
|
||||
|
||||
window.addEventListener("click", e => {
|
||||
const existing = document.querySelector(".search-results");
|
||||
if (!existing) return;
|
||||
// If the click was anywhere search components ignore it
|
||||
if (parents(e.target as HTMLElement, ".search-results,.search-item").length) return;
|
||||
if (existing) existing.remove();
|
||||
});
|
||||
}
|
29
packages/share-theme/src/scripts/modules/theme.ts
Normal file
29
packages/share-theme/src/scripts/modules/theme.ts
Normal file
@ -0,0 +1,29 @@
|
||||
const prefersDark = localStorage.getItem("theme") === "dark" || (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches);
|
||||
if (prefersDark) {
|
||||
document.body.classList.add("theme-dark");
|
||||
document.body.classList.remove("theme-light");
|
||||
} else {
|
||||
document.body.classList.remove("theme-dark");
|
||||
document.body.classList.add("theme-light");
|
||||
}
|
||||
|
||||
export default function setupThemeSelector() {
|
||||
const themeSwitch: HTMLInputElement = document.querySelector(".theme-selection input")!;
|
||||
|
||||
const themeSelection: HTMLDivElement = document.querySelector(".theme-selection")!;
|
||||
themeSelection.classList.add("no-transition");
|
||||
themeSwitch.checked = prefersDark;
|
||||
setTimeout(() => themeSelection.classList.remove("no-transition"), 400);
|
||||
|
||||
themeSwitch?.addEventListener("change", () => {
|
||||
if (themeSwitch.checked) {
|
||||
document.body.classList.add("theme-dark");
|
||||
document.body.classList.remove("theme-light");
|
||||
localStorage.setItem("theme", "dark");
|
||||
} else {
|
||||
document.body.classList.remove("theme-dark");
|
||||
document.body.classList.add("theme-light");
|
||||
localStorage.setItem("theme", "light");
|
||||
}
|
||||
});
|
||||
}
|
46
packages/share-theme/src/scripts/modules/toc.ts
Normal file
46
packages/share-theme/src/scripts/modules/toc.ts
Normal file
@ -0,0 +1,46 @@
|
||||
/**
|
||||
* The ToC is now generated in the page template so
|
||||
* it even exists for users without client-side js
|
||||
* and that means it loads with the page so it avoids
|
||||
* all potential reshuffling or layout recalculations.
|
||||
*
|
||||
* So, all this function needs to do is make the links
|
||||
* perform smooth animation, and adjust the "active"
|
||||
* entry as the user scrolls.
|
||||
*/
|
||||
export default function setupToC() {
|
||||
const toc = document.getElementById("toc");
|
||||
if (!toc) return;
|
||||
|
||||
// Get all relevant elements
|
||||
const sections = document.getElementById("content")!.querySelectorAll("h2, h3, h4, h5, h6");
|
||||
const links = toc.querySelectorAll("a");
|
||||
|
||||
// Setup smooth scroll on click
|
||||
for (const link of links) {
|
||||
link.addEventListener("click", e => {
|
||||
const target = document.querySelector(link.getAttribute("href")!);
|
||||
if (!target) return;
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
target.scrollIntoView({behavior: "smooth"});
|
||||
});
|
||||
}
|
||||
|
||||
// Setup a moving "active" in the ToC that adjusts with the scroll state
|
||||
function changeLinkState() {
|
||||
let index = sections.length;
|
||||
|
||||
// Work backkwards to find the first matching section
|
||||
while (--index && window.scrollY + 50 < (sections[index] as HTMLElement).offsetTop) {} // eslint-disable-line no-empty
|
||||
|
||||
// Update the "active" item in ToC
|
||||
links.forEach((link) => link.classList.remove("active"));
|
||||
links[index].classList.add("active");
|
||||
}
|
||||
|
||||
// Initial render
|
||||
changeLinkState();
|
||||
window.addEventListener("scroll", changeLinkState);
|
||||
}
|
78
packages/share-theme/src/scripts/test.ts
Normal file
78
packages/share-theme/src/scripts/test.ts
Normal file
File diff suppressed because one or more lines are too long
@ -14,33 +14,6 @@ a {
|
||||
flex-direction: row-reverse;
|
||||
}
|
||||
|
||||
#menu {
|
||||
padding: 25px;
|
||||
flex-basis: 0;
|
||||
flex-grow: 1;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
#menu p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#menu > p {
|
||||
font-weight: bold;
|
||||
font-size: 110%;
|
||||
}
|
||||
|
||||
#menu ul {
|
||||
padding-left: 20px;
|
||||
}
|
||||
|
||||
#main {
|
||||
flex-basis: 0;
|
||||
flex-grow: 3;
|
||||
overflow: auto;
|
||||
padding: 10px 20px 20px 20px;
|
||||
}
|
||||
|
||||
#parentLink {
|
||||
float: right;
|
||||
margin-top: 20px;
|
||||
@ -80,48 +53,6 @@ iframe.pdf-view {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#childLinks.grid ul {
|
||||
list-style-type: none;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#childLinks.grid ul li {
|
||||
width: 180px;
|
||||
height: 140px;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
#childLinks.grid ul li a {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 5px;
|
||||
justify-content: center;
|
||||
align-content: center;
|
||||
text-align: center;
|
||||
font-size: large;
|
||||
}
|
||||
|
||||
#childLinks.grid ul li a:hover {
|
||||
background: #eee;
|
||||
}
|
||||
|
||||
#childLinks.list ul {
|
||||
list-style-type: none;
|
||||
display: inline-flex;
|
||||
flex-wrap: wrap;
|
||||
padding: 0;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
#childLinks.list ul li {
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
#noteClippedFrom {
|
||||
padding: 10px 0 10px 0;
|
||||
margin: 20px 0 20px 0;
|
56
packages/share-theme/src/styles/childlinks.css
Normal file
56
packages/share-theme/src/styles/childlinks.css
Normal file
@ -0,0 +1,56 @@
|
||||
#childLinks,
|
||||
#childLinks ul,
|
||||
#childLinks li {
|
||||
list-style: none;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
#childLinks {
|
||||
padding-top: 10px;
|
||||
flex-direction: column;
|
||||
gap: 0px;
|
||||
justify-content: center;
|
||||
border-top: 1px solid var(--background-highlight);
|
||||
}
|
||||
|
||||
.no-content + #childLinks {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
#childLinks ul {
|
||||
padding: 0;
|
||||
gap: 10px;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
#childLinks li {
|
||||
padding: 0;
|
||||
background: var(--background-highlight);
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
#childLinks li a {
|
||||
padding: 2px 12px;
|
||||
background: var(--background-highlight);
|
||||
border-radius: 12px;
|
||||
transform: translateY(0);
|
||||
transition: transform 200ms ease, background-color 200ms ease, color 200ms ease;
|
||||
}
|
||||
|
||||
#childLinks li a:hover {
|
||||
background: var(--background-active);
|
||||
color: var(--background-secondary);
|
||||
text-decoration: none;
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
#childLinks.grid li a {
|
||||
padding: 50px;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
#childLinks.grid li a:hover {
|
||||
transform: translateY(-5px);
|
||||
}
|
70
packages/share-theme/src/styles/content-footer.css
Normal file
70
packages/share-theme/src/styles/content-footer.css
Normal file
@ -0,0 +1,70 @@
|
||||
#content-footer .navigation {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2,1fr);
|
||||
gap: 1rem;
|
||||
margin-top: 3rem;
|
||||
}
|
||||
|
||||
#content-footer .navigation a {
|
||||
border-radius: 3px;
|
||||
border: 2px solid #ffffff0d;
|
||||
color: var(--text-primary);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
overflow: hidden;
|
||||
padding: 8px 12px;
|
||||
user-select: none;
|
||||
transform: translateY(0);
|
||||
transition: transform 200ms ease, background-color 200ms ease, color 200ms ease;
|
||||
}
|
||||
|
||||
#content-footer .navigation a:hover {
|
||||
background: var(--background-active);
|
||||
color: var(--background-secondary);
|
||||
text-decoration: none;
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
#content-footer .navigation a.previous {
|
||||
justify-self: flex-start;
|
||||
}
|
||||
|
||||
#content-footer .navigation a.next {
|
||||
justify-self: flex-end;
|
||||
grid-column: 2/3;
|
||||
}
|
||||
|
||||
#content-footer .navigation a.previous::before {
|
||||
content: "« ";
|
||||
}
|
||||
|
||||
#content-footer .navigation a.next::after {
|
||||
content: " »";
|
||||
}
|
||||
|
||||
#content-footer .navigation + #childLinks {
|
||||
margin-top: 3rem;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#content-footer {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-top: 3rem;
|
||||
}
|
||||
|
||||
#content-footer .updated {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 5px;
|
||||
font-style: italic;
|
||||
font-size: smaller;
|
||||
}
|
||||
|
||||
#content-footer .updated time {
|
||||
font-weight: bold;
|
||||
|
||||
}
|
42
packages/share-theme/src/styles/content.css
Normal file
42
packages/share-theme/src/styles/content.css
Normal file
@ -0,0 +1,42 @@
|
||||
.ck-content code,
|
||||
.ck-content pre {
|
||||
color: var(--text-primary);
|
||||
background-color: var(--background-secondary);
|
||||
border: 1px solid var(--background-active);
|
||||
border-radius: 6px;
|
||||
white-space: pre;
|
||||
}
|
||||
|
||||
.ck-content code {
|
||||
padding: 2px 5px;
|
||||
}
|
||||
|
||||
.ck-content pre code {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.ck-content pre {
|
||||
overflow: auto;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.ck-content pre .copy-button {
|
||||
position: absolute;
|
||||
top: 0.5em;
|
||||
right: 0.5em;
|
||||
}
|
||||
|
||||
#content h1,
|
||||
#content h2,
|
||||
#content h3,
|
||||
#content h4,
|
||||
#content h5,
|
||||
#content h6 {
|
||||
color: var(--text-heading);
|
||||
border-bottom: 1px solid var(--background-highlight);
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
|
||||
#content img {
|
||||
max-width: 100%;
|
||||
}
|
19
packages/share-theme/src/styles/externallinks.css
Normal file
19
packages/share-theme/src/styles/externallinks.css
Normal file
@ -0,0 +1,19 @@
|
||||
a[href^="https://"] {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
#content a[href^="https://"] {
|
||||
padding-right: 6px;
|
||||
}
|
||||
|
||||
a[href^="https://"]::after {
|
||||
content: "";
|
||||
background-color: currentcolor;
|
||||
mask: url("data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"13.5\" height=\"13.5\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z\"></path></svg>");
|
||||
-webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"13.5\" height=\"13.5\" viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z\"></path></svg>");
|
||||
width: 13.5px;
|
||||
height: 13.5px;
|
||||
display: inline-flex;
|
||||
}
|
81
packages/share-theme/src/styles/index.css
Normal file
81
packages/share-theme/src/styles/index.css
Normal file
@ -0,0 +1,81 @@
|
||||
@import "./base.css";
|
||||
@import "./childlinks.css";
|
||||
@import "./externallinks.css";
|
||||
@import "./toc.css";
|
||||
|
||||
@import "./navbar/index.css";
|
||||
@import "./popouts/index.css";
|
||||
|
||||
@import "./layout.css";
|
||||
@import "./content.css";
|
||||
@import "./content-footer.css";
|
||||
|
||||
@import "./mobile.css";
|
||||
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/*
|
||||
Accent Color Ideas
|
||||
--text-link: #4693C3;
|
||||
--text-link: #F9B273;
|
||||
--text-link: #5CA9BF;
|
||||
--text-link: #E43F66;
|
||||
--text-link: #2FB8D1;
|
||||
--text-link: #A78BFA;
|
||||
--text-link: #F2B049;
|
||||
--text-link: #E47B19;
|
||||
--text-link: #FFB628;
|
||||
*/
|
||||
|
||||
:root {
|
||||
--background-primary: #333333;
|
||||
--background-secondary: #1F1F1F;
|
||||
--background-highlight: #484848;
|
||||
--background-active: #777777;
|
||||
--text-primary: #cccccc;
|
||||
--text-heading: #cccccc;
|
||||
--text-menu: #AAAAAA;
|
||||
--text-link: #87CEFA;
|
||||
--text-menu-active: #000000;
|
||||
color-scheme: dark;
|
||||
}
|
||||
|
||||
body.theme-light {
|
||||
--background-primary: #FFFFFF;
|
||||
--background-secondary: #F3F3F3;
|
||||
--background-highlight: #DDDDDD;
|
||||
--background-active: #777777;
|
||||
--text-primary: #000000;
|
||||
--text-heading: #000000;
|
||||
--text-menu: #333333;
|
||||
--text-link: #0000ff;
|
||||
color-scheme: light;
|
||||
}
|
||||
|
||||
body {
|
||||
background: var(--background-primary);
|
||||
font-family: 'Montserrat', 'Lucida Grande', 'Lucida Sans Unicode', arial, sans-serif;
|
||||
line-height: 1.5;
|
||||
color: var(--text-primary);
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
a {
|
||||
color: var(--text-link);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
pre, code, kbd, samp {
|
||||
font-family: "JetBrains Mono", Consolas, monospace;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
32
packages/share-theme/src/styles/layout.css
Normal file
32
packages/share-theme/src/styles/layout.css
Normal file
@ -0,0 +1,32 @@
|
||||
#split-pane {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
gap: 50px;
|
||||
}
|
||||
|
||||
#left-pane {
|
||||
display: flex;
|
||||
width: calc((100vw - 900px) / 2);
|
||||
min-width: fit-content;
|
||||
height: calc(100vh);
|
||||
background: var(--background-secondary);
|
||||
border-right: 5px solid var(--background-highlight);
|
||||
justify-content: flex-end;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
#right-pane {
|
||||
display: flex;
|
||||
margin: 0 auto;
|
||||
gap: 40px;
|
||||
flex: 1;
|
||||
padding-right: 50px;
|
||||
}
|
||||
|
||||
#main {
|
||||
order: 2;
|
||||
max-width: 900px;
|
||||
flex: 1;
|
||||
}
|
95
packages/share-theme/src/styles/mobile.css
Normal file
95
packages/share-theme/src/styles/mobile.css
Normal file
@ -0,0 +1,95 @@
|
||||
#mobile-header {
|
||||
display: none;
|
||||
background: var(--background-secondary);
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 6px 12px;
|
||||
}
|
||||
|
||||
#mobile-header a {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
}
|
||||
|
||||
#mobile-header a img {
|
||||
max-width: 32px;
|
||||
}
|
||||
|
||||
#mobile-header button {
|
||||
color: var(--text-menu);
|
||||
background: transparent;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
outline: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
border-radius: 6px;
|
||||
transform: rotate(0);
|
||||
transition: background-color 200ms ease, transform 200ms ease;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@media (max-width: 48em) {
|
||||
|
||||
#right-pane, #main {
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#main {
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
|
||||
#mobile-header {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
#mobile-header button svg {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
#left-pane {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: auto;
|
||||
transform: translateX(-100%);
|
||||
transition: transform 200ms ease;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.menu-open #left-pane {
|
||||
transform: translateX(0);
|
||||
}
|
||||
|
||||
body::before {
|
||||
content: "";
|
||||
display: block;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background: rgba(0,0,0,0);
|
||||
pointer-events: none;
|
||||
transition: background-color 200ms ease;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
body.menu-open::before {
|
||||
background: rgba(0,0,0, 0.6);
|
||||
}
|
||||
|
||||
|
||||
body.menu-open #show-menu-button {
|
||||
background: var(--background-highlight);
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
}
|
149
packages/share-theme/src/styles/navbar/header.css
Normal file
149
packages/share-theme/src/styles/navbar/header.css
Normal file
@ -0,0 +1,149 @@
|
||||
#site-header {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
#site-header > a {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
|
||||
/* The switch - the box around the slider */
|
||||
.switch {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: 60px;
|
||||
height: 27px; /* 32 */
|
||||
}
|
||||
|
||||
/* Hide default HTML checkbox */
|
||||
.switch input {
|
||||
opacity: 0;
|
||||
width: 0;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
/* The slider */
|
||||
.slider {
|
||||
position: absolute;
|
||||
cursor: pointer;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: var(--text-primary);;
|
||||
transition: 0.4s;
|
||||
border-radius: 34px;
|
||||
}
|
||||
|
||||
.slider::before {
|
||||
position: absolute;
|
||||
content: "";
|
||||
height: 19px; /* 26px */
|
||||
width: 19px;
|
||||
left: 4px;
|
||||
bottom: 4px;
|
||||
background-color: white;
|
||||
transition: 0.4s;
|
||||
border-radius: 50%;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
input:checked + .slider {
|
||||
background-color: var(--background-highlight);
|
||||
}
|
||||
|
||||
input:focus + .slider {
|
||||
box-shadow: 0 0 1px var(--background-highlight);
|
||||
}
|
||||
|
||||
input:checked + .slider:before {
|
||||
transform: translateX(33px); /* whole width - slider width - 8px padding*/
|
||||
}
|
||||
|
||||
|
||||
.theme-selection {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.theme-selection.no-transition .slider,
|
||||
.theme-selection.no-transition .slider::before,
|
||||
.theme-selection.no-transition .dark-icon,
|
||||
.theme-selection.no-transition .light-icon {
|
||||
transition: none!important;
|
||||
}
|
||||
|
||||
|
||||
.theme-selection label {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.dark-icon, .light-icon {
|
||||
display: flex;
|
||||
opacity: 0;
|
||||
transition: opacity 400ms ease, color 400ms ease;
|
||||
pointer-events: none;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
height: 100%;
|
||||
width: 24px;
|
||||
}
|
||||
|
||||
/* input ~ .dark-icon {
|
||||
display: none;
|
||||
} */
|
||||
|
||||
input:not(:checked) ~ .light-icon {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
input:checked ~ .dark-icon {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
/* input:checked ~ .light-icon {
|
||||
display: none;
|
||||
} */
|
||||
|
||||
|
||||
.dark-icon {
|
||||
left: 5px;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.light-icon {
|
||||
right: 5px;
|
||||
color: var(--background-highlight);
|
||||
}
|
||||
|
||||
|
||||
.search-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.search-input {
|
||||
color: var(--text-primary);
|
||||
background: var(--background-highlight);
|
||||
outline: 0;
|
||||
border: 0;
|
||||
flex: 1;
|
||||
padding: 5px 5px 5px 32px;
|
||||
width: 200px;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.search-icon {
|
||||
display: flex;
|
||||
color: var(--text-primary);
|
||||
position: absolute;
|
||||
width: 20px;
|
||||
left: 5px;
|
||||
}
|
2
packages/share-theme/src/styles/navbar/index.css
Normal file
2
packages/share-theme/src/styles/navbar/index.css
Normal file
@ -0,0 +1,2 @@
|
||||
@import "./header.css";
|
||||
@import "./navbar.css";
|
148
packages/share-theme/src/styles/navbar/navbar.css
Normal file
148
packages/share-theme/src/styles/navbar/navbar.css
Normal file
@ -0,0 +1,148 @@
|
||||
#navigation {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 25px;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
#menu {
|
||||
order: 1;
|
||||
/* margin-left: auto; */
|
||||
|
||||
white-space: nowrap;
|
||||
|
||||
flex: 0;
|
||||
/* padding: 25px; */
|
||||
}
|
||||
|
||||
#menu > ul {
|
||||
overflow-y: auto;
|
||||
list-style: none;
|
||||
padding-left: 0!important;
|
||||
}
|
||||
|
||||
/* #menu > ul, #menu > div {
|
||||
width: fit-content;
|
||||
margin-left: auto;
|
||||
} */
|
||||
|
||||
#menu ul {
|
||||
overflow-y: hidden;
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
list-style: none;
|
||||
padding-left: 20px;
|
||||
}
|
||||
|
||||
#menu li {
|
||||
/* overflow-y: hidden; */
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
list-style: none;
|
||||
cursor: pointer;
|
||||
max-width: 350px;
|
||||
}
|
||||
|
||||
#menu li span {
|
||||
display: inline-block;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
#menu li .collapsible-label {
|
||||
display: flex;
|
||||
flex: 1
|
||||
}
|
||||
|
||||
#menu li > ul {
|
||||
transition: height 200ms ease;
|
||||
}
|
||||
|
||||
#menu li:not(.expanded) > ul {
|
||||
height: 0!important;
|
||||
/* transition: height 1000ms ease; */
|
||||
}
|
||||
|
||||
#menu li.expanded > ul {
|
||||
/* max-height: 500px; */
|
||||
}
|
||||
|
||||
#menu p {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
#menu li.item > a {
|
||||
padding-left: 24px;
|
||||
}
|
||||
|
||||
#menu a {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
gap: 5px;
|
||||
color: var(--text-menu);
|
||||
text-decoration: none;
|
||||
border-radius: 6px;
|
||||
border: 1px solid transparent;
|
||||
flex: 1;
|
||||
padding: 2px 6px;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
#menu a:hover {
|
||||
border-color: var(--text-menu);
|
||||
}
|
||||
|
||||
#menu a.active {
|
||||
background: var(--background-active);
|
||||
color: var(--background-secondary);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
#menu li ul {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#menu li ul::before {
|
||||
content: "";
|
||||
display: flex;
|
||||
position: absolute;
|
||||
top: 5px;
|
||||
bottom: 5px;
|
||||
left: 10px;
|
||||
width: 2px;
|
||||
background: var(--background-highlight);
|
||||
}
|
||||
|
||||
.active .collapse-button {
|
||||
background: none;
|
||||
color: var(--background-secondary);
|
||||
}
|
||||
|
||||
|
||||
.collapse-button {
|
||||
cursor: pointer;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 0;
|
||||
background: var(--background-secondary);
|
||||
border: 0;
|
||||
color: var(--text-menu);
|
||||
/* position: absolute; */
|
||||
/* top: 2px; */
|
||||
/* left: -18px; */
|
||||
transform: rotate(-90deg);
|
||||
transition: transform 200ms ease;
|
||||
}
|
||||
|
||||
.expanded > .collapse-button,
|
||||
.expanded > a > .collapse-button {
|
||||
transform: rotate(0);
|
||||
}
|
||||
|
||||
.collapse-button svg {
|
||||
width: 14px;
|
||||
}
|
1
packages/share-theme/src/styles/popouts/index.css
Normal file
1
packages/share-theme/src/styles/popouts/index.css
Normal file
@ -0,0 +1 @@
|
||||
@import "./search.css";
|
34
packages/share-theme/src/styles/popouts/search.css
Normal file
34
packages/share-theme/src/styles/popouts/search.css
Normal file
@ -0,0 +1,34 @@
|
||||
.search-results {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
position: fixed;
|
||||
background: var(--background-highlight);
|
||||
margin-top: 10px;
|
||||
border-radius: 12px;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
z-index: 5;
|
||||
}
|
||||
|
||||
.search-result-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 4px 12px;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.search-result-item:hover {
|
||||
cursor: pointer;
|
||||
background: var(--background-active);
|
||||
color: var(--text-menu-active);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.search-result-item:hover .search-result-note {
|
||||
color: var(--text-menu-active);
|
||||
}
|
||||
|
||||
.search-result-note {
|
||||
font-size: 12px;
|
||||
color: var(--text-menu);
|
||||
}
|
94
packages/share-theme/src/styles/toc.css
Normal file
94
packages/share-theme/src/styles/toc.css
Normal file
@ -0,0 +1,94 @@
|
||||
#toc-pane {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: fit-content;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
order: 3;
|
||||
/* padding: 16px 16px 16px 32px; */
|
||||
}
|
||||
|
||||
#toc-pane h3 {
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
#toc {
|
||||
position: relative;
|
||||
height: fit-content;
|
||||
margin: 0;
|
||||
border-radius: 6px;
|
||||
padding: 0 0 0 16px;
|
||||
max-width: 250px;
|
||||
}
|
||||
|
||||
#toc, #toc ul {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
#toc ul {
|
||||
padding-left: 16px;
|
||||
}
|
||||
|
||||
#toc span {
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
#toc li a {
|
||||
/* position: relative; */
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: var(--text-heading);
|
||||
transition: color 200ms ease;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
#toc li a:hover,
|
||||
#toc li a.active {
|
||||
color: var(--text-link);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#toc li a::before {
|
||||
content: "";
|
||||
display: flex;
|
||||
position: absolute;
|
||||
width: 2px;
|
||||
height: 16px;
|
||||
background: transparent;
|
||||
left: 0;
|
||||
transition: background-color 200ms ease;
|
||||
}
|
||||
|
||||
#toc li a.active::before {
|
||||
background: var(--text-link);
|
||||
}
|
||||
|
||||
#toc::before {
|
||||
content: "";
|
||||
display: block;
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
top: 4px;
|
||||
width: 2px;
|
||||
height: calc(100% - 8px);
|
||||
background: var(--background-highlight);
|
||||
}
|
||||
|
||||
#content h1 a.toc-anchor,
|
||||
#content h2 a.toc-anchor,
|
||||
#content h3 a.toc-anchor,
|
||||
#content h4 a.toc-anchor,
|
||||
#content h5 a.toc-anchor,
|
||||
#content h6 a.toc-anchor {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@media (max-width: 1200px) {
|
||||
#toc-pane {
|
||||
display: none;
|
||||
}
|
||||
}
|
209
packages/share-theme/src/templates/page.ejs
Normal file
209
packages/share-theme/src/templates/page.ejs
Normal file
@ -0,0 +1,209 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<% const hasTree = subRoot.note.hasVisibleChildren(); %>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<link rel="shortcut icon" href="<% if (note.hasRelation("shareFavicon")) { %>api/notes/<%= note.getRelation("shareFavicon").value %>/download<% } else { %>../favicon.ico<% } %>">
|
||||
<script src="<%= appPath %>/share.js" type="module"></script>
|
||||
<% if (!isDev && !note.isLabelTruthy("shareOmitDefaultCss")) { %>
|
||||
<link href="<%= assetPath %>/src/share.css" rel="stylesheet">
|
||||
<link href="<%= assetPath %>/src/boxicons.css" rel="stylesheet">
|
||||
<% } %>
|
||||
|
||||
<% for (const cssRelation of note.getRelations("shareCss")) { %>
|
||||
<link href="api/notes/<%= cssRelation.value %>/download" rel="stylesheet">
|
||||
<% } %>
|
||||
<% for (const jsRelation of note.getRelations("shareJs")) { %>
|
||||
<script type="module" src="api/notes/<%= jsRelation.value %>/download"></script>
|
||||
<% } %>
|
||||
<% if (note.hasLabel("shareDisallowRobotIndexing")) { %>
|
||||
<meta name="robots" content="noindex,follow" />
|
||||
<% } %>
|
||||
|
||||
<%
|
||||
const pageTitle = `${note.title}${note.noteId !== subRoot.note.noteId ? ` - ${subRoot.note.title}` : ""}`;
|
||||
|
||||
// Setup some key OpenGraph variables
|
||||
const openGraphColor = subRoot.note.getLabelValue("shareOpenGraphColor");
|
||||
const openGraphURL = subRoot.note.getLabelValue("shareOpenGraphURL");
|
||||
const openGraphDomain = subRoot.note.getLabelValue("shareOpenGraphDomain");
|
||||
let openGraphImage = subRoot.note.getLabelValue("shareOpenGraphImage");
|
||||
// Relation takes priority and requires some altering
|
||||
if (subRoot.note.hasRelation("shareOpenGraphImage")) {
|
||||
openGraphImage = `api/images/${subRoot.note.getRelation("shareOpenGraphImage").value}/image.png`;
|
||||
}
|
||||
%>
|
||||
<title><%= pageTitle %></title>
|
||||
<!-- HTML Meta Tags -->
|
||||
<meta name="description" content="<%= note.getLabelValue("shareDescription") %>">
|
||||
<!-- Facebook Meta Tags -->
|
||||
<meta property="og:url" content="<%= openGraphURL %>">
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:title" content="<%= pageTitle %>">
|
||||
<meta property="og:description" content="<%= note.getLabelValue("shareDescription") %>">
|
||||
<meta property="og:image" content="<%= openGraphImage %>">
|
||||
<!-- Twitter Meta Tags -->
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta property="twitter:domain" content="<%= openGraphDomain %>">
|
||||
<meta property="twitter:url" content="<%= openGraphURL %>">
|
||||
<meta name="twitter:title" content="<%= pageTitle %>">
|
||||
<meta name="twitter:description" content="<%= note.getLabelValue("shareDescription") %>">
|
||||
<meta name="twitter:image" content="<%= openGraphImage %>">
|
||||
<!-- Meta Tags Generated via https://opengraph.dev -->
|
||||
<meta name="theme-color" content="<%= openGraphColor %>">
|
||||
</head>
|
||||
<%
|
||||
const customLogoId = subRoot.note.getRelation("shareLogo")?.value;
|
||||
const logoUrl = customLogoId ? `api/images/${customLogoId}/image.png` : `../${assetUrlFragment}/images/icon-color.svg`;
|
||||
const logoWidth = subRoot.note.getLabelValue("shareLogoWidth") ?? 53;
|
||||
const logoHeight = subRoot.note.getLabelValue("shareLogoHeight") ?? 40;
|
||||
const mobileLogoHeight = logoHeight && logoWidth ? 32 / (logoWidth / logoHeight) : "";
|
||||
const shareRootLink = subRoot.note.hasLabel("shareRootLink") ? subRoot.note.getLabelValue("shareRootLink") : `./${subRoot.note.noteId}`;
|
||||
const currentTheme = note.getLabel("shareTheme") === "light" ? "light" : "dark";
|
||||
const themeClass = currentTheme === "light" ? " theme-light" : " theme-dark";
|
||||
const headingRe = /(<h[1-6]>)(.+?)(<\/h[1-6]>)/g;
|
||||
const headingMatches = [...content.matchAll(headingRe)];
|
||||
const slugify = (text) => text.toLowerCase().replace(/[^\w]/g, "-");
|
||||
content = content.replaceAll(headingRe, (...match) => {
|
||||
match[0] = match[0].replace(match[3], `<a id="${slugify(match[2])}" class="toc-anchor" name="${slugify(match[2])}" href="#${slugify(match[2])}">#</a>${match[3]}`);
|
||||
return match[0];
|
||||
});
|
||||
%>
|
||||
<body data-note-id="<%= note.noteId %>" class="type-<%= note.type %><%= themeClass %>" data-ancestor-note-id="<%= subRoot.note.noteId %>">
|
||||
<div id="mobile-header">
|
||||
<a href="<%= shareRootLink %>">
|
||||
<img src="<%= logoUrl %>" width="32" height="<%= mobileLogoHeight %>" alt="Logo" />
|
||||
<%= subRoot.note.title %>
|
||||
</a>
|
||||
<button aria-label="Show Mobile Menu" id="show-menu-button"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path d="M4 6h16v2H4zm0 5h16v2H4zm0 5h16v2H4z"></path></svg></button>
|
||||
</div>
|
||||
<div id="split-pane">
|
||||
<div id="left-pane">
|
||||
<div id="navigation">
|
||||
<div id="site-header">
|
||||
<a href="<%= shareRootLink %>">
|
||||
<img src="<%= logoUrl %>" width="<%= logoWidth %>" height="<%= logoHeight %>" alt="Logo" />
|
||||
<%= subRoot.note.title %>
|
||||
</a>
|
||||
<div class="theme-selection">
|
||||
<span id="sitetheme"><%= t("share_theme.site-theme") %></span>
|
||||
<label class="switch">
|
||||
<input type="checkbox" checked="<%= currentTheme === "dark" %>" aria-labelledby="sitetheme">
|
||||
<span class="slider"></span>
|
||||
<svg class="dark-icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path d="M20.742 13.045a8.088 8.088 0 0 1-2.077.271c-2.135 0-4.14-.83-5.646-2.336a8.025 8.025 0 0 1-2.064-7.723A1 1 0 0 0 9.73 2.034a10.014 10.014 0 0 0-4.489 2.582c-3.898 3.898-3.898 10.243 0 14.143a9.937 9.937 0 0 0 7.072 2.93 9.93 9.93 0 0 0 7.07-2.929 10.007 10.007 0 0 0 2.583-4.491 1.001 1.001 0 0 0-1.224-1.224zm-2.772 4.301a7.947 7.947 0 0 1-5.656 2.343 7.953 7.953 0 0 1-5.658-2.344c-3.118-3.119-3.118-8.195 0-11.314a7.923 7.923 0 0 1 2.06-1.483 10.027 10.027 0 0 0 2.89 7.848 9.972 9.972 0 0 0 7.848 2.891 8.036 8.036 0 0 1-1.484 2.059z"></path></svg>
|
||||
<svg class="light-icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path d="M6.993 12c0 2.761 2.246 5.007 5.007 5.007s5.007-2.246 5.007-5.007S14.761 6.993 12 6.993 6.993 9.239 6.993 12zM12 8.993c1.658 0 3.007 1.349 3.007 3.007S13.658 15.007 12 15.007 8.993 13.658 8.993 12 10.342 8.993 12 8.993zM10.998 19h2v3h-2zm0-17h2v3h-2zm-9 9h3v2h-3zm17 0h3v2h-3zM4.219 18.363l2.12-2.122 1.415 1.414-2.12 2.122zM16.24 6.344l2.122-2.122 1.414 1.414-2.122 2.122zM6.342 7.759 4.22 5.637l1.415-1.414 2.12 2.122zm13.434 10.605-1.414 1.414-2.122-2.122 1.414-1.414z"></path></svg>
|
||||
</label>
|
||||
</div>
|
||||
<% if (hasTree) { %>
|
||||
<div class="search-item">
|
||||
<svg class="search-icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path d="M10 18a7.952 7.952 0 0 0 4.897-1.688l4.396 4.396 1.414-1.414-4.396-4.396A7.952 7.952 0 0 0 18 10c0-4.411-3.589-8-8-8s-8 3.589-8 8 3.589 8 8 8zm0-14c3.309 0 6 2.691 6 6s-2.691 6-6 6-6-2.691-6-6 2.691-6 6-6z"></path></svg>
|
||||
<input type="text" class="search-input" placeholder="<%= t("share_theme.search_placeholder") %>">
|
||||
</div>
|
||||
<% } %>
|
||||
</div>
|
||||
<% if (hasTree) { %>
|
||||
<nav id="menu">
|
||||
<%
|
||||
const ancestors = [];
|
||||
let notePointer = note;
|
||||
while (notePointer.parents[0].noteId !== "_share") {
|
||||
const pointerParent = notePointer.parents[0];
|
||||
ancestors.push(pointerParent.noteId);
|
||||
notePointer = pointerParent;
|
||||
}
|
||||
%>
|
||||
<%- include("tree_item", {note: subRoot.note, activeNote: note, subRoot: subRoot, ancestors: ancestors}) %>
|
||||
</nav>
|
||||
<% } %>
|
||||
</div>
|
||||
</div>
|
||||
<div id="right-pane">
|
||||
<div id="main">
|
||||
|
||||
<div id="content" class="type-<%= note.type %><% if (note.type === "text") { %> ck-content<% } %><% if (isEmpty) { %> no-content<% } %>">
|
||||
<h1 id="title"><%= note.title %></h1>
|
||||
<% if (isEmpty && (!note.hasVisibleChildren() && note.type !== "book")) { %>
|
||||
<p>This note has no content.</p>
|
||||
<% } else { %>
|
||||
<%
|
||||
content = content.replace(/<img /g, `<img alt="${t("share_theme.image_alt")}" loading="lazy" `);
|
||||
%>
|
||||
<%- content %>
|
||||
<% } %>
|
||||
</div>
|
||||
|
||||
<% if (note.hasVisibleChildren() || note.type === "book") { %>
|
||||
<nav id="childLinks" class="<% if (isEmpty) { %>grid<% } else { %>list<% } %>">
|
||||
<% if (!isEmpty) { %>
|
||||
<span><%= t("share_theme.subpages") %></span>
|
||||
<% } %>
|
||||
|
||||
<ul>
|
||||
<%
|
||||
const action = note.type === "book" ? "getChildNotes" : "getVisibleChildNotes";
|
||||
for (const childNote of note[action]()) {
|
||||
const isExternalLink = childNote.hasLabel("shareExternal") || childNote.hasLabel("shareExternalLink");
|
||||
const linkHref = isExternalLink ? childNote.getLabelValue("shareExternal") ?? childNote.getLabelValue("shareExternalLink") : `./${childNote.shareId}`;
|
||||
const target = isExternalLink ? ` target="_blank" rel="noopener noreferrer"` : "";
|
||||
%>
|
||||
<li>
|
||||
<a class="type-<%= childNote.type %>" href="<%= linkHref %>"<%= target %>><%= childNote.title %></a>
|
||||
</li>
|
||||
<% } %>
|
||||
</ul>
|
||||
</nav>
|
||||
<% } %>
|
||||
|
||||
<footer id="content-footer">
|
||||
<% if (!isEmpty) { %>
|
||||
<div class="updated">
|
||||
<% const lastUpdated = new Date(note.utcDateModified); %>
|
||||
<%- t("share_theme.last-updated", { date: `<time datetime="${lastUpdated.toISOString()}">${lastUpdated.toLocaleDateString()}</time>`}) %>
|
||||
</div>
|
||||
<% } %>
|
||||
|
||||
<% if (hasTree) { %>
|
||||
<%- include("prev_next", { note: note, subRoot: subRoot }) %>
|
||||
<% } %>
|
||||
</footer>
|
||||
</div>
|
||||
<%
|
||||
if (headingMatches.length > 1) {
|
||||
const level = (m) => parseInt(m[1].replace(/[<h>]+/g, ""));
|
||||
|
||||
const toc = [
|
||||
{
|
||||
level: level(headingMatches[0]),
|
||||
name: headingMatches[0][2],
|
||||
children: []
|
||||
}
|
||||
];
|
||||
const last = (arr = toc) => arr[arr.length - 1];
|
||||
const makeEntry = (m) => ({level: level(m), name: m[2], children: []});
|
||||
const getLevelArr = (lvl, arr = toc) => {
|
||||
if (arr[0].level === lvl) return arr;
|
||||
const top = last(arr);
|
||||
return top.children.length ? getLevelArr(lvl, top.children) : top.children;
|
||||
};
|
||||
|
||||
|
||||
for (let m = 1; m < headingMatches.length; m++) {
|
||||
const target = getLevelArr(level(headingMatches[m]));
|
||||
target.push(makeEntry(headingMatches[m]));
|
||||
}
|
||||
%>
|
||||
<div id="toc-pane">
|
||||
<h3><%= t("share_theme.on-this-page") %></h3>
|
||||
<ul id="toc">
|
||||
<% for (const entry of toc) { %>
|
||||
<%- include("toc_item", {entry}) %>
|
||||
<% } %>
|
||||
</ul>
|
||||
</div>
|
||||
<% } %>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
58
packages/share-theme/src/templates/prev_next.ejs
Normal file
58
packages/share-theme/src/templates/prev_next.ejs
Normal file
@ -0,0 +1,58 @@
|
||||
<%
|
||||
// TODO: code cleanup + putting this behind a toggle/attribute
|
||||
const previousNote = (() => {
|
||||
// If we are at the subRoot, there is no previous
|
||||
if (note.noteId === subRoot.note.noteId) return null;
|
||||
|
||||
const parent = note.getParentNotes()[0];
|
||||
const children = parent.getChildNotes();
|
||||
const index = children.findIndex(n => n.noteId === note.noteId);
|
||||
|
||||
// If we are the first child, previous goes up a level
|
||||
// this is already protected by the first if statement
|
||||
if (index === 0) return parent;
|
||||
|
||||
// We are not the first child at this level so previous
|
||||
// should go to the end of the previous tree
|
||||
let candidate = children[index - 1];
|
||||
while (candidate.hasChildren()) {
|
||||
const children = candidate.getChildNotes();
|
||||
const lastChild = children[children.length - 1];
|
||||
candidate = lastChild;
|
||||
}
|
||||
|
||||
return candidate;
|
||||
})();
|
||||
|
||||
const nextNote = (() => {
|
||||
// If this currently active note has children, next
|
||||
// should be the first child
|
||||
if (note.hasChildren()) return note.getChildNotes()[0];
|
||||
|
||||
let parent = note.getParentNotes()[0];
|
||||
let children = parent.getChildNotes();
|
||||
let index = children.findIndex(n => n.noteId === note.noteId);
|
||||
|
||||
// If we are not the last of the current level, just go
|
||||
// to the next sibling note
|
||||
if (index !== children.length - 1) return children[index + 1];
|
||||
|
||||
// We are the last sibling, we need to find the next ancestral note
|
||||
while (index === children.length - 1) {
|
||||
// If we are already at subRoot level, no reason trying to go higher
|
||||
if (parent.noteId === subRoot.note.noteId) return null;
|
||||
|
||||
const originalParent = parent;
|
||||
parent = parent.getParentNotes()[0];
|
||||
children = parent.getChildNotes();
|
||||
index = children.findIndex(n => n.noteId === originalParent.noteId);
|
||||
}
|
||||
|
||||
return children[index + 1];
|
||||
})();
|
||||
%>
|
||||
|
||||
<div class="navigation">
|
||||
<% if (previousNote) { %><a class="previous" href="./<%- previousNote.shareId %>"><%- previousNote.title %></a><% } %>
|
||||
<% if (nextNote) { %><a class="next" href="./<%- nextNote.shareId %>"><%- nextNote.title %></a><% } %>
|
||||
</div>
|
19
packages/share-theme/src/templates/toc_item.ejs
Normal file
19
packages/share-theme/src/templates/toc_item.ejs
Normal file
@ -0,0 +1,19 @@
|
||||
<%
|
||||
const slugify = (text) => text.toLowerCase().replace(/[^\w]/g, "-");
|
||||
const slug = slugify(entry.name);
|
||||
%>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#<%= slug %>">
|
||||
<span><%= entry.name %></span>
|
||||
</a>
|
||||
|
||||
<% if (entry.children.length) { %>
|
||||
<ul>
|
||||
<% for (const subentry of entry.children) { %>
|
||||
<%- include('toc_item', {entry: subentry}) %>
|
||||
<% } %>
|
||||
</ul>
|
||||
<% } %>
|
||||
</li>
|
29
packages/share-theme/src/templates/tree_item.ejs
Normal file
29
packages/share-theme/src/templates/tree_item.ejs
Normal file
@ -0,0 +1,29 @@
|
||||
<%
|
||||
const linkClass = `type-${note.type}` + (activeNote.noteId === note.noteId ? " active" : "");
|
||||
const isExternalLink = note.hasLabel("shareExternal");
|
||||
const linkHref = isExternalLink ? note.getLabelValue("shareExternal") : `./${note.shareId}`;
|
||||
const target = isExternalLink ? ` target="_blank" rel="noopener noreferrer"` : "";
|
||||
%>
|
||||
|
||||
<% if (note.noteId !== subRoot.note.noteId) { %>
|
||||
<a class="<%= linkClass %>" href="<%= linkHref %>"<%= target %>>
|
||||
<% if (note.hasVisibleChildren()) { %><button class="collapse-button" aria-label="<%= t("share_theme.expand") %>"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svg-icon right-triangle"><path d="M3 8L12 17L21 8"></path></svg></button><% } %>
|
||||
<span><i class="<%= note.getIcon() %>"></i> <%= note.title %></span>
|
||||
</a>
|
||||
<% } %>
|
||||
|
||||
|
||||
<% if (note.hasVisibleChildren()) { %>
|
||||
<ul>
|
||||
<% note.getVisibleChildNotes().forEach(function (childNote) { %>
|
||||
<%
|
||||
const hasChildren = childNote.hasVisibleChildren();
|
||||
const isAncestorOfActive = ancestors.some(p => p === childNote.noteId);
|
||||
const expandedClass = childNote.noteId === activeNote.noteId || isAncestorOfActive ? " expanded" : "";
|
||||
%>
|
||||
<li class="<% if (hasChildren) { %>submenu-<% } %>item<%= expandedClass %>">
|
||||
<%- include('tree_item', {note: childNote, subRoot: subRoot}) %>
|
||||
</li>
|
||||
<% }) %>
|
||||
</ul>
|
||||
<% } %>
|
8
packages/share-theme/tsconfig.eslint.json
Normal file
8
packages/share-theme/tsconfig.eslint.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"rootDir": ".",
|
||||
"noEmit": true
|
||||
},
|
||||
"include": ["src/**/*", "scripts/*"],
|
||||
}
|
16
packages/share-theme/tsconfig.json
Normal file
16
packages/share-theme/tsconfig.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"esModuleInterop": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"resolveJsonModule": true,
|
||||
"strictNullChecks": true,
|
||||
"moduleResolution": "Node16",
|
||||
"target": "ES2022",
|
||||
"rootDir": "src",
|
||||
"module": "Node16"
|
||||
},
|
||||
"include": ["src/**/*"]
|
||||
}
|
347
pnpm-lock.yaml
generated
347
pnpm-lock.yaml
generated
@ -198,6 +198,9 @@ importers:
|
||||
'@triliumnext/highlightjs':
|
||||
specifier: workspace:*
|
||||
version: link:../../packages/highlightjs
|
||||
'@triliumnext/share-theme':
|
||||
specifier: workspace:*
|
||||
version: link:../../packages/share-theme
|
||||
autocomplete.js:
|
||||
specifier: 0.38.1
|
||||
version: 0.38.1
|
||||
@ -1274,6 +1277,36 @@ importers:
|
||||
specifier: 1.2.0
|
||||
version: 1.2.0
|
||||
|
||||
packages/share-theme:
|
||||
devDependencies:
|
||||
'@digitak/esrun':
|
||||
specifier: ^3.2.24
|
||||
version: 3.2.26
|
||||
'@types/swagger-ui':
|
||||
specifier: ^3.52.0
|
||||
version: 3.52.4
|
||||
'@typescript-eslint/eslint-plugin':
|
||||
specifier: ^6.7.2
|
||||
version: 6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@5.8.3))(eslint@8.57.1)(typescript@5.8.3)
|
||||
'@typescript-eslint/parser':
|
||||
specifier: ^6.7.2
|
||||
version: 6.21.0(eslint@8.57.1)(typescript@5.8.3)
|
||||
dotenv:
|
||||
specifier: ^16.3.1
|
||||
version: 16.5.0
|
||||
esbuild:
|
||||
specifier: '>=0.25.0'
|
||||
version: 0.25.5
|
||||
eslint:
|
||||
specifier: ^8.49.0
|
||||
version: 8.57.1
|
||||
highlight.js:
|
||||
specifier: ^11.8.0
|
||||
version: 11.11.1
|
||||
typescript:
|
||||
specifier: ^5.2.2
|
||||
version: 5.8.3
|
||||
|
||||
packages/turndown-plugin-gfm:
|
||||
devDependencies:
|
||||
turndown:
|
||||
@ -2285,6 +2318,14 @@ packages:
|
||||
peerDependencies:
|
||||
postcss-selector-parser: ^7.0.0
|
||||
|
||||
'@digitak/esrun@3.2.26':
|
||||
resolution: {integrity: sha512-mL0bw7NhKVghp7mVsPwnAMhCn4NGAsk0KKFmAfnrYAZ/QCXR5xLXIYP82zLMjcsQag8DD6i1c+Yrm/57StYVzg==}
|
||||
engines: {node: '>=14.0'}
|
||||
hasBin: true
|
||||
|
||||
'@digitak/grubber@3.1.4':
|
||||
resolution: {integrity: sha512-pqsnp2BUYlDoTXWG34HWgEJse/Eo1okRgNex8IG84wHrJp8h3SakeR5WhB4VxSA2+/D+frNYJ0ch3yXzsfNDoA==}
|
||||
|
||||
'@dual-bundle/import-meta-resolve@4.1.0':
|
||||
resolution: {integrity: sha512-+nxncfwHM5SgAtrVzgpzJOI1ol0PkumhVo469KCf9lUi21IGcY90G98VuHm9VRrUypmAzawAHO9bs6hqeADaVg==}
|
||||
|
||||
@ -2611,10 +2652,18 @@ packages:
|
||||
resolution: {integrity: sha512-qIbV0/JZr7iSDjqAc60IqbLdsj9GDt16xQtWD+B78d/HAlvysGdZZ6rpJHGAc2T0FQx1X6thsSPdnoiGKdNtdg==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
|
||||
'@eslint/eslintrc@2.1.4':
|
||||
resolution: {integrity: sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==}
|
||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
||||
|
||||
'@eslint/eslintrc@3.3.1':
|
||||
resolution: {integrity: sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
|
||||
'@eslint/js@8.57.1':
|
||||
resolution: {integrity: sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==}
|
||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
||||
|
||||
'@eslint/js@9.28.0':
|
||||
resolution: {integrity: sha512-fnqSjGWd/CoIp4EXIxWVK/sHA6DOHN4+8Ix2cX5ycOY7LG0UY8nHCU5pIp2eaE1Mc7Qd8kHspYNzYXT2ojPLzg==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
@ -2896,10 +2945,19 @@ packages:
|
||||
resolution: {integrity: sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==}
|
||||
engines: {node: '>=18.18.0'}
|
||||
|
||||
'@humanwhocodes/config-array@0.13.0':
|
||||
resolution: {integrity: sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==}
|
||||
engines: {node: '>=10.10.0'}
|
||||
deprecated: Use @eslint/config-array instead
|
||||
|
||||
'@humanwhocodes/module-importer@1.0.1':
|
||||
resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==}
|
||||
engines: {node: '>=12.22'}
|
||||
|
||||
'@humanwhocodes/object-schema@2.0.3':
|
||||
resolution: {integrity: sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==}
|
||||
deprecated: Use @eslint/object-schema instead
|
||||
|
||||
'@humanwhocodes/retry@0.3.1':
|
||||
resolution: {integrity: sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==}
|
||||
engines: {node: '>=18.18'}
|
||||
@ -4687,6 +4745,9 @@ packages:
|
||||
'@types/sax@1.2.7':
|
||||
resolution: {integrity: sha512-rO73L89PJxeYM3s3pPPjiPgVVcymqU490g0YO5n5By0k2Erzj6tay/4lr1CHAAU4JyOWd1rpQ8bCf6cZfHU96A==}
|
||||
|
||||
'@types/semver@7.7.0':
|
||||
resolution: {integrity: sha512-k107IF4+Xr7UHjwDc7Cfd6PRQfbdkiRabXGRjo07b4WyPahFBZCZ1sE+BNxYIJPPg73UkfOsVOLwqVc/6ETrIA==}
|
||||
|
||||
'@types/send@0.17.4':
|
||||
resolution: {integrity: sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==}
|
||||
|
||||
@ -4732,6 +4793,9 @@ packages:
|
||||
'@types/swagger-ui-express@4.1.8':
|
||||
resolution: {integrity: sha512-AhZV8/EIreHFmBV5wAs0gzJUNq9JbbSXgJLQubCC0jtIo6prnI9MIRRxnU4MZX9RB9yXxF1V4R7jtLl/Wcj31g==}
|
||||
|
||||
'@types/swagger-ui@3.52.4':
|
||||
resolution: {integrity: sha512-7NV7q8BfupqdQxr26OkM0g0YEPB9uXnKGzXadgcearvI9MoCHt3F72lPTX3fZZIlrr21DC0IK26wcDMZ37oFDA==}
|
||||
|
||||
'@types/tmp@0.2.6':
|
||||
resolution: {integrity: sha512-chhaNf2oKHlRkDGt+tiKE2Z5aJ6qalm7Z9rlLdBwmOiAAf09YQvvoLXjWK4HWPF1xU/fqvMgfNfpVoBscA/tKA==}
|
||||
|
||||
@ -4765,6 +4829,17 @@ packages:
|
||||
'@types/yauzl@2.10.3':
|
||||
resolution: {integrity: sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==}
|
||||
|
||||
'@typescript-eslint/eslint-plugin@6.21.0':
|
||||
resolution: {integrity: sha512-oy9+hTPCUFpngkEZUSzbf9MxI65wbKFoQYsgPdILTfbUldp5ovUuphZVe4i30emU9M/kP+T64Di0mxl7dSw3MA==}
|
||||
engines: {node: ^16.0.0 || >=18.0.0}
|
||||
peerDependencies:
|
||||
'@typescript-eslint/parser': ^6.0.0 || ^6.0.0-alpha
|
||||
eslint: ^7.0.0 || ^8.0.0
|
||||
typescript: '*'
|
||||
peerDependenciesMeta:
|
||||
typescript:
|
||||
optional: true
|
||||
|
||||
'@typescript-eslint/eslint-plugin@8.34.0':
|
||||
resolution: {integrity: sha512-QXwAlHlbcAwNlEEMKQS2RCgJsgXrTJdjXT08xEgbPFa2yYQgVjBymxP5DrfrE7X7iodSzd9qBUHUycdyVJTW1w==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
@ -4773,6 +4848,16 @@ packages:
|
||||
eslint: ^8.57.0 || ^9.0.0
|
||||
typescript: '>=4.8.4 <5.9.0'
|
||||
|
||||
'@typescript-eslint/parser@6.21.0':
|
||||
resolution: {integrity: sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ==}
|
||||
engines: {node: ^16.0.0 || >=18.0.0}
|
||||
peerDependencies:
|
||||
eslint: ^7.0.0 || ^8.0.0
|
||||
typescript: '*'
|
||||
peerDependenciesMeta:
|
||||
typescript:
|
||||
optional: true
|
||||
|
||||
'@typescript-eslint/parser@8.33.1':
|
||||
resolution: {integrity: sha512-qwxv6dq682yVvgKKp2qWwLgRbscDAYktPptK4JPojCwwi3R9cwrvIxS4lvBpzmcqzR4bdn54Z0IG1uHFskW4dA==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
@ -4799,6 +4884,10 @@ packages:
|
||||
peerDependencies:
|
||||
typescript: '>=4.8.4 <5.9.0'
|
||||
|
||||
'@typescript-eslint/scope-manager@6.21.0':
|
||||
resolution: {integrity: sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==}
|
||||
engines: {node: ^16.0.0 || >=18.0.0}
|
||||
|
||||
'@typescript-eslint/scope-manager@8.33.1':
|
||||
resolution: {integrity: sha512-dM4UBtgmzHR9bS0Rv09JST0RcHYearoEoo3pG5B6GoTR9XcyeqX87FEhPo+5kTvVfKCvfHaHrcgeJQc6mrDKrA==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
@ -4819,6 +4908,16 @@ packages:
|
||||
peerDependencies:
|
||||
typescript: '>=4.8.4 <5.9.0'
|
||||
|
||||
'@typescript-eslint/type-utils@6.21.0':
|
||||
resolution: {integrity: sha512-rZQI7wHfao8qMX3Rd3xqeYSMCL3SoiSQLBATSiVKARdFGCYSRvmViieZjqc58jKgs8Y8i9YvVVhRbHSTA4VBag==}
|
||||
engines: {node: ^16.0.0 || >=18.0.0}
|
||||
peerDependencies:
|
||||
eslint: ^7.0.0 || ^8.0.0
|
||||
typescript: '*'
|
||||
peerDependenciesMeta:
|
||||
typescript:
|
||||
optional: true
|
||||
|
||||
'@typescript-eslint/type-utils@8.33.1':
|
||||
resolution: {integrity: sha512-1cG37d9xOkhlykom55WVwG2QRNC7YXlxMaMzqw2uPeJixBFfKWZgaP/hjAObqMN/u3fr5BrTwTnc31/L9jQ2ww==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
@ -4833,6 +4932,10 @@ packages:
|
||||
eslint: ^8.57.0 || ^9.0.0
|
||||
typescript: '>=4.8.4 <5.9.0'
|
||||
|
||||
'@typescript-eslint/types@6.21.0':
|
||||
resolution: {integrity: sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==}
|
||||
engines: {node: ^16.0.0 || >=18.0.0}
|
||||
|
||||
'@typescript-eslint/types@8.33.1':
|
||||
resolution: {integrity: sha512-xid1WfizGhy/TKMTwhtVOgalHwPtV8T32MS9MaH50Cwvz6x6YqRIPdD2WvW0XaqOzTV9p5xdLY0h/ZusU5Lokg==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
@ -4841,6 +4944,15 @@ packages:
|
||||
resolution: {integrity: sha512-9V24k/paICYPniajHfJ4cuAWETnt7Ssy+R0Rbcqo5sSFr3QEZ/8TSoUi9XeXVBGXCaLtwTOKSLGcInCAvyZeMA==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
|
||||
'@typescript-eslint/typescript-estree@6.21.0':
|
||||
resolution: {integrity: sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==}
|
||||
engines: {node: ^16.0.0 || >=18.0.0}
|
||||
peerDependencies:
|
||||
typescript: '*'
|
||||
peerDependenciesMeta:
|
||||
typescript:
|
||||
optional: true
|
||||
|
||||
'@typescript-eslint/typescript-estree@8.33.1':
|
||||
resolution: {integrity: sha512-+s9LYcT8LWjdYWu7IWs7FvUxpQ/DGkdjZeE/GGulHvv8rvYwQvVaUZ6DE+j5x/prADUgSbbCWZ2nPI3usuVeOA==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
@ -4853,6 +4965,12 @@ packages:
|
||||
peerDependencies:
|
||||
typescript: '>=4.8.4 <5.9.0'
|
||||
|
||||
'@typescript-eslint/utils@6.21.0':
|
||||
resolution: {integrity: sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==}
|
||||
engines: {node: ^16.0.0 || >=18.0.0}
|
||||
peerDependencies:
|
||||
eslint: ^7.0.0 || ^8.0.0
|
||||
|
||||
'@typescript-eslint/utils@8.33.1':
|
||||
resolution: {integrity: sha512-52HaBiEQUaRYqAXpfzWSR2U3gxk92Kw006+xZpElaPMg3C4PgM+A5LqwoQI1f9E5aZ/qlxAZxzm42WX+vn92SQ==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
@ -4867,6 +4985,10 @@ packages:
|
||||
eslint: ^8.57.0 || ^9.0.0
|
||||
typescript: '>=4.8.4 <5.9.0'
|
||||
|
||||
'@typescript-eslint/visitor-keys@6.21.0':
|
||||
resolution: {integrity: sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==}
|
||||
engines: {node: ^16.0.0 || >=18.0.0}
|
||||
|
||||
'@typescript-eslint/visitor-keys@8.33.1':
|
||||
resolution: {integrity: sha512-3i8NrFcZeeDHJ+7ZUuDkGT+UHq+XoFGsymNK2jZCOHcfEzRQ0BdpRtdpSx/Iyf3MHLWIcLS0COuOPibKQboIiQ==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
@ -4875,6 +4997,9 @@ packages:
|
||||
resolution: {integrity: sha512-qHV7pW7E85A0x6qyrFn+O+q1k1p3tQCsqIZ1KZ5ESLXY57aTvUd3/a4rdPTeXisvhXn2VQG0VSKUqs8KHF2zcA==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
|
||||
'@ungap/structured-clone@1.3.0':
|
||||
resolution: {integrity: sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==}
|
||||
|
||||
'@vitest/browser@3.2.0':
|
||||
resolution: {integrity: sha512-sVpX5m53lX9/0ehAqkcTSQeJK1SVlTlvBrwE8rPQ2KJQgb/Iiorx+3y+VQdzIJ+CDqfG89bQEA5l1Z02VogDsA==}
|
||||
peerDependencies:
|
||||
@ -7113,6 +7238,10 @@ packages:
|
||||
resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==}
|
||||
engines: {node: '>=8.0.0'}
|
||||
|
||||
eslint-scope@7.2.2:
|
||||
resolution: {integrity: sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==}
|
||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
||||
|
||||
eslint-scope@8.3.0:
|
||||
resolution: {integrity: sha512-pUNxi75F8MJ/GdeKtVLSbYg4ZI34J6C0C7sbL4YOp2exGwen7ZsuBqKzUhXd0qMQ362yET3z+uPwKeg/0C2XCQ==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
@ -7125,6 +7254,12 @@ packages:
|
||||
resolution: {integrity: sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
|
||||
eslint@8.57.1:
|
||||
resolution: {integrity: sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==}
|
||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
||||
deprecated: This version is no longer supported. Please see https://eslint.org/version-support for other options.
|
||||
hasBin: true
|
||||
|
||||
eslint@9.28.0:
|
||||
resolution: {integrity: sha512-ocgh41VhRlf9+fVpe7QKzwLj9c92fDiqOj8Y3Sd4/ZmVA4Btx4PlUYPq4pp9JDyupkf1upbEXecxL2mwNV7jPQ==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
@ -7345,6 +7480,10 @@ packages:
|
||||
file-entry-cache@10.1.0:
|
||||
resolution: {integrity: sha512-Et/ex6smi3wOOB+n5mek+Grf7P2AxZR5ueqRUvAAn4qkyatXi3cUC1cuQXVkX0VlzBVsN4BkWJFmY/fYiRTdww==}
|
||||
|
||||
file-entry-cache@6.0.1:
|
||||
resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==}
|
||||
engines: {node: ^10.12.0 || >=12.0.0}
|
||||
|
||||
file-entry-cache@8.0.0:
|
||||
resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==}
|
||||
engines: {node: '>=16.0.0'}
|
||||
@ -7411,6 +7550,10 @@ packages:
|
||||
resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==}
|
||||
engines: {node: '>=10'}
|
||||
|
||||
flat-cache@3.2.0:
|
||||
resolution: {integrity: sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==}
|
||||
engines: {node: ^10.12.0 || >=12.0.0}
|
||||
|
||||
flat-cache@4.0.1:
|
||||
resolution: {integrity: sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==}
|
||||
engines: {node: '>=16'}
|
||||
@ -12032,6 +12175,9 @@ packages:
|
||||
text-decoder@1.2.3:
|
||||
resolution: {integrity: sha512-3/o9z3X0X0fTupwsYvR03pJ/DjWuqqrfwBgTQzdWDiQSm9KitAyz/9WqsT2JQW7KV2m+bC2ol/zqpW37NHxLaA==}
|
||||
|
||||
text-table@0.2.0:
|
||||
resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==}
|
||||
|
||||
thingies@1.21.0:
|
||||
resolution: {integrity: sha512-hsqsJsFMsV+aD4s3CWKk85ep/3I9XzYV/IXaSouJMYIoDlgyi11cBhsqYe9/geRfB0YIikBQg6raRaM+nIMP9g==}
|
||||
engines: {node: '>=10.18'}
|
||||
@ -12168,6 +12314,12 @@ packages:
|
||||
truncate-utf8-bytes@1.0.2:
|
||||
resolution: {integrity: sha512-95Pu1QXQvruGEhv62XCMO3Mm90GscOCClvrIUwCM0PYOXK3kaF3l3sIHxx71ThJfcbM2O5Au6SO3AWCSEfW4mQ==}
|
||||
|
||||
ts-api-utils@1.4.3:
|
||||
resolution: {integrity: sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw==}
|
||||
engines: {node: '>=16'}
|
||||
peerDependencies:
|
||||
typescript: '>=4.2.0'
|
||||
|
||||
ts-api-utils@2.1.0:
|
||||
resolution: {integrity: sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==}
|
||||
engines: {node: '>=18.12'}
|
||||
@ -14856,6 +15008,14 @@ snapshots:
|
||||
dependencies:
|
||||
postcss-selector-parser: 7.1.0
|
||||
|
||||
'@digitak/esrun@3.2.26':
|
||||
dependencies:
|
||||
'@digitak/grubber': 3.1.4
|
||||
chokidar: 3.6.0
|
||||
esbuild: 0.25.5
|
||||
|
||||
'@digitak/grubber@3.1.4': {}
|
||||
|
||||
'@dual-bundle/import-meta-resolve@4.1.0': {}
|
||||
|
||||
'@electron-forge/cli@7.8.1(encoding@0.1.13)':
|
||||
@ -15341,6 +15501,11 @@ snapshots:
|
||||
'@esbuild/win32-x64@0.25.5':
|
||||
optional: true
|
||||
|
||||
'@eslint-community/eslint-utils@4.7.0(eslint@8.57.1)':
|
||||
dependencies:
|
||||
eslint: 8.57.1
|
||||
eslint-visitor-keys: 3.4.3
|
||||
|
||||
'@eslint-community/eslint-utils@4.7.0(eslint@9.28.0(jiti@2.4.2))':
|
||||
dependencies:
|
||||
eslint: 9.28.0(jiti@2.4.2)
|
||||
@ -15362,6 +15527,20 @@ snapshots:
|
||||
dependencies:
|
||||
'@types/json-schema': 7.0.15
|
||||
|
||||
'@eslint/eslintrc@2.1.4':
|
||||
dependencies:
|
||||
ajv: 6.12.6
|
||||
debug: 4.4.1(supports-color@6.0.0)
|
||||
espree: 9.6.1
|
||||
globals: 13.24.0
|
||||
ignore: 5.3.2
|
||||
import-fresh: 3.3.1
|
||||
js-yaml: 4.1.0
|
||||
minimatch: 3.1.2
|
||||
strip-json-comments: 3.1.1
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@eslint/eslintrc@3.3.1':
|
||||
dependencies:
|
||||
ajv: 6.12.6
|
||||
@ -15376,6 +15555,8 @@ snapshots:
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@eslint/js@8.57.1': {}
|
||||
|
||||
'@eslint/js@9.28.0': {}
|
||||
|
||||
'@eslint/object-schema@2.1.6': {}
|
||||
@ -15666,8 +15847,18 @@ snapshots:
|
||||
'@humanfs/core': 0.19.1
|
||||
'@humanwhocodes/retry': 0.3.1
|
||||
|
||||
'@humanwhocodes/config-array@0.13.0':
|
||||
dependencies:
|
||||
'@humanwhocodes/object-schema': 2.0.3
|
||||
debug: 4.4.1(supports-color@6.0.0)
|
||||
minimatch: 3.1.2
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@humanwhocodes/module-importer@1.0.1': {}
|
||||
|
||||
'@humanwhocodes/object-schema@2.0.3': {}
|
||||
|
||||
'@humanwhocodes/retry@0.3.1': {}
|
||||
|
||||
'@humanwhocodes/retry@0.4.3': {}
|
||||
@ -17852,6 +18043,8 @@ snapshots:
|
||||
dependencies:
|
||||
'@types/node': 22.15.21
|
||||
|
||||
'@types/semver@7.7.0': {}
|
||||
|
||||
'@types/send@0.17.4':
|
||||
dependencies:
|
||||
'@types/mime': 1.3.5
|
||||
@ -17915,6 +18108,8 @@ snapshots:
|
||||
'@types/express': 5.0.3
|
||||
'@types/serve-static': 1.15.8
|
||||
|
||||
'@types/swagger-ui@3.52.4': {}
|
||||
|
||||
'@types/tmp@0.2.6': {}
|
||||
|
||||
'@types/tough-cookie@4.0.5': {}
|
||||
@ -17947,6 +18142,26 @@ snapshots:
|
||||
'@types/node': 22.15.30
|
||||
optional: true
|
||||
|
||||
'@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@5.8.3))(eslint@8.57.1)(typescript@5.8.3)':
|
||||
dependencies:
|
||||
'@eslint-community/regexpp': 4.12.1
|
||||
'@typescript-eslint/parser': 6.21.0(eslint@8.57.1)(typescript@5.8.3)
|
||||
'@typescript-eslint/scope-manager': 6.21.0
|
||||
'@typescript-eslint/type-utils': 6.21.0(eslint@8.57.1)(typescript@5.8.3)
|
||||
'@typescript-eslint/utils': 6.21.0(eslint@8.57.1)(typescript@5.8.3)
|
||||
'@typescript-eslint/visitor-keys': 6.21.0
|
||||
debug: 4.4.1(supports-color@6.0.0)
|
||||
eslint: 8.57.1
|
||||
graphemer: 1.4.0
|
||||
ignore: 5.3.2
|
||||
natural-compare: 1.4.0
|
||||
semver: 7.7.2
|
||||
ts-api-utils: 1.4.3(typescript@5.8.3)
|
||||
optionalDependencies:
|
||||
typescript: 5.8.3
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@typescript-eslint/eslint-plugin@8.34.0(@typescript-eslint/parser@8.33.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3)':
|
||||
dependencies:
|
||||
'@eslint-community/regexpp': 4.12.1
|
||||
@ -17981,6 +18196,19 @@ snapshots:
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@typescript-eslint/parser@6.21.0(eslint@8.57.1)(typescript@5.8.3)':
|
||||
dependencies:
|
||||
'@typescript-eslint/scope-manager': 6.21.0
|
||||
'@typescript-eslint/types': 6.21.0
|
||||
'@typescript-eslint/typescript-estree': 6.21.0(typescript@5.8.3)
|
||||
'@typescript-eslint/visitor-keys': 6.21.0
|
||||
debug: 4.4.1(supports-color@6.0.0)
|
||||
eslint: 8.57.1
|
||||
optionalDependencies:
|
||||
typescript: 5.8.3
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@typescript-eslint/parser@8.33.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3)':
|
||||
dependencies:
|
||||
'@typescript-eslint/scope-manager': 8.33.1
|
||||
@ -18023,6 +18251,11 @@ snapshots:
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@typescript-eslint/scope-manager@6.21.0':
|
||||
dependencies:
|
||||
'@typescript-eslint/types': 6.21.0
|
||||
'@typescript-eslint/visitor-keys': 6.21.0
|
||||
|
||||
'@typescript-eslint/scope-manager@8.33.1':
|
||||
dependencies:
|
||||
'@typescript-eslint/types': 8.33.1
|
||||
@ -18041,6 +18274,18 @@ snapshots:
|
||||
dependencies:
|
||||
typescript: 5.8.3
|
||||
|
||||
'@typescript-eslint/type-utils@6.21.0(eslint@8.57.1)(typescript@5.8.3)':
|
||||
dependencies:
|
||||
'@typescript-eslint/typescript-estree': 6.21.0(typescript@5.8.3)
|
||||
'@typescript-eslint/utils': 6.21.0(eslint@8.57.1)(typescript@5.8.3)
|
||||
debug: 4.4.1(supports-color@6.0.0)
|
||||
eslint: 8.57.1
|
||||
ts-api-utils: 1.4.3(typescript@5.8.3)
|
||||
optionalDependencies:
|
||||
typescript: 5.8.3
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@typescript-eslint/type-utils@8.33.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3)':
|
||||
dependencies:
|
||||
'@typescript-eslint/typescript-estree': 8.33.1(typescript@5.8.3)
|
||||
@ -18063,10 +18308,27 @@ snapshots:
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@typescript-eslint/types@6.21.0': {}
|
||||
|
||||
'@typescript-eslint/types@8.33.1': {}
|
||||
|
||||
'@typescript-eslint/types@8.34.0': {}
|
||||
|
||||
'@typescript-eslint/typescript-estree@6.21.0(typescript@5.8.3)':
|
||||
dependencies:
|
||||
'@typescript-eslint/types': 6.21.0
|
||||
'@typescript-eslint/visitor-keys': 6.21.0
|
||||
debug: 4.4.1(supports-color@6.0.0)
|
||||
globby: 11.1.0
|
||||
is-glob: 4.0.3
|
||||
minimatch: 9.0.3
|
||||
semver: 7.7.2
|
||||
ts-api-utils: 1.4.3(typescript@5.8.3)
|
||||
optionalDependencies:
|
||||
typescript: 5.8.3
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@typescript-eslint/typescript-estree@8.33.1(typescript@5.8.3)':
|
||||
dependencies:
|
||||
'@typescript-eslint/project-service': 8.33.1(typescript@5.8.3)
|
||||
@ -18099,6 +18361,20 @@ snapshots:
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@typescript-eslint/utils@6.21.0(eslint@8.57.1)(typescript@5.8.3)':
|
||||
dependencies:
|
||||
'@eslint-community/eslint-utils': 4.7.0(eslint@8.57.1)
|
||||
'@types/json-schema': 7.0.15
|
||||
'@types/semver': 7.7.0
|
||||
'@typescript-eslint/scope-manager': 6.21.0
|
||||
'@typescript-eslint/types': 6.21.0
|
||||
'@typescript-eslint/typescript-estree': 6.21.0(typescript@5.8.3)
|
||||
eslint: 8.57.1
|
||||
semver: 7.7.2
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
- typescript
|
||||
|
||||
'@typescript-eslint/utils@8.33.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3)':
|
||||
dependencies:
|
||||
'@eslint-community/eslint-utils': 4.7.0(eslint@9.28.0(jiti@2.4.2))
|
||||
@ -18121,6 +18397,11 @@ snapshots:
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@typescript-eslint/visitor-keys@6.21.0':
|
||||
dependencies:
|
||||
'@typescript-eslint/types': 6.21.0
|
||||
eslint-visitor-keys: 3.4.3
|
||||
|
||||
'@typescript-eslint/visitor-keys@8.33.1':
|
||||
dependencies:
|
||||
'@typescript-eslint/types': 8.33.1
|
||||
@ -18131,6 +18412,8 @@ snapshots:
|
||||
'@typescript-eslint/types': 8.34.0
|
||||
eslint-visitor-keys: 4.2.0
|
||||
|
||||
'@ungap/structured-clone@1.3.0': {}
|
||||
|
||||
'@vitest/browser@3.2.0(bufferutil@4.0.9)(msw@2.7.5(@types/node@22.15.30)(typescript@5.8.3))(playwright@1.52.0)(utf-8-validate@6.0.5)(vite@6.3.5(@types/node@22.15.30)(jiti@2.4.2)(less@4.1.3)(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0))(vitest@3.2.0)(webdriverio@9.15.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))':
|
||||
dependencies:
|
||||
'@testing-library/dom': 10.4.0
|
||||
@ -20920,6 +21203,11 @@ snapshots:
|
||||
esrecurse: 4.3.0
|
||||
estraverse: 4.3.0
|
||||
|
||||
eslint-scope@7.2.2:
|
||||
dependencies:
|
||||
esrecurse: 4.3.0
|
||||
estraverse: 5.3.0
|
||||
|
||||
eslint-scope@8.3.0:
|
||||
dependencies:
|
||||
esrecurse: 4.3.0
|
||||
@ -20929,6 +21217,49 @@ snapshots:
|
||||
|
||||
eslint-visitor-keys@4.2.0: {}
|
||||
|
||||
eslint@8.57.1:
|
||||
dependencies:
|
||||
'@eslint-community/eslint-utils': 4.7.0(eslint@8.57.1)
|
||||
'@eslint-community/regexpp': 4.12.1
|
||||
'@eslint/eslintrc': 2.1.4
|
||||
'@eslint/js': 8.57.1
|
||||
'@humanwhocodes/config-array': 0.13.0
|
||||
'@humanwhocodes/module-importer': 1.0.1
|
||||
'@nodelib/fs.walk': 1.2.8
|
||||
'@ungap/structured-clone': 1.3.0
|
||||
ajv: 6.12.6
|
||||
chalk: 4.1.2
|
||||
cross-spawn: 7.0.6
|
||||
debug: 4.4.1(supports-color@6.0.0)
|
||||
doctrine: 3.0.0
|
||||
escape-string-regexp: 4.0.0
|
||||
eslint-scope: 7.2.2
|
||||
eslint-visitor-keys: 3.4.3
|
||||
espree: 9.6.1
|
||||
esquery: 1.6.0
|
||||
esutils: 2.0.3
|
||||
fast-deep-equal: 3.1.3
|
||||
file-entry-cache: 6.0.1
|
||||
find-up: 5.0.0
|
||||
glob-parent: 6.0.2
|
||||
globals: 13.24.0
|
||||
graphemer: 1.4.0
|
||||
ignore: 5.3.2
|
||||
imurmurhash: 0.1.4
|
||||
is-glob: 4.0.3
|
||||
is-path-inside: 3.0.3
|
||||
js-yaml: 4.1.0
|
||||
json-stable-stringify-without-jsonify: 1.0.1
|
||||
levn: 0.4.1
|
||||
lodash.merge: 4.6.2
|
||||
minimatch: 3.1.2
|
||||
natural-compare: 1.4.0
|
||||
optionator: 0.9.4
|
||||
strip-ansi: 6.0.1
|
||||
text-table: 0.2.0
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
eslint@9.28.0(jiti@2.4.2):
|
||||
dependencies:
|
||||
'@eslint-community/eslint-utils': 4.7.0(eslint@9.28.0(jiti@2.4.2))
|
||||
@ -21247,6 +21578,10 @@ snapshots:
|
||||
dependencies:
|
||||
flat-cache: 6.1.9
|
||||
|
||||
file-entry-cache@6.0.1:
|
||||
dependencies:
|
||||
flat-cache: 3.2.0
|
||||
|
||||
file-entry-cache@8.0.0:
|
||||
dependencies:
|
||||
flat-cache: 4.0.1
|
||||
@ -21335,6 +21670,12 @@ snapshots:
|
||||
locate-path: 6.0.0
|
||||
path-exists: 4.0.0
|
||||
|
||||
flat-cache@3.2.0:
|
||||
dependencies:
|
||||
flatted: 3.3.3
|
||||
keyv: 4.5.4
|
||||
rimraf: 3.0.2
|
||||
|
||||
flat-cache@4.0.1:
|
||||
dependencies:
|
||||
flatted: 3.3.3
|
||||
@ -26797,6 +27138,8 @@ snapshots:
|
||||
dependencies:
|
||||
b4a: 1.6.7
|
||||
|
||||
text-table@0.2.0: {}
|
||||
|
||||
thingies@1.21.0(tslib@2.8.1):
|
||||
dependencies:
|
||||
tslib: 2.8.1
|
||||
@ -26919,6 +27262,10 @@ snapshots:
|
||||
dependencies:
|
||||
utf8-byte-length: 1.0.5
|
||||
|
||||
ts-api-utils@1.4.3(typescript@5.8.3):
|
||||
dependencies:
|
||||
typescript: 5.8.3
|
||||
|
||||
ts-api-utils@2.1.0(typescript@5.8.3):
|
||||
dependencies:
|
||||
typescript: 5.8.3
|
||||
|
@ -56,6 +56,9 @@
|
||||
},
|
||||
{
|
||||
"path": "./packages/highlightjs"
|
||||
},
|
||||
{
|
||||
"path": "./packages/share-theme"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user