@printstack/print-studio 0.1.0 → 0.1.2
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 +122 -154
- package/assets/render.worker-DkH7TepL.js +109 -0
- package/{cloneDeep-C5UZRjbH.js → cloneDeep-waBDTGc3.js} +10 -4
- package/components/print-s-logo/print-s-logo.vue.d.ts +1 -1
- package/components/s-form/types.d.ts +1 -1
- package/core/coordinate-space.d.ts +16 -0
- package/core/document-model.d.ts +1 -1
- package/core/element-registry.d.ts +3 -8
- package/core/page-extensions.d.ts +1 -1
- package/core/types.d.ts +8 -0
- package/core.js +2 -2
- package/designer/commands/menu-adapter.d.ts +3 -3
- package/designer/commands/menu-types.d.ts +8 -1
- package/designer/commands/types.d.ts +2 -0
- package/designer/components/dialogs/preview-dialog.vue.d.ts +10 -1
- package/designer/components/dialogs/print-preview-dialog.vue.d.ts +14 -0
- package/designer/components/dialogs/print-preview-source.d.ts +22 -0
- package/designer/components/dialogs/use-document-preview.d.ts +5 -1
- package/designer/components/dialogs/use-preview-renderer.d.ts +2 -0
- package/designer/components/dialogs/use-print-preview.d.ts +33 -0
- package/designer/components/fields/use-table-draft.d.ts +0 -4
- package/designer/components/panels/layer-row-types.d.ts +37 -0
- package/designer/components/panels/layer-row.vue.d.ts +17 -0
- package/designer/components/stage/marquee-overlay.vue.d.ts +8 -0
- package/designer/components/stage/node-style.d.ts +3 -0
- package/designer/components/stage/selection-member.vue.d.ts +14 -0
- package/designer/composables/use-theme.d.ts +3 -0
- package/designer/facade/editing.d.ts +2 -2
- package/designer/facade/entities.d.ts +1156 -22
- package/designer/facade/output.d.ts +2 -2
- package/designer/frame/print-designer-frame.vue.d.ts +2 -2
- package/designer/frame/shared.d.ts +2 -0
- package/designer/frame/view.d.ts +9 -0
- package/designer/interactions/marquee.d.ts +1 -1
- package/designer/interactions/move.d.ts +3 -1
- package/designer/mount-print-designer.d.ts +1 -1
- package/designer/mount-print-preview.d.ts +5 -0
- package/designer/plugins/plugin-manager.d.ts +3 -3
- package/designer/plugins/types.d.ts +1 -1
- package/designer/print-designer.vue.d.ts +2 -2
- package/designer/print-preview.vue.d.ts +4 -0
- package/designer/stores/document-store.d.ts +72 -0
- package/designer/stores/editor-store.d.ts +770 -14
- package/designer/stores/page-store.d.ts +25 -1
- package/designer/stores/template-store.d.ts +52 -4
- package/designer/stores/types.d.ts +1 -0
- package/designer/stores/ui-store.d.ts +232 -3
- package/designer/stores/view-store.d.ts +10 -1
- package/designer.d.ts +1 -1
- package/designer.js +3 -3
- package/{document-model-DC9sn2WV.js → document-model-Cc5RoO4j.js} +160 -179
- package/elements/table/table-style.d.ts +3 -10
- package/host-OAp3gFDx.js +123 -0
- package/index.js +5 -5
- package/locales/runtime.d.ts +8 -2
- package/locales/translations/zh-CN/app.json.d.ts +1 -0
- package/locales/translations/zh-CN/designer.json.d.ts +9 -4
- package/{mount-print-designer-BzHLGlv-.js → mount-print-designer-DnHTrBE9.js} +4 -3
- package/mount-print-preview-Bcb08lJ-.js +66 -0
- package/package.json +1 -1
- package/presets-BunYODhE.js +13 -0
- package/{registries-BOU8RLim.js → registries-sg39PGF1.js} +793 -790
- package/runtime/browser-output.d.ts +2 -0
- package/runtime.js +4 -4
- package/{saas-B3fJOgHX.js → saas-D-q51uTz.js} +1 -1
- package/saas.js +1 -1
- package/{studio-C_rqbJ9q.js → studio-B3B6zI06.js} +830 -754
- package/studio-types.d.ts +3 -2
- package/style.css +1 -1
- package/vue.js +1035 -941
- package/assets/render.worker-Cfbk18NW.js +0 -109
- package/presets-Cwp20ef6.js +0 -133
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { n as e } from "./rolldown-runtime-QGRDbDUS.js";
|
|
2
|
-
import { A as t, B as n, D as r, G as i, J as a, K as o, N as s, O as c, P as l,
|
|
3
|
-
import { A as x, B as S, N as C, P as w, R as T, t as E } from "./cloneDeep-
|
|
4
|
-
import { $ as D, A as O, B as k, D as A, E as j, G as M, I as N, L as ee, M as
|
|
5
|
-
import { createPinia as
|
|
6
|
-
import { computed as
|
|
2
|
+
import { A as t, B as n, D as r, G as i, J as a, K as o, N as s, O as c, P as l, Q as u, U as d, W as f, Y as p, Z as m, k as h, n as g, q as _, r as v, t as y, z as b } from "./registries-sg39PGF1.js";
|
|
3
|
+
import { A as x, B as S, N as C, P as w, R as T, t as E } from "./cloneDeep-waBDTGc3.js";
|
|
4
|
+
import { $ as D, A as O, B as k, D as A, E as j, G as M, I as N, L as ee, M as P, N as te, O as ne, P as re, Q as F, T as I, Z as ie, _ as ae, a as oe, at as L, c as se, ct as ce, d as le, dt as ue, et as de, f as fe, ft as pe, g as me, h as R, ht as he, i as ge, j as _e, l as z, lt as ve, m as ye, mt as be, o as xe, ot as Se, p as B, pt as Ce, r as we, s as Te, st as Ee, t as De, tt as V, u as Oe, ut as ke, v as Ae, x as je, y as Me, z as Ne } from "./document-model-Cc5RoO4j.js";
|
|
5
|
+
import { createPinia as Pe, defineStore as H, disposePinia as Fe, getActivePinia as Ie, setActivePinia as Le } from "pinia";
|
|
6
|
+
import { computed as U, hasInjectionContext as Re, markRaw as ze, onScopeDispose as Be, reactive as Ve, ref as W, shallowReactive as He, shallowRef as Ue, toRefs as G, watch as K } from "vue";
|
|
7
7
|
// node_modules/.pnpm/mitt@3.0.1/node_modules/mitt/dist/mitt.mjs
|
|
8
|
-
function
|
|
8
|
+
function We(e) {
|
|
9
9
|
return {
|
|
10
10
|
all: e ||= /* @__PURE__ */ new Map(),
|
|
11
11
|
on: function(t, n) {
|
|
@@ -27,8 +27,8 @@ function Ge(e) {
|
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
// src/core/events.ts
|
|
30
|
-
var
|
|
31
|
-
emitter =
|
|
30
|
+
var Ge = class {
|
|
31
|
+
emitter = We();
|
|
32
32
|
wildcard = /* @__PURE__ */ new Set();
|
|
33
33
|
emit(e, t) {
|
|
34
34
|
this.emitter.emit(e, t);
|
|
@@ -53,17 +53,17 @@ var Ke = class {
|
|
|
53
53
|
});
|
|
54
54
|
return n;
|
|
55
55
|
}
|
|
56
|
-
},
|
|
57
|
-
function
|
|
58
|
-
return
|
|
56
|
+
}, Ke = null;
|
|
57
|
+
function qe() {
|
|
58
|
+
return Ke ||= new Ge(), Ke;
|
|
59
59
|
}
|
|
60
60
|
// src/designer/commands/command-registry.ts
|
|
61
|
-
var
|
|
61
|
+
var Je = class {
|
|
62
62
|
bus;
|
|
63
63
|
commands = /* @__PURE__ */ new Map();
|
|
64
64
|
getContext;
|
|
65
|
-
version =
|
|
66
|
-
constructor(e, t =
|
|
65
|
+
version = Ue(0);
|
|
66
|
+
constructor(e, t = qe()) {
|
|
67
67
|
this.getContext = e, this.bus = t;
|
|
68
68
|
}
|
|
69
69
|
byGroup(e) {
|
|
@@ -173,8 +173,7 @@ var Ye = class {
|
|
|
173
173
|
trackVersion() {
|
|
174
174
|
return this.version.value;
|
|
175
175
|
}
|
|
176
|
-
};
|
|
177
|
-
// src/designer/commands/domain-commands.ts
|
|
176
|
+
}, Ye = /* @__PURE__ */ e({ installDomainCommands: () => Xe });
|
|
178
177
|
function q(e, t, n, r = {}) {
|
|
179
178
|
return {
|
|
180
179
|
...r,
|
|
@@ -276,15 +275,18 @@ function Xe(e, t = !1) {
|
|
|
276
275
|
q("canvas.setBackground", n, (e) => e.view.setCanvasBackground),
|
|
277
276
|
q("output.html", o, (e) => (t, n, r) => e.rendering.html(e.document.data, t ?? w(e.document.data), n, r)),
|
|
278
277
|
q("output.pdf", o, (e) => (t, n, r) => e.rendering.pdf(e.document.data, t ?? w(e.document.data), n, r)),
|
|
279
|
-
...["preview", "print"].map((t) => q(`output.${t}`, o, (n) => async (r, i) =>
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
278
|
+
...["preview", "print"].map((t) => q(`output.${t}`, o, (n) => async (r, i) => {
|
|
279
|
+
if (t === "preview" && i?.mode === "designer") {
|
|
280
|
+
let t = {
|
|
281
|
+
document: n.document.getDocument(),
|
|
282
|
+
input: E(r ?? w(n.document.data))
|
|
283
|
+
}, { mountPrintPreview: a } = await import("./mount-print-preview-Bcb08lJ-.js");
|
|
284
|
+
return a(e, t, i);
|
|
285
|
+
}
|
|
286
|
+
return p(n.rendering, e.output, () => {
|
|
287
|
+
e.store();
|
|
288
|
+
})[t](n.document.data, r ?? w(n.document.data), i);
|
|
289
|
+
}))
|
|
288
290
|
];
|
|
289
291
|
return e.commands.registerScoped(t ? c.filter((t) => !e.commands.has(t.id)) : c);
|
|
290
292
|
}
|
|
@@ -294,7 +296,7 @@ function Ze(e, t) {
|
|
|
294
296
|
t.emit("elements:changed", {});
|
|
295
297
|
});
|
|
296
298
|
}
|
|
297
|
-
function Qe(e, t =
|
|
299
|
+
function Qe(e, t = qe()) {
|
|
298
300
|
let n = tt(e, t), r = $e(e, t), i = {
|
|
299
301
|
canvas: e.canvas,
|
|
300
302
|
clipboard: e.clipboard,
|
|
@@ -750,7 +752,7 @@ var vt = {
|
|
|
750
752
|
}, yt = "1.0", bt = class {
|
|
751
753
|
#e = /* @__PURE__ */ new Map();
|
|
752
754
|
#t = /* @__PURE__ */ new Map();
|
|
753
|
-
#n =
|
|
755
|
+
#n = Ue(0);
|
|
754
756
|
contribute(e, t) {
|
|
755
757
|
e.signal.throwIfAborted();
|
|
756
758
|
let n = this.#t.get(t.point);
|
|
@@ -1061,7 +1063,7 @@ function Ut() {
|
|
|
1061
1063
|
shortcut: "p",
|
|
1062
1064
|
toHtml({ props: e }) {
|
|
1063
1065
|
let t = Mt(e), n = t.closed ? String(e.fill ?? "none") : "none";
|
|
1064
|
-
return `<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 ${t.viewWidth} ${t.viewHeight}" preserveAspectRatio="none" style="overflow:visible"><path d="${jt(t.anchors, t.closed)}" fill="${
|
|
1066
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 ${t.viewWidth} ${t.viewHeight}" preserveAspectRatio="none" style="overflow:visible"><path d="${jt(t.anchors, t.closed)}" fill="${f(n)}" stroke="${f(e.stroke ?? "#333333")}" stroke-width="${zt(e)}" stroke-linecap="round" stroke-linejoin="round" /></svg>`;
|
|
1065
1067
|
},
|
|
1066
1068
|
toPdf({ draw: e, node: t, pdf: n, props: r }) {
|
|
1067
1069
|
let a = Mt(r), o = a.anchors[0], s = a.closed && !i(r.fill), c = !i(r.stroke);
|
|
@@ -1130,7 +1132,7 @@ async function Yt(e) {
|
|
|
1130
1132
|
let t = document.createElement("iframe");
|
|
1131
1133
|
t.id = "print-studio-print-frame", t.style.position = "fixed", t.style.right = "0", t.style.bottom = "0", t.style.width = "0", t.style.height = "0", t.style.border = "0", t.style.visibility = "hidden", document.body.appendChild(t);
|
|
1132
1134
|
try {
|
|
1133
|
-
await
|
|
1135
|
+
await d(t, e);
|
|
1134
1136
|
let n = t.contentWindow;
|
|
1135
1137
|
n && (n.focus(), n.print());
|
|
1136
1138
|
} catch (e) {
|
|
@@ -1371,7 +1373,7 @@ function $t(e, t, n) {
|
|
|
1371
1373
|
preferences: { register(t) {
|
|
1372
1374
|
i("preferences");
|
|
1373
1375
|
let r = n.track(e.preferences.register(t));
|
|
1374
|
-
return e.store().view.restorePreferences(), e.store().panel.restorePreferences(), r;
|
|
1376
|
+
return e.store().view.restorePreferences(), e.store().panel.restorePreferences(), e.store().ui.restorePreferences(), r;
|
|
1375
1377
|
} },
|
|
1376
1378
|
rendering: {
|
|
1377
1379
|
get active() {
|
|
@@ -1448,20 +1450,7 @@ var en = class {
|
|
|
1448
1450
|
function tn(e) {
|
|
1449
1451
|
return !!e && typeof e == "object" && "then" in e;
|
|
1450
1452
|
}
|
|
1451
|
-
|
|
1452
|
-
return "manifest" in e && e.manifest ? e.manifest : {
|
|
1453
|
-
apiVersion: "1.0",
|
|
1454
|
-
id: e.name,
|
|
1455
|
-
permissions: typeof e == "function" ? [
|
|
1456
|
-
"commands",
|
|
1457
|
-
"events",
|
|
1458
|
-
"panels",
|
|
1459
|
-
"templates"
|
|
1460
|
-
] : [],
|
|
1461
|
-
version: "1.0.0"
|
|
1462
|
-
};
|
|
1463
|
-
}
|
|
1464
|
-
var rn = class {
|
|
1453
|
+
var nn = class {
|
|
1465
1454
|
getContext;
|
|
1466
1455
|
policy;
|
|
1467
1456
|
#e = !1;
|
|
@@ -1518,7 +1507,7 @@ var rn = class {
|
|
|
1518
1507
|
}
|
|
1519
1508
|
install(e) {
|
|
1520
1509
|
if (this.#e) throw Error("Plugin manager has been disposed");
|
|
1521
|
-
let t =
|
|
1510
|
+
let t = this.manifestOf(e);
|
|
1522
1511
|
if (this.validate(t), this.#n.has(t.id)) return t.id;
|
|
1523
1512
|
let n = {
|
|
1524
1513
|
manifest: Object.freeze({
|
|
@@ -1529,18 +1518,13 @@ var rn = class {
|
|
|
1529
1518
|
}),
|
|
1530
1519
|
status: "installed"
|
|
1531
1520
|
};
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
name: e.name,
|
|
1540
|
-
setup: e.setup
|
|
1541
|
-
};
|
|
1542
|
-
}
|
|
1543
|
-
return this.#n.set(t.id, n), this.getContext().store().plugin.add(t.id), this.setStatus(n, "installed"), t.id;
|
|
1521
|
+
return "load" in e ? n.loader = e.load : n.definition = typeof e == "function" ? e : "manifest" in e ? {
|
|
1522
|
+
manifest: n.manifest,
|
|
1523
|
+
setup: e.setup
|
|
1524
|
+
} : {
|
|
1525
|
+
name: e.name,
|
|
1526
|
+
setup: e.setup
|
|
1527
|
+
}, this.#n.set(t.id, n), this.getContext().store().plugin.add(t.id), this.setStatus(n, "installed"), t.id;
|
|
1544
1528
|
}
|
|
1545
1529
|
list() {
|
|
1546
1530
|
return [...this.#n.keys()];
|
|
@@ -1559,7 +1543,7 @@ var rn = class {
|
|
|
1559
1543
|
return this.dispose(e);
|
|
1560
1544
|
}
|
|
1561
1545
|
use(e, t) {
|
|
1562
|
-
let n = "createPlugin" in e ? e.createPlugin(t) : e, r =
|
|
1546
|
+
let n = "createPlugin" in e ? e.createPlugin(t) : e, r = this.manifestOf(n).id;
|
|
1563
1547
|
if (this.has(r)) return this.enable(r);
|
|
1564
1548
|
this.install(n);
|
|
1565
1549
|
let i = this.#n.get(r);
|
|
@@ -1573,7 +1557,7 @@ var rn = class {
|
|
|
1573
1557
|
}
|
|
1574
1558
|
}
|
|
1575
1559
|
useScoped(e) {
|
|
1576
|
-
let t =
|
|
1560
|
+
let t = this.manifestOf(e).id;
|
|
1577
1561
|
if (this.has(t)) return () => {};
|
|
1578
1562
|
let n = this.use(e), r = this.#n.get(t), i = () => {
|
|
1579
1563
|
this.#n.get(t) === r && this.dispose(t);
|
|
@@ -1591,7 +1575,7 @@ var rn = class {
|
|
|
1591
1575
|
let r = e.definition;
|
|
1592
1576
|
if (!r) throw Error(`Plugin was not loaded: ${e.manifest.id}`);
|
|
1593
1577
|
let i;
|
|
1594
|
-
if (i = typeof r == "function" ? r($t(this.getContext(), e.manifest, t)) : "manifest" in r ? r.setup($t(this.getContext(), e.manifest, t)) : r.setup(this.
|
|
1578
|
+
if (i = typeof r == "function" ? r($t(this.getContext(), e.manifest, t)) : "manifest" in r ? r.setup($t(this.getContext(), e.manifest, t)) : r.setup(this.createHostContext(t)), tn(i)) return i.then(n).catch((t) => {
|
|
1595
1579
|
throw this.fail(e, t), t;
|
|
1596
1580
|
});
|
|
1597
1581
|
n(i);
|
|
@@ -1613,7 +1597,7 @@ var rn = class {
|
|
|
1613
1597
|
}
|
|
1614
1598
|
}
|
|
1615
1599
|
}
|
|
1616
|
-
|
|
1600
|
+
createHostContext(e) {
|
|
1617
1601
|
let t = this.getContext(), n = new Proxy(t.commands, { get(t, n) {
|
|
1618
1602
|
if (n === "register") return (n) => {
|
|
1619
1603
|
e.track(t.registerScoped([n]));
|
|
@@ -1651,6 +1635,19 @@ var rn = class {
|
|
|
1651
1635
|
setup: n.setup
|
|
1652
1636
|
};
|
|
1653
1637
|
}
|
|
1638
|
+
manifestOf(e) {
|
|
1639
|
+
if ("manifest" in e) {
|
|
1640
|
+
if (!e.manifest) throw Error("Plugins require a manifest");
|
|
1641
|
+
return e.manifest;
|
|
1642
|
+
}
|
|
1643
|
+
if (!this.#t.has(e)) throw Error("Plugins require a manifest");
|
|
1644
|
+
return {
|
|
1645
|
+
apiVersion: "1.0",
|
|
1646
|
+
id: e.name,
|
|
1647
|
+
permissions: [],
|
|
1648
|
+
version: "1.0.0"
|
|
1649
|
+
};
|
|
1650
|
+
}
|
|
1654
1651
|
removeFailedInstallation(e, t) {
|
|
1655
1652
|
this.#n.get(e) === t && (this.#n.delete(e), this.getContext().store().plugin.remove(e));
|
|
1656
1653
|
}
|
|
@@ -1680,16 +1677,16 @@ var rn = class {
|
|
|
1680
1677
|
for (let t of e.permissions ?? []) if (!this.policy.permissions.includes(t)) throw Error(`Host denied permission ${t} for ${e.id}`);
|
|
1681
1678
|
}
|
|
1682
1679
|
}
|
|
1683
|
-
},
|
|
1684
|
-
function
|
|
1685
|
-
return
|
|
1680
|
+
}, rn = 2e3, an = "designer.errorHandling.unexpectedErrorMessage", on = null;
|
|
1681
|
+
function sn() {
|
|
1682
|
+
return on ||= m({ report: cn }), on;
|
|
1686
1683
|
}
|
|
1687
|
-
function
|
|
1688
|
-
function
|
|
1684
|
+
function cn(e, t) {}
|
|
1685
|
+
function ln(e) {
|
|
1689
1686
|
let t = /* @__PURE__ */ new Map();
|
|
1690
1687
|
function n(e, n) {
|
|
1691
1688
|
let r = t.get(e);
|
|
1692
|
-
return r !== void 0 && n - r <
|
|
1689
|
+
return r !== void 0 && n - r < rn ? !1 : (t.set(e, n), !0);
|
|
1693
1690
|
}
|
|
1694
1691
|
return {
|
|
1695
1692
|
handle: async function(t) {
|
|
@@ -1709,12 +1706,12 @@ function un(e) {
|
|
|
1709
1706
|
}
|
|
1710
1707
|
};
|
|
1711
1708
|
}
|
|
1712
|
-
function
|
|
1709
|
+
function un(e) {
|
|
1713
1710
|
let t = 0;
|
|
1714
1711
|
return {
|
|
1715
1712
|
handle: async function() {
|
|
1716
1713
|
let n = Date.now();
|
|
1717
|
-
return n - t >=
|
|
1714
|
+
return n - t >= rn && (t = n, e.store().ui.toast(S(an), "error")), {
|
|
1718
1715
|
code: "unexpected-toast",
|
|
1719
1716
|
handled: !0
|
|
1720
1717
|
};
|
|
@@ -1724,13 +1721,13 @@ function dn(e) {
|
|
|
1724
1721
|
}
|
|
1725
1722
|
};
|
|
1726
1723
|
}
|
|
1727
|
-
var
|
|
1724
|
+
var dn = {
|
|
1728
1725
|
get description() {
|
|
1729
1726
|
return S("designer.errorHandling.pluginDescription");
|
|
1730
1727
|
},
|
|
1731
1728
|
name: "builtin:error-handling",
|
|
1732
1729
|
setup: function(e) {
|
|
1733
|
-
let t = e.errors, n = t.addRule(
|
|
1730
|
+
let t = e.errors, n = t.addRule(ln(e), { prepend: !0 }), r = t.addRule(un(e)), i = e.events.on("command:error", (t) => {
|
|
1734
1731
|
e.errors.capture(t.error, {
|
|
1735
1732
|
metadata: { commandId: t.id },
|
|
1736
1733
|
source: "command"
|
|
@@ -1740,26 +1737,26 @@ var fn = {
|
|
|
1740
1737
|
n(), r(), i();
|
|
1741
1738
|
};
|
|
1742
1739
|
}
|
|
1743
|
-
},
|
|
1744
|
-
bindEditorElements: () =>
|
|
1745
|
-
bindEditorErrors: () =>
|
|
1746
|
-
getEditorElements: () =>
|
|
1747
|
-
getEditorErrors: () =>
|
|
1748
|
-
}),
|
|
1749
|
-
function
|
|
1750
|
-
|
|
1740
|
+
}, fn = /* @__PURE__ */ e({
|
|
1741
|
+
bindEditorElements: () => _n,
|
|
1742
|
+
bindEditorErrors: () => hn,
|
|
1743
|
+
getEditorElements: () => vn,
|
|
1744
|
+
getEditorErrors: () => gn
|
|
1745
|
+
}), pn = /* @__PURE__ */ new WeakMap(), mn = /* @__PURE__ */ new WeakMap();
|
|
1746
|
+
function hn(e, t) {
|
|
1747
|
+
mn.set(e, t);
|
|
1751
1748
|
}
|
|
1752
|
-
function
|
|
1753
|
-
return
|
|
1749
|
+
function gn(e) {
|
|
1750
|
+
return mn.get(e) ?? sn();
|
|
1754
1751
|
}
|
|
1755
|
-
function
|
|
1756
|
-
|
|
1752
|
+
function _n(e, t) {
|
|
1753
|
+
pn.set(e, t);
|
|
1757
1754
|
}
|
|
1758
|
-
function
|
|
1759
|
-
return
|
|
1755
|
+
function vn(e) {
|
|
1756
|
+
return pn.get(e) ?? M;
|
|
1760
1757
|
}
|
|
1761
1758
|
// src/designer/services/preference-storage.ts
|
|
1762
|
-
var
|
|
1759
|
+
var yn = class {
|
|
1763
1760
|
fallback;
|
|
1764
1761
|
#e = [];
|
|
1765
1762
|
constructor(e) {
|
|
@@ -1777,19 +1774,40 @@ var bn = class {
|
|
|
1777
1774
|
set(e, t) {
|
|
1778
1775
|
(this.#e.at(-1) ?? this.fallback)?.set(e, t);
|
|
1779
1776
|
}
|
|
1780
|
-
}
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1777
|
+
};
|
|
1778
|
+
// src/core/coordinate-space.ts
|
|
1779
|
+
function bn(e, t) {
|
|
1780
|
+
return {
|
|
1781
|
+
x: t.x - e.x,
|
|
1782
|
+
y: t.y - e.y
|
|
1783
|
+
};
|
|
1784
|
+
}
|
|
1785
|
+
function xn(e, t) {
|
|
1786
|
+
return {
|
|
1787
|
+
x: t.x + e.x,
|
|
1788
|
+
y: t.y + e.y
|
|
1789
|
+
};
|
|
1790
|
+
}
|
|
1791
|
+
function Sn(e, t, n) {
|
|
1792
|
+
return {
|
|
1793
|
+
x: (t.x - e.left) / n,
|
|
1794
|
+
y: (t.y - e.top) / n
|
|
1795
|
+
};
|
|
1796
|
+
}
|
|
1797
|
+
// src/designer/services/stage-service.ts
|
|
1798
|
+
var Cn = /* @__PURE__ */ e({
|
|
1799
|
+
bindStageService: () => On,
|
|
1800
|
+
contentMmFromClient: () => kn,
|
|
1801
|
+
createStageService: () => wn,
|
|
1802
|
+
getScrollElement: () => An,
|
|
1803
|
+
getStageController: () => jn,
|
|
1804
|
+
getStageService: () => Dn,
|
|
1805
|
+
registerStageController: () => Mn,
|
|
1806
|
+
registerStageElements: () => Nn,
|
|
1807
|
+
scrollToContentPoint: () => Pn
|
|
1790
1808
|
});
|
|
1791
|
-
function
|
|
1792
|
-
let e =
|
|
1809
|
+
function wn() {
|
|
1810
|
+
let e = Ue(null), t = Ue(null), n = Ue(null);
|
|
1793
1811
|
function r(n, r) {
|
|
1794
1812
|
e.value = n, t.value = r;
|
|
1795
1813
|
}
|
|
@@ -1808,16 +1826,16 @@ function Sn() {
|
|
|
1808
1826
|
x: 0,
|
|
1809
1827
|
y: 0
|
|
1810
1828
|
};
|
|
1811
|
-
let a = i.getBoundingClientRect(), o =
|
|
1812
|
-
return {
|
|
1813
|
-
x:
|
|
1814
|
-
y:
|
|
1815
|
-
};
|
|
1829
|
+
let a = i.getBoundingClientRect(), o = de * r;
|
|
1830
|
+
return Sn(a, {
|
|
1831
|
+
x: e,
|
|
1832
|
+
y: n
|
|
1833
|
+
}, o);
|
|
1816
1834
|
}
|
|
1817
1835
|
function c(t, n, r, i) {
|
|
1818
1836
|
let a = e.value;
|
|
1819
1837
|
if (!a) return;
|
|
1820
|
-
let o =
|
|
1838
|
+
let o = de * i;
|
|
1821
1839
|
a.scrollLeft = t.x * o - n, a.scrollTop = t.y * o - r;
|
|
1822
1840
|
}
|
|
1823
1841
|
return {
|
|
@@ -1829,14 +1847,14 @@ function Sn() {
|
|
|
1829
1847
|
scrollToContentPoint: c
|
|
1830
1848
|
};
|
|
1831
1849
|
}
|
|
1832
|
-
var
|
|
1833
|
-
function
|
|
1834
|
-
return e ?
|
|
1850
|
+
var Tn = /* @__PURE__ */ new WeakMap(), En = wn();
|
|
1851
|
+
function Dn(e) {
|
|
1852
|
+
return e ? Tn.get(e) ?? En : En;
|
|
1835
1853
|
}
|
|
1836
|
-
function
|
|
1837
|
-
|
|
1854
|
+
function On(e) {
|
|
1855
|
+
Tn.set(e, wn());
|
|
1838
1856
|
}
|
|
1839
|
-
var { contentMmFromClient:
|
|
1857
|
+
var { contentMmFromClient: kn, getScrollElement: An, getStageController: jn, registerStageController: Mn, registerStageElements: Nn, scrollToContentPoint: Pn } = En, Fn = [
|
|
1840
1858
|
{
|
|
1841
1859
|
height: 297,
|
|
1842
1860
|
id: "delivery",
|
|
@@ -1856,8 +1874,8 @@ var { contentMmFromClient: Dn, getScrollElement: On, getStageController: kn, reg
|
|
|
1856
1874
|
width: 148
|
|
1857
1875
|
}
|
|
1858
1876
|
];
|
|
1859
|
-
function
|
|
1860
|
-
let e =
|
|
1877
|
+
function In() {
|
|
1878
|
+
let e = Oe();
|
|
1861
1879
|
return e.templateId = we, {
|
|
1862
1880
|
dataSources: [],
|
|
1863
1881
|
name: S("designer.tutorial.practiceName"),
|
|
@@ -1866,12 +1884,12 @@ function Pn() {
|
|
|
1866
1884
|
version: "1.0"
|
|
1867
1885
|
};
|
|
1868
1886
|
}
|
|
1869
|
-
function
|
|
1887
|
+
function Ln(e, t) {
|
|
1870
1888
|
let n = e[0].toUpperCase() + e.slice(1), r = t[0].toUpperCase() + t.slice(1);
|
|
1871
1889
|
return S(`designer.tutorial.courses${n}${r}`);
|
|
1872
1890
|
}
|
|
1873
1891
|
function X(e, t) {
|
|
1874
|
-
return
|
|
1892
|
+
return Ln(e.id, t);
|
|
1875
1893
|
}
|
|
1876
1894
|
function Z(e, t, n, r, i, a, o = {}) {
|
|
1877
1895
|
let s = e.element.add("text", {
|
|
@@ -1892,7 +1910,7 @@ function Z(e, t, n, r, i, a, o = {}) {
|
|
|
1892
1910
|
if (!s) throw Error(`Tutorial page missing: ${t}`);
|
|
1893
1911
|
return s;
|
|
1894
1912
|
}
|
|
1895
|
-
function
|
|
1913
|
+
function Rn(e, t) {
|
|
1896
1914
|
e.page.update(e.document.data.pages[0].id, {
|
|
1897
1915
|
height: t.height,
|
|
1898
1916
|
margins: {
|
|
@@ -1906,7 +1924,7 @@ function In(e, t) {
|
|
|
1906
1924
|
width: t.width
|
|
1907
1925
|
});
|
|
1908
1926
|
}
|
|
1909
|
-
function
|
|
1927
|
+
function zn(e, t) {
|
|
1910
1928
|
let n = e.template.create({
|
|
1911
1929
|
id: "tutorial-template",
|
|
1912
1930
|
name: X(t, "templateName")
|
|
@@ -1937,7 +1955,7 @@ function Ln(e, t) {
|
|
|
1937
1955
|
}
|
|
1938
1956
|
e.template.applyToPages([e.document.data.pages[0].id], n.id), e.template.enterEdit(n.id);
|
|
1939
1957
|
}
|
|
1940
|
-
function
|
|
1958
|
+
function Bn(e, t) {
|
|
1941
1959
|
e.template.exitEdit();
|
|
1942
1960
|
let n = e.document.data.pages[0];
|
|
1943
1961
|
e.page.setActive(n.id);
|
|
@@ -1997,7 +2015,7 @@ function Rn(e, t) {
|
|
|
1997
2015
|
number: "{{ bill.number }}"
|
|
1998
2016
|
}), 18, 33, t.width - 30), Z(e, n.id, `${X(t, "partnerLabel")}:{{ bill.partner }}`, 18, 41, t.width - 30);
|
|
1999
2017
|
}
|
|
2000
|
-
var
|
|
2018
|
+
var Vn = "tutorial-details", Hn = 50, Un = 22, Wn = 5, Gn = [
|
|
2001
2019
|
{
|
|
2002
2020
|
align: "left",
|
|
2003
2021
|
bind: "name",
|
|
@@ -2014,25 +2032,25 @@ var zn = "tutorial-details", Bn = 50, Vn = 22, Hn = 5, Un = [
|
|
|
2014
2032
|
key: "columnAmount"
|
|
2015
2033
|
}
|
|
2016
2034
|
];
|
|
2017
|
-
function
|
|
2035
|
+
function Kn(e, t) {
|
|
2018
2036
|
let n = e.document.data.pages[0], r = e.element.add("table", {
|
|
2019
2037
|
bindings: { rows: "bill.items" },
|
|
2020
|
-
height:
|
|
2021
|
-
id:
|
|
2038
|
+
height: Un,
|
|
2039
|
+
id: Vn,
|
|
2022
2040
|
name: X(t, "detailsName"),
|
|
2023
2041
|
width: t.width - 36,
|
|
2024
2042
|
x: 18,
|
|
2025
|
-
y:
|
|
2043
|
+
y: Hn
|
|
2026
2044
|
}, n.id);
|
|
2027
2045
|
if (!r) throw Error(`Tutorial page missing: ${n.id}`);
|
|
2028
|
-
e.element.updateProps(r.id, { columns:
|
|
2046
|
+
e.element.updateProps(r.id, { columns: Gn.map((e, n) => ({
|
|
2029
2047
|
align: e.align,
|
|
2030
2048
|
bind: e.bind,
|
|
2031
2049
|
title: X(t, e.key),
|
|
2032
2050
|
width: n === 0 ? 2 : 1
|
|
2033
2051
|
})) });
|
|
2034
2052
|
}
|
|
2035
|
-
function
|
|
2053
|
+
function qn(e, t) {
|
|
2036
2054
|
let n = e.document.data.pages[0], r = Z(e, n.id, S("designer.tutorial.documentTotal", { amount: "{{ bill.total | currency }}" }), 18, 77, t.width - 36, { props: {
|
|
2037
2055
|
fontWeight: "700",
|
|
2038
2056
|
textAlign: "right"
|
|
@@ -2040,9 +2058,9 @@ function Gn(e, t) {
|
|
|
2040
2058
|
if (!e.followBlock.create(n.id, [r.id, i.id], {
|
|
2041
2059
|
id: "tutorial-details",
|
|
2042
2060
|
kind: "element"
|
|
2043
|
-
},
|
|
2061
|
+
}, Wn, S("designer.tutorial.documentSummary"))) throw Error("Tutorial follow block could not be created");
|
|
2044
2062
|
}
|
|
2045
|
-
function
|
|
2063
|
+
function Jn(e, t) {
|
|
2046
2064
|
let n = e.page.add(t.width, t.height, X(t, "attachmentTitle"), { templateId: "tutorial-template" });
|
|
2047
2065
|
Z(e, n.id, X(t, "attachmentTitle"), 18, 35, t.width - 36, {
|
|
2048
2066
|
height: 12,
|
|
@@ -2058,60 +2076,60 @@ function Kn(e, t) {
|
|
|
2058
2076
|
props: { lineHeight: 1.8 }
|
|
2059
2077
|
}), Z(e, n.id, X(t, "signature"), 18, 105, t.width - 36);
|
|
2060
2078
|
}
|
|
2061
|
-
function
|
|
2079
|
+
function Yn(e) {
|
|
2062
2080
|
e.view.updateSettings({ previewWithData: !0 });
|
|
2063
2081
|
}
|
|
2064
|
-
var
|
|
2082
|
+
var Xn = [
|
|
2065
2083
|
{
|
|
2066
2084
|
id: "welcome",
|
|
2067
2085
|
target: "menu"
|
|
2068
2086
|
},
|
|
2069
2087
|
{
|
|
2070
|
-
apply:
|
|
2088
|
+
apply: Rn,
|
|
2071
2089
|
id: "page",
|
|
2072
2090
|
target: "canvas"
|
|
2073
2091
|
},
|
|
2074
2092
|
{
|
|
2075
|
-
apply:
|
|
2093
|
+
apply: zn,
|
|
2076
2094
|
id: "template",
|
|
2077
2095
|
target: "canvas"
|
|
2078
2096
|
},
|
|
2079
2097
|
{
|
|
2080
|
-
apply:
|
|
2098
|
+
apply: Bn,
|
|
2081
2099
|
id: "data",
|
|
2082
2100
|
target: "canvas"
|
|
2083
2101
|
},
|
|
2084
2102
|
{
|
|
2085
|
-
apply:
|
|
2103
|
+
apply: Kn,
|
|
2086
2104
|
id: "table",
|
|
2087
2105
|
target: "canvas"
|
|
2088
2106
|
},
|
|
2089
2107
|
{
|
|
2090
|
-
apply:
|
|
2108
|
+
apply: qn,
|
|
2091
2109
|
id: "follow",
|
|
2092
2110
|
target: "canvas"
|
|
2093
2111
|
},
|
|
2094
2112
|
{
|
|
2095
|
-
apply:
|
|
2113
|
+
apply: Jn,
|
|
2096
2114
|
id: "pages",
|
|
2097
2115
|
target: "canvas"
|
|
2098
2116
|
},
|
|
2099
2117
|
{
|
|
2100
|
-
apply:
|
|
2118
|
+
apply: Yn,
|
|
2101
2119
|
id: "preview",
|
|
2102
2120
|
target: "canvas"
|
|
2103
2121
|
}
|
|
2104
2122
|
];
|
|
2105
2123
|
// src/designer/stores/canvas-store.ts
|
|
2106
|
-
function
|
|
2124
|
+
function Zn(e) {
|
|
2107
2125
|
let n = e.elements ?? M;
|
|
2108
|
-
return
|
|
2109
|
-
let r =
|
|
2126
|
+
return H("editor-canvas", () => {
|
|
2127
|
+
let r = U(() => e.scope.pages.map((e) => ({
|
|
2110
2128
|
...e,
|
|
2111
2129
|
elements: o(e, e.elements)
|
|
2112
|
-
}))), i =
|
|
2130
|
+
}))), i = U(() => function(e) {
|
|
2113
2131
|
return r.value.find((t) => t.id === e);
|
|
2114
|
-
}), a =
|
|
2132
|
+
}), a = U(() => o);
|
|
2115
2133
|
function o(r, i, a = {}) {
|
|
2116
2134
|
let o = e.document.data, c = a.withData ?? e.view.settings.previewWithData, l = e.template.editingId ? void 0 : {
|
|
2117
2135
|
documentName: o.name,
|
|
@@ -2123,18 +2141,18 @@ function Yn(e) {
|
|
|
2123
2141
|
d.elements = n;
|
|
2124
2142
|
let f = e.repeatGroup.getByPage(r.id), p = /* @__PURE__ */ new Map();
|
|
2125
2143
|
return i.map((e) => {
|
|
2126
|
-
let r =
|
|
2144
|
+
let r = P(o, e, n);
|
|
2127
2145
|
a.resetSize && (r = {
|
|
2128
2146
|
...r,
|
|
2129
2147
|
height: 0
|
|
2130
2148
|
});
|
|
2131
|
-
let i =
|
|
2149
|
+
let i = Qn(r, n);
|
|
2132
2150
|
if (i) return i;
|
|
2133
2151
|
if (!c) {
|
|
2134
2152
|
let e = new Set(n.get(r.type)?.previewExpressionKeys);
|
|
2135
2153
|
return l ? t(r, l, u, e) : r;
|
|
2136
2154
|
}
|
|
2137
|
-
let s =
|
|
2155
|
+
let s = $n(r, d, f, p);
|
|
2138
2156
|
return b(r, s, u, "preview");
|
|
2139
2157
|
});
|
|
2140
2158
|
}
|
|
@@ -2144,7 +2162,7 @@ function Yn(e) {
|
|
|
2144
2162
|
};
|
|
2145
2163
|
})();
|
|
2146
2164
|
}
|
|
2147
|
-
function
|
|
2165
|
+
function Qn(e, t) {
|
|
2148
2166
|
let n = t.get(e.type);
|
|
2149
2167
|
if (!n?.resolvePreviewProps) return;
|
|
2150
2168
|
let r = {
|
|
@@ -2163,7 +2181,7 @@ function Xn(e, t) {
|
|
|
2163
2181
|
...i
|
|
2164
2182
|
};
|
|
2165
2183
|
}
|
|
2166
|
-
function
|
|
2184
|
+
function $n(e, t, r, i) {
|
|
2167
2185
|
let a = r.find((t) => t.elementIds.includes(e.id));
|
|
2168
2186
|
if (!a?.collection) return t;
|
|
2169
2187
|
let o = i.get(a.id);
|
|
@@ -2178,7 +2196,7 @@ function Zn(e, t, r, i) {
|
|
|
2178
2196
|
});
|
|
2179
2197
|
}
|
|
2180
2198
|
// src/core/layout-references.ts
|
|
2181
|
-
function
|
|
2199
|
+
function er(e, t) {
|
|
2182
2200
|
let n = new Set(t);
|
|
2183
2201
|
return JSON.parse(JSON.stringify({
|
|
2184
2202
|
elementGroups: (e.elementGroups ?? []).filter((e) => e.elementIds.every((e) => n.has(e))),
|
|
@@ -2186,7 +2204,7 @@ function Qn(e, t) {
|
|
|
2186
2204
|
repeatGroups: (e.repeatGroups ?? []).filter((e) => e.elementIds.every((e) => n.has(e)))
|
|
2187
2205
|
}));
|
|
2188
2206
|
}
|
|
2189
|
-
function
|
|
2207
|
+
function tr(e, t, n, r, i) {
|
|
2190
2208
|
function a(e, t) {
|
|
2191
2209
|
let n = e.get(t);
|
|
2192
2210
|
if (!n) throw Error(`Missing copied layout reference: ${t}`);
|
|
@@ -2216,9 +2234,9 @@ function $n(e, t, n, r, i) {
|
|
|
2216
2234
|
d = !1;
|
|
2217
2235
|
for (let e of l) u.has(e.id) && e.target.kind === "followBlock" && !u.has(e.target.id) && (u.delete(e.id), d = !0);
|
|
2218
2236
|
}
|
|
2219
|
-
|
|
2237
|
+
nr(e, t.elementGroups ?? [], n, r, i), c.length > 0 && (e.repeatGroups = [...e.repeatGroups ?? [], ...c]), u.size > 0 && (e.followBlocks = [...e.followBlocks ?? [], ...l.filter((e) => u.has(e.id))]);
|
|
2220
2238
|
}
|
|
2221
|
-
function
|
|
2239
|
+
function nr(e, t, n, r, i) {
|
|
2222
2240
|
if (t.length === 0) return;
|
|
2223
2241
|
let a = new Map(t.map((e) => [e.id, i("layer-group")])), o = [];
|
|
2224
2242
|
for (let e of t) {
|
|
@@ -2232,18 +2250,18 @@ function er(e, t, n, r, i) {
|
|
|
2232
2250
|
let s = e.parentId ? a.get(e.parentId) : void 0;
|
|
2233
2251
|
s && (i.parentId = s), o.push(i);
|
|
2234
2252
|
}
|
|
2235
|
-
e.elementGroups = [...e.elementGroups ?? [], ...o],
|
|
2253
|
+
e.elementGroups = [...e.elementGroups ?? [], ...o], Ce(e);
|
|
2236
2254
|
}
|
|
2237
2255
|
// src/designer/stores/clipboard-store.ts
|
|
2238
|
-
function
|
|
2239
|
-
return
|
|
2240
|
-
let { unlockedNodes: n } = G(e.selection), r = e.ui.toast, i = e.element.removeSelected, { active: a } = G(e.scope), o = e.history.commit, s =
|
|
2256
|
+
function rr(e) {
|
|
2257
|
+
return H("editor-clipboard", ({ action: t }) => {
|
|
2258
|
+
let { unlockedNodes: n } = G(e.selection), r = e.ui.toast, i = e.element.removeSelected, { active: a } = G(e.scope), o = e.history.commit, s = W([]), c = W([]), l = W({
|
|
2241
2259
|
elementGroups: [],
|
|
2242
2260
|
followBlocks: [],
|
|
2243
2261
|
repeatGroups: []
|
|
2244
2262
|
}), u = t(() => {
|
|
2245
2263
|
let t = n.value;
|
|
2246
|
-
t.length !== 0 && (s.value = t.map((e) =>
|
|
2264
|
+
t.length !== 0 && (s.value = t.map((e) => xe(e)), c.value = E(e.document.data.templates ?? []), l.value = er(e.document.data, t.map((e) => e.id)), r(S("designer.clipboardStore.selectionCopiedMessage", { count: t.length })));
|
|
2247
2265
|
}, "copy"), d = t(() => {
|
|
2248
2266
|
u(), i();
|
|
2249
2267
|
}, "cut"), f = t(() => {
|
|
@@ -2252,27 +2270,27 @@ function tr(e) {
|
|
|
2252
2270
|
if (!t) return;
|
|
2253
2271
|
let n = [], i = /* @__PURE__ */ new Map();
|
|
2254
2272
|
for (let r of s.value) {
|
|
2255
|
-
let a =
|
|
2256
|
-
a.id =
|
|
2273
|
+
let a = xe(r);
|
|
2274
|
+
a.id = z("el"), Object.assign(a, F(a, 3, 3)), ne(e.document.data, r, a, e.elements ?? M, {
|
|
2257
2275
|
...e.document.data,
|
|
2258
2276
|
templates: c.value
|
|
2259
2277
|
}), t.elements.push(a), n.push(a.id), i.set(r.id, a.id);
|
|
2260
2278
|
}
|
|
2261
|
-
e.document.data.pages.some((e) => e.id === t.id) &&
|
|
2279
|
+
e.document.data.pages.some((e) => e.id === t.id) && tr(e.document.data, l.value, i, t.id, z), e.selection.set(n), o(), r(S("designer.clipboardStore.selectionPastedMessage", { count: n.length }), "success");
|
|
2262
2280
|
}, "paste");
|
|
2263
2281
|
return {
|
|
2264
2282
|
copy: u,
|
|
2265
2283
|
cut: d,
|
|
2266
|
-
isEmpty:
|
|
2284
|
+
isEmpty: U(() => s.value.length === 0),
|
|
2267
2285
|
nodes: s,
|
|
2268
2286
|
paste: f
|
|
2269
2287
|
};
|
|
2270
2288
|
})();
|
|
2271
2289
|
}
|
|
2272
2290
|
// src/designer/stores/config-store.ts
|
|
2273
|
-
function
|
|
2274
|
-
return
|
|
2275
|
-
let e =
|
|
2291
|
+
function ir() {
|
|
2292
|
+
return H("editor-config", () => {
|
|
2293
|
+
let e = W(c());
|
|
2276
2294
|
function t(t) {
|
|
2277
2295
|
e.value = c({ rendering: {
|
|
2278
2296
|
...e.value.rendering,
|
|
@@ -2290,9 +2308,9 @@ function nr() {
|
|
|
2290
2308
|
})();
|
|
2291
2309
|
}
|
|
2292
2310
|
// src/designer/stores/data-source-store.ts
|
|
2293
|
-
function
|
|
2294
|
-
return
|
|
2295
|
-
let { data: t } = G(e.document), n = e.history.commit, r =
|
|
2311
|
+
function ar(e) {
|
|
2312
|
+
return H("editor-dataSource", () => {
|
|
2313
|
+
let { data: t } = G(e.document), n = e.history.commit, r = U(() => t.value.dataSources ?? []);
|
|
2296
2314
|
function i(e) {
|
|
2297
2315
|
return r.value.find((t) => t.key === e);
|
|
2298
2316
|
}
|
|
@@ -2309,8 +2327,8 @@ function rr(e) {
|
|
|
2309
2327
|
r && (t.value.dataSources = r.filter((t) => t.key !== e), n());
|
|
2310
2328
|
}
|
|
2311
2329
|
return {
|
|
2312
|
-
get:
|
|
2313
|
-
has:
|
|
2330
|
+
get: U(() => i),
|
|
2331
|
+
has: U(() => function(e) {
|
|
2314
2332
|
return i(e) !== void 0;
|
|
2315
2333
|
}),
|
|
2316
2334
|
list: r,
|
|
@@ -2320,14 +2338,14 @@ function rr(e) {
|
|
|
2320
2338
|
})();
|
|
2321
2339
|
}
|
|
2322
2340
|
// src/designer/template-library/builtin/welcome.json
|
|
2323
|
-
var
|
|
2324
|
-
dataSources: () =>
|
|
2325
|
-
default: () =>
|
|
2326
|
-
name: () =>
|
|
2327
|
-
pages: () =>
|
|
2328
|
-
templates: () =>
|
|
2341
|
+
var or = /* @__PURE__ */ e({
|
|
2342
|
+
dataSources: () => sr,
|
|
2343
|
+
default: () => dr,
|
|
2344
|
+
name: () => cr,
|
|
2345
|
+
pages: () => lr,
|
|
2346
|
+
templates: () => ur,
|
|
2329
2347
|
version: () => "1.0"
|
|
2330
|
-
}),
|
|
2348
|
+
}), sr = [], cr = "欢迎模板(横向 A4)", lr = [{
|
|
2331
2349
|
background: "#f5f3ee",
|
|
2332
2350
|
elements: [
|
|
2333
2351
|
{
|
|
@@ -2958,7 +2976,7 @@ var ir = /* @__PURE__ */ e({
|
|
|
2958
2976
|
name: "横向 A4",
|
|
2959
2977
|
templateId: "template-blank",
|
|
2960
2978
|
width: 297
|
|
2961
|
-
}],
|
|
2979
|
+
}], ur = [{
|
|
2962
2980
|
builtin: !0,
|
|
2963
2981
|
id: "template-blank",
|
|
2964
2982
|
name: "空白模板",
|
|
@@ -2971,24 +2989,24 @@ var ir = /* @__PURE__ */ e({
|
|
|
2971
2989
|
name: "空白模板",
|
|
2972
2990
|
width: 297
|
|
2973
2991
|
}
|
|
2974
|
-
}],
|
|
2975
|
-
dataSources:
|
|
2976
|
-
name:
|
|
2977
|
-
pages:
|
|
2978
|
-
templates:
|
|
2992
|
+
}], dr = {
|
|
2993
|
+
dataSources: sr,
|
|
2994
|
+
name: cr,
|
|
2995
|
+
pages: lr,
|
|
2996
|
+
templates: ur,
|
|
2979
2997
|
version: "1.0"
|
|
2980
|
-
},
|
|
2998
|
+
}, fr = {
|
|
2981
2999
|
costSheet: () => import("./cost-sheet-Dwg0rt_l.js"),
|
|
2982
3000
|
invoice: () => import("./invoice-DuBN6ZCM.js"),
|
|
2983
3001
|
purchaseOrder: () => import("./purchase-order-DNBFPpEZ.js"),
|
|
2984
|
-
welcome: () => Promise.resolve().then(() =>
|
|
3002
|
+
welcome: () => Promise.resolve().then(() => or)
|
|
2985
3003
|
};
|
|
2986
|
-
function
|
|
2987
|
-
return structuredClone(
|
|
3004
|
+
function pr() {
|
|
3005
|
+
return structuredClone(dr);
|
|
2988
3006
|
}
|
|
2989
|
-
async function
|
|
3007
|
+
async function mr(e) {
|
|
2990
3008
|
try {
|
|
2991
|
-
let t = await
|
|
3009
|
+
let t = await fr[e]();
|
|
2992
3010
|
return structuredClone(t.default);
|
|
2993
3011
|
} catch (t) {
|
|
2994
3012
|
throw new x(S("designer.templateLibrary.builtinFailed", { id: `builtin.${e}` }), {
|
|
@@ -2997,7 +3015,7 @@ async function fr(e) {
|
|
|
2997
3015
|
});
|
|
2998
3016
|
}
|
|
2999
3017
|
}
|
|
3000
|
-
function
|
|
3018
|
+
function hr() {
|
|
3001
3019
|
return {
|
|
3002
3020
|
id: "builtin",
|
|
3003
3021
|
list() {
|
|
@@ -3006,28 +3024,28 @@ function pr() {
|
|
|
3006
3024
|
category: S("designer.templateLibrary.categoryBasic"),
|
|
3007
3025
|
description: S("designer.templateLibrary.welcomeDescription"),
|
|
3008
3026
|
id: "builtin.welcome",
|
|
3009
|
-
load: () =>
|
|
3027
|
+
load: () => mr("welcome"),
|
|
3010
3028
|
name: S("designer.templateLibrary.welcomeName")
|
|
3011
3029
|
},
|
|
3012
3030
|
{
|
|
3013
3031
|
category: S("designer.templateLibrary.categoryBusiness"),
|
|
3014
3032
|
description: S("designer.templateLibrary.purchaseOrderDescription"),
|
|
3015
3033
|
id: "builtin.purchaseOrder",
|
|
3016
|
-
load: () =>
|
|
3034
|
+
load: () => mr("purchaseOrder"),
|
|
3017
3035
|
name: S("designer.templateLibrary.purchaseOrderName")
|
|
3018
3036
|
},
|
|
3019
3037
|
{
|
|
3020
3038
|
category: S("designer.templateLibrary.categoryBusiness"),
|
|
3021
3039
|
description: S("designer.templateLibrary.costSheetDescription"),
|
|
3022
3040
|
id: "builtin.costSheet",
|
|
3023
|
-
load: () =>
|
|
3041
|
+
load: () => mr("costSheet"),
|
|
3024
3042
|
name: S("designer.templateLibrary.costSheetName")
|
|
3025
3043
|
},
|
|
3026
3044
|
{
|
|
3027
3045
|
category: S("designer.templateLibrary.categoryBusiness"),
|
|
3028
3046
|
description: S("designer.templateLibrary.invoiceDescription"),
|
|
3029
3047
|
id: "builtin.invoice",
|
|
3030
|
-
load: () =>
|
|
3048
|
+
load: () => mr("invoice"),
|
|
3031
3049
|
name: S("designer.templateLibrary.invoiceName")
|
|
3032
3050
|
}
|
|
3033
3051
|
];
|
|
@@ -3036,8 +3054,8 @@ function pr() {
|
|
|
3036
3054
|
};
|
|
3037
3055
|
}
|
|
3038
3056
|
// src/designer/stores/document-store.ts
|
|
3039
|
-
var
|
|
3040
|
-
function
|
|
3057
|
+
var gr = "print-studio:document";
|
|
3058
|
+
function _r(e) {
|
|
3041
3059
|
if (e.initialDocument) {
|
|
3042
3060
|
let t = B(E(e.initialDocument), e.elements);
|
|
3043
3061
|
if (e.strictInitialDocument && t.skippedTypes.length > 0) throw new x(S("designer.documentStore.skippedElementTypesMessage", { elementTypes: t.skippedTypes.join(", ") }), { code: "document.unsupported-elements" });
|
|
@@ -3045,7 +3063,7 @@ function hr(e) {
|
|
|
3045
3063
|
}
|
|
3046
3064
|
try {
|
|
3047
3065
|
let t = null;
|
|
3048
|
-
if (e.storage ? t = e.storage.get() : e.storage !== !1 && (t = localStorage.getItem(
|
|
3066
|
+
if (e.storage ? t = e.storage.get() : e.storage !== !1 && (t = localStorage.getItem(gr)), t) {
|
|
3049
3067
|
let { document: n, skippedTypes: r } = B(JSON.parse(t), e.elements);
|
|
3050
3068
|
return r.length > 0 && console.warn(S("designer.documentStore.skippedElementTypesDetail", { elementTypes: r.join(", ") })), n;
|
|
3051
3069
|
}
|
|
@@ -3055,14 +3073,14 @@ function hr(e) {
|
|
|
3055
3073
|
code: "document.restore-failed",
|
|
3056
3074
|
detail: S("designer.documentStore.autoSaveRestoreFailedDetail")
|
|
3057
3075
|
});
|
|
3058
|
-
(e.errors ??
|
|
3076
|
+
(e.errors ?? sn()).capture(n, { source: "store.init" });
|
|
3059
3077
|
}
|
|
3060
|
-
let t = e.createDocument?.() ?? B(
|
|
3061
|
-
return
|
|
3078
|
+
let t = e.createDocument?.() ?? B(pr(), e.elements).document;
|
|
3079
|
+
return oe(t), t;
|
|
3062
3080
|
}
|
|
3063
|
-
function
|
|
3064
|
-
return
|
|
3065
|
-
let t = e.ui.toast, n =
|
|
3081
|
+
function vr(e) {
|
|
3082
|
+
return H("editor-document", () => {
|
|
3083
|
+
let t = e.ui.toast, n = W(_r(e)), r = W(JSON.stringify(n.value)), i = W(!1), a = W([]), o = W(null), s = U(() => JSON.stringify(a.value[0] ?? n.value) !== r.value), c, l = 0, u, d = 0;
|
|
3066
3084
|
function f() {
|
|
3067
3085
|
d += 1, clearTimeout(u);
|
|
3068
3086
|
let e = !1;
|
|
@@ -3077,19 +3095,19 @@ function gr(e) {
|
|
|
3077
3095
|
], () => {
|
|
3078
3096
|
clearTimeout(u), o.value || a.value.length > 0 || e.storage === !1 || d > 0 || (u = setTimeout(() => {
|
|
3079
3097
|
if (!(d > 0)) try {
|
|
3080
|
-
e.storage ? e.storage.set(JSON.stringify(n.value)) : localStorage.setItem(
|
|
3098
|
+
e.storage ? e.storage.set(JSON.stringify(n.value)) : localStorage.setItem(gr, JSON.stringify(n.value));
|
|
3081
3099
|
} catch (t) {
|
|
3082
3100
|
let n = new x(S("designer.documentStore.autoSaveFailed"), {
|
|
3083
3101
|
cause: t,
|
|
3084
3102
|
code: "document.autosave-failed"
|
|
3085
3103
|
});
|
|
3086
|
-
(e.errors ??
|
|
3104
|
+
(e.errors ?? sn()).capture(n, { source: "store.autosave" });
|
|
3087
3105
|
}
|
|
3088
3106
|
}, 600));
|
|
3089
3107
|
}, { deep: !0 });
|
|
3090
3108
|
function p() {
|
|
3091
3109
|
let r = e.createDocument?.() ?? le();
|
|
3092
|
-
|
|
3110
|
+
oe(r), l += 1, n.value = r, n.value.pages[0].elements = [], n.value.pages[0].name = S("designer.documentStore.initialPageName"), e.resetSession(), e.commitHistory(), t(S("designer.documentStore.documentCreatedMessage"));
|
|
3093
3111
|
}
|
|
3094
3112
|
function m(i) {
|
|
3095
3113
|
let a;
|
|
@@ -3130,7 +3148,7 @@ function gr(e) {
|
|
|
3130
3148
|
}
|
|
3131
3149
|
function w(t) {
|
|
3132
3150
|
if (o.value || i.value) throw Error("Document session is busy");
|
|
3133
|
-
|
|
3151
|
+
oe(t), clearTimeout(u), o.value = {
|
|
3134
3152
|
document: _(),
|
|
3135
3153
|
savedSnapshot: r.value
|
|
3136
3154
|
}, l += 1, n.value = E(t), e.resetSession(), e.resetHistory();
|
|
@@ -3151,7 +3169,7 @@ function gr(e) {
|
|
|
3151
3169
|
i.value = !1, c = void 0;
|
|
3152
3170
|
}), c;
|
|
3153
3171
|
}
|
|
3154
|
-
return
|
|
3172
|
+
return Be(() => clearTimeout(u)), {
|
|
3155
3173
|
beginPreview: y,
|
|
3156
3174
|
beginTemporary: w,
|
|
3157
3175
|
create: p,
|
|
@@ -3173,14 +3191,14 @@ function gr(e) {
|
|
|
3173
3191
|
})();
|
|
3174
3192
|
}
|
|
3175
3193
|
// src/designer/stores/element-group-store.ts
|
|
3176
|
-
function
|
|
3177
|
-
return
|
|
3178
|
-
let { data: n } = G(e.document), { active: r } = G(e.scope), { ids: i } = G(e.selection), a = e.history.commit, o =
|
|
3194
|
+
function yr(e) {
|
|
3195
|
+
return H("editor-elementGroup", ({ action: t }) => {
|
|
3196
|
+
let { data: n } = G(e.document), { active: r } = G(e.scope), { ids: i } = G(e.selection), a = e.history.commit, o = W([]), s = U(() => n.value.elementGroups ?? []);
|
|
3179
3197
|
function c(e) {
|
|
3180
3198
|
return s.value.find((t) => t.id === e);
|
|
3181
3199
|
}
|
|
3182
3200
|
function l(e) {
|
|
3183
|
-
return
|
|
3201
|
+
return R(n.value, e.pageId);
|
|
3184
3202
|
}
|
|
3185
3203
|
function u(e) {
|
|
3186
3204
|
return s.value.filter((t) => t.pageId === e);
|
|
@@ -3192,14 +3210,14 @@ function _r(e) {
|
|
|
3192
3210
|
return n.elements.filter((e) => r.has(e.id));
|
|
3193
3211
|
}
|
|
3194
3212
|
function f(e) {
|
|
3195
|
-
let t =
|
|
3196
|
-
return t ?
|
|
3213
|
+
let t = R(n.value, e);
|
|
3214
|
+
return t ? ce(t, s.value) : [];
|
|
3197
3215
|
}
|
|
3198
3216
|
function p(e) {
|
|
3199
3217
|
return o.value.includes(e);
|
|
3200
3218
|
}
|
|
3201
3219
|
function m(e) {
|
|
3202
|
-
return
|
|
3220
|
+
return Ee(f(e), p);
|
|
3203
3221
|
}
|
|
3204
3222
|
function h(e) {
|
|
3205
3223
|
let t = s.value.filter((t) => t.elementIds.includes(e)), n;
|
|
@@ -3210,19 +3228,19 @@ function _r(e) {
|
|
|
3210
3228
|
let n = d(e);
|
|
3211
3229
|
return n.length > 0 && n.every((e) => e[t]);
|
|
3212
3230
|
}
|
|
3213
|
-
let _ =
|
|
3231
|
+
let _ = U(() => i.value.length === 0 ? null : ke(f(r.value.id), i.value) ?? null), v = t((t, o) => {
|
|
3214
3232
|
let l = r.value, u = (t ?? i.value).filter((e) => l.elements.some((t) => t.id === e));
|
|
3215
3233
|
if (u.length === 0) return null;
|
|
3216
|
-
let d =
|
|
3217
|
-
if (!
|
|
3218
|
-
|
|
3234
|
+
let d = ve(n.value, l.id, z, o), f = ce(l, s.value);
|
|
3235
|
+
if (!ue(f, u, d)) return null;
|
|
3236
|
+
Se(n.value, l, f);
|
|
3219
3237
|
let p = c(d.id);
|
|
3220
3238
|
return p ? (e.selection.set([...p.elementIds]), a(), p) : null;
|
|
3221
3239
|
}, "create"), y = t((t) => {
|
|
3222
3240
|
let r = c(t), i = r ? l(r) : void 0;
|
|
3223
3241
|
if (!r || !i) return;
|
|
3224
|
-
let u = [...r.elementIds], d =
|
|
3225
|
-
he(d, t) && (
|
|
3242
|
+
let u = [...r.elementIds], d = ce(i, s.value);
|
|
3243
|
+
he(d, t) && (Se(n.value, i, d), o.value = o.value.filter((e) => e !== t), e.selection.set(u), a());
|
|
3226
3244
|
}, "ungroup"), b = t((t, n = !1) => {
|
|
3227
3245
|
let r = c(t);
|
|
3228
3246
|
r && (n ? e.element.removeIds([...r.elementIds]) : y(t));
|
|
@@ -3247,15 +3265,15 @@ function _r(e) {
|
|
|
3247
3265
|
}, "selectMembers");
|
|
3248
3266
|
return {
|
|
3249
3267
|
create: v,
|
|
3250
|
-
find:
|
|
3251
|
-
findByElement:
|
|
3252
|
-
getByPage:
|
|
3253
|
-
getMembers:
|
|
3254
|
-
getRows:
|
|
3255
|
-
getTree:
|
|
3256
|
-
isCollapsed:
|
|
3257
|
-
isLocked:
|
|
3258
|
-
isVisible:
|
|
3268
|
+
find: U(() => c),
|
|
3269
|
+
findByElement: U(() => h),
|
|
3270
|
+
getByPage: U(() => u),
|
|
3271
|
+
getMembers: U(() => d),
|
|
3272
|
+
getRows: U(() => m),
|
|
3273
|
+
getTree: U(() => f),
|
|
3274
|
+
isCollapsed: U(() => p),
|
|
3275
|
+
isLocked: U(() => (e) => g(e, "locked")),
|
|
3276
|
+
isVisible: U(() => (e) => g(e, "visible")),
|
|
3259
3277
|
list: s,
|
|
3260
3278
|
remove: b,
|
|
3261
3279
|
rename: x,
|
|
@@ -3270,21 +3288,21 @@ function _r(e) {
|
|
|
3270
3288
|
})();
|
|
3271
3289
|
}
|
|
3272
3290
|
// src/core/align.ts
|
|
3273
|
-
var
|
|
3291
|
+
var br = {
|
|
3274
3292
|
bottom: "y",
|
|
3275
3293
|
hcenter: "x",
|
|
3276
3294
|
left: "x",
|
|
3277
3295
|
right: "x",
|
|
3278
3296
|
top: "y",
|
|
3279
3297
|
vcenter: "y"
|
|
3280
|
-
},
|
|
3281
|
-
function
|
|
3282
|
-
return
|
|
3298
|
+
}, xr = 1e-6;
|
|
3299
|
+
function Sr(e) {
|
|
3300
|
+
return br[e];
|
|
3283
3301
|
}
|
|
3284
|
-
function
|
|
3302
|
+
function Cr(e) {
|
|
3285
3303
|
return e === "h" ? "x" : "y";
|
|
3286
3304
|
}
|
|
3287
|
-
function
|
|
3305
|
+
function wr(e, t) {
|
|
3288
3306
|
return t === "x" ? {
|
|
3289
3307
|
end: e.x + e.width,
|
|
3290
3308
|
start: e.x
|
|
@@ -3293,55 +3311,55 @@ function Sr(e, t) {
|
|
|
3293
3311
|
start: e.y
|
|
3294
3312
|
};
|
|
3295
3313
|
}
|
|
3296
|
-
function
|
|
3297
|
-
let { end: n, start: r } =
|
|
3314
|
+
function Tr(e, t) {
|
|
3315
|
+
let { end: n, start: r } = wr(e, br[t]);
|
|
3298
3316
|
return t === "left" || t === "top" ? r : t === "right" || t === "bottom" ? n : (r + n) / 2;
|
|
3299
3317
|
}
|
|
3300
|
-
function
|
|
3318
|
+
function Er(e) {
|
|
3301
3319
|
let t = /* @__PURE__ */ new Map();
|
|
3302
|
-
for (let [n, r] of e) Math.abs(r) >
|
|
3320
|
+
for (let [n, r] of e) Math.abs(r) > xr && t.set(n, r);
|
|
3303
3321
|
return t;
|
|
3304
3322
|
}
|
|
3305
|
-
function
|
|
3323
|
+
function Dr(e, t) {
|
|
3306
3324
|
let { keyId: n, pageBounds: r, target: i = "selection" } = t;
|
|
3307
3325
|
if (r && (i === "page" || i === "selection" && e.length === 1)) return r;
|
|
3308
3326
|
if (i === "key") {
|
|
3309
3327
|
let t = e.find((e) => e.id === n);
|
|
3310
3328
|
if (t) return t.box;
|
|
3311
3329
|
}
|
|
3312
|
-
return
|
|
3330
|
+
return D(e.map((e) => e.box));
|
|
3313
3331
|
}
|
|
3314
|
-
function
|
|
3332
|
+
function Or(e, t, n = {}) {
|
|
3315
3333
|
if (e.length === 0) return /* @__PURE__ */ new Map();
|
|
3316
|
-
let r =
|
|
3334
|
+
let r = Dr(e, n);
|
|
3317
3335
|
if (!r) return /* @__PURE__ */ new Map();
|
|
3318
|
-
let i =
|
|
3319
|
-
return
|
|
3336
|
+
let i = Tr(r, t);
|
|
3337
|
+
return Er(e.map((e) => [e.id, i - Tr(e.box, t)]));
|
|
3320
3338
|
}
|
|
3321
|
-
function
|
|
3339
|
+
function kr(e, t, n = {}) {
|
|
3322
3340
|
if (e.length < 3) return null;
|
|
3323
|
-
let r =
|
|
3341
|
+
let r = br[t], i = e.map((e) => ({
|
|
3324
3342
|
item: e,
|
|
3325
|
-
point:
|
|
3343
|
+
point: Tr(e.box, t)
|
|
3326
3344
|
})).sort((e, t) => e.point - t.point), a = i[0], o = i[i.length - 1], s = a.point, c = o.point;
|
|
3327
3345
|
if (n.target === "page" && n.pageBounds) {
|
|
3328
|
-
let e =
|
|
3346
|
+
let e = wr(n.pageBounds, r), t = wr(a.item.box, r), i = wr(o.item.box, r);
|
|
3329
3347
|
s = e.start + (a.point - t.start), c = e.end - (i.end - o.point);
|
|
3330
3348
|
}
|
|
3331
3349
|
let l = (c - s) / (i.length - 1);
|
|
3332
|
-
return
|
|
3350
|
+
return Er(i.map(({ item: e, point: t }, n) => [e.id, s + l * n - t]));
|
|
3333
3351
|
}
|
|
3334
|
-
function
|
|
3335
|
-
let r =
|
|
3352
|
+
function Ar(e, t, n = {}) {
|
|
3353
|
+
let r = Cr(t), i = typeof n.spacing == "number" && Number.isFinite(n.spacing) ? n.spacing : null;
|
|
3336
3354
|
if (e.length < (i === null ? 3 : 2)) return null;
|
|
3337
3355
|
let a = e.map((e) => ({
|
|
3338
3356
|
item: e,
|
|
3339
|
-
...
|
|
3357
|
+
...wr(e.box, r)
|
|
3340
3358
|
})).sort((e, t) => e.start - t.start || e.end - t.end), o = a.map((e) => e.end - e.start), s = [];
|
|
3341
3359
|
if (i === null) {
|
|
3342
3360
|
let e = a[0], t = a[a.length - 1], i = e.start, c = t.end;
|
|
3343
3361
|
if (n.target === "page" && n.pageBounds) {
|
|
3344
|
-
let e =
|
|
3362
|
+
let e = wr(n.pageBounds, r);
|
|
3345
3363
|
i = e.start, c = e.end;
|
|
3346
3364
|
}
|
|
3347
3365
|
let l = o.reduce((e, t) => e + t, 0), u = (c - i - l) / (a.length - 1), d = i;
|
|
@@ -3352,28 +3370,28 @@ function Or(e, t, n = {}) {
|
|
|
3352
3370
|
for (let e = t + 1; e < a.length; e++) s[e] = s[e - 1] + o[e - 1] + i;
|
|
3353
3371
|
for (let e = t - 1; e >= 0; e--) s[e] = s[e + 1] - i - o[e];
|
|
3354
3372
|
}
|
|
3355
|
-
return
|
|
3373
|
+
return Er(a.map((e, t) => [e.item.id, s[t] - e.start]));
|
|
3356
3374
|
}
|
|
3357
3375
|
// src/designer/stores/element-store.ts
|
|
3358
|
-
function
|
|
3376
|
+
function jr(e) {
|
|
3359
3377
|
let t = e.elements ?? M;
|
|
3360
|
-
return
|
|
3378
|
+
return H("editor-element", ({ action: n }) => {
|
|
3361
3379
|
let { data: r } = G(e.document), { active: i } = G(e.scope), a = e.history.commit, { ids: o, nodes: s } = G(e.selection), c = e.ui.toast;
|
|
3362
3380
|
function l(e) {
|
|
3363
|
-
return
|
|
3381
|
+
return R(r.value, e);
|
|
3364
3382
|
}
|
|
3365
|
-
let u =
|
|
3383
|
+
let u = W(null), d = W("");
|
|
3366
3384
|
function f(e, n) {
|
|
3367
|
-
Object.assign(e,
|
|
3385
|
+
Object.assign(e, Ne(e, { width: e.width }, t, { enforceMinimum: !1 })), u.value = e, d.value = n;
|
|
3368
3386
|
}
|
|
3369
3387
|
function p(e) {
|
|
3370
|
-
u.value && Object.assign(u.value,
|
|
3388
|
+
u.value && Object.assign(u.value, Ne(u.value, e, t, { enforceMinimum: !1 }));
|
|
3371
3389
|
}
|
|
3372
3390
|
let m = n(() => {
|
|
3373
3391
|
u.value = null, d.value = "";
|
|
3374
3392
|
}, "cancelDraft");
|
|
3375
3393
|
function h(e) {
|
|
3376
|
-
return
|
|
3394
|
+
return ye(r.value, e);
|
|
3377
3395
|
}
|
|
3378
3396
|
function g(e) {
|
|
3379
3397
|
return h(e)?.node;
|
|
@@ -3388,17 +3406,17 @@ function kr(e) {
|
|
|
3388
3406
|
let s = o ? l(o) : i.value;
|
|
3389
3407
|
if (!s) return null;
|
|
3390
3408
|
let c = se(e, n, t);
|
|
3391
|
-
return s.elements.push(c),
|
|
3409
|
+
return s.elements.push(c), _e(r.value, c, t), a(), c;
|
|
3392
3410
|
}, "add"), b = n((n) => {
|
|
3393
3411
|
let i = u.value;
|
|
3394
3412
|
if (!i || !d.value) return u.value = null, d.value = "", null;
|
|
3395
3413
|
let o = l(d.value);
|
|
3396
3414
|
if (u.value = null, d.value = "", !o) return null;
|
|
3397
3415
|
if (!t.get(i.type)?.pointBased) {
|
|
3398
|
-
let e = k(i, t), r =
|
|
3399
|
-
n && r > i.width && i.x <
|
|
3416
|
+
let e = k(i, t), r = L(Math.max(i.width, e.width)), a = L(Math.max(i.height, e.height));
|
|
3417
|
+
n && r > i.width && i.x < L(n.x) && (i.x = L(n.x - r)), n && a > i.height && i.y < L(n.y) && (i.y = L(n.y - a)), i.width = r, i.height = a;
|
|
3400
3418
|
}
|
|
3401
|
-
return o.elements.push(i),
|
|
3419
|
+
return o.elements.push(i), _e(r.value, i, t), e.selection.set([i.id]), a(), i;
|
|
3402
3420
|
}, "commitDraft");
|
|
3403
3421
|
function x(e, n) {
|
|
3404
3422
|
let i = h(e);
|
|
@@ -3407,7 +3425,7 @@ function kr(e) {
|
|
|
3407
3425
|
let a = {
|
|
3408
3426
|
...i.node,
|
|
3409
3427
|
...n
|
|
3410
|
-
}, o =
|
|
3428
|
+
}, o = P(r.value, a, t);
|
|
3411
3429
|
return o !== a && (n = {
|
|
3412
3430
|
...n,
|
|
3413
3431
|
bindings: o.bindings,
|
|
@@ -3415,7 +3433,7 @@ function kr(e) {
|
|
|
3415
3433
|
}), j(r.value, {
|
|
3416
3434
|
...i.node,
|
|
3417
3435
|
...n
|
|
3418
|
-
}, t), Object.assign(i.node,
|
|
3436
|
+
}, t), Object.assign(i.node, Ne(i.node, n, t)), ("props" in n || "type" in n || "bindings" in n) && (_e(r.value, i.node, t), O(r.value, t)), "props" in n && ge(i.node, t.get(i.node.type)), !0;
|
|
3419
3437
|
}
|
|
3420
3438
|
function C(e) {
|
|
3421
3439
|
return e.y !== void 0 && !w(e);
|
|
@@ -3426,7 +3444,7 @@ function kr(e) {
|
|
|
3426
3444
|
let T = n((n, i = {}, o = []) => {
|
|
3427
3445
|
for (let { id: e, patch: i } of n) {
|
|
3428
3446
|
let n = g(e);
|
|
3429
|
-
n && (A(r.value, n, i), j(r.value,
|
|
3447
|
+
n && (A(r.value, n, i), j(r.value, P(r.value, {
|
|
3430
3448
|
...n,
|
|
3431
3449
|
...i
|
|
3432
3450
|
}, t), t));
|
|
@@ -3441,68 +3459,68 @@ function kr(e) {
|
|
|
3441
3459
|
return i.transient || a(), l;
|
|
3442
3460
|
}, "updateMany"), E = n((t, n, r = {}) => {
|
|
3443
3461
|
x(t, n) && (e.layout.apply(C(n) ? [t] : [], w(n) ? [t] : []), r.transient || a());
|
|
3444
|
-
}, "update"),
|
|
3462
|
+
}, "update"), D = n((n, i, o = {}) => {
|
|
3445
3463
|
let s = h(n);
|
|
3446
3464
|
if (!s || s.node.locked) return;
|
|
3447
|
-
let c =
|
|
3465
|
+
let c = P(r.value, {
|
|
3448
3466
|
...s.node,
|
|
3449
3467
|
props: {
|
|
3450
3468
|
...s.node.props,
|
|
3451
3469
|
...i
|
|
3452
3470
|
}
|
|
3453
3471
|
}, t);
|
|
3454
|
-
j(r.value, c, t), s.node.props = c.props,
|
|
3455
|
-
}, "updateProps"),
|
|
3472
|
+
j(r.value, c, t), s.node.props = c.props, _e(r.value, s.node, t), O(r.value, t), ge(s.node, t.get(s.node.type)), e.layout.apply(), o.transient || a();
|
|
3473
|
+
}, "updateProps"), M = n((t, n = {}) => {
|
|
3456
3474
|
if (t.length === 0) return;
|
|
3457
3475
|
for (let e of t) {
|
|
3458
3476
|
let t = g(e);
|
|
3459
3477
|
t && A(r.value, t);
|
|
3460
3478
|
}
|
|
3461
3479
|
let i = new Set(t);
|
|
3462
|
-
for (let e of
|
|
3463
|
-
O(r.value),
|
|
3480
|
+
for (let e of ae(r.value)) e.elements = e.elements.filter((e) => !i.has(e.id));
|
|
3481
|
+
O(r.value), Ce(r.value), r.value.repeatGroups?.length && (r.value.repeatGroups = r.value.repeatGroups.map((e) => ({
|
|
3464
3482
|
...e,
|
|
3465
3483
|
elementIds: e.elementIds.filter((e) => !i.has(e))
|
|
3466
3484
|
})).filter((e) => e.elementIds.length > 0)), e.selection.set(o.value.filter((e) => !i.has(e))), N(r.value), e.selection.setEditingId(null), n.transient || a();
|
|
3467
|
-
}, "removeIds"),
|
|
3468
|
-
|
|
3485
|
+
}, "removeIds"), ee = n(() => {
|
|
3486
|
+
M(o.value.filter((e) => {
|
|
3469
3487
|
let t = h(e);
|
|
3470
3488
|
return t ? !t.node.locked : !1;
|
|
3471
3489
|
}));
|
|
3472
|
-
}, "removeSelected"),
|
|
3473
|
-
let s =
|
|
3490
|
+
}, "removeSelected"), te = n((n, i = 3, o = {}) => {
|
|
3491
|
+
let s = er(r.value, n), c = [], l = /* @__PURE__ */ new Map();
|
|
3474
3492
|
for (let e of n) {
|
|
3475
3493
|
let n = h(e);
|
|
3476
3494
|
if (!n) continue;
|
|
3477
|
-
let a =
|
|
3478
|
-
a.id =
|
|
3495
|
+
let a = xe(n.node);
|
|
3496
|
+
a.id = z("el"), a.name = S("designer.elementStore.duplicateName", { elementName: n.node.name }), Object.assign(a, F(a, i, i)), ne(r.value, n.node, a, t), n.page.elements.push(a);
|
|
3479
3497
|
let o = l.get(n.page.id) ?? /* @__PURE__ */ new Map();
|
|
3480
3498
|
o.set(e, a.id), l.set(n.page.id, o), c.push(a.id);
|
|
3481
3499
|
}
|
|
3482
3500
|
if (c.length > 0) {
|
|
3483
|
-
for (let [e, t] of l)
|
|
3501
|
+
for (let [e, t] of l) tr(r.value, {
|
|
3484
3502
|
elementGroups: s.elementGroups.filter((t) => t.pageId === e),
|
|
3485
3503
|
followBlocks: s.followBlocks.filter((t) => t.pageId === e),
|
|
3486
3504
|
repeatGroups: s.repeatGroups.filter((t) => t.pageId === e)
|
|
3487
|
-
}, t, e,
|
|
3505
|
+
}, t, e, z);
|
|
3488
3506
|
e.selection.set(c), o.transient || a();
|
|
3489
3507
|
}
|
|
3490
|
-
}, "duplicate"),
|
|
3508
|
+
}, "duplicate"), re = n((t, n) => {
|
|
3491
3509
|
let r = e.selection.unlockedNodes;
|
|
3492
3510
|
if (r.length !== 0) {
|
|
3493
|
-
for (let e of r) Object.assign(e,
|
|
3511
|
+
for (let e of r) Object.assign(e, F(e, t, n));
|
|
3494
3512
|
e.layout.apply(n === 0 ? [] : r.map((e) => e.id)), a({ coalesce: `nudge:${r.map((e) => e.id).join(",")}` });
|
|
3495
3513
|
}
|
|
3496
3514
|
}, "nudge");
|
|
3497
|
-
function
|
|
3498
|
-
let n =
|
|
3499
|
-
return t(n) ? (
|
|
3515
|
+
function I(e, t) {
|
|
3516
|
+
let n = ce(e, r.value.elementGroups ?? []);
|
|
3517
|
+
return t(n) ? (Se(r.value, e, n), !0) : !1;
|
|
3500
3518
|
}
|
|
3501
|
-
let
|
|
3519
|
+
let oe = n((e, t, n) => {
|
|
3502
3520
|
let r = l(e);
|
|
3503
3521
|
if (!r || !r.elements.some((e) => e.id === t)) return;
|
|
3504
|
-
let i = [...r.elements].reverse(), o =
|
|
3505
|
-
c.id !== t &&
|
|
3522
|
+
let i = [...r.elements].reverse(), o = V(n, 0, i.length), s = o < i.length, c = s ? i[o] : i[i.length - 1];
|
|
3523
|
+
c.id !== t && I(r, (e) => pe(e, [{
|
|
3506
3524
|
id: t,
|
|
3507
3525
|
kind: "element"
|
|
3508
3526
|
}], {
|
|
@@ -3511,7 +3529,7 @@ function kr(e) {
|
|
|
3511
3529
|
}, s ? "above" : "below")), a();
|
|
3512
3530
|
}, "moveByDisplayIndex"), le = n((e, t, n, r) => {
|
|
3513
3531
|
let i = l(e);
|
|
3514
|
-
i &&
|
|
3532
|
+
i && I(i, (e) => pe(e, t, n, r)) && a();
|
|
3515
3533
|
}, "moveLayerNodes");
|
|
3516
3534
|
function ue(e) {
|
|
3517
3535
|
let t = /* @__PURE__ */ new Map();
|
|
@@ -3523,7 +3541,7 @@ function kr(e) {
|
|
|
3523
3541
|
}
|
|
3524
3542
|
for (let [n, r] of t) {
|
|
3525
3543
|
let t = l(n);
|
|
3526
|
-
t &&
|
|
3544
|
+
t && I(t, (t) => be(t, r, e));
|
|
3527
3545
|
}
|
|
3528
3546
|
a();
|
|
3529
3547
|
}
|
|
@@ -3531,17 +3549,17 @@ function kr(e) {
|
|
|
3531
3549
|
ue({ offset: e });
|
|
3532
3550
|
}, "reorder"), fe = n((e) => {
|
|
3533
3551
|
ue({ edge: e });
|
|
3534
|
-
}, "sendTo"),
|
|
3552
|
+
}, "sendTo"), me = n((e, t, n) => {
|
|
3535
3553
|
let i = _(e).filter((e) => e[t] !== n);
|
|
3536
3554
|
if (i.length !== 0) {
|
|
3537
3555
|
if (t === "visible") for (let e of i) A(r.value, e, { visible: n });
|
|
3538
3556
|
for (let e of i) e[t] = n;
|
|
3539
3557
|
a();
|
|
3540
3558
|
}
|
|
3541
|
-
}, "setFlag"),
|
|
3559
|
+
}, "setFlag"), he = n((e, t) => {
|
|
3542
3560
|
let n = h(e);
|
|
3543
3561
|
n && (t === "visible" && A(r.value, n.node, { visible: !n.node.visible }), n.node[t] = !n.node[t], a());
|
|
3544
|
-
}, "toggleFlag"),
|
|
3562
|
+
}, "toggleFlag"), ve = n((e, t) => {
|
|
3545
3563
|
let n = h(e);
|
|
3546
3564
|
n && t.trim() && (n.node.name = t.trim(), a());
|
|
3547
3565
|
}, "rename");
|
|
@@ -3570,7 +3588,7 @@ function kr(e) {
|
|
|
3570
3588
|
for (let [e, i] of r) {
|
|
3571
3589
|
let r = t.get(e);
|
|
3572
3590
|
if (!r) continue;
|
|
3573
|
-
let a = n === "x" ?
|
|
3591
|
+
let a = n === "x" ? F(r, i, 0) : F(r, 0, i);
|
|
3574
3592
|
Object.assign(r, a);
|
|
3575
3593
|
}
|
|
3576
3594
|
e.layout.apply(n === "y" ? [...r.keys()] : []), a();
|
|
@@ -3580,31 +3598,31 @@ function kr(e) {
|
|
|
3580
3598
|
align: n((e, t = {}) => {
|
|
3581
3599
|
let n = B();
|
|
3582
3600
|
if (!n) return;
|
|
3583
|
-
let r =
|
|
3601
|
+
let r = Or(n.items, e, {
|
|
3584
3602
|
...t,
|
|
3585
3603
|
pageBounds: n.pageBounds
|
|
3586
3604
|
});
|
|
3587
|
-
we(n.nodes,
|
|
3605
|
+
we(n.nodes, Sr(e), r);
|
|
3588
3606
|
}, "align"),
|
|
3589
3607
|
cancelDraft: m,
|
|
3590
3608
|
commitDraft: b,
|
|
3591
3609
|
distribute: n((e, t = {}) => {
|
|
3592
3610
|
let n = B();
|
|
3593
3611
|
if (!n) return;
|
|
3594
|
-
let r =
|
|
3612
|
+
let r = kr(n.items, e, {
|
|
3595
3613
|
...t,
|
|
3596
3614
|
pageBounds: n.pageBounds
|
|
3597
3615
|
});
|
|
3598
|
-
r ? we(n.nodes,
|
|
3616
|
+
r ? we(n.nodes, Sr(e), r) : c(S("designer.elementStore.insufficientDistributionSelection"));
|
|
3599
3617
|
}, "distribute"),
|
|
3600
3618
|
distributeSpacing: n((e, t = {}) => {
|
|
3601
3619
|
let n = B();
|
|
3602
3620
|
if (!n) return;
|
|
3603
|
-
let r =
|
|
3621
|
+
let r = Ar(n.items, e, {
|
|
3604
3622
|
...t,
|
|
3605
3623
|
pageBounds: n.pageBounds
|
|
3606
3624
|
});
|
|
3607
|
-
if (r) we(n.nodes,
|
|
3625
|
+
if (r) we(n.nodes, Cr(e), r);
|
|
3608
3626
|
else {
|
|
3609
3627
|
let e = typeof t.spacing == "number" && Number.isFinite(t.spacing);
|
|
3610
3628
|
c(S(e ? "designer.elementStore.insufficientSpacingSelection" : "designer.elementStore.insufficientDistributionSelection"));
|
|
@@ -3612,40 +3630,40 @@ function kr(e) {
|
|
|
3612
3630
|
}, "distributeSpacing"),
|
|
3613
3631
|
draftElement: u,
|
|
3614
3632
|
draftPageId: d,
|
|
3615
|
-
duplicate:
|
|
3616
|
-
find:
|
|
3617
|
-
get:
|
|
3618
|
-
getByPage:
|
|
3619
|
-
getMany:
|
|
3620
|
-
moveByDisplayIndex:
|
|
3633
|
+
duplicate: te,
|
|
3634
|
+
find: U(() => h),
|
|
3635
|
+
get: U(() => g),
|
|
3636
|
+
getByPage: U(() => v),
|
|
3637
|
+
getMany: U(() => _),
|
|
3638
|
+
moveByDisplayIndex: oe,
|
|
3621
3639
|
moveLayerNodes: le,
|
|
3622
|
-
nudge:
|
|
3623
|
-
removeIds:
|
|
3624
|
-
removeSelected:
|
|
3625
|
-
rename:
|
|
3640
|
+
nudge: re,
|
|
3641
|
+
removeIds: M,
|
|
3642
|
+
removeSelected: ee,
|
|
3643
|
+
rename: ve,
|
|
3626
3644
|
reorder: de,
|
|
3627
3645
|
sendTo: fe,
|
|
3628
3646
|
setDraft: f,
|
|
3629
|
-
setFlag:
|
|
3630
|
-
toggleFlag:
|
|
3647
|
+
setFlag: me,
|
|
3648
|
+
toggleFlag: he,
|
|
3631
3649
|
update: E,
|
|
3632
3650
|
updateDraft: p,
|
|
3633
3651
|
updateMany: T,
|
|
3634
|
-
updateProps:
|
|
3652
|
+
updateProps: D
|
|
3635
3653
|
};
|
|
3636
3654
|
})();
|
|
3637
3655
|
}
|
|
3638
3656
|
// src/designer/stores/follow-block-store.ts
|
|
3639
|
-
function
|
|
3640
|
-
return
|
|
3641
|
-
let t =
|
|
3657
|
+
function Mr(e) {
|
|
3658
|
+
return H("editor-followBlock", () => {
|
|
3659
|
+
let t = U(() => e.document.data.followBlocks ?? []), n = U(() => (e) => t.value.find((t) => t.id === e)), r = U(() => (e) => t.value.filter((t) => t.pageId === e)), i = U(() => (e) => {
|
|
3642
3660
|
let n = /* @__PURE__ */ new Set();
|
|
3643
3661
|
for (let r of e) for (let e of t.value) e.elementIds.includes(r) && n.add(e);
|
|
3644
3662
|
return [...n];
|
|
3645
|
-
}), s =
|
|
3663
|
+
}), s = U(() => {
|
|
3646
3664
|
let n = e.selection.ids;
|
|
3647
3665
|
if (n.length !== 0) return t.value.find((e) => n.every((t) => e.elementIds.includes(t)));
|
|
3648
|
-
}), c =
|
|
3666
|
+
}), c = U(() => (e) => t.value.filter((t) => {
|
|
3649
3667
|
let n = l(t, e);
|
|
3650
3668
|
return n.elementIds.length > t.elementIds.length && !u(n);
|
|
3651
3669
|
}));
|
|
@@ -3679,7 +3697,7 @@ function Ar(e) {
|
|
|
3679
3697
|
let i = e.document.data, o = i.pages.find((e) => e.id === t), s = ee(i, t, r)?.elementIds ?? [], c = a((o?.elements ?? []).filter((e) => n.includes(e.id))), l = a((o?.elements ?? []).filter((e) => s.includes(e.id)));
|
|
3680
3698
|
return !c || !l ? 0 : c.y - l.y - l.height;
|
|
3681
3699
|
}
|
|
3682
|
-
function m(e, t, r, i = 2, a = S("designer.followBlock.defaultName"), o =
|
|
3700
|
+
function m(e, t, r, i = 2, a = S("designer.followBlock.defaultName"), o = z("follow")) {
|
|
3683
3701
|
if (n.value(o)) throw Error(`Follow block already exists: ${o}`);
|
|
3684
3702
|
let s = {
|
|
3685
3703
|
elementIds: [...t],
|
|
@@ -3734,13 +3752,13 @@ function Ar(e) {
|
|
|
3734
3752
|
})();
|
|
3735
3753
|
}
|
|
3736
3754
|
// src/designer/stores/guide-store.ts
|
|
3737
|
-
function
|
|
3738
|
-
return
|
|
3755
|
+
function Nr(e) {
|
|
3756
|
+
return H("editor-guide", () => {
|
|
3739
3757
|
let { pages: t } = G(e.scope), n = e.history.commit;
|
|
3740
3758
|
function r(t) {
|
|
3741
3759
|
return e.scope.get(t);
|
|
3742
3760
|
}
|
|
3743
|
-
let i =
|
|
3761
|
+
let i = U(() => t.value.some((e) => e.guides.length > 0));
|
|
3744
3762
|
function a(e) {
|
|
3745
3763
|
return r(e)?.guides ?? [];
|
|
3746
3764
|
}
|
|
@@ -3761,15 +3779,15 @@ function jr(e) {
|
|
|
3761
3779
|
let o = r(e);
|
|
3762
3780
|
if (!o) return null;
|
|
3763
3781
|
let s = {
|
|
3764
|
-
id:
|
|
3782
|
+
id: z("guide"),
|
|
3765
3783
|
orientation: t,
|
|
3766
|
-
position:
|
|
3784
|
+
position: L(i)
|
|
3767
3785
|
};
|
|
3768
3786
|
return o.guides.push(s), a.transient || n(), s;
|
|
3769
3787
|
}
|
|
3770
3788
|
function l(e, t, r, i = {}) {
|
|
3771
3789
|
let a = o(e, t);
|
|
3772
|
-
a && (a.position =
|
|
3790
|
+
a && (a.position = L(r), i.transient || n());
|
|
3773
3791
|
}
|
|
3774
3792
|
function u(e, t, i = {}) {
|
|
3775
3793
|
let a = r(e);
|
|
@@ -3782,9 +3800,9 @@ function jr(e) {
|
|
|
3782
3800
|
return {
|
|
3783
3801
|
add: c,
|
|
3784
3802
|
clear: d,
|
|
3785
|
-
find:
|
|
3786
|
-
get:
|
|
3787
|
-
getByPage:
|
|
3803
|
+
find: U(() => s),
|
|
3804
|
+
get: U(() => o),
|
|
3805
|
+
getByPage: U(() => a),
|
|
3788
3806
|
hasAny: i,
|
|
3789
3807
|
move: l,
|
|
3790
3808
|
remove: u
|
|
@@ -3792,10 +3810,10 @@ function jr(e) {
|
|
|
3792
3810
|
})();
|
|
3793
3811
|
}
|
|
3794
3812
|
// src/designer/stores/history-store.ts
|
|
3795
|
-
var
|
|
3796
|
-
function
|
|
3797
|
-
return
|
|
3798
|
-
let { data: n } = G(e.document), r =
|
|
3813
|
+
var Pr = 100;
|
|
3814
|
+
function Fr(e) {
|
|
3815
|
+
return H("editor-history", ({ action: t }) => {
|
|
3816
|
+
let { data: n } = G(e.document), r = W([]), i = W(-1), a = W([]), o = W(null), s = U(() => i.value > 0), c = U(() => i.value < r.value.length - 1);
|
|
3799
3817
|
function l() {
|
|
3800
3818
|
return JSON.stringify({
|
|
3801
3819
|
dataSources: n.value.dataSources ?? [],
|
|
@@ -3812,7 +3830,7 @@ function Nr(e) {
|
|
|
3812
3830
|
let n = l();
|
|
3813
3831
|
if (r.value[i.value] === n) return;
|
|
3814
3832
|
let a = Date.now();
|
|
3815
|
-
t.coalesce !== void 0 && t.coalesce === u && a - d < 800 && i.value === r.value.length - 1 ? (r.value[i.value] = n, d = a) : (u = t.coalesce ?? null, d = a, r.value = r.value.slice(0, i.value + 1), r.value.push(n), r.value.length >
|
|
3833
|
+
t.coalesce !== void 0 && t.coalesce === u && a - d < 800 && i.value === r.value.length - 1 ? (r.value[i.value] = n, d = a) : (u = t.coalesce ?? null, d = a, r.value = r.value.slice(0, i.value + 1), r.value.push(n), r.value.length > Pr && r.value.shift(), i.value = r.value.length - 1);
|
|
3816
3834
|
}, "commit");
|
|
3817
3835
|
function p(t) {
|
|
3818
3836
|
let r = JSON.parse(t);
|
|
@@ -3871,19 +3889,19 @@ function Nr(e) {
|
|
|
3871
3889
|
})();
|
|
3872
3890
|
}
|
|
3873
3891
|
// src/designer/stores/layout-store.ts
|
|
3874
|
-
function
|
|
3875
|
-
return
|
|
3876
|
-
let t =
|
|
3892
|
+
function Ir(e) {
|
|
3893
|
+
return H("editor-layout", () => {
|
|
3894
|
+
let t = He(/* @__PURE__ */ new Map());
|
|
3877
3895
|
function n(e, n) {
|
|
3878
3896
|
let r = t.get(e);
|
|
3879
|
-
return t.set(e,
|
|
3897
|
+
return t.set(e, ze(n)), () => {
|
|
3880
3898
|
t.get(e) === n && (r ? t.set(e, r) : t.delete(e));
|
|
3881
3899
|
};
|
|
3882
3900
|
}
|
|
3883
3901
|
function r(n = [], r = []) {
|
|
3884
3902
|
let i = [];
|
|
3885
3903
|
for (let a of t.values()) for (let t of a(e.document.data, n, r)) {
|
|
3886
|
-
let n =
|
|
3904
|
+
let n = ye(e.document.data, t.id);
|
|
3887
3905
|
n && (Object.assign(n.node, t.patch), i.push(t));
|
|
3888
3906
|
}
|
|
3889
3907
|
return i;
|
|
@@ -3896,9 +3914,9 @@ function Pr(e) {
|
|
|
3896
3914
|
})();
|
|
3897
3915
|
}
|
|
3898
3916
|
// src/designer/stores/navigation-store.ts
|
|
3899
|
-
function
|
|
3900
|
-
return
|
|
3901
|
-
let t =
|
|
3917
|
+
function Lr(e) {
|
|
3918
|
+
return H("editor-navigation", () => {
|
|
3919
|
+
let t = W([]);
|
|
3902
3920
|
function n(n) {
|
|
3903
3921
|
e.template.get(n) && e.template.editingId !== n && (t.value.push({
|
|
3904
3922
|
dialogSessionId: e.ui.suspendDialog(),
|
|
@@ -3937,30 +3955,30 @@ function Fr(e) {
|
|
|
3937
3955
|
})();
|
|
3938
3956
|
}
|
|
3939
3957
|
// src/designer/stores/page-store.ts
|
|
3940
|
-
function
|
|
3941
|
-
return
|
|
3942
|
-
let { data: t } = G(e.document), n = e.history.commit, r = e.ui.toast, i =
|
|
3958
|
+
function Rr(e) {
|
|
3959
|
+
return H("editor-page", () => {
|
|
3960
|
+
let { data: t } = G(e.document), n = e.history.commit, r = e.ui.toast, i = W(""), a = U(() => t.value.pages), o = U(() => a.value.length > 1), s = U(() => l(d.value));
|
|
3943
3961
|
function c(e) {
|
|
3944
3962
|
return a.value.find((t) => t.id === e);
|
|
3945
3963
|
}
|
|
3946
3964
|
function l(e) {
|
|
3947
3965
|
return a.value.findIndex((t) => t.id === e);
|
|
3948
3966
|
}
|
|
3949
|
-
let u =
|
|
3967
|
+
let u = U(() => {
|
|
3950
3968
|
let e = c(i.value) ?? a.value[0];
|
|
3951
3969
|
if (!e) throw Error("Document must contain at least one page");
|
|
3952
3970
|
return e;
|
|
3953
|
-
}), d =
|
|
3971
|
+
}), d = U(() => u.value.id);
|
|
3954
3972
|
function f(e) {
|
|
3955
3973
|
c(e) && (i.value = e);
|
|
3956
3974
|
}
|
|
3957
3975
|
function p(e, r, a, o = {}) {
|
|
3958
|
-
if (o.id &&
|
|
3959
|
-
let s =
|
|
3976
|
+
if (o.id && R(t.value, o.id)) throw Error(`Page already exists: ${o.id}`);
|
|
3977
|
+
let s = Ae(t.value, {
|
|
3960
3978
|
height: r,
|
|
3961
3979
|
width: e,
|
|
3962
3980
|
...o
|
|
3963
|
-
}, t.value.pages.length + 1), c =
|
|
3981
|
+
}, t.value.pages.length + 1), c = Oe(e, r, a ?? S("designer.pageStore.numberedPageName", { pageNumber: t.value.pages.length + 1 }), {
|
|
3964
3982
|
...o,
|
|
3965
3983
|
...s
|
|
3966
3984
|
});
|
|
@@ -3969,23 +3987,23 @@ function Ir(e) {
|
|
|
3969
3987
|
function m(r) {
|
|
3970
3988
|
let a = l(r);
|
|
3971
3989
|
if (a < 0) return;
|
|
3972
|
-
let o = t.value.pages[a], s =
|
|
3973
|
-
...
|
|
3990
|
+
let o = t.value.pages[a], s = er(t.value, o.elements.map((e) => e.id)), c = {
|
|
3991
|
+
...I(o),
|
|
3974
3992
|
background: o.background,
|
|
3975
3993
|
elements: o.elements.map((e) => ({
|
|
3976
|
-
...
|
|
3977
|
-
id:
|
|
3994
|
+
...xe(e),
|
|
3995
|
+
id: z("el")
|
|
3978
3996
|
})),
|
|
3979
3997
|
guides: o.guides.map((e) => ({
|
|
3980
3998
|
...e,
|
|
3981
|
-
id:
|
|
3999
|
+
id: z("guide")
|
|
3982
4000
|
})),
|
|
3983
|
-
id:
|
|
4001
|
+
id: z("page"),
|
|
3984
4002
|
name: S("designer.pageStore.duplicatePageName", { pageName: o.name }),
|
|
3985
4003
|
templateId: o.templateId
|
|
3986
4004
|
};
|
|
3987
|
-
for (let [n, r] of o.elements.entries())
|
|
3988
|
-
t.value.pages.splice(a + 1, 0, c),
|
|
4005
|
+
for (let [n, r] of o.elements.entries()) ne(t.value, r, c.elements[n], e.elements ?? M);
|
|
4006
|
+
t.value.pages.splice(a + 1, 0, c), tr(t.value, s, new Map(o.elements.map((e, t) => [e.id, c.elements[t].id])), c.id, z), i.value = c.id, n();
|
|
3989
4007
|
}
|
|
3990
4008
|
function h(e) {
|
|
3991
4009
|
if (!o.value) {
|
|
@@ -4002,9 +4020,19 @@ function Ir(e) {
|
|
|
4002
4020
|
let a = {
|
|
4003
4021
|
...i,
|
|
4004
4022
|
...r
|
|
4005
|
-
}, o =
|
|
4023
|
+
}, o = Ae(t.value, a);
|
|
4006
4024
|
Object.assign(i, a, o), n();
|
|
4007
4025
|
}
|
|
4026
|
+
function _(e, t) {
|
|
4027
|
+
let r = c(e);
|
|
4028
|
+
if (r) {
|
|
4029
|
+
if (t && (!Number.isFinite(t.x) || !Number.isFinite(t.y))) throw Error("Page position must contain finite coordinates");
|
|
4030
|
+
t === null ? delete r.position : r.position = {
|
|
4031
|
+
x: Math.max(0, L(t.x, 2)),
|
|
4032
|
+
y: Math.max(0, L(t.y, 2))
|
|
4033
|
+
}, n();
|
|
4034
|
+
}
|
|
4035
|
+
}
|
|
4008
4036
|
return {
|
|
4009
4037
|
active: u,
|
|
4010
4038
|
activeId: d,
|
|
@@ -4012,12 +4040,13 @@ function Ir(e) {
|
|
|
4012
4040
|
add: p,
|
|
4013
4041
|
canRemove: o,
|
|
4014
4042
|
copy: m,
|
|
4015
|
-
get:
|
|
4016
|
-
getIndex:
|
|
4017
|
-
has:
|
|
4043
|
+
get: U(() => c),
|
|
4044
|
+
getIndex: U(() => l),
|
|
4045
|
+
has: U(() => function(e) {
|
|
4018
4046
|
return c(e) !== void 0;
|
|
4019
4047
|
}),
|
|
4020
4048
|
list: a,
|
|
4049
|
+
move: _,
|
|
4021
4050
|
remove: h,
|
|
4022
4051
|
setActive: f,
|
|
4023
4052
|
update: g
|
|
@@ -4025,32 +4054,32 @@ function Ir(e) {
|
|
|
4025
4054
|
})();
|
|
4026
4055
|
}
|
|
4027
4056
|
// src/designer/stores/panel-store.ts
|
|
4028
|
-
var
|
|
4029
|
-
function
|
|
4057
|
+
var zr = "print-studio:panel-layout";
|
|
4058
|
+
function Br(e) {
|
|
4030
4059
|
return {
|
|
4031
4060
|
activeId: e[0] ?? "",
|
|
4032
|
-
id:
|
|
4061
|
+
id: z("panel-group"),
|
|
4033
4062
|
panelIds: e,
|
|
4034
4063
|
weight: 1
|
|
4035
4064
|
};
|
|
4036
4065
|
}
|
|
4037
|
-
function
|
|
4066
|
+
function Vr(e) {
|
|
4038
4067
|
return {
|
|
4039
4068
|
collapsed: !1,
|
|
4040
4069
|
floating: !1,
|
|
4041
4070
|
groups: e,
|
|
4042
4071
|
height: 480,
|
|
4043
|
-
id:
|
|
4072
|
+
id: z("panel-column"),
|
|
4044
4073
|
railWidth: 112,
|
|
4045
4074
|
width: 280,
|
|
4046
4075
|
x: 80,
|
|
4047
4076
|
y: 100
|
|
4048
4077
|
};
|
|
4049
4078
|
}
|
|
4050
|
-
function
|
|
4051
|
-
return typeof e == "number" && Number.isFinite(e) ?
|
|
4079
|
+
function Hr(e, t, n, r) {
|
|
4080
|
+
return typeof e == "number" && Number.isFinite(e) ? V(e, n, r) : t;
|
|
4052
4081
|
}
|
|
4053
|
-
function
|
|
4082
|
+
function Ur(e) {
|
|
4054
4083
|
let t = {
|
|
4055
4084
|
columns: [],
|
|
4056
4085
|
version: 1
|
|
@@ -4059,22 +4088,22 @@ function Vr(e) {
|
|
|
4059
4088
|
let n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set();
|
|
4060
4089
|
for (let i of e.columns) {
|
|
4061
4090
|
if (!i || typeof i != "object" || !Array.isArray(i.groups)) continue;
|
|
4062
|
-
let e =
|
|
4091
|
+
let e = Vr([]);
|
|
4063
4092
|
typeof i.id == "string" && !r.has(i.id) && (e.id = i.id), r.add(e.id);
|
|
4064
4093
|
for (let t of i.groups) {
|
|
4065
4094
|
if (!t || typeof t != "object" || !Array.isArray(t.panelIds)) continue;
|
|
4066
4095
|
let i = t.panelIds.filter((e) => typeof e != "string" || !e || n.has(e) ? !1 : (n.add(e), !0));
|
|
4067
4096
|
if (!i.length) continue;
|
|
4068
|
-
let a =
|
|
4069
|
-
typeof t.id == "string" && !r.has(t.id) && (a.id = t.id), r.add(a.id), a.activeId = i.includes(t.activeId) ? t.activeId : i[0], a.weight =
|
|
4097
|
+
let a = Br(i);
|
|
4098
|
+
typeof t.id == "string" && !r.has(t.id) && (a.id = t.id), r.add(a.id), a.activeId = i.includes(t.activeId) ? t.activeId : i[0], a.weight = Hr(t.weight, 1, .05, 100), e.groups.push(a);
|
|
4070
4099
|
}
|
|
4071
|
-
e.groups.length && (e.collapsed = i.collapsed === !0, e.floating = i.floating === !0, e.width =
|
|
4100
|
+
e.groups.length && (e.collapsed = i.collapsed === !0, e.floating = i.floating === !0, e.width = Hr(i.width, 280, 240, 560), e.railWidth = Hr(i.railWidth, 112, 36, 180), e.height = Hr(i.height, 480, 180, 1600), e.x = Hr(i.x, 80, 0, 1e4), e.y = Hr(i.y, 100, 0, 1e4), t.columns.push(e));
|
|
4072
4101
|
}
|
|
4073
4102
|
return t;
|
|
4074
4103
|
}
|
|
4075
|
-
function
|
|
4104
|
+
function Wr(e) {
|
|
4076
4105
|
try {
|
|
4077
|
-
return
|
|
4106
|
+
return Ur(JSON.parse((e ? e.get(zr) : localStorage.getItem(zr)) ?? "null"));
|
|
4078
4107
|
} catch {
|
|
4079
4108
|
return {
|
|
4080
4109
|
columns: [],
|
|
@@ -4082,45 +4111,45 @@ function Hr(e) {
|
|
|
4082
4111
|
};
|
|
4083
4112
|
}
|
|
4084
4113
|
}
|
|
4085
|
-
function
|
|
4114
|
+
function Gr(e, t, n) {
|
|
4086
4115
|
for (let r of e) r !== n && (r.panelIds = r.panelIds.filter((e) => !t.includes(e)));
|
|
4087
4116
|
}
|
|
4088
|
-
function
|
|
4117
|
+
function Kr(e, t, n, r) {
|
|
4089
4118
|
let i = n.panelIds.filter((e) => !t.includes(e)), a = r ? i.indexOf(r) : -1;
|
|
4090
|
-
i.splice(a < 0 ? i.length : a, 0, ...t),
|
|
4119
|
+
i.splice(a < 0 ? i.length : a, 0, ...t), Gr(e, t, n), n.panelIds = i, n.activeId = t[0];
|
|
4091
4120
|
}
|
|
4092
|
-
function
|
|
4121
|
+
function qr(e) {
|
|
4093
4122
|
for (let t of e.columns) {
|
|
4094
4123
|
t.groups = t.groups.filter((e) => e.panelIds.length > 0);
|
|
4095
4124
|
for (let e of t.groups) e.panelIds.includes(e.activeId) || (e.activeId = e.panelIds[0]);
|
|
4096
4125
|
}
|
|
4097
4126
|
e.columns = e.columns.filter((e) => e.groups.length > 0);
|
|
4098
4127
|
}
|
|
4099
|
-
function
|
|
4100
|
-
let i =
|
|
4128
|
+
function Jr(e, t, n, r) {
|
|
4129
|
+
let i = Vr(t);
|
|
4101
4130
|
if (i.width = e.width, r && (i.collapsed = e.collapsed, i.railWidth = e.railWidth, i.height = e.height), n.placement === "float") {
|
|
4102
4131
|
i.floating = !0;
|
|
4103
4132
|
let e = i.collapsed ? i.railWidth : i.width;
|
|
4104
|
-
i.x =
|
|
4133
|
+
i.x = V(n.x ?? 80, 0, Math.max(0, window.innerWidth - e)), i.y = V(n.y ?? 100, 0, Math.max(0, window.innerHeight - 180));
|
|
4105
4134
|
}
|
|
4106
4135
|
return i;
|
|
4107
4136
|
}
|
|
4108
|
-
function
|
|
4109
|
-
return
|
|
4110
|
-
let r =
|
|
4137
|
+
function Yr(e = !0, t) {
|
|
4138
|
+
return H("editor-panel", ({ action: n }) => {
|
|
4139
|
+
let r = He({}), i = /* @__PURE__ */ new Map(), a = W(e ? Wr(t) : {
|
|
4111
4140
|
columns: [],
|
|
4112
4141
|
version: 1
|
|
4113
|
-
}), o =
|
|
4142
|
+
}), o = W(null), s = W(null), c = W(null), l = U(() => a.value.columns.filter((e) => !e.floating)), u = U(() => a.value.columns.filter((e) => e.floating)), d = U(() => function(e) {
|
|
4114
4143
|
return a.value.columns.find((t) => t.id === e);
|
|
4115
|
-
}), f =
|
|
4144
|
+
}), f = U(() => function(e) {
|
|
4116
4145
|
let t = d.value(e.columnId);
|
|
4117
4146
|
return t ? !e.groupId || t.groups.length === 1 && t.groups[0].id === e.groupId && (!e.panelId || t.groups[0].panelIds.length === 1) : !1;
|
|
4118
4147
|
});
|
|
4119
4148
|
function p() {
|
|
4120
4149
|
if (e && !c.value) {
|
|
4121
|
-
if (t) t.set(
|
|
4150
|
+
if (t) t.set(zr, JSON.stringify(a.value));
|
|
4122
4151
|
else try {
|
|
4123
|
-
localStorage.setItem(
|
|
4152
|
+
localStorage.setItem(zr, JSON.stringify(a.value));
|
|
4124
4153
|
} catch {
|
|
4125
4154
|
return;
|
|
4126
4155
|
}
|
|
@@ -4129,13 +4158,13 @@ function qr(e = !0, t) {
|
|
|
4129
4158
|
function m(e) {
|
|
4130
4159
|
let t = {
|
|
4131
4160
|
...e,
|
|
4132
|
-
component:
|
|
4161
|
+
component: ze(e.component)
|
|
4133
4162
|
};
|
|
4134
4163
|
r[e.id] = t;
|
|
4135
4164
|
let n = i.get(e.id) ?? [];
|
|
4136
4165
|
if (n.push(t), i.set(e.id, n), !a.value.columns.some((t) => t.groups.some((t) => t.panelIds.includes(e.id)))) {
|
|
4137
4166
|
let t = l.value[0];
|
|
4138
|
-
t || (t =
|
|
4167
|
+
t || (t = Vr([]), a.value.columns.push(t)), t.groups.push(Br([e.id]));
|
|
4139
4168
|
}
|
|
4140
4169
|
return function() {
|
|
4141
4170
|
let a = n.indexOf(t);
|
|
@@ -4146,7 +4175,7 @@ function qr(e = !0, t) {
|
|
|
4146
4175
|
};
|
|
4147
4176
|
}
|
|
4148
4177
|
function h() {
|
|
4149
|
-
t?.get(
|
|
4178
|
+
t?.get(zr) && (a.value = Wr(t));
|
|
4150
4179
|
}
|
|
4151
4180
|
function g(e, t, n = !1) {
|
|
4152
4181
|
for (let r of a.value.columns) {
|
|
@@ -4171,15 +4200,15 @@ function qr(e = !0, t) {
|
|
|
4171
4200
|
}
|
|
4172
4201
|
function b(e, t, n) {
|
|
4173
4202
|
let r = d.value(e);
|
|
4174
|
-
r && (n ?? r.collapsed ? r.railWidth = Math.round(
|
|
4203
|
+
r && (n ?? r.collapsed ? r.railWidth = Math.round(V(t, 36, 180)) : r.width = Math.round(V(t, 240, 560)));
|
|
4175
4204
|
}
|
|
4176
4205
|
function x(e, t, n, r, i) {
|
|
4177
4206
|
let a = d.value(e), o = a?.groups.find((e) => e.id === t), s = a?.groups.find((e) => e.id === n);
|
|
4178
|
-
o && s && (o.weight = i *
|
|
4207
|
+
o && s && (o.weight = i * V(r, .1, .9), s.weight = i - o.weight);
|
|
4179
4208
|
}
|
|
4180
4209
|
function S(e, t, n) {
|
|
4181
4210
|
let r = d.value(e);
|
|
4182
|
-
r && (r.width =
|
|
4211
|
+
r && (r.width = V(t, 240, 560), r.height = V(n, 180, Math.max(180, window.innerHeight - r.y - 12)));
|
|
4183
4212
|
}
|
|
4184
4213
|
function C(e, t) {
|
|
4185
4214
|
E();
|
|
@@ -4197,21 +4226,21 @@ function qr(e = !0, t) {
|
|
|
4197
4226
|
version: 1
|
|
4198
4227
|
};
|
|
4199
4228
|
let r = n;
|
|
4200
|
-
if (f.value(e)) n.floating
|
|
4229
|
+
if (f.value(e)) !n.floating && !t.collapsed && (n.height = t.height);
|
|
4201
4230
|
else {
|
|
4202
4231
|
D(e, {
|
|
4203
4232
|
placement: "float",
|
|
4204
4233
|
x: t.x,
|
|
4205
4234
|
y: t.y
|
|
4206
4235
|
});
|
|
4207
|
-
let
|
|
4208
|
-
if (!
|
|
4236
|
+
let i = u.value.at(-1);
|
|
4237
|
+
if (!i) {
|
|
4209
4238
|
E();
|
|
4210
4239
|
return;
|
|
4211
4240
|
}
|
|
4212
|
-
r =
|
|
4241
|
+
r = i, r.height = t.collapsed ? n.height : t.height;
|
|
4213
4242
|
}
|
|
4214
|
-
r.floating = !0, r.x = t.x, r.y = t.y, s.value = {
|
|
4243
|
+
r.collapsed = t.collapsed, t.collapsed ? r.railWidth = t.width : r.width = t.width, r.floating = !0, r.x = t.x, r.y = t.y, s.value = {
|
|
4215
4244
|
columnId: r.id,
|
|
4216
4245
|
target: null,
|
|
4217
4246
|
x: e.x,
|
|
@@ -4243,26 +4272,26 @@ function qr(e = !0, t) {
|
|
|
4243
4272
|
if (!n || t.columnId && !r || t.groupId && !i) return;
|
|
4244
4273
|
if (n.floating && !e.groupId && !e.panelId && t.placement === "float") {
|
|
4245
4274
|
let e = n.collapsed ? n.railWidth : n.width;
|
|
4246
|
-
n.x =
|
|
4275
|
+
n.x = V(t.x ?? n.x, 0, Math.max(0, window.innerWidth - e)), n.y = V(t.y ?? n.y, 0, Math.max(0, window.innerHeight - 180)), p();
|
|
4247
4276
|
return;
|
|
4248
4277
|
}
|
|
4249
4278
|
let o = n.groups.filter((t) => !e.groupId || t.id === e.groupId), s = o.flatMap((t) => t.panelIds.filter((t) => !e.panelId || t === e.panelId));
|
|
4250
4279
|
if (!(!s.length || i && o.includes(i) && !e.panelId) && !(t.placement === "tab" && i?.panelIds.includes(e.panelId ?? "") && e.panelId === t.panelId) && (n !== r || e.groupId || t.placement !== "left" && t.placement !== "right")) {
|
|
4251
|
-
if (t.placement === "tab" && i)
|
|
4280
|
+
if (t.placement === "tab" && i) Kr(o, s, i, t.panelId);
|
|
4252
4281
|
else {
|
|
4253
|
-
let c = e.panelId ? [
|
|
4282
|
+
let c = e.panelId ? [Br(s)] : o.map((e) => ({
|
|
4254
4283
|
...e,
|
|
4255
4284
|
panelIds: [...e.panelIds]
|
|
4256
4285
|
}));
|
|
4257
|
-
if (
|
|
4286
|
+
if (Gr(o, s), (t.placement === "top" || t.placement === "bottom") && r && i) {
|
|
4258
4287
|
let e = r.groups.indexOf(i);
|
|
4259
4288
|
r.groups.splice(e + +(t.placement === "bottom"), 0, ...c);
|
|
4260
4289
|
} else {
|
|
4261
|
-
let i =
|
|
4290
|
+
let i = Jr(n, c, t, !e.groupId && !e.panelId), o = r ? a.value.columns.indexOf(r) : a.value.columns.length, s = t.placement === "right" || t.placement === "after";
|
|
4262
4291
|
a.value.columns.splice(o + +!!s, 0, i);
|
|
4263
4292
|
}
|
|
4264
4293
|
}
|
|
4265
|
-
|
|
4294
|
+
qr(a.value), _(), p();
|
|
4266
4295
|
}
|
|
4267
4296
|
}, "movePanels");
|
|
4268
4297
|
function O() {
|
|
@@ -4275,7 +4304,7 @@ function qr(e = !0, t) {
|
|
|
4275
4304
|
version: 1
|
|
4276
4305
|
};
|
|
4277
4306
|
let e = Object.keys(r);
|
|
4278
|
-
e.length && a.value.columns.push(
|
|
4307
|
+
e.length && a.value.columns.push(Vr(e.map((e) => Br([e])))), _(), p();
|
|
4279
4308
|
}
|
|
4280
4309
|
return {
|
|
4281
4310
|
activate: g,
|
|
@@ -4308,9 +4337,9 @@ function qr(e = !0, t) {
|
|
|
4308
4337
|
})();
|
|
4309
4338
|
}
|
|
4310
4339
|
// src/designer/stores/plugin-store.ts
|
|
4311
|
-
function
|
|
4312
|
-
return
|
|
4313
|
-
let e =
|
|
4340
|
+
function Xr() {
|
|
4341
|
+
return H("editor-plugin", () => {
|
|
4342
|
+
let e = W([]), t = W({});
|
|
4314
4343
|
function n(e, n) {
|
|
4315
4344
|
t.value[e] = n;
|
|
4316
4345
|
}
|
|
@@ -4330,9 +4359,9 @@ function Jr() {
|
|
|
4330
4359
|
})();
|
|
4331
4360
|
}
|
|
4332
4361
|
// src/designer/stores/rendering-store.ts
|
|
4333
|
-
function
|
|
4334
|
-
return
|
|
4335
|
-
let t =
|
|
4362
|
+
function Zr(e) {
|
|
4363
|
+
return H("editor-rendering", () => {
|
|
4364
|
+
let t = W(null), n = W(null), i = W(!1), a = W(!1), o = W(!0), s = W({
|
|
4336
4365
|
completed: 0,
|
|
4337
4366
|
stage: "prepare",
|
|
4338
4367
|
total: 1
|
|
@@ -4342,34 +4371,34 @@ function Yr(e) {
|
|
|
4342
4371
|
parsers: e.parsers,
|
|
4343
4372
|
snapshot: E
|
|
4344
4373
|
});
|
|
4345
|
-
async function
|
|
4374
|
+
async function d(e, n, r, i) {
|
|
4346
4375
|
let a = E(e), o = n === void 0 ? void 0 : E(n), s = await g((e) => l.html(a, o, r, {
|
|
4347
4376
|
...i,
|
|
4348
4377
|
...e,
|
|
4349
4378
|
onProgress: (e) => {
|
|
4350
4379
|
h(e), i?.onProgress?.(e);
|
|
4351
4380
|
},
|
|
4352
|
-
waitIfPaused:
|
|
4381
|
+
waitIfPaused: p
|
|
4353
4382
|
}), i);
|
|
4354
4383
|
return t.value = s.execution, s;
|
|
4355
4384
|
}
|
|
4356
|
-
async function
|
|
4385
|
+
async function f(e, n, r, i) {
|
|
4357
4386
|
let a = E(e), o = n === void 0 ? void 0 : E(n), s = await g((e) => l.pdf(a, o, r, {
|
|
4358
4387
|
...i,
|
|
4359
4388
|
...e,
|
|
4360
4389
|
onProgress: (e) => {
|
|
4361
4390
|
h(e), i?.onProgress?.(e);
|
|
4362
4391
|
},
|
|
4363
|
-
waitIfPaused:
|
|
4392
|
+
waitIfPaused: p
|
|
4364
4393
|
}), i);
|
|
4365
4394
|
return t.value = s.execution, s;
|
|
4366
4395
|
}
|
|
4367
|
-
async function
|
|
4396
|
+
async function p() {
|
|
4368
4397
|
a.value && await new Promise((e) => {
|
|
4369
4398
|
c = e;
|
|
4370
4399
|
});
|
|
4371
4400
|
}
|
|
4372
|
-
function
|
|
4401
|
+
function m(e) {
|
|
4373
4402
|
return g((t) => {
|
|
4374
4403
|
if (!t.signal) throw Error("Missing render cancellation signal");
|
|
4375
4404
|
return e(t.signal);
|
|
@@ -4396,7 +4425,7 @@ function Yr(e) {
|
|
|
4396
4425
|
}
|
|
4397
4426
|
}
|
|
4398
4427
|
function _() {
|
|
4399
|
-
n.value?.abort(new
|
|
4428
|
+
n.value?.abort(new u("Render cancelled")), c?.(), c = void 0;
|
|
4400
4429
|
}
|
|
4401
4430
|
function y() {
|
|
4402
4431
|
n.value && o.value && (a.value = !0);
|
|
@@ -4406,27 +4435,27 @@ function Yr(e) {
|
|
|
4406
4435
|
}
|
|
4407
4436
|
return K(() => e.config.data.rendering.worker, (e) => {
|
|
4408
4437
|
e || l.dispose();
|
|
4409
|
-
}, { flush: "sync" }),
|
|
4438
|
+
}, { flush: "sync" }), Be(() => {
|
|
4410
4439
|
_(), l.dispose();
|
|
4411
4440
|
}), {
|
|
4412
4441
|
active: i,
|
|
4413
4442
|
cancel: _,
|
|
4414
|
-
html:
|
|
4443
|
+
html: d,
|
|
4415
4444
|
lastExecution: t,
|
|
4416
4445
|
pausable: o,
|
|
4417
4446
|
pause: y,
|
|
4418
4447
|
paused: a,
|
|
4419
|
-
pdf:
|
|
4448
|
+
pdf: f,
|
|
4420
4449
|
progress: s,
|
|
4421
4450
|
resume: b,
|
|
4422
|
-
runExternal:
|
|
4451
|
+
runExternal: m
|
|
4423
4452
|
};
|
|
4424
4453
|
})();
|
|
4425
4454
|
}
|
|
4426
4455
|
// src/designer/stores/repeat-group-store.ts
|
|
4427
|
-
function
|
|
4428
|
-
return
|
|
4429
|
-
let { data: n } = G(e.document), { ids: r } = G(e.selection), { activeId: i } = G(e.page), a = e.ui.toast, o = e.history.commit, s = e.element.removeIds, c =
|
|
4456
|
+
function Qr(e) {
|
|
4457
|
+
return H("editor-repeatGroup", ({ action: t }) => {
|
|
4458
|
+
let { data: n } = G(e.document), { ids: r } = G(e.selection), { activeId: i } = G(e.page), a = e.ui.toast, o = e.history.commit, s = e.element.removeIds, c = U(() => n.value.repeatGroups ?? []), l = U(() => {
|
|
4430
4459
|
let e = /* @__PURE__ */ new Map();
|
|
4431
4460
|
for (let t of c.value) for (let n of t.elementIds) e.has(n) || e.set(n, t);
|
|
4432
4461
|
return e;
|
|
@@ -4454,7 +4483,7 @@ function Xr(e) {
|
|
|
4454
4483
|
let r = new Set(n.elementIds);
|
|
4455
4484
|
return e.element.getByPage(n.pageId).filter((e) => r.has(e.id));
|
|
4456
4485
|
}
|
|
4457
|
-
let h =
|
|
4486
|
+
let h = U(() => r.value.length === 0 ? null : c.value.find((e) => e.elementIds.length === r.value.length && e.elementIds.every((e) => r.value.includes(e))) ?? null), g = U(() => f(i.value));
|
|
4458
4487
|
function _(t, n) {
|
|
4459
4488
|
let r = new Set(e.element.getByPage(t).map((e) => e.id)), i = new Set(n.filter((e) => r.has(e))), a = p([...i]).filter((e) => e.pageId === t);
|
|
4460
4489
|
for (let e of a) for (let t of e.elementIds) r.has(t) && i.add(t);
|
|
@@ -4478,7 +4507,7 @@ function Xr(e) {
|
|
|
4478
4507
|
direction: "vertical",
|
|
4479
4508
|
gapX: 2,
|
|
4480
4509
|
gapY: 2,
|
|
4481
|
-
id:
|
|
4510
|
+
id: z("group"),
|
|
4482
4511
|
name: S("designer.repeatGroupStore.numberedGroupName", { groupNumber: c.value.length + 1 }),
|
|
4483
4512
|
...i,
|
|
4484
4513
|
elementIds: f,
|
|
@@ -4497,12 +4526,12 @@ function Xr(e) {
|
|
|
4497
4526
|
activePageGroups: g,
|
|
4498
4527
|
applyToSelection: b,
|
|
4499
4528
|
create: y,
|
|
4500
|
-
find:
|
|
4501
|
-
findByElement:
|
|
4502
|
-
getApplyTarget:
|
|
4503
|
-
getByElements:
|
|
4504
|
-
getByPage:
|
|
4505
|
-
getMembers:
|
|
4529
|
+
find: U(() => u),
|
|
4530
|
+
findByElement: U(() => d),
|
|
4531
|
+
getApplyTarget: U(() => _),
|
|
4532
|
+
getByElements: U(() => p),
|
|
4533
|
+
getByPage: U(() => f),
|
|
4534
|
+
getMembers: U(() => m),
|
|
4506
4535
|
list: c,
|
|
4507
4536
|
remove: C,
|
|
4508
4537
|
selected: h,
|
|
@@ -4511,9 +4540,9 @@ function Xr(e) {
|
|
|
4511
4540
|
})();
|
|
4512
4541
|
}
|
|
4513
4542
|
// src/designer/stores/scope-store.ts
|
|
4514
|
-
function
|
|
4515
|
-
return
|
|
4516
|
-
let t =
|
|
4543
|
+
function $r(e) {
|
|
4544
|
+
return H("editor-scope", () => {
|
|
4545
|
+
let t = U(() => {
|
|
4517
4546
|
for (let t of e) {
|
|
4518
4547
|
let e = t.resolve();
|
|
4519
4548
|
if (e) return {
|
|
@@ -4522,7 +4551,7 @@ function Zr(e) {
|
|
|
4522
4551
|
};
|
|
4523
4552
|
}
|
|
4524
4553
|
throw Error("No editing scope available");
|
|
4525
|
-
}), n =
|
|
4554
|
+
}), n = U(() => t.value.scope.id), r = U(() => t.value.scope.pages), i = U(() => t.value.scope.layoutMode), a = U(() => t.value.scope.pageGap), o = U(() => r.value.find((e) => e.id === t.value.scope.activeId) ?? r.value[0]), s = U(() => function(e) {
|
|
4526
4555
|
return r.value.find((t) => t.id === e);
|
|
4527
4556
|
});
|
|
4528
4557
|
function c(e) {
|
|
@@ -4544,60 +4573,64 @@ function Zr(e) {
|
|
|
4544
4573
|
})();
|
|
4545
4574
|
}
|
|
4546
4575
|
// src/designer/stores/selection-store.ts
|
|
4547
|
-
function
|
|
4548
|
-
return
|
|
4549
|
-
|
|
4576
|
+
function ei(e, t) {
|
|
4577
|
+
return e.length === t.length && e.every((e, n) => t[n] === e);
|
|
4578
|
+
}
|
|
4579
|
+
function ti(e) {
|
|
4580
|
+
return H("editor-selection", ({ action: t }) => {
|
|
4581
|
+
let { data: n } = G(e.document), { active: r } = G(e.scope), i = W([]), a = U(() => new Set(i.value)), o = U(() => function(e) {
|
|
4550
4582
|
return a.value.has(e);
|
|
4551
|
-
}), s =
|
|
4583
|
+
}), s = W(null), c = W(null), l = W(null), u = W(null), d = t((e) => {
|
|
4552
4584
|
c.value = e;
|
|
4553
4585
|
}, "setHoverId"), f = t((e) => {
|
|
4554
4586
|
l.value = e;
|
|
4555
4587
|
}, "setRenamingId"), p = t((e) => {
|
|
4556
4588
|
u.value = e;
|
|
4557
|
-
}, "setEditingId"), m =
|
|
4589
|
+
}, "setEditingId"), m = U(() => {
|
|
4558
4590
|
let e = [];
|
|
4559
|
-
for (let t of
|
|
4591
|
+
for (let t of ae(n.value)) for (let n of t.elements) o.value(n.id) && e.push(n);
|
|
4560
4592
|
return e;
|
|
4561
|
-
}), h =
|
|
4562
|
-
return (
|
|
4563
|
-
}), S =
|
|
4593
|
+
}), h = U(() => m.value[0] ?? null), g = U(() => m.value.length > 0 && m.value.every((e) => e.type === h.value?.type)), _ = U(() => m.value.length === 1 ? m.value[0] : null), v = U(() => m.value.length === 0), y = U(() => m.value.some((e) => e.locked)), b = U(() => m.value.filter((e) => !e.locked)), x = U(() => function(e, t = {}) {
|
|
4594
|
+
return (R(n.value, e)?.elements ?? []).filter((e) => o.value(e.id) && (t.visible === void 0 || e.visible === t.visible) && (t.locked === void 0 || e.locked === t.locked));
|
|
4595
|
+
}), S = U(() => {
|
|
4564
4596
|
let e = m.value;
|
|
4565
|
-
return e.length === 0 ? null :
|
|
4597
|
+
return e.length === 0 ? null : D(e.map((e) => ie({
|
|
4566
4598
|
height: e.height,
|
|
4567
4599
|
width: e.width,
|
|
4568
4600
|
x: e.x,
|
|
4569
4601
|
y: e.y
|
|
4570
4602
|
}, e.rotation)));
|
|
4571
|
-
}), C =
|
|
4603
|
+
}), C = W(null), w = t((e) => {
|
|
4572
4604
|
(e === null || o.value(e)) && (C.value = e);
|
|
4573
4605
|
}, "setKeyId"), T = t((e, t = !1) => {
|
|
4574
4606
|
if (t) {
|
|
4575
4607
|
let t = new Set(i.value);
|
|
4576
4608
|
for (let n of e) t.has(n) ? t.delete(n) : t.add(n);
|
|
4577
|
-
|
|
4578
|
-
|
|
4609
|
+
let n = [...t];
|
|
4610
|
+
ei(n, i.value) || (i.value = n);
|
|
4611
|
+
} else ei(e, i.value) || (i.value = [...e]);
|
|
4579
4612
|
i.value.length > 0 && (s.value = null, u.value = null), C.value && !i.value.includes(C.value) && (C.value = null);
|
|
4580
4613
|
}, "set"), E = t(() => {
|
|
4581
4614
|
i.value = [], C.value = null, s.value = null;
|
|
4582
|
-
}, "clear"),
|
|
4615
|
+
}, "clear"), O = t(() => {
|
|
4583
4616
|
let e = r.value;
|
|
4584
4617
|
e && (C.value = null, i.value = e.elements.filter((e) => e.visible && !e.locked).map((e) => e.id));
|
|
4585
|
-
}, "all"),
|
|
4618
|
+
}, "all"), k = U(() => {
|
|
4586
4619
|
let t = s.value;
|
|
4587
4620
|
return t ? e.guide.find(t) : null;
|
|
4588
|
-
}),
|
|
4621
|
+
}), A = t((e) => {
|
|
4589
4622
|
s.value = e, e && (i.value = [], u.value = null, C.value = null);
|
|
4590
4623
|
}, "selectGuide");
|
|
4591
4624
|
K(i, (e) => {
|
|
4592
4625
|
e.length > 0 && (s.value = null);
|
|
4593
|
-
}), K(
|
|
4626
|
+
}), K(k, (e) => {
|
|
4594
4627
|
s.value && !e && (s.value = null);
|
|
4595
4628
|
}, { flush: "sync" });
|
|
4596
|
-
function
|
|
4629
|
+
function j() {
|
|
4597
4630
|
E(), c.value = null, u.value = null, l.value = null;
|
|
4598
4631
|
}
|
|
4599
4632
|
return {
|
|
4600
|
-
all:
|
|
4633
|
+
all: O,
|
|
4601
4634
|
bounds: S,
|
|
4602
4635
|
clear: E,
|
|
4603
4636
|
editingId: u,
|
|
@@ -4611,11 +4644,11 @@ function Qr(e) {
|
|
|
4611
4644
|
nodes: m,
|
|
4612
4645
|
primary: h,
|
|
4613
4646
|
renamingId: l,
|
|
4614
|
-
reset:
|
|
4647
|
+
reset: j,
|
|
4615
4648
|
sameType: g,
|
|
4616
|
-
selectedGuide:
|
|
4649
|
+
selectedGuide: k,
|
|
4617
4650
|
selectedGuideId: s,
|
|
4618
|
-
selectGuide:
|
|
4651
|
+
selectGuide: A,
|
|
4619
4652
|
set: T,
|
|
4620
4653
|
setEditingId: p,
|
|
4621
4654
|
setHoverId: d,
|
|
@@ -4627,14 +4660,14 @@ function Qr(e) {
|
|
|
4627
4660
|
})();
|
|
4628
4661
|
}
|
|
4629
4662
|
// src/designer/stores/template-store.ts
|
|
4630
|
-
function
|
|
4631
|
-
return
|
|
4632
|
-
let { data: t } = G(e.document), n = e.history.commit, r = e.ui.toast, i =
|
|
4663
|
+
function ni(e) {
|
|
4664
|
+
return H("editor-template", () => {
|
|
4665
|
+
let { data: t } = G(e.document), n = e.history.commit, r = e.ui.toast, i = W(null), a = W(null), o = U(() => t.value.templates ?? []), s = U(() => o.value.filter((e) => !e.owner)), c = U(() => i.value ? o.value.find((e) => e.id === i.value) : void 0), l = U(() => c.value ? me(c.value) : []), u = U(() => l.value.find((e) => e.id === a.value) ?? c.value?.page ?? null);
|
|
4633
4666
|
function d(e) {
|
|
4634
4667
|
return o.value.find((t) => t.id === e);
|
|
4635
4668
|
}
|
|
4636
4669
|
function f(e, n) {
|
|
4637
|
-
return
|
|
4670
|
+
return Me(t.value, e, n);
|
|
4638
4671
|
}
|
|
4639
4672
|
function p(e) {
|
|
4640
4673
|
let t = f(e);
|
|
@@ -4659,13 +4692,13 @@ function $r(e) {
|
|
|
4659
4692
|
let n = d(e.id);
|
|
4660
4693
|
if (n) return n;
|
|
4661
4694
|
let r = E(e);
|
|
4662
|
-
return
|
|
4695
|
+
return te(r), je({
|
|
4663
4696
|
...t.value,
|
|
4664
4697
|
templates: [...o.value, r]
|
|
4665
4698
|
}, r), v(r), r;
|
|
4666
4699
|
}
|
|
4667
4700
|
function b(n = {}) {
|
|
4668
|
-
if (n.id && (d(n.id) ||
|
|
4701
|
+
if (n.id && (d(n.id) || R(t.value, n.id))) throw Error(`Template already exists: ${n.id}`);
|
|
4669
4702
|
let r = e.page.active, i = fe(n.name ?? S("designer.templateStore.newTemplateName", { templateNumber: s.value.length }), r ? {
|
|
4670
4703
|
height: r.height,
|
|
4671
4704
|
width: r.width
|
|
@@ -4677,29 +4710,29 @@ function $r(e) {
|
|
|
4677
4710
|
if (!n) return null;
|
|
4678
4711
|
let i = fe(S("designer.templateStore.fromPageTemplateName", { pageName: n.name }), n);
|
|
4679
4712
|
return i.background = n.background, i.page.elements = n.elements.map((n) => {
|
|
4680
|
-
let r =
|
|
4681
|
-
return r.id =
|
|
4713
|
+
let r = xe(n);
|
|
4714
|
+
return r.id = z("el"), ne(t.value, n, r, e.elements ?? M), r;
|
|
4682
4715
|
}), i.page.guides = n.guides.map((e) => ({
|
|
4683
4716
|
...e,
|
|
4684
|
-
id:
|
|
4717
|
+
id: z("guide")
|
|
4685
4718
|
})), v(i), r(S("designer.templateStore.createdFromPageMessage")), i;
|
|
4686
4719
|
}
|
|
4687
4720
|
function w(e, t) {
|
|
4688
4721
|
let r = d(e);
|
|
4689
4722
|
r && t.trim() && (D(r, t.trim()), n());
|
|
4690
4723
|
}
|
|
4691
|
-
function T(e, r) {
|
|
4692
|
-
let
|
|
4693
|
-
if (
|
|
4694
|
-
if (r.baseTemplateId && d(r.baseTemplateId)?.owner ||
|
|
4724
|
+
function T(e, r, i = {}) {
|
|
4725
|
+
let a = d(e);
|
|
4726
|
+
if (a) {
|
|
4727
|
+
if (r.baseTemplateId && d(r.baseTemplateId)?.owner || a.owner && r.facingPages) throw new x(S("core.pageExtensions.internalTemplate"), { code: "template.internal-resource" });
|
|
4695
4728
|
if (r.baseTemplateId !== void 0) {
|
|
4696
4729
|
let e = {
|
|
4697
|
-
...
|
|
4730
|
+
...a,
|
|
4698
4731
|
baseTemplateId: r.baseTemplateId || void 0
|
|
4699
4732
|
};
|
|
4700
|
-
|
|
4733
|
+
je(t.value, e), a.baseTemplateId = e.baseTemplateId;
|
|
4701
4734
|
}
|
|
4702
|
-
r.background !== void 0 && (
|
|
4735
|
+
r.background !== void 0 && (a.background = r.background || void 0), r.facingPages !== void 0 && (a.facingPages = r.facingPages, a.oddPages = !0, a.evenPages = !0, r.facingPages && !a.evenPage && (a.evenPage = Oe(a.page.width, a.page.height, a.name, { margins: a.page.margins }), a.evenPage.id = `${a.id}-even`)), r.oddPages !== void 0 && (a.oddPages = r.oddPages), r.evenPages !== void 0 && (a.evenPages = r.evenPages), r.name !== void 0 && D(a, r.name), (r.facingPages !== void 0 || r.oddPages !== void 0 || r.evenPages !== void 0) && A(a.id), i.transient || n();
|
|
4703
4736
|
}
|
|
4704
4737
|
}
|
|
4705
4738
|
function D(e, t) {
|
|
@@ -4713,7 +4746,7 @@ function $r(e) {
|
|
|
4713
4746
|
for (let n of t.value.pages) n.templateId === e && (n.templateId = void 0);
|
|
4714
4747
|
i.value === e && (i.value = null, a.value = null), t.value.templates = (t.value.templates ?? []).filter((t) => t.id !== e);
|
|
4715
4748
|
for (let t of o.value) t.baseTemplateId === e && (t.baseTemplateId = void 0);
|
|
4716
|
-
O(t.value),
|
|
4749
|
+
O(t.value), Ce(t.value), A(De), n();
|
|
4717
4750
|
}
|
|
4718
4751
|
}
|
|
4719
4752
|
function A(e, n) {
|
|
@@ -4724,9 +4757,9 @@ function $r(e) {
|
|
|
4724
4757
|
let r = [];
|
|
4725
4758
|
for (let i of e.pages) {
|
|
4726
4759
|
if (n && !n.has(i.id) || t && (i.templateId ?? "template-blank") !== t) continue;
|
|
4727
|
-
let a =
|
|
4760
|
+
let a = Me(e, i);
|
|
4728
4761
|
if (!a) continue;
|
|
4729
|
-
let o =
|
|
4762
|
+
let o = I(a.page);
|
|
4730
4763
|
r.push({
|
|
4731
4764
|
dimensions: o,
|
|
4732
4765
|
page: i
|
|
@@ -4755,21 +4788,21 @@ function $r(e) {
|
|
|
4755
4788
|
}, void 0, a);
|
|
4756
4789
|
for (let e of t.value.pages) if (a.has(e.id)) {
|
|
4757
4790
|
e.templateId = r;
|
|
4758
|
-
let n =
|
|
4759
|
-
n && Object.assign(e,
|
|
4791
|
+
let n = Me(t.value, e);
|
|
4792
|
+
n && Object.assign(e, I(n.page));
|
|
4760
4793
|
}
|
|
4761
4794
|
n();
|
|
4762
4795
|
}
|
|
4763
|
-
function
|
|
4796
|
+
function P(e) {
|
|
4764
4797
|
d(e) && (i.value = e, a.value = d(e)?.page.id ?? null);
|
|
4765
4798
|
}
|
|
4766
4799
|
function re(e) {
|
|
4767
4800
|
l.value.some((t) => t.id === e) && (a.value = e);
|
|
4768
4801
|
}
|
|
4769
|
-
function
|
|
4802
|
+
function F(e, r) {
|
|
4770
4803
|
let i = _(e), a = i ? me(i).find((t) => t.id === e) : void 0;
|
|
4771
4804
|
if (!a) return;
|
|
4772
|
-
let s =
|
|
4805
|
+
let s = I({
|
|
4773
4806
|
...a,
|
|
4774
4807
|
...r
|
|
4775
4808
|
});
|
|
@@ -4788,17 +4821,17 @@ function $r(e) {
|
|
|
4788
4821
|
} : t)
|
|
4789
4822
|
}, i.id), Object.assign(a, r, s), i && A(i.id), i && r.name !== void 0 && D(i, r.name), n();
|
|
4790
4823
|
}
|
|
4791
|
-
function
|
|
4824
|
+
function ie() {
|
|
4792
4825
|
i.value = null, a.value = null;
|
|
4793
4826
|
}
|
|
4794
|
-
function
|
|
4827
|
+
function ae(r) {
|
|
4795
4828
|
let i = t.value.pages.find((e) => e.id === r);
|
|
4796
4829
|
if (!i) return;
|
|
4797
4830
|
let a = f(i);
|
|
4798
4831
|
if (!a) return;
|
|
4799
4832
|
let o = a.page.elements.map((n) => {
|
|
4800
|
-
let r =
|
|
4801
|
-
return r.id =
|
|
4833
|
+
let r = xe(n);
|
|
4834
|
+
return r.id = z("el"), ne(t.value, n, r, e.elements ?? M), r;
|
|
4802
4835
|
});
|
|
4803
4836
|
i.elements.unshift(...o), i.background = a.background ?? i.background, i.templateId = we, n();
|
|
4804
4837
|
}
|
|
@@ -4807,37 +4840,37 @@ function $r(e) {
|
|
|
4807
4840
|
applyToPages: ee,
|
|
4808
4841
|
create: b,
|
|
4809
4842
|
createFromPage: C,
|
|
4810
|
-
detach:
|
|
4843
|
+
detach: ae,
|
|
4811
4844
|
editingId: i,
|
|
4812
4845
|
editingPage: u,
|
|
4813
4846
|
editingPages: l,
|
|
4814
4847
|
editingTemplate: c,
|
|
4815
|
-
effectiveBackground:
|
|
4816
|
-
effectiveTemplate:
|
|
4817
|
-
enterEdit:
|
|
4818
|
-
exitEdit:
|
|
4819
|
-
get:
|
|
4820
|
-
getByPage:
|
|
4848
|
+
effectiveBackground: U(() => m),
|
|
4849
|
+
effectiveTemplate: U(() => p),
|
|
4850
|
+
enterEdit: P,
|
|
4851
|
+
exitEdit: ie,
|
|
4852
|
+
get: U(() => d),
|
|
4853
|
+
getByPage: U(() => _),
|
|
4821
4854
|
import: y,
|
|
4822
|
-
isContainer:
|
|
4855
|
+
isContainer: U(() => g),
|
|
4823
4856
|
list: s,
|
|
4824
4857
|
remove: k,
|
|
4825
4858
|
rename: w,
|
|
4826
|
-
resolveFor:
|
|
4859
|
+
resolveFor: U(() => f),
|
|
4827
4860
|
syncPageDimensions: N,
|
|
4828
4861
|
update: T,
|
|
4829
|
-
updatePage:
|
|
4830
|
-
usageCount:
|
|
4862
|
+
updatePage: F,
|
|
4863
|
+
usageCount: U(() => h)
|
|
4831
4864
|
};
|
|
4832
4865
|
})();
|
|
4833
4866
|
}
|
|
4834
4867
|
// src/designer/stores/tutorial-store.ts
|
|
4835
|
-
function
|
|
4836
|
-
return
|
|
4837
|
-
let t =
|
|
4868
|
+
function ri(e) {
|
|
4869
|
+
return H("editor-tutorial", () => {
|
|
4870
|
+
let t = W("idle"), n = W(null), r = W(0), i = Ue([]), a = U(() => {
|
|
4838
4871
|
let e = i.value;
|
|
4839
4872
|
return typeof e == "function" ? e() : e;
|
|
4840
|
-
}), o =
|
|
4873
|
+
}), o = W(!1), s = W(!1), c = W("idle"), l = W(1200), u = U(() => a.value[r.value]), d = W(null), f = U(() => Fn.find((e) => e.id === n.value));
|
|
4841
4874
|
function p() {
|
|
4842
4875
|
t.value !== "running" && t.value !== "finish" && (t.value = "list");
|
|
4843
4876
|
}
|
|
@@ -4845,7 +4878,7 @@ function ei(e) {
|
|
|
4845
4878
|
t.value === "list" && (t.value = "idle");
|
|
4846
4879
|
}
|
|
4847
4880
|
function h(l, u = []) {
|
|
4848
|
-
|
|
4881
|
+
Fn.find((e) => e.id === l) && t.value === "list" && e.beginSession() && (d.value = E(e.view.settings), n.value = l, r.value = 0, i.value = u, o.value = a.value.length > 0, s.value = !1, c.value = "idle", t.value = "running", e.document.rename(Ln(l, "title")), e.ui.closeDialog(), e.view.updateSettings({
|
|
4849
4882
|
previewWithData: !1,
|
|
4850
4883
|
showMargins: !0
|
|
4851
4884
|
}));
|
|
@@ -4857,14 +4890,14 @@ function ei(e) {
|
|
|
4857
4890
|
n >= a.value.length ? _() : r.value = n;
|
|
4858
4891
|
return;
|
|
4859
4892
|
}
|
|
4860
|
-
let i =
|
|
4893
|
+
let i = Xn[n];
|
|
4861
4894
|
i ? (i.apply?.(e, f.value), r.value = n) : _();
|
|
4862
4895
|
}
|
|
4863
4896
|
function _() {
|
|
4864
4897
|
t.value === "running" && (o.value = !1, e.ui.closeDialog(), t.value = "finish");
|
|
4865
4898
|
}
|
|
4866
4899
|
function v(i, c = !1) {
|
|
4867
|
-
t.value !== "running" || !n.value || s.value || !Number.isInteger(i) || i < 0 || i >= a.value.length || i === r.value && !c || (o.value = !1, e.ui.closeDialog(), e.finishSession(!1), e.beginSession() ? (e.document.rename(
|
|
4900
|
+
t.value !== "running" || !n.value || s.value || !Number.isInteger(i) || i < 0 || i >= a.value.length || i === r.value && !c || (o.value = !1, e.ui.closeDialog(), e.finishSession(!1), e.beginSession() ? (e.document.rename(Ln(n.value, "title")), e.view.updateSettings({
|
|
4868
4901
|
previewWithData: !1,
|
|
4869
4902
|
showMargins: !0
|
|
4870
4903
|
}), r.value = i) : y(!1));
|
|
@@ -4884,7 +4917,7 @@ function ei(e) {
|
|
|
4884
4917
|
function C(e) {
|
|
4885
4918
|
l.value = Math.max(200, e);
|
|
4886
4919
|
}
|
|
4887
|
-
return
|
|
4920
|
+
return Be(() => y(!1)), {
|
|
4888
4921
|
close: m,
|
|
4889
4922
|
course: f,
|
|
4890
4923
|
courseId: n,
|
|
@@ -4910,85 +4943,105 @@ function ei(e) {
|
|
|
4910
4943
|
})();
|
|
4911
4944
|
}
|
|
4912
4945
|
// src/designer/stores/ui-store.ts
|
|
4913
|
-
|
|
4914
|
-
|
|
4915
|
-
|
|
4946
|
+
var ii = "print-studio:theme-mode";
|
|
4947
|
+
function ai(e, t) {
|
|
4948
|
+
try {
|
|
4949
|
+
let t = e ? e.get(ii) : localStorage.getItem(ii);
|
|
4950
|
+
return t === "light" || t === "dark" || t === "system" ? t : "dark";
|
|
4951
|
+
} catch (e) {
|
|
4952
|
+
return t(e), "dark";
|
|
4953
|
+
}
|
|
4954
|
+
}
|
|
4955
|
+
function oi(e) {
|
|
4956
|
+
return H("editor-ui", ({ action: t }) => {
|
|
4957
|
+
let n = W(e.persistPreferences === !1 ? "dark" : ai(e.preferenceStorage, e.capturePreferenceError));
|
|
4958
|
+
function r() {
|
|
4959
|
+
n.value = e.persistPreferences === !1 ? "dark" : ai(e.preferenceStorage, e.capturePreferenceError);
|
|
4960
|
+
}
|
|
4961
|
+
function i(t) {
|
|
4962
|
+
if (n.value = t, e.persistPreferences !== !1) try {
|
|
4963
|
+
e.preferenceStorage ? e.preferenceStorage.set(ii, t) : localStorage.setItem(ii, t);
|
|
4964
|
+
} catch (t) {
|
|
4965
|
+
e.capturePreferenceError(t);
|
|
4966
|
+
}
|
|
4967
|
+
}
|
|
4968
|
+
let a = W({
|
|
4916
4969
|
items: [],
|
|
4917
4970
|
open: !1,
|
|
4918
4971
|
x: 0,
|
|
4919
4972
|
y: 0
|
|
4920
|
-
}),
|
|
4921
|
-
function
|
|
4922
|
-
|
|
4973
|
+
}), o = W(null);
|
|
4974
|
+
function s(e) {
|
|
4975
|
+
o.value = {
|
|
4923
4976
|
completed: !1,
|
|
4924
4977
|
format: e,
|
|
4925
4978
|
minimized: !1
|
|
4926
4979
|
};
|
|
4927
4980
|
}
|
|
4928
|
-
function
|
|
4929
|
-
|
|
4981
|
+
function c(e) {
|
|
4982
|
+
o.value && (o.value.minimized = e);
|
|
4930
4983
|
}
|
|
4931
|
-
function
|
|
4932
|
-
|
|
4984
|
+
function l() {
|
|
4985
|
+
o.value && (o.value.completed = !0);
|
|
4933
4986
|
}
|
|
4934
|
-
function
|
|
4935
|
-
|
|
4936
|
-
}
|
|
4937
|
-
let
|
|
4938
|
-
let t =
|
|
4939
|
-
return
|
|
4940
|
-
dialog:
|
|
4941
|
-
elementId:
|
|
4942
|
-
elementIds:
|
|
4943
|
-
id:
|
|
4987
|
+
function u() {
|
|
4988
|
+
o.value = null;
|
|
4989
|
+
}
|
|
4990
|
+
let d = W({ name: null }), f = W([]), p = W(0), m = W(), h = W([]), g = 0, _ = U(() => function(e) {
|
|
4991
|
+
let t = f.value.filter((t) => t.dialog.name === e);
|
|
4992
|
+
return d.value.name === e && t.push({
|
|
4993
|
+
dialog: d.value,
|
|
4994
|
+
elementId: m.value,
|
|
4995
|
+
elementIds: h.value,
|
|
4996
|
+
id: p.value
|
|
4944
4997
|
}), t;
|
|
4945
|
-
}),
|
|
4946
|
-
function
|
|
4947
|
-
|
|
4998
|
+
}), v = W({}), y = W(0), b = W([]), x = /* @__PURE__ */ new Map();
|
|
4999
|
+
function S(e) {
|
|
5000
|
+
y.value += 1, v.value = e;
|
|
4948
5001
|
}
|
|
4949
|
-
|
|
4950
|
-
for (let e of
|
|
4951
|
-
|
|
5002
|
+
Be(() => {
|
|
5003
|
+
for (let e of x.values()) clearTimeout(e);
|
|
5004
|
+
x.clear();
|
|
4952
5005
|
});
|
|
4953
|
-
function
|
|
5006
|
+
function C(e, t = "info") {
|
|
4954
5007
|
let n = Date.now() + Math.random();
|
|
4955
|
-
|
|
5008
|
+
b.value.push({
|
|
4956
5009
|
id: n,
|
|
4957
5010
|
kind: t,
|
|
4958
5011
|
text: e
|
|
4959
|
-
}),
|
|
5012
|
+
}), E(n);
|
|
4960
5013
|
}
|
|
4961
|
-
function
|
|
4962
|
-
clearTimeout(
|
|
5014
|
+
function w(e) {
|
|
5015
|
+
clearTimeout(x.get(e)), x.delete(e);
|
|
4963
5016
|
}
|
|
4964
|
-
function
|
|
4965
|
-
|
|
5017
|
+
function T(e) {
|
|
5018
|
+
w(e), b.value = b.value.filter((t) => t.id !== e);
|
|
4966
5019
|
}
|
|
4967
|
-
function
|
|
4968
|
-
|
|
4969
|
-
let t =
|
|
5020
|
+
function E(e) {
|
|
5021
|
+
w(e);
|
|
5022
|
+
let t = b.value.find((t) => t.id === e);
|
|
4970
5023
|
if (!t) return;
|
|
4971
5024
|
let n = setTimeout(() => {
|
|
4972
|
-
|
|
5025
|
+
T(e);
|
|
4973
5026
|
}, t.kind === "error" ? 8e3 : 5e3);
|
|
4974
|
-
|
|
5027
|
+
x.set(e, n);
|
|
4975
5028
|
}
|
|
4976
|
-
function
|
|
4977
|
-
|
|
4978
|
-
items:
|
|
5029
|
+
function D(e, t, n) {
|
|
5030
|
+
a.value = {
|
|
5031
|
+
items: n,
|
|
4979
5032
|
open: !0,
|
|
4980
5033
|
x: e,
|
|
4981
5034
|
y: t
|
|
4982
5035
|
};
|
|
4983
5036
|
}
|
|
4984
|
-
function
|
|
4985
|
-
|
|
4986
|
-
...
|
|
5037
|
+
function O() {
|
|
5038
|
+
a.value = {
|
|
5039
|
+
...a.value,
|
|
4987
5040
|
open: !1
|
|
4988
5041
|
};
|
|
4989
5042
|
}
|
|
4990
|
-
function
|
|
4991
|
-
|
|
5043
|
+
function k(t, n, r, i, a) {
|
|
5044
|
+
p.value = ++g, m.value = e.getElementId(), h.value = e.getElementIds?.() ?? [], d.value = {
|
|
4992
5045
|
groupId: r,
|
|
4993
5046
|
guideId: i,
|
|
4994
5047
|
name: t,
|
|
@@ -4996,65 +5049,68 @@ function ti(e) {
|
|
|
4996
5049
|
...a
|
|
4997
5050
|
};
|
|
4998
5051
|
}
|
|
4999
|
-
function
|
|
5000
|
-
if (!
|
|
5001
|
-
let e =
|
|
5002
|
-
return
|
|
5003
|
-
dialog: { ...
|
|
5004
|
-
elementId:
|
|
5005
|
-
elementIds:
|
|
5052
|
+
function A() {
|
|
5053
|
+
if (!d.value.name) return;
|
|
5054
|
+
let e = p.value;
|
|
5055
|
+
return f.value.push({
|
|
5056
|
+
dialog: { ...d.value },
|
|
5057
|
+
elementId: m.value,
|
|
5058
|
+
elementIds: h.value,
|
|
5006
5059
|
id: e
|
|
5007
|
-
}),
|
|
5060
|
+
}), d.value = { name: null }, e;
|
|
5008
5061
|
}
|
|
5009
|
-
function
|
|
5010
|
-
let n =
|
|
5062
|
+
function j(t) {
|
|
5063
|
+
let n = f.value.find((e) => e.id === t);
|
|
5011
5064
|
if (!n) return;
|
|
5012
|
-
|
|
5065
|
+
M(t);
|
|
5013
5066
|
let r = e.getElementIds?.() ?? [], i = n.elementId !== e.getElementId() || !(!n.elementIds?.length || n.elementIds.length === r.length && !n.elementIds.some((e) => !r.includes(e)));
|
|
5014
|
-
n.dialog.name === "element" && i || (
|
|
5067
|
+
n.dialog.name === "element" && i || (d.value = n.dialog, m.value = n.elementId, h.value = n.elementIds ?? [], p.value = n.id);
|
|
5015
5068
|
}
|
|
5016
|
-
let
|
|
5017
|
-
|
|
5069
|
+
let M = t((e) => {
|
|
5070
|
+
f.value = f.value.filter((t) => t.id !== e);
|
|
5018
5071
|
}, "discardSuspendedDialog");
|
|
5019
|
-
function
|
|
5020
|
-
|
|
5072
|
+
function N() {
|
|
5073
|
+
f.value = [];
|
|
5021
5074
|
}
|
|
5022
|
-
function
|
|
5023
|
-
|
|
5075
|
+
function ee() {
|
|
5076
|
+
d.value = { name: null }, v.value = {};
|
|
5024
5077
|
}
|
|
5025
5078
|
return {
|
|
5026
|
-
activeDialog:
|
|
5027
|
-
clearSuspendedDialogs:
|
|
5028
|
-
closeContextMenu:
|
|
5029
|
-
closeDialog:
|
|
5030
|
-
completeExportDialog:
|
|
5031
|
-
contextMenu:
|
|
5032
|
-
dialogElementId:
|
|
5033
|
-
dialogSessionId:
|
|
5034
|
-
dialogSessions:
|
|
5035
|
-
discardSuspendedDialog:
|
|
5036
|
-
dismissToast:
|
|
5037
|
-
exportDialog:
|
|
5038
|
-
finishExportDialog:
|
|
5039
|
-
minimizeExportDialog:
|
|
5040
|
-
openContextMenu:
|
|
5041
|
-
openDialog:
|
|
5042
|
-
openExportDialog:
|
|
5043
|
-
pauseToast:
|
|
5044
|
-
restoredState:
|
|
5045
|
-
|
|
5046
|
-
|
|
5047
|
-
|
|
5048
|
-
|
|
5049
|
-
|
|
5050
|
-
|
|
5051
|
-
|
|
5052
|
-
|
|
5079
|
+
activeDialog: d,
|
|
5080
|
+
clearSuspendedDialogs: N,
|
|
5081
|
+
closeContextMenu: O,
|
|
5082
|
+
closeDialog: ee,
|
|
5083
|
+
completeExportDialog: l,
|
|
5084
|
+
contextMenu: a,
|
|
5085
|
+
dialogElementId: m,
|
|
5086
|
+
dialogSessionId: p,
|
|
5087
|
+
dialogSessions: _,
|
|
5088
|
+
discardSuspendedDialog: M,
|
|
5089
|
+
dismissToast: T,
|
|
5090
|
+
exportDialog: o,
|
|
5091
|
+
finishExportDialog: u,
|
|
5092
|
+
minimizeExportDialog: c,
|
|
5093
|
+
openContextMenu: D,
|
|
5094
|
+
openDialog: k,
|
|
5095
|
+
openExportDialog: s,
|
|
5096
|
+
pauseToast: w,
|
|
5097
|
+
restoredState: v,
|
|
5098
|
+
restorePreferences: r,
|
|
5099
|
+
restoreRevision: y,
|
|
5100
|
+
restoreState: S,
|
|
5101
|
+
resumeDialog: j,
|
|
5102
|
+
resumeToast: E,
|
|
5103
|
+
setThemeMode: i,
|
|
5104
|
+
suspendDialog: A,
|
|
5105
|
+
suspendedDialogs: f,
|
|
5106
|
+
themeMode: n,
|
|
5107
|
+
toast: C,
|
|
5108
|
+
toasts: b
|
|
5053
5109
|
};
|
|
5054
5110
|
})();
|
|
5055
5111
|
}
|
|
5056
5112
|
// src/designer/config/canvas-background.ts
|
|
5057
|
-
var
|
|
5113
|
+
var si = [
|
|
5058
5114
|
{
|
|
5059
5115
|
color: "var(--color-canvas)",
|
|
5060
5116
|
id: "default",
|
|
@@ -5090,24 +5146,24 @@ var ni = [
|
|
|
5090
5146
|
return S("designer.canvasBackground.lightGrayLabel");
|
|
5091
5147
|
}
|
|
5092
5148
|
}
|
|
5093
|
-
],
|
|
5094
|
-
function
|
|
5095
|
-
return e === "custom" ||
|
|
5149
|
+
], ci = "#4d4d4d";
|
|
5150
|
+
function li(e) {
|
|
5151
|
+
return e === "custom" || si.some((t) => t.id === e);
|
|
5096
5152
|
}
|
|
5097
5153
|
// src/designer/stores/view-store.ts
|
|
5098
|
-
function
|
|
5099
|
-
return
|
|
5100
|
-
let { layoutMode: t, pageGap: n, pages: r } = G(e.scope), i =
|
|
5154
|
+
function ui(e) {
|
|
5155
|
+
return H("editor-view", () => {
|
|
5156
|
+
let { layoutMode: t, pageGap: n, pages: r } = G(e.scope), i = W(1), a = W("select"), o = W(!1), s = W(null), c = W({
|
|
5101
5157
|
left: 0,
|
|
5102
5158
|
top: 0
|
|
5103
|
-
}), l =
|
|
5159
|
+
}), l = W({
|
|
5104
5160
|
height: 0,
|
|
5105
5161
|
width: 0
|
|
5106
|
-
}), u =
|
|
5162
|
+
}), u = W(null), d = W(null), f = W({
|
|
5107
5163
|
h: [],
|
|
5108
5164
|
pageId: "",
|
|
5109
5165
|
v: []
|
|
5110
|
-
}), p =
|
|
5166
|
+
}), p = Ve({
|
|
5111
5167
|
clickToCreate: !1,
|
|
5112
5168
|
gridSize: 5,
|
|
5113
5169
|
guidesLocked: !1,
|
|
@@ -5121,7 +5177,7 @@ function ai(e) {
|
|
|
5121
5177
|
snapToGrid: !1,
|
|
5122
5178
|
snapToGuides: !0,
|
|
5123
5179
|
snapToMargins: !0
|
|
5124
|
-
}), m =
|
|
5180
|
+
}), m = Ve({
|
|
5125
5181
|
spacing: null,
|
|
5126
5182
|
target: "selection"
|
|
5127
5183
|
});
|
|
@@ -5148,24 +5204,24 @@ function ai(e) {
|
|
|
5148
5204
|
try {
|
|
5149
5205
|
let t = null;
|
|
5150
5206
|
if (e.persistPreferences !== !1 && (t = e.preferenceStorage ? e.preferenceStorage.get(x) : localStorage.getItem(x)), t) {
|
|
5151
|
-
let e = JSON.parse(t), n = typeof e.customColor == "string" && e.customColor.trim() !== "" ? e.customColor.trim() :
|
|
5152
|
-
if (
|
|
5207
|
+
let e = JSON.parse(t), n = typeof e.customColor == "string" && e.customColor.trim() !== "" ? e.customColor.trim() : ci;
|
|
5208
|
+
if (li(e.preset)) return {
|
|
5153
5209
|
customColor: n,
|
|
5154
5210
|
preset: e.preset
|
|
5155
5211
|
};
|
|
5156
5212
|
}
|
|
5157
5213
|
} catch {}
|
|
5158
5214
|
return {
|
|
5159
|
-
customColor:
|
|
5215
|
+
customColor: ci,
|
|
5160
5216
|
preset: "default"
|
|
5161
5217
|
};
|
|
5162
5218
|
}
|
|
5163
|
-
let C =
|
|
5219
|
+
let C = W(S());
|
|
5164
5220
|
function w() {
|
|
5165
5221
|
C.value = S();
|
|
5166
5222
|
}
|
|
5167
|
-
let T =
|
|
5168
|
-
function
|
|
5223
|
+
let T = U(() => C.value.preset), E = U(() => C.value.customColor), O = U(() => C.value.preset === "custom" ? C.value.customColor : si.find((e) => e.id === C.value.preset)?.color ?? "#4d4d4d");
|
|
5224
|
+
function k(t, n) {
|
|
5169
5225
|
if (C.value = {
|
|
5170
5226
|
customColor: t === "custom" ? n ?? C.value.customColor : C.value.customColor,
|
|
5171
5227
|
preset: t
|
|
@@ -5176,7 +5232,7 @@ function ai(e) {
|
|
|
5176
5232
|
} catch {}
|
|
5177
5233
|
}
|
|
5178
5234
|
}
|
|
5179
|
-
let
|
|
5235
|
+
let A = U(() => 96 / 25.4 * i.value), j = U(() => {
|
|
5180
5236
|
let e = r.value, i = t.value ?? p.pageLayoutMode, a = Math.max(...e.map((e) => e.width), 1), o = Math.max(...e.map((e) => e.height), 1);
|
|
5181
5237
|
if (i === "horizontal") {
|
|
5182
5238
|
let t = 500;
|
|
@@ -5209,10 +5265,29 @@ function ai(e) {
|
|
|
5209
5265
|
};
|
|
5210
5266
|
return s += e.height + 15, t;
|
|
5211
5267
|
});
|
|
5212
|
-
}),
|
|
5213
|
-
|
|
5214
|
-
|
|
5215
|
-
|
|
5268
|
+
}), M = U(() => j.value.map((e) => {
|
|
5269
|
+
let t = e.page.position;
|
|
5270
|
+
return t ? {
|
|
5271
|
+
...e,
|
|
5272
|
+
x: t.x,
|
|
5273
|
+
y: t.y
|
|
5274
|
+
} : e;
|
|
5275
|
+
})), N = U(() => new Map(M.value.map((e) => [e.page.id, e]))), ee = U(() => function(e) {
|
|
5276
|
+
return N.value.get(e);
|
|
5277
|
+
}), P = U(() => function(e) {
|
|
5278
|
+
let t = N.value.get(e);
|
|
5279
|
+
return t ? {
|
|
5280
|
+
x: t.x,
|
|
5281
|
+
y: t.y
|
|
5282
|
+
} : void 0;
|
|
5283
|
+
}), te = U(() => function(e, t) {
|
|
5284
|
+
let n = P.value(e);
|
|
5285
|
+
return n ? bn(n, t) : void 0;
|
|
5286
|
+
}), ne = U(() => function(e, t) {
|
|
5287
|
+
let n = P.value(e);
|
|
5288
|
+
return n ? xn(n, t) : void 0;
|
|
5289
|
+
}), re = U(() => {
|
|
5290
|
+
let e = M.value;
|
|
5216
5291
|
if (e.length === 0) return {
|
|
5217
5292
|
height: 1e3,
|
|
5218
5293
|
width: 1e3
|
|
@@ -5222,59 +5297,62 @@ function ai(e) {
|
|
|
5222
5297
|
height: Math.max(...e.map((e) => e.y + e.page.height)) + 500,
|
|
5223
5298
|
width: t + 500
|
|
5224
5299
|
};
|
|
5225
|
-
}),
|
|
5226
|
-
let e =
|
|
5227
|
-
return e.length === 0 ? null :
|
|
5300
|
+
}), F = U(() => {
|
|
5301
|
+
let e = M.value;
|
|
5302
|
+
return e.length === 0 ? null : D(e.map((e) => ({
|
|
5228
5303
|
height: e.page.height,
|
|
5229
5304
|
width: e.page.width,
|
|
5230
5305
|
x: e.x,
|
|
5231
5306
|
y: e.y
|
|
5232
5307
|
})));
|
|
5233
5308
|
});
|
|
5234
|
-
function
|
|
5309
|
+
function I(t) {
|
|
5235
5310
|
a.value = t, t !== "select" && e.selection.setEditingId(null);
|
|
5236
5311
|
}
|
|
5237
|
-
function
|
|
5238
|
-
i.value = L(
|
|
5312
|
+
function ie(e) {
|
|
5313
|
+
i.value = V(L(e, 4), .05, 8);
|
|
5239
5314
|
}
|
|
5240
|
-
function
|
|
5315
|
+
function ae(e) {
|
|
5241
5316
|
u.value = e;
|
|
5242
5317
|
}
|
|
5243
|
-
function
|
|
5318
|
+
function oe(e) {
|
|
5244
5319
|
d.value = e;
|
|
5245
5320
|
}
|
|
5246
|
-
function
|
|
5321
|
+
function se(e) {
|
|
5247
5322
|
f.value = e;
|
|
5248
5323
|
}
|
|
5249
5324
|
return {
|
|
5250
5325
|
activeTool: a,
|
|
5251
5326
|
alignPanel: m,
|
|
5252
|
-
canvasBackground:
|
|
5327
|
+
canvasBackground: O,
|
|
5253
5328
|
canvasBackgroundPreset: T,
|
|
5254
|
-
contentSizeMm:
|
|
5329
|
+
contentSizeMm: re,
|
|
5255
5330
|
cursorContent: s,
|
|
5256
5331
|
customCanvasColor: E,
|
|
5257
5332
|
draggingGuide: d,
|
|
5258
|
-
getLayout:
|
|
5333
|
+
getLayout: ee,
|
|
5259
5334
|
marquee: u,
|
|
5260
|
-
|
|
5261
|
-
|
|
5262
|
-
|
|
5335
|
+
originOf: P,
|
|
5336
|
+
pageLayouts: M,
|
|
5337
|
+
pagesBoundsMm: F,
|
|
5338
|
+
pxPerMm: A,
|
|
5263
5339
|
restorePreferences: w,
|
|
5264
5340
|
scrollPos: c,
|
|
5265
|
-
setCanvasBackground:
|
|
5341
|
+
setCanvasBackground: k,
|
|
5266
5342
|
setCursorContent: v,
|
|
5267
|
-
setDraggingGuide:
|
|
5268
|
-
setMarquee:
|
|
5343
|
+
setDraggingGuide: oe,
|
|
5344
|
+
setMarquee: ae,
|
|
5269
5345
|
setScrollPos: y,
|
|
5270
|
-
setSnapLines:
|
|
5346
|
+
setSnapLines: se,
|
|
5271
5347
|
setSpacePanning: _,
|
|
5272
5348
|
settings: p,
|
|
5273
|
-
setTool:
|
|
5349
|
+
setTool: I,
|
|
5274
5350
|
setViewportSize: b,
|
|
5275
|
-
setZoom:
|
|
5351
|
+
setZoom: ie,
|
|
5276
5352
|
snapLines: f,
|
|
5277
5353
|
spacePanning: o,
|
|
5354
|
+
toGlobal: ne,
|
|
5355
|
+
toLocal: te,
|
|
5278
5356
|
updateAlignPanel: g,
|
|
5279
5357
|
updateSettings: h,
|
|
5280
5358
|
viewportSize: l,
|
|
@@ -5283,19 +5361,19 @@ function ai(e) {
|
|
|
5283
5361
|
})();
|
|
5284
5362
|
}
|
|
5285
5363
|
// src/core/z-index.ts
|
|
5286
|
-
var
|
|
5287
|
-
function
|
|
5364
|
+
var di = 2e3;
|
|
5365
|
+
function fi(e) {
|
|
5288
5366
|
if (!Number.isInteger(e) || e < 0 || e > 2147483647) throw Error(`Invalid z-index: ${e}`);
|
|
5289
5367
|
}
|
|
5290
|
-
function
|
|
5291
|
-
return
|
|
5368
|
+
function pi(e = di) {
|
|
5369
|
+
return fi(e), {
|
|
5292
5370
|
currentZIndex: e,
|
|
5293
5371
|
entries: [],
|
|
5294
5372
|
initialZIndex: e,
|
|
5295
5373
|
sequence: 0
|
|
5296
5374
|
};
|
|
5297
5375
|
}
|
|
5298
|
-
var
|
|
5376
|
+
var mi = class {
|
|
5299
5377
|
state;
|
|
5300
5378
|
get currentZIndex() {
|
|
5301
5379
|
return this.state.currentZIndex;
|
|
@@ -5314,7 +5392,7 @@ var li = class {
|
|
|
5314
5392
|
this.state.entries = this.state.entries.filter((t) => t.id !== e);
|
|
5315
5393
|
}
|
|
5316
5394
|
configure(e) {
|
|
5317
|
-
|
|
5395
|
+
fi(e), this.state.initialZIndex = e, this.state.currentZIndex = Math.max(e, this.currentZIndex);
|
|
5318
5396
|
}
|
|
5319
5397
|
get(e) {
|
|
5320
5398
|
return this.state.entries.find((t) => t.id === e);
|
|
@@ -5325,11 +5403,11 @@ var li = class {
|
|
|
5325
5403
|
}
|
|
5326
5404
|
nextZIndex() {
|
|
5327
5405
|
let e = Math.max(this.initialZIndex, this.currentZIndex) + 1;
|
|
5328
|
-
return
|
|
5406
|
+
return fi(e), this.state.currentZIndex = e, e;
|
|
5329
5407
|
}
|
|
5330
5408
|
open(e = {}) {
|
|
5331
5409
|
let t = e.zIndex ?? this.nextZIndex();
|
|
5332
|
-
|
|
5410
|
+
fi(t), this.state.currentZIndex = Math.max(this.currentZIndex, t);
|
|
5333
5411
|
let n = ++this.state.sequence;
|
|
5334
5412
|
return this.state.entries.push({
|
|
5335
5413
|
id: n,
|
|
@@ -5339,9 +5417,9 @@ var li = class {
|
|
|
5339
5417
|
}
|
|
5340
5418
|
};
|
|
5341
5419
|
// src/designer/stores/z-index-store.ts
|
|
5342
|
-
function
|
|
5343
|
-
return
|
|
5344
|
-
let e =
|
|
5420
|
+
function hi() {
|
|
5421
|
+
return H("editor-z-index", () => {
|
|
5422
|
+
let e = Ve(pi()), t = new mi(e), n = U(() => t.initialZIndex), r = U(() => t.currentZIndex), i = U(() => t.get.bind(t)), a = U(() => t.isTop.bind(t));
|
|
5345
5423
|
function o(e) {
|
|
5346
5424
|
t.configure(e);
|
|
5347
5425
|
}
|
|
@@ -5372,20 +5450,25 @@ function ui() {
|
|
|
5372
5450
|
})();
|
|
5373
5451
|
}
|
|
5374
5452
|
// src/designer/stores/editor-store.ts
|
|
5375
|
-
function
|
|
5376
|
-
return
|
|
5377
|
-
let t =
|
|
5453
|
+
function gi(e = {}) {
|
|
5454
|
+
return H("editor", () => {
|
|
5455
|
+
let t = ir(), n = Zr({
|
|
5378
5456
|
config: t,
|
|
5379
5457
|
elements: e.elements,
|
|
5380
5458
|
parsers: e.parsers
|
|
5381
|
-
}), r =
|
|
5459
|
+
}), r = oi({
|
|
5460
|
+
capturePreferenceError(t) {
|
|
5461
|
+
(e.errors ?? sn()).capture(t, { source: "ui.preferences" });
|
|
5462
|
+
},
|
|
5382
5463
|
getElementId() {
|
|
5383
5464
|
return m.primary?.id;
|
|
5384
5465
|
},
|
|
5385
5466
|
getElementIds() {
|
|
5386
5467
|
return [...m.ids];
|
|
5387
|
-
}
|
|
5388
|
-
|
|
5468
|
+
},
|
|
5469
|
+
persistPreferences: e.persistPreferences,
|
|
5470
|
+
preferenceStorage: e.preferenceStorage
|
|
5471
|
+
}), i = Yr(e.persistPreferences, e.preferenceStorage), a = Xr(), o = hi(), s = vr({
|
|
5389
5472
|
...e,
|
|
5390
5473
|
beginPreviewHistory() {
|
|
5391
5474
|
c.beginPreview();
|
|
@@ -5411,7 +5494,7 @@ function di(e = {}) {
|
|
|
5411
5494
|
O(!0);
|
|
5412
5495
|
},
|
|
5413
5496
|
ui: r
|
|
5414
|
-
}), c =
|
|
5497
|
+
}), c = Fr({
|
|
5415
5498
|
applyLayout() {
|
|
5416
5499
|
l.apply();
|
|
5417
5500
|
},
|
|
@@ -5419,18 +5502,18 @@ function di(e = {}) {
|
|
|
5419
5502
|
resetSession() {
|
|
5420
5503
|
O(!1);
|
|
5421
5504
|
}
|
|
5422
|
-
}), l =
|
|
5505
|
+
}), l = Ir({ document: s }), u = Rr({
|
|
5423
5506
|
document: s,
|
|
5424
5507
|
elements: e.elements,
|
|
5425
5508
|
history: c,
|
|
5426
5509
|
ui: r
|
|
5427
|
-
}), d =
|
|
5510
|
+
}), d = ni({
|
|
5428
5511
|
document: s,
|
|
5429
5512
|
elements: e.elements,
|
|
5430
5513
|
history: c,
|
|
5431
5514
|
page: u,
|
|
5432
5515
|
ui: r
|
|
5433
|
-
}), f =
|
|
5516
|
+
}), f = $r([{
|
|
5434
5517
|
activate: d.activatePage,
|
|
5435
5518
|
resolve() {
|
|
5436
5519
|
if (d.editingTemplate) return {
|
|
@@ -5451,19 +5534,19 @@ function di(e = {}) {
|
|
|
5451
5534
|
};
|
|
5452
5535
|
},
|
|
5453
5536
|
updatePage: u.update
|
|
5454
|
-
}]), p =
|
|
5537
|
+
}]), p = Nr({
|
|
5455
5538
|
history: c,
|
|
5456
5539
|
scope: f
|
|
5457
|
-
}), m =
|
|
5540
|
+
}), m = ti({
|
|
5458
5541
|
document: s,
|
|
5459
5542
|
guide: p,
|
|
5460
5543
|
scope: f
|
|
5461
|
-
}), h =
|
|
5544
|
+
}), h = ui({
|
|
5462
5545
|
persistPreferences: e.persistPreferences,
|
|
5463
5546
|
preferenceStorage: e.preferenceStorage,
|
|
5464
5547
|
scope: f,
|
|
5465
5548
|
selection: m
|
|
5466
|
-
}), g =
|
|
5549
|
+
}), g = jr({
|
|
5467
5550
|
document: s,
|
|
5468
5551
|
elements: e.elements,
|
|
5469
5552
|
history: c,
|
|
@@ -5471,13 +5554,13 @@ function di(e = {}) {
|
|
|
5471
5554
|
scope: f,
|
|
5472
5555
|
selection: m,
|
|
5473
5556
|
ui: r
|
|
5474
|
-
}), _ =
|
|
5557
|
+
}), _ = yr({
|
|
5475
5558
|
document: s,
|
|
5476
5559
|
element: g,
|
|
5477
5560
|
history: c,
|
|
5478
5561
|
scope: f,
|
|
5479
5562
|
selection: m
|
|
5480
|
-
}), v =
|
|
5563
|
+
}), v = rr({
|
|
5481
5564
|
document: s,
|
|
5482
5565
|
element: g,
|
|
5483
5566
|
elements: e.elements,
|
|
@@ -5485,36 +5568,36 @@ function di(e = {}) {
|
|
|
5485
5568
|
scope: f,
|
|
5486
5569
|
selection: m,
|
|
5487
5570
|
ui: r
|
|
5488
|
-
}), y =
|
|
5571
|
+
}), y = ar({
|
|
5489
5572
|
document: s,
|
|
5490
5573
|
history: c
|
|
5491
|
-
}), b =
|
|
5574
|
+
}), b = Mr({
|
|
5492
5575
|
document: s,
|
|
5493
5576
|
history: c,
|
|
5494
5577
|
selection: m,
|
|
5495
5578
|
ui: r
|
|
5496
|
-
}), x =
|
|
5579
|
+
}), x = Qr({
|
|
5497
5580
|
document: s,
|
|
5498
5581
|
element: g,
|
|
5499
5582
|
history: c,
|
|
5500
5583
|
page: u,
|
|
5501
5584
|
selection: m,
|
|
5502
5585
|
ui: r
|
|
5503
|
-
}), C =
|
|
5586
|
+
}), C = Zn({
|
|
5504
5587
|
document: s,
|
|
5505
5588
|
elements: e.elements,
|
|
5506
5589
|
repeatGroup: x,
|
|
5507
5590
|
scope: f,
|
|
5508
5591
|
template: d,
|
|
5509
5592
|
view: h
|
|
5510
|
-
}), w =
|
|
5593
|
+
}), w = Lr({
|
|
5511
5594
|
scope: f,
|
|
5512
5595
|
selection: m,
|
|
5513
5596
|
template: d,
|
|
5514
5597
|
ui: r
|
|
5515
|
-
}), T =
|
|
5598
|
+
}), T = W(null), E = ri({
|
|
5516
5599
|
beginSession() {
|
|
5517
|
-
return s.saving ? (r.toast(S("designer.tutorial.waitForSave")), !1) : (T.value = D(), c.beginTemporary(), s.beginTemporary(
|
|
5600
|
+
return s.saving ? (r.toast(S("designer.tutorial.waitForSave")), !1) : (T.value = D(), c.beginTemporary(), s.beginTemporary(In()), h.setTool("select"), !0);
|
|
5518
5601
|
},
|
|
5519
5602
|
dataSource: y,
|
|
5520
5603
|
document: s,
|
|
@@ -5588,12 +5671,12 @@ function di(e = {}) {
|
|
|
5588
5671
|
view: h,
|
|
5589
5672
|
zIndex: o
|
|
5590
5673
|
};
|
|
5591
|
-
return
|
|
5674
|
+
return Be(() => {
|
|
5592
5675
|
for (let e of Object.values(k)) e.$dispose();
|
|
5593
5676
|
}), k;
|
|
5594
5677
|
});
|
|
5595
5678
|
}
|
|
5596
|
-
var
|
|
5679
|
+
var _i = gi(), vi = class {
|
|
5597
5680
|
providers = /* @__PURE__ */ new Map();
|
|
5598
5681
|
async collect() {
|
|
5599
5682
|
let e = this.list(), t = [], n = [], r = await Promise.all(e.map(async (e) => {
|
|
@@ -5634,33 +5717,33 @@ var fi = di(), pi = class {
|
|
|
5634
5717
|
n < 0 || (t.splice(n, 1), t.length === 0 && this.providers.delete(e.id));
|
|
5635
5718
|
};
|
|
5636
5719
|
}
|
|
5637
|
-
},
|
|
5638
|
-
bindEditorView: () =>
|
|
5639
|
-
disposeEditorView: () =>
|
|
5640
|
-
}),
|
|
5641
|
-
function
|
|
5642
|
-
if (
|
|
5720
|
+
}, yi = /* @__PURE__ */ e({
|
|
5721
|
+
bindEditorView: () => xi,
|
|
5722
|
+
disposeEditorView: () => Si
|
|
5723
|
+
}), bi = /* @__PURE__ */ new WeakMap();
|
|
5724
|
+
function xi(e, t) {
|
|
5725
|
+
if (bi.has(e)) throw Error("A designer is already mounted for this editor context");
|
|
5643
5726
|
let n = e.root;
|
|
5644
|
-
return
|
|
5645
|
-
|
|
5727
|
+
return bi.set(e, t), e.root = t.root, () => {
|
|
5728
|
+
bi.get(e) === t && (bi.delete(e), e.root = n);
|
|
5646
5729
|
};
|
|
5647
5730
|
}
|
|
5648
|
-
function
|
|
5649
|
-
|
|
5731
|
+
function Si(e) {
|
|
5732
|
+
bi.get(e)?.dispose();
|
|
5650
5733
|
}
|
|
5651
5734
|
// src/designer/context/editor-runtime.ts
|
|
5652
|
-
var
|
|
5653
|
-
EditorContextKey: () =>
|
|
5654
|
-
createEditorRuntime: () =>
|
|
5655
|
-
}),
|
|
5656
|
-
function
|
|
5657
|
-
let n =
|
|
5735
|
+
var Ci = /* @__PURE__ */ e({
|
|
5736
|
+
EditorContextKey: () => wi,
|
|
5737
|
+
createEditorRuntime: () => Ti
|
|
5738
|
+
}), wi = Symbol("editor-context");
|
|
5739
|
+
function Ti(e = {}, t) {
|
|
5740
|
+
let n = Re() ? void 0 : Ie(), r = Pe(), i = new Ge(), a = e.errors ?? m(), o = g(), s = new bt(), c = new yn(e.persistPreferences ? e.preferenceStorage ?? {
|
|
5658
5741
|
get: (e) => localStorage.getItem(e),
|
|
5659
5742
|
set: (e, t) => localStorage.setItem(e, t)
|
|
5660
5743
|
} : void 0), l, u;
|
|
5661
5744
|
try {
|
|
5662
5745
|
u = Gt();
|
|
5663
|
-
let n = y(Kt(e)), d =
|
|
5746
|
+
let n = y(Kt(e)), d = gi({
|
|
5664
5747
|
...e,
|
|
5665
5748
|
...n,
|
|
5666
5749
|
errors: a,
|
|
@@ -5668,11 +5751,11 @@ function bi(e = {}, t) {
|
|
|
5668
5751
|
preferenceStorage: c,
|
|
5669
5752
|
storage: e.storage ?? !1
|
|
5670
5753
|
})(r);
|
|
5671
|
-
|
|
5754
|
+
_n(d, n.elements), hn(d, a), On(d), d.config.configure(e);
|
|
5672
5755
|
let f = !1, p = {
|
|
5673
|
-
commands: new
|
|
5756
|
+
commands: new Je(() => p, i),
|
|
5674
5757
|
dispose() {
|
|
5675
|
-
f ||= (
|
|
5758
|
+
f ||= (Si(p), p.plugins.close(), u?.(), o.dispose(), i.offAll(), Fe(r), !0);
|
|
5676
5759
|
},
|
|
5677
5760
|
elements: n.elements,
|
|
5678
5761
|
errors: a,
|
|
@@ -5688,13 +5771,13 @@ function bi(e = {}, t) {
|
|
|
5688
5771
|
},
|
|
5689
5772
|
output: o,
|
|
5690
5773
|
parsers: n.parsers,
|
|
5691
|
-
plugins: new
|
|
5774
|
+
plugins: new nn(() => p, e.pluginPolicy),
|
|
5692
5775
|
preferences: c,
|
|
5693
5776
|
store() {
|
|
5694
5777
|
if (f) throw Error("Designer has been disposed");
|
|
5695
5778
|
return d;
|
|
5696
5779
|
},
|
|
5697
|
-
templateLibrary: new
|
|
5780
|
+
templateLibrary: new vi(),
|
|
5698
5781
|
get use() {
|
|
5699
5782
|
return p.plugins.use.bind(p.plugins);
|
|
5700
5783
|
},
|
|
@@ -5704,38 +5787,38 @@ function bi(e = {}, t) {
|
|
|
5704
5787
|
};
|
|
5705
5788
|
return l = p, _t(p), t?.(p), p;
|
|
5706
5789
|
} catch (e) {
|
|
5707
|
-
throw l ? l.dispose?.() : (u?.(), o.dispose(), i.offAll(),
|
|
5790
|
+
throw l ? l.dispose?.() : (u?.(), o.dispose(), i.offAll(), Fe(r)), e;
|
|
5708
5791
|
} finally {
|
|
5709
|
-
|
|
5792
|
+
Le(n);
|
|
5710
5793
|
}
|
|
5711
5794
|
}
|
|
5712
5795
|
// src/designer/facade/bindings.ts
|
|
5713
|
-
var
|
|
5714
|
-
bindStudioContext: () =>
|
|
5715
|
-
getStudioContext: () =>
|
|
5716
|
-
onStudioDispose: () =>
|
|
5717
|
-
unbindStudioContext: () =>
|
|
5718
|
-
}),
|
|
5719
|
-
function
|
|
5720
|
-
|
|
5721
|
-
let n =
|
|
5722
|
-
return n || (n = /* @__PURE__ */ new Set(),
|
|
5796
|
+
var Ei = /* @__PURE__ */ e({
|
|
5797
|
+
bindStudioContext: () => Ai,
|
|
5798
|
+
getStudioContext: () => ji,
|
|
5799
|
+
onStudioDispose: () => ki,
|
|
5800
|
+
unbindStudioContext: () => Mi
|
|
5801
|
+
}), Di = /* @__PURE__ */ new WeakMap(), Oi = /* @__PURE__ */ new WeakMap();
|
|
5802
|
+
function ki(e, t) {
|
|
5803
|
+
ji(e);
|
|
5804
|
+
let n = Oi.get(e);
|
|
5805
|
+
return n || (n = /* @__PURE__ */ new Set(), Oi.set(e, n)), n.add(t), () => {
|
|
5723
5806
|
n.delete(t);
|
|
5724
5807
|
};
|
|
5725
5808
|
}
|
|
5726
|
-
function
|
|
5727
|
-
|
|
5809
|
+
function Ai(e, t) {
|
|
5810
|
+
Di.set(e, t);
|
|
5728
5811
|
}
|
|
5729
|
-
function
|
|
5730
|
-
let t =
|
|
5812
|
+
function ji(e) {
|
|
5813
|
+
let t = Di.get(e);
|
|
5731
5814
|
if (!t) throw Error("Unknown print studio instance");
|
|
5732
5815
|
return t.store(), t;
|
|
5733
5816
|
}
|
|
5734
|
-
function
|
|
5735
|
-
let t =
|
|
5736
|
-
|
|
5817
|
+
function Mi(e) {
|
|
5818
|
+
let t = Oi.get(e);
|
|
5819
|
+
Oi.delete(e);
|
|
5737
5820
|
for (let e of t ?? []) e();
|
|
5738
|
-
|
|
5821
|
+
Di.delete(e);
|
|
5739
5822
|
}
|
|
5740
5823
|
// src/designer/facade/entities.ts
|
|
5741
5824
|
function Q(e) {
|
|
@@ -5745,7 +5828,7 @@ function Q(e) {
|
|
|
5745
5828
|
function $(e) {
|
|
5746
5829
|
return typeof e == "string" ? e : e.id;
|
|
5747
5830
|
}
|
|
5748
|
-
function
|
|
5831
|
+
function Ni(e) {
|
|
5749
5832
|
let t = !1, n = 0;
|
|
5750
5833
|
function r() {
|
|
5751
5834
|
if (t) throw Error("Print studio facade has been disposed");
|
|
@@ -5777,7 +5860,7 @@ function Oi(e) {
|
|
|
5777
5860
|
store: r
|
|
5778
5861
|
};
|
|
5779
5862
|
}
|
|
5780
|
-
function
|
|
5863
|
+
function Pi(e, t, n) {
|
|
5781
5864
|
function r(t) {
|
|
5782
5865
|
return e.store(), n.list().find((e) => e.id === $(t));
|
|
5783
5866
|
}
|
|
@@ -5824,21 +5907,14 @@ function ki(e, t, n) {
|
|
|
5824
5907
|
};
|
|
5825
5908
|
}
|
|
5826
5909
|
// src/designer/facade/editing.ts
|
|
5827
|
-
|
|
5828
|
-
h: "hcenter",
|
|
5829
|
-
v: "vcenter"
|
|
5830
|
-
};
|
|
5831
|
-
function ji(e) {
|
|
5910
|
+
function Fi(e) {
|
|
5832
5911
|
return {
|
|
5833
5912
|
edit: {
|
|
5834
5913
|
align: (t, n) => e.command("element.align", t, n),
|
|
5835
5914
|
copy: () => e.command("edit.copy"),
|
|
5836
5915
|
cut: () => e.command("edit.cut"),
|
|
5837
5916
|
delete: () => e.command("edit.delete"),
|
|
5838
|
-
distribute: (t, n) =>
|
|
5839
|
-
let r = Ai[t] ?? t;
|
|
5840
|
-
return e.command("element.distribute", r, n);
|
|
5841
|
-
},
|
|
5917
|
+
distribute: (t, n) => e.command("element.distribute", t, n),
|
|
5842
5918
|
distributeSpacing: (t, n) => e.command("element.distributeSpacing", t, n),
|
|
5843
5919
|
duplicate: () => e.command("edit.duplicate"),
|
|
5844
5920
|
nudge: (t, n) => e.command("element.nudge", t, n),
|
|
@@ -5860,13 +5936,13 @@ function ji(e) {
|
|
|
5860
5936
|
};
|
|
5861
5937
|
}
|
|
5862
5938
|
// src/designer/facade/elements.ts
|
|
5863
|
-
function
|
|
5939
|
+
function Ii(e, t, n) {
|
|
5864
5940
|
function r(n) {
|
|
5865
5941
|
let r = $(n);
|
|
5866
5942
|
if (!e.store().element.getByPage(t).some((e) => e.id === r)) throw Error(`Element not found on page ${t}: ${r}`);
|
|
5867
5943
|
return r;
|
|
5868
5944
|
}
|
|
5869
|
-
let i =
|
|
5945
|
+
let i = Pi(e, "element", {
|
|
5870
5946
|
list: () => e.store().element.getByPage(t),
|
|
5871
5947
|
remove: (t) => e.command("element.removeIds", [t]),
|
|
5872
5948
|
update: (t, n) => e.command("element.update", t, n)
|
|
@@ -5927,7 +6003,7 @@ function Mi(e, t, n) {
|
|
|
5927
6003
|
};
|
|
5928
6004
|
}
|
|
5929
6005
|
// src/designer/facade/output.ts
|
|
5930
|
-
function
|
|
6006
|
+
function Li(e) {
|
|
5931
6007
|
function t(t, n, r) {
|
|
5932
6008
|
return e.command("output.html", t, n, r);
|
|
5933
6009
|
}
|
|
@@ -5947,8 +6023,8 @@ function Ni(e) {
|
|
|
5947
6023
|
};
|
|
5948
6024
|
}
|
|
5949
6025
|
// src/designer/facade/pages.ts
|
|
5950
|
-
function
|
|
5951
|
-
let n =
|
|
6026
|
+
function Ri(e, t) {
|
|
6027
|
+
let n = Pi(e, "page", {
|
|
5952
6028
|
list: () => e.store().page.list,
|
|
5953
6029
|
remove: (t) => e.command("page.remove", t),
|
|
5954
6030
|
update: (t, n) => e.command("page.update", t, n)
|
|
@@ -5959,7 +6035,7 @@ function Pi(e, t) {
|
|
|
5959
6035
|
get data() {
|
|
5960
6036
|
return i.data;
|
|
5961
6037
|
},
|
|
5962
|
-
elements:
|
|
6038
|
+
elements: Ii(e, i.id, t),
|
|
5963
6039
|
id: i.id,
|
|
5964
6040
|
remove: i.remove,
|
|
5965
6041
|
update: i.update
|
|
@@ -5992,8 +6068,8 @@ function Pi(e, t) {
|
|
|
5992
6068
|
};
|
|
5993
6069
|
}
|
|
5994
6070
|
// src/designer/facade/state.ts
|
|
5995
|
-
function
|
|
5996
|
-
let n = t.store(), r = /* @__PURE__ */ new Set(), i =
|
|
6071
|
+
function zi(e, t) {
|
|
6072
|
+
let n = t.store(), r = /* @__PURE__ */ new Set(), i = U(() => Object.freeze({
|
|
5997
6073
|
activePageId: n.page.active?.id,
|
|
5998
6074
|
canRedo: n.history.canRedo,
|
|
5999
6075
|
canUndo: n.history.canUndo,
|
|
@@ -6026,12 +6102,12 @@ function Fi(e, t) {
|
|
|
6026
6102
|
};
|
|
6027
6103
|
}
|
|
6028
6104
|
// src/designer/facade/print-studio.ts
|
|
6029
|
-
function
|
|
6030
|
-
let r = !1, i, a = !1, o = !1, s =
|
|
6105
|
+
function Bi(e, t = {}, n) {
|
|
6106
|
+
let r = !1, i, a = !1, o = !1, s = Ni(e), c = zi(e, s), l = t.defaultElementType ?? "text", u = Ri(s, l), d = Pi(s, "template", {
|
|
6031
6107
|
list: () => s.store().template.list,
|
|
6032
6108
|
remove: (e) => s.command("template.remove", e),
|
|
6033
6109
|
update: (e, t) => s.command("template.update", e, t)
|
|
6034
|
-
}), f =
|
|
6110
|
+
}), f = Pi(s, "repeatGroup", {
|
|
6035
6111
|
list: () => s.store().repeatGroup.list,
|
|
6036
6112
|
remove: (e) => s.command("repeatGroup.remove", e),
|
|
6037
6113
|
update: (e, t) => {
|
|
@@ -6047,7 +6123,7 @@ function Ii(e, t = {}, n) {
|
|
|
6047
6123
|
if (t && t.id !== n) throw Error(`Element already belongs to repeat group: ${a}`);
|
|
6048
6124
|
}
|
|
6049
6125
|
}
|
|
6050
|
-
let m =
|
|
6126
|
+
let m = Pi(s, "followBlock", {
|
|
6051
6127
|
list: () => s.store().followBlock.list,
|
|
6052
6128
|
remove: (e) => s.command("followBlock.remove", e),
|
|
6053
6129
|
update: (e, t) => {
|
|
@@ -6067,7 +6143,7 @@ function Ii(e, t = {}, n) {
|
|
|
6067
6143
|
let e = s.store().template.getByPage(i), t = e?.page.id === i ? e.page : e?.evenPage;
|
|
6068
6144
|
return t ? E(t) : void 0;
|
|
6069
6145
|
},
|
|
6070
|
-
elements:
|
|
6146
|
+
elements: Ii(s, i, l),
|
|
6071
6147
|
id: i,
|
|
6072
6148
|
update(e) {
|
|
6073
6149
|
s.run("template.updatePage", () => s.command("template.updatePage", i, E(e)));
|
|
@@ -6092,18 +6168,18 @@ function Ii(e, t = {}, n) {
|
|
|
6092
6168
|
};
|
|
6093
6169
|
}
|
|
6094
6170
|
function _() {
|
|
6095
|
-
r || (r = !0, v(), c.dispose(), s.dispose(),
|
|
6171
|
+
r || (r = !0, v(), c.dispose(), s.dispose(), Mi(x), n?.());
|
|
6096
6172
|
}
|
|
6097
6173
|
function v(e = i) {
|
|
6098
6174
|
!e && a ? o = !0 : (e?.unmount(), i === e && (i = void 0));
|
|
6099
6175
|
}
|
|
6100
6176
|
async function y(e) {
|
|
6101
6177
|
if (r) throw Error("Print studio has been disposed");
|
|
6102
|
-
if (a ||
|
|
6178
|
+
if (a || ji(x).root) throw Error("A designer is already mounted for this studio");
|
|
6103
6179
|
let t = b(e.el);
|
|
6104
6180
|
a = !0;
|
|
6105
6181
|
try {
|
|
6106
|
-
let {
|
|
6182
|
+
let { attachDesigner: n } = await import("./mount-print-designer-DnHTrBE9.js").then((e) => e.n);
|
|
6107
6183
|
if (r) throw Error("Print studio has been disposed");
|
|
6108
6184
|
if (o) throw new DOMException("Designer unmounted before ready", "AbortError");
|
|
6109
6185
|
let s = n(t, {
|
|
@@ -6225,18 +6301,18 @@ function Ii(e, t = {}, n) {
|
|
|
6225
6301
|
},
|
|
6226
6302
|
unmount: () => v(),
|
|
6227
6303
|
use: e.plugins.use.bind(e.plugins),
|
|
6228
|
-
...
|
|
6229
|
-
...
|
|
6304
|
+
...Li(s),
|
|
6305
|
+
...Fi(s)
|
|
6230
6306
|
};
|
|
6231
|
-
return
|
|
6307
|
+
return Ai(x, e), ze(x);
|
|
6232
6308
|
}
|
|
6233
6309
|
// src/studio.ts
|
|
6234
|
-
function
|
|
6235
|
-
let t =
|
|
6310
|
+
function Vi(e = {}) {
|
|
6311
|
+
let t = Ti(e);
|
|
6236
6312
|
try {
|
|
6237
|
-
return
|
|
6313
|
+
return Bi(t, e, () => t.dispose?.());
|
|
6238
6314
|
} catch (e) {
|
|
6239
6315
|
throw t.dispose?.(), e;
|
|
6240
6316
|
}
|
|
6241
6317
|
}
|
|
6242
|
-
export { Ht as A, bt as B,
|
|
6318
|
+
export { Ht as A, bt as B, dn as C, Jt as D, qt as E, Rt as F, Je as G, _t as H, jt as I, qe as K, zt as L, Bt as M, J as N, Yt as O, At as P, Mt as R, vn as S, nn as T, Ye as U, yt as V, Xe as W, Gn as _, ki as a, yn as b, Ci as c, _i as d, si as f, Ln as g, Fn as h, ji as i, Ut as j, Vt as k, yi as l, Vn as m, Bi as n, wi as o, hr as p, Ei as r, Ti as s, Vi as t, vi as u, Dn as v, sn as w, fn as x, Cn as y, Et as z };
|