svelte-streamdown 1.0.6 → 1.0.7
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/dist/Block.svelte +64 -20
- package/dist/Elements/A.svelte +17 -14
- package/dist/Elements/A.svelte.d.ts +7 -2
- package/dist/Elements/Alert.svelte +12 -28
- package/dist/Elements/Alert.svelte.d.ts +7 -2
- package/dist/Elements/Blockquote.svelte +11 -9
- package/dist/Elements/Blockquote.svelte.d.ts +7 -2
- package/dist/Elements/Code.svelte +13 -11
- package/dist/Elements/Code.svelte.d.ts +7 -2
- package/dist/Elements/Del.svelte +11 -7
- package/dist/Elements/Del.svelte.d.ts +7 -2
- package/dist/Elements/Element.svelte +50 -99
- package/dist/Elements/Element.svelte.d.ts +2 -5
- package/dist/Elements/Em.svelte +11 -6
- package/dist/Elements/Em.svelte.d.ts +7 -2
- package/dist/Elements/Heading.svelte +25 -0
- package/dist/Elements/Heading.svelte.d.ts +9 -0
- package/dist/Elements/Hr.svelte +12 -6
- package/dist/Elements/Hr.svelte.d.ts +7 -2
- package/dist/Elements/Image.svelte +17 -17
- package/dist/Elements/Image.svelte.d.ts +7 -2
- package/dist/Elements/InlineCode.svelte +12 -7
- package/dist/Elements/InlineCode.svelte.d.ts +7 -2
- package/dist/Elements/Li.svelte +11 -6
- package/dist/Elements/Li.svelte.d.ts +7 -2
- package/dist/Elements/Math.svelte +19 -9
- package/dist/Elements/Math.svelte.d.ts +7 -2
- package/dist/Elements/Mermaid.svelte +13 -9
- package/dist/Elements/Mermaid.svelte.d.ts +7 -2
- package/dist/Elements/Ol.svelte +13 -6
- package/dist/Elements/Ol.svelte.d.ts +7 -2
- package/dist/Elements/P.svelte +11 -6
- package/dist/Elements/P.svelte.d.ts +7 -2
- package/dist/Elements/Strong.svelte +11 -6
- package/dist/Elements/Strong.svelte.d.ts +7 -2
- package/dist/Elements/Sub.svelte +10 -6
- package/dist/Elements/Sub.svelte.d.ts +6 -2
- package/dist/Elements/Sup.svelte +10 -5
- package/dist/Elements/Sup.svelte.d.ts +6 -2
- package/dist/Elements/Table.svelte +12 -7
- package/dist/Elements/Table.svelte.d.ts +7 -2
- package/dist/Elements/Tbody.svelte +8 -7
- package/dist/Elements/Tbody.svelte.d.ts +5 -2
- package/dist/Elements/Td.svelte +12 -7
- package/dist/Elements/Td.svelte.d.ts +7 -2
- package/dist/Elements/Th.svelte +11 -6
- package/dist/Elements/Th.svelte.d.ts +7 -2
- package/dist/Elements/Thead.svelte +13 -9
- package/dist/Elements/Thead.svelte.d.ts +7 -2
- package/dist/Elements/Tr.svelte +13 -9
- package/dist/Elements/Tr.svelte.d.ts +7 -2
- package/dist/Elements/Ul.svelte +11 -6
- package/dist/Elements/Ul.svelte.d.ts +7 -2
- package/dist/Elements/index.d.ts +1 -6
- package/dist/Elements/index.js +1 -6
- package/dist/Streamdown.d.ts +16 -24
- package/dist/Streamdown.svelte +7 -39
- package/dist/Streamdown.svelte.d.ts +1 -1
- package/dist/hightlighter.svelte.js +0 -1
- package/dist/marked/index.d.ts +16 -0
- package/dist/marked/index.js +34 -0
- package/dist/marked/marked-alert.d.ts +19 -0
- package/dist/marked/marked-alert.js +54 -0
- package/dist/marked/marked-footnotes.d.ts +28 -0
- package/dist/marked/marked-footnotes.js +75 -0
- package/dist/marked/marked-math.d.ts +10 -0
- package/dist/marked/marked-math.js +60 -0
- package/dist/theme.d.ts +3 -3
- package/dist/theme.js +5 -5
- package/package.json +2 -14
- package/dist/Elements/H1.svelte +0 -23
- package/dist/Elements/H1.svelte.d.ts +0 -4
- package/dist/Elements/H2.svelte +0 -23
- package/dist/Elements/H2.svelte.d.ts +0 -4
- package/dist/Elements/H3.svelte +0 -23
- package/dist/Elements/H3.svelte.d.ts +0 -4
- package/dist/Elements/H4.svelte +0 -23
- package/dist/Elements/H4.svelte.d.ts +0 -4
- package/dist/Elements/H5.svelte +0 -23
- package/dist/Elements/H5.svelte.d.ts +0 -4
- package/dist/Elements/H6.svelte +0 -23
- package/dist/Elements/H6.svelte.d.ts +0 -4
- package/dist/Elements/element.d.ts +0 -8
- package/dist/Elements/element.js +0 -1
- package/dist/utils/alerts.d.ts +0 -12
- package/dist/utils/alerts.js +0 -207
- package/dist/utils/parse-blocks.d.ts +0 -1
- package/dist/utils/parse-blocks.js +0 -40
- package/dist/utils/parse.d.ts +0 -3
- package/dist/utils/parse.js +0 -131
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Tokens } from 'marked';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
type $$ComponentProps = {
|
|
4
|
+
token: Tokens.Heading;
|
|
5
|
+
children: Snippet;
|
|
6
|
+
};
|
|
7
|
+
declare const Heading: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
8
|
+
type Heading = ReturnType<typeof Heading>;
|
|
9
|
+
export default Heading;
|
package/dist/Elements/Hr.svelte
CHANGED
|
@@ -1,20 +1,26 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { useStreamdown } from '../Streamdown.svelte';
|
|
3
|
-
import { clsx } from 'clsx';
|
|
4
|
-
import type { ElementProps } from './element.js';
|
|
5
3
|
import Slot from './Slot.svelte';
|
|
4
|
+
import type { Tokens } from 'marked';
|
|
5
|
+
import type { Snippet } from 'svelte';
|
|
6
6
|
|
|
7
7
|
const streamdown = useStreamdown();
|
|
8
8
|
|
|
9
|
-
const {
|
|
9
|
+
const {
|
|
10
|
+
children,
|
|
11
|
+
token
|
|
12
|
+
}: {
|
|
13
|
+
children: Snippet;
|
|
14
|
+
token: Tokens.Hr;
|
|
15
|
+
} = $props();
|
|
10
16
|
</script>
|
|
11
17
|
|
|
12
18
|
<Slot
|
|
13
19
|
props={{
|
|
14
|
-
|
|
15
|
-
|
|
20
|
+
children,
|
|
21
|
+
token
|
|
16
22
|
}}
|
|
17
23
|
render={streamdown.snippets.hr}
|
|
18
24
|
>
|
|
19
|
-
<hr
|
|
25
|
+
<hr class={streamdown.theme.hr.base} />
|
|
20
26
|
</Slot>
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type { Tokens } from 'marked';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
type $$ComponentProps = {
|
|
4
|
+
children: Snippet;
|
|
5
|
+
token: Tokens.Hr;
|
|
6
|
+
};
|
|
7
|
+
declare const Hr: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
3
8
|
type Hr = ReturnType<typeof Hr>;
|
|
4
9
|
export default Hr;
|
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { useStreamdown } from '../Streamdown.svelte';
|
|
3
3
|
import { transformUrl } from '../utils/url.js';
|
|
4
|
-
import { clsx } from 'clsx';
|
|
5
|
-
import type { ElementProps } from './element.js';
|
|
6
4
|
import Slot from './Slot.svelte';
|
|
5
|
+
import type { Tokens } from 'marked';
|
|
6
|
+
import type { Snippet } from 'svelte';
|
|
7
7
|
|
|
8
8
|
const streamdown = useStreamdown();
|
|
9
9
|
|
|
10
|
-
const {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
const {
|
|
11
|
+
children,
|
|
12
|
+
token
|
|
13
|
+
}: {
|
|
14
|
+
children: Snippet;
|
|
15
|
+
token: Tokens.Image;
|
|
16
|
+
} = $props();
|
|
14
17
|
|
|
15
18
|
const transformedUrl = $derived(
|
|
16
|
-
transformUrl(
|
|
19
|
+
transformUrl(token.href, streamdown.allowedImagePrefixes ?? [], streamdown.defaultOrigin)
|
|
17
20
|
);
|
|
18
21
|
</script>
|
|
19
22
|
|
|
@@ -21,24 +24,21 @@
|
|
|
21
24
|
<Slot
|
|
22
25
|
props={{
|
|
23
26
|
src: transformedUrl,
|
|
24
|
-
alt,
|
|
27
|
+
alt: token.text,
|
|
25
28
|
children,
|
|
26
|
-
|
|
29
|
+
token
|
|
27
30
|
}}
|
|
28
31
|
render={streamdown.snippets.img}
|
|
29
32
|
>
|
|
30
|
-
<div class={
|
|
31
|
-
<img class={streamdown.theme.img.image} src={transformedUrl} {
|
|
33
|
+
<div class={streamdown.theme.img.base}>
|
|
34
|
+
<img class={streamdown.theme.img.image} src={transformedUrl} alt={token.text} />
|
|
32
35
|
</div>
|
|
33
36
|
</Slot>
|
|
34
37
|
{:else}
|
|
35
38
|
<span
|
|
36
|
-
class=
|
|
37
|
-
|
|
38
|
-
className?.toString()
|
|
39
|
-
)}
|
|
40
|
-
title={`Blocked URL: ${src}`}
|
|
39
|
+
class="inline-block rounded bg-gray-200 px-3 py-1 text-sm text-gray-600 dark:bg-gray-700 dark:text-gray-400"
|
|
40
|
+
title={`Blocked URL: ${token.href}`}
|
|
41
41
|
>
|
|
42
|
-
[Image blocked: {
|
|
42
|
+
[Image blocked: {token.text || 'No description'}]
|
|
43
43
|
</span>
|
|
44
44
|
{/if}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type { Tokens } from 'marked';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
type $$ComponentProps = {
|
|
4
|
+
children: Snippet;
|
|
5
|
+
token: Tokens.Image;
|
|
6
|
+
};
|
|
7
|
+
declare const Image: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
3
8
|
type Image = ReturnType<typeof Image>;
|
|
4
9
|
export default Image;
|
|
@@ -1,23 +1,28 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { useStreamdown } from '../Streamdown.svelte';
|
|
3
|
-
import { clsx } from 'clsx';
|
|
4
|
-
import type { ElementProps } from './element.js';
|
|
5
3
|
import Slot from './Slot.svelte';
|
|
4
|
+
import type { Tokens } from 'marked';
|
|
5
|
+
import type { Snippet } from 'svelte';
|
|
6
6
|
|
|
7
7
|
const streamdown = useStreamdown();
|
|
8
8
|
|
|
9
|
-
const {
|
|
9
|
+
const {
|
|
10
|
+
children,
|
|
11
|
+
token
|
|
12
|
+
}: {
|
|
13
|
+
children: Snippet;
|
|
14
|
+
token: Tokens.Codespan;
|
|
15
|
+
} = $props();
|
|
10
16
|
</script>
|
|
11
17
|
|
|
12
18
|
<Slot
|
|
13
19
|
props={{
|
|
14
20
|
children,
|
|
15
|
-
|
|
16
|
-
...props
|
|
21
|
+
token
|
|
17
22
|
}}
|
|
18
23
|
render={streamdown.snippets.inlineCode}
|
|
19
24
|
>
|
|
20
|
-
<code
|
|
21
|
-
{
|
|
25
|
+
<code class={streamdown.theme.inlineCode.base}>
|
|
26
|
+
{token.text}
|
|
22
27
|
</code>
|
|
23
28
|
</Slot>
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type { Tokens } from 'marked';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
type $$ComponentProps = {
|
|
4
|
+
children: Snippet;
|
|
5
|
+
token: Tokens.Codespan;
|
|
6
|
+
};
|
|
7
|
+
declare const InlineCode: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
3
8
|
type InlineCode = ReturnType<typeof InlineCode>;
|
|
4
9
|
export default InlineCode;
|
package/dist/Elements/Li.svelte
CHANGED
|
@@ -1,23 +1,28 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { useStreamdown } from '../Streamdown.svelte';
|
|
3
|
-
import { clsx } from 'clsx';
|
|
4
|
-
import type { ElementProps } from './element.js';
|
|
5
3
|
import Slot from './Slot.svelte';
|
|
4
|
+
import type { Tokens } from 'marked';
|
|
5
|
+
import type { Snippet } from 'svelte';
|
|
6
6
|
|
|
7
7
|
const streamdown = useStreamdown();
|
|
8
8
|
|
|
9
|
-
const {
|
|
9
|
+
const {
|
|
10
|
+
children,
|
|
11
|
+
token
|
|
12
|
+
}: {
|
|
13
|
+
children: Snippet;
|
|
14
|
+
token: Tokens.ListItem;
|
|
15
|
+
} = $props();
|
|
10
16
|
</script>
|
|
11
17
|
|
|
12
18
|
<Slot
|
|
13
19
|
props={{
|
|
14
20
|
children,
|
|
15
|
-
|
|
16
|
-
...props
|
|
21
|
+
token
|
|
17
22
|
}}
|
|
18
23
|
render={streamdown.snippets.li}
|
|
19
24
|
>
|
|
20
|
-
<li
|
|
25
|
+
<li class={streamdown.theme.li.base}>
|
|
21
26
|
{@render children()}
|
|
22
27
|
</li>
|
|
23
28
|
</Slot>
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type { Tokens } from 'marked';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
type $$ComponentProps = {
|
|
4
|
+
children: Snippet;
|
|
5
|
+
token: Tokens.ListItem;
|
|
6
|
+
};
|
|
7
|
+
declare const Li: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
3
8
|
type Li = ReturnType<typeof Li>;
|
|
4
9
|
export default Li;
|
|
@@ -1,14 +1,25 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { onMount, untrack } from 'svelte';
|
|
3
3
|
import { useStreamdown } from '../Streamdown.svelte';
|
|
4
|
-
import { clsx } from 'clsx';
|
|
5
|
-
import type { ElementProps } from './element.js';
|
|
6
4
|
import Slot from './Slot.svelte';
|
|
5
|
+
import type { MathToken } from '../marked/index.js';
|
|
6
|
+
import type { Snippet } from 'svelte';
|
|
7
7
|
import type { KatexOptions } from 'katex';
|
|
8
8
|
import 'katex/dist/katex.min.css';
|
|
9
|
+
|
|
9
10
|
const streamdown = useStreamdown();
|
|
10
|
-
|
|
11
|
-
const
|
|
11
|
+
|
|
12
|
+
const {
|
|
13
|
+
children,
|
|
14
|
+
token
|
|
15
|
+
}: {
|
|
16
|
+
children: Snippet;
|
|
17
|
+
token: MathToken;
|
|
18
|
+
} = $props();
|
|
19
|
+
|
|
20
|
+
const isInline = $derived(token.isInline);
|
|
21
|
+
|
|
22
|
+
console.log({ token });
|
|
12
23
|
|
|
13
24
|
let katexInstance = $state<typeof import('katex') | null>(null);
|
|
14
25
|
|
|
@@ -30,7 +41,7 @@
|
|
|
30
41
|
? streamdown.katexConfig(isInline)
|
|
31
42
|
: streamdown.katexConfig || {})
|
|
32
43
|
};
|
|
33
|
-
const code =
|
|
44
|
+
const code = token.text;
|
|
34
45
|
try {
|
|
35
46
|
return katexInstance.renderToString(code, config);
|
|
36
47
|
} catch (error) {
|
|
@@ -44,19 +55,18 @@
|
|
|
44
55
|
<Slot
|
|
45
56
|
props={{
|
|
46
57
|
children,
|
|
47
|
-
|
|
48
|
-
...props
|
|
58
|
+
token
|
|
49
59
|
}}
|
|
50
60
|
render={streamdown.snippets.math}
|
|
51
61
|
>
|
|
52
62
|
{#if isInline}
|
|
53
|
-
<span bind:this={inner}
|
|
63
|
+
<span bind:this={inner} class={streamdown.theme.inlineMath.base}>
|
|
54
64
|
{@html html}
|
|
55
65
|
</span>
|
|
56
66
|
{:else}
|
|
57
67
|
<div class="h-fit w-full">
|
|
58
68
|
<div class="overflow-x-auto">
|
|
59
|
-
<div bind:this={inner}
|
|
69
|
+
<div bind:this={inner} class={streamdown.theme.math.base}>
|
|
60
70
|
{@html html}
|
|
61
71
|
</div>
|
|
62
72
|
</div>
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { MathToken } from '../marked/index.js';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
2
3
|
import 'katex/dist/katex.min.css';
|
|
3
|
-
|
|
4
|
+
type $$ComponentProps = {
|
|
5
|
+
children: Snippet;
|
|
6
|
+
token: MathToken;
|
|
7
|
+
};
|
|
8
|
+
declare const Math: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
4
9
|
type Math = ReturnType<typeof Math>;
|
|
5
10
|
export default Math;
|
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { onMount } from 'svelte';
|
|
3
3
|
import { useStreamdown } from '../Streamdown.svelte';
|
|
4
|
-
import { clsx } from 'clsx';
|
|
5
|
-
import type { ElementProps } from './element.js';
|
|
6
4
|
import Slot from './Slot.svelte';
|
|
5
|
+
import type { Tokens } from 'marked';
|
|
6
|
+
import type { Snippet } from 'svelte';
|
|
7
7
|
import type { MermaidConfig } from 'mermaid';
|
|
8
8
|
import { on } from 'svelte/events';
|
|
9
9
|
import { usePanzoom } from '../utils/panzoom.svelte';
|
|
10
10
|
|
|
11
11
|
const streamdown = useStreamdown();
|
|
12
12
|
|
|
13
|
-
const {
|
|
13
|
+
const {
|
|
14
|
+
children,
|
|
15
|
+
token
|
|
16
|
+
}: {
|
|
17
|
+
children: Snippet;
|
|
18
|
+
token: Tokens.Code;
|
|
19
|
+
} = $props();
|
|
14
20
|
|
|
15
|
-
const code = $derived(
|
|
21
|
+
const code = $derived(token.text);
|
|
16
22
|
let mermaid = $state<any>(null);
|
|
17
23
|
onMount(async () => {
|
|
18
24
|
mermaid = (await import('mermaid')).default;
|
|
@@ -114,15 +120,13 @@
|
|
|
114
120
|
<Slot
|
|
115
121
|
props={{
|
|
116
122
|
children,
|
|
117
|
-
|
|
118
|
-
...props
|
|
123
|
+
token
|
|
119
124
|
}}
|
|
120
125
|
render={streamdown.snippets.mermaid}
|
|
121
126
|
>
|
|
122
127
|
{#if mermaid}
|
|
123
128
|
<div
|
|
124
|
-
{
|
|
125
|
-
class={clsx(streamdown.theme.mermaid.base, className)}
|
|
129
|
+
class={streamdown.theme.mermaid.base}
|
|
126
130
|
{@attach (node) => renderMermaid(code, node)}
|
|
127
131
|
{@attach insider.attach}
|
|
128
132
|
data-expanded={'false'}
|
|
@@ -225,7 +229,7 @@
|
|
|
225
229
|
<svg {@attach panzoom.attach} data-mermaid-svg></svg>
|
|
226
230
|
</div>
|
|
227
231
|
{:else}
|
|
228
|
-
<div
|
|
232
|
+
<div class={streamdown.theme.mermaid.base}></div>
|
|
229
233
|
{/if}
|
|
230
234
|
</Slot>
|
|
231
235
|
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type { Tokens } from 'marked';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
type $$ComponentProps = {
|
|
4
|
+
children: Snippet;
|
|
5
|
+
token: Tokens.Code;
|
|
6
|
+
};
|
|
7
|
+
declare const Mermaid: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
3
8
|
type Mermaid = ReturnType<typeof Mermaid>;
|
|
4
9
|
export default Mermaid;
|
package/dist/Elements/Ol.svelte
CHANGED
|
@@ -1,23 +1,30 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { useStreamdown } from '../Streamdown.svelte';
|
|
3
|
-
import { clsx } from 'clsx';
|
|
4
|
-
import type { ElementProps } from './element.js';
|
|
5
3
|
import Slot from './Slot.svelte';
|
|
4
|
+
import type { Tokens } from 'marked';
|
|
5
|
+
import type { Snippet } from 'svelte';
|
|
6
6
|
|
|
7
7
|
const streamdown = useStreamdown();
|
|
8
8
|
|
|
9
|
-
const {
|
|
9
|
+
const {
|
|
10
|
+
children,
|
|
11
|
+
token
|
|
12
|
+
}: {
|
|
13
|
+
children: Snippet;
|
|
14
|
+
token: Tokens.List;
|
|
15
|
+
} = $props();
|
|
16
|
+
|
|
17
|
+
console.log({ token });
|
|
10
18
|
</script>
|
|
11
19
|
|
|
12
20
|
<Slot
|
|
13
21
|
props={{
|
|
14
22
|
children,
|
|
15
|
-
|
|
16
|
-
...props
|
|
23
|
+
token
|
|
17
24
|
}}
|
|
18
25
|
render={streamdown.snippets.ol}
|
|
19
26
|
>
|
|
20
|
-
<ol
|
|
27
|
+
<ol class={streamdown.theme.ol.base}>
|
|
21
28
|
{@render children()}
|
|
22
29
|
</ol>
|
|
23
30
|
</Slot>
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type { Tokens } from 'marked';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
type $$ComponentProps = {
|
|
4
|
+
children: Snippet;
|
|
5
|
+
token: Tokens.List;
|
|
6
|
+
};
|
|
7
|
+
declare const Ol: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
3
8
|
type Ol = ReturnType<typeof Ol>;
|
|
4
9
|
export default Ol;
|
package/dist/Elements/P.svelte
CHANGED
|
@@ -1,23 +1,28 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { useStreamdown } from '../Streamdown.svelte';
|
|
3
|
-
import { clsx } from 'clsx';
|
|
4
|
-
import type { ElementProps } from './element.js';
|
|
5
3
|
import Slot from './Slot.svelte';
|
|
4
|
+
import type { Tokens } from 'marked';
|
|
5
|
+
import type { Snippet } from 'svelte';
|
|
6
6
|
|
|
7
7
|
const streamdown = useStreamdown();
|
|
8
8
|
|
|
9
|
-
const {
|
|
9
|
+
const {
|
|
10
|
+
children,
|
|
11
|
+
token
|
|
12
|
+
}: {
|
|
13
|
+
children: Snippet;
|
|
14
|
+
token: Tokens.Paragraph;
|
|
15
|
+
} = $props();
|
|
10
16
|
</script>
|
|
11
17
|
|
|
12
18
|
<Slot
|
|
13
19
|
props={{
|
|
14
20
|
children,
|
|
15
|
-
|
|
16
|
-
...props
|
|
21
|
+
token
|
|
17
22
|
}}
|
|
18
23
|
render={streamdown.snippets.p}
|
|
19
24
|
>
|
|
20
|
-
<p
|
|
25
|
+
<p class={streamdown.theme.p.base}>
|
|
21
26
|
{@render children()}
|
|
22
27
|
</p>
|
|
23
28
|
</Slot>
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type { Tokens } from 'marked';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
type $$ComponentProps = {
|
|
4
|
+
children: Snippet;
|
|
5
|
+
token: Tokens.Paragraph;
|
|
6
|
+
};
|
|
7
|
+
declare const P: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
3
8
|
type P = ReturnType<typeof P>;
|
|
4
9
|
export default P;
|
|
@@ -1,23 +1,28 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { useStreamdown } from '../Streamdown.svelte';
|
|
3
|
-
import { clsx } from 'clsx';
|
|
4
|
-
import type { ElementProps } from './element.js';
|
|
5
3
|
import Slot from './Slot.svelte';
|
|
4
|
+
import type { Tokens } from 'marked';
|
|
5
|
+
import type { Snippet } from 'svelte';
|
|
6
6
|
|
|
7
7
|
const streamdown = useStreamdown();
|
|
8
8
|
|
|
9
|
-
const {
|
|
9
|
+
const {
|
|
10
|
+
children,
|
|
11
|
+
token
|
|
12
|
+
}: {
|
|
13
|
+
children: Snippet;
|
|
14
|
+
token: Tokens.Strong;
|
|
15
|
+
} = $props();
|
|
10
16
|
</script>
|
|
11
17
|
|
|
12
18
|
<Slot
|
|
13
19
|
props={{
|
|
14
20
|
children,
|
|
15
|
-
|
|
16
|
-
...props
|
|
21
|
+
token
|
|
17
22
|
}}
|
|
18
23
|
render={streamdown.snippets.strong}
|
|
19
24
|
>
|
|
20
|
-
<strong
|
|
25
|
+
<strong class={streamdown.theme.strong.base}>
|
|
21
26
|
{@render children()}
|
|
22
27
|
</strong>
|
|
23
28
|
</Slot>
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type { Tokens } from 'marked';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
type $$ComponentProps = {
|
|
4
|
+
children: Snippet;
|
|
5
|
+
token: Tokens.Strong;
|
|
6
|
+
};
|
|
7
|
+
declare const Strong: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
3
8
|
type Strong = ReturnType<typeof Strong>;
|
|
4
9
|
export default Strong;
|
package/dist/Elements/Sub.svelte
CHANGED
|
@@ -1,23 +1,27 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { useStreamdown } from '../Streamdown.svelte';
|
|
3
|
-
import { clsx } from 'clsx';
|
|
4
|
-
import type { ElementProps } from './element.js';
|
|
5
3
|
import Slot from './Slot.svelte';
|
|
4
|
+
import type { Snippet } from 'svelte';
|
|
6
5
|
|
|
7
6
|
const streamdown = useStreamdown();
|
|
8
7
|
|
|
9
|
-
const {
|
|
8
|
+
const {
|
|
9
|
+
children,
|
|
10
|
+
token
|
|
11
|
+
}: {
|
|
12
|
+
children: Snippet;
|
|
13
|
+
token: any;
|
|
14
|
+
} = $props();
|
|
10
15
|
</script>
|
|
11
16
|
|
|
12
17
|
<Slot
|
|
13
18
|
props={{
|
|
14
19
|
children,
|
|
15
|
-
|
|
16
|
-
...props
|
|
20
|
+
token
|
|
17
21
|
}}
|
|
18
22
|
render={streamdown.snippets.sub}
|
|
19
23
|
>
|
|
20
|
-
<sub
|
|
24
|
+
<sub class={streamdown.theme.sub.base}>
|
|
21
25
|
{@render children()}
|
|
22
26
|
</sub>
|
|
23
27
|
</Slot>
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
children: Snippet;
|
|
4
|
+
token: any;
|
|
5
|
+
};
|
|
6
|
+
declare const Sub: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
3
7
|
type Sub = ReturnType<typeof Sub>;
|
|
4
8
|
export default Sub;
|
package/dist/Elements/Sup.svelte
CHANGED
|
@@ -1,23 +1,28 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { useStreamdown } from '../Streamdown.svelte';
|
|
3
3
|
import { clsx } from 'clsx';
|
|
4
|
-
import type { ElementProps } from './element.js';
|
|
5
4
|
import Slot from './Slot.svelte';
|
|
5
|
+
import type { Snippet } from 'svelte';
|
|
6
6
|
|
|
7
7
|
const streamdown = useStreamdown();
|
|
8
8
|
|
|
9
|
-
const {
|
|
9
|
+
const {
|
|
10
|
+
children,
|
|
11
|
+
token
|
|
12
|
+
}: {
|
|
13
|
+
children: Snippet;
|
|
14
|
+
token: any;
|
|
15
|
+
} = $props();
|
|
10
16
|
</script>
|
|
11
17
|
|
|
12
18
|
<Slot
|
|
13
19
|
props={{
|
|
14
20
|
children,
|
|
15
|
-
|
|
16
|
-
...props
|
|
21
|
+
token
|
|
17
22
|
}}
|
|
18
23
|
render={streamdown.snippets.sup}
|
|
19
24
|
>
|
|
20
|
-
<sup
|
|
25
|
+
<sup class={streamdown.theme.sup.base}>
|
|
21
26
|
{@render children()}
|
|
22
27
|
</sup>
|
|
23
28
|
</Slot>
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
children: Snippet;
|
|
4
|
+
token: any;
|
|
5
|
+
};
|
|
6
|
+
declare const Sup: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
3
7
|
type Sup = ReturnType<typeof Sup>;
|
|
4
8
|
export default Sup;
|
|
@@ -1,24 +1,29 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { useStreamdown } from '../Streamdown.svelte';
|
|
3
|
-
import { clsx } from 'clsx';
|
|
4
|
-
import type { ElementProps } from './element.js';
|
|
5
3
|
import Slot from './Slot.svelte';
|
|
4
|
+
import type { Tokens } from 'marked';
|
|
5
|
+
import type { Snippet } from 'svelte';
|
|
6
6
|
|
|
7
7
|
const streamdown = useStreamdown();
|
|
8
8
|
|
|
9
|
-
const {
|
|
9
|
+
const {
|
|
10
|
+
children,
|
|
11
|
+
token
|
|
12
|
+
}: {
|
|
13
|
+
children: Snippet;
|
|
14
|
+
token: Tokens.Table;
|
|
15
|
+
} = $props();
|
|
10
16
|
</script>
|
|
11
17
|
|
|
12
18
|
<Slot
|
|
13
19
|
props={{
|
|
14
20
|
children,
|
|
15
|
-
|
|
16
|
-
...props
|
|
21
|
+
token
|
|
17
22
|
}}
|
|
18
23
|
render={streamdown.snippets.table}
|
|
19
24
|
>
|
|
20
|
-
<div class={
|
|
21
|
-
<table class={streamdown.theme.table.table}
|
|
25
|
+
<div class={streamdown.theme.table.base}>
|
|
26
|
+
<table class={streamdown.theme.table.table}>
|
|
22
27
|
{@render children()}
|
|
23
28
|
</table>
|
|
24
29
|
</div>
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type { Tokens } from 'marked';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
type $$ComponentProps = {
|
|
4
|
+
children: Snippet;
|
|
5
|
+
token: Tokens.Table;
|
|
6
|
+
};
|
|
7
|
+
declare const Table: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
3
8
|
type Table = ReturnType<typeof Table>;
|
|
4
9
|
export default Table;
|