@incremark/devtools 0.3.3 → 0.3.5

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.
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @file en-US.ts - 英文
3
+ */
4
+ import type { I18nMessages } from '../types';
5
+ export declare const enUS: I18nMessages;
6
+ //# sourceMappingURL=en-US.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"en-US.d.ts","sourceRoot":"","sources":["../../../src/i18n/locales/en-US.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAE5C,eAAO,MAAM,IAAI,EAAE,YAmClB,CAAA"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @file index.ts - 导出所有语言包
3
+ */
4
+ export { zhCN } from './zh-CN';
5
+ export { enUS } from './en-US';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/i18n/locales/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @file zh-CN.ts - 简体中文
3
+ */
4
+ import type { I18nMessages } from '../types';
5
+ export declare const zhCN: I18nMessages;
6
+ //# sourceMappingURL=zh-CN.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zh-CN.d.ts","sourceRoot":"","sources":["../../../src/i18n/locales/zh-CN.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAE5C,eAAO,MAAM,IAAI,EAAE,YAmClB,CAAA"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * @file types.ts - i18n 类型定义
3
+ */
4
+ export type Locale = 'zh-CN' | 'en-US';
5
+ export interface I18nMessages {
6
+ panelTitle: string;
7
+ tabOverview: string;
8
+ tabBlocks: string;
9
+ tabAst: string;
10
+ tabTimeline: string;
11
+ btnClose: string;
12
+ btnCopy: string;
13
+ btnClear: string;
14
+ statusStreaming: string;
15
+ statusComplete: string;
16
+ waitingForData: string;
17
+ totalBlocks: string;
18
+ completed: string;
19
+ pending: string;
20
+ characters: string;
21
+ nodeTypes: string;
22
+ status: string;
23
+ blockDetails: string;
24
+ blockId: string;
25
+ blockType: string;
26
+ blockStatus: string;
27
+ rawText: string;
28
+ astNode: string;
29
+ selectBlockHint: string;
30
+ totalAppends: string;
31
+ toolTriggerTitle: string;
32
+ }
33
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/i18n/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,MAAM,MAAM,GAAG,OAAO,GAAG,OAAO,CAAA;AAEtC,MAAM,WAAW,YAAY;IAE3B,UAAU,EAAE,MAAM,CAAA;IAElB,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,MAAM,CAAA;IAEnB,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;IAEhB,eAAe,EAAE,MAAM,CAAA;IACvB,cAAc,EAAE,MAAM,CAAA;IACtB,cAAc,EAAE,MAAM,CAAA;IAEtB,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,MAAM,CAAA;IAEd,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,eAAe,EAAE,MAAM,CAAA;IAEvB,YAAY,EAAE,MAAM,CAAA;IAEpB,gBAAgB,EAAE,MAAM,CAAA;CACzB"}
package/dist/index.d.ts CHANGED
@@ -1,114 +1,9 @@
1
- import { ParsedBlock, Root } from '@incremark/core';
2
-
3
- interface DevToolsState {
4
- /** 所有块 */
5
- blocks: ParsedBlock[];
6
- /** 已完成的块 */
7
- completedBlocks: ParsedBlock[];
8
- /** 待处理的块 */
9
- pendingBlocks: ParsedBlock[];
10
- /** Markdown 字符串 */
11
- markdown: string;
12
- /** AST */
13
- ast: Root;
14
- /** 是否加载中 */
15
- isLoading: boolean;
16
- }
17
- interface AppendRecord {
18
- timestamp: number;
19
- chunk: string;
20
- completedCount: number;
21
- pendingCount: number;
22
- }
23
- interface DevToolsOptions {
24
- /** 初始是否打开 */
25
- open?: boolean;
26
- /** 位置 */
27
- position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
28
- /** 主题 */
29
- theme?: 'dark' | 'light';
30
- }
31
-
32
- declare class IncremarkDevTools {
33
- private container;
34
- private state;
35
- private isOpen;
36
- private activeTab;
37
- private selectedBlockId;
38
- private appendHistory;
39
- private lastMarkdownLength;
40
- private options;
41
- private styleElement;
42
- constructor(options?: DevToolsOptions);
43
- /**
44
- * 挂载 DevTools 到 DOM
45
- */
46
- mount(target?: HTMLElement | string): this;
47
- /**
48
- * 卸载 DevTools
49
- */
50
- unmount(): this;
51
- /**
52
- * 更新状态
53
- */
54
- update(state: DevToolsState): this;
55
- /**
56
- * 重置状态
57
- */
58
- reset(): this;
59
- /**
60
- * 打开面板
61
- */
62
- open(): this;
63
- /**
64
- * 关闭面板
65
- */
66
- close(): this;
67
- /**
68
- * 切换面板
69
- */
70
- toggle(): this;
71
- private render;
72
- private renderTabContent;
73
- private renderOverview;
74
- private renderBlocks;
75
- private renderAst;
76
- private renderTimeline;
77
- private bindEvents;
78
- private truncate;
79
- private formatTime;
80
- private escapeHtml;
81
- }
82
1
  /**
83
- * 创建 DevTools 实例
2
+ * @file index.ts - DevTools 入口
3
+ * @description 导出 DevTools API 和类型
84
4
  */
85
- declare function createDevTools(options?: DevToolsOptions): IncremarkDevTools;
86
- /**
87
- * 一行代码挂载 DevTools
88
- *
89
- * @example
90
- * ```ts
91
- * import { createIncremarkParser } from '@incremark/core'
92
- * import { mountDevTools } from '@incremark/devtools'
93
- *
94
- * const parser = createIncremarkParser({
95
- * onChange: mountDevTools() // 就这一行!
96
- * })
97
- * ```
98
- *
99
- * @example
100
- * ```ts
101
- * // 或者自定义选项
102
- * const parser = createIncremarkParser({
103
- * onChange: mountDevTools({ position: 'bottom-left', theme: 'light' })
104
- * })
105
- * ```
106
- */
107
- declare function mountDevTools(options?: DevToolsOptions): (state: {
108
- completedBlocks: any[];
109
- pendingBlocks: any[];
110
- markdown: string;
111
- ast: any;
112
- }) => void;
113
-
114
- export { type AppendRecord, type DevToolsOptions, type DevToolsState, IncremarkDevTools, createDevTools, mountDevTools };
5
+ export { IncremarkDevTools, createDevTools, mountDevTools } from './devtools';
6
+ export type { DevToolsState, DevToolsOptions, AppendRecord, RegisterOptions, ParserRegistration } from './types';
7
+ export type { Locale, I18nMessages } from './i18n/types';
8
+ export { createI18n, setLocale, getLocale, t } from './i18n/index.svelte';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAG7E,YAAY,EACV,aAAa,EACb,eAAe,EACf,YAAY,EACZ,eAAe,EACf,kBAAkB,EACnB,MAAM,SAAS,CAAA;AAGhB,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AACxD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,qBAAqB,CAAA"}