markstream-svelte 0.0.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +77 -0
- package/dist/components/AdmonitionNode.svelte +8 -0
- package/dist/components/AdmonitionNode.svelte.d.ts +23 -0
- package/dist/components/AdmonitionNode.svelte.d.ts.map +1 -0
- package/dist/components/BlockquoteNode.svelte +10 -0
- package/dist/components/BlockquoteNode.svelte.d.ts +24 -0
- package/dist/components/BlockquoteNode.svelte.d.ts.map +1 -0
- package/dist/components/CheckboxNode.svelte +5 -0
- package/dist/components/CheckboxNode.svelte.d.ts +22 -0
- package/dist/components/CheckboxNode.svelte.d.ts.map +1 -0
- package/dist/components/CodeBlockNode.svelte +944 -0
- package/dist/components/CodeBlockNode.svelte.d.ts +43 -0
- package/dist/components/CodeBlockNode.svelte.d.ts.map +1 -0
- package/dist/components/D2BlockNode.svelte +272 -0
- package/dist/components/D2BlockNode.svelte.d.ts +33 -0
- package/dist/components/D2BlockNode.svelte.d.ts.map +1 -0
- package/dist/components/DefinitionListNode.svelte +8 -0
- package/dist/components/DefinitionListNode.svelte.d.ts +23 -0
- package/dist/components/DefinitionListNode.svelte.d.ts.map +1 -0
- package/dist/components/EmojiNode.svelte +7 -0
- package/dist/components/EmojiNode.svelte.d.ts +22 -0
- package/dist/components/EmojiNode.svelte.d.ts.map +1 -0
- package/dist/components/EmphasisNode.svelte +8 -0
- package/dist/components/EmphasisNode.svelte.d.ts +24 -0
- package/dist/components/EmphasisNode.svelte.d.ts.map +1 -0
- package/dist/components/FallbackComponent.svelte +8 -0
- package/dist/components/FallbackComponent.svelte.d.ts +23 -0
- package/dist/components/FallbackComponent.svelte.d.ts.map +1 -0
- package/dist/components/FootnoteAnchorNode.svelte +21 -0
- package/dist/components/FootnoteAnchorNode.svelte.d.ts +22 -0
- package/dist/components/FootnoteAnchorNode.svelte.d.ts.map +1 -0
- package/dist/components/FootnoteNode.svelte +19 -0
- package/dist/components/FootnoteNode.svelte.d.ts +24 -0
- package/dist/components/FootnoteNode.svelte.d.ts.map +1 -0
- package/dist/components/FootnoteReferenceNode.svelte +26 -0
- package/dist/components/FootnoteReferenceNode.svelte.d.ts +22 -0
- package/dist/components/FootnoteReferenceNode.svelte.d.ts.map +1 -0
- package/dist/components/HardBreakNode.svelte +1 -0
- package/dist/components/HardBreakNode.svelte.d.ts +27 -0
- package/dist/components/HardBreakNode.svelte.d.ts.map +1 -0
- package/dist/components/HeadingNode.svelte +15 -0
- package/dist/components/HeadingNode.svelte.d.ts +24 -0
- package/dist/components/HeadingNode.svelte.d.ts.map +1 -0
- package/dist/components/HighlightNode.svelte +8 -0
- package/dist/components/HighlightNode.svelte.d.ts +24 -0
- package/dist/components/HighlightNode.svelte.d.ts.map +1 -0
- package/dist/components/HtmlBlockNode.svelte +8 -0
- package/dist/components/HtmlBlockNode.svelte.d.ts +23 -0
- package/dist/components/HtmlBlockNode.svelte.d.ts.map +1 -0
- package/dist/components/HtmlInlineNode.svelte +8 -0
- package/dist/components/HtmlInlineNode.svelte.d.ts +23 -0
- package/dist/components/HtmlInlineNode.svelte.d.ts.map +1 -0
- package/dist/components/HtmlPreviewFrame.svelte +13 -0
- package/dist/components/HtmlPreviewFrame.svelte.d.ts +26 -0
- package/dist/components/HtmlPreviewFrame.svelte.d.ts.map +1 -0
- package/dist/components/ImageNode.svelte +86 -0
- package/dist/components/ImageNode.svelte.d.ts +25 -0
- package/dist/components/ImageNode.svelte.d.ts.map +1 -0
- package/dist/components/InfographicBlockNode.svelte +429 -0
- package/dist/components/InfographicBlockNode.svelte.d.ts +34 -0
- package/dist/components/InfographicBlockNode.svelte.d.ts.map +1 -0
- package/dist/components/InlineCodeNode.svelte +7 -0
- package/dist/components/InlineCodeNode.svelte.d.ts +22 -0
- package/dist/components/InlineCodeNode.svelte.d.ts.map +1 -0
- package/dist/components/InlineWrapNode.svelte +10 -0
- package/dist/components/InlineWrapNode.svelte.d.ts +25 -0
- package/dist/components/InlineWrapNode.svelte.d.ts.map +1 -0
- package/dist/components/InsertNode.svelte +8 -0
- package/dist/components/InsertNode.svelte.d.ts +24 -0
- package/dist/components/InsertNode.svelte.d.ts.map +1 -0
- package/dist/components/LinkNode.svelte +41 -0
- package/dist/components/LinkNode.svelte.d.ts +25 -0
- package/dist/components/LinkNode.svelte.d.ts.map +1 -0
- package/dist/components/ListItemNode.svelte +9 -0
- package/dist/components/ListItemNode.svelte.d.ts +24 -0
- package/dist/components/ListItemNode.svelte.d.ts.map +1 -0
- package/dist/components/ListNode.svelte +16 -0
- package/dist/components/ListNode.svelte.d.ts +24 -0
- package/dist/components/ListNode.svelte.d.ts.map +1 -0
- package/dist/components/MarkdownCodeBlockNode.svelte +7 -0
- package/dist/components/MarkdownCodeBlockNode.svelte.d.ts +23 -0
- package/dist/components/MarkdownCodeBlockNode.svelte.d.ts.map +1 -0
- package/dist/components/MathBlockNode.svelte +96 -0
- package/dist/components/MathBlockNode.svelte.d.ts +22 -0
- package/dist/components/MathBlockNode.svelte.d.ts.map +1 -0
- package/dist/components/MathInlineNode.svelte +103 -0
- package/dist/components/MathInlineNode.svelte.d.ts +22 -0
- package/dist/components/MathInlineNode.svelte.d.ts.map +1 -0
- package/dist/components/MermaidBlockNode.svelte +557 -0
- package/dist/components/MermaidBlockNode.svelte.d.ts +40 -0
- package/dist/components/MermaidBlockNode.svelte.d.ts.map +1 -0
- package/dist/components/NodeOutlet.svelte +192 -0
- package/dist/components/NodeOutlet.svelte.d.ts +24 -0
- package/dist/components/NodeOutlet.svelte.d.ts.map +1 -0
- package/dist/components/NodeRenderer.svelte +349 -0
- package/dist/components/NodeRenderer.svelte.d.ts +64 -0
- package/dist/components/NodeRenderer.svelte.d.ts.map +1 -0
- package/dist/components/ParagraphNode.svelte +21 -0
- package/dist/components/ParagraphNode.svelte.d.ts +24 -0
- package/dist/components/ParagraphNode.svelte.d.ts.map +1 -0
- package/dist/components/PreCodeNode.svelte +13 -0
- package/dist/components/PreCodeNode.svelte.d.ts +22 -0
- package/dist/components/PreCodeNode.svelte.d.ts.map +1 -0
- package/dist/components/ReferenceNode.svelte +8 -0
- package/dist/components/ReferenceNode.svelte.d.ts +23 -0
- package/dist/components/ReferenceNode.svelte.d.ts.map +1 -0
- package/dist/components/RenderChildren.svelte +12 -0
- package/dist/components/RenderChildren.svelte.d.ts +24 -0
- package/dist/components/RenderChildren.svelte.d.ts.map +1 -0
- package/dist/components/StrikethroughNode.svelte +8 -0
- package/dist/components/StrikethroughNode.svelte.d.ts +24 -0
- package/dist/components/StrikethroughNode.svelte.d.ts.map +1 -0
- package/dist/components/StrongNode.svelte +8 -0
- package/dist/components/StrongNode.svelte.d.ts +24 -0
- package/dist/components/StrongNode.svelte.d.ts.map +1 -0
- package/dist/components/SubscriptNode.svelte +8 -0
- package/dist/components/SubscriptNode.svelte.d.ts +24 -0
- package/dist/components/SubscriptNode.svelte.d.ts.map +1 -0
- package/dist/components/SuperscriptNode.svelte +8 -0
- package/dist/components/SuperscriptNode.svelte.d.ts +24 -0
- package/dist/components/SuperscriptNode.svelte.d.ts.map +1 -0
- package/dist/components/TableNode.svelte +8 -0
- package/dist/components/TableNode.svelte.d.ts +23 -0
- package/dist/components/TableNode.svelte.d.ts.map +1 -0
- package/dist/components/TextNode.svelte +37 -0
- package/dist/components/TextNode.svelte.d.ts +25 -0
- package/dist/components/TextNode.svelte.d.ts.map +1 -0
- package/dist/components/ThematicBreakNode.svelte +1 -0
- package/dist/components/ThematicBreakNode.svelte.d.ts +27 -0
- package/dist/components/ThematicBreakNode.svelte.d.ts.map +1 -0
- package/dist/components/Tooltip.svelte +4 -0
- package/dist/components/Tooltip.svelte.d.ts +21 -0
- package/dist/components/Tooltip.svelte.d.ts.map +1 -0
- package/dist/components/VmrContainerNode.svelte +8 -0
- package/dist/components/VmrContainerNode.svelte.d.ts +23 -0
- package/dist/components/VmrContainerNode.svelte.d.ts.map +1 -0
- package/dist/components/shared/diagram-height.d.ts +10 -0
- package/dist/components/shared/diagram-height.d.ts.map +1 -0
- package/dist/components/shared/diagram-height.js +52 -0
- package/dist/components/shared/node-helpers.d.ts +108 -0
- package/dist/components/shared/node-helpers.d.ts.map +1 -0
- package/dist/components/shared/node-helpers.js +220 -0
- package/dist/components/shared/node-outlet-helpers.d.ts +9 -0
- package/dist/components/shared/node-outlet-helpers.d.ts.map +1 -0
- package/dist/components/shared/node-outlet-helpers.js +92 -0
- package/dist/components/shared/render-window.d.ts +19 -0
- package/dist/components/shared/render-window.d.ts.map +1 -0
- package/dist/components/shared/render-window.js +63 -0
- package/dist/components/shared/renderNodeHtml.d.ts +4 -0
- package/dist/components/shared/renderNodeHtml.d.ts.map +1 -0
- package/dist/components/shared/renderNodeHtml.js +19 -0
- package/dist/components/shared/rich-block-helpers.d.ts +7 -0
- package/dist/components/shared/rich-block-helpers.d.ts.map +1 -0
- package/dist/components/shared/rich-block-helpers.js +76 -0
- package/dist/customComponents.d.ts +10 -0
- package/dist/customComponents.d.ts.map +1 -0
- package/dist/customComponents.js +66 -0
- package/dist/enhanceRenderedHtml.d.ts +21 -0
- package/dist/enhanceRenderedHtml.d.ts.map +1 -0
- package/dist/enhanceRenderedHtml.js +768 -0
- package/dist/hydrateCustomTagContent.d.ts +3 -0
- package/dist/hydrateCustomTagContent.d.ts.map +1 -0
- package/dist/hydrateCustomTagContent.js +130 -0
- package/dist/i18n/useSafeI18n.d.ts +5 -0
- package/dist/i18n/useSafeI18n.d.ts.map +1 -0
- package/dist/i18n/useSafeI18n.js +42 -0
- package/dist/index.css +2009 -0
- package/dist/index.d.ts +78 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +66 -0
- package/dist/index.px.css +2009 -0
- package/dist/index.tailwind.css +2009 -0
- package/dist/optional/d2.d.ts +7 -0
- package/dist/optional/d2.d.ts.map +1 -0
- package/dist/optional/d2.js +67 -0
- package/dist/optional/infographic.d.ts +2 -0
- package/dist/optional/infographic.d.ts.map +1 -0
- package/dist/optional/infographic.js +29 -0
- package/dist/optional/katex.d.ts +7 -0
- package/dist/optional/katex.d.ts.map +1 -0
- package/dist/optional/katex.js +93 -0
- package/dist/optional/mermaid.d.ts +7 -0
- package/dist/optional/mermaid.d.ts.map +1 -0
- package/dist/optional/mermaid.js +171 -0
- package/dist/optional/monaco.d.ts +5 -0
- package/dist/optional/monaco.d.ts.map +1 -0
- package/dist/optional/monaco.js +70 -0
- package/dist/parseNestedMarkdownToNodes.d.ts +15 -0
- package/dist/parseNestedMarkdownToNodes.d.ts.map +1 -0
- package/dist/parseNestedMarkdownToNodes.js +66 -0
- package/dist/renderMarkdownHtml.d.ts +31 -0
- package/dist/renderMarkdownHtml.d.ts.map +1 -0
- package/dist/renderMarkdownHtml.js +465 -0
- package/dist/sanitizeHtmlContent.d.ts +3 -0
- package/dist/sanitizeHtmlContent.d.ts.map +1 -0
- package/dist/sanitizeHtmlContent.js +175 -0
- package/dist/sanitizeSvg.d.ts +3 -0
- package/dist/sanitizeSvg.d.ts.map +1 -0
- package/dist/sanitizeSvg.js +76 -0
- package/dist/tailwind-entry.d.ts +2 -0
- package/dist/tailwind-entry.d.ts.map +1 -0
- package/dist/tailwind-entry.js +1 -0
- package/dist/tooltip/singletonTooltip.d.ts +8 -0
- package/dist/tooltip/singletonTooltip.d.ts.map +1 -0
- package/dist/tooltip/singletonTooltip.js +124 -0
- package/dist/types/monaco.d.ts +66 -0
- package/dist/types/monaco.d.ts.map +1 -0
- package/dist/types/monaco.js +1 -0
- package/dist/utils/languageIcon.d.ts +8 -0
- package/dist/utils/languageIcon.d.ts.map +1 -0
- package/dist/utils/languageIcon.js +182 -0
- package/dist/utils/normalizeKaTeXRenderInput.d.ts +2 -0
- package/dist/utils/normalizeKaTeXRenderInput.d.ts.map +1 -0
- package/dist/utils/normalizeKaTeXRenderInput.js +7 -0
- package/dist/workers/katexCdnWorker.d.ts +21 -0
- package/dist/workers/katexCdnWorker.d.ts.map +1 -0
- package/dist/workers/katexCdnWorker.js +193 -0
- package/dist/workers/katexRenderer.worker.d.ts +2 -0
- package/dist/workers/katexRenderer.worker.d.ts.map +1 -0
- package/dist/workers/katexRenderer.worker.js +55 -0
- package/dist/workers/katexWorkerClient.d.ts +36 -0
- package/dist/workers/katexWorkerClient.d.ts.map +1 -0
- package/dist/workers/katexWorkerClient.js +270 -0
- package/dist/workers/mermaidCdnWorker.d.ts +16 -0
- package/dist/workers/mermaidCdnWorker.d.ts.map +1 -0
- package/dist/workers/mermaidCdnWorker.js +235 -0
- package/dist/workers/mermaidParser.worker.d.ts +2 -0
- package/dist/workers/mermaidParser.worker.d.ts.map +1 -0
- package/dist/workers/mermaidParser.worker.js +85 -0
- package/dist/workers/mermaidWorkerClient.d.ts +16 -0
- package/dist/workers/mermaidWorkerClient.d.ts.map +1 -0
- package/dist/workers/mermaidWorkerClient.js +170 -0
- package/package.json +95 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { CodeBlockMonacoOptions, CodeBlockMonacoTheme } from '../types/monaco';
|
|
2
|
+
import type { SvelteRenderableNode, SvelteRenderContext } from './shared/node-helpers';
|
|
3
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
4
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
5
|
+
$$bindings?: Bindings;
|
|
6
|
+
} & Exports;
|
|
7
|
+
(internal: unknown, props: Props & {
|
|
8
|
+
$$events?: Events;
|
|
9
|
+
$$slots?: Slots;
|
|
10
|
+
}): Exports & {
|
|
11
|
+
$set?: any;
|
|
12
|
+
$on?: any;
|
|
13
|
+
};
|
|
14
|
+
z_$$bindings?: Bindings;
|
|
15
|
+
}
|
|
16
|
+
declare const CodeBlockNode: $$__sveltets_2_IsomorphicComponent<{
|
|
17
|
+
node: SvelteRenderableNode;
|
|
18
|
+
context?: SvelteRenderContext | undefined;
|
|
19
|
+
isDark?: boolean | undefined;
|
|
20
|
+
loading?: boolean | undefined;
|
|
21
|
+
stream?: boolean | undefined;
|
|
22
|
+
darkTheme?: CodeBlockMonacoTheme | undefined;
|
|
23
|
+
lightTheme?: CodeBlockMonacoTheme | undefined;
|
|
24
|
+
themes?: CodeBlockMonacoTheme[] | undefined;
|
|
25
|
+
monacoOptions?: CodeBlockMonacoOptions | undefined;
|
|
26
|
+
minWidth?: string | number | undefined;
|
|
27
|
+
maxWidth?: string | number | undefined;
|
|
28
|
+
isShowPreview?: boolean;
|
|
29
|
+
enableFontSizeControl?: boolean;
|
|
30
|
+
showHeader?: boolean;
|
|
31
|
+
showCopyButton?: boolean;
|
|
32
|
+
showExpandButton?: boolean;
|
|
33
|
+
showPreviewButton?: boolean;
|
|
34
|
+
showCollapseButton?: boolean;
|
|
35
|
+
showFontSizeButtons?: boolean;
|
|
36
|
+
htmlPreviewAllowScripts?: boolean;
|
|
37
|
+
htmlPreviewSandbox?: string | undefined;
|
|
38
|
+
}, {
|
|
39
|
+
[evt: string]: CustomEvent<any>;
|
|
40
|
+
}, {}, {}, string>;
|
|
41
|
+
type CodeBlockNode = InstanceType<typeof CodeBlockNode>;
|
|
42
|
+
export default CodeBlockNode;
|
|
43
|
+
//# sourceMappingURL=CodeBlockNode.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeBlockNode.svelte.d.ts","sourceRoot":"","sources":["../../src/components/CodeBlockNode.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AACnF,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAo7BtF,UAAU,kCAAkC,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,OAAO,GAAG,EAAE,EAAE,QAAQ,GAAG,MAAM;IACpM,KAAK,OAAO,EAAE,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAG;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IAC9G,YAAY,CAAC,EAAE,QAAQ,CAAC;CAC3B;AAKD,QAAA,MAAM,aAAa;UAV0mB,oBAAoB;cAAY,mBAAmB,GAAG,SAAS;aAAW,OAAO,GAAG,SAAS;cAAY,OAAO,GAAG,SAAS;aAAW,OAAO,GAAG,SAAS;gBAAc,oBAAoB,GAAG,SAAS;iBAAe,oBAAoB,GAAG,SAAS;aAAW,oBAAoB,EAAE,GAAG,SAAS;oBAAkB,sBAAsB,GAAG,SAAS;eAAa,MAAM,GAAG,MAAM,GAAG,SAAS;eAAa,MAAM,GAAG,MAAM,GAAG,SAAS;;;;;;;;;;yBAAib,MAAM,GAAG,SAAS;;;kBAUt4C,CAAC;AACjF,KAAK,aAAa,GAAG,YAAY,CAAC,OAAO,aAAa,CAAC,CAAC;AAC1D,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { SvelteRenderableNode, SvelteRenderContext } from './shared/node-helpers'
|
|
3
|
+
import { afterUpdate, onDestroy, onMount } from 'svelte'
|
|
4
|
+
import { useSafeI18n } from '../i18n/useSafeI18n'
|
|
5
|
+
import { getD2 } from '../optional/d2'
|
|
6
|
+
import { extractRenderedSvg, toSafeSvgMarkup } from '../sanitizeSvg'
|
|
7
|
+
import { hideTooltip, showTooltipForAnchor } from '../tooltip/singletonTooltip'
|
|
8
|
+
import { copyTextToClipboard, downloadSvgMarkup } from './shared/rich-block-helpers'
|
|
9
|
+
import { getString } from './shared/node-helpers'
|
|
10
|
+
|
|
11
|
+
const DARK_THEME_OVERRIDES: Record<string, string> = {
|
|
12
|
+
N1: '#E5E7EB',
|
|
13
|
+
N2: '#CBD5E1',
|
|
14
|
+
N3: '#94A3B8',
|
|
15
|
+
N4: '#64748B',
|
|
16
|
+
N5: '#475569',
|
|
17
|
+
N6: '#334155',
|
|
18
|
+
N7: '#0B1220',
|
|
19
|
+
B1: '#60A5FA',
|
|
20
|
+
B2: '#3B82F6',
|
|
21
|
+
B3: '#2563EB',
|
|
22
|
+
B4: '#1D4ED8',
|
|
23
|
+
B5: '#1E40AF',
|
|
24
|
+
B6: '#111827',
|
|
25
|
+
AA2: '#22D3EE',
|
|
26
|
+
AA4: '#0EA5E9',
|
|
27
|
+
AA5: '#0284C7',
|
|
28
|
+
AB4: '#FBBF24',
|
|
29
|
+
AB5: '#F59E0B',
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export let node: SvelteRenderableNode
|
|
33
|
+
export let context: SvelteRenderContext | undefined = undefined
|
|
34
|
+
export let maxHeight: string | null | undefined = '500px'
|
|
35
|
+
export let loading: boolean | undefined = undefined
|
|
36
|
+
export let isDark: boolean | undefined = undefined
|
|
37
|
+
export let themeId: number | null | undefined = undefined
|
|
38
|
+
export let darkThemeId: number | null | undefined = undefined
|
|
39
|
+
export let showHeader = true
|
|
40
|
+
export let showModeToggle = true
|
|
41
|
+
export let showCopyButton = true
|
|
42
|
+
export let showExportButton = true
|
|
43
|
+
export let showCollapseButton = true
|
|
44
|
+
|
|
45
|
+
const { t } = useSafeI18n()
|
|
46
|
+
|
|
47
|
+
let mounted = false
|
|
48
|
+
let renderToken = 0
|
|
49
|
+
let lastSignature = ''
|
|
50
|
+
let activeRenderSignature = ''
|
|
51
|
+
let svgMarkup = ''
|
|
52
|
+
let renderError = ''
|
|
53
|
+
let rendering = false
|
|
54
|
+
let rerenderQueued = false
|
|
55
|
+
let rerenderForce = false
|
|
56
|
+
let copied = false
|
|
57
|
+
let collapsed = false
|
|
58
|
+
let showSource = false
|
|
59
|
+
let copyTimer: ReturnType<typeof setTimeout> | null = null
|
|
60
|
+
|
|
61
|
+
$: source = getString((node as any)?.code)
|
|
62
|
+
$: resolvedLoading = loading ?? (node as any)?.loading === true
|
|
63
|
+
$: resolvedIsDark = isDark ?? context?.isDark ?? false
|
|
64
|
+
$: shouldRender = !(resolvedLoading && !source.trim())
|
|
65
|
+
$: showSourceFallback = showSource || !svgMarkup
|
|
66
|
+
$: renderStyle = maxHeight && maxHeight !== 'none' ? `max-height: ${maxHeight}` : ''
|
|
67
|
+
|
|
68
|
+
onMount(() => {
|
|
69
|
+
mounted = true
|
|
70
|
+
void renderD2(true)
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
afterUpdate(() => {
|
|
74
|
+
if (mounted)
|
|
75
|
+
void renderD2()
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
onDestroy(() => {
|
|
79
|
+
mounted = false
|
|
80
|
+
renderToken += 1
|
|
81
|
+
if (copyTimer)
|
|
82
|
+
clearTimeout(copyTimer)
|
|
83
|
+
})
|
|
84
|
+
|
|
85
|
+
async function renderD2(force = false) {
|
|
86
|
+
if (!mounted || collapsed || showSource || !source.trim())
|
|
87
|
+
return
|
|
88
|
+
const signature = getRenderSignature()
|
|
89
|
+
if (rendering) {
|
|
90
|
+
if (signature !== activeRenderSignature || force) {
|
|
91
|
+
rerenderQueued = true
|
|
92
|
+
rerenderForce = rerenderForce || force
|
|
93
|
+
}
|
|
94
|
+
return
|
|
95
|
+
}
|
|
96
|
+
if (!force && signature === lastSignature && (svgMarkup || renderError))
|
|
97
|
+
return
|
|
98
|
+
|
|
99
|
+
const token = ++renderToken
|
|
100
|
+
activeRenderSignature = signature
|
|
101
|
+
lastSignature = signature
|
|
102
|
+
rendering = true
|
|
103
|
+
renderError = ''
|
|
104
|
+
try {
|
|
105
|
+
const D2Ctor = await getD2()
|
|
106
|
+
if (!mounted || token !== renderToken)
|
|
107
|
+
return
|
|
108
|
+
const instance = createD2Instance(D2Ctor)
|
|
109
|
+
if (!instance || typeof instance.compile !== 'function' || typeof instance.render !== 'function')
|
|
110
|
+
throw new Error('D2 renderer is not available.')
|
|
111
|
+
|
|
112
|
+
const compileResult = await instance.compile(source)
|
|
113
|
+
const diagram = compileResult?.diagram ?? compileResult
|
|
114
|
+
const baseRenderOptions = compileResult?.renderOptions ?? compileResult?.options ?? {}
|
|
115
|
+
const renderOptions: Record<string, any> = { ...baseRenderOptions }
|
|
116
|
+
renderOptions.themeID = resolvedIsDark && darkThemeId != null
|
|
117
|
+
? darkThemeId
|
|
118
|
+
: themeId ?? baseRenderOptions.themeID
|
|
119
|
+
renderOptions.darkThemeID = null
|
|
120
|
+
renderOptions.darkThemeOverrides = null
|
|
121
|
+
if (resolvedIsDark) {
|
|
122
|
+
renderOptions.themeOverrides = {
|
|
123
|
+
...DARK_THEME_OVERRIDES,
|
|
124
|
+
...(baseRenderOptions.themeOverrides || {}),
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
const rendered = await instance.render(diagram, renderOptions)
|
|
129
|
+
if (!mounted || token !== renderToken)
|
|
130
|
+
return
|
|
131
|
+
const safeSvg = toSafeSvgMarkup(extractRenderedSvg(rendered))
|
|
132
|
+
if (!safeSvg)
|
|
133
|
+
throw new Error('D2 rendered empty SVG.')
|
|
134
|
+
svgMarkup = safeSvg.replace('<svg', '<svg class="markstream-d2-root-svg"')
|
|
135
|
+
}
|
|
136
|
+
catch (error) {
|
|
137
|
+
if (token === renderToken) {
|
|
138
|
+
svgMarkup = ''
|
|
139
|
+
renderError = error instanceof Error ? error.message : String(error)
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
finally {
|
|
143
|
+
if (token === renderToken) {
|
|
144
|
+
rendering = false
|
|
145
|
+
activeRenderSignature = ''
|
|
146
|
+
if (rerenderQueued) {
|
|
147
|
+
const forceNext = rerenderForce
|
|
148
|
+
rerenderQueued = false
|
|
149
|
+
rerenderForce = false
|
|
150
|
+
void renderD2(forceNext)
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function getRenderSignature() {
|
|
157
|
+
return `${source}\n${resolvedIsDark}\n${themeId}\n${darkThemeId}`
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
function createD2Instance(D2Ctor: any) {
|
|
161
|
+
if (typeof D2Ctor === 'function') {
|
|
162
|
+
const instance = new D2Ctor()
|
|
163
|
+
if (instance && typeof instance.compile === 'function')
|
|
164
|
+
return instance
|
|
165
|
+
if (typeof D2Ctor.compile === 'function')
|
|
166
|
+
return D2Ctor
|
|
167
|
+
}
|
|
168
|
+
if (D2Ctor?.D2 && typeof D2Ctor.D2 === 'function')
|
|
169
|
+
return new D2Ctor.D2()
|
|
170
|
+
if (typeof D2Ctor?.compile === 'function')
|
|
171
|
+
return D2Ctor
|
|
172
|
+
return null
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
async function copy() {
|
|
176
|
+
await copyTextToClipboard(source)
|
|
177
|
+
context?.events?.onCopy?.(source)
|
|
178
|
+
copied = true
|
|
179
|
+
if (copyTimer)
|
|
180
|
+
clearTimeout(copyTimer)
|
|
181
|
+
copyTimer = setTimeout(() => {
|
|
182
|
+
copied = false
|
|
183
|
+
}, 1000)
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
function exportSvg() {
|
|
187
|
+
if (svgMarkup)
|
|
188
|
+
downloadSvgMarkup(svgMarkup, `d2-diagram-${Date.now()}.svg`)
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
function switchMode(mode: 'preview' | 'source') {
|
|
192
|
+
showSource = mode === 'source'
|
|
193
|
+
if (!showSource)
|
|
194
|
+
void renderD2(true)
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
function showButtonTooltip(event: MouseEvent | FocusEvent, text: string) {
|
|
198
|
+
const target = event.currentTarget as HTMLElement | null
|
|
199
|
+
if (!target || (target instanceof HTMLButtonElement && target.disabled))
|
|
200
|
+
return
|
|
201
|
+
showTooltipForAnchor(target, text, 'top', false, undefined, resolvedIsDark)
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
function showCopyTooltip(event: MouseEvent | FocusEvent) {
|
|
205
|
+
showButtonTooltip(event, copied ? (t('common.copied') || 'Copied') : (t('common.copy') || 'Copy'))
|
|
206
|
+
}
|
|
207
|
+
</script>
|
|
208
|
+
|
|
209
|
+
{#if shouldRender}
|
|
210
|
+
<div
|
|
211
|
+
class:dark={resolvedIsDark}
|
|
212
|
+
class:is-rendering={rendering || resolvedLoading}
|
|
213
|
+
class="markstream-svelte-enhanced-block markstream-svelte-enhanced-block--d2"
|
|
214
|
+
data-markstream-d2="1"
|
|
215
|
+
data-markstream-mode={showSourceFallback ? 'fallback' : 'preview'}
|
|
216
|
+
>
|
|
217
|
+
{#if showHeader}
|
|
218
|
+
<div class="markstream-svelte-enhanced-block__header d2-block-header">
|
|
219
|
+
<div class="d2-header-title">
|
|
220
|
+
<span class="d2-label">D2</span>
|
|
221
|
+
</div>
|
|
222
|
+
<div class="markstream-svelte-enhanced-block__actions d2-header-actions">
|
|
223
|
+
{#if showModeToggle}
|
|
224
|
+
<div class="d2-mode-toggle">
|
|
225
|
+
<button type="button" class:is-active={!showSource} class="markstream-svelte-enhanced-block__action mode-btn d2-mode-btn" onblur={() => hideTooltip()} onclick={() => switchMode('preview')} onfocus={(event) => showButtonTooltip(event, t('common.preview') || 'Preview')} onmouseleave={() => hideTooltip()} onmouseenter={(event) => showButtonTooltip(event, t('common.preview') || 'Preview')}>{t('common.preview')}</button>
|
|
226
|
+
<button type="button" class:is-active={showSource} class="markstream-svelte-enhanced-block__action mode-btn d2-mode-btn" onblur={() => hideTooltip()} onclick={() => switchMode('source')} onfocus={(event) => showButtonTooltip(event, t('common.source') || 'Source')} onmouseleave={() => hideTooltip()} onmouseenter={(event) => showButtonTooltip(event, t('common.source') || 'Source')}>{t('common.source')}</button>
|
|
227
|
+
</div>
|
|
228
|
+
{/if}
|
|
229
|
+
{#if showCopyButton}
|
|
230
|
+
<button type="button" class="markstream-svelte-enhanced-block__action markstream-svelte-enhanced-block__action--icon d2-action-btn" aria-label={copied ? (t('common.copied') || 'Copied') : (t('common.copy') || 'Copy')} onblur={() => hideTooltip()} onclick={copy} onfocus={showCopyTooltip} onmouseleave={() => hideTooltip()} onmouseenter={showCopyTooltip}>
|
|
231
|
+
{#if copied}
|
|
232
|
+
<svg aria-hidden="true" role="img" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 6L9 17l-5-5"/></svg>
|
|
233
|
+
{:else}
|
|
234
|
+
<svg aria-hidden="true" role="img" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></g></svg>
|
|
235
|
+
{/if}
|
|
236
|
+
</button>
|
|
237
|
+
{/if}
|
|
238
|
+
{#if showExportButton && svgMarkup}
|
|
239
|
+
<button type="button" class="markstream-svelte-enhanced-block__action markstream-svelte-enhanced-block__action--icon d2-action-btn" aria-label={t('common.export') || 'Export'} onblur={() => hideTooltip()} onclick={exportSvg} onfocus={(event) => showButtonTooltip(event, t('common.export') || 'Export')} onmouseleave={() => hideTooltip()} onmouseenter={(event) => showButtonTooltip(event, t('common.export') || 'Export')}>
|
|
240
|
+
<svg aria-hidden="true" role="img" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 3v12m0-12l-4 4m4-4l4 4M4 14v4a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-4"/></svg>
|
|
241
|
+
</button>
|
|
242
|
+
{/if}
|
|
243
|
+
{#if showCollapseButton}
|
|
244
|
+
<button type="button" class="markstream-svelte-enhanced-block__action markstream-svelte-enhanced-block__action--icon d2-action-btn" aria-label={collapsed ? (t('common.expand') || 'Expand') : (t('common.collapse') || 'Collapse')} aria-pressed={collapsed} onblur={() => hideTooltip()} onclick={() => (collapsed = !collapsed)} onfocus={(event) => showButtonTooltip(event, collapsed ? (t('common.expand') || 'Expand') : (t('common.collapse') || 'Collapse'))} onmouseleave={() => hideTooltip()} onmouseenter={(event) => showButtonTooltip(event, collapsed ? (t('common.expand') || 'Expand') : (t('common.collapse') || 'Collapse'))}>
|
|
245
|
+
<svg aria-hidden="true" role="img" style:transform={collapsed ? 'rotate(0deg)' : 'rotate(90deg)'} viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m9 18l6-6l-6-6"/></svg>
|
|
246
|
+
</button>
|
|
247
|
+
{/if}
|
|
248
|
+
</div>
|
|
249
|
+
</div>
|
|
250
|
+
{/if}
|
|
251
|
+
|
|
252
|
+
{#if !collapsed}
|
|
253
|
+
<div class="markstream-svelte-enhanced-block__body d2-block-body">
|
|
254
|
+
{#if showSourceFallback}
|
|
255
|
+
<div class="d2-source">
|
|
256
|
+
<pre class="d2-code"><code>{source}</code></pre>
|
|
257
|
+
{#if renderError}
|
|
258
|
+
<p class="d2-error">{renderError}</p>
|
|
259
|
+
{/if}
|
|
260
|
+
</div>
|
|
261
|
+
{:else}
|
|
262
|
+
<div class="d2-render" style={renderStyle}>
|
|
263
|
+
<div class="d2-svg">{@html svgMarkup}</div>
|
|
264
|
+
{#if renderError}
|
|
265
|
+
<p class="d2-error">{renderError}</p>
|
|
266
|
+
{/if}
|
|
267
|
+
</div>
|
|
268
|
+
{/if}
|
|
269
|
+
</div>
|
|
270
|
+
{/if}
|
|
271
|
+
</div>
|
|
272
|
+
{/if}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { SvelteRenderableNode, SvelteRenderContext } from './shared/node-helpers';
|
|
2
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
+
$$bindings?: Bindings;
|
|
5
|
+
} & Exports;
|
|
6
|
+
(internal: unknown, props: Props & {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
12
|
+
};
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
14
|
+
}
|
|
15
|
+
declare const D2BlockNode: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
+
node: SvelteRenderableNode;
|
|
17
|
+
context?: SvelteRenderContext | undefined;
|
|
18
|
+
maxHeight?: string | null | undefined;
|
|
19
|
+
loading?: boolean | undefined;
|
|
20
|
+
isDark?: boolean | undefined;
|
|
21
|
+
themeId?: number | null | undefined;
|
|
22
|
+
darkThemeId?: number | null | undefined;
|
|
23
|
+
showHeader?: boolean;
|
|
24
|
+
showModeToggle?: boolean;
|
|
25
|
+
showCopyButton?: boolean;
|
|
26
|
+
showExportButton?: boolean;
|
|
27
|
+
showCollapseButton?: boolean;
|
|
28
|
+
}, {
|
|
29
|
+
[evt: string]: CustomEvent<any>;
|
|
30
|
+
}, {}, {}, string>;
|
|
31
|
+
type D2BlockNode = InstanceType<typeof D2BlockNode>;
|
|
32
|
+
export default D2BlockNode;
|
|
33
|
+
//# sourceMappingURL=D2BlockNode.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"D2BlockNode.svelte.d.ts","sourceRoot":"","sources":["../../src/components/D2BlockNode.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAsRtF,UAAU,kCAAkC,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,OAAO,GAAG,EAAE,EAAE,QAAQ,GAAG,MAAM;IACpM,KAAK,OAAO,EAAE,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAG;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IAC9G,YAAY,CAAC,EAAE,QAAQ,CAAC;CAC3B;AAKD,QAAA,MAAM,WAAW;UAV2T,oBAAoB;cAAY,mBAAmB,GAAG,SAAS;gBAAc,MAAM,GAAG,IAAI,GAAG,SAAS;cAAY,OAAO,GAAG,SAAS;aAAW,OAAO,GAAG,SAAS;cAAY,MAAM,GAAG,IAAI,GAAG,SAAS;kBAAgB,MAAM,GAAG,IAAI,GAAG,SAAS;;;;;;;;kBAU7d,CAAC;AAC/E,KAAK,WAAW,GAAG,YAAY,CAAC,OAAO,WAAW,CAAC,CAAC;AACtD,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { SvelteRenderableNode, SvelteRenderContext } from './shared/node-helpers'
|
|
3
|
+
import { renderNodeHtml } from './shared/renderNodeHtml'
|
|
4
|
+
export let node: SvelteRenderableNode
|
|
5
|
+
export let context: SvelteRenderContext | undefined = undefined
|
|
6
|
+
$: html = renderNodeHtml(node, context)
|
|
7
|
+
</script>
|
|
8
|
+
{@html html}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { SvelteRenderableNode, SvelteRenderContext } from './shared/node-helpers';
|
|
2
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
+
$$bindings?: Bindings;
|
|
5
|
+
} & Exports;
|
|
6
|
+
(internal: unknown, props: Props & {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
12
|
+
};
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
14
|
+
}
|
|
15
|
+
declare const DefinitionListNode: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
+
node: SvelteRenderableNode;
|
|
17
|
+
context?: SvelteRenderContext | undefined;
|
|
18
|
+
}, {
|
|
19
|
+
[evt: string]: CustomEvent<any>;
|
|
20
|
+
}, {}, {}, string>;
|
|
21
|
+
type DefinitionListNode = InstanceType<typeof DefinitionListNode>;
|
|
22
|
+
export default DefinitionListNode;
|
|
23
|
+
//# sourceMappingURL=DefinitionListNode.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefinitionListNode.svelte.d.ts","sourceRoot":"","sources":["../../src/components/DefinitionListNode.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AActF,UAAU,kCAAkC,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,OAAO,GAAG,EAAE,EAAE,QAAQ,GAAG,MAAM;IACpM,KAAK,OAAO,EAAE,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAG;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IAC9G,YAAY,CAAC,EAAE,QAAQ,CAAC;CAC3B;AAKD,QAAA,MAAM,kBAAkB;UAVkC,oBAAoB;cAAY,mBAAmB,GAAG,SAAS;;;kBAUlB,CAAC;AACtF,KAAK,kBAAkB,GAAG,YAAY,CAAC,OAAO,kBAAkB,CAAC,CAAC;AACpE,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { SvelteRenderableNode } from './shared/node-helpers'
|
|
3
|
+
import { getString } from './shared/node-helpers'
|
|
4
|
+
export let node: SvelteRenderableNode
|
|
5
|
+
$: value = getString((node as any)?.raw || (node as any)?.markup || (node as any)?.content || (node as any)?.name)
|
|
6
|
+
</script>
|
|
7
|
+
<span class="emoji-node">{value}</span>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { SvelteRenderableNode } from './shared/node-helpers';
|
|
2
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
+
$$bindings?: Bindings;
|
|
5
|
+
} & Exports;
|
|
6
|
+
(internal: unknown, props: Props & {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
12
|
+
};
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
14
|
+
}
|
|
15
|
+
declare const EmojiNode: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
+
node: SvelteRenderableNode;
|
|
17
|
+
}, {
|
|
18
|
+
[evt: string]: CustomEvent<any>;
|
|
19
|
+
}, {}, {}, string>;
|
|
20
|
+
type EmojiNode = InstanceType<typeof EmojiNode>;
|
|
21
|
+
export default EmojiNode;
|
|
22
|
+
//# sourceMappingURL=EmojiNode.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmojiNode.svelte.d.ts","sourceRoot":"","sources":["../../src/components/EmojiNode.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AAajE,UAAU,kCAAkC,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,OAAO,GAAG,EAAE,EAAE,QAAQ,GAAG,MAAM;IACpM,KAAK,OAAO,EAAE,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAG;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IAC9G,YAAY,CAAC,EAAE,QAAQ,CAAC;CAC3B;AAKD,QAAA,MAAM,SAAS;UAVwB,oBAAoB;;;kBAUmC,CAAC;AAC7E,KAAK,SAAS,GAAG,YAAY,CAAC,OAAO,SAAS,CAAC,CAAC;AAClD,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { SvelteRenderableNode, SvelteRenderContext } from './shared/node-helpers'
|
|
3
|
+
import InlineWrapNode from './InlineWrapNode.svelte'
|
|
4
|
+
export let node: SvelteRenderableNode
|
|
5
|
+
export let context: SvelteRenderContext | undefined = undefined
|
|
6
|
+
export let indexKey: string | number | undefined = undefined
|
|
7
|
+
</script>
|
|
8
|
+
<InlineWrapNode {node} {context} {indexKey} tag="em" />
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { SvelteRenderableNode, SvelteRenderContext } from './shared/node-helpers';
|
|
2
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
+
$$bindings?: Bindings;
|
|
5
|
+
} & Exports;
|
|
6
|
+
(internal: unknown, props: Props & {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
12
|
+
};
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
14
|
+
}
|
|
15
|
+
declare const EmphasisNode: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
+
node: SvelteRenderableNode;
|
|
17
|
+
context?: SvelteRenderContext | undefined;
|
|
18
|
+
indexKey?: string | number | undefined;
|
|
19
|
+
}, {
|
|
20
|
+
[evt: string]: CustomEvent<any>;
|
|
21
|
+
}, {}, {}, string>;
|
|
22
|
+
type EmphasisNode = InstanceType<typeof EmphasisNode>;
|
|
23
|
+
export default EmphasisNode;
|
|
24
|
+
//# sourceMappingURL=EmphasisNode.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmphasisNode.svelte.d.ts","sourceRoot":"","sources":["../../src/components/EmphasisNode.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AActF,UAAU,kCAAkC,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,OAAO,GAAG,EAAE,EAAE,QAAQ,GAAG,MAAM;IACpM,KAAK,OAAO,EAAE,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAG;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IAC9G,YAAY,CAAC,EAAE,QAAQ,CAAC;CAC3B;AAKD,QAAA,MAAM,YAAY;UAV6D,oBAAoB;cAAY,mBAAmB,GAAG,SAAS;eAAa,MAAM,GAAG,MAAM,GAAG,SAAS;;;kBAUrF,CAAC;AAChF,KAAK,YAAY,GAAG,YAAY,CAAC,OAAO,YAAY,CAAC,CAAC;AACxD,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { SvelteRenderableNode, SvelteRenderContext } from './shared/node-helpers'
|
|
3
|
+
import { renderNodeHtml } from './shared/renderNodeHtml'
|
|
4
|
+
export let node: SvelteRenderableNode
|
|
5
|
+
export let context: SvelteRenderContext | undefined = undefined
|
|
6
|
+
$: html = renderNodeHtml(node, context)
|
|
7
|
+
</script>
|
|
8
|
+
{@html html}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { SvelteRenderableNode, SvelteRenderContext } from './shared/node-helpers';
|
|
2
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
+
$$bindings?: Bindings;
|
|
5
|
+
} & Exports;
|
|
6
|
+
(internal: unknown, props: Props & {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
12
|
+
};
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
14
|
+
}
|
|
15
|
+
declare const FallbackComponent: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
+
node: SvelteRenderableNode;
|
|
17
|
+
context?: SvelteRenderContext | undefined;
|
|
18
|
+
}, {
|
|
19
|
+
[evt: string]: CustomEvent<any>;
|
|
20
|
+
}, {}, {}, string>;
|
|
21
|
+
type FallbackComponent = InstanceType<typeof FallbackComponent>;
|
|
22
|
+
export default FallbackComponent;
|
|
23
|
+
//# sourceMappingURL=FallbackComponent.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FallbackComponent.svelte.d.ts","sourceRoot":"","sources":["../../src/components/FallbackComponent.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AActF,UAAU,kCAAkC,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,OAAO,GAAG,EAAE,EAAE,QAAQ,GAAG,MAAM;IACpM,KAAK,OAAO,EAAE,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAG;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IAC9G,YAAY,CAAC,EAAE,QAAQ,CAAC;CAC3B;AAKD,QAAA,MAAM,iBAAiB;UAVmC,oBAAoB;cAAY,mBAAmB,GAAG,SAAS;;;kBAUnB,CAAC;AACrF,KAAK,iBAAiB,GAAG,YAAY,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAClE,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { SvelteRenderableNode } from './shared/node-helpers'
|
|
3
|
+
import { getString } from './shared/node-helpers'
|
|
4
|
+
|
|
5
|
+
export let node: SvelteRenderableNode
|
|
6
|
+
|
|
7
|
+
$: id = getString((node as any)?.id)
|
|
8
|
+
$: href = id ? `#fnref-${id}` : undefined
|
|
9
|
+
|
|
10
|
+
function scrollToReference(event: MouseEvent) {
|
|
11
|
+
event.preventDefault()
|
|
12
|
+
if (typeof document === 'undefined' || !id)
|
|
13
|
+
return
|
|
14
|
+
const target = document.getElementById(`fnref-${id}`)
|
|
15
|
+
target?.scrollIntoView({ behavior: 'smooth', block: 'center' })
|
|
16
|
+
}
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<a class="footnote-anchor" href={href} title={id ? `返回引用 ${id}` : undefined} onclick={scrollToReference}>
|
|
20
|
+
↩︎
|
|
21
|
+
</a>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { SvelteRenderableNode } from './shared/node-helpers';
|
|
2
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
+
$$bindings?: Bindings;
|
|
5
|
+
} & Exports;
|
|
6
|
+
(internal: unknown, props: Props & {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
12
|
+
};
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
14
|
+
}
|
|
15
|
+
declare const FootnoteAnchorNode: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
+
node: SvelteRenderableNode;
|
|
17
|
+
}, {
|
|
18
|
+
[evt: string]: CustomEvent<any>;
|
|
19
|
+
}, {}, {}, string>;
|
|
20
|
+
type FootnoteAnchorNode = InstanceType<typeof FootnoteAnchorNode>;
|
|
21
|
+
export default FootnoteAnchorNode;
|
|
22
|
+
//# sourceMappingURL=FootnoteAnchorNode.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FootnoteAnchorNode.svelte.d.ts","sourceRoot":"","sources":["../../src/components/FootnoteAnchorNode.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AA2BjE,UAAU,kCAAkC,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,OAAO,GAAG,EAAE,EAAE,QAAQ,GAAG,MAAM;IACpM,KAAK,OAAO,EAAE,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAG;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IAC9G,YAAY,CAAC,EAAE,QAAQ,CAAC;CAC3B;AAKD,QAAA,MAAM,kBAAkB;UAVe,oBAAoB;;;kBAU4C,CAAC;AACtF,KAAK,kBAAkB,GAAG,YAAY,CAAC,OAAO,kBAAkB,CAAC,CAAC;AACpE,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { SvelteRenderableNode, SvelteRenderContext } from './shared/node-helpers'
|
|
3
|
+
import RenderChildren from './RenderChildren.svelte'
|
|
4
|
+
import { getNodeList, getString } from './shared/node-helpers'
|
|
5
|
+
|
|
6
|
+
export let node: SvelteRenderableNode
|
|
7
|
+
export let context: SvelteRenderContext | undefined = undefined
|
|
8
|
+
export let indexKey: string | number | undefined = undefined
|
|
9
|
+
|
|
10
|
+
$: id = getString((node as any)?.id)
|
|
11
|
+
$: children = getNodeList((node as any)?.children)
|
|
12
|
+
$: prefix = `footnote-${indexKey ?? (id || 'node')}`
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<div id={id ? `fnref--${id}` : undefined} class="footnote-node">
|
|
16
|
+
<div class="footnote-node__content">
|
|
17
|
+
<RenderChildren nodes={children} context={context} {prefix} />
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { SvelteRenderableNode, SvelteRenderContext } from './shared/node-helpers';
|
|
2
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
+
$$bindings?: Bindings;
|
|
5
|
+
} & Exports;
|
|
6
|
+
(internal: unknown, props: Props & {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
12
|
+
};
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
14
|
+
}
|
|
15
|
+
declare const FootnoteNode: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
+
node: SvelteRenderableNode;
|
|
17
|
+
context?: SvelteRenderContext | undefined;
|
|
18
|
+
indexKey?: string | number | undefined;
|
|
19
|
+
}, {
|
|
20
|
+
[evt: string]: CustomEvent<any>;
|
|
21
|
+
}, {}, {}, string>;
|
|
22
|
+
type FootnoteNode = InstanceType<typeof FootnoteNode>;
|
|
23
|
+
export default FootnoteNode;
|
|
24
|
+
//# sourceMappingURL=FootnoteNode.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FootnoteNode.svelte.d.ts","sourceRoot":"","sources":["../../src/components/FootnoteNode.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AA0BtF,UAAU,kCAAkC,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,OAAO,GAAG,EAAE,EAAE,QAAQ,GAAG,MAAM;IACpM,KAAK,OAAO,EAAE,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAG;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IAC9G,YAAY,CAAC,EAAE,QAAQ,CAAC;CAC3B;AAKD,QAAA,MAAM,YAAY;UAV6D,oBAAoB;cAAY,mBAAmB,GAAG,SAAS;eAAa,MAAM,GAAG,MAAM,GAAG,SAAS;;;kBAUrF,CAAC;AAChF,KAAK,YAAY,GAAG,YAAY,CAAC,OAAO,YAAY,CAAC,CAAC;AACxD,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { SvelteRenderableNode } from './shared/node-helpers'
|
|
3
|
+
import { getString } from './shared/node-helpers'
|
|
4
|
+
|
|
5
|
+
export let node: SvelteRenderableNode
|
|
6
|
+
|
|
7
|
+
$: id = getString((node as any)?.id)
|
|
8
|
+
$: href = id ? `#fnref--${id}` : undefined
|
|
9
|
+
$: linkAttrs = href ? { href } : {}
|
|
10
|
+
|
|
11
|
+
function scrollToFootnote(event: MouseEvent) {
|
|
12
|
+
event.preventDefault()
|
|
13
|
+
if (typeof document === 'undefined' || !id)
|
|
14
|
+
return
|
|
15
|
+
const target = document.querySelector(href || '')
|
|
16
|
+
target?.scrollIntoView({ behavior: 'smooth', block: 'start' })
|
|
17
|
+
}
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
|
21
|
+
<!-- svelte-ignore a11y_no_noninteractive_element_interactions -->
|
|
22
|
+
<sup id={id ? `fnref-${id}` : undefined} class="footnote-reference" onclick={scrollToFootnote}>
|
|
23
|
+
<span {...linkAttrs} title={id ? `查看脚注 ${id}` : undefined} class="footnote-link cursor-pointer">
|
|
24
|
+
[{id}]
|
|
25
|
+
</span>
|
|
26
|
+
</sup>
|