@worm-vue3-print/common 1.3.7-beta.0 → 1.4.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.
Files changed (44) hide show
  1. package/README.md +189 -11
  2. package/dist/browser-bundle.d.ts +3 -1
  3. package/dist/common.css +65 -1
  4. package/dist/common.js +184 -77
  5. package/dist/core/default-template.d.ts +1 -1
  6. package/dist/core/format.d.ts +34 -14
  7. package/dist/core/h.d.ts +1 -1
  8. package/dist/core/icons.d.ts +1 -1
  9. package/dist/core/store.d.ts +1 -1
  10. package/dist/index.cjs +112 -9
  11. package/dist/index.d.ts +1 -1
  12. package/dist/index.js +3752 -3113
  13. package/dist/print-designer.d.ts +11 -6
  14. package/dist/shell/binding.d.ts +1 -1
  15. package/dist/shell/canvas.d.ts +1 -1
  16. package/dist/shell/code.d.ts +1 -1
  17. package/dist/shell/color-picker.d.ts +1 -1
  18. package/dist/shell/controls.d.ts +42 -5
  19. package/dist/shell/crop-anchor.d.ts +29 -0
  20. package/dist/shell/elements.d.ts +3 -3
  21. package/dist/shell/expression-editor.d.ts +1 -1
  22. package/dist/shell/flow-list.d.ts +11 -0
  23. package/dist/shell/font-select.d.ts +4 -4
  24. package/dist/shell/format-bar.d.ts +1 -1
  25. package/dist/shell/help-content/changelog.d.ts +1 -1
  26. package/dist/shell/help-content/faq.d.ts +1 -1
  27. package/dist/shell/help-content/features.d.ts +1 -1
  28. package/dist/shell/help-content/getting-started.d.ts +1 -1
  29. package/dist/shell/help-content/index.d.ts +1 -1
  30. package/dist/shell/help-content/shortcuts.d.ts +1 -1
  31. package/dist/shell/help-modal.d.ts +1 -1
  32. package/dist/shell/page-extras.d.ts +4 -3
  33. package/dist/shell/panels.d.ts +1 -1
  34. package/dist/shell/prop-group.d.ts +1 -1
  35. package/dist/shell/property-panel.d.ts +4 -3
  36. package/dist/shell/property-search.d.ts +1 -1
  37. package/dist/shell/ruler.d.ts +1 -1
  38. package/dist/shell/table-props.d.ts +1 -1
  39. package/dist/shell/table.d.ts +1 -1
  40. package/dist/shell/toolbar-overflow.d.ts +1 -1
  41. package/dist/shell/toolbar.d.ts +1 -1
  42. package/dist/shell/watermark.d.ts +3 -2
  43. package/package.json +7 -3
  44. package/dist/core/font-catalog.d.ts +0 -30
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @worm-vue3-print/common v1.3.7-beta.0
2
+ * @worm-vue3-print/common v1.4.0
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
@@ -34,9 +34,9 @@ export declare class PrintDesignerElement extends HTMLElement {
34
34
  private unmountHelp;
35
35
  private drag;
36
36
  private snapTimer;
37
- /** 页签 tooltip:挂在 shadow root 上的浮层(canvas 的 .page-tabs-tip 等价物) */
38
- private pageTipEl;
39
- private pageTipTimer;
37
+ /** 悬浮提示浮层:挂在 shadow root 上(canvas 的 useHoverTip / .pd-hover-tip 等价物) */
38
+ private hoverTipEl;
39
+ private hoverTipTimer;
40
40
  private resize;
41
41
  private raf;
42
42
  private lastSelKey;
@@ -79,6 +79,11 @@ export declare class PrintDesignerElement extends HTMLElement {
79
79
  save(): void;
80
80
  /** 拼版配置校验:getTemplateJson 是旁路,宿主导出/另存时需自行调用拦截 */
81
81
  validateTemplate(): import("@worm-vue3-print/core").TilingIssue[];
82
+ /**
83
+ * 出纸裁切提示(旋转外接盒顶越页首、元素超出纸面左右缘),与 canvas 同名同口径。
84
+ * 预估口径:编辑期无实测高,自适应行高按设计盒估算 ⇒ 只提示、不阻断保存。
85
+ */
86
+ getGeometryWarnings(): string[];
82
87
  private applyTemplate;
83
88
  private openExpression;
84
89
  private closeExpression;
@@ -163,8 +168,8 @@ export declare class PrintDesignerElement extends HTMLElement {
163
168
  private onWheel;
164
169
  private onScroll;
165
170
  private bindPointer;
166
- private showPageTip;
167
- private hidePageTip;
171
+ private showHoverTip;
172
+ private hideHoverTip;
168
173
  private manualGuides;
169
174
  /** 仅重绘吸附引导线,避免拖拽中全量重建 DOM */
170
175
  private paintGuidesOnly;
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @worm-vue3-print/common v1.3.7-beta.0
2
+ * @worm-vue3-print/common v1.4.0
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-vue3-print/common v1.3.7-beta.0
2
+ * @worm-vue3-print/common v1.4.0
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-vue3-print/common v1.3.7-beta.0
2
+ * @worm-vue3-print/common v1.4.0
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-vue3-print/common v1.3.7-beta.0
2
+ * @worm-vue3-print/common v1.4.0
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-vue3-print/common v1.3.7-beta.0
2
+ * @worm-vue3-print/common v1.4.0
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
@@ -50,7 +50,8 @@ export interface ShellCtx {
50
50
  host: {
51
51
  uploadImage?: (file: File) => Promise<string>;
52
52
  uploadDesignBackground?: (file: File) => Promise<string>;
53
- fonts?: readonly (string | PrintFontDeclaration)[];
53
+ /** 模板级字体声明,与 canvas 的 PrintDesigner `fonts` prop 同类型(裸字符串族名不参与候选,与画布一致) */
54
+ fonts?: readonly PrintFontDeclaration[];
54
55
  };
55
56
  }
56
57
  /** 带图标的工具栏按钮(对应 canvas 的 .tb-btn.tb-icon) */
@@ -82,12 +83,35 @@ export declare function stepper(opts: {
82
83
  disabled?: boolean;
83
84
  onCommit: (v: number) => void;
84
85
  }): import("../core/h").El;
85
- /** 属性行:pd-field > pd-label + 控件 */
86
- export declare function field(label: string, control: unknown, hint?: string): import("../core/h").El;
86
+ /** 属性行:pd-field > pd-label(.pd-label-t + 恢复默认值) + 控件 */
87
+ export declare function field(label: string, control: unknown, hint?: string, reset?: unknown): import("../core/h").El;
87
88
  /** 字段说明图标:说明不常驻行内,悬浮或点击聚焦时才浮出(对应 canvas 的 button.pd-help) */
88
89
  export declare const labelHelp: (tip: string) => import("../core/h").El;
89
90
  /** 带说明图标的属性行:与 field() 同结构,差别只在说明挂图标而非常驻 .pd-hint 段落 */
90
- export declare function fieldHelp(label: string, control: unknown, tip: string): import("../core/h").El;
91
+ export declare function fieldHelp(label: string, control: unknown, tip: string, reset?: unknown): import("../core/h").El;
92
+ /**
93
+ * 「恢复默认值」按钮,与 canvas 的 property/ResetButton.vue 逐字同构。
94
+ * 落点派生自 base[propKey]:判据一律 === 比出厂值,base 里取到 undefined 即「未设」,
95
+ * 写回它天然等于删键。0 与 undefined 是两个状态,不得用 ?? / || 归并。
96
+ * 外壳是全量重绘模型,灰/亮在构造时求值即可,不需要响应式。
97
+ * 按钮不带任何文本子节点——属性搜索按 .pd-label 的 textContent 匹配,写字会污染命中。
98
+ */
99
+ export declare function resetButton(o: {
100
+ target: Record<string, any>;
101
+ base: Record<string, any>;
102
+ propKey: string;
103
+ /** 提示语数值:仅用于文案,不参与判定 */
104
+ tipValue?: number | string;
105
+ tipUnit?: string;
106
+ /** 覆盖整条提示(单元格级固定用「跟随表格默认」,回落目标是该表自己的默认) */
107
+ tipOverride?: string;
108
+ /** 覆盖写回通道:单元格组必须整选区恢复,不能让按钮只改当前展示的那一个 cell 对象 */
109
+ write?: (value: any) => void;
110
+ /** 写回后的收尾(重绘 / 记历史);不提供时只改对象 */
111
+ onReset?: () => void;
112
+ /** 多选批量档:不显示"已改"脏点(判据取自单格会误导),但按钮恒可点,写回整选区 */
113
+ force?: boolean;
114
+ }): import("../core/h").El;
91
115
  /** 分节标题(对应 canvas 的 h3.pd-divider) */
92
116
  export declare const divider: (text: string) => import("../core/h").El;
93
117
  /** 颜色触发钮:预设色板面板(移植 canvas 的 PresetColorPicker.vue,面板实现见 shell/color-picker.ts)。
@@ -99,3 +123,16 @@ export declare function radioGroup(name: string, options: {
99
123
  value: string;
100
124
  label: string;
101
125
  }[], current: string, onChange: (v: string) => void, twoCol?: boolean): import("../core/h").El;
126
+ /**
127
+ * 裸下拉(无 label 包裹,用于 .border-style-row 这类横向控件行)。
128
+ * 不能只靠 <option selected> 属性:happy-dom/部分内核在"首项未选中、第三项选中"时会回落到第二项,
129
+ * 必须建真节点后显式 select.value = 当前值(与 selectField 同一套可靠赋值)。
130
+ */
131
+ export declare function plainSelect(value: string, options: {
132
+ value: string;
133
+ label: string;
134
+ disabled?: boolean;
135
+ }[], onChange: (v: string) => void, attrs?: {
136
+ className?: string;
137
+ width?: string;
138
+ }): HTMLSelectElement;
@@ -0,0 +1,29 @@
1
+ /*!
2
+ * @worm-vue3-print/common v1.4.0
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
+ import type { ShellCtx } from './controls';
8
+ export interface CropAnchorOpts {
9
+ fieldKey: string;
10
+ label: string;
11
+ /** 容器类名:canvas 只在单元格台包一层 `pd-cell-anchor`(`TableCellGroup.vue`),元素台没有包层;缺省沿用本包 `pd-crop-anchor` */
12
+ containerClass?: string;
13
+ /** 已解析的图片地址(表达式由宿主求值后传入);为空则回落内置示例图 */
14
+ src: string;
15
+ widthMm: number;
16
+ heightMm: number;
17
+ /** 缩放模式(CSS object-fit 原值,缺省按 contain):可挪余量按它逐轴结算 */
18
+ fit?: string;
19
+ /** 剪裁放大比例(%):只有 cover 消费,铺满后把画面再推大这么多 */
20
+ scale?: number;
21
+ /** 行尾「恢复默认值」图标:落点由宿主按所在层构造(元素级派生出厂值、单元格级删自身值),
22
+ * 本组件只负责把它摆进标签行右端,与 canvas 的 CropAnchorField 同一 DOM 结构 */
23
+ resetAnchor?: unknown;
24
+ resetScale?: unknown;
25
+ value?: string;
26
+ onCommit: (value: string | undefined) => void;
27
+ onScaleCommit: (value: number | undefined) => void;
28
+ }
29
+ export declare function cropAnchorField(ctx: ShellCtx, o: CropAnchorOpts): import("../core/h").El;
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @worm-vue3-print/common v1.3.7-beta.0
2
+ * @worm-vue3-print/common v1.4.0
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
@@ -8,7 +8,7 @@ import { mmToPx } from '@worm-vue3-print/core/designer';
8
8
  import type { RuntimeElement } from '@worm-vue3-print/core/designer';
9
9
  import type { ShellCtx } from './controls';
10
10
  /** 元素几何与边框(对齐 BaseElement.elementStyle) */
11
- export declare function elementStyle(el: RuntimeElement): Record<string, string>;
11
+ export declare function elementStyle(el: RuntimeElement, followMemberIds?: Set<string>): Record<string, string>;
12
12
  /** 文本与长文本共用的行内样式:与 canvas 的 TextElement / LongTextElement 逐项一致(差异按类型分支) */
13
13
  export declare function textLikeStyle(el: RuntimeElement): {
14
14
  style: Record<string, string>;
@@ -22,6 +22,6 @@ export declare function positionLabel(o: {
22
22
  width: number;
23
23
  height: number;
24
24
  }): string;
25
- export declare function renderDesignElement(ctx: ShellCtx, el: RuntimeElement): import("../core/h").El;
25
+ export declare function renderDesignElement(ctx: ShellCtx, el: RuntimeElement, followMemberIds?: Set<string>): import("../core/h").El;
26
26
  /** mm → px(供画布几何换算复用同一口径) */
27
27
  export { mmToPx };
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @worm-vue3-print/common v1.3.7-beta.0
2
+ * @worm-vue3-print/common v1.4.0
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
@@ -0,0 +1,11 @@
1
+ /*!
2
+ * @worm-vue3-print/common v1.4.0
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
+ import type { RuntimeElement } from '@worm-vue3-print/core/designer';
8
+ /** 与 canvas FlowListElement 的 DESIGN_FALLBACK_ITEMS 逐字一致:新拖入的元素也要看得见形状 */
9
+ export declare const FLOW_LIST_DEMO_ITEMS: string[];
10
+ export declare function flowListCells(el: RuntimeElement, data?: Record<string, any>[]): string[];
11
+ export declare function renderFlowListElement(el: RuntimeElement, data?: Record<string, any>[]): import("../core/h").El;
@@ -1,18 +1,18 @@
1
1
  /*!
2
- * @worm-vue3-print/common v1.3.7-beta.0
2
+ * @worm-vue3-print/common v1.4.0
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 { FontOption } from '../core/font-catalog';
7
+ import type { FontCatalogOption, PrintFontDeclaration } from '@worm-vue3-print/core';
8
8
  import type { ShellState } from './controls';
9
9
  export interface FontSelectOptions {
10
10
  /** 实例标识:同一时刻只允许一个字体下拉处于展开态 */
11
11
  id: string;
12
12
  /** 外壳状态:展开态落在这里,跨重绘保持 */
13
13
  state: ShellState;
14
- /** 宿主注入的字体清单(字符串或字体声明均可) */
15
- fonts?: readonly (string | FontOption)[];
14
+ /** 宿主注入的字体清单:条目须是字体声明(family/label,`files` 由宿主侧携带),裸字符串不进候选——与画布同一判据 */
15
+ fonts?: readonly (FontCatalogOption | PrintFontDeclaration | null | undefined)[];
16
16
  /** 当前族名;undefined 表示未设置,走全局兜底字体栈 */
17
17
  value?: string;
18
18
  /** 空值行文案(同时用作输入框 placeholder) */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @worm-vue3-print/common v1.3.7-beta.0
2
+ * @worm-vue3-print/common v1.4.0
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-vue3-print/common v1.3.7-beta.0
2
+ * @worm-vue3-print/common v1.4.0
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-vue3-print/common v1.3.7-beta.0
2
+ * @worm-vue3-print/common v1.4.0
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-vue3-print/common v1.3.7-beta.0
2
+ * @worm-vue3-print/common v1.4.0
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-vue3-print/common v1.3.7-beta.0
2
+ * @worm-vue3-print/common v1.4.0
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-vue3-print/common v1.3.7-beta.0
2
+ * @worm-vue3-print/common v1.4.0
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-vue3-print/common v1.3.7-beta.0
2
+ * @worm-vue3-print/common v1.4.0
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-vue3-print/common v1.3.7-beta.0
2
+ * @worm-vue3-print/common v1.4.0
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,10 +1,11 @@
1
1
  /*!
2
- * @worm-vue3-print/common v1.3.7-beta.0
2
+ * @worm-vue3-print/common v1.4.0
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';
7
8
  import type { ShellCtx } from './controls';
8
- export declare function designBackgroundSection(ctx: ShellCtx): import("../core/h").El;
9
+ export declare function designBackgroundSection(ctx: ShellCtx): El;
9
10
  /** 拼版打印:开关 + 目标纸 + 留白 + 间距列数 + 校验与摘要 */
10
- export declare function tilingSection(ctx: ShellCtx): import("../core/h").El;
11
+ export declare function tilingSection(ctx: ShellCtx): El;
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @worm-vue3-print/common v1.3.7-beta.0
2
+ * @worm-vue3-print/common v1.4.0
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-vue3-print/common v1.3.7-beta.0
2
+ * @worm-vue3-print/common v1.4.0
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,14 +1,15 @@
1
1
  /*!
2
- * @worm-vue3-print/common v1.3.7-beta.0
2
+ * @worm-vue3-print/common v1.4.0
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';
7
8
  import type { ShellCtx } from './controls';
8
9
  /** 下拉属性行 */
9
10
  /** 下拉属性行(导出仅供单测断言未设置态,包公开入口不导出) */
10
11
  export declare function selectField(_ctx: ShellCtx, label: string, value: string, options: {
11
12
  value: string;
12
13
  label: string;
13
- }[], onCommit: (v: string) => void, tip?: string): import("../core/h").El;
14
- export declare function renderPropertyPanel(ctx: ShellCtx): import("../core/h").El;
14
+ }[], onCommit: (v: string) => void, tip?: string, reset?: El): El;
15
+ export declare function renderPropertyPanel(ctx: ShellCtx): El;
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @worm-vue3-print/common v1.3.7-beta.0
2
+ * @worm-vue3-print/common v1.4.0
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-vue3-print/common v1.3.7-beta.0
2
+ * @worm-vue3-print/common v1.4.0
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-vue3-print/common v1.3.7-beta.0
2
+ * @worm-vue3-print/common v1.4.0
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-vue3-print/common v1.3.7-beta.0
2
+ * @worm-vue3-print/common v1.4.0
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-vue3-print/common v1.3.7-beta.0
2
+ * @worm-vue3-print/common v1.4.0
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-vue3-print/common v1.3.7-beta.0
2
+ * @worm-vue3-print/common v1.4.0
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,10 +1,11 @@
1
1
  /*!
2
- * @worm-vue3-print/common v1.3.7-beta.0
2
+ * @worm-vue3-print/common v1.4.0
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';
7
8
  import type { ShellCtx } from './controls';
8
9
  /** 与 canvas 的 isExpressionText 同判定:花括号 / 函数调用 / 字段路径视为表达式 */
9
10
  export declare function isExpressionText(text: string): boolean;
10
- export declare function watermarkSection(ctx: ShellCtx): import("../core/h").El;
11
+ export declare function watermarkSection(ctx: ShellCtx): El;
package/package.json CHANGED
@@ -1,8 +1,12 @@
1
1
  {
2
2
  "name": "@worm-vue3-print/common",
3
- "version": "1.3.7-beta.0",
3
+ "version": "1.4.0",
4
+ "publishConfig": {
5
+ "access": "public",
6
+ "registry": "https://registry.npmjs.org"
7
+ },
4
8
  "type": "module",
5
- "description": "【预览版 · 实验性,不建议用于生产】打印模板设计器的通用宿主适配包:任意框架或无框架宿主均可直接接入(实现为零框架原生 Custom Elements + Shadow DOM),零 Vue/React 依赖,直接消费 @worm-vue3-print/core;Vue 3 项目请使用 @worm-vue3-print/canvas",
9
+ "description": "【实验性,不建议用于生产】打印模板设计器的通用宿主适配包:任意框架或无框架宿主均可直接接入(实现为零框架原生 Custom Elements + Shadow DOM),零 Vue/React 依赖,直接消费 @worm-vue3-print/core;Vue 3 项目请使用 @worm-vue3-print/canvas",
6
10
  "main": "./dist/index.cjs",
7
11
  "module": "./dist/index.js",
8
12
  "types": "./dist/index.d.ts",
@@ -44,7 +48,7 @@
44
48
  "test": "npm run styles && vitest run"
45
49
  },
46
50
  "dependencies": {
47
- "@worm-vue3-print/core": "^1.3.7",
51
+ "@worm-vue3-print/core": "^1.4.0",
48
52
  "dompurify": "^3.4.12",
49
53
  "jsbarcode": "^3.12.3",
50
54
  "qrcode": "^1.5.4"
@@ -1,30 +0,0 @@
1
- /*!
2
- * @worm-vue3-print/common v1.3.7-beta.0
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
- /** 下拉候选项:family 写入模板,label 仅用于界面展示 */
8
- export interface FontOption {
9
- family: string;
10
- label?: string;
11
- }
12
- /** 宿主清单条目:字符串族名,或带 label 的声明(core 的 PrintFontDeclaration 结构兼容) */
13
- export type FontSource = string | FontOption | null | undefined;
14
- /**
15
- * 把宿主注入的字体清单整理为下拉候选项:去空白、丢空值、族名大小写不敏感去重,
16
- * 保留声明顺序(顺序即宿主期望的优先级)。
17
- */
18
- export declare function buildFontCatalog(sources?: readonly FontSource[] | null): readonly FontOption[];
19
- /** 在目录中按族名查找(大小写不敏感) */
20
- export declare function findFontOption(fonts: readonly FontOption[], family?: string): FontOption | undefined;
21
- /** 下拉选项文案:有展示名时补上真实族名(写入模板的值) */
22
- export declare function fontOptionLabel(option: FontOption): string;
23
- /** 匹配用键:小写并去掉全部空白,使用户输入 `ya hei` 与 `yahei` 等价 */
24
- export declare function normalizeFontQuery(value: string): string;
25
- /**
26
- * 模糊过滤字体目录:完全相等 > 前缀 > 子串 > 子序列,同档保持目录原有顺序
27
- * (目录顺序由宿主声明决定,过滤不应打乱)。
28
- * 族名与展示名(label)都参与匹配,设计者按业务名搜也能命中。
29
- */
30
- export declare function filterFontOptions(fonts: readonly FontOption[], query: string): FontOption[];