x-print-designer 0.4.41 → 0.4.42
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/dist/{JsBarcode-tsAzeEWM.js → JsBarcode-CECdI86m.js} +1 -1
- package/dist/{JsBarcode-CLlw_gbk.js → JsBarcode-DJOhOA0M.js} +1 -1
- package/dist/{browser-CRmiemCh.js → browser-BRqImYbl.js} +1 -1
- package/dist/{browser-iNycRk4T.js → browser-Dzsc4Gy5.js} +1 -1
- package/dist/{dom-to-image-more.min-D0ig0Uh4.js → dom-to-image-more.min-C_XiZUaT.js} +1 -1
- package/dist/{index-qEe1XFR1.js → index-CQixnPpt.js} +86 -100
- package/dist/{index-AEN4Ym4J.js → index-D4aOsQY_.js} +1 -1
- package/dist/{index.es-B2ZLGl1x.js → index.es-Ch6y9Iyi.js} +1 -1
- package/dist/{jspdf.es.min-Bh2x9vwp.js → jspdf.es.min-BY5Xfz5v.js} +1 -1
- package/dist/{jszip.min-DdkLg28T.js → jszip.min-CrajC7IR.js} +1 -1
- package/dist/print-designer.css +1 -1
- package/dist/print-designer.es.js +1 -1
- package/dist/print-designer.umd.js +41 -41
- package/dist/{vue-BW3F83GJ.js → vue-D8wYXHHD.js} +65 -90
- package/dist/vue.css +1 -1
- package/dist/vue.es.js +1 -1
- package/package.json +1 -1
|
@@ -22235,6 +22235,26 @@ const buildSavePages = (designerStore) => {
|
|
|
22235
22235
|
}
|
|
22236
22236
|
return sanitizePages(rawPages);
|
|
22237
22237
|
};
|
|
22238
|
+
const buildPersistedTemplateData = (designerStore) => {
|
|
22239
|
+
const data = {
|
|
22240
|
+
pages: buildSavePages(designerStore),
|
|
22241
|
+
canvasSize: cloneDeep$1(designerStore.canvasSize),
|
|
22242
|
+
guides: cloneDeep$1(designerStore.guides),
|
|
22243
|
+
headerHeight: designerStore.headerHeight,
|
|
22244
|
+
footerHeight: designerStore.footerHeight,
|
|
22245
|
+
showHeaderLine: designerStore.showHeaderLine,
|
|
22246
|
+
showFooterLine: designerStore.showFooterLine,
|
|
22247
|
+
canvasBackground: designerStore.canvasBackground,
|
|
22248
|
+
pageSpacingX: designerStore.pageSpacingX,
|
|
22249
|
+
pageSpacingY: designerStore.pageSpacingY,
|
|
22250
|
+
unit: designerStore.unit,
|
|
22251
|
+
watermark: cloneDeep$1(designerStore.watermark)
|
|
22252
|
+
};
|
|
22253
|
+
if (!designerStore.testDataInjectedByHost) {
|
|
22254
|
+
data.testData = cloneDeep$1(designerStore.testData || {});
|
|
22255
|
+
}
|
|
22256
|
+
return data;
|
|
22257
|
+
};
|
|
22238
22258
|
const hasMeaningfulTemplateData = (data) => {
|
|
22239
22259
|
if (!data || typeof data !== "object") return false;
|
|
22240
22260
|
if (Array.isArray(data.pages) && data.pages.length > 0) return true;
|
|
@@ -22423,27 +22443,7 @@ const useTemplateStore = /* @__PURE__ */ defineStore("templates", {
|
|
|
22423
22443
|
buildSavePayload(name2) {
|
|
22424
22444
|
const designerStore = useDesignerStore();
|
|
22425
22445
|
const targetId = this.currentTemplateId;
|
|
22426
|
-
const
|
|
22427
|
-
const isReportMode = designerStore.mode === "report";
|
|
22428
|
-
const data = {
|
|
22429
|
-
...(existingTemplate == null ? void 0 : existingTemplate.data) || {},
|
|
22430
|
-
pages: buildSavePages(designerStore),
|
|
22431
|
-
canvasSize: cloneDeep$1(designerStore.canvasSize),
|
|
22432
|
-
guides: cloneDeep$1(designerStore.guides),
|
|
22433
|
-
zoom: designerStore.zoom,
|
|
22434
|
-
showGrid: designerStore.showGrid,
|
|
22435
|
-
headerHeight: designerStore.headerHeight,
|
|
22436
|
-
footerHeight: designerStore.footerHeight,
|
|
22437
|
-
showHeaderLine: designerStore.showHeaderLine,
|
|
22438
|
-
showFooterLine: designerStore.showFooterLine,
|
|
22439
|
-
showMinimap: designerStore.showMinimap,
|
|
22440
|
-
canvasBackground: designerStore.canvasBackground,
|
|
22441
|
-
pageSpacingX: designerStore.pageSpacingX,
|
|
22442
|
-
pageSpacingY: designerStore.pageSpacingY,
|
|
22443
|
-
unit: designerStore.unit,
|
|
22444
|
-
watermark: cloneDeep$1(designerStore.watermark),
|
|
22445
|
-
...isReportMode ? { testData: cloneDeep$1(designerStore.testData || {}) } : {}
|
|
22446
|
-
};
|
|
22446
|
+
const data = buildPersistedTemplateData(designerStore);
|
|
22447
22447
|
return {
|
|
22448
22448
|
id: targetId,
|
|
22449
22449
|
name: name2,
|
|
@@ -22463,26 +22463,7 @@ const useTemplateStore = /* @__PURE__ */ defineStore("templates", {
|
|
|
22463
22463
|
}
|
|
22464
22464
|
return;
|
|
22465
22465
|
}
|
|
22466
|
-
const
|
|
22467
|
-
const data = {
|
|
22468
|
-
...(existingTemplate == null ? void 0 : existingTemplate.data) || {},
|
|
22469
|
-
pages: buildSavePages(designerStore),
|
|
22470
|
-
canvasSize: cloneDeep$1(designerStore.canvasSize),
|
|
22471
|
-
guides: cloneDeep$1(designerStore.guides),
|
|
22472
|
-
zoom: designerStore.zoom,
|
|
22473
|
-
showGrid: designerStore.showGrid,
|
|
22474
|
-
headerHeight: designerStore.headerHeight,
|
|
22475
|
-
footerHeight: designerStore.footerHeight,
|
|
22476
|
-
showHeaderLine: designerStore.showHeaderLine,
|
|
22477
|
-
showFooterLine: designerStore.showFooterLine,
|
|
22478
|
-
showMinimap: designerStore.showMinimap,
|
|
22479
|
-
canvasBackground: designerStore.canvasBackground,
|
|
22480
|
-
pageSpacingX: designerStore.pageSpacingX,
|
|
22481
|
-
pageSpacingY: designerStore.pageSpacingY,
|
|
22482
|
-
unit: designerStore.unit,
|
|
22483
|
-
watermark: cloneDeep$1(designerStore.watermark),
|
|
22484
|
-
...isReportMode ? { testData: cloneDeep$1(designerStore.testData || {}) } : {}
|
|
22485
|
-
};
|
|
22466
|
+
const data = buildPersistedTemplateData(designerStore);
|
|
22486
22467
|
if (targetId && existingTemplate) {
|
|
22487
22468
|
const oldData = sanitizeTemplateData(existingTemplate.data || {});
|
|
22488
22469
|
const newData = sanitizeTemplateData(data);
|
|
@@ -22501,10 +22482,9 @@ const useTemplateStore = /* @__PURE__ */ defineStore("templates", {
|
|
|
22501
22482
|
const payloadBase = {
|
|
22502
22483
|
id: targetId || v4(),
|
|
22503
22484
|
name: name2,
|
|
22504
|
-
data
|
|
22505
|
-
|
|
22506
|
-
|
|
22507
|
-
},
|
|
22485
|
+
// 只落盘白名单 data,不再合并 upsertBase.data(避免 imageBundle/fieldMapping
|
|
22486
|
+
// 等历史遗留字段与旧画布配置回流到模板 JSON)
|
|
22487
|
+
data,
|
|
22508
22488
|
updatedAt: Date.now(),
|
|
22509
22489
|
permissions: upsertBase == null ? void 0 : upsertBase.permissions,
|
|
22510
22490
|
ext: withExtAvailableVariables(
|
|
@@ -22611,25 +22591,7 @@ const useTemplateStore = /* @__PURE__ */ defineStore("templates", {
|
|
|
22611
22591
|
var _a2, _b;
|
|
22612
22592
|
const { mode, endpoints, headers, fetcher } = getCrudConfig();
|
|
22613
22593
|
const designerStore = useDesignerStore();
|
|
22614
|
-
const
|
|
22615
|
-
const nextData = data || {
|
|
22616
|
-
pages: cloneDeep$1(designerStore.pages),
|
|
22617
|
-
canvasSize: cloneDeep$1(designerStore.canvasSize),
|
|
22618
|
-
pageSpacingX: designerStore.pageSpacingX,
|
|
22619
|
-
pageSpacingY: designerStore.pageSpacingY,
|
|
22620
|
-
unit: designerStore.unit,
|
|
22621
|
-
watermark: cloneDeep$1(designerStore.watermark),
|
|
22622
|
-
...isReportMode ? { testData: cloneDeep$1(designerStore.testData || {}) } : {},
|
|
22623
|
-
guides: cloneDeep$1(designerStore.guides),
|
|
22624
|
-
zoom: designerStore.zoom,
|
|
22625
|
-
showGrid: designerStore.showGrid,
|
|
22626
|
-
headerHeight: designerStore.headerHeight,
|
|
22627
|
-
footerHeight: designerStore.footerHeight,
|
|
22628
|
-
showHeaderLine: designerStore.showHeaderLine,
|
|
22629
|
-
showFooterLine: designerStore.showFooterLine,
|
|
22630
|
-
showMinimap: designerStore.showMinimap,
|
|
22631
|
-
canvasBackground: designerStore.canvasBackground
|
|
22632
|
-
};
|
|
22594
|
+
const nextData = data || buildPersistedTemplateData(designerStore);
|
|
22633
22595
|
const newData = sanitizeTemplateData(nextData);
|
|
22634
22596
|
const templateBase = applyModalExtraValues({
|
|
22635
22597
|
id: v4(),
|
|
@@ -22885,6 +22847,7 @@ const useTemplateStore = /* @__PURE__ */ defineStore("templates", {
|
|
|
22885
22847
|
} else {
|
|
22886
22848
|
designerStore.testData = cloneDeep$1(data.testData || {});
|
|
22887
22849
|
}
|
|
22850
|
+
designerStore.testDataInjectedByHost = false;
|
|
22888
22851
|
if (injectedVariables) {
|
|
22889
22852
|
designerStore.variables = injectedVariables;
|
|
22890
22853
|
} else if (data.variables !== void 0) {
|
|
@@ -22973,6 +22936,7 @@ const useTemplateStore = /* @__PURE__ */ defineStore("templates", {
|
|
|
22973
22936
|
} else {
|
|
22974
22937
|
designerStore.testData = cloneDeep$1(data.testData || {});
|
|
22975
22938
|
}
|
|
22939
|
+
designerStore.testDataInjectedByHost = false;
|
|
22976
22940
|
if (injectedVariables) {
|
|
22977
22941
|
designerStore.variables = injectedVariables;
|
|
22978
22942
|
} else if (data.variables !== void 0) {
|
|
@@ -24081,6 +24045,12 @@ const useDesignerStore = /* @__PURE__ */ defineStore("designer", {
|
|
|
24081
24045
|
// W10:保存时自动折叠循环页,宿主无需手动调用 collapseLoopPages
|
|
24082
24046
|
autoCollapseLoopPages: true,
|
|
24083
24047
|
testData: {},
|
|
24048
|
+
/**
|
|
24049
|
+
* 宿主是否注入过运行时数据(setSampleData / setTestData)。
|
|
24050
|
+
* 为 true 时保存模板不持久化 testData —— 宿主每次打开都会重新注入,
|
|
24051
|
+
* 固化运行时数据会导致模板 JSON 膨胀且内容随运行时数据漂移。
|
|
24052
|
+
*/
|
|
24053
|
+
testDataInjectedByHost: false,
|
|
24084
24054
|
variables: {},
|
|
24085
24055
|
availableVariables: [],
|
|
24086
24056
|
fieldDictionary: {},
|
|
@@ -24192,6 +24162,7 @@ const useDesignerStore = /* @__PURE__ */ defineStore("designer", {
|
|
|
24192
24162
|
setSampleData(data) {
|
|
24193
24163
|
this.isDataLoading = true;
|
|
24194
24164
|
this.testData = data;
|
|
24165
|
+
this.testDataInjectedByHost = true;
|
|
24195
24166
|
this.regenerateFieldTree();
|
|
24196
24167
|
if (!this.materializeReportTables()) {
|
|
24197
24168
|
this.autoPaginateTables();
|
|
@@ -24910,6 +24881,7 @@ const useDesignerStore = /* @__PURE__ */ defineStore("designer", {
|
|
|
24910
24881
|
if (data.watermark !== void 0) this.watermark = cloneDeep$1(data.watermark);
|
|
24911
24882
|
if (data.testData !== void 0) this.testData = cloneDeep$1(data.testData);
|
|
24912
24883
|
if (data.variables !== void 0) this.variables = cloneDeep$1(data.variables);
|
|
24884
|
+
this.testDataInjectedByHost = false;
|
|
24913
24885
|
this.testData = buildTestDataFromPages(this.pages, this.testData);
|
|
24914
24886
|
this.selectedElementId = null;
|
|
24915
24887
|
this.selectedElementIds = [];
|
|
@@ -26011,6 +25983,7 @@ const useDesignerStore = /* @__PURE__ */ defineStore("designer", {
|
|
|
26011
25983
|
}
|
|
26012
25984
|
if (channel === "testData" || channel === "sampleData") {
|
|
26013
25985
|
this.testData = merge2 ? { ...this.testData || {}, ...data } : data;
|
|
25986
|
+
this.testDataInjectedByHost = true;
|
|
26014
25987
|
} else {
|
|
26015
25988
|
this.variables = merge2 ? { ...this.variables || {}, ...data } : data;
|
|
26016
25989
|
}
|
|
@@ -26024,26 +25997,15 @@ const useDesignerStore = /* @__PURE__ */ defineStore("designer", {
|
|
|
26024
25997
|
if (!this.isTemplateEditable) return;
|
|
26025
25998
|
const firstPage = this.pages[0];
|
|
26026
25999
|
if (!firstPage) return;
|
|
26027
|
-
const userPages =
|
|
26028
|
-
|
|
26029
|
-
|
|
26030
|
-
|
|
26031
|
-
|
|
26032
|
-
|
|
26033
|
-
userPages.push(this.pages[i]);
|
|
26034
|
-
}
|
|
26035
|
-
}
|
|
26036
|
-
if (userPages.length > 0) {
|
|
26037
|
-
userPages.forEach((page2, pageIndex) => {
|
|
26038
|
-
const cleanedElements = page2.elements.map((el2) => {
|
|
26039
|
-
if (el2 && el2.type === ElementType.TABLE && (el2.dataStart !== void 0 || el2.dataEnd !== void 0 || el2.skipHeader !== void 0)) {
|
|
26040
|
-
return { ...el2, dataStart: void 0, dataEnd: void 0, skipHeader: void 0 };
|
|
26041
|
-
}
|
|
26042
|
-
return el2;
|
|
26043
|
-
});
|
|
26044
|
-
userPages[pageIndex] = { ...page2, elements: cleanedElements };
|
|
26000
|
+
const userPages = this.pages.map((page2) => {
|
|
26001
|
+
const cleanedElements = page2.elements.map((el2) => {
|
|
26002
|
+
if (el2 && el2.type === ElementType.TABLE && (el2.dataStart !== void 0 || el2.dataEnd !== void 0 || el2.skipHeader !== void 0)) {
|
|
26003
|
+
return { ...el2, dataStart: void 0, dataEnd: void 0, skipHeader: void 0 };
|
|
26004
|
+
}
|
|
26005
|
+
return el2;
|
|
26045
26006
|
});
|
|
26046
|
-
|
|
26007
|
+
return { ...page2, elements: cleanedElements };
|
|
26008
|
+
});
|
|
26047
26009
|
this.pages = userPages;
|
|
26048
26010
|
if (this.currentPageIndex >= this.pages.length) {
|
|
26049
26011
|
this.currentPageIndex = this.pages.length - 1;
|
|
@@ -30094,7 +30056,7 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
|
|
|
30094
30056
|
textAlign: { default: "left" },
|
|
30095
30057
|
writingMode: { default: "horizontal-tb" }
|
|
30096
30058
|
},
|
|
30097
|
-
emits: ["commit", "cancel"],
|
|
30059
|
+
emits: ["commit", "cancel", "sync"],
|
|
30098
30060
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
30099
30061
|
const props = __props;
|
|
30100
30062
|
const emit2 = __emit;
|
|
@@ -30232,6 +30194,7 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
|
|
|
30232
30194
|
chip.dataset.var = key;
|
|
30233
30195
|
chip.title = chipTitle(key);
|
|
30234
30196
|
chip.textContent = getChipLabel(key);
|
|
30197
|
+
syncContent();
|
|
30235
30198
|
};
|
|
30236
30199
|
const buildVariableHtml = (rawKey) => `<span class="variable-chip" contenteditable="false" data-var="${escapeHtml2(rawKey)}" title="${escapeHtml2(chipTitle(rawKey))}">${escapeHtml2(getChipLabel(rawKey))}</span>`;
|
|
30237
30200
|
const toChips = (html) => html.replace(/\{#([^}]+)\}/g, (_match, rawKey) => buildVariableHtml(rawKey));
|
|
@@ -30378,6 +30341,7 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
|
|
|
30378
30341
|
range.insertNode(chip);
|
|
30379
30342
|
placeCaretAfter(chip);
|
|
30380
30343
|
(_a2 = editorRef.value) == null ? void 0 : _a2.focus();
|
|
30344
|
+
syncContent();
|
|
30381
30345
|
};
|
|
30382
30346
|
const insertLineBreak = () => {
|
|
30383
30347
|
const editor = editorRef.value;
|
|
@@ -30401,7 +30365,11 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
|
|
|
30401
30365
|
finished = true;
|
|
30402
30366
|
emit2("cancel");
|
|
30403
30367
|
};
|
|
30404
|
-
|
|
30368
|
+
const syncContent = () => {
|
|
30369
|
+
if (finished) return;
|
|
30370
|
+
emit2("sync", serialize());
|
|
30371
|
+
};
|
|
30372
|
+
__expose({ commit, cancel, syncContent });
|
|
30405
30373
|
const handleKeydown = (event) => {
|
|
30406
30374
|
if (event.isComposing) return;
|
|
30407
30375
|
if (event.key === "Escape") {
|
|
@@ -30638,6 +30606,7 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
|
|
|
30638
30606
|
return span;
|
|
30639
30607
|
})) return;
|
|
30640
30608
|
closeMenu();
|
|
30609
|
+
syncContent();
|
|
30641
30610
|
};
|
|
30642
30611
|
let lastNonCollapsedRange = null;
|
|
30643
30612
|
let caretSnapshot = null;
|
|
@@ -31241,6 +31210,7 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
|
|
|
31241
31210
|
setPendingFormat,
|
|
31242
31211
|
queryActiveFormat,
|
|
31243
31212
|
captureSelection,
|
|
31213
|
+
syncContent,
|
|
31244
31214
|
insertField: handleFieldSelect,
|
|
31245
31215
|
polishText: handlePolish
|
|
31246
31216
|
});
|
|
@@ -31451,7 +31421,7 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
|
|
|
31451
31421
|
};
|
|
31452
31422
|
}
|
|
31453
31423
|
});
|
|
31454
|
-
const VariableInlineEditor = /* @__PURE__ */ _export_sfc(_sfc_main$U, [["__scopeId", "data-v-
|
|
31424
|
+
const VariableInlineEditor = /* @__PURE__ */ _export_sfc(_sfc_main$U, [["__scopeId", "data-v-cd808142"]]);
|
|
31455
31425
|
const _hoisted_1$1U = ["data-auto-height"];
|
|
31456
31426
|
const _hoisted_2$F = ["innerHTML"];
|
|
31457
31427
|
const _hoisted_3$C = {
|
|
@@ -31710,6 +31680,11 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
|
|
|
31710
31680
|
store.updateElement(props.element.id, { content: raw });
|
|
31711
31681
|
}
|
|
31712
31682
|
};
|
|
31683
|
+
const handleSync = (raw) => {
|
|
31684
|
+
if (raw !== (props.element.content || "")) {
|
|
31685
|
+
store.updateElement(props.element.id, { content: raw }, false);
|
|
31686
|
+
}
|
|
31687
|
+
};
|
|
31713
31688
|
const handleCancel = () => {
|
|
31714
31689
|
isInlineEditing.value = false;
|
|
31715
31690
|
};
|
|
@@ -31752,7 +31727,8 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
|
|
|
31752
31727
|
"text-align": _ctx.element.style.textAlign,
|
|
31753
31728
|
"writing-mode": _ctx.element.style.writingMode || "horizontal-tb",
|
|
31754
31729
|
onCommit: handleCommit,
|
|
31755
|
-
onCancel: handleCancel
|
|
31730
|
+
onCancel: handleCancel,
|
|
31731
|
+
onSync: handleSync
|
|
31756
31732
|
}, null, 8, ["model-value", "element-id", "page-index", "font-size", "font-family", "font-weight", "font-style", "text-color", "text-align", "writing-mode"])) : !isEmpty2.value ? (openBlock(), createElementBlock("div", {
|
|
31757
31733
|
key: 1,
|
|
31758
31734
|
class: "w-full unified-text-content",
|
|
@@ -31762,7 +31738,7 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
|
|
|
31762
31738
|
};
|
|
31763
31739
|
}
|
|
31764
31740
|
});
|
|
31765
|
-
const UnifiedTextElement = /* @__PURE__ */ _export_sfc(_sfc_main$T, [["__scopeId", "data-v-
|
|
31741
|
+
const UnifiedTextElement = /* @__PURE__ */ _export_sfc(_sfc_main$T, [["__scopeId", "data-v-1344f0b6"]]);
|
|
31766
31742
|
const _hoisted_1$1T = ["src"];
|
|
31767
31743
|
const _hoisted_2$E = {
|
|
31768
31744
|
key: 1,
|
|
@@ -34834,7 +34810,7 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
|
|
|
34834
34810
|
const renderBarcode = async () => {
|
|
34835
34811
|
if (!barcodeRef.value) return;
|
|
34836
34812
|
try {
|
|
34837
|
-
const jsBarcodeModule = await import("./JsBarcode-
|
|
34813
|
+
const jsBarcodeModule = await import("./JsBarcode-CECdI86m.js").then((n) => n.JsBarcode);
|
|
34838
34814
|
const JsBarcode = (jsBarcodeModule == null ? void 0 : jsBarcodeModule.default) || jsBarcodeModule;
|
|
34839
34815
|
const content = resolvedContent.value;
|
|
34840
34816
|
if (!content) return;
|
|
@@ -34989,7 +34965,7 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
|
|
|
34989
34965
|
});
|
|
34990
34966
|
const renderQR = async () => {
|
|
34991
34967
|
try {
|
|
34992
|
-
const qrcodeModule = await import("./browser-
|
|
34968
|
+
const qrcodeModule = await import("./browser-Dzsc4Gy5.js").then((n) => n.browser);
|
|
34993
34969
|
const QRCode = (qrcodeModule == null ? void 0 : qrcodeModule.default) || qrcodeModule;
|
|
34994
34970
|
const content = resolvedContent.value;
|
|
34995
34971
|
if (!content) {
|
|
@@ -38332,7 +38308,7 @@ const usePrint = () => {
|
|
|
38332
38308
|
const svgToCanvas = async (root) => {
|
|
38333
38309
|
const svgs = root.querySelectorAll("svg");
|
|
38334
38310
|
if (svgs.length === 0) return;
|
|
38335
|
-
const { Canvg } = await import("./index.es-
|
|
38311
|
+
const { Canvg } = await import("./index.es-Ch6y9Iyi.js");
|
|
38336
38312
|
svgs.forEach((svg) => {
|
|
38337
38313
|
const parent = svg.parentElement;
|
|
38338
38314
|
if (!parent) return;
|
|
@@ -38920,7 +38896,7 @@ const usePrint = () => {
|
|
|
38920
38896
|
}
|
|
38921
38897
|
try {
|
|
38922
38898
|
const generatePageImage = async (page2) => {
|
|
38923
|
-
const domToImageModule = await import("./dom-to-image-more.min-
|
|
38899
|
+
const domToImageModule = await import("./dom-to-image-more.min-C_XiZUaT.js").then((n) => n.domToImageMore_min);
|
|
38924
38900
|
const domtoimage = (domToImageModule == null ? void 0 : domToImageModule.default) || domToImageModule;
|
|
38925
38901
|
const canvas = await domtoimage.toCanvas(page2, {
|
|
38926
38902
|
filter: (node) => {
|
|
@@ -38978,7 +38954,7 @@ const usePrint = () => {
|
|
|
38978
38954
|
cleanup = source.cleanup;
|
|
38979
38955
|
const { container, tempWrapper: wrapper } = await processContentForImage(source.content, width, height, true, source.getComputedStyleFn);
|
|
38980
38956
|
tempWrapper = wrapper;
|
|
38981
|
-
const jsPdfModule = await import("./jspdf.es.min-
|
|
38957
|
+
const jsPdfModule = await import("./jspdf.es.min-BY5Xfz5v.js");
|
|
38982
38958
|
const jsPDF = (jsPdfModule == null ? void 0 : jsPdfModule.default) || (jsPdfModule == null ? void 0 : jsPdfModule.jsPDF) || jsPdfModule;
|
|
38983
38959
|
const pdf = new jsPDF({
|
|
38984
38960
|
orientation: width > height ? "l" : "p",
|
|
@@ -39390,7 +39366,7 @@ const usePrint = () => {
|
|
|
39390
39366
|
link.click();
|
|
39391
39367
|
document.body.removeChild(link);
|
|
39392
39368
|
} else {
|
|
39393
|
-
const jsZipModule = await import("./jszip.min-
|
|
39369
|
+
const jsZipModule = await import("./jszip.min-CrajC7IR.js").then((n) => n.jszip_min);
|
|
39394
39370
|
const JSZip = (jsZipModule == null ? void 0 : jsZipModule.default) || jsZipModule;
|
|
39395
39371
|
const zip = new JSZip();
|
|
39396
39372
|
await Promise.all(pageImages.map(async (dataUrl, index2) => {
|
|
@@ -40199,7 +40175,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
40199
40175
|
},
|
|
40200
40176
|
emits: ["update:visible", "update:value", "close"],
|
|
40201
40177
|
setup(__props, { emit: __emit }) {
|
|
40202
|
-
const Editor = /* @__PURE__ */ defineAsyncComponent(() => import("./index-
|
|
40178
|
+
const Editor = /* @__PURE__ */ defineAsyncComponent(() => import("./index-D4aOsQY_.js").then((m) => m.Editor));
|
|
40203
40179
|
const { t } = useI18n();
|
|
40204
40180
|
const { isDark: isDark2 } = useTheme();
|
|
40205
40181
|
const modalContainer = inject("modal-container", ref(null));
|
|
@@ -43295,7 +43271,7 @@ function render$K(_ctx, _cache) {
|
|
|
43295
43271
|
}
|
|
43296
43272
|
const InfoIcon = markRaw({ name: "material-symbols-info", render: render$K });
|
|
43297
43273
|
const name = "x-print-designer";
|
|
43298
|
-
const version = "0.4.
|
|
43274
|
+
const version = "0.4.42";
|
|
43299
43275
|
const dependencies = { "@guolao/vue-monaco-editor": "^1.6.0", "canvg": "^3.0.11", "dom-to-image-more": "^3.7.2", "echarts": "^6.0.0", "jsbarcode": "^3.12.3", "jspdf": "4.2", "jszip": "^3.10.1", "lodash": "^4.17.21", "qrcode": "^1.5.4", "uuid": "^11.0.3" };
|
|
43300
43276
|
const devDependencies = { "@iconify-json/material-symbols": "^1.2.53", "@types/jsbarcode": "^3.11.4", "@types/lodash": "^4.17.13", "@types/node": "^22.10.2", "@types/qrcode": "^1.5.6", "@types/uuid": "^10.0.0", "@vitejs/plugin-vue": "^5.2.1", "@vue/tsconfig": "^0.7.0", "autoprefixer": "^10.4.20", "postcss": "^8.4.49", "pinia": "2.3.0", "rollup-plugin-visualizer": "^7.0.1", "sharp": "^0.34.5", "tailwindcss": "^3.4.17", "terser": "^5.46.1", "typescript": "~5.6.2", "unplugin-icons": "^23.0.1", "vite": "^6.0.1", "vue": "3.5.13", "vue-i18n": "11.2.8", "vue-tsc": "^2.1.10" };
|
|
43301
43277
|
const pkg = {
|
|
@@ -46050,7 +46026,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
46050
46026
|
},
|
|
46051
46027
|
emits: ["update:value"],
|
|
46052
46028
|
setup(__props, { emit: __emit }) {
|
|
46053
|
-
const Editor = /* @__PURE__ */ defineAsyncComponent(() => import("./index-
|
|
46029
|
+
const Editor = /* @__PURE__ */ defineAsyncComponent(() => import("./index-D4aOsQY_.js").then((m) => m.Editor));
|
|
46054
46030
|
const emit2 = __emit;
|
|
46055
46031
|
useDesignerStore();
|
|
46056
46032
|
const { isDark: isDark2 } = useTheme();
|
|
@@ -50138,6 +50114,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
50138
50114
|
captureInlineSelection();
|
|
50139
50115
|
};
|
|
50140
50116
|
const handleFormat = (type, value) => {
|
|
50117
|
+
var _a2;
|
|
50141
50118
|
console.log("[DEBUG 文本2] handleFormat called:", { type, value });
|
|
50142
50119
|
if (!store.isTemplateEditable) return;
|
|
50143
50120
|
if (!selectedElementId.value && !store.tableSelection && !store.customTableSelection) return;
|
|
@@ -50152,15 +50129,24 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
50152
50129
|
if (hasSelection) {
|
|
50153
50130
|
console.log("[DEBUG 文本2] applying inline format to selection");
|
|
50154
50131
|
editor.applyInlineFormat(type, value);
|
|
50132
|
+
(_a2 = editor.syncContent) == null ? void 0 : _a2.call(editor);
|
|
50155
50133
|
return;
|
|
50156
50134
|
}
|
|
50157
50135
|
if (hasCaretSnapshot) {
|
|
50158
50136
|
console.log("[DEBUG 文本2] setting pending format with caret snapshot");
|
|
50137
|
+
if (type === "fontSize") {
|
|
50138
|
+
updateStyle({ fontSize: value });
|
|
50139
|
+
return;
|
|
50140
|
+
}
|
|
50159
50141
|
editor.setPendingFormat(type, value);
|
|
50160
50142
|
return;
|
|
50161
50143
|
}
|
|
50162
50144
|
if (isCollapsed) {
|
|
50163
50145
|
console.log("[DEBUG 文本2] setting pending format for collapsed caret");
|
|
50146
|
+
if (type === "fontSize") {
|
|
50147
|
+
updateStyle({ fontSize: value });
|
|
50148
|
+
return;
|
|
50149
|
+
}
|
|
50164
50150
|
editor.setPendingFormat(type, value);
|
|
50165
50151
|
return;
|
|
50166
50152
|
}
|
|
@@ -50612,7 +50598,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
50612
50598
|
};
|
|
50613
50599
|
}
|
|
50614
50600
|
});
|
|
50615
|
-
const FloatingTypographyToolbar = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-
|
|
50601
|
+
const FloatingTypographyToolbar = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-42b9b68e"]]);
|
|
50616
50602
|
const _hoisted_1$c = { class: "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 text-sm leading-none text-gray-300 z-10" };
|
|
50617
50603
|
const _hoisted_2$4 = {
|
|
50618
50604
|
key: 2,
|
|
@@ -50862,7 +50848,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
50862
50848
|
};
|
|
50863
50849
|
const renderBarcodeDataUrl = async (element) => {
|
|
50864
50850
|
try {
|
|
50865
|
-
const jsBarcodeModule = await import("./JsBarcode-
|
|
50851
|
+
const jsBarcodeModule = await import("./JsBarcode-CECdI86m.js").then((n) => n.JsBarcode);
|
|
50866
50852
|
const JsBarcode = (jsBarcodeModule == null ? void 0 : jsBarcodeModule.default) || jsBarcodeModule;
|
|
50867
50853
|
const canvas = document.createElement("canvas");
|
|
50868
50854
|
const style = element.style || {};
|
|
@@ -50889,7 +50875,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
50889
50875
|
const renderQrDataUrl = async (element) => {
|
|
50890
50876
|
var _a2, _b;
|
|
50891
50877
|
try {
|
|
50892
|
-
const qrcodeModule = await import("./browser-
|
|
50878
|
+
const qrcodeModule = await import("./browser-Dzsc4Gy5.js").then((n) => n.browser);
|
|
50893
50879
|
const QRCode = (qrcodeModule == null ? void 0 : qrcodeModule.default) || qrcodeModule;
|
|
50894
50880
|
return await QRCode.toDataURL(getResolvedContent(element), {
|
|
50895
50881
|
margin: 0,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, h, shallowRef, computed, onUnmounted, watch, loader, ref, onMounted, nextTick } from "./index-
|
|
1
|
+
import { defineComponent, h, shallowRef, computed, onUnmounted, watch, loader, ref, onMounted, nextTick } from "./index-CQixnPpt.js";
|
|
2
2
|
var __defProp$2 = Object.defineProperty;
|
|
3
3
|
var __defProps = Object.defineProperties;
|
|
4
4
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { commonjsGlobal, getDefaultExportFromCjs } from "./index-
|
|
1
|
+
import { commonjsGlobal, getDefaultExportFromCjs } from "./index-CQixnPpt.js";
|
|
2
2
|
import { _typeof as _typeof$1 } from "./typeof-DxTVrAEz.js";
|
|
3
3
|
var es_promise = {};
|
|
4
4
|
var es_promise_constructor = {};
|
|
@@ -10832,7 +10832,7 @@ function le() {
|
|
|
10832
10832
|
var h2 = l2.getContext("2d");
|
|
10833
10833
|
h2.fillStyle = "#fff", h2.fillRect(0, 0, l2.width, l2.height);
|
|
10834
10834
|
var f2 = { ignoreMouse: true, ignoreAnimation: true, ignoreDimensions: true }, d2 = this;
|
|
10835
|
-
return (i.canvg ? Promise.resolve(i.canvg) : import("./index.es-
|
|
10835
|
+
return (i.canvg ? Promise.resolve(i.canvg) : import("./index.es-Ch6y9Iyi.js")).catch(function(t3) {
|
|
10836
10836
|
return Promise.reject(new Error("Could not load canvg: " + t3));
|
|
10837
10837
|
}).then(function(t3) {
|
|
10838
10838
|
return t3.default ? t3.default : t3;
|