@klarkxy/dsh-deep-view 0.1.0 → 0.2.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.
package/lib/copy.d.ts ADDED
@@ -0,0 +1,37 @@
1
+ //#region src/copy.d.ts
2
+ declare const uiZh: {
3
+ copy: string;
4
+ copied: string;
5
+ footnotes: string;
6
+ code: string;
7
+ wrap: string;
8
+ unwrap: string;
9
+ prepared: string;
10
+ preparing: string;
11
+ error: string;
12
+ invalid: string;
13
+ local: string;
14
+ answerFailed: string;
15
+ chart: string;
16
+ chartOptions: string;
17
+ viewAsChart: string;
18
+ viewAsTable: string;
19
+ copyData: string;
20
+ chartNumber: string;
21
+ value: string;
22
+ series: string;
23
+ view: string;
24
+ sources: string;
25
+ progress: string;
26
+ yourAnswer: string;
27
+ options: string;
28
+ submit: string;
29
+ cancel: string;
30
+ confirm: string;
31
+ send: string;
32
+ selected: string;
33
+ };
34
+ declare const uiEn: Record<keyof typeof uiZh, string>;
35
+ //#endregion
36
+ export { uiEn, uiZh };
37
+ //# sourceMappingURL=copy.d.ts.map
package/lib/copy.js ADDED
@@ -0,0 +1,69 @@
1
+ //#region src/copy.ts
2
+ const uiZh = {
3
+ copy: "复制",
4
+ copied: "已复制",
5
+ footnotes: "脚注",
6
+ code: "代码",
7
+ wrap: "自动换行",
8
+ unwrap: "不换行",
9
+ prepared: "卡片将在最终回复中显示",
10
+ preparing: "正在准备视图…",
11
+ error: "视图未能显示",
12
+ invalid: "视图数据无效",
13
+ local: "仅本地预览;此卡片不会发送回答。",
14
+ answerFailed: "回答未能发送,请重试。",
15
+ chart: "图表",
16
+ chartOptions: "图表选项",
17
+ viewAsChart: "查看图表",
18
+ viewAsTable: "查看表格",
19
+ copyData: "复制数据",
20
+ chartNumber: "图表 {n}",
21
+ value: "值",
22
+ series: "系列",
23
+ view: "视图",
24
+ sources: "来源",
25
+ progress: "进度",
26
+ yourAnswer: "你的回答",
27
+ options: "选项",
28
+ submit: "提交",
29
+ cancel: "取消",
30
+ confirm: "确认",
31
+ send: "发送",
32
+ selected: "已选择"
33
+ };
34
+ const uiEn = {
35
+ copy: "Copy",
36
+ copied: "Copied",
37
+ footnotes: "Footnotes",
38
+ code: "Code",
39
+ wrap: "Wrap lines",
40
+ unwrap: "Do not wrap lines",
41
+ prepared: "The card will appear in the final reply",
42
+ preparing: "Preparing view…",
43
+ error: "The view could not be shown",
44
+ invalid: "Invalid view data",
45
+ local: "Local preview only; this card does not send an answer.",
46
+ answerFailed: "The answer could not be sent; try again.",
47
+ chart: "Chart",
48
+ chartOptions: "Chart options",
49
+ viewAsChart: "View as chart",
50
+ viewAsTable: "View as table",
51
+ copyData: "Copy data",
52
+ chartNumber: "Chart {n}",
53
+ value: "Value",
54
+ series: "Series",
55
+ view: "View",
56
+ sources: "Sources",
57
+ progress: "Progress",
58
+ yourAnswer: "Your answer",
59
+ options: "Options",
60
+ submit: "Submit",
61
+ cancel: "Cancel",
62
+ confirm: "Confirm",
63
+ send: "Send",
64
+ selected: "Selected"
65
+ };
66
+ //#endregion
67
+ export { uiEn, uiZh };
68
+
69
+ //# sourceMappingURL=copy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copy.js","names":[],"sources":["../src/copy.ts"],"sourcesContent":["export const uiZh = {\n copy: '复制', copied: '已复制', footnotes: '脚注', code: '代码', wrap: '自动换行', unwrap: '不换行',\n prepared: '卡片将在最终回复中显示', preparing: '正在准备视图…', error: '视图未能显示', invalid: '视图数据无效',\n local: '仅本地预览;此卡片不会发送回答。', answerFailed: '回答未能发送,请重试。',\n chart: '图表', chartOptions: '图表选项', viewAsChart: '查看图表', viewAsTable: '查看表格', copyData: '复制数据',\n chartNumber: '图表 {n}', value: '值', series: '系列', view: '视图', sources: '来源', progress: '进度', yourAnswer: '你的回答',\n options: '选项', submit: '提交', cancel: '取消', confirm: '确认', send: '发送', selected: '已选择',\n}\n\nexport const uiEn: Record<keyof typeof uiZh, string> = {\n copy: 'Copy', copied: 'Copied', footnotes: 'Footnotes', code: 'Code', wrap: 'Wrap lines', unwrap: 'Do not wrap lines',\n prepared: 'The card will appear in the final reply', preparing: 'Preparing view…', error: 'The view could not be shown', invalid: 'Invalid view data',\n local: 'Local preview only; this card does not send an answer.', answerFailed: 'The answer could not be sent; try again.',\n chart: 'Chart', chartOptions: 'Chart options', viewAsChart: 'View as chart', viewAsTable: 'View as table', copyData: 'Copy data',\n chartNumber: 'Chart {n}', value: 'Value', series: 'Series', view: 'View', sources: 'Sources', progress: 'Progress', yourAnswer: 'Your answer',\n options: 'Options', submit: 'Submit', cancel: 'Cancel', confirm: 'Confirm', send: 'Send', selected: 'Selected',\n}\n"],"mappings":";AAAA,MAAa,OAAO;CAClB,MAAM;CAAM,QAAQ;CAAO,WAAW;CAAM,MAAM;CAAM,MAAM;CAAQ,QAAQ;CAC9E,UAAU;CAAe,WAAW;CAAW,OAAO;CAAU,SAAS;CACzE,OAAO;CAAoB,cAAc;CACzC,OAAO;CAAM,cAAc;CAAQ,aAAa;CAAQ,aAAa;CAAQ,UAAU;CACvF,aAAa;CAAU,OAAO;CAAK,QAAQ;CAAM,MAAM;CAAM,SAAS;CAAM,UAAU;CAAM,YAAY;CACxG,SAAS;CAAM,QAAQ;CAAM,QAAQ;CAAM,SAAS;CAAM,MAAM;CAAM,UAAU;AAClF;AAEA,MAAa,OAA0C;CACrD,MAAM;CAAQ,QAAQ;CAAU,WAAW;CAAa,MAAM;CAAQ,MAAM;CAAc,QAAQ;CAClG,UAAU;CAA2C,WAAW;CAAmB,OAAO;CAA+B,SAAS;CAClI,OAAO;CAA0D,cAAc;CAC/E,OAAO;CAAS,cAAc;CAAiB,aAAa;CAAiB,aAAa;CAAiB,UAAU;CACrH,aAAa;CAAa,OAAO;CAAS,QAAQ;CAAU,MAAM;CAAQ,SAAS;CAAW,UAAU;CAAY,YAAY;CAChI,SAAS;CAAW,QAAQ;CAAU,QAAQ;CAAU,SAAS;CAAW,MAAM;CAAQ,UAAU;AACtG"}
package/lib/core.d.ts ADDED
@@ -0,0 +1,57 @@
1
+ import { g as ViewNode, h as ViewFailure, l as Scalar, r as Formula, u as ShownView } from "./contracts2.js";
2
+ //#region src/core/index.d.ts
3
+ declare const CHART_KINDS: readonly string[];
4
+ declare const VIEW_BYTE_LIMIT: number;
5
+ declare const FORMULA_FUNCTIONS: readonly string[];
6
+ declare function isName(value: unknown): value is string;
7
+ declare function show(value: unknown): string;
8
+ declare function asText(value: unknown): string;
9
+ declare function checkShownView(title: unknown, sent: unknown): ShownView | ViewFailure;
10
+ declare function normalizeView(value: unknown): unknown;
11
+ declare function validateView(view: unknown): {
12
+ ok: true;
13
+ interactive: boolean;
14
+ } | {
15
+ ok: false;
16
+ error: string;
17
+ };
18
+ declare function viewBytes(title: unknown, view: unknown): number;
19
+ declare function viewInputs(view: ViewNode): ViewNode[];
20
+ declare function inputDefault(node: ViewNode): unknown;
21
+ declare function choiceValue(option: {
22
+ label?: string;
23
+ value?: Scalar;
24
+ } | undefined): Scalar | undefined;
25
+ declare function viewScope(view: ViewNode, values?: Record<string, unknown>): (name: string) => unknown;
26
+ declare function resolve(value: unknown, lookup: (name: string) => unknown, fallback?: unknown): unknown;
27
+ declare function validateViewAnswer(view: ViewNode, action: unknown, values: unknown): Record<string, unknown> & {
28
+ error?: string;
29
+ };
30
+ declare function viewSummary(view: ViewNode): string;
31
+ declare function inputsSummary(view: ViewNode, values: unknown): string;
32
+ declare function hasInputs(view: ViewNode): boolean;
33
+ declare function isFormula(value: unknown): value is Formula;
34
+ type FormulaTree = {
35
+ type: string;
36
+ [key: string]: unknown;
37
+ };
38
+ declare function compileFormula(source: unknown): {
39
+ tree: FormulaTree;
40
+ names: string[];
41
+ error?: undefined;
42
+ } | {
43
+ error: string;
44
+ tree?: undefined;
45
+ names?: undefined;
46
+ };
47
+ declare function createScope(inputs: Map<string, unknown>, lets: Map<string, FormulaTree>): (name: string) => unknown;
48
+ declare function evaluate(tree: FormulaTree, lookup: (name: string) => unknown): {
49
+ value: unknown;
50
+ error?: undefined;
51
+ } | {
52
+ error: string;
53
+ value?: undefined;
54
+ };
55
+ //#endregion
56
+ export { CHART_KINDS, FORMULA_FUNCTIONS, VIEW_BYTE_LIMIT, asText, checkShownView, choiceValue, compileFormula, createScope, evaluate, hasInputs, inputDefault, inputsSummary, isFormula, isName, normalizeView, resolve, show, validateView, validateViewAnswer, viewBytes, viewInputs, viewScope, viewSummary };
57
+ //# sourceMappingURL=core.d.ts.map
package/lib/core.js ADDED
@@ -0,0 +1,2 @@
1
+ import { C as show, S as isName, _ as viewSummary, a as choiceValue, b as createScope, c as inputsSummary, d as resolve, f as validateView, g as viewScope, h as viewInputs, i as checkShownView, l as isFormula, m as viewBytes, n as VIEW_BYTE_LIMIT, o as hasInputs, p as validateViewAnswer, r as asText, s as inputDefault, t as CHART_KINDS, u as normalizeView, v as FORMULA_FUNCTIONS, x as evaluate, y as compileFormula } from "./core2.js";
2
+ export { CHART_KINDS, FORMULA_FUNCTIONS, VIEW_BYTE_LIMIT, asText, checkShownView, choiceValue, compileFormula, createScope, evaluate, hasInputs, inputDefault, inputsSummary, isFormula, isName, normalizeView, resolve, show, validateView, validateViewAnswer, viewBytes, viewInputs, viewScope, viewSummary };