@worm-print-platform/canvas 1.5.3 → 1.6.1

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.
Files changed (70) hide show
  1. package/README.md +12 -4
  2. package/dist/browser-bundle.d.ts +1 -1
  3. package/dist/canvas.css +6 -1
  4. package/dist/canvas.js +1173 -119
  5. package/dist/core/default-template.d.ts +1 -1
  6. package/dist/core/element-definitions.d.ts +1 -1
  7. package/dist/core/format.d.ts +1 -1
  8. package/dist/core/h.d.ts +3 -17
  9. package/dist/core/icons.d.ts +1 -1
  10. package/dist/core/plugin.d.ts +4 -3
  11. package/dist/core/store.d.ts +3 -2
  12. package/dist/host-contract.d.ts +16 -3
  13. package/dist/index.cjs +1043 -13
  14. package/dist/index.d.ts +1 -1
  15. package/dist/index.js +6225 -4961
  16. package/dist/print-designer.d.ts +22 -3
  17. package/dist/shell/binding.d.ts +2 -2
  18. package/dist/shell/canvas.d.ts +2 -2
  19. package/dist/shell/code.d.ts +3 -3
  20. package/dist/shell/color-picker.d.ts +3 -39
  21. package/dist/shell/controls.d.ts +29 -11
  22. package/dist/shell/crop-anchor.d.ts +2 -2
  23. package/dist/shell/elements.d.ts +2 -2
  24. package/dist/shell/expression-editor.d.ts +3 -28
  25. package/dist/shell/flow-list.d.ts +2 -4
  26. package/dist/shell/font-select.d.ts +1 -1
  27. package/dist/shell/format-bar.d.ts +2 -2
  28. package/dist/shell/help-content/{advanced-settings.d.ts → en-US/advanced-settings.d.ts} +1 -1
  29. package/dist/shell/help-content/{changelog.d.ts → en-US/changelog.d.ts} +1 -1
  30. package/dist/shell/help-content/{faq.d.ts → en-US/faq.d.ts} +1 -1
  31. package/dist/shell/help-content/{features.d.ts → en-US/features.d.ts} +1 -1
  32. package/dist/shell/help-content/{getting-started.d.ts → en-US/getting-started.d.ts} +1 -1
  33. package/dist/shell/help-content/{shortcuts.d.ts → en-US/shortcuts.d.ts} +1 -1
  34. package/dist/shell/help-content/index.d.ts +4 -1
  35. package/dist/shell/help-content/th-TH/advanced-settings.d.ts +12 -0
  36. package/dist/shell/help-content/th-TH/changelog.d.ts +12 -0
  37. package/dist/shell/help-content/th-TH/faq.d.ts +12 -0
  38. package/dist/shell/help-content/th-TH/features.d.ts +12 -0
  39. package/dist/shell/help-content/th-TH/getting-started.d.ts +12 -0
  40. package/dist/shell/help-content/th-TH/shortcuts.d.ts +12 -0
  41. package/dist/shell/help-content/zh-CN/advanced-settings.d.ts +12 -0
  42. package/dist/shell/help-content/zh-CN/changelog.d.ts +12 -0
  43. package/dist/shell/help-content/zh-CN/faq.d.ts +12 -0
  44. package/dist/shell/help-content/zh-CN/features.d.ts +12 -0
  45. package/dist/shell/help-content/zh-CN/getting-started.d.ts +12 -0
  46. package/dist/shell/help-content/zh-CN/shortcuts.d.ts +12 -0
  47. package/dist/shell/help-modal.d.ts +6 -1
  48. package/dist/shell/page-extras.d.ts +1 -1
  49. package/dist/shell/panels.d.ts +4 -4
  50. package/dist/shell/plugin-ui.d.ts +1 -1
  51. package/dist/shell/prop-group.d.ts +1 -1
  52. package/dist/shell/property-panel.d.ts +1 -1
  53. package/dist/shell/property-search.d.ts +1 -1
  54. package/dist/shell/ruler.d.ts +1 -1
  55. package/dist/shell/table-props.d.ts +1 -1
  56. package/dist/shell/table.d.ts +1 -1
  57. package/dist/shell/toolbar-overflow.d.ts +4 -4
  58. package/dist/shell/toolbar.d.ts +2 -2
  59. package/dist/shell/watermark.d.ts +1 -1
  60. package/dist/test-setup.d.ts +7 -0
  61. package/dist/theme-tokens.d.ts +1 -1
  62. package/dist/version.d.ts +2 -2
  63. package/dist/vue3/PrintDesigner.d.ts +24 -1
  64. package/dist/vue3/PrintHtmlPreview.d.ts +1 -1
  65. package/dist/vue3/index.cjs +2 -2
  66. package/dist/vue3/index.d.ts +1 -1
  67. package/dist/vue3/index.js +85 -75
  68. package/dist/vue3/previewStyle.d.ts +1 -1
  69. package/dist/vue3/toolbarOverflow.d.ts +1 -1
  70. package/package.json +3 -3
@@ -1,12 +1,14 @@
1
1
  /*!
2
- * @worm-print-platform/canvas v1.5.3
2
+ * @worm-print-platform/canvas v1.6.1
3
3
  * Copyright (c) 2026 worm <liu_long_qqcom@qq.com>
4
4
  * SPDX-FileCopyrightText: 2026 worm <liu_long_qqcom@qq.com>
5
5
  * SPDX-License-Identifier: MIT
6
6
  */
7
+ import type { CustomLocaleMessages } from '@worm-print-platform/core/i18n';
7
8
  import type { UploadDesignBackgroundFn, UploadImageFn } from '@worm-print-platform/core/designer';
8
9
  import type { PrintFontDeclaration } from '@worm-print-platform/core';
9
10
  import type { PrintDesignerHostContract, PrintDesignerThemeConfig, PrintDesignerThemeMode } from './host-contract';
11
+ import type { FieldDisplayMode } from './shell/expression-editor';
10
12
  /**
11
13
  * 插件 UI 的设计态示例数据统一成「数组信封」(data[0] 即数据根对象)。
12
14
  * 宿主可传单个业务对象、对象数组或 JSON 字符串;非法/缺省值返回 undefined,
@@ -26,6 +28,12 @@ export declare class PrintDesignerElement extends HTMLElement {
26
28
  private pluginStyleEls;
27
29
  /** 实例级监听登记:卸载时成对摘除,避免 SPA 反复挂载累积 window/document 监听并持有整个实例 */
28
30
  private instanceDisposers;
31
+ /** 实例显式语言;未设置时跟随 core 全局 locale */
32
+ private _lang;
33
+ /** 当前实例用户语言包:交给 scoped translator 使用,不注册到全局 */
34
+ private _messages;
35
+ /** 全局 locale 变化订阅;仅未显式设置 lang 的实例重绘 */
36
+ private unsubI18n;
29
37
  /** 首挂标尺测量的 rAF 句柄:卸载后取消,避免对已销毁实例回调 */
30
38
  private measureRaf;
31
39
  private state;
@@ -100,6 +108,16 @@ export declare class PrintDesignerElement extends HTMLElement {
100
108
  set showPreview(v: boolean);
101
109
  /** 工具栏「保存」按钮显隐;默认显示,隐藏只影响按钮出图,save() 与 save 事件不受影响 */
102
110
  set showSave(v: boolean);
111
+ /** 字段行显示模式:label / key / both(默认 both);非法值静默回退 both */
112
+ set fieldDisplay(v: unknown);
113
+ get fieldDisplay(): FieldDisplayMode;
114
+ /** 界面语言;未设置时跟随 core 全局 locale(浏览器按 navigator.language 探测) */
115
+ set lang(v: string | undefined);
116
+ get lang(): string;
117
+ /** 自定义语言包(对象注入):只作用于本实例的 scoped translator,不污染全局 */
118
+ set messages(v: CustomLocaleMessages | undefined);
119
+ /** 切换当前实例语言并即时重绘;不影响全局 locale */
120
+ setLocale(locale: string): void;
103
121
  /** 主题预设:auto(默认)跟随系统 prefers-color-scheme,light/dark 强制 */
104
122
  set theme(v: PrintDesignerThemeMode | undefined);
105
123
  get theme(): PrintDesignerThemeMode;
@@ -110,12 +128,12 @@ export declare class PrintDesignerElement extends HTMLElement {
110
128
  * 宿主契约版本(机器可读);宿主可在挂载前用 `PrintDesignerElement.contractVersion`
111
129
  * 判断是否需要降级或提示升级,避免把版本号埋在文档里。
112
130
  */
113
- static readonly contractVersion = "1.2.0";
131
+ static readonly contractVersion = "1.4.0";
114
132
  /** 返回完整契约快照(attributes / properties / methods / 事件 / parts / 主题令牌) */
115
133
  static getHostContract(): PrintDesignerHostContract;
116
134
  /** 实例侧同款读取入口,便于 `document.querySelector('print-designer').getHostContract()` */
117
135
  getHostContract(): PrintDesignerHostContract;
118
- static get observedAttributes(): ("template" | "fields" | "name" | "fonts" | "design-data" | "theme" | "theme-config")[];
136
+ static get observedAttributes(): ("fields" | "name" | "fonts" | "template" | "design-data" | "theme" | "theme-config" | "field-display" | "lang")[];
119
137
  attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
120
138
  connectedCallback(): void;
121
139
  /** 仅 auto 模式需要监听系统深浅色;matchMedia 缺失的环境(部分测试宿主)保持浅色 */
@@ -173,6 +191,7 @@ export declare class PrintDesignerElement extends HTMLElement {
173
191
  private canvasUi;
174
192
  private repaint;
175
193
  private paint;
194
+ private paintInternal;
176
195
  /**
177
196
  * 每次整树重建后补 `::part` 标记。派生的 designer.css 只认类名,
178
197
  * 因此这里只给顶层容器加属性,不改动任何 DOM 结构与 class。
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @worm-print-platform/canvas v1.5.3
2
+ * @worm-print-platform/canvas v1.6.1
3
3
  * Copyright (c) 2026 worm <liu_long_qqcom@qq.com>
4
4
  * SPDX-FileCopyrightText: 2026 worm <liu_long_qqcom@qq.com>
5
5
  * SPDX-License-Identifier: MIT
@@ -18,4 +18,4 @@ export declare function readBindingValue(element: RuntimeElement, targetPath: st
18
18
  export declare function writeBindingValue(store: DesignerStore, element: RuntimeElement, targetPath: string, value: string): void;
19
19
  /** 当前应渲染的绑定项:表格有选区时只出选中单元格,否则按注册表(与 Vue 3 轨同口径) */
20
20
  export declare function bindingDescriptorsFor(ctx: ShellCtx, el: RuntimeElement): BindingDescriptor[];
21
- export declare function bindingGroup(ctx: ShellCtx, el: RuntimeElement): import("../core/h").El;
21
+ export declare function bindingGroup(ctx: ShellCtx, el: RuntimeElement): import("@worm-print-platform/plugin-kit/dom").El;
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @worm-print-platform/canvas v1.5.3
2
+ * @worm-print-platform/canvas v1.6.1
3
3
  * Copyright (c) 2026 worm <liu_long_qqcom@qq.com>
4
4
  * SPDX-FileCopyrightText: 2026 worm <liu_long_qqcom@qq.com>
5
5
  * SPDX-License-Identifier: MIT
@@ -58,4 +58,4 @@ export declare function zoneRectsMM(t: TemplateData, paper: {
58
58
  };
59
59
  /** 清徽标与锁存意图(drop 与拖拽会话结束时各调一次) */
60
60
  export declare function clearDropDrag(area: HTMLElement | null | undefined): void;
61
- export declare function renderCanvasArea(ctx: ShellCtx, ui: CanvasUI): import("../core/h").El;
61
+ export declare function renderCanvasArea(ctx: ShellCtx, ui: CanvasUI): import("@worm-print-platform/plugin-kit/dom").El;
@@ -1,11 +1,11 @@
1
1
  /*!
2
- * @worm-print-platform/canvas v1.5.3
2
+ * @worm-print-platform/canvas v1.6.1
3
3
  * Copyright (c) 2026 worm <liu_long_qqcom@qq.com>
4
4
  * SPDX-FileCopyrightText: 2026 worm <liu_long_qqcom@qq.com>
5
5
  * SPDX-License-Identifier: MIT
6
6
  */
7
7
  import type { RuntimeElement } from '@worm-print-platform/core/designer';
8
- export declare function renderQrcode(el: RuntimeElement): import("../core/h").El;
9
- export declare function renderBarcode(el: RuntimeElement): import("../core/h").El;
8
+ export declare function renderQrcode(el: RuntimeElement): import("@worm-print-platform/plugin-kit/dom").El;
9
+ export declare function renderBarcode(el: RuntimeElement): import("@worm-print-platform/plugin-kit/dom").El;
10
10
  /** DOM 落位后绘制所有码类元素;listSource 为宿主注入的设计态数据(画布文本、插件元素同源) */
11
11
  export declare function hydrateCodes(root: ShadowRoot, elements: RuntimeElement[], listSource?: readonly Record<string, unknown>[]): void;
@@ -1,44 +1,8 @@
1
1
  /*!
2
- * @worm-print-platform/canvas v1.5.3
2
+ * @worm-print-platform/canvas v1.6.1
3
3
  * Copyright (c) 2026 worm <liu_long_qqcom@qq.com>
4
4
  * SPDX-FileCopyrightText: 2026 worm <liu_long_qqcom@qq.com>
5
5
  * SPDX-License-Identifier: MIT
6
6
  */
7
- import type { El } from '../core/h';
8
- export interface ColorPickerOptions {
9
- /** 当前色值;空串/undefined 均视为「未设置」 */
10
- value?: string;
11
- /** 是否允许清除(Vue 3 轨 边框等必填场景传 false),默认 true */
12
- clearable?: boolean;
13
- /** 触发按钮 title(Vue 3 轨 侧为色值或「自动」,本包保留调用方传入的字段名语义) */
14
- title?: string;
15
- /** 追加在触发钮上的类名(Vue 3 轨 给组件根挂的 class 会与其自身类名合并,如 `page-bg-picker`) */
16
- triggerClass?: string;
17
- /** 选中回调;undefined 表示清除(Vue 3 轨 emit '' 的等价归一) */
18
- onChange: (value: string | undefined) => void;
19
- }
20
- export declare function parseHex(color: string): {
21
- r: number;
22
- g: number;
23
- b: number;
24
- } | null;
25
- export declare function normalizeHex(color: string): string;
26
- export declare function rgbToHex({ r, g, b }: {
27
- r: number;
28
- g: number;
29
- b: number;
30
- }): string;
31
- export declare function rgbToHsv(r: number, g: number, b: number): {
32
- h: number;
33
- s: number;
34
- v: number;
35
- };
36
- export declare function hsvToRgb(h_: number, s: number, v: number): {
37
- r: number;
38
- g: number;
39
- b: number;
40
- };
41
- /** 触发按钮(对应 Vue 3 轨 的 button.preset-color-trigger);点击在挂载根上开/关面板 */
42
- export declare function colorPicker(opts: ColorPickerOptions): El;
43
- /** 关闭当前打开的面板并解除全部监听(宿主 disconnectedCallback 亦可用) */
44
- export declare function closeColorPicker(): void;
7
+ export { parseHex, normalizeHex, rgbToHex, rgbToHsv, hsvToRgb, colorPicker, closeColorPicker, } from '@worm-print-platform/plugin-kit/controls';
8
+ export type { ColorPickerOptions } from '@worm-print-platform/plugin-kit/controls';
@@ -1,11 +1,13 @@
1
1
  /*!
2
- * @worm-print-platform/canvas v1.5.3
2
+ * @worm-print-platform/canvas v1.6.1
3
3
  * Copyright (c) 2026 worm <liu_long_qqcom@qq.com>
4
4
  * SPDX-FileCopyrightText: 2026 worm <liu_long_qqcom@qq.com>
5
5
  * SPDX-License-Identifier: MIT
6
6
  */
7
+ import type { Translate } from '@worm-print-platform/core/i18n';
7
8
  import type { PrintFontDeclaration } from '@worm-print-platform/core';
8
9
  import type { PrintBusinessField } from '@worm-print-platform/core/designer';
10
+ import type { FieldDisplayMode } from '@worm-print-platform/plugin-kit/expression-editor';
9
11
  import type { DesignerStore } from '../core/store';
10
12
  /** 外壳局部 UI 状态(不落模板数据,仅影响渲染) */
11
13
  export interface ShellState {
@@ -23,6 +25,8 @@ export interface ShellState {
23
25
  openMore?: boolean;
24
26
  /** 字段搜索关键字(仅影响左栏字段树) */
25
27
  fieldSearch?: string;
28
+ /** 宿主注入的字段行显示模式(field-display attribute / property),缺省 both */
29
+ fieldDisplay?: FieldDisplayMode;
26
30
  /** 折叠的字段分组 key */
27
31
  collapsedGroups: Set<string>;
28
32
  /** 最近一次复制成功的字段 key:素材台行内「已复制」提示,1.2s 后清空重绘(对齐 canvas) */
@@ -53,6 +57,10 @@ export interface ShellCtx {
53
57
  showPreview?: boolean;
54
58
  showSave?: boolean;
55
59
  isEdit: boolean;
60
+ /** 当前实例 locale 的翻译函数;由 print-designer 注入,缺省用全局 t */
61
+ t?: import('@worm-print-platform/core/i18n').Translate;
62
+ /** 当前实例 locale BCP47(模块级常量 label 翻译用) */
63
+ lang?: string;
56
64
  /** 宿主注入能力(图片上传、设计背景上传、字体清单),未注入时相关入口置灰 */
57
65
  host: {
58
66
  uploadImage?: (file: File) => Promise<string>;
@@ -65,6 +73,16 @@ export interface ShellCtx {
65
73
  fields?: readonly PrintBusinessField[];
66
74
  };
67
75
  }
76
+ /** 外壳文案翻译:优先实例 translator,缺省回退 core 全局 t */
77
+ export declare function tr(ctx: {
78
+ t?: import('@worm-print-platform/core/i18n').Translate;
79
+ }, key: string, params?: Record<string, string | number>): string;
80
+ export declare function withRenderTranslator(t: Translate, paint: () => void): void;
81
+ /**
82
+ * 无 ctx 作用域(模块级常量与工具函数)的翻译:
83
+ * 绘制期间优先取实例 translator,其余场景回落 core 全局 locale。
84
+ */
85
+ export declare function trG(key: string, params?: Record<string, string | number>): string;
68
86
  /** 带图标的工具栏按钮(对应 Vue 3 轨 的 .tb-btn.tb-icon) */
69
87
  export declare function tbIconBtn(ctx: ShellCtx, iconName: string, action: string, opts: {
70
88
  tip: string;
@@ -73,7 +91,7 @@ export declare function tbIconBtn(ctx: ShellCtx, iconName: string, action: strin
73
91
  danger?: boolean;
74
92
  arg?: unknown;
75
93
  test?: string;
76
- }): import("../core/h").El;
94
+ }): import("@worm-print-platform/plugin-kit/dom").El;
77
95
  /** 下拉壳:触发钮 + 面板,面板内容由调用方给出(对应 Vue 3 轨 的 ToolbarDropdown) */
78
96
  export declare function dropdown(ctx: ShellCtx, id: string, opts: {
79
97
  tip: string;
@@ -83,7 +101,7 @@ export declare function dropdown(ctx: ShellCtx, id: string, opts: {
83
101
  disabled?: boolean;
84
102
  testId?: string;
85
103
  panelClass?: string;
86
- }, panel: unknown[]): import("../core/h").El;
104
+ }, panel: unknown[]): import("@worm-print-platform/plugin-kit/dom").El;
87
105
  /** 步进数字输入(对应 Vue 3 轨 的 property/StepperInput) */
88
106
  export declare function stepper(opts: {
89
107
  value?: number;
@@ -93,13 +111,13 @@ export declare function stepper(opts: {
93
111
  placeholder?: string;
94
112
  disabled?: boolean;
95
113
  onCommit: (v: number) => void;
96
- }): import("../core/h").El;
114
+ }): import("@worm-print-platform/plugin-kit/dom").El;
97
115
  /** 属性行:pd-field > pd-label(.pd-label-t + 恢复默认值) + 控件 */
98
- export declare function field(label: string, control: unknown, hint?: string, reset?: unknown): import("../core/h").El;
116
+ export declare function field(label: string, control: unknown, hint?: string, reset?: unknown): import("@worm-print-platform/plugin-kit/dom").El;
99
117
  /** 字段说明图标:说明不常驻行内,悬浮或点击聚焦时才浮出(对应 Vue 3 轨 的 button.pd-help) */
100
- export declare const labelHelp: (tip: string) => import("../core/h").El;
118
+ export declare const labelHelp: (tip: string) => import("@worm-print-platform/plugin-kit/dom").El;
101
119
  /** 带说明图标的属性行:与 field() 同结构,差别只在说明挂图标而非常驻 .pd-hint 段落 */
102
- export declare function fieldHelp(label: string, control: unknown, tip: string, reset?: unknown): import("../core/h").El;
120
+ export declare function fieldHelp(label: string, control: unknown, tip: string, reset?: unknown): import("@worm-print-platform/plugin-kit/dom").El;
103
121
  /**
104
122
  * 「恢复默认值」按钮,与 Vue 3 轨的 property/ResetButton.vue 逐字同构。
105
123
  * 落点派生自 base[propKey]:判据一律 === 比出厂值,base 里取到 undefined 即「未设」,
@@ -122,18 +140,18 @@ export declare function resetButton(o: {
122
140
  onReset?: () => void;
123
141
  /** 多选批量档:不显示"已改"脏点(判据取自单格会误导),但按钮恒可点,写回整选区 */
124
142
  force?: boolean;
125
- }): import("../core/h").El;
143
+ }): import("@worm-print-platform/plugin-kit/dom").El;
126
144
  /** 分节标题(对应 Vue 3 轨 的 h3.pd-divider) */
127
- export declare const divider: (text: string) => import("../core/h").El;
145
+ export declare const divider: (text: string) => import("@worm-print-platform/plugin-kit/dom").El;
128
146
  /** 颜色触发钮:预设色板面板(移植 Vue 3 轨的 PresetColorPicker.vue,面板实现见 shell/color-picker.ts)。
129
147
  * onPick 收到的 undefined 表示「清除颜色」:Vue 3 轨侧 emit '' 后由消费方归一化为未设置,
130
148
  * 本包在触发器层直接归一后透传,调用方 patch 即删除该颜色属性(签名保持 (v: string) 不变)。 */
131
- export declare function colorTrigger(value: string | undefined, onPick: (v: string) => void, title?: string, triggerClass?: string): import("../core/h").El;
149
+ export declare function colorTrigger(value: string | undefined, onPick: (v: string) => void, title?: string, triggerClass?: string): import("@worm-print-platform/plugin-kit/dom").El;
132
150
  /** 单选组(对应 Vue 3 轨 的 .pd-radio-group) */
133
151
  export declare function radioGroup(name: string, options: {
134
152
  value: string;
135
153
  label: string;
136
- }[], current: string, onChange: (v: string) => void, twoCol?: boolean): import("../core/h").El;
154
+ }[], current: string, onChange: (v: string) => void, twoCol?: boolean): import("@worm-print-platform/plugin-kit/dom").El;
137
155
  /**
138
156
  * 裸下拉(无 label 包裹,用于 .border-style-row 这类横向控件行)。
139
157
  * 不能只靠 <option selected> 属性:happy-dom/部分内核在"首项未选中、第三项选中"时会回落到第二项,
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @worm-print-platform/canvas v1.5.3
2
+ * @worm-print-platform/canvas v1.6.1
3
3
  * Copyright (c) 2026 worm <liu_long_qqcom@qq.com>
4
4
  * SPDX-FileCopyrightText: 2026 worm <liu_long_qqcom@qq.com>
5
5
  * SPDX-License-Identifier: MIT
@@ -26,4 +26,4 @@ export interface CropAnchorOpts {
26
26
  onCommit: (value: string | undefined) => void;
27
27
  onScaleCommit: (value: number | undefined) => void;
28
28
  }
29
- export declare function cropAnchorField(ctx: ShellCtx, o: CropAnchorOpts): import("../core/h").El;
29
+ export declare function cropAnchorField(ctx: ShellCtx, o: CropAnchorOpts): import("@worm-print-platform/plugin-kit/dom").El;
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @worm-print-platform/canvas v1.5.3
2
+ * @worm-print-platform/canvas v1.6.1
3
3
  * Copyright (c) 2026 worm <liu_long_qqcom@qq.com>
4
4
  * SPDX-FileCopyrightText: 2026 worm <liu_long_qqcom@qq.com>
5
5
  * SPDX-License-Identifier: MIT
@@ -25,6 +25,6 @@ export declare function positionLabel(o: {
25
25
  width: number;
26
26
  height: number;
27
27
  }): string;
28
- export declare function renderDesignElement(ctx: ShellCtx, el: RuntimeElement, followMemberIds?: Set<string>): import("../core/h").El;
28
+ export declare function renderDesignElement(ctx: ShellCtx, el: RuntimeElement, followMemberIds?: Set<string>): import("@worm-print-platform/plugin-kit/dom").El;
29
29
  /** mm → px(供画布几何换算复用同一口径) */
30
30
  export { mmToPx };
@@ -1,33 +1,8 @@
1
1
  /*!
2
- * @worm-print-platform/canvas v1.5.3
2
+ * @worm-print-platform/canvas v1.6.1
3
3
  * Copyright (c) 2026 worm <liu_long_qqcom@qq.com>
4
4
  * SPDX-FileCopyrightText: 2026 worm <liu_long_qqcom@qq.com>
5
5
  * SPDX-License-Identifier: MIT
6
6
  */
7
- import type { PrintBusinessField } from '@worm-print-platform/core/designer';
8
- import type { El } from '../core/h';
9
- export interface ExpressionEditorTarget {
10
- /** 元素 id(表格单元格时用于定位) */
11
- elementId: string;
12
- /** 要写回的目标路径,如 'options.formatter' 或 'cell:<rowId>:<colIndex>' */
13
- targetPath: string;
14
- /** 当前表达式文本 */
15
- value: string;
16
- /** 可选:字段绑定模式的初始字段 key */
17
- binding?: string;
18
- }
19
- export interface ExpressionEditorOptions {
20
- fields: PrintBusinessField[];
21
- /** 求值预览用的样例行数据 */
22
- demoData?: Record<string, any>;
23
- /** 关闭弹窗 */
24
- onClose: () => void;
25
- /** 点确定:把最终表达式回写 */
26
- onApply: (next: {
27
- formatter?: string;
28
- binding?: string;
29
- title?: string;
30
- }) => void;
31
- }
32
- /** 渲染表达式编辑器弹窗的 DOM 描述(内部已含遮罩层,render 进 shadow 根下即可) */
33
- export declare function renderExpressionEditor(opts: ExpressionEditorOptions, target: ExpressionEditorTarget): El;
7
+ export { renderExpressionEditor, normalizeFieldDisplay } from '@worm-print-platform/plugin-kit/expression-editor';
8
+ export type { ExpressionEditorTarget, ExpressionEditorOptions, FieldDisplayMode } from '@worm-print-platform/plugin-kit/expression-editor';
@@ -1,12 +1,10 @@
1
1
  /*!
2
- * @worm-print-platform/canvas v1.5.3
2
+ * @worm-print-platform/canvas v1.6.1
3
3
  * Copyright (c) 2026 worm <liu_long_qqcom@qq.com>
4
4
  * SPDX-FileCopyrightText: 2026 worm <liu_long_qqcom@qq.com>
5
5
  * SPDX-License-Identifier: MIT
6
6
  */
7
7
  import type { RuntimeElement } from '@worm-print-platform/core/designer';
8
8
  import type { DesignerStore } from '../core/store';
9
- /** 与 Vue 3 轨 FlowListElement 的 DESIGN_FALLBACK_ITEMS 逐字一致:新拖入的元素也要看得见形状 */
10
- export declare const FLOW_LIST_DEMO_ITEMS: string[];
11
9
  export declare function flowListCells(el: RuntimeElement, data?: Record<string, any>[]): string[];
12
- export declare function renderFlowListElement(el: RuntimeElement, data?: Record<string, any>[], store?: DesignerStore): import("../core/h").El;
10
+ export declare function renderFlowListElement(el: RuntimeElement, data?: Record<string, any>[], store?: DesignerStore): import("@worm-print-platform/plugin-kit/dom").El;
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @worm-print-platform/canvas v1.5.3
2
+ * @worm-print-platform/canvas v1.6.1
3
3
  * Copyright (c) 2026 worm <liu_long_qqcom@qq.com>
4
4
  * SPDX-FileCopyrightText: 2026 worm <liu_long_qqcom@qq.com>
5
5
  * SPDX-License-Identifier: MIT
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @worm-print-platform/canvas v1.5.3
2
+ * @worm-print-platform/canvas v1.6.1
3
3
  * Copyright (c) 2026 worm <liu_long_qqcom@qq.com>
4
4
  * SPDX-FileCopyrightText: 2026 worm <liu_long_qqcom@qq.com>
5
5
  * SPDX-License-Identifier: MIT
@@ -10,6 +10,6 @@ import type { FormatToolbar } from '../core/format';
10
10
  type FormatCtx = ShellCtx & {
11
11
  format: FormatToolbar;
12
12
  };
13
- export declare function renderFormatBar(ctx: FormatCtx): import("../core/h").El;
13
+ export declare function renderFormatBar(ctx: FormatCtx): import("@worm-print-platform/plugin-kit/dom").El;
14
14
  /** 供状态栏/属性面板复用的排版行(保持与 Vue 3 轨同类名) */
15
15
  export { field as formatField };
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @worm-print-platform/canvas v1.5.3
2
+ * @worm-print-platform/canvas v1.6.1
3
3
  * Copyright (c) 2026 worm <liu_long_qqcom@qq.com>
4
4
  * SPDX-FileCopyrightText: 2026 worm <liu_long_qqcom@qq.com>
5
5
  * SPDX-License-Identifier: MIT
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @worm-print-platform/canvas v1.5.3
2
+ * @worm-print-platform/canvas v1.6.1
3
3
  * Copyright (c) 2026 worm <liu_long_qqcom@qq.com>
4
4
  * SPDX-FileCopyrightText: 2026 worm <liu_long_qqcom@qq.com>
5
5
  * SPDX-License-Identifier: MIT
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @worm-print-platform/canvas v1.5.3
2
+ * @worm-print-platform/canvas v1.6.1
3
3
  * Copyright (c) 2026 worm <liu_long_qqcom@qq.com>
4
4
  * SPDX-FileCopyrightText: 2026 worm <liu_long_qqcom@qq.com>
5
5
  * SPDX-License-Identifier: MIT
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @worm-print-platform/canvas v1.5.3
2
+ * @worm-print-platform/canvas v1.6.1
3
3
  * Copyright (c) 2026 worm <liu_long_qqcom@qq.com>
4
4
  * SPDX-FileCopyrightText: 2026 worm <liu_long_qqcom@qq.com>
5
5
  * SPDX-License-Identifier: MIT
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @worm-print-platform/canvas v1.5.3
2
+ * @worm-print-platform/canvas v1.6.1
3
3
  * Copyright (c) 2026 worm <liu_long_qqcom@qq.com>
4
4
  * SPDX-FileCopyrightText: 2026 worm <liu_long_qqcom@qq.com>
5
5
  * SPDX-License-Identifier: MIT
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @worm-print-platform/canvas v1.5.3
2
+ * @worm-print-platform/canvas v1.6.1
3
3
  * Copyright (c) 2026 worm <liu_long_qqcom@qq.com>
4
4
  * SPDX-FileCopyrightText: 2026 worm <liu_long_qqcom@qq.com>
5
5
  * SPDX-License-Identifier: MIT
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @worm-print-platform/canvas v1.5.3
2
+ * @worm-print-platform/canvas v1.6.1
3
3
  * Copyright (c) 2026 worm <liu_long_qqcom@qq.com>
4
4
  * SPDX-FileCopyrightText: 2026 worm <liu_long_qqcom@qq.com>
5
5
  * SPDX-License-Identifier: MIT
@@ -9,5 +9,8 @@ export type HelpSection = {
9
9
  title: string;
10
10
  content: string;
11
11
  };
12
+ /** 未指定语言时默认中文;en-* 走英文;th-* 走泰语;其余回退中文 */
13
+ export declare function getHelpSections(locale?: string): HelpSection[];
14
+ /** zh-CN 别名,供旧的直接引用保持兼容 */
12
15
  export declare const helpSections: HelpSection[];
13
16
  export type { HelpSection as default };
@@ -0,0 +1,12 @@
1
+ /*!
2
+ * @worm-print-platform/canvas v1.6.1
3
+ * Copyright (c) 2026 worm <liu_long_qqcom@qq.com>
4
+ * SPDX-FileCopyrightText: 2026 worm <liu_long_qqcom@qq.com>
5
+ * SPDX-License-Identifier: MIT
6
+ */
7
+ declare const _default: {
8
+ id: string;
9
+ title: string;
10
+ content: string;
11
+ };
12
+ export default _default;
@@ -0,0 +1,12 @@
1
+ /*!
2
+ * @worm-print-platform/canvas v1.6.1
3
+ * Copyright (c) 2026 worm <liu_long_qqcom@qq.com>
4
+ * SPDX-FileCopyrightText: 2026 worm <liu_long_qqcom@qq.com>
5
+ * SPDX-License-Identifier: MIT
6
+ */
7
+ declare const _default: {
8
+ id: string;
9
+ title: string;
10
+ content: string;
11
+ };
12
+ export default _default;
@@ -0,0 +1,12 @@
1
+ /*!
2
+ * @worm-print-platform/canvas v1.6.1
3
+ * Copyright (c) 2026 worm <liu_long_qqcom@qq.com>
4
+ * SPDX-FileCopyrightText: 2026 worm <liu_long_qqcom@qq.com>
5
+ * SPDX-License-Identifier: MIT
6
+ */
7
+ declare const _default: {
8
+ id: string;
9
+ title: string;
10
+ content: string;
11
+ };
12
+ export default _default;
@@ -0,0 +1,12 @@
1
+ /*!
2
+ * @worm-print-platform/canvas v1.6.1
3
+ * Copyright (c) 2026 worm <liu_long_qqcom@qq.com>
4
+ * SPDX-FileCopyrightText: 2026 worm <liu_long_qqcom@qq.com>
5
+ * SPDX-License-Identifier: MIT
6
+ */
7
+ declare const _default: {
8
+ id: string;
9
+ title: string;
10
+ content: string;
11
+ };
12
+ export default _default;
@@ -0,0 +1,12 @@
1
+ /*!
2
+ * @worm-print-platform/canvas v1.6.1
3
+ * Copyright (c) 2026 worm <liu_long_qqcom@qq.com>
4
+ * SPDX-FileCopyrightText: 2026 worm <liu_long_qqcom@qq.com>
5
+ * SPDX-License-Identifier: MIT
6
+ */
7
+ declare const _default: {
8
+ id: string;
9
+ title: string;
10
+ content: string;
11
+ };
12
+ export default _default;
@@ -0,0 +1,12 @@
1
+ /*!
2
+ * @worm-print-platform/canvas v1.6.1
3
+ * Copyright (c) 2026 worm <liu_long_qqcom@qq.com>
4
+ * SPDX-FileCopyrightText: 2026 worm <liu_long_qqcom@qq.com>
5
+ * SPDX-License-Identifier: MIT
6
+ */
7
+ declare const _default: {
8
+ id: string;
9
+ title: string;
10
+ content: string;
11
+ };
12
+ export default _default;
@@ -0,0 +1,12 @@
1
+ /*!
2
+ * @worm-print-platform/canvas v1.6.1
3
+ * Copyright (c) 2026 worm <liu_long_qqcom@qq.com>
4
+ * SPDX-FileCopyrightText: 2026 worm <liu_long_qqcom@qq.com>
5
+ * SPDX-License-Identifier: MIT
6
+ */
7
+ declare const _default: {
8
+ id: string;
9
+ title: string;
10
+ content: string;
11
+ };
12
+ export default _default;
@@ -0,0 +1,12 @@
1
+ /*!
2
+ * @worm-print-platform/canvas v1.6.1
3
+ * Copyright (c) 2026 worm <liu_long_qqcom@qq.com>
4
+ * SPDX-FileCopyrightText: 2026 worm <liu_long_qqcom@qq.com>
5
+ * SPDX-License-Identifier: MIT
6
+ */
7
+ declare const _default: {
8
+ id: string;
9
+ title: string;
10
+ content: string;
11
+ };
12
+ export default _default;
@@ -0,0 +1,12 @@
1
+ /*!
2
+ * @worm-print-platform/canvas v1.6.1
3
+ * Copyright (c) 2026 worm <liu_long_qqcom@qq.com>
4
+ * SPDX-FileCopyrightText: 2026 worm <liu_long_qqcom@qq.com>
5
+ * SPDX-License-Identifier: MIT
6
+ */
7
+ declare const _default: {
8
+ id: string;
9
+ title: string;
10
+ content: string;
11
+ };
12
+ export default _default;
@@ -0,0 +1,12 @@
1
+ /*!
2
+ * @worm-print-platform/canvas v1.6.1
3
+ * Copyright (c) 2026 worm <liu_long_qqcom@qq.com>
4
+ * SPDX-FileCopyrightText: 2026 worm <liu_long_qqcom@qq.com>
5
+ * SPDX-License-Identifier: MIT
6
+ */
7
+ declare const _default: {
8
+ id: string;
9
+ title: string;
10
+ content: string;
11
+ };
12
+ export default _default;
@@ -0,0 +1,12 @@
1
+ /*!
2
+ * @worm-print-platform/canvas v1.6.1
3
+ * Copyright (c) 2026 worm <liu_long_qqcom@qq.com>
4
+ * SPDX-FileCopyrightText: 2026 worm <liu_long_qqcom@qq.com>
5
+ * SPDX-License-Identifier: MIT
6
+ */
7
+ declare const _default: {
8
+ id: string;
9
+ title: string;
10
+ content: string;
11
+ };
12
+ export default _default;
@@ -0,0 +1,12 @@
1
+ /*!
2
+ * @worm-print-platform/canvas v1.6.1
3
+ * Copyright (c) 2026 worm <liu_long_qqcom@qq.com>
4
+ * SPDX-FileCopyrightText: 2026 worm <liu_long_qqcom@qq.com>
5
+ * SPDX-License-Identifier: MIT
6
+ */
7
+ declare const _default: {
8
+ id: string;
9
+ title: string;
10
+ content: string;
11
+ };
12
+ export default _default;
@@ -1,13 +1,18 @@
1
1
  /*!
2
- * @worm-print-platform/canvas v1.5.3
2
+ * @worm-print-platform/canvas v1.6.1
3
3
  * Copyright (c) 2026 worm <liu_long_qqcom@qq.com>
4
4
  * SPDX-FileCopyrightText: 2026 worm <liu_long_qqcom@qq.com>
5
5
  * SPDX-License-Identifier: MIT
6
6
  */
7
+ import type { Translate } from '@worm-print-platform/core/i18n';
7
8
  import type { El } from '../core/h';
8
9
  export interface HelpModalOptions {
9
10
  /** 首次打开的页签(Vue 3 轨 的 initialTab,默认「快速入门」) */
10
11
  initialTab?: string;
12
+ /** 语言包标识;en-* 显示英文帮助,其余中文(正文/页签本期静态,自定义语言回退中文) */
13
+ locale?: string;
14
+ /** 外壳标题/关闭按钮的实例取词器;未传时按 locale 取全局 */
15
+ t?: Translate;
11
16
  onClose: () => void;
12
17
  }
13
18
  /** 渲染帮助弹窗(调用方负责挂到 shadow root 上) */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @worm-print-platform/canvas v1.5.3
2
+ * @worm-print-platform/canvas v1.6.1
3
3
  * Copyright (c) 2026 worm <liu_long_qqcom@qq.com>
4
4
  * SPDX-FileCopyrightText: 2026 worm <liu_long_qqcom@qq.com>
5
5
  * SPDX-License-Identifier: MIT