@incremark/vue 0.4.0-alpha.1 → 1.0.0

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.
@@ -3,7 +3,14 @@ import type { Component } from 'vue';
3
3
  import type { CodeBlockConfig } from './Incremark.vue';
4
4
  interface Props {
5
5
  node: Code;
6
- /** Shiki 主题,默认 github-dark */
6
+ /** Shiki 亮色主题,默认 github-light */
7
+ lightTheme?: string;
8
+ /** Shiki 暗色主题,默认 github-dark */
9
+ darkTheme?: string;
10
+ /**
11
+ * Shiki 主题(手动指定,优先于 lightTheme/darkTheme 的自动选择)
12
+ * @deprecated 推荐使用 lightTheme/darkTheme 配合 ThemeProvider 自动切换
13
+ */
7
14
  theme?: string;
8
15
  /** 默认回退主题(当指定主题加载失败时使用),默认 github-dark */
9
16
  fallbackTheme?: string;
@@ -21,8 +28,9 @@ interface Props {
21
28
  defaultCodeComponent?: Component;
22
29
  }
23
30
  declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
24
- theme: string;
25
31
  mermaidDelay: number;
32
+ lightTheme: string;
33
+ darkTheme: string;
26
34
  fallbackTheme: string;
27
35
  disableHighlight: boolean;
28
36
  blockStatus: "pending" | "stable" | "completed";
@@ -1,7 +1,14 @@
1
1
  import type { Code } from 'mdast';
2
2
  interface Props {
3
3
  node: Code;
4
- /** Shiki 主题,默认 github-dark */
4
+ /** Shiki 亮色主题,默认 github-light */
5
+ lightTheme?: string;
6
+ /** Shiki 暗色主题,默认 github-dark */
7
+ darkTheme?: string;
8
+ /**
9
+ * Shiki 主题(手动指定,优先于 lightTheme/darkTheme 的自动选择)
10
+ * @deprecated 推荐使用 lightTheme/darkTheme 配合 ThemeProvider 自动切换
11
+ */
5
12
  theme?: string;
6
13
  /** 默认回退主题(当指定主题加载失败时使用),默认 github-dark */
7
14
  fallbackTheme?: string;
@@ -11,7 +18,8 @@ interface Props {
11
18
  blockStatus?: 'pending' | 'stable' | 'completed';
12
19
  }
13
20
  declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
14
- theme: string;
21
+ lightTheme: string;
22
+ darkTheme: string;
15
23
  fallbackTheme: string;
16
24
  disableHighlight: boolean;
17
25
  blockStatus: "pending" | "stable" | "completed";
@@ -2,7 +2,9 @@
2
2
  * Shiki Highlighter 单例管理器
3
3
  *
4
4
  * 避免重复创建 Shiki 实例,所有组件共享同一个 highlighter
5
+ * 支持多主题:按主题名缓存 highlighter,运行时可切换
5
6
  */
7
+ import type { MaybeRefOrGetter } from 'vue';
6
8
  import type { HighlighterGeneric, BundledLanguage, BundledTheme } from 'shiki';
7
9
  interface HighlighterInfo {
8
10
  highlighter: HighlighterGeneric<BundledLanguage, BundledTheme>;
@@ -56,10 +58,10 @@ export { getShikiManager, ShikiManager };
56
58
  /**
57
59
  * 使用 Shiki Highlighter(组合式函数)
58
60
  *
59
- * @param theme 主题名称
61
+ * @param theme 主题名称,支持响应式(ref / getter / 静态值)
60
62
  * @returns Shiki 相关的响应式状态和方法
61
63
  */
62
- export declare function useShiki(theme: string): {
64
+ export declare function useShiki(theme: MaybeRefOrGetter<string>): {
63
65
  highlighterInfo: import("vue").ShallowRef<HighlighterInfo | null, HighlighterInfo | null>;
64
66
  isHighlighting: import("vue").ShallowRef<boolean, boolean>;
65
67
  isReady: import("vue").ShallowRef<boolean, boolean>;