@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.
- package/README.md +12 -4
- package/dist/browser-bundle.d.ts +1 -1
- package/dist/canvas.css +6 -1
- package/dist/canvas.js +1173 -119
- package/dist/core/default-template.d.ts +1 -1
- package/dist/core/element-definitions.d.ts +1 -1
- package/dist/core/format.d.ts +1 -1
- package/dist/core/h.d.ts +3 -17
- package/dist/core/icons.d.ts +1 -1
- package/dist/core/plugin.d.ts +4 -3
- package/dist/core/store.d.ts +3 -2
- package/dist/host-contract.d.ts +16 -3
- package/dist/index.cjs +1043 -13
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6225 -4961
- package/dist/print-designer.d.ts +22 -3
- package/dist/shell/binding.d.ts +2 -2
- package/dist/shell/canvas.d.ts +2 -2
- package/dist/shell/code.d.ts +3 -3
- package/dist/shell/color-picker.d.ts +3 -39
- package/dist/shell/controls.d.ts +29 -11
- package/dist/shell/crop-anchor.d.ts +2 -2
- package/dist/shell/elements.d.ts +2 -2
- package/dist/shell/expression-editor.d.ts +3 -28
- package/dist/shell/flow-list.d.ts +2 -4
- package/dist/shell/font-select.d.ts +1 -1
- package/dist/shell/format-bar.d.ts +2 -2
- package/dist/shell/help-content/{advanced-settings.d.ts → en-US/advanced-settings.d.ts} +1 -1
- package/dist/shell/help-content/{changelog.d.ts → en-US/changelog.d.ts} +1 -1
- package/dist/shell/help-content/{faq.d.ts → en-US/faq.d.ts} +1 -1
- package/dist/shell/help-content/{features.d.ts → en-US/features.d.ts} +1 -1
- package/dist/shell/help-content/{getting-started.d.ts → en-US/getting-started.d.ts} +1 -1
- package/dist/shell/help-content/{shortcuts.d.ts → en-US/shortcuts.d.ts} +1 -1
- package/dist/shell/help-content/index.d.ts +4 -1
- package/dist/shell/help-content/th-TH/advanced-settings.d.ts +12 -0
- package/dist/shell/help-content/th-TH/changelog.d.ts +12 -0
- package/dist/shell/help-content/th-TH/faq.d.ts +12 -0
- package/dist/shell/help-content/th-TH/features.d.ts +12 -0
- package/dist/shell/help-content/th-TH/getting-started.d.ts +12 -0
- package/dist/shell/help-content/th-TH/shortcuts.d.ts +12 -0
- package/dist/shell/help-content/zh-CN/advanced-settings.d.ts +12 -0
- package/dist/shell/help-content/zh-CN/changelog.d.ts +12 -0
- package/dist/shell/help-content/zh-CN/faq.d.ts +12 -0
- package/dist/shell/help-content/zh-CN/features.d.ts +12 -0
- package/dist/shell/help-content/zh-CN/getting-started.d.ts +12 -0
- package/dist/shell/help-content/zh-CN/shortcuts.d.ts +12 -0
- package/dist/shell/help-modal.d.ts +6 -1
- package/dist/shell/page-extras.d.ts +1 -1
- package/dist/shell/panels.d.ts +4 -4
- package/dist/shell/plugin-ui.d.ts +1 -1
- package/dist/shell/prop-group.d.ts +1 -1
- package/dist/shell/property-panel.d.ts +1 -1
- package/dist/shell/property-search.d.ts +1 -1
- package/dist/shell/ruler.d.ts +1 -1
- package/dist/shell/table-props.d.ts +1 -1
- package/dist/shell/table.d.ts +1 -1
- package/dist/shell/toolbar-overflow.d.ts +4 -4
- package/dist/shell/toolbar.d.ts +2 -2
- package/dist/shell/watermark.d.ts +1 -1
- package/dist/test-setup.d.ts +7 -0
- package/dist/theme-tokens.d.ts +1 -1
- package/dist/version.d.ts +2 -2
- package/dist/vue3/PrintDesigner.d.ts +24 -1
- package/dist/vue3/PrintHtmlPreview.d.ts +1 -1
- package/dist/vue3/index.cjs +2 -2
- package/dist/vue3/index.d.ts +1 -1
- package/dist/vue3/index.js +85 -75
- package/dist/vue3/previewStyle.d.ts +1 -1
- package/dist/vue3/toolbarOverflow.d.ts +1 -1
- package/package.json +3 -3
package/dist/core/format.d.ts
CHANGED
package/dist/core/h.d.ts
CHANGED
|
@@ -1,22 +1,8 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @worm-print-platform/canvas v1.
|
|
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
|
-
export
|
|
8
|
-
export
|
|
9
|
-
node: Node;
|
|
10
|
-
}
|
|
11
|
-
export interface El {
|
|
12
|
-
tag: string;
|
|
13
|
-
props: Record<string, unknown>;
|
|
14
|
-
children: unknown[];
|
|
15
|
-
}
|
|
16
|
-
/** h('div', { class, style, onClick, html, ... }, [...]) */
|
|
17
|
-
export declare function h(tag: string, props?: Record<string, unknown>, children?: unknown[]): El;
|
|
18
|
-
export declare function render(node: El | string | Node, parent: Element | ShadowRoot): Element | Text;
|
|
19
|
-
/** 清空容器(重渲染前调用) */
|
|
20
|
-
export declare function clear(node: Element | ShadowRoot): void;
|
|
21
|
-
export declare function mm(v: number): string;
|
|
22
|
-
export declare const SVG_NS_CONST = "http://www.w3.org/2000/svg";
|
|
7
|
+
export { h, render, clear, mm, SVG_NS_CONST } from '@worm-print-platform/plugin-kit/dom';
|
|
8
|
+
export type { AttrValue, Child, El } from '@worm-print-platform/plugin-kit/dom';
|
package/dist/core/icons.d.ts
CHANGED
package/dist/core/plugin.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @worm-print-platform/canvas v1.
|
|
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 { ElementUI } from '@worm-print-platform/plugin-kit';
|
|
9
|
-
/**
|
|
10
|
-
export declare const
|
|
9
|
+
/** 属性台「自定义属性」页签标题键;渲染期按实例 locale 取词,不再冻结为中文 */
|
|
10
|
+
export declare const CUSTOM_PROPERTY_TAB_LABEL_KEY = "propertyPanel.k328";
|
|
11
|
+
export declare const customPropertyTabLabel: () => string;
|
|
11
12
|
export interface PluginElement {
|
|
12
13
|
type: string;
|
|
13
14
|
/** 素材卡标签与图层名,取 core kind.label */
|
package/dist/core/store.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @worm-print-platform/canvas v1.
|
|
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 { AlignLine, AlignMode, MultiPageTemplateData, PrintBusinessField, RuntimeElement, TableSelection, TemplateData } from '@worm-print-platform/core/designer';
|
|
8
8
|
import { createRuntimeElement } from '@worm-print-platform/core/designer';
|
|
9
|
-
/**
|
|
9
|
+
/** 拼版模板只允许单页:中文别名保留兼容,运行时按 locale 取译文 */
|
|
10
10
|
export declare const TILING_SINGLE_PAGE_TIP = "\u5F00\u542F\u62FC\u7248\u540E\u53EA\u80FD\u6709\u4E00\u4E2A\u8BBE\u8BA1\u9875\u9762";
|
|
11
|
+
export declare const tilingSinglePageTip: () => string;
|
|
11
12
|
/** 纸面 mm 落点(与 Vue 3 轨的 toPaperPoint 同口径,原点为纸张左上角) */
|
|
12
13
|
export interface PaperPoint {
|
|
13
14
|
x: number;
|
package/dist/host-contract.d.ts
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @worm-print-platform/canvas v1.
|
|
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 { MultiPageTemplateData, PrintBusinessField, TemplateData } from '@worm-print-platform/core/designer';
|
|
8
8
|
import type { PrintFontDeclaration } from '@worm-print-platform/core';
|
|
9
|
+
import type { FieldDisplayMode } from '@worm-print-platform/plugin-kit/expression-editor';
|
|
10
|
+
import type { CustomLocaleMessages } from '@worm-print-platform/core/i18n';
|
|
9
11
|
/** 宿主契约版本;每次改动可观察面必须同步升号 */
|
|
10
|
-
export declare const PRINT_DESIGNER_CONTRACT_VERSION = "1.
|
|
12
|
+
export declare const PRINT_DESIGNER_CONTRACT_VERSION = "1.4.0";
|
|
11
13
|
/** 自定义元素标签名 */
|
|
12
14
|
export declare const PRINT_DESIGNER_TAG: "print-designer";
|
|
13
15
|
/** 会触发 attributeChangedCallback 的声明式 attribute(字符串形态) */
|
|
14
|
-
export declare const PRINT_DESIGNER_ATTRIBUTES: readonly ["template", "fields", "name", "fonts", "design-data", "theme", "theme-config"];
|
|
16
|
+
export declare const PRINT_DESIGNER_ATTRIBUTES: readonly ["template", "fields", "name", "fonts", "design-data", "theme", "theme-config", "field-display", "lang"];
|
|
15
17
|
export type PrintDesignerAttribute = typeof PRINT_DESIGNER_ATTRIBUTES[number];
|
|
16
18
|
/** 只走 property 的开关(不进 observedAttributes,写 setAttribute 只影响样式/语义) */
|
|
17
19
|
export declare const PRINT_DESIGNER_BOOLEAN_ATTRIBUTES: readonly ["is-edit", "show-help", "show-preview", "show-save"];
|
|
@@ -44,6 +46,15 @@ export interface PrintDesignerProperties {
|
|
|
44
46
|
uploadImage?: (file: File) => Promise<string> | string;
|
|
45
47
|
/** 宿主提供的设计背景上传回调 */
|
|
46
48
|
uploadDesignBackground?: (file: File) => Promise<string> | string;
|
|
49
|
+
/**
|
|
50
|
+
* 素材台字段行与表达式弹窗「字段」页签的显示模式:'label' 只显中文名 / 'key' 只显 key / 'both' 两者(默认)。
|
|
51
|
+
* 分组名、搜索、复制、插入与拖拽语义不受影响;非法值静默回退 both。
|
|
52
|
+
*/
|
|
53
|
+
fieldDisplay: FieldDisplayMode;
|
|
54
|
+
/** 界面语言(BCP47,如 en-US);缺省按 navigator.language 探测,回退 zh-CN */
|
|
55
|
+
lang?: string;
|
|
56
|
+
/** 自定义语言包(对象注入),覆盖内置与插件译文;缺键回退中文 */
|
|
57
|
+
messages?: CustomLocaleMessages;
|
|
47
58
|
}
|
|
48
59
|
/** 方法的返回类型契约 */
|
|
49
60
|
export interface PrintDesignerMethods {
|
|
@@ -59,6 +70,8 @@ export interface PrintDesignerMethods {
|
|
|
59
70
|
}>;
|
|
60
71
|
/** 出纸裁切预估提示(不阻断保存) */
|
|
61
72
|
getGeometryWarnings(): string[];
|
|
73
|
+
/** 切换当前设计器实例的界面语言并即时重绘 */
|
|
74
|
+
setLocale(locale: string): void;
|
|
62
75
|
}
|
|
63
76
|
/** 事件 detail 联合:宿主按事件名即可推出载荷类型,不必再猜 */
|
|
64
77
|
export interface PrintDesignerEventMap {
|