@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/vue3/index.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { defineComponent as B, ref as y, onMounted as C, onBeforeUnmount as L, watch as
|
|
1
|
+
import { defineComponent as B, ref as y, onMounted as C, onBeforeUnmount as L, watch as v, h as g, computed as D, shallowRef as M, reactive as j, onUnmounted as F, provide as _, inject as V, nextTick as U } from "vue";
|
|
2
2
|
import { definePrintDesigner as Z } from "@worm-print-platform/canvas";
|
|
3
3
|
import { createDefaultTemplate as Pe, toRuntimePool as Re } from "@worm-print-platform/canvas";
|
|
4
4
|
import { collectLayoutWarnings as G } from "@worm-print-platform/core";
|
|
5
5
|
import { renderHtmlPages as K, browserCodeRenderer as N } from "@worm-print-platform/core/browser";
|
|
6
|
-
import { browserCodeRenderer as
|
|
6
|
+
import { browserCodeRenderer as ke, renderHtmlPages as Ie } from "@worm-print-platform/core/browser";
|
|
7
7
|
import { resolvePrinterDpi as $, zoomPresets as q, paperWidthPx as Y, defaultZoomKey as Q, zoomValueOf as X, viewZoomHint as ee, applyPreviewViewZoom as te, resolveZoomKey as ne, resolveToolbarOverflow as ie } from "@worm-print-platform/core/designer";
|
|
8
8
|
import { DEFAULT_DEMO_DATA as We, getDemoData as Ae } from "@worm-print-platform/core/designer";
|
|
9
9
|
import { TOOLBAR_OVERFLOW_KEY as oe } from "@worm-print-platform/plugin-kit";
|
|
10
|
-
function
|
|
11
|
-
const
|
|
10
|
+
function ae(e, r) {
|
|
11
|
+
const c = r.map((s) => ({
|
|
12
12
|
...s,
|
|
13
13
|
options: { ...s.options },
|
|
14
14
|
printElementType: { ...s.printElementType }
|
|
15
15
|
})), i = e.pages;
|
|
16
16
|
return Array.isArray(i) ? {
|
|
17
17
|
...e,
|
|
18
|
-
pages: i.map((s,
|
|
19
|
-
} : { ...e, elements:
|
|
18
|
+
pages: i.map((s, a) => a === 0 ? { ...s, elements: c } : s)
|
|
19
|
+
} : { ...e, elements: c };
|
|
20
20
|
}
|
|
21
|
-
const
|
|
21
|
+
const re = B({
|
|
22
22
|
name: "PrintDesigner",
|
|
23
23
|
props: {
|
|
24
24
|
initialTemplate: {
|
|
@@ -63,15 +63,19 @@ const ae = B({
|
|
|
63
63
|
/** 主题预设:auto(默认)跟随系统 prefers-color-scheme,light/dark 强制 */
|
|
64
64
|
theme: { type: String, default: void 0 },
|
|
65
65
|
/** 主题色值覆盖:传参优先于预设、系统与 CSS 令牌;只影响外壳,画布纸张不受影响 */
|
|
66
|
-
themeConfig: { type: Object, default: void 0 }
|
|
66
|
+
themeConfig: { type: Object, default: void 0 },
|
|
67
|
+
/** 界面语言(BCP47,如 en-US);未传时跟随全局 locale */
|
|
68
|
+
lang: { type: String, default: void 0 },
|
|
69
|
+
/** 自定义语言包(对象注入),覆盖内置与插件译文 */
|
|
70
|
+
messages: { type: Object, default: void 0 }
|
|
67
71
|
},
|
|
68
72
|
emits: {
|
|
69
73
|
preview: () => !0,
|
|
70
74
|
save: (e) => typeof e == "string"
|
|
71
75
|
},
|
|
72
|
-
setup(e, { emit:
|
|
76
|
+
setup(e, { emit: r, expose: c }) {
|
|
73
77
|
const i = y(null);
|
|
74
|
-
let s = null,
|
|
78
|
+
let s = null, a = null;
|
|
75
79
|
typeof customElements < "u" && Z();
|
|
76
80
|
function f(t) {
|
|
77
81
|
if (e.initialTemplate !== void 0) {
|
|
@@ -80,58 +84,64 @@ const ae = B({
|
|
|
80
84
|
}
|
|
81
85
|
if (e.initialElements === void 0) return;
|
|
82
86
|
const n = t.getTemplateJson(), m = JSON.parse(n);
|
|
83
|
-
t.template =
|
|
87
|
+
t.template = ae(m, e.initialElements);
|
|
84
88
|
}
|
|
85
89
|
function x() {
|
|
86
90
|
const t = i.value;
|
|
87
|
-
t && (f(t), e.fields !== void 0 && (t.fields = e.fields), e.fonts !== void 0 && (t.fonts = e.fonts), e.designData !== void 0 && (t.designData = e.designData), t.uploadImage = e.uploadImage, t.uploadDesignBackground = e.uploadDesignBackground, e.isEdit !== void 0 && (t.isEdit = e.isEdit), e.showHelp !== void 0 && (t.showHelp = e.showHelp), e.showPreview !== void 0 && (t.showPreview = e.showPreview), e.showSave !== void 0 && (t.showSave = e.showSave), e.theme !== void 0 && (t.theme = e.theme), e.themeConfig !== void 0 && (t.themeConfig = e.themeConfig));
|
|
91
|
+
t && (f(t), e.fields !== void 0 && (t.fields = e.fields), e.fonts !== void 0 && (t.fonts = e.fonts), e.designData !== void 0 && (t.designData = e.designData), t.uploadImage = e.uploadImage, t.uploadDesignBackground = e.uploadDesignBackground, e.isEdit !== void 0 && (t.isEdit = e.isEdit), e.showHelp !== void 0 && (t.showHelp = e.showHelp), e.showPreview !== void 0 && (t.showPreview = e.showPreview), e.showSave !== void 0 && (t.showSave = e.showSave), e.theme !== void 0 && (t.theme = e.theme), e.themeConfig !== void 0 && (t.themeConfig = e.themeConfig), e.lang !== void 0 && (t.lang = e.lang), e.messages !== void 0 && (t.messages = e.messages));
|
|
88
92
|
}
|
|
89
93
|
return C(() => {
|
|
90
94
|
const t = i.value;
|
|
91
|
-
t && (s = (n) =>
|
|
95
|
+
t && (s = (n) => r("save", n.detail), a = () => r("preview"), t.addEventListener("save", s), t.addEventListener("preview", a), x());
|
|
92
96
|
}), L(() => {
|
|
93
97
|
const t = i.value;
|
|
94
|
-
s && t?.removeEventListener("save", s),
|
|
95
|
-
}),
|
|
98
|
+
s && t?.removeEventListener("save", s), a && t?.removeEventListener("preview", a), s = null, a = null;
|
|
99
|
+
}), v(() => e.initialTemplate, () => {
|
|
96
100
|
const t = i.value;
|
|
97
101
|
t && f(t);
|
|
98
|
-
}),
|
|
102
|
+
}), v(() => e.initialElements, () => {
|
|
99
103
|
const t = i.value;
|
|
100
104
|
t && f(t);
|
|
101
|
-
}),
|
|
105
|
+
}), v(() => e.fields, (t) => {
|
|
102
106
|
const n = i.value;
|
|
103
107
|
n && (n.fields = t ?? []);
|
|
104
|
-
}),
|
|
108
|
+
}), v(() => e.fonts, (t) => {
|
|
105
109
|
const n = i.value;
|
|
106
110
|
n && (n.fonts = t);
|
|
107
|
-
}),
|
|
111
|
+
}), v(() => e.designData, (t) => {
|
|
108
112
|
const n = i.value;
|
|
109
113
|
n && (n.designData = t);
|
|
110
|
-
}),
|
|
114
|
+
}), v(() => e.uploadImage, (t) => {
|
|
111
115
|
const n = i.value;
|
|
112
116
|
n && (n.uploadImage = t);
|
|
113
|
-
}),
|
|
117
|
+
}), v(() => e.uploadDesignBackground, (t) => {
|
|
114
118
|
const n = i.value;
|
|
115
119
|
n && (n.uploadDesignBackground = t);
|
|
116
|
-
}),
|
|
120
|
+
}), v(() => e.isEdit, (t) => {
|
|
117
121
|
const n = i.value;
|
|
118
122
|
n && t !== void 0 && (n.isEdit = t);
|
|
119
|
-
}),
|
|
123
|
+
}), v(() => e.showHelp, (t) => {
|
|
120
124
|
const n = i.value;
|
|
121
125
|
n && t !== void 0 && (n.showHelp = t);
|
|
122
|
-
}),
|
|
126
|
+
}), v(() => e.showPreview, (t) => {
|
|
123
127
|
const n = i.value;
|
|
124
128
|
n && t !== void 0 && (n.showPreview = t);
|
|
125
|
-
}),
|
|
129
|
+
}), v(() => e.showSave, (t) => {
|
|
126
130
|
const n = i.value;
|
|
127
131
|
n && t !== void 0 && (n.showSave = t);
|
|
128
|
-
}),
|
|
132
|
+
}), v(() => e.theme, (t) => {
|
|
129
133
|
const n = i.value;
|
|
130
134
|
n && t !== void 0 && (n.theme = t);
|
|
131
|
-
}),
|
|
135
|
+
}), v(() => e.themeConfig, (t) => {
|
|
132
136
|
const n = i.value;
|
|
133
137
|
n && t !== void 0 && (n.themeConfig = t);
|
|
134
|
-
}), v({
|
|
138
|
+
}), v(() => e.lang, (t) => {
|
|
139
|
+
const n = i.value;
|
|
140
|
+
n && t !== void 0 && (n.lang = t);
|
|
141
|
+
}), v(() => e.messages, (t) => {
|
|
142
|
+
const n = i.value;
|
|
143
|
+
n && t !== void 0 && (n.messages = t);
|
|
144
|
+
}), c({
|
|
135
145
|
getTemplateJson() {
|
|
136
146
|
const t = i.value?.getTemplateJson();
|
|
137
147
|
return t ? JSON.parse(t) : void 0;
|
|
@@ -144,7 +154,7 @@ const ae = B({
|
|
|
144
154
|
}
|
|
145
155
|
}), () => g("print-designer", { ref: i });
|
|
146
156
|
}
|
|
147
|
-
}), ge =
|
|
157
|
+
}), ge = re, A = "worm-print-canvas-vue3-preview", le = `
|
|
148
158
|
.pcv3-preview.print-html-preview {
|
|
149
159
|
width: 100%;
|
|
150
160
|
height: 100%;
|
|
@@ -255,34 +265,34 @@ const ue = B({
|
|
|
255
265
|
}
|
|
256
266
|
},
|
|
257
267
|
emits: {
|
|
258
|
-
rendered: (e,
|
|
268
|
+
rendered: (e, r) => typeof e == "number" && typeof r == "number",
|
|
259
269
|
error: (e) => typeof e == "string"
|
|
260
270
|
},
|
|
261
|
-
setup(e, { emit:
|
|
262
|
-
const i = y(), s = y(),
|
|
271
|
+
setup(e, { emit: r, expose: c }) {
|
|
272
|
+
const i = y(), s = y(), a = y(!1), f = y(""), x = y([]);
|
|
263
273
|
let E = 0;
|
|
264
274
|
const t = D(() => $(e.templateJson)), n = y(0), m = D(
|
|
265
275
|
() => q(t.value, n.value, Y(e.templateJson))
|
|
266
|
-
), p = y(Q(t.value)),
|
|
267
|
-
function
|
|
276
|
+
), p = y(Q(t.value)), S = D(() => X(m.value, p.value)), O = D(() => ee(t.value, p.value));
|
|
277
|
+
function T() {
|
|
268
278
|
n.value = s.value?.clientWidth ?? 0;
|
|
269
279
|
}
|
|
270
|
-
function
|
|
280
|
+
function k() {
|
|
271
281
|
p.value = ne(m.value, p.value, t.value);
|
|
272
282
|
}
|
|
273
283
|
function P() {
|
|
274
|
-
te(i.value?.contentWindow?.document,
|
|
284
|
+
te(i.value?.contentWindow?.document, S.value);
|
|
275
285
|
}
|
|
276
286
|
function I() {
|
|
277
|
-
|
|
287
|
+
T(), P();
|
|
278
288
|
}
|
|
279
289
|
async function o() {
|
|
280
290
|
if (!e.templateJson) {
|
|
281
|
-
f.value = "",
|
|
291
|
+
f.value = "", a.value = !1;
|
|
282
292
|
return;
|
|
283
293
|
}
|
|
284
294
|
const l = ++E;
|
|
285
|
-
|
|
295
|
+
a.value = !0, f.value = "", x.value = [];
|
|
286
296
|
try {
|
|
287
297
|
const { html: u, pageCount: b, copies: d, pageLayouts: R } = await K(
|
|
288
298
|
e.templateJson,
|
|
@@ -294,12 +304,12 @@ const ue = B({
|
|
|
294
304
|
if (l !== E) return;
|
|
295
305
|
x.value = G(R ?? []);
|
|
296
306
|
const h = i.value?.contentWindow?.document;
|
|
297
|
-
h && (h.open(), h.write(u), h.close()),
|
|
307
|
+
h && (h.open(), h.write(u), h.close()), T(), k(), P(), r("rendered", b, d);
|
|
298
308
|
} catch (u) {
|
|
299
309
|
if (l !== E) return;
|
|
300
|
-
f.value = u instanceof Error ? u.message : "未知错误",
|
|
310
|
+
f.value = u instanceof Error ? u.message : "未知错误", r("error", f.value);
|
|
301
311
|
} finally {
|
|
302
|
-
l === E && (
|
|
312
|
+
l === E && (a.value = !1);
|
|
303
313
|
}
|
|
304
314
|
}
|
|
305
315
|
function w() {
|
|
@@ -309,21 +319,21 @@ const ue = B({
|
|
|
309
319
|
function z(l) {
|
|
310
320
|
m.value.some((u) => u.key === l) && (p.value = l);
|
|
311
321
|
}
|
|
312
|
-
return
|
|
322
|
+
return v(
|
|
313
323
|
() => [e.templateJson, e.printData, e.baseUrl, e.fontBaseUrl, e.renderers],
|
|
314
324
|
() => {
|
|
315
325
|
o();
|
|
316
326
|
},
|
|
317
327
|
{ deep: !0 }
|
|
318
|
-
),
|
|
319
|
-
se(),
|
|
328
|
+
), v(S, () => P()), C(() => {
|
|
329
|
+
se(), T(), k(), window.addEventListener("resize", I), o();
|
|
320
330
|
}), L(() => {
|
|
321
331
|
E++, window.removeEventListener("resize", I);
|
|
322
|
-
}),
|
|
323
|
-
const l =
|
|
332
|
+
}), c({ print: w, rerender: o, setViewZoom: z, zoomKey: p, presets: m, viewHint: O }), () => {
|
|
333
|
+
const l = a.value || !!f.value, u = [];
|
|
324
334
|
if (f.value ? u.push(g("div", { key: "error", class: "print-html-preview-error" }, [
|
|
325
335
|
g("span", null, `预览渲染失败:${f.value}`)
|
|
326
|
-
])) :
|
|
336
|
+
])) : a.value && u.push(g("div", { key: "loading", class: "print-html-preview-loading" }, "预览渲染中…")), u.push(g("iframe", {
|
|
327
337
|
key: "iframe",
|
|
328
338
|
ref: i,
|
|
329
339
|
class: "print-html-preview-iframe",
|
|
@@ -344,7 +354,7 @@ const ue = B({
|
|
|
344
354
|
p.value = d.key;
|
|
345
355
|
}
|
|
346
356
|
}, d.label));
|
|
347
|
-
|
|
357
|
+
O.value && b.push(g("span", { class: "print-html-preview-zoom-hint" }, O.value)), b.push(g("span", { class: "print-html-preview-zoom-note" }, "仅屏幕缩放,打印不受影响")), u.push(g("div", { key: "zoom", class: "print-html-preview-zoom" }, b));
|
|
348
358
|
}
|
|
349
359
|
return g("div", {
|
|
350
360
|
ref: s,
|
|
@@ -358,11 +368,11 @@ function be(e) {
|
|
|
358
368
|
}
|
|
359
369
|
const H = oe, W = 2, de = 74;
|
|
360
370
|
function ve() {
|
|
361
|
-
const e = M(null),
|
|
371
|
+
const e = M(null), r = /* @__PURE__ */ new Map(), c = j(/* @__PURE__ */ new Map()), i = /* @__PURE__ */ new Map();
|
|
362
372
|
let s = 0;
|
|
363
|
-
const
|
|
373
|
+
const a = y(/* @__PURE__ */ new Set()), f = y(!1), x = D(() => [...c.values()].sort((o, w) => o.order - w.order)), E = D(() => a.value.size > 0);
|
|
364
374
|
function t() {
|
|
365
|
-
for (const [o, w] of
|
|
375
|
+
for (const [o, w] of r) {
|
|
366
376
|
const z = w.offsetWidth;
|
|
367
377
|
z > 0 && i.set(o, z);
|
|
368
378
|
}
|
|
@@ -380,7 +390,7 @@ function ve() {
|
|
|
380
390
|
function m() {
|
|
381
391
|
const o = e.value;
|
|
382
392
|
if (!o) return;
|
|
383
|
-
const { available: w, natural: z } = n(o), l =
|
|
393
|
+
const { available: w, natural: z } = n(o), l = a.value.size > 0;
|
|
384
394
|
l || (s = z, t());
|
|
385
395
|
const u = x.value.map((h) => ({
|
|
386
396
|
id: h.id,
|
|
@@ -393,31 +403,31 @@ function ve() {
|
|
|
393
403
|
gap: W,
|
|
394
404
|
units: u
|
|
395
405
|
});
|
|
396
|
-
d.movedIds.length ===
|
|
406
|
+
d.movedIds.length === a.value.size && d.movedIds.every((h) => a.value.has(h)) || (a.value = new Set(d.movedIds)), f.value = d.overflowRemains, l && a.value.size === 0 && U(m);
|
|
397
407
|
}
|
|
398
408
|
let p = null;
|
|
399
|
-
function
|
|
409
|
+
function S(o) {
|
|
400
410
|
o !== e.value && (p?.disconnect(), e.value = o, o && typeof ResizeObserver < "u" && (p = new ResizeObserver(() => m()), p.observe(o)), U(m));
|
|
401
411
|
}
|
|
402
|
-
function
|
|
403
|
-
|
|
412
|
+
function O(o, w) {
|
|
413
|
+
c.set(o.id, o), r.set(o.id, w), U(m);
|
|
404
414
|
}
|
|
405
|
-
function
|
|
406
|
-
|
|
415
|
+
function T(o) {
|
|
416
|
+
r.delete(o), c.delete(o), i.delete(o), U(m);
|
|
407
417
|
}
|
|
408
|
-
const
|
|
418
|
+
const k = document.createElement("div");
|
|
409
419
|
function P(o) {
|
|
410
|
-
return
|
|
420
|
+
return a.value.has(o);
|
|
411
421
|
}
|
|
412
422
|
function I(o) {
|
|
413
|
-
return
|
|
423
|
+
return a.value, e.value?.querySelector(`[data-overflow-slot="${o}"]`) ?? k;
|
|
414
424
|
}
|
|
415
|
-
return
|
|
416
|
-
attachRoot:
|
|
417
|
-
registerUnit:
|
|
418
|
-
unregisterUnit:
|
|
425
|
+
return F(() => p?.disconnect()), {
|
|
426
|
+
attachRoot: S,
|
|
427
|
+
registerUnit: O,
|
|
428
|
+
unregisterUnit: T,
|
|
419
429
|
refresh: m,
|
|
420
|
-
movedIds:
|
|
430
|
+
movedIds: a,
|
|
421
431
|
overflowRemains: f,
|
|
422
432
|
hasMoved: E,
|
|
423
433
|
chain: x,
|
|
@@ -427,13 +437,13 @@ function ve() {
|
|
|
427
437
|
}
|
|
428
438
|
function xe() {
|
|
429
439
|
const e = ve();
|
|
430
|
-
return
|
|
440
|
+
return _(H, e), e;
|
|
431
441
|
}
|
|
432
442
|
function Ee() {
|
|
433
443
|
return V(H, null);
|
|
434
444
|
}
|
|
435
445
|
function ze() {
|
|
436
|
-
const e = y(/* @__PURE__ */ new Set()),
|
|
446
|
+
const e = y(/* @__PURE__ */ new Set()), r = document.createElement("div");
|
|
437
447
|
return {
|
|
438
448
|
attachRoot: () => {
|
|
439
449
|
},
|
|
@@ -448,16 +458,16 @@ function ze() {
|
|
|
448
458
|
hasMoved: D(() => !1),
|
|
449
459
|
chain: D(() => []),
|
|
450
460
|
moved: () => !1,
|
|
451
|
-
slotEl: () =>
|
|
461
|
+
slotEl: () => r
|
|
452
462
|
};
|
|
453
463
|
}
|
|
454
464
|
function De(e) {
|
|
455
465
|
return {
|
|
456
|
-
mounted(
|
|
457
|
-
|
|
466
|
+
mounted(r, c) {
|
|
467
|
+
r.dataset.unit = c.value.id, e.registerUnit(c.value, r);
|
|
458
468
|
},
|
|
459
|
-
unmounted(
|
|
460
|
-
e.unregisterUnit(
|
|
469
|
+
unmounted(r, c) {
|
|
470
|
+
e.unregisterUnit(c.value.id);
|
|
461
471
|
}
|
|
462
472
|
};
|
|
463
473
|
}
|
|
@@ -466,7 +476,7 @@ export {
|
|
|
466
476
|
ge as PrintDesigner,
|
|
467
477
|
ye as PrintHtmlPreview,
|
|
468
478
|
H as TOOLBAR_OVERFLOW,
|
|
469
|
-
|
|
479
|
+
ke as browserCodeRenderer,
|
|
470
480
|
Pe as createDefaultTemplate,
|
|
471
481
|
De as createOverflowUnitDirective,
|
|
472
482
|
ve as createToolbarOverflow,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@worm-print-platform/canvas",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
"pretest": "npm run typecheck"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@worm-print-platform/core": "^1.
|
|
58
|
-
"@worm-print-platform/plugin-kit": "^1.
|
|
57
|
+
"@worm-print-platform/core": "^1.6.1",
|
|
58
|
+
"@worm-print-platform/plugin-kit": "^1.6.1",
|
|
59
59
|
"dompurify": "^3.4.12",
|
|
60
60
|
"jsbarcode": "^3.12.3",
|
|
61
61
|
"qrcode": "^1.5.4"
|