@incremark/svelte 0.3.6 → 0.3.8

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.
@@ -13,14 +13,27 @@
13
13
  interface Props {
14
14
  /** 引用节点 */
15
15
  node: Blockquote
16
+ /** 自定义组件映射 */
17
+ components?: Record<string, any>
18
+ customContainers?: Record<string, any>
19
+ customCodeBlocks?: Record<string, any>
20
+ codeBlockConfigs?: Record<string, { takeOver?: boolean }>
21
+ blockStatus?: 'pending' | 'stable' | 'completed'
16
22
  }
17
23
 
18
- let { node }: Props = $props()
24
+ let { node, components, customContainers, customCodeBlocks, codeBlockConfigs, blockStatus }: Props = $props()
19
25
  </script>
20
26
 
21
27
  <blockquote class="incremark-blockquote">
22
28
  {#each node.children as child, index (index)}
23
- <IncremarkRenderer node={child} />
29
+ <IncremarkRenderer
30
+ node={child}
31
+ {components}
32
+ {customContainers}
33
+ {customCodeBlocks}
34
+ {codeBlockConfigs}
35
+ {blockStatus}
36
+ />
24
37
  {/each}
25
38
  </blockquote>
26
39
 
@@ -5,6 +5,14 @@ import type { Blockquote } from 'mdast';
5
5
  interface Props {
6
6
  /** 引用节点 */
7
7
  node: Blockquote;
8
+ /** 自定义组件映射 */
9
+ components?: Record<string, any>;
10
+ customContainers?: Record<string, any>;
11
+ customCodeBlocks?: Record<string, any>;
12
+ codeBlockConfigs?: Record<string, {
13
+ takeOver?: boolean;
14
+ }>;
15
+ blockStatus?: 'pending' | 'stable' | 'completed';
8
16
  }
9
17
  declare const IncremarkBlockquote: import("svelte").Component<Props, {}, "">;
10
18
  type IncremarkBlockquote = ReturnType<typeof IncremarkBlockquote>;
@@ -1 +1 @@
1
- {"version":3,"file":"IncremarkBlockquote.svelte.d.ts","sourceRoot":"","sources":["../../src/components/IncremarkBlockquote.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAIrC;;GAEG;AACH,UAAU,KAAK;IACb,WAAW;IACX,IAAI,EAAE,UAAU,CAAA;CACjB;AAoBH,QAAA,MAAM,mBAAmB,2CAAwC,CAAC;AAClE,KAAK,mBAAmB,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAClE,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"IncremarkBlockquote.svelte.d.ts","sourceRoot":"","sources":["../../src/components/IncremarkBlockquote.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAIrC;;GAEG;AACH,UAAU,KAAK;IACb,WAAW;IACX,IAAI,EAAE,UAAU,CAAA;IAChB,cAAc;IACd,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAChC,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACtC,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACtC,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC,CAAA;IACzD,WAAW,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,WAAW,CAAA;CACjD;AAoBH,QAAA,MAAM,mBAAmB,2CAAwC,CAAC;AAClE,KAAK,mBAAmB,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAClE,eAAe,mBAAmB,CAAC"}
@@ -14,9 +14,15 @@
14
14
  interface Props {
15
15
  /** 列表节点 */
16
16
  node: List
17
+ /** 自定义组件映射 */
18
+ components?: Record<string, any>
19
+ customContainers?: Record<string, any>
20
+ customCodeBlocks?: Record<string, any>
21
+ codeBlockConfigs?: Record<string, { takeOver?: boolean }>
22
+ blockStatus?: 'pending' | 'stable' | 'completed'
17
23
  }
18
24
 
19
- let { node }: Props = $props()
25
+ let { node, components, customContainers, customCodeBlocks, codeBlockConfigs, blockStatus }: Props = $props()
20
26
 
21
27
  /**
22
28
  * 根据 ordered 属性计算标签名
@@ -99,7 +105,14 @@
99
105
  <IncremarkInline nodes={getItemInlineContent(item)} />
100
106
  <!-- 递归渲染所有块级内容(嵌套列表、heading、blockquote、code、table 等) -->
101
107
  {#each getItemBlockChildren(item) as child, childIndex (childIndex)}
102
- <IncremarkRenderer node={child} />
108
+ <IncremarkRenderer
109
+ node={child}
110
+ {components}
111
+ {customContainers}
112
+ {customCodeBlocks}
113
+ {codeBlockConfigs}
114
+ {blockStatus}
115
+ />
103
116
  {/each}
104
117
  {/if}
105
118
  </li>
@@ -5,6 +5,14 @@ import type { List } from 'mdast';
5
5
  interface Props {
6
6
  /** 列表节点 */
7
7
  node: List;
8
+ /** 自定义组件映射 */
9
+ components?: Record<string, any>;
10
+ customContainers?: Record<string, any>;
11
+ customCodeBlocks?: Record<string, any>;
12
+ codeBlockConfigs?: Record<string, {
13
+ takeOver?: boolean;
14
+ }>;
15
+ blockStatus?: 'pending' | 'stable' | 'completed';
8
16
  }
9
17
  declare const IncremarkList: import("svelte").Component<Props, {}, "">;
10
18
  type IncremarkList = ReturnType<typeof IncremarkList>;
@@ -1 +1 @@
1
- {"version":3,"file":"IncremarkList.svelte.d.ts","sourceRoot":"","sources":["../../src/components/IncremarkList.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAyB,MAAM,OAAO,CAAA;AAKtD;;GAEG;AACH,UAAU,KAAK;IACb,WAAW;IACX,IAAI,EAAE,IAAI,CAAA;CACX;AAyFH,QAAA,MAAM,aAAa,2CAAwC,CAAC;AAC5D,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACtD,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"IncremarkList.svelte.d.ts","sourceRoot":"","sources":["../../src/components/IncremarkList.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAyB,MAAM,OAAO,CAAA;AAKtD;;GAEG;AACH,UAAU,KAAK;IACb,WAAW;IACX,IAAI,EAAE,IAAI,CAAA;IACV,cAAc;IACd,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAChC,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACtC,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACtC,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC,CAAA;IACzD,WAAW,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,WAAW,CAAA;CACjD;AAyFH,QAAA,MAAM,aAAa,2CAAwC,CAAC;AAC5D,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACtD,eAAe,aAAa,CAAC"}
@@ -100,6 +100,26 @@
100
100
  blockStatus={blockStatus}
101
101
  defaultCodeComponent={components?.['code']}
102
102
  />
103
+ <!-- 列表节点:传递所有 props -->
104
+ {:else if node.type === 'list'}
105
+ <IncremarkList
106
+ node={node}
107
+ {components}
108
+ {customContainers}
109
+ {customCodeBlocks}
110
+ {codeBlockConfigs}
111
+ {blockStatus}
112
+ />
113
+ <!-- 引用块节点:传递所有 props -->
114
+ {:else if node.type === 'blockquote'}
115
+ <IncremarkBlockquote
116
+ node={node}
117
+ {components}
118
+ {customContainers}
119
+ {customCodeBlocks}
120
+ {codeBlockConfigs}
121
+ {blockStatus}
122
+ />
103
123
  {:else}
104
124
  <!-- 其他节点:使用对应组件 -->
105
125
  {@const Component = getComponent(node.type)}
@@ -1 +1 @@
1
- {"version":3,"file":"IncremarkRenderer.svelte.d.ts","sourceRoot":"","sources":["../../src/components/IncremarkRenderer.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAQ,MAAM,OAAO,CAAA;AAW9C,OAA2B,E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AAC,EAAE,OAAO,CAAA;KAAE,CAAC,CAAA;IACzD,WAAW,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,WAAW,CAAA;CACjD;AA+FH,QAAA,MAAM,iBAAiB,2CAAwC,CAAC;AAChE,KAAK,iBAAiB,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC9D,eAAe,iBAAiB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@incremark/svelte",
3
- "version": "0.3.6",
3
+ "version": "0.3.8",
4
4
  "description": "High-performance streaming markdown renderer for Svelte 5 ecosystem.",
5
5
  "type": "module",
6
6
  "svelte": "./dist/index.js",
@@ -26,11 +26,11 @@
26
26
  "@antfu/utils": "^9.3.0",
27
27
  "shiki": "^3.20.0",
28
28
  "shiki-stream": "^0.1.4",
29
- "@incremark/core": "0.3.6",
30
- "@incremark/devtools": "0.3.6",
31
- "@incremark/icons": "0.3.6",
32
- "@incremark/shared": "0.3.6",
33
- "@incremark/theme": "0.3.6"
29
+ "@incremark/core": "0.3.8",
30
+ "@incremark/devtools": "0.3.8",
31
+ "@incremark/theme": "0.3.8",
32
+ "@incremark/shared": "0.3.8",
33
+ "@incremark/icons": "0.3.8"
34
34
  },
35
35
  "peerDependencies": {
36
36
  "svelte": "^5.46.1",