@guodun/antdv 1.7.6 → 1.7.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.vue.mjs +152 -146
- package/dist/es/components/pro-contract-template-designer/src/DesignerPage.vue.mjs +351 -301
- package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.mjs +939 -914
- package/dist/es/components/pro-contract-template-designer/src/composables/use-auto-pagination.mjs +82 -47
- package/dist/es/components/pro-contract-template-designer/src/composables/use-draft-cache-session.mjs +1 -1
- package/dist/es/components/pro-contract-template-designer/src/composables/use-page-authoring.mjs +22 -21
- package/dist/es/components/pro-contract-template-designer/src/composables/use-template-authoring.mjs +37 -36
- package/dist/es/components/pro-contract-template-designer/src/composables/use-template-designer.mjs +125 -75
- package/dist/es/components/pro-contract-template-designer/src/utils/authoring-search.mjs +34 -13
- package/dist/es/components/pro-contract-template-designer/src/utils/document-outline.mjs +24 -1
- package/dist/es/components/pro-contract-template-designer/src/utils/editor-snapshot-cache.mjs +15 -0
- package/dist/es/index.mjs +21 -21
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/DesignerPage.vue.cjs +2 -2
- package/dist/lib/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/composables/use-auto-pagination.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/composables/use-draft-cache-session.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/composables/use-page-authoring.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-authoring.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-designer.cjs +4 -4
- package/dist/lib/components/pro-contract-template-designer/src/utils/authoring-search.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/utils/document-outline.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/utils/editor-snapshot-cache.cjs +1 -0
- package/dist/lib/index.cjs +1 -1
- package/dist/theme/icon.css +1 -1
- package/dist/theme/index.css +1 -1
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.vue.d.ts +1 -0
- package/dist/types/components/pro-contract-template-designer/src/DesignerPage.vue.d.ts +14 -0
- package/dist/types/components/pro-contract-template-designer/src/composables/use-auto-pagination.d.ts +8 -2
- package/dist/types/components/pro-contract-template-designer/src/composables/use-draft-cache-session.d.ts +1 -1
- package/dist/types/components/pro-contract-template-designer/src/composables/use-template-designer.d.ts +10 -1
- package/dist/types/components/pro-contract-template-designer/src/utils/authoring-search.d.ts +5 -0
- package/dist/types/components/pro-contract-template-designer/src/utils/document-outline.d.ts +6 -0
- package/dist/types/components/pro-contract-template-designer/src/utils/editor-snapshot-cache.d.ts +16 -0
- package/package.json +3 -3
package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CONTRACT_BLOCK_STYLES as e, DEFAULT_CONTRACT_FONT_FAMILY as t, DEFAULT_FONT_SIZE_PRESETS as n, DEFAULT_TEXT_ALIGN_OPTIONS as r, resolveFontFamilyOptions as i } from "./constants.mjs";
|
|
2
2
|
import { collectPageDecorationVariableKeys as a, normalizePageDecorations as o, resolvePageDecorationPreset as ee, resolvePageDecorationValidationPath as te, rewritePageDecorationVariableTokens as ne } from "./utils/page-decorations.mjs";
|
|
3
3
|
import { isContractTemplateFieldType as re } from "./types.mjs";
|
|
4
|
-
import { DEFAULT_ADVANCED_CHOICE_FIELD_TYPES as ie, DEFAULT_BUILTIN_SELECTOR_FIELD_TYPES as ae, DEFAULT_CUSTOM_FIELD_TYPES as oe, DEFAULT_FIELD_STYLE as se, DEFAULT_FIELD_TYPES as s, DEFAULT_PAGE_SIZE as ce, buildTemplatePreviewPages as le, cloneTemplateValue as c,
|
|
4
|
+
import { DEFAULT_ADVANCED_CHOICE_FIELD_TYPES as ie, DEFAULT_BUILTIN_SELECTOR_FIELD_TYPES as ae, DEFAULT_CUSTOM_FIELD_TYPES as oe, DEFAULT_FIELD_STYLE as se, DEFAULT_FIELD_TYPES as s, DEFAULT_PAGE_SIZE as ce, buildTemplatePreviewPages as le, cloneTemplateValue as c, constrainTemplatePageSizes as ue, createBlankPage as de, createBlankTemplate as fe, createDefaultPage as pe, createTemplateBodySync as me, createTemplateVariable as he, exportTemplateValue as ge, getFieldOption as _e, getPageSizeKey as ve, normalizeContractTemplateMaxPages as ye, normalizePageSizeOptions as be, normalizeTemplateValue as xe, resolvePageSize as Se, syncTemplateVariablesWithPages as Ce, validateContractTemplateVariableKey as we, validateTemplateValue as Te } from "./composables/use-template-designer.mjs";
|
|
5
5
|
import { isSafeContractImageUrl as Ee } from "./utils/image-url.mjs";
|
|
6
6
|
import { buildTemplateVariableData as De } from "./utils/template-renderer.mjs";
|
|
7
7
|
import { useFitWidthZoom as Oe } from "./composables/use-fit-width-zoom.mjs";
|
|
@@ -34,7 +34,7 @@ import ht from "./ContractTemplatePageDecorationsStudio.mjs";
|
|
|
34
34
|
import { serializeFingerprint as d } from "./utils/serialize-fingerprint.mjs";
|
|
35
35
|
import { isSameEditorState as gt } from "./utils/editor-state.mjs";
|
|
36
36
|
import { clampContextMenuPosition as _t, clampContextMenuToElement as vt } from "./utils/context-menu-viewport.mjs";
|
|
37
|
-
import { Fragment as yt, Teleport as bt, computed as f, createBlock as
|
|
37
|
+
import { Fragment as yt, Teleport as bt, computed as f, createBlock as p, createCommentVNode as m, createElementBlock as xt, createElementVNode as h, createVNode as g, defineComponent as _, isRef as St, nextTick as v, normalizeClass as Ct, normalizeStyle as wt, onBeforeUnmount as Tt, onMounted as Et, openBlock as y, ref as b, renderList as Dt, toDisplayString as Ot, toRaw as kt, unref as x, useId as At, vShow as jt, watch as S, withCtx as Mt, withDirectives as Nt } from "vue";
|
|
38
38
|
import { Alert as Pt, Modal as Ft, Tooltip as It, message as Lt } from "ant-design-vue";
|
|
39
39
|
import { useElementSize as Rt } from "@vueuse/core";
|
|
40
40
|
import { CompressOutlined as zt, DownOutlined as Bt } from "@ant-design/icons-vue";
|
|
@@ -48,7 +48,7 @@ var Vt = {
|
|
|
48
48
|
}, Ut = ["onClick"], Wt = {
|
|
49
49
|
class: "gd-contract-template-designer__sr-status",
|
|
50
50
|
"aria-live": "polite"
|
|
51
|
-
}, Gt = .5, Kt = 1.5, qt = .1, Jt = 120, Yt = 128, Xt = 108, Zt = 48, Qt = 24, $t = 10, en = 48, tn = 8, nn = /* @__PURE__ */
|
|
51
|
+
}, Gt = .5, Kt = 1.5, qt = .1, Jt = 120, Yt = 128, Xt = 108, Zt = 48, Qt = 24, $t = 10, en = 48, tn = 8, nn = /* @__PURE__ */ _({
|
|
52
52
|
name: "ProContractTemplateDesigner",
|
|
53
53
|
__name: "ProContractTemplateDesigner",
|
|
54
54
|
props: {
|
|
@@ -128,52 +128,52 @@ var Vt = {
|
|
|
128
128
|
"image-error"
|
|
129
129
|
],
|
|
130
130
|
setup(s, { expose: Xe, emit: Ze }) {
|
|
131
|
-
let l = s,
|
|
132
|
-
if (
|
|
133
|
-
if (
|
|
134
|
-
let e = u(
|
|
135
|
-
mn = d(e),
|
|
131
|
+
let l = s, _ = Ze, nn = f(() => ({ height: typeof l.height == "number" ? `${l.height}px` : l.height })), rn = b(), an = b(), on = b(), sn = b(), cn = b(), ln = `gd-contract-template-page-decorations-studio-${At()}`, un = `gd-contract-template-workspace-chrome-${At()}`, dn = b(), fn = b(), pn = b(), mn = "", hn = "", gn = me(), _n = /* @__PURE__ */ new Map(), vn = b(!1), C = f(() => vn.value || Array.isArray(l.files)), yn = ot(l.files, l.modelValue, l.pageSize), bn = nt(yn, l.pageSizeOptions), xn = C.value ? bn.files : yn, Sn = ut(xn, l.activeFileId), w = b(xn), T = b(Sn), Cn = xe((xn.find((e) => e.id === Sn) ?? xn[0])?.template ?? l.modelValue, l.pageSize), E = b(ue(Cn, l.pageSizeOptions));
|
|
132
|
+
if (C.value) {
|
|
133
|
+
if (w.value = lt(w.value, T.value, E.value), d(w.value) !== d(yn)) {
|
|
134
|
+
let e = u(w.value);
|
|
135
|
+
mn = d(e), _("update:files", e), _("files-change", u(e));
|
|
136
136
|
}
|
|
137
|
-
} else l.modelValue && d(
|
|
138
|
-
let
|
|
137
|
+
} else l.modelValue && d(E.value) !== d(Cn) && (hn = d(E.value), _("update:modelValue", c(E.value)), _("change", c(E.value)));
|
|
138
|
+
let D = b(""), O = b(E.value.pages[0]?.id ?? ""), k = b(!1), A = b([]), j = /* @__PURE__ */ new Map(), wn = b(!1), Tn = b(""), En = b(!1), Dn = b(), On = b(), kn = b(""), An = b(!1), jn = b(""), Mn = b(!1), Nn = b({
|
|
139
139
|
values: {},
|
|
140
140
|
variables: []
|
|
141
|
-
}),
|
|
141
|
+
}), M = b(1), N = b(!1), Pn = b(!1), Fn = b(!1), P = b(!1), In = b(!1), Ln = b(), F = b(!1), Rn = b("header"), zn = b(!1), Bn = b({}), Vn = b(""), I = b(!1), L = b(!1), Hn = b(!1), Un = b(!1), Wn = b(!1), Gn = b(!1), Kn = b(!1), qn = b(""), Jn = b(), Yn = b(), Xn = b(""), Zn = b(!1), R = b(), Qn = b(), z = b(), $n = b(), er = b(!1), tr, nr = b(!1), rr, ir = b(!1), ar = b(""), B = b(), or = b(), V = b(), sr = b(), cr = b(), lr = b(), H = b(""), U = b(Qe("idle", "暂无本地草稿")), ur = b({
|
|
142
142
|
rows: 3,
|
|
143
143
|
cols: 3,
|
|
144
144
|
withHeaderRow: !0
|
|
145
|
-
}),
|
|
146
|
-
pages: () =>
|
|
147
|
-
fileId: () =>
|
|
145
|
+
}), dr = /* @__PURE__ */ new WeakSet(), fr = [".gd-contract-template-designer__page-decorations-select-popup", ".gd-contract-template-designer__page-decorations-dropdown-popup"].join(","), pr, mr, hr = !1, gr = !1, _r, W = f(() => l.readonly || l.disabled), { panel: vr, query: yr, replacement: br, matchCase: xr, matches: Sr, currentIndex: Cr, currentMatch: wr, feedback: Tr, highlightQuery: Er, open: Dr, close: Or, navigate: kr, replaceCurrent: Ar, replaceAll: jr, handleKeydown: Mr } = He({
|
|
146
|
+
pages: () => E.value.pages,
|
|
147
|
+
fileId: () => T.value,
|
|
148
148
|
readonly: () => W.value,
|
|
149
149
|
root: () => rn.value,
|
|
150
|
-
pageRefs:
|
|
151
|
-
activatePage:
|
|
150
|
+
pageRefs: j,
|
|
151
|
+
activatePage: Eo,
|
|
152
152
|
beforeOpen: () => {
|
|
153
|
-
$(),
|
|
153
|
+
$(), ms(), P.value = !1;
|
|
154
154
|
},
|
|
155
155
|
focusPanel: () => pn.value?.focusPanel(),
|
|
156
156
|
focusTrigger: (e) => pn.value?.focusTrigger(e)
|
|
157
|
-
}),
|
|
157
|
+
}), Nr = f(() => !!(R.value || vr.value || B.value || V.value || I.value || L.value || zn.value || Hn.value || Un.value || Wn.value || Gn.value || Kn.value)), Pr = f(() => !!l.enableDraftCache && !W.value), Fr = f(() => w.value.find((e) => e.id === T.value) ?? w.value[0]), Ir = f(() => Dn.value ? le(Dn.value) : []), Lr = f(() => (On.value ?? []).map((e) => ({
|
|
158
158
|
file: e,
|
|
159
159
|
pages: le(e.template)
|
|
160
|
-
}))),
|
|
160
|
+
}))), Rr = f(() => Lr.value.find((e) => e.file.id === kn.value) ?? Lr.value[0]), G = f(() => E.value.pages.find((e) => e.id === O.value) ?? E.value.pages[0]), zr = f(() => Se(G.value?.pageSize, E.value.pageSize)), Br = f(() => k.value && A.value.length === 0), Vr = f(() => k.value ? Br.value ? "校验通过,正文变量与变量配置一致" : `发现 ${A.value.length} 个校验问题` : ""), Hr = f(() => {
|
|
161
161
|
let e = G.value?.title || "合同正文";
|
|
162
|
-
return `${
|
|
163
|
-
}),
|
|
162
|
+
return `${C.value && Fr.value ? `${Fr.value.name} · ` : ""}${e} · ${zr.value.label} · 共 ${E.value.pages.length} 页`;
|
|
163
|
+
}), Ur = f(() => ({
|
|
164
164
|
none: "无装饰",
|
|
165
165
|
"page-number": "标准页码",
|
|
166
166
|
"internal-review": "内部审阅",
|
|
167
167
|
draft: "草稿",
|
|
168
168
|
custom: "自定义"
|
|
169
|
-
})[ee(
|
|
170
|
-
let e = o(
|
|
169
|
+
})[ee(E.value.pageDecorations)]), Wr = f(() => {
|
|
170
|
+
let e = o(E.value.pageDecorations);
|
|
171
171
|
return {
|
|
172
172
|
header: e.header.enabled,
|
|
173
173
|
footer: e.footer.enabled,
|
|
174
174
|
watermark: e.watermark.enabled
|
|
175
175
|
};
|
|
176
|
-
}),
|
|
176
|
+
}), Gr = f(() => Object.values(Wr.value).filter(Boolean).length), Kr = f(() => {
|
|
177
177
|
switch (U.value.type) {
|
|
178
178
|
case "saved": return `草稿已缓存 ${$e(U.value.savedAt)}`;
|
|
179
179
|
case "restored": return "已恢复本地草稿";
|
|
@@ -184,23 +184,23 @@ var Vt = {
|
|
|
184
184
|
case "cleared": return "草稿缓存已清理";
|
|
185
185
|
default: return "";
|
|
186
186
|
}
|
|
187
|
-
}),
|
|
187
|
+
}), qr = f(() => ({
|
|
188
188
|
"is-success": U.value.type === "saved" || U.value.type === "restored",
|
|
189
189
|
"is-warning": U.value.type === "too-large",
|
|
190
190
|
"is-error": U.value.type === "unavailable" || U.value.type === "read-failed" || U.value.type === "write-failed"
|
|
191
|
-
})),
|
|
191
|
+
})), Jr = f(() => `${Math.round(M.value * 100)}%`), Yr = f(() => i(l.fontFamilies, l.fontFamilyMode)), Xr = f(() => Yr.value.map((e) => ({
|
|
192
192
|
label: e.label,
|
|
193
193
|
value: e.value
|
|
194
|
-
}))),
|
|
194
|
+
}))), Zr = r, Qr = [...e.map((e) => ({
|
|
195
195
|
label: e.label,
|
|
196
196
|
value: e.format
|
|
197
|
-
}))],
|
|
197
|
+
}))], $r = [{
|
|
198
198
|
label: "实线",
|
|
199
199
|
value: "solid"
|
|
200
200
|
}, {
|
|
201
201
|
label: "虚线",
|
|
202
202
|
value: "dashed"
|
|
203
|
-
}],
|
|
203
|
+
}], ei = [
|
|
204
204
|
{
|
|
205
205
|
label: "完整显示",
|
|
206
206
|
value: "contain"
|
|
@@ -213,10 +213,10 @@ var Vt = {
|
|
|
213
213
|
label: "拉伸填充",
|
|
214
214
|
value: "fill"
|
|
215
215
|
}
|
|
216
|
-
],
|
|
216
|
+
], ti = f(() => be(l.pageSizeOptions)), ni = f(() => ti.value.map((e) => ({
|
|
217
217
|
label: `${e.label} · ${e.width} × ${e.height}`,
|
|
218
218
|
value: ve(e)
|
|
219
|
-
}))),
|
|
219
|
+
}))), ri = f(() => ve(zr.value)), ii = f(() => l.draftCacheKey), K = f(() => E.value.variables.find((e) => e.key === D.value)), ai = f(() => {
|
|
220
220
|
let e = [
|
|
221
221
|
...l.variableTypes,
|
|
222
222
|
...l.showAdvancedChoiceControls ? ie : [],
|
|
@@ -224,56 +224,60 @@ var Vt = {
|
|
|
224
224
|
...l.showCustomControls ? oe : []
|
|
225
225
|
].filter((e) => re(e?.type));
|
|
226
226
|
return Array.from(new Map(e.map((e) => [e.type, e])).values());
|
|
227
|
-
}),
|
|
227
|
+
}), oi = f(() => {
|
|
228
228
|
let e = [...Me.map((e) => je[e]), ...(l.signingLayoutPresets ?? []).filter((e) => !!e?.key)];
|
|
229
229
|
return Array.from(new Map(e.map((e) => [e.key, e])).values());
|
|
230
|
-
}),
|
|
230
|
+
}), si = f(() => ai.value.map((e) => ({
|
|
231
231
|
...e,
|
|
232
232
|
icon: ze(e.type),
|
|
233
233
|
group: e.type === "select" || e.type === "radio" ? "advanced-choice" : e.type.endsWith("-selector") ? "builtin-selector" : e.type === "custom" ? "custom" : "basic"
|
|
234
|
-
}))),
|
|
235
|
-
let e =
|
|
236
|
-
return Array.from(a(
|
|
237
|
-
}), { scheduleAutoPaginate: q } = et({
|
|
238
|
-
templateValue:
|
|
234
|
+
}))), ci = f(() => ye(l.maxPages)), li = f(() => E.value.pages.length >= ci.value), ui = f(() => {
|
|
235
|
+
let e = gn.collectKeys(E.value);
|
|
236
|
+
return Array.from(a(E.value.pageDecorations)).filter((t) => !e.has(t));
|
|
237
|
+
}), { scheduleAutoPaginate: di, scheduleFullPagination: q, resetPagination: fi, disposePagination: pi } = et({
|
|
238
|
+
templateValue: E,
|
|
239
239
|
readonlyState: W,
|
|
240
|
-
isAutoPaginating:
|
|
241
|
-
pendingPaginationPageId:
|
|
242
|
-
activePageId:
|
|
243
|
-
normalizedMaxPages:
|
|
244
|
-
pageRefs:
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
240
|
+
isAutoPaginating: wn,
|
|
241
|
+
pendingPaginationPageId: Tn,
|
|
242
|
+
activePageId: O,
|
|
243
|
+
normalizedMaxPages: ci,
|
|
244
|
+
pageRefs: j,
|
|
245
|
+
applyPagesChange: (e) => {
|
|
246
|
+
E.value = {
|
|
247
|
+
...E.value,
|
|
248
|
+
pages: e
|
|
249
|
+
}, k.value = !1, A.value = [], zi();
|
|
250
|
+
},
|
|
251
|
+
getPageSize: ea,
|
|
252
|
+
notifyPageLimit: na
|
|
253
|
+
}), { saveDraftCache: mi, loadDraftCache: hi, clearDraftCache: gi, restoreDraftCacheIfNeeded: _i, stopDraftCacheTimer: vi, restartDraftCacheTimer: yi, resetDraftFingerprint: bi } = dt({
|
|
254
|
+
draftCacheWritable: Pr,
|
|
255
|
+
multipleFilesMode: C,
|
|
256
|
+
filesValue: w,
|
|
257
|
+
activeFileIdValue: T,
|
|
258
|
+
templateValue: E,
|
|
259
|
+
draftCacheKey: ii,
|
|
256
260
|
draftCacheInterval: () => l.draftCacheInterval,
|
|
257
261
|
draftCacheMaxBytes: () => l.draftCacheMaxBytes,
|
|
258
262
|
pageSize: () => l.pageSize,
|
|
259
263
|
pageSizeOptions: () => l.pageSizeOptions,
|
|
260
264
|
syncActiveFileSnapshot: Y,
|
|
261
|
-
syncPageEditors:
|
|
262
|
-
setActiveFileId:
|
|
265
|
+
syncPageEditors: () => (Ri(), Ii()),
|
|
266
|
+
setActiveFileId: Hi,
|
|
263
267
|
emitFilesChange: X,
|
|
264
268
|
commit: Z,
|
|
265
|
-
updateDraftCacheStatus:
|
|
266
|
-
|
|
267
|
-
activePageId:
|
|
268
|
-
selectedVariableKey:
|
|
269
|
-
}),
|
|
270
|
-
let e =
|
|
269
|
+
updateDraftCacheStatus: Ui,
|
|
270
|
+
scheduleFullPagination: q,
|
|
271
|
+
activePageId: O,
|
|
272
|
+
selectedVariableKey: D
|
|
273
|
+
}), xi = f(() => {
|
|
274
|
+
let e = ar.value.trim().toLowerCase(), t = E.value.variables;
|
|
271
275
|
return e ? t.filter((t) => t.label.toLowerCase().includes(e) || t.key.toLowerCase().includes(e)) : t;
|
|
272
|
-
}),
|
|
276
|
+
}), Si = f(() => Math.max(Zt, zr.value.width - Yt)), Ci = f(() => Math.max(Qt, zr.value.height - Xt)), J = f(() => Bn.value[O.value] ?? ji()), wi = f(() => J.value.hasMixedBlockFormats ? void 0 : J.value.currentHeadingLevel ?? "paragraph"), Ti = f(() => J.value.fontFamily || t), Ei = f(() => J.value.fontSize ?? se.fontSize ?? 14), Di = f(() => J.value.textColor || se.color || "#1f2937"), Oi = f(() => K.value?.style?.fontFamily || se.fontFamily || t), ki = f(() => {
|
|
273
277
|
let e = n.map((e) => ({
|
|
274
278
|
label: `${e}px`,
|
|
275
279
|
value: e
|
|
276
|
-
})), t =
|
|
280
|
+
})), t = Fi(Ei.value), r = Fi(Vn.value), i = /* @__PURE__ */ new Map();
|
|
277
281
|
return r && !n.includes(r) && i.set(r, {
|
|
278
282
|
label: `使用 ${r}px`,
|
|
279
283
|
value: r
|
|
@@ -282,78 +286,86 @@ var Vt = {
|
|
|
282
286
|
value: t
|
|
283
287
|
}), [...Array.from(i.values()), ...e];
|
|
284
288
|
});
|
|
285
|
-
|
|
286
|
-
if (!e ||
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
289
|
+
S(() => l.modelValue, (e) => {
|
|
290
|
+
if (!e || C.value) return;
|
|
291
|
+
if (d(e) === hn) {
|
|
292
|
+
hn = "";
|
|
293
|
+
return;
|
|
294
|
+
}
|
|
295
|
+
let t = xe(e, l.pageSize), n = ue(t, l.pageSizeOptions), r = d(n) !== d(E.value), i = d(n), a = i === hn;
|
|
296
|
+
a && (hn = ""), (r || !a) && (hn = "", fi(), gn.clear(), Li(), E.value = n, w.value = lt(w.value, T.value, n), O.value = n.pages[0]?.id ?? "", D.value = "", q()), d(n) !== d(t) && (hn = i, _("update:modelValue", c(n)), _("change", c(n)));
|
|
297
|
+
}, { deep: !0 }), S(() => l.files, (e) => {
|
|
290
298
|
if (!Array.isArray(e)) return;
|
|
291
|
-
|
|
299
|
+
if (d(e) === mn) {
|
|
300
|
+
mn = "";
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
let t = ot(e, void 0, l.pageSize), n = nt(t, l.pageSizeOptions).files, r = d(n), i = d(w.value);
|
|
292
304
|
r === mn && (mn = "");
|
|
293
|
-
let a = ut(n, l.activeFileId ||
|
|
294
|
-
if (r === i ? a !==
|
|
305
|
+
let a = ut(n, l.activeFileId || T.value);
|
|
306
|
+
if (r === i ? a !== T.value && Hi(a, {
|
|
295
307
|
syncCurrent: !1,
|
|
296
308
|
shouldEmit: !1
|
|
297
|
-
}) : (
|
|
309
|
+
}) : (mn = "", w.value = n, Hi(a, {
|
|
298
310
|
syncCurrent: !1,
|
|
299
311
|
shouldEmit: !1,
|
|
300
312
|
forceRefresh: !0
|
|
301
313
|
})), r !== d(t)) {
|
|
302
314
|
let e = u(n);
|
|
303
|
-
mn = d(e),
|
|
315
|
+
mn = d(e), _("update:files", e), _("files-change", u(e));
|
|
304
316
|
}
|
|
305
|
-
}, { deep: !0 }),
|
|
306
|
-
!
|
|
317
|
+
}, { deep: !0 }), S(() => l.activeFileId, (e) => {
|
|
318
|
+
!C.value || !e || e === T.value || Hi(e, {
|
|
307
319
|
syncCurrent: !0,
|
|
308
320
|
shouldEmit: !1
|
|
309
321
|
});
|
|
310
322
|
});
|
|
311
|
-
function
|
|
312
|
-
let n = d(
|
|
323
|
+
function Ai(e, t) {
|
|
324
|
+
let n = d(w.value);
|
|
313
325
|
Y(!1);
|
|
314
|
-
let { files: r } = nt(ot(
|
|
315
|
-
return a && d(a.template) !== d(
|
|
326
|
+
let { files: r } = nt(ot(w.value, void 0, e), t), i = d(r) !== n, a = r.find((e) => e.id === T.value);
|
|
327
|
+
return a && d(a.template) !== d(E.value) && (E.value = c(a.template)), i && (k.value = !1, A.value = [], X(r, "")), i;
|
|
316
328
|
}
|
|
317
|
-
|
|
318
|
-
if (
|
|
319
|
-
|
|
329
|
+
S([() => l.pageSize, () => l.pageSizeOptions], ([e, t]) => {
|
|
330
|
+
if (C.value) {
|
|
331
|
+
Ai(e, t), q();
|
|
320
332
|
return;
|
|
321
333
|
}
|
|
322
|
-
let n =
|
|
323
|
-
d(n) !== d(
|
|
324
|
-
}, { deep: !0 }),
|
|
325
|
-
q(
|
|
326
|
-
}),
|
|
327
|
-
e
|
|
328
|
-
}),
|
|
334
|
+
let n = ue(xe(E.value, e), t);
|
|
335
|
+
d(n) !== d(E.value) && Z(n), q();
|
|
336
|
+
}, { deep: !0 }), S(ci, () => {
|
|
337
|
+
q();
|
|
338
|
+
}), S(W, (e) => {
|
|
339
|
+
e ? ($(), I.value = !1, L.value = !1) : q();
|
|
340
|
+
}), S(O, () => {
|
|
329
341
|
z.value = void 0;
|
|
330
|
-
}),
|
|
331
|
-
|
|
342
|
+
}), S([
|
|
343
|
+
Nr,
|
|
332
344
|
F,
|
|
333
|
-
|
|
345
|
+
En
|
|
334
346
|
], () => {
|
|
335
|
-
|
|
336
|
-
}),
|
|
347
|
+
_s();
|
|
348
|
+
}), S(() => [
|
|
337
349
|
l.enableDraftCache,
|
|
338
|
-
|
|
350
|
+
ii.value,
|
|
339
351
|
l.draftCacheInterval,
|
|
340
352
|
W.value
|
|
341
353
|
], () => {
|
|
342
|
-
|
|
343
|
-
}),
|
|
354
|
+
bi(), yi();
|
|
355
|
+
}), S(N, (e) => {
|
|
344
356
|
if (!(typeof document > "u")) {
|
|
345
357
|
if (e) {
|
|
346
|
-
|
|
358
|
+
pr = document.body.style.overflow, document.body.style.overflow = "hidden";
|
|
347
359
|
return;
|
|
348
360
|
}
|
|
349
|
-
document.body.style.overflow =
|
|
361
|
+
document.body.style.overflow = pr ?? "", pr = void 0;
|
|
350
362
|
}
|
|
351
|
-
}), Dt(() => {
|
|
352
|
-
di(), pi(), q(D.value), window.addEventListener("pointerdown", ys, !0), window.addEventListener("pointerup", gs), window.addEventListener("keydown", Ss, !0), window.addEventListener("keydown", Cs), window.addEventListener("resize", _s), window.addEventListener("scroll", bs, !0);
|
|
353
363
|
}), Et(() => {
|
|
354
|
-
|
|
364
|
+
_i(), yi(), q(), document.fonts?.ready.then(q), document.fonts?.addEventListener("loadingdone", q), window.addEventListener("pointerdown", Ts, !0), window.addEventListener("pointerup", Ss), window.addEventListener("keydown", Os, !0), window.addEventListener("keydown", ks), window.addEventListener("resize", Cs), window.addEventListener("scroll", Es, !0);
|
|
365
|
+
}), Tt(() => {
|
|
366
|
+
pi(), Ri(), hr = !0, N.value && typeof document < "u" && (document.body.style.overflow = pr ?? ""), document.fonts?.removeEventListener("loadingdone", q), window.removeEventListener("pointerdown", Ts, !0), window.removeEventListener("pointerup", Ss), window.removeEventListener("keydown", Os, !0), window.removeEventListener("keydown", ks), window.removeEventListener("resize", Cs), window.removeEventListener("scroll", Es, !0), rr !== void 0 && cancelAnimationFrame(rr), vi();
|
|
355
367
|
});
|
|
356
|
-
function
|
|
368
|
+
function ji() {
|
|
357
369
|
return {
|
|
358
370
|
isFocused: !1,
|
|
359
371
|
canUndo: !1,
|
|
@@ -372,235 +384,243 @@ var Vt = {
|
|
|
372
384
|
hasMixedBlockFormats: !1
|
|
373
385
|
};
|
|
374
386
|
}
|
|
375
|
-
function
|
|
387
|
+
function Mi(e) {
|
|
376
388
|
return e === "left" || e === "center" || e === "right";
|
|
377
389
|
}
|
|
378
|
-
function
|
|
390
|
+
function Ni(e) {
|
|
379
391
|
return typeof e == "number" && Number.isInteger(e) && e >= 1 && e <= 6;
|
|
380
392
|
}
|
|
381
|
-
function
|
|
393
|
+
function Pi(e, t = Ei.value) {
|
|
382
394
|
let n = Number(e);
|
|
383
395
|
return Number.isFinite(n) ? Math.min(en, Math.max($t, Math.round(n))) : t;
|
|
384
396
|
}
|
|
385
|
-
function
|
|
397
|
+
function Fi(e) {
|
|
386
398
|
let t = String(e || "").trim().match(/(\d+(\.\d+)?)/);
|
|
387
399
|
if (!t) return;
|
|
388
400
|
let n = Number(t[1]);
|
|
389
401
|
if (Number.isFinite(n)) return Math.min(en, Math.max($t, Math.round(n)));
|
|
390
402
|
}
|
|
391
|
-
function
|
|
392
|
-
|
|
403
|
+
function Ii(e = E.value) {
|
|
404
|
+
let t = !1, n = e.pages.map((e) => {
|
|
405
|
+
let n = j.get(e.id)?.getContentSnapshot(e), r = n?.contentHtml ?? e.contentHtml, i = n?.contentJson ?? e.contentJson;
|
|
406
|
+
return r === e.contentHtml && kt(i) === kt(e.contentJson) ? e : (t = !0, {
|
|
407
|
+
...e,
|
|
408
|
+
contentHtml: r,
|
|
409
|
+
contentJson: i
|
|
410
|
+
});
|
|
411
|
+
});
|
|
412
|
+
return t ? {
|
|
393
413
|
...e,
|
|
394
|
-
pages:
|
|
395
|
-
|
|
396
|
-
return {
|
|
397
|
-
...e,
|
|
398
|
-
contentHtml: t?.getHTML() ?? e.contentHtml,
|
|
399
|
-
contentJson: t?.getJSON() ?? e.contentJson
|
|
400
|
-
};
|
|
401
|
-
})
|
|
402
|
-
};
|
|
403
|
-
}
|
|
404
|
-
function ji() {
|
|
405
|
-
pr = !1, mr &&= (clearTimeout(mr), void 0);
|
|
414
|
+
pages: n
|
|
415
|
+
} : e;
|
|
406
416
|
}
|
|
407
|
-
function
|
|
408
|
-
|
|
409
|
-
ji(), e && Fi();
|
|
417
|
+
function Li() {
|
|
418
|
+
gr = !1, _r &&= (clearTimeout(_r), void 0);
|
|
410
419
|
}
|
|
411
|
-
function
|
|
412
|
-
|
|
413
|
-
|
|
420
|
+
function Ri() {
|
|
421
|
+
let e = gr;
|
|
422
|
+
Li(), e && Vi();
|
|
423
|
+
}
|
|
424
|
+
function zi() {
|
|
425
|
+
gr = !0, _r && clearTimeout(_r), _r = setTimeout(() => {
|
|
426
|
+
if (_r = void 0, !(!gr || hr)) {
|
|
427
|
+
if (wn.value) {
|
|
428
|
+
zi();
|
|
429
|
+
return;
|
|
430
|
+
}
|
|
431
|
+
gr = !1, Vi();
|
|
432
|
+
}
|
|
414
433
|
}, Jt);
|
|
415
434
|
}
|
|
416
|
-
function
|
|
417
|
-
let t =
|
|
435
|
+
function Bi(e) {
|
|
436
|
+
let t = E.value.pages, n = t.findIndex((t) => t.id === e.id);
|
|
418
437
|
if (n < 0) return;
|
|
419
438
|
let r = t[n];
|
|
420
439
|
if (r.contentHtml === e.contentHtml && r.contentJson === e.contentJson && r.title === e.title && r.pageSize === e.pageSize) return;
|
|
421
440
|
let i = t.slice();
|
|
422
|
-
i[n] = e,
|
|
423
|
-
...
|
|
441
|
+
i[n] = e, E.value = {
|
|
442
|
+
...E.value,
|
|
424
443
|
pages: i
|
|
425
444
|
};
|
|
426
445
|
}
|
|
427
|
-
function
|
|
428
|
-
let e =
|
|
429
|
-
|
|
446
|
+
function Vi() {
|
|
447
|
+
let e = Ii(), t = gn.sync(e);
|
|
448
|
+
D.value && !t.variables.some((e) => e.key === D.value) && (D.value = ""), Z(t, { normalizedBody: !0 });
|
|
430
449
|
}
|
|
431
450
|
function Y(e = !1) {
|
|
432
|
-
|
|
433
|
-
let t = c(
|
|
434
|
-
if (!
|
|
435
|
-
let n =
|
|
436
|
-
return
|
|
437
|
-
}
|
|
438
|
-
function X(e, t =
|
|
439
|
-
if (!
|
|
451
|
+
Ri();
|
|
452
|
+
let t = c(Ii());
|
|
453
|
+
if (!C.value) return t;
|
|
454
|
+
let n = w.value.find((e) => e.id === T.value)?.template, r = d(n) !== d(t), i = lt(w.value, T.value, t);
|
|
455
|
+
return w.value = i, r && e && X(i), t;
|
|
456
|
+
}
|
|
457
|
+
function X(e, t = T.value) {
|
|
458
|
+
if (!C.value) return;
|
|
440
459
|
let n = u(e);
|
|
441
|
-
|
|
460
|
+
w.value = n, mn = d(n), _("update:files", u(n)), _("files-change", u(n));
|
|
442
461
|
let r = n.find((e) => e.id === t);
|
|
443
|
-
r &&
|
|
444
|
-
}
|
|
445
|
-
function
|
|
446
|
-
let { syncCurrent: n, shouldEmit: r, forceRefresh: i } = tt(t), a = ut(
|
|
447
|
-
if (n ? Y(!0) :
|
|
448
|
-
let ee =
|
|
449
|
-
ee && (
|
|
450
|
-
q(
|
|
462
|
+
r && _("file-change", u([r])[0]);
|
|
463
|
+
}
|
|
464
|
+
function Hi(e, t = {}) {
|
|
465
|
+
let { syncCurrent: n, shouldEmit: r, forceRefresh: i } = tt(t), a = ut(w.value, e), o = a !== T.value;
|
|
466
|
+
if (n ? Y(!0) : Li(), !o && !i) return;
|
|
467
|
+
let ee = w.value.find((e) => e.id === a);
|
|
468
|
+
ee && (T.value = a, E.value = c(ee.template), D.value = "", O.value = E.value.pages[0]?.id ?? "", Bn.value = {}, j.clear(), gn.clear(), _n.clear(), fi(), k.value = !1, A.value = [], En.value = !1, Dn.value = void 0, On.value = void 0, bi(), r && o && _("update:activeFileId", a), n && o && Pr.value && mi(), v(() => {
|
|
469
|
+
q();
|
|
451
470
|
}));
|
|
452
471
|
}
|
|
453
|
-
function Z(e) {
|
|
454
|
-
|
|
455
|
-
let
|
|
456
|
-
return
|
|
472
|
+
function Z(e, t = {}) {
|
|
473
|
+
Li();
|
|
474
|
+
let n = t.normalizedBody ? e : ue(xe(e, l.pageSize), l.pageSizeOptions);
|
|
475
|
+
return t.normalizedBody || (gn.clear(), _n.clear()), E.value = n, k.value = !1, A.value = [], C.value ? X(lt(w.value, T.value, n)) : (w.value = lt(w.value, T.value, n), hn = d(n), _("update:modelValue", c(n)), _("change", c(n))), n;
|
|
457
476
|
}
|
|
458
|
-
function
|
|
459
|
-
U.value = e, t &&
|
|
477
|
+
function Ui(e, t = e.type !== "unchanged") {
|
|
478
|
+
U.value = e, t && _("draft-cache-change", { ...e });
|
|
460
479
|
}
|
|
461
|
-
function
|
|
480
|
+
function Wi() {
|
|
462
481
|
return { ...U.value };
|
|
463
482
|
}
|
|
464
|
-
function
|
|
465
|
-
t ?
|
|
483
|
+
function Gi(e, t) {
|
|
484
|
+
t ? j.set(e, t) : j.delete(e);
|
|
466
485
|
}
|
|
467
|
-
function
|
|
468
|
-
$(),
|
|
486
|
+
function Ki(e) {
|
|
487
|
+
$(), Wn.value = !1, Q({
|
|
469
488
|
type: "insert-signing-layout",
|
|
470
489
|
preset: Ne(e.key) ? e.key : void 0,
|
|
471
490
|
options: e.options
|
|
472
491
|
});
|
|
473
492
|
}
|
|
474
|
-
function
|
|
493
|
+
function qi(e) {
|
|
475
494
|
$(), Q({
|
|
476
495
|
type: "insert-signing-layout",
|
|
477
496
|
options: e
|
|
478
497
|
});
|
|
479
498
|
}
|
|
480
|
-
function
|
|
481
|
-
|
|
499
|
+
function Ji() {
|
|
500
|
+
Wn.value = !1, Kn.value = !0;
|
|
482
501
|
}
|
|
483
|
-
function
|
|
484
|
-
$(),
|
|
502
|
+
function Yi(e) {
|
|
503
|
+
$(), Gn.value = !1, Q({
|
|
485
504
|
type: "insert-signing-mark",
|
|
486
505
|
mark: { markType: e }
|
|
487
506
|
});
|
|
488
507
|
}
|
|
489
|
-
function Q(e, t = G.value?.id ??
|
|
490
|
-
W.value ||
|
|
508
|
+
function Q(e, t = G.value?.id ?? O.value) {
|
|
509
|
+
W.value || j.get(t)?.runCommand(e);
|
|
491
510
|
}
|
|
492
|
-
function
|
|
511
|
+
function Xi(e) {
|
|
493
512
|
Q(e), $();
|
|
494
513
|
}
|
|
495
|
-
function
|
|
514
|
+
function Zi(e) {
|
|
496
515
|
let t = R.value?.pageId;
|
|
497
|
-
t && (
|
|
516
|
+
t && (j.get(t)?.focus(), H.value = typeof document < "u" && document.execCommand(e) ? `${e === "copy" ? "已复制" : e === "cut" ? "已剪切" : "已粘贴"}` : "浏览器未授权剪贴板操作,请使用系统快捷键。", $());
|
|
498
517
|
}
|
|
499
|
-
function
|
|
518
|
+
function Qi(e) {
|
|
500
519
|
let t = Z(Ce(e));
|
|
501
|
-
return
|
|
520
|
+
return D.value && !t.variables.some((e) => e.key === D.value) && (D.value = ""), t;
|
|
502
521
|
}
|
|
503
|
-
function
|
|
504
|
-
|
|
522
|
+
function $i(e) {
|
|
523
|
+
Bi(e), zi(), di(e.id);
|
|
505
524
|
}
|
|
506
|
-
function
|
|
507
|
-
|
|
525
|
+
function ea(e) {
|
|
526
|
+
let t = Se(e?.pageSize, E.value.pageSize), n = `${ve(t)}:${t.label ?? ""}`;
|
|
527
|
+
return _n.get(n) || (_n.set(n, t), t);
|
|
508
528
|
}
|
|
509
|
-
function
|
|
529
|
+
function ta(e) {
|
|
510
530
|
if (W.value || !G.value) return;
|
|
511
|
-
let t =
|
|
531
|
+
let t = ti.value.find((t) => ve(t) === e);
|
|
512
532
|
if (!t) return;
|
|
513
|
-
let n = G.value.id, r = Se(t,
|
|
533
|
+
let n = G.value.id, r = Se(t, E.value.pageSize);
|
|
514
534
|
Z({
|
|
515
|
-
...
|
|
516
|
-
pages:
|
|
535
|
+
...E.value,
|
|
536
|
+
pages: E.value.pages.map((e) => e.id === n ? {
|
|
517
537
|
...e,
|
|
518
538
|
pageSize: r
|
|
519
539
|
} : e)
|
|
520
|
-
}),
|
|
540
|
+
}), di(n);
|
|
521
541
|
}
|
|
522
|
-
function
|
|
523
|
-
let t =
|
|
524
|
-
H.value = `合同最多支持 ${t} 页`,
|
|
542
|
+
function na(e) {
|
|
543
|
+
let t = ci.value;
|
|
544
|
+
H.value = `合同最多支持 ${t} 页`, _("page-limit", t, e);
|
|
525
545
|
}
|
|
526
|
-
function
|
|
546
|
+
function ra() {
|
|
527
547
|
if (W.value) return;
|
|
528
|
-
if (
|
|
529
|
-
|
|
548
|
+
if (li.value) {
|
|
549
|
+
na("add");
|
|
530
550
|
return;
|
|
531
551
|
}
|
|
532
|
-
let e =
|
|
552
|
+
let e = pe(E.value.pages.length + 1, zr.value);
|
|
533
553
|
Z({
|
|
534
|
-
...
|
|
535
|
-
pages: [...
|
|
536
|
-
}),
|
|
554
|
+
...E.value,
|
|
555
|
+
pages: [...E.value.pages, e]
|
|
556
|
+
}), O.value = e.id, q();
|
|
537
557
|
}
|
|
538
|
-
function
|
|
558
|
+
function ia(e) {
|
|
539
559
|
if (W.value) return;
|
|
540
|
-
if (
|
|
541
|
-
|
|
560
|
+
if (li.value) {
|
|
561
|
+
na("duplicate");
|
|
542
562
|
return;
|
|
543
563
|
}
|
|
544
|
-
let t =
|
|
564
|
+
let t = E.value.pages.findIndex((t) => t.id === e.id);
|
|
545
565
|
if (t < 0) return;
|
|
546
566
|
let n = c({
|
|
547
567
|
pages: [e],
|
|
548
568
|
variables: [],
|
|
549
|
-
pageSize:
|
|
550
|
-
}).pages[0], r =
|
|
569
|
+
pageSize: E.value.pageSize
|
|
570
|
+
}).pages[0], r = de(t + 2, ea(e), n.contentHtml, n.contentJson);
|
|
551
571
|
r.title = `${e.title || `第 ${t + 1} 页`}副本`;
|
|
552
|
-
let i = [...
|
|
572
|
+
let i = [...E.value.pages];
|
|
553
573
|
i.splice(t + 1, 0, r), Z({
|
|
554
|
-
...
|
|
574
|
+
...E.value,
|
|
555
575
|
pages: i
|
|
556
|
-
}),
|
|
576
|
+
}), O.value = r.id, q();
|
|
557
577
|
}
|
|
558
|
-
function
|
|
559
|
-
if (W.value ||
|
|
560
|
-
let t =
|
|
578
|
+
function aa(e) {
|
|
579
|
+
if (W.value || E.value.pages.length <= 1) return;
|
|
580
|
+
let t = E.value.pages.findIndex((t) => t.id === e.id);
|
|
561
581
|
if (t < 0) return;
|
|
562
|
-
let n =
|
|
563
|
-
...
|
|
582
|
+
let n = E.value.pages.filter((t) => t.id !== e.id), r = Qi({
|
|
583
|
+
...E.value,
|
|
564
584
|
pages: n
|
|
565
585
|
});
|
|
566
|
-
|
|
586
|
+
O.value = r.pages[Math.min(t, r.pages.length - 1)]?.id ?? "", q();
|
|
567
587
|
}
|
|
568
|
-
function
|
|
569
|
-
W.value ||
|
|
588
|
+
function oa(e) {
|
|
589
|
+
W.value || E.value.pages.length <= 1 || Ft.confirm({
|
|
570
590
|
title: "删除合同页面",
|
|
571
591
|
content: "删除页面会同时移除页面正文,是否继续?",
|
|
572
592
|
okText: "确认删除",
|
|
573
593
|
okType: "danger",
|
|
574
594
|
cancelText: "取消",
|
|
575
595
|
onOk: () => {
|
|
576
|
-
|
|
596
|
+
aa(e);
|
|
577
597
|
}
|
|
578
598
|
});
|
|
579
599
|
}
|
|
580
|
-
function
|
|
581
|
-
let t = new Set(
|
|
600
|
+
function sa(e) {
|
|
601
|
+
let t = new Set(E.value.variables.map((e) => e.key)), n = 1;
|
|
582
602
|
for (; t.has(`${e}_${n}`);) n += 1;
|
|
583
603
|
return `${e}_${n}`;
|
|
584
604
|
}
|
|
585
|
-
function
|
|
605
|
+
function ca(e) {
|
|
586
606
|
let t = e.type ?? "text";
|
|
587
607
|
return he({
|
|
588
608
|
...e,
|
|
589
609
|
type: t,
|
|
590
|
-
key: e.key ||
|
|
591
|
-
label: e.label || _e(t,
|
|
592
|
-
},
|
|
610
|
+
key: e.key || sa(t),
|
|
611
|
+
label: e.label || _e(t, ai.value).label
|
|
612
|
+
}, ai.value, l.defaultVariableStyle);
|
|
593
613
|
}
|
|
594
|
-
function
|
|
614
|
+
function la(e, t = G.value?.id ?? E.value.pages[0].id, n) {
|
|
595
615
|
if (W.value) return e;
|
|
596
|
-
let r =
|
|
616
|
+
let r = j.get(t)?.insertVariable(e, n), i = !E.value.variables.some((t) => t.key === e.key);
|
|
597
617
|
return Z({
|
|
598
|
-
...
|
|
599
|
-
pages: r ?
|
|
600
|
-
variables: i ? [...
|
|
601
|
-
}),
|
|
618
|
+
...E.value,
|
|
619
|
+
pages: r ? E.value.pages.map((e) => e.id === r.id ? r : e) : E.value.pages,
|
|
620
|
+
variables: i ? [...E.value.variables, e] : E.value.variables
|
|
621
|
+
}), D.value = e.key, O.value = t, i && _("variable-add", e), di(t), e;
|
|
602
622
|
}
|
|
603
|
-
function
|
|
623
|
+
function ua(e) {
|
|
604
624
|
let { width: t, height: n, ...r } = e, i = ke(t), a = ke(n);
|
|
605
625
|
return {
|
|
606
626
|
...r,
|
|
@@ -608,101 +628,101 @@ var Vt = {
|
|
|
608
628
|
...a === void 0 ? {} : { height: a }
|
|
609
629
|
};
|
|
610
630
|
}
|
|
611
|
-
function
|
|
612
|
-
let t = ke(
|
|
631
|
+
function da(e = {}) {
|
|
632
|
+
let t = ke(Jn.value), n = ke(Yn.value);
|
|
613
633
|
return {
|
|
614
634
|
...e,
|
|
615
635
|
...t === void 0 ? {} : { width: t },
|
|
616
636
|
...n === void 0 ? {} : { height: n }
|
|
617
637
|
};
|
|
618
638
|
}
|
|
619
|
-
function
|
|
620
|
-
|
|
639
|
+
function fa() {
|
|
640
|
+
qn.value = "", Jn.value = void 0, Yn.value = void 0, Xn.value = "";
|
|
621
641
|
}
|
|
622
|
-
function
|
|
623
|
-
let r =
|
|
642
|
+
function pa(e, t = G.value?.id ?? E.value.pages[0]?.id, n) {
|
|
643
|
+
let r = ua({
|
|
624
644
|
...e,
|
|
625
645
|
src: e.src.trim()
|
|
626
646
|
});
|
|
627
|
-
if (!(W.value || !t || !Ee(r.src) || !r.src || !
|
|
647
|
+
if (!(W.value || !t || !Ee(r.src) || !r.src || !j.get(t)?.insertContentImage(r, n))) return O.value = t, D.value = "", r.src;
|
|
628
648
|
}
|
|
629
|
-
function
|
|
649
|
+
function ma(e) {
|
|
630
650
|
return e instanceof Error ? e : /* @__PURE__ */ Error("图片处理失败");
|
|
631
651
|
}
|
|
632
|
-
async function
|
|
633
|
-
t === "toolbar" && (
|
|
652
|
+
async function ha(e, t) {
|
|
653
|
+
t === "toolbar" && (Zn.value = !0, Xn.value = "");
|
|
634
654
|
try {
|
|
635
655
|
let n = await Ae(e, {
|
|
636
656
|
source: t,
|
|
637
657
|
compression: l.imageCompression,
|
|
638
658
|
upload: l.imageUpload
|
|
639
659
|
});
|
|
640
|
-
return
|
|
660
|
+
return hr ? void 0 : n.src;
|
|
641
661
|
} catch (e) {
|
|
642
|
-
let n =
|
|
643
|
-
t === "toolbar" && (
|
|
662
|
+
let n = ma(e);
|
|
663
|
+
t === "toolbar" && (Xn.value = n.message), H.value = n.message, _("image-error", n, t);
|
|
644
664
|
return;
|
|
645
665
|
} finally {
|
|
646
|
-
t === "toolbar" && (
|
|
666
|
+
t === "toolbar" && (Zn.value = !1);
|
|
647
667
|
}
|
|
648
668
|
}
|
|
649
|
-
let
|
|
650
|
-
function
|
|
669
|
+
let ga = 0;
|
|
670
|
+
function _a(e) {
|
|
651
671
|
let t = e.replacedFontFamilies.filter(Boolean);
|
|
652
672
|
if (!t.length) return;
|
|
653
673
|
let n = Date.now();
|
|
654
|
-
n -
|
|
674
|
+
n - ga < 800 || (ga = n, Lt.info(`已将 ${t.length} 种外部字体(${t.join("、")})统一为合同标准字体,以保证 Mac 与 Windows 排版一致`));
|
|
655
675
|
}
|
|
656
|
-
async function
|
|
657
|
-
return await
|
|
676
|
+
async function va(e) {
|
|
677
|
+
return await ha(e, "paste") ?? null;
|
|
658
678
|
}
|
|
659
|
-
async function
|
|
679
|
+
async function ya(e, t = {}) {
|
|
660
680
|
if (W.value) return;
|
|
661
|
-
let n = G.value?.id ??
|
|
662
|
-
if (
|
|
681
|
+
let n = G.value?.id ?? E.value.pages[0]?.id, r = n ? j.get(n)?.getSelectionRange() : void 0, i = typeof e == "string" ? e.trim() : await ha(e, "toolbar");
|
|
682
|
+
if (hr) return;
|
|
663
683
|
if (!i || !Ee(i)) {
|
|
664
|
-
typeof e == "string" && (
|
|
684
|
+
typeof e == "string" && (Xn.value = "请输入安全的图片 URL");
|
|
665
685
|
return;
|
|
666
686
|
}
|
|
667
|
-
if (n && !
|
|
668
|
-
let a =
|
|
687
|
+
if (n && !j.has(n)) return;
|
|
688
|
+
let a = pa({
|
|
669
689
|
...t,
|
|
670
690
|
src: i
|
|
671
691
|
}, n, r);
|
|
672
|
-
return a && (
|
|
692
|
+
return a && (Un.value = !1, fa(), H.value = "已插入图片"), a;
|
|
673
693
|
}
|
|
674
|
-
function
|
|
675
|
-
W.value ||
|
|
694
|
+
function ba() {
|
|
695
|
+
W.value || Zn.value || ($(), Xn.value = "", fn.value && (fn.value.value = ""), fn.value?.click());
|
|
676
696
|
}
|
|
677
|
-
async function
|
|
697
|
+
async function xa(e) {
|
|
678
698
|
let t = e.target.files?.[0];
|
|
679
|
-
t && await
|
|
699
|
+
t && await ya(t, da({ alt: t.name }));
|
|
680
700
|
}
|
|
681
|
-
async function
|
|
682
|
-
let e =
|
|
683
|
-
await
|
|
701
|
+
async function Sa() {
|
|
702
|
+
let e = qn.value;
|
|
703
|
+
await ya(e, da());
|
|
684
704
|
}
|
|
685
|
-
function
|
|
686
|
-
|
|
705
|
+
function Ca(e) {
|
|
706
|
+
Ua(e), Hn.value = !1;
|
|
687
707
|
}
|
|
688
|
-
function
|
|
689
|
-
$(),
|
|
708
|
+
function wa() {
|
|
709
|
+
$(), ra();
|
|
690
710
|
}
|
|
691
|
-
function
|
|
692
|
-
$(),
|
|
711
|
+
function Ta(e, t, n, r) {
|
|
712
|
+
$(), la(ca({ type: t }), e, {
|
|
693
713
|
left: n,
|
|
694
714
|
top: r
|
|
695
715
|
});
|
|
696
716
|
}
|
|
697
|
-
function
|
|
698
|
-
$(),
|
|
717
|
+
function Ea(e) {
|
|
718
|
+
$(), D.value = e;
|
|
699
719
|
}
|
|
700
|
-
function
|
|
701
|
-
let t =
|
|
720
|
+
function Da(e) {
|
|
721
|
+
let t = E.value.variables.find((t) => t.id === e.id);
|
|
702
722
|
if (!t) return;
|
|
703
723
|
let n = e.key.trim();
|
|
704
724
|
if (n !== t.key) {
|
|
705
|
-
let t = we(n,
|
|
725
|
+
let t = we(n, E.value.variables, e.id);
|
|
706
726
|
if (t) {
|
|
707
727
|
H.value = t;
|
|
708
728
|
return;
|
|
@@ -712,23 +732,22 @@ var Vt = {
|
|
|
712
732
|
...e,
|
|
713
733
|
key: n
|
|
714
734
|
};
|
|
715
|
-
let r = [...
|
|
716
|
-
|
|
717
|
-
let
|
|
718
|
-
if (
|
|
719
|
-
a ||= n;
|
|
735
|
+
let r = [...E.value.pages], i = t.key;
|
|
736
|
+
j.forEach((t, n) => {
|
|
737
|
+
let a = t.updateVariable(e, i);
|
|
738
|
+
if (a) {
|
|
720
739
|
let e = r.findIndex((e) => e.id === n);
|
|
721
|
-
e >= 0 && (r[e] =
|
|
740
|
+
e >= 0 && (r[e] = a);
|
|
722
741
|
}
|
|
723
742
|
}), Z({
|
|
724
|
-
...
|
|
743
|
+
...E.value,
|
|
725
744
|
pages: r,
|
|
726
|
-
variables:
|
|
727
|
-
...i !== e.key &&
|
|
728
|
-
}),
|
|
745
|
+
variables: E.value.variables.map((t) => t.id === e.id ? e : t),
|
|
746
|
+
...i !== e.key && E.value.pageDecorations ? { pageDecorations: ne(E.value.pageDecorations, i, e.key) } : {}
|
|
747
|
+
}), D.value = e.key, q();
|
|
729
748
|
}
|
|
730
|
-
function
|
|
731
|
-
K.value &&
|
|
749
|
+
function Oa(e) {
|
|
750
|
+
K.value && Da({
|
|
732
751
|
...K.value,
|
|
733
752
|
...e,
|
|
734
753
|
style: {
|
|
@@ -737,211 +756,211 @@ var Vt = {
|
|
|
737
756
|
}
|
|
738
757
|
});
|
|
739
758
|
}
|
|
740
|
-
function
|
|
741
|
-
W.value || !K.value ||
|
|
759
|
+
function ka(e) {
|
|
760
|
+
W.value || !K.value || Oa({ key: e });
|
|
742
761
|
}
|
|
743
|
-
function
|
|
762
|
+
function Aa(e) {
|
|
744
763
|
W.value || (Z({
|
|
745
|
-
...
|
|
764
|
+
...E.value,
|
|
746
765
|
pageDecorations: o(e)
|
|
747
|
-
}), q(
|
|
766
|
+
}), q());
|
|
748
767
|
}
|
|
749
|
-
function
|
|
750
|
-
(e === "left" || e === "center" || e === "right") &&
|
|
768
|
+
function ja(e) {
|
|
769
|
+
(e === "left" || e === "center" || e === "right") && Oa({ style: { textAlign: e } });
|
|
751
770
|
}
|
|
752
|
-
function
|
|
753
|
-
(e === "solid" || e === "dashed") &&
|
|
771
|
+
function Ma(e) {
|
|
772
|
+
(e === "solid" || e === "dashed") && Oa({ style: { borderStyle: e } });
|
|
754
773
|
}
|
|
755
|
-
function
|
|
756
|
-
(e === "contain" || e === "cover" || e === "fill") &&
|
|
774
|
+
function Na(e) {
|
|
775
|
+
(e === "contain" || e === "cover" || e === "fill") && Oa({ style: { objectFit: e } });
|
|
757
776
|
}
|
|
758
|
-
function
|
|
759
|
-
|
|
777
|
+
function Pa(e) {
|
|
778
|
+
Oa({ style: e });
|
|
760
779
|
}
|
|
761
|
-
function
|
|
762
|
-
|
|
780
|
+
function Fa(e) {
|
|
781
|
+
Pa({ fontFamily: String(e || "").trim() || t });
|
|
763
782
|
}
|
|
764
|
-
function
|
|
765
|
-
|
|
783
|
+
function Ia(e) {
|
|
784
|
+
Pa({ fontSize: Pi(e, K.value?.style?.fontSize ?? 14) });
|
|
766
785
|
}
|
|
767
|
-
function
|
|
768
|
-
K.value &&
|
|
786
|
+
function La(e) {
|
|
787
|
+
K.value && Oa({
|
|
769
788
|
multiline: e,
|
|
770
789
|
rows: K.value.rows || 3,
|
|
771
790
|
lineHeight: K.value.lineHeight || 28,
|
|
772
791
|
style: e ? { underline: !0 } : void 0
|
|
773
792
|
});
|
|
774
793
|
}
|
|
775
|
-
function
|
|
776
|
-
K.value &&
|
|
794
|
+
function Ra(e) {
|
|
795
|
+
K.value && Oa({
|
|
777
796
|
rows: Number(e || 3),
|
|
778
797
|
lineHeight: K.value.lineHeight || 28
|
|
779
798
|
});
|
|
780
799
|
}
|
|
781
|
-
function
|
|
800
|
+
function za(e) {
|
|
782
801
|
if (W.value) return;
|
|
783
|
-
let t = [...
|
|
784
|
-
|
|
802
|
+
let t = [...E.value.pages];
|
|
803
|
+
j.forEach((n, r) => {
|
|
785
804
|
let i = n.removeVariable(e.key);
|
|
786
805
|
if (i) {
|
|
787
806
|
let e = t.findIndex((e) => e.id === r);
|
|
788
807
|
e >= 0 && (t[e] = i);
|
|
789
808
|
}
|
|
790
809
|
}), Z({
|
|
791
|
-
...
|
|
810
|
+
...E.value,
|
|
792
811
|
pages: t,
|
|
793
|
-
variables:
|
|
794
|
-
...
|
|
795
|
-
}),
|
|
812
|
+
variables: E.value.variables.filter((t) => t.id !== e.id),
|
|
813
|
+
...E.value.pageDecorations ? { pageDecorations: ne(E.value.pageDecorations, e.key) } : {}
|
|
814
|
+
}), D.value = "";
|
|
796
815
|
}
|
|
797
|
-
function
|
|
798
|
-
let t = (e.trim() || "variable").replace(/\s+/g, "_"), n = new Set(
|
|
816
|
+
function Ba(e) {
|
|
817
|
+
let t = (e.trim() || "variable").replace(/\s+/g, "_"), n = new Set(E.value.variables.map((e) => e.key));
|
|
799
818
|
if (!n.has(t)) return t;
|
|
800
819
|
let r = 2;
|
|
801
820
|
for (; n.has(`${t}_${r}`);) r += 1;
|
|
802
821
|
return `${t}_${r}`;
|
|
803
822
|
}
|
|
804
|
-
function
|
|
805
|
-
W.value ||
|
|
823
|
+
function Va(e) {
|
|
824
|
+
W.value || la(he({
|
|
806
825
|
...e,
|
|
807
826
|
id: void 0,
|
|
808
|
-
key:
|
|
827
|
+
key: Ba(`${e.key || e.type}_copy`),
|
|
809
828
|
label: `${e.label}副本`,
|
|
810
829
|
style: { ...e.style }
|
|
811
|
-
},
|
|
830
|
+
}, ai.value, l.defaultVariableStyle));
|
|
812
831
|
}
|
|
813
|
-
function
|
|
814
|
-
return W.value ? void 0 :
|
|
832
|
+
function Ha(e) {
|
|
833
|
+
return W.value ? void 0 : la(E.value.variables.find((t) => t.key === e.key) ?? he(e, ai.value, l.defaultVariableStyle));
|
|
815
834
|
}
|
|
816
|
-
function
|
|
817
|
-
if (!W.value) return
|
|
835
|
+
function Ua(e) {
|
|
836
|
+
if (!W.value) return la(ca({ type: e }));
|
|
818
837
|
}
|
|
819
|
-
function
|
|
838
|
+
function Wa(e) {
|
|
820
839
|
if (W.value || !re(e)) return;
|
|
821
|
-
let t = R.value, n =
|
|
840
|
+
let t = R.value, n = ai.value.find((t) => t.type === e);
|
|
822
841
|
if (!t || !n) return;
|
|
823
|
-
let r = Pe(t.leadingText) || n.label, i = Fe(t.selectionWidth, Zt,
|
|
824
|
-
|
|
842
|
+
let r = Pe(t.leadingText) || n.label, i = Fe(t.selectionWidth, Zt, Si.value), a = Ga();
|
|
843
|
+
la(ca({
|
|
825
844
|
type: e,
|
|
826
845
|
label: r,
|
|
827
846
|
...i ? { width: i } : {},
|
|
828
847
|
...a ? { style: a } : {}
|
|
829
848
|
}), t.pageId), H.value = t.hasSelection ? `已将选中内容替换为${n.label}控件` : `已插入${n.label}控件`, $();
|
|
830
849
|
}
|
|
831
|
-
function
|
|
850
|
+
function Ga() {
|
|
832
851
|
let e = J.value, t = {};
|
|
833
852
|
return e.isUnderline && (t.underline = !0), typeof e.fontSize == "number" && Number.isFinite(e.fontSize) && (t.fontSize = e.fontSize), e.fontFamily && (t.fontFamily = e.fontFamily), e.textColor && (t.color = e.textColor), Object.keys(t).length ? t : void 0;
|
|
834
853
|
}
|
|
835
|
-
function
|
|
854
|
+
function Ka(e) {
|
|
836
855
|
if (W.value) return;
|
|
837
856
|
let t = R.value;
|
|
838
|
-
t && (
|
|
857
|
+
t && (la(e, t.pageId), H.value = `已绑定到${e.label},沿用原控件尺寸`, $());
|
|
839
858
|
}
|
|
840
|
-
function
|
|
841
|
-
return _e(e.type && re(e.type) ? e.type : "text",
|
|
859
|
+
function qa(e) {
|
|
860
|
+
return _e(e.type && re(e.type) ? e.type : "text", ai.value).label;
|
|
842
861
|
}
|
|
843
|
-
function
|
|
844
|
-
|
|
845
|
-
|
|
862
|
+
function Ja() {
|
|
863
|
+
E.value.variables.length && (ir.value = !0, v(() => {
|
|
864
|
+
ss(), Qn.value?.focusBindSearch();
|
|
846
865
|
}));
|
|
847
866
|
}
|
|
848
|
-
function
|
|
867
|
+
function Ya(e, t) {
|
|
849
868
|
e.dataTransfer?.setData("application/x-gd-contract-variable", t), e.dataTransfer && (e.dataTransfer.effectAllowed = "copy");
|
|
850
869
|
}
|
|
851
|
-
function
|
|
852
|
-
return
|
|
870
|
+
function Xa(e) {
|
|
871
|
+
return M.value = Math.round(Math.min(Kt, Math.max(Gt, Number.isFinite(e) ? e : 1)) * 100) / 100, M.value;
|
|
853
872
|
}
|
|
854
|
-
let { width:
|
|
855
|
-
viewportWidth:
|
|
856
|
-
widestPageWidth: f(() => Math.max(...
|
|
873
|
+
let { width: Za } = Rt(an), { fitWidth: Qa, applyAutoFit: $a, markUserAdjusted: eo, userAdjusted: to } = Oe({
|
|
874
|
+
viewportWidth: Za,
|
|
875
|
+
widestPageWidth: f(() => Math.max(...E.value.pages.map((e) => ea(e).width), ce.width) + 10),
|
|
857
876
|
padding: 48,
|
|
858
877
|
minZoom: Gt,
|
|
859
878
|
maxZoom: Kt,
|
|
860
|
-
getZoom: () =>
|
|
861
|
-
applyZoom:
|
|
879
|
+
getZoom: () => M.value,
|
|
880
|
+
applyZoom: Xa
|
|
862
881
|
});
|
|
863
|
-
function
|
|
864
|
-
return
|
|
882
|
+
function no(e) {
|
|
883
|
+
return eo(), Xa(e);
|
|
865
884
|
}
|
|
866
|
-
function
|
|
867
|
-
return
|
|
885
|
+
function ro() {
|
|
886
|
+
return $a();
|
|
868
887
|
}
|
|
869
|
-
function
|
|
870
|
-
return
|
|
888
|
+
function io() {
|
|
889
|
+
return M.value;
|
|
871
890
|
}
|
|
872
|
-
function
|
|
873
|
-
|
|
891
|
+
function ao() {
|
|
892
|
+
no(M.value + qt);
|
|
874
893
|
}
|
|
875
|
-
function
|
|
876
|
-
|
|
894
|
+
function oo() {
|
|
895
|
+
no(M.value - qt);
|
|
877
896
|
}
|
|
878
|
-
function
|
|
879
|
-
$(),
|
|
897
|
+
function so() {
|
|
898
|
+
$(), ms(), N.value = !N.value;
|
|
880
899
|
}
|
|
881
|
-
|
|
882
|
-
|
|
900
|
+
S(Za, (e) => {
|
|
901
|
+
In.value && !to.value && e > 0 && Qa();
|
|
883
902
|
});
|
|
884
|
-
function
|
|
885
|
-
|
|
903
|
+
function co(e) {
|
|
904
|
+
P.value ? dn.value?.focus() : e();
|
|
886
905
|
}
|
|
887
|
-
function
|
|
888
|
-
$(),
|
|
889
|
-
fullscreen:
|
|
890
|
-
sidebar:
|
|
891
|
-
inspector:
|
|
892
|
-
chrome:
|
|
893
|
-
zoom:
|
|
894
|
-
userAdjusted:
|
|
895
|
-
},
|
|
896
|
-
W.value ?
|
|
906
|
+
function lo() {
|
|
907
|
+
$(), ms(), F.value = !1, mr = {
|
|
908
|
+
fullscreen: N.value,
|
|
909
|
+
sidebar: Pn.value,
|
|
910
|
+
inspector: Fn.value,
|
|
911
|
+
chrome: P.value,
|
|
912
|
+
zoom: M.value,
|
|
913
|
+
userAdjusted: to.value
|
|
914
|
+
}, N.value = !0, Pn.value = !0, Fn.value = !0, P.value = !0, In.value = !0, v(() => {
|
|
915
|
+
W.value ? Ln.value?.focus() : j.get(O.value)?.focus();
|
|
897
916
|
});
|
|
898
917
|
}
|
|
899
|
-
function
|
|
900
|
-
let e =
|
|
901
|
-
|
|
918
|
+
function uo() {
|
|
919
|
+
let e = mr;
|
|
920
|
+
In.value = !1, mr = void 0, e && (N.value = e.fullscreen, Pn.value = e.sidebar, Fn.value = e.inspector, P.value = e.chrome, e.userAdjusted ? no(e.zoom) : $a(), v(() => co(() => sn.value?.focusImmersive())));
|
|
902
921
|
}
|
|
903
|
-
function
|
|
904
|
-
|
|
922
|
+
function fo() {
|
|
923
|
+
In.value ? uo() : lo();
|
|
905
924
|
}
|
|
906
|
-
function
|
|
925
|
+
function po() {
|
|
907
926
|
$(), z.value = void 0;
|
|
908
927
|
let e = Y(!1);
|
|
909
|
-
|
|
928
|
+
C.value ? (On.value = u(w.value), Dn.value = void 0, kn.value = T.value || w.value[0]?.id || "") : (Dn.value = c(e), On.value = void 0, kn.value = ""), En.value = !0;
|
|
910
929
|
}
|
|
911
|
-
function
|
|
912
|
-
|
|
930
|
+
function mo() {
|
|
931
|
+
En.value = !1, Dn.value = void 0, On.value = void 0, kn.value = "";
|
|
913
932
|
}
|
|
914
|
-
function
|
|
915
|
-
return
|
|
933
|
+
function ho() {
|
|
934
|
+
return Wo();
|
|
916
935
|
}
|
|
917
|
-
function
|
|
936
|
+
function go() {
|
|
918
937
|
$();
|
|
919
|
-
let e =
|
|
920
|
-
return
|
|
938
|
+
let e = ho();
|
|
939
|
+
return jn.value = JSON.stringify(e, null, 2), An.value = !0, e;
|
|
921
940
|
}
|
|
922
|
-
function
|
|
923
|
-
|
|
941
|
+
function _o() {
|
|
942
|
+
An.value = !1;
|
|
924
943
|
}
|
|
925
|
-
function
|
|
944
|
+
function vo() {
|
|
926
945
|
return De(Y(!1));
|
|
927
946
|
}
|
|
928
|
-
function
|
|
947
|
+
function yo() {
|
|
929
948
|
$();
|
|
930
|
-
let e =
|
|
931
|
-
return
|
|
949
|
+
let e = vo();
|
|
950
|
+
return Nn.value = e, Mn.value = !0, e;
|
|
932
951
|
}
|
|
933
|
-
function
|
|
934
|
-
|
|
952
|
+
function bo() {
|
|
953
|
+
Mn.value = !1;
|
|
935
954
|
}
|
|
936
|
-
function
|
|
937
|
-
$(), z.value = void 0, I.value = !1, L.value = !1,
|
|
955
|
+
function xo() {
|
|
956
|
+
$(), z.value = void 0, I.value = !1, L.value = !1, D.value = "", O.value = "", En.value = !1, Dn.value = void 0, On.value = void 0, An.value = !1, jn.value = "", Mn.value = !1, Nn.value = {
|
|
938
957
|
values: {},
|
|
939
958
|
variables: []
|
|
940
|
-
},
|
|
941
|
-
let e = Z(
|
|
942
|
-
return
|
|
959
|
+
}, Bn.value = {}, fi();
|
|
960
|
+
let e = Z(fe(ce));
|
|
961
|
+
return O.value = e.pages[0]?.id ?? "", c(e);
|
|
943
962
|
}
|
|
944
|
-
function
|
|
963
|
+
function So() {
|
|
945
964
|
W.value || ($(), Ft.confirm({
|
|
946
965
|
title: "清空合同内容",
|
|
947
966
|
content: "将清空全部合同正文、页面和模板变量,仅保留一个空白 A4 合同页。此操作不可撤销。",
|
|
@@ -949,98 +968,98 @@ var Vt = {
|
|
|
949
968
|
okType: "danger",
|
|
950
969
|
cancelText: "取消",
|
|
951
970
|
onOk: () => {
|
|
952
|
-
|
|
971
|
+
xo();
|
|
953
972
|
}
|
|
954
973
|
}));
|
|
955
974
|
}
|
|
956
|
-
function
|
|
957
|
-
let t =
|
|
975
|
+
function Co(e) {
|
|
976
|
+
let t = Ii().pages, n = t.find((e) => e.id === O.value);
|
|
958
977
|
return (n ? [n, ...t.filter((e) => e.id !== n.id)] : t).find((t) => t.contentHtml.includes(`data-key="${e.key}"`) || t.contentHtml.includes(`data-key='${e.key}'`));
|
|
959
978
|
}
|
|
960
|
-
function
|
|
961
|
-
$(),
|
|
962
|
-
let t =
|
|
963
|
-
t && (
|
|
964
|
-
|
|
979
|
+
function wo(e) {
|
|
980
|
+
$(), D.value = e.key;
|
|
981
|
+
let t = Co(e);
|
|
982
|
+
t && (O.value = t.id, v(() => {
|
|
983
|
+
j.get(t.id)?.scrollIntoVariable(e.key);
|
|
965
984
|
}));
|
|
966
985
|
}
|
|
967
|
-
function
|
|
968
|
-
let t =
|
|
969
|
-
t &&
|
|
986
|
+
function To(e) {
|
|
987
|
+
let t = E.value.variables.find((t) => t.key === e || t.id === e);
|
|
988
|
+
t && wo(t);
|
|
970
989
|
}
|
|
971
|
-
function
|
|
972
|
-
$(),
|
|
973
|
-
|
|
990
|
+
function Eo(e, t = !0) {
|
|
991
|
+
$(), O.value = e, t && v(() => {
|
|
992
|
+
j.get(e)?.scrollIntoPage();
|
|
974
993
|
});
|
|
975
994
|
}
|
|
976
|
-
function
|
|
977
|
-
|
|
995
|
+
function Do(e) {
|
|
996
|
+
Eo(e.pageId, !1), j.get(e.pageId)?.focusHeading(e.headingIndex);
|
|
978
997
|
}
|
|
979
|
-
function
|
|
980
|
-
|
|
998
|
+
function Oo(e) {
|
|
999
|
+
E.value.pages.some((t) => t.id === e) && Eo(e);
|
|
981
1000
|
}
|
|
982
|
-
function
|
|
1001
|
+
function ko() {
|
|
983
1002
|
if (F.value) {
|
|
984
|
-
|
|
1003
|
+
Ao();
|
|
985
1004
|
return;
|
|
986
1005
|
}
|
|
987
1006
|
F.value = !0;
|
|
988
1007
|
}
|
|
989
|
-
function
|
|
990
|
-
F.value = !1,
|
|
1008
|
+
function Ao() {
|
|
1009
|
+
F.value = !1, v(() => co(() => sn.value?.focusPageDecorations()));
|
|
991
1010
|
}
|
|
992
|
-
function
|
|
993
|
-
return
|
|
1011
|
+
function jo() {
|
|
1012
|
+
return Ri(), c(Ii());
|
|
994
1013
|
}
|
|
995
|
-
function
|
|
996
|
-
|
|
1014
|
+
function Mo(e) {
|
|
1015
|
+
fi(), Z(e), q();
|
|
997
1016
|
}
|
|
998
|
-
function
|
|
1017
|
+
function No() {
|
|
999
1018
|
let e = Y(!1);
|
|
1000
|
-
return
|
|
1019
|
+
return C.value ? u(w.value) : u(lt(w.value, T.value, e));
|
|
1001
1020
|
}
|
|
1002
|
-
function
|
|
1003
|
-
let n = nt(ot(e, void 0, l.pageSize), l.pageSizeOptions), r =
|
|
1004
|
-
|
|
1021
|
+
function Po(e, t) {
|
|
1022
|
+
let n = nt(ot(e, void 0, l.pageSize), l.pageSizeOptions), r = w.value;
|
|
1023
|
+
vn.value = !0, Y(!1), w.value = n.files, Hi(ut(w.value, t ?? T.value), {
|
|
1005
1024
|
syncCurrent: !1,
|
|
1006
1025
|
shouldEmit: !0,
|
|
1007
1026
|
forceRefresh: !0
|
|
1008
|
-
}), d(r) !== d(
|
|
1027
|
+
}), d(r) !== d(w.value) && X(w.value, "");
|
|
1009
1028
|
}
|
|
1010
|
-
function
|
|
1029
|
+
function Fo(e) {
|
|
1011
1030
|
if (W.value) return;
|
|
1012
|
-
|
|
1013
|
-
let t = rt(e || `合同文件 ${
|
|
1014
|
-
return
|
|
1031
|
+
vn.value = !0, Y(!0);
|
|
1032
|
+
let t = rt(e || `合同文件 ${w.value.length + 1}`, l.pageSize);
|
|
1033
|
+
return w.value = [...w.value, t], X(w.value, ""), _("file-add", u([t])[0]), Hi(t.id, {
|
|
1015
1034
|
syncCurrent: !1,
|
|
1016
1035
|
shouldEmit: !0,
|
|
1017
1036
|
forceRefresh: !0
|
|
1018
1037
|
}), u([t])[0];
|
|
1019
1038
|
}
|
|
1020
|
-
function
|
|
1021
|
-
!
|
|
1039
|
+
function Io(e) {
|
|
1040
|
+
!C.value && !w.value.some((t) => t.id === e) || (vn.value = !0, Hi(e));
|
|
1022
1041
|
}
|
|
1023
|
-
function
|
|
1042
|
+
function Lo(e, t) {
|
|
1024
1043
|
if (W.value) return;
|
|
1025
|
-
|
|
1026
|
-
let n = ct(
|
|
1027
|
-
if (r) return
|
|
1028
|
-
}
|
|
1029
|
-
function
|
|
1030
|
-
if (W.value ||
|
|
1031
|
-
|
|
1032
|
-
let t =
|
|
1044
|
+
vn.value = !0, Y(!1);
|
|
1045
|
+
let n = ct(w.value, e, t), r = n.find((t) => t.id === e);
|
|
1046
|
+
if (r) return w.value = n, X(n, e), u([r])[0];
|
|
1047
|
+
}
|
|
1048
|
+
function Ro(e) {
|
|
1049
|
+
if (W.value || w.value.length <= 1) return;
|
|
1050
|
+
vn.value = !0, Y(!1);
|
|
1051
|
+
let t = w.value.find((t) => t.id === e);
|
|
1033
1052
|
if (!t) return;
|
|
1034
|
-
let n = st(
|
|
1035
|
-
if (n.length !==
|
|
1053
|
+
let n = st(w.value, e);
|
|
1054
|
+
if (n.length !== w.value.length) return w.value = n, X(n, ""), _("file-remove", u([t])[0]), T.value === e && Hi(ut(n, n[0]?.id), {
|
|
1036
1055
|
syncCurrent: !1,
|
|
1037
1056
|
shouldEmit: !0,
|
|
1038
1057
|
forceRefresh: !0
|
|
1039
1058
|
}), u([t])[0];
|
|
1040
1059
|
}
|
|
1041
|
-
function
|
|
1042
|
-
if (W.value ||
|
|
1043
|
-
let t =
|
|
1060
|
+
function zo(e) {
|
|
1061
|
+
if (W.value || w.value.length <= 1) return;
|
|
1062
|
+
let t = w.value.find((t) => t.id === e);
|
|
1044
1063
|
t && Ft.confirm({
|
|
1045
1064
|
title: "删除合同文件",
|
|
1046
1065
|
content: `删除“${t.name}”后,其正文和变量将无法恢复,是否继续?`,
|
|
@@ -1048,27 +1067,27 @@ var Vt = {
|
|
|
1048
1067
|
okType: "danger",
|
|
1049
1068
|
cancelText: "取消",
|
|
1050
1069
|
onOk: () => {
|
|
1051
|
-
|
|
1070
|
+
Ro(e);
|
|
1052
1071
|
}
|
|
1053
1072
|
});
|
|
1054
1073
|
}
|
|
1055
|
-
function
|
|
1074
|
+
function Bo(e, t) {
|
|
1056
1075
|
if (W.value) return;
|
|
1057
|
-
|
|
1058
|
-
let n =
|
|
1059
|
-
if (!(!a || n === i)) return
|
|
1076
|
+
vn.value = !0, Y(!1);
|
|
1077
|
+
let n = w.value.findIndex((t) => t.id === e), r = at(w.value, e, t), i = r.findIndex((t) => t.id === e), a = r[i];
|
|
1078
|
+
if (!(!a || n === i)) return w.value = r, X(r, ""), _("file-move", u([a])[0], n, i), u([a])[0];
|
|
1060
1079
|
}
|
|
1061
|
-
function
|
|
1080
|
+
function Vo() {
|
|
1062
1081
|
Y(!1);
|
|
1063
|
-
let e =
|
|
1082
|
+
let e = Ko(C.value ? w.value.flatMap((e) => Te(e.template, { maxPages: ci.value }).map((t) => ({
|
|
1064
1083
|
...t,
|
|
1065
1084
|
fileId: e.id
|
|
1066
|
-
}))) : Te(
|
|
1067
|
-
return
|
|
1085
|
+
}))) : Te(Ii(), { maxPages: ci.value }));
|
|
1086
|
+
return A.value = e, k.value = !0, _("validate", e), e;
|
|
1068
1087
|
}
|
|
1069
|
-
function
|
|
1070
|
-
if (e.fileId && e.fileId !==
|
|
1071
|
-
|
|
1088
|
+
function Ho(e) {
|
|
1089
|
+
if (e.fileId && e.fileId !== T.value) {
|
|
1090
|
+
Io(e.fileId), v(() => Ho({
|
|
1072
1091
|
...e,
|
|
1073
1092
|
fileId: void 0
|
|
1074
1093
|
}));
|
|
@@ -1076,70 +1095,70 @@ var Vt = {
|
|
|
1076
1095
|
}
|
|
1077
1096
|
let t = te(e);
|
|
1078
1097
|
if (t) {
|
|
1079
|
-
F.value = !0,
|
|
1098
|
+
F.value = !0, v(() => cn.value?.focusField(t));
|
|
1080
1099
|
return;
|
|
1081
1100
|
}
|
|
1082
1101
|
if (e.variableKey) {
|
|
1083
|
-
|
|
1102
|
+
To(e.variableKey);
|
|
1084
1103
|
return;
|
|
1085
1104
|
}
|
|
1086
1105
|
if (e.pageId) {
|
|
1087
|
-
|
|
1106
|
+
Oo(e.pageId);
|
|
1088
1107
|
return;
|
|
1089
1108
|
}
|
|
1090
|
-
let n =
|
|
1109
|
+
let n = E.value.variables.find((t) => t.id === e.id || t.key === e.id);
|
|
1091
1110
|
if (n) {
|
|
1092
|
-
|
|
1111
|
+
wo(n);
|
|
1093
1112
|
return;
|
|
1094
1113
|
}
|
|
1095
|
-
|
|
1114
|
+
E.value.pages.some((t) => t.id === e.id) && Eo(e.id);
|
|
1096
1115
|
}
|
|
1097
|
-
function
|
|
1116
|
+
function Uo(e) {
|
|
1098
1117
|
return te(e) ? "页面装饰" : e.type === "variable" ? "变量" : "字段";
|
|
1099
1118
|
}
|
|
1100
|
-
function
|
|
1101
|
-
return
|
|
1119
|
+
function Wo() {
|
|
1120
|
+
return Ri(), ge(Ii());
|
|
1102
1121
|
}
|
|
1103
|
-
function
|
|
1122
|
+
function Go() {
|
|
1104
1123
|
let e = Y(!1);
|
|
1105
|
-
return it(
|
|
1124
|
+
return it(C.value ? w.value : lt(w.value, T.value, e));
|
|
1106
1125
|
}
|
|
1107
|
-
function
|
|
1126
|
+
function Ko(e) {
|
|
1108
1127
|
let t = /* @__PURE__ */ new Set();
|
|
1109
1128
|
return e.filter((e) => {
|
|
1110
1129
|
let n = `${e.fileId ?? ""}|${e.code ?? ""}|${e.id}|${e.pageId ?? ""}|${e.message}`;
|
|
1111
1130
|
return t.has(n) ? !1 : (t.add(n), !0);
|
|
1112
1131
|
});
|
|
1113
1132
|
}
|
|
1114
|
-
function
|
|
1115
|
-
|
|
1133
|
+
function qo(e) {
|
|
1134
|
+
A.value = [...e], k.value = !0;
|
|
1116
1135
|
}
|
|
1117
|
-
function
|
|
1118
|
-
|
|
1136
|
+
function Jo() {
|
|
1137
|
+
A.value = [], k.value = !1;
|
|
1119
1138
|
}
|
|
1120
|
-
function
|
|
1121
|
-
|
|
1139
|
+
function Yo() {
|
|
1140
|
+
j.get(G.value?.id ?? O.value)?.focus();
|
|
1122
1141
|
}
|
|
1123
|
-
function
|
|
1124
|
-
|
|
1142
|
+
function Xo(e) {
|
|
1143
|
+
Mi(e) && Q({
|
|
1125
1144
|
type: "set-text-align",
|
|
1126
1145
|
value: e
|
|
1127
1146
|
});
|
|
1128
1147
|
}
|
|
1129
|
-
function
|
|
1130
|
-
(e === "paragraph" ||
|
|
1148
|
+
function Zo(e) {
|
|
1149
|
+
(e === "paragraph" || Ni(e)) && Q({
|
|
1131
1150
|
type: "apply-block-style",
|
|
1132
1151
|
format: e
|
|
1133
1152
|
});
|
|
1134
1153
|
}
|
|
1135
|
-
function
|
|
1136
|
-
let t =
|
|
1154
|
+
function Qo(e) {
|
|
1155
|
+
let t = Fi(e);
|
|
1137
1156
|
t && (Q({
|
|
1138
1157
|
type: "set-font-size",
|
|
1139
1158
|
value: t
|
|
1140
|
-
}),
|
|
1159
|
+
}), Vn.value = "");
|
|
1141
1160
|
}
|
|
1142
|
-
function
|
|
1161
|
+
function $o(e) {
|
|
1143
1162
|
let t = String(e || "").trim();
|
|
1144
1163
|
if (!t) {
|
|
1145
1164
|
Q({ type: "unset-font-family" });
|
|
@@ -1150,31 +1169,31 @@ var Vt = {
|
|
|
1150
1169
|
value: t
|
|
1151
1170
|
});
|
|
1152
1171
|
}
|
|
1153
|
-
function
|
|
1154
|
-
|
|
1172
|
+
function es(e) {
|
|
1173
|
+
ts(e.target?.value ?? "");
|
|
1155
1174
|
}
|
|
1156
|
-
function
|
|
1175
|
+
function ts(e) {
|
|
1157
1176
|
let t = e.trim();
|
|
1158
1177
|
t && Q({
|
|
1159
1178
|
type: "set-color",
|
|
1160
1179
|
value: t
|
|
1161
1180
|
});
|
|
1162
1181
|
}
|
|
1163
|
-
function
|
|
1164
|
-
|
|
1182
|
+
function ns(e) {
|
|
1183
|
+
Vn.value = e;
|
|
1165
1184
|
}
|
|
1166
|
-
function
|
|
1167
|
-
|
|
1185
|
+
function rs() {
|
|
1186
|
+
Vn.value.trim() && Qo(Vn.value);
|
|
1168
1187
|
}
|
|
1169
|
-
function
|
|
1170
|
-
e.key === "Enter" && (e.preventDefault(),
|
|
1188
|
+
function is(e) {
|
|
1189
|
+
e.key === "Enter" && (e.preventDefault(), rs());
|
|
1171
1190
|
}
|
|
1172
|
-
function
|
|
1173
|
-
e || (
|
|
1191
|
+
function as(e) {
|
|
1192
|
+
e || (rs(), Vn.value = "");
|
|
1174
1193
|
}
|
|
1175
|
-
function
|
|
1194
|
+
function os(e) {
|
|
1176
1195
|
if (W.value) return;
|
|
1177
|
-
|
|
1196
|
+
O.value = e.pageId, I.value = !1, L.value = !1, B.value = void 0, V.value = void 0, ir.value = !1, ar.value = "";
|
|
1178
1197
|
let t = _t(e.clientX, e.clientY, 304, 300);
|
|
1179
1198
|
R.value = {
|
|
1180
1199
|
pageId: e.pageId,
|
|
@@ -1183,12 +1202,12 @@ var Vt = {
|
|
|
1183
1202
|
hasSelection: e.hasSelection,
|
|
1184
1203
|
selectionWidth: e.selectionWidth,
|
|
1185
1204
|
leadingText: e.leadingText
|
|
1186
|
-
},
|
|
1187
|
-
|
|
1205
|
+
}, v(() => {
|
|
1206
|
+
ss(), Qn.value?.focusFirstButton();
|
|
1188
1207
|
});
|
|
1189
1208
|
}
|
|
1190
|
-
function
|
|
1191
|
-
let e =
|
|
1209
|
+
function ss() {
|
|
1210
|
+
let e = Qn.value?.getMenuElement(), t = R.value;
|
|
1192
1211
|
if (!e || !t) return;
|
|
1193
1212
|
let n = vt(t.x, t.y, e);
|
|
1194
1213
|
R.value = {
|
|
@@ -1197,16 +1216,16 @@ var Vt = {
|
|
|
1197
1216
|
y: n.y
|
|
1198
1217
|
};
|
|
1199
1218
|
}
|
|
1200
|
-
function
|
|
1219
|
+
function cs(e) {
|
|
1201
1220
|
if (W.value) return;
|
|
1202
|
-
|
|
1221
|
+
O.value = e.pageId, I.value = !1, L.value = !1, R.value = void 0, V.value = void 0;
|
|
1203
1222
|
let t = _t(e.clientX, e.clientY, 248, 400);
|
|
1204
1223
|
B.value = {
|
|
1205
1224
|
...e,
|
|
1206
1225
|
x: t.x,
|
|
1207
1226
|
y: t.y
|
|
1208
|
-
},
|
|
1209
|
-
let e =
|
|
1227
|
+
}, v(() => {
|
|
1228
|
+
let e = or.value?.getMenuElement(), t = B.value;
|
|
1210
1229
|
if (e && t) {
|
|
1211
1230
|
let n = vt(t.x, t.y, e);
|
|
1212
1231
|
B.value = {
|
|
@@ -1215,24 +1234,24 @@ var Vt = {
|
|
|
1215
1234
|
y: n.y
|
|
1216
1235
|
};
|
|
1217
1236
|
}
|
|
1218
|
-
|
|
1237
|
+
or.value?.focusFirstItem();
|
|
1219
1238
|
});
|
|
1220
1239
|
}
|
|
1221
|
-
function
|
|
1240
|
+
function ls(e) {
|
|
1222
1241
|
if (W.value) return;
|
|
1223
|
-
|
|
1242
|
+
O.value = e.pageId, I.value = !1, L.value = !1, R.value = void 0, B.value = void 0, cr.value = e.image.width, lr.value = e.image.height, D.value = "";
|
|
1224
1243
|
let t = _t(e.clientX, e.clientY, 288, 196);
|
|
1225
1244
|
V.value = {
|
|
1226
1245
|
pageId: e.pageId,
|
|
1227
1246
|
image: e.image,
|
|
1228
1247
|
x: t.x,
|
|
1229
1248
|
y: t.y
|
|
1230
|
-
},
|
|
1231
|
-
|
|
1249
|
+
}, v(() => {
|
|
1250
|
+
us(), sr.value?.getMenuElement()?.querySelector("input, button:not(:disabled)")?.focus();
|
|
1232
1251
|
});
|
|
1233
1252
|
}
|
|
1234
|
-
function
|
|
1235
|
-
let e =
|
|
1253
|
+
function us() {
|
|
1254
|
+
let e = sr.value?.getMenuElement(), t = V.value;
|
|
1236
1255
|
if (!e || !t) return;
|
|
1237
1256
|
let n = vt(t.x, t.y, e);
|
|
1238
1257
|
V.value = {
|
|
@@ -1241,39 +1260,39 @@ var Vt = {
|
|
|
1241
1260
|
y: n.y
|
|
1242
1261
|
};
|
|
1243
1262
|
}
|
|
1244
|
-
function
|
|
1263
|
+
function ds() {
|
|
1245
1264
|
let e = V.value;
|
|
1246
|
-
!e || W.value || (
|
|
1247
|
-
width: ke(
|
|
1248
|
-
height: ke(
|
|
1265
|
+
!e || W.value || (j.get(e.pageId)?.updateSelectedContentImage({
|
|
1266
|
+
width: ke(cr.value),
|
|
1267
|
+
height: ke(lr.value)
|
|
1249
1268
|
}) && (H.value = "已更新图片尺寸"), $());
|
|
1250
1269
|
}
|
|
1251
|
-
function
|
|
1270
|
+
function fs() {
|
|
1252
1271
|
let e = V.value;
|
|
1253
|
-
!e || W.value || (
|
|
1272
|
+
!e || W.value || (j.get(e.pageId)?.updateSelectedContentImage({
|
|
1254
1273
|
width: void 0,
|
|
1255
1274
|
height: void 0
|
|
1256
1275
|
}) && (H.value = "已恢复图片自然尺寸"), $());
|
|
1257
1276
|
}
|
|
1258
|
-
function
|
|
1259
|
-
e.type === "table" ?
|
|
1277
|
+
function ps(e) {
|
|
1278
|
+
e.type === "table" ? cs(e) : e.type === "image" ? ls(e) : os(e);
|
|
1260
1279
|
}
|
|
1261
1280
|
function $() {
|
|
1262
|
-
R.value = void 0, B.value = void 0, V.value = void 0,
|
|
1281
|
+
R.value = void 0, B.value = void 0, V.value = void 0, ir.value = !1, ar.value = "";
|
|
1263
1282
|
}
|
|
1264
|
-
function
|
|
1265
|
-
|
|
1283
|
+
function ms() {
|
|
1284
|
+
Or(!1), I.value = !1, L.value = !1, zn.value = !1, Hn.value = !1, Un.value = !1, Wn.value = !1, Gn.value = !1;
|
|
1266
1285
|
}
|
|
1267
|
-
function
|
|
1268
|
-
|
|
1286
|
+
function hs() {
|
|
1287
|
+
ms(), P.value = !P.value, v(() => co(() => sn.value?.focusChromeToggle()));
|
|
1269
1288
|
}
|
|
1270
|
-
let
|
|
1289
|
+
let gs = [
|
|
1271
1290
|
".gd-contract-template-designer__context-menu",
|
|
1272
1291
|
".gd-contract-template-designer__bubble-menu",
|
|
1273
1292
|
".gd-contract-template-designer__bubble-menu-popup"
|
|
1274
1293
|
].join(",");
|
|
1275
|
-
function
|
|
1276
|
-
let e = W.value ||
|
|
1294
|
+
function _s() {
|
|
1295
|
+
let e = W.value || nr.value || er.value || Nr.value || F.value || En.value, t = O.value, n = e ? void 0 : j.get(t)?.getSelectionViewportRect();
|
|
1277
1296
|
if (!n) {
|
|
1278
1297
|
z.value = void 0;
|
|
1279
1298
|
return;
|
|
@@ -1283,10 +1302,10 @@ var Vt = {
|
|
|
1283
1302
|
pageId: t,
|
|
1284
1303
|
x: a.x,
|
|
1285
1304
|
y: a.y
|
|
1286
|
-
},
|
|
1305
|
+
}, v(() => vs(n));
|
|
1287
1306
|
}
|
|
1288
|
-
function
|
|
1289
|
-
let t =
|
|
1307
|
+
function vs(e) {
|
|
1308
|
+
let t = $n.value?.getMenuElement(), n = z.value;
|
|
1290
1309
|
if (!t || !n) return;
|
|
1291
1310
|
let r = t.getBoundingClientRect(), i = e.top - r.height - tn, a = i >= 12 ? i : e.bottom + tn, o = vt((e.left + e.right) / 2 - r.width / 2, a, t);
|
|
1292
1311
|
z.value = {
|
|
@@ -1295,96 +1314,96 @@ var Vt = {
|
|
|
1295
1314
|
y: o.y
|
|
1296
1315
|
};
|
|
1297
1316
|
}
|
|
1298
|
-
function
|
|
1299
|
-
let e = z.value?.pageId ??
|
|
1300
|
-
|
|
1317
|
+
function ys() {
|
|
1318
|
+
let e = z.value?.pageId ?? O.value, t = j.get(e)?.getSelectionRange();
|
|
1319
|
+
tr = t ? {
|
|
1301
1320
|
pageId: e,
|
|
1302
1321
|
...t
|
|
1303
|
-
} : void 0,
|
|
1322
|
+
} : void 0, er.value = !0, z.value = void 0;
|
|
1304
1323
|
}
|
|
1305
|
-
function
|
|
1306
|
-
if (!
|
|
1307
|
-
let t =
|
|
1308
|
-
t && n && t.pageId === e && t.from === n.from && t.to === n.to || (
|
|
1324
|
+
function bs(e) {
|
|
1325
|
+
if (!er.value) return;
|
|
1326
|
+
let t = tr, n = j.get(e)?.getSelectionRange();
|
|
1327
|
+
t && n && t.pageId === e && t.from === n.from && t.to === n.to || (er.value = !1, tr = void 0);
|
|
1309
1328
|
}
|
|
1310
|
-
function
|
|
1311
|
-
!z.value ||
|
|
1312
|
-
|
|
1329
|
+
function xs() {
|
|
1330
|
+
!z.value || rr !== void 0 || (rr = requestAnimationFrame(() => {
|
|
1331
|
+
rr = void 0, _s();
|
|
1313
1332
|
}));
|
|
1314
1333
|
}
|
|
1315
|
-
function
|
|
1316
|
-
|
|
1334
|
+
function Ss() {
|
|
1335
|
+
nr.value && (nr.value = !1, _s());
|
|
1317
1336
|
}
|
|
1318
|
-
function
|
|
1319
|
-
$(),
|
|
1337
|
+
function Cs() {
|
|
1338
|
+
$(), xs();
|
|
1320
1339
|
}
|
|
1321
|
-
function
|
|
1322
|
-
|
|
1340
|
+
function ws(e, t) {
|
|
1341
|
+
j.get(z.value?.pageId ?? O.value)?.requestTextContextMenu(e, t);
|
|
1323
1342
|
}
|
|
1324
|
-
function
|
|
1343
|
+
function Ts(e) {
|
|
1325
1344
|
let t = e.target instanceof Element ? e.target : null;
|
|
1326
|
-
t?.closest(".ProseMirror") && (
|
|
1345
|
+
t?.closest(".ProseMirror") && (nr.value = !0, z.value = void 0), !(!R.value && !B.value && !V.value && !z.value) && (t?.closest(gs) || ($(), z.value && ys()));
|
|
1327
1346
|
}
|
|
1328
|
-
function
|
|
1329
|
-
(e.target instanceof Element ? e.target : null)?.closest(
|
|
1347
|
+
function Es(e) {
|
|
1348
|
+
(e.target instanceof Element ? e.target : null)?.closest(gs) || ($(), xs());
|
|
1330
1349
|
}
|
|
1331
|
-
function
|
|
1350
|
+
function Ds(e) {
|
|
1332
1351
|
let t = rn.value;
|
|
1333
1352
|
if (!t || typeof document > "u") return !1;
|
|
1334
1353
|
let n = e.target instanceof Node ? e.target : void 0, r = document.activeElement;
|
|
1335
1354
|
return !!(n && t.contains(n) || r && t.contains(r) || n instanceof Element && n.closest(".gd-contract-template-designer__context-menu"));
|
|
1336
1355
|
}
|
|
1337
|
-
function
|
|
1356
|
+
function Os(e) {
|
|
1338
1357
|
if (e.key !== "Escape" || !F.value || typeof document > "u") return;
|
|
1339
1358
|
let t = rn.value?.querySelector(".gd-contract-template-designer__page-decorations-studio");
|
|
1340
1359
|
if (!t) return;
|
|
1341
|
-
let n = e.target instanceof Element ? e.target : null, r = document.activeElement instanceof Element ? document.activeElement : null, i = !!(n?.closest(
|
|
1360
|
+
let n = e.target instanceof Element ? e.target : null, r = document.activeElement instanceof Element ? document.activeElement : null, i = !!(n?.closest(fr) || r?.closest(fr)), a = !!(n && t.contains(n) || r && t.contains(r)), o = !!t.querySelector(".ant-select-open, .ant-dropdown-open");
|
|
1342
1361
|
if (i || a && o) {
|
|
1343
|
-
|
|
1362
|
+
dr.add(e);
|
|
1344
1363
|
return;
|
|
1345
1364
|
}
|
|
1346
|
-
!
|
|
1365
|
+
!Nr.value && (a || e.target === document) && (e.preventDefault(), e.stopPropagation(), Ao());
|
|
1347
1366
|
}
|
|
1348
|
-
function
|
|
1367
|
+
function ks(e) {
|
|
1349
1368
|
if ((e.ctrlKey || e.metaKey) && !e.altKey && e.key.toLowerCase() === "s") {
|
|
1350
|
-
if (!
|
|
1351
|
-
e.preventDefault(),
|
|
1369
|
+
if (!Pr.value || !Ds(e)) return;
|
|
1370
|
+
e.preventDefault(), mi();
|
|
1352
1371
|
return;
|
|
1353
1372
|
}
|
|
1354
1373
|
if (e.key === "Escape") {
|
|
1355
|
-
if (
|
|
1356
|
-
|
|
1374
|
+
if (dr.has(e)) {
|
|
1375
|
+
dr.delete(e);
|
|
1357
1376
|
return;
|
|
1358
1377
|
}
|
|
1359
|
-
let t =
|
|
1360
|
-
if (!t && F.value &&
|
|
1378
|
+
let t = Nr.value, n = t || F.value;
|
|
1379
|
+
if (!t && F.value && Ao(), $(), ms(), n && e.stopPropagation(), !n) {
|
|
1361
1380
|
if (z.value) {
|
|
1362
|
-
|
|
1381
|
+
ys(), e.stopPropagation();
|
|
1363
1382
|
return;
|
|
1364
1383
|
}
|
|
1365
|
-
|
|
1384
|
+
In.value ? uo() : N.value = !1;
|
|
1366
1385
|
}
|
|
1367
1386
|
}
|
|
1368
1387
|
}
|
|
1369
|
-
function
|
|
1370
|
-
e ===
|
|
1371
|
-
let n =
|
|
1372
|
-
n && gt(n, t) || (
|
|
1373
|
-
...
|
|
1388
|
+
function As(e, t) {
|
|
1389
|
+
e === O.value && t.selectedContentImage && (D.value = ""), e === O.value && (bs(e), _s());
|
|
1390
|
+
let n = Bn.value[e];
|
|
1391
|
+
n && gt(n, t) || (Bn.value = {
|
|
1392
|
+
...Bn.value,
|
|
1374
1393
|
[e]: t
|
|
1375
1394
|
});
|
|
1376
1395
|
}
|
|
1377
|
-
function
|
|
1396
|
+
function js(e = ur.value.rows, t = ur.value.cols) {
|
|
1378
1397
|
Q({
|
|
1379
1398
|
type: "insert-table",
|
|
1380
1399
|
options: {
|
|
1381
1400
|
rows: Math.min(10, Math.max(1, Math.round(Number(e) || 3))),
|
|
1382
1401
|
cols: Math.min(10, Math.max(1, Math.round(Number(t) || 3))),
|
|
1383
|
-
withHeaderRow: !!
|
|
1402
|
+
withHeaderRow: !!ur.value.withHeaderRow
|
|
1384
1403
|
}
|
|
1385
1404
|
}), I.value = !1, $();
|
|
1386
1405
|
}
|
|
1387
|
-
let
|
|
1406
|
+
let Ms = {
|
|
1388
1407
|
"delete-table-row": {
|
|
1389
1408
|
label: "删除当前行",
|
|
1390
1409
|
countKey: "deleteRow"
|
|
@@ -1398,12 +1417,12 @@ var Vt = {
|
|
|
1398
1417
|
countKey: "deleteTable"
|
|
1399
1418
|
}
|
|
1400
1419
|
};
|
|
1401
|
-
function
|
|
1420
|
+
function Ns(e) {
|
|
1402
1421
|
let t = B.value;
|
|
1403
1422
|
if (!t) return;
|
|
1404
1423
|
let n = () => {
|
|
1405
1424
|
Q(e, t.pageId), $();
|
|
1406
|
-
}, r =
|
|
1425
|
+
}, r = Ms[e.type];
|
|
1407
1426
|
if (!r) {
|
|
1408
1427
|
n();
|
|
1409
1428
|
return;
|
|
@@ -1416,16 +1435,16 @@ var Vt = {
|
|
|
1416
1435
|
okType: "danger",
|
|
1417
1436
|
cancelText: "取消",
|
|
1418
1437
|
onOk: n,
|
|
1419
|
-
onCancel: () =>
|
|
1438
|
+
onCancel: () => j.get(t.pageId)?.focus()
|
|
1420
1439
|
});
|
|
1421
1440
|
}
|
|
1422
|
-
function
|
|
1423
|
-
let t =
|
|
1441
|
+
function Ps(e) {
|
|
1442
|
+
let t = or.value?.getMenuElement();
|
|
1424
1443
|
if (!t) return;
|
|
1425
1444
|
if (e.key === "Escape") {
|
|
1426
1445
|
e.preventDefault(), e.stopPropagation();
|
|
1427
1446
|
let t = B.value?.pageId;
|
|
1428
|
-
$(),
|
|
1447
|
+
$(), j.get(t ?? "")?.focus();
|
|
1429
1448
|
return;
|
|
1430
1449
|
}
|
|
1431
1450
|
let n = Array.from(t.querySelectorAll("button:not(:disabled)"));
|
|
@@ -1443,115 +1462,117 @@ var Vt = {
|
|
|
1443
1462
|
let r = (Math.max(0, n.indexOf(document.activeElement)) + (e.key === "ArrowUp" || e.key === "ArrowLeft" ? -1 : 1) + n.length) % n.length;
|
|
1444
1463
|
e.preventDefault(), n[r]?.focus();
|
|
1445
1464
|
}
|
|
1446
|
-
function
|
|
1465
|
+
function Fs(e) {
|
|
1447
1466
|
if (e.key !== "Escape") return;
|
|
1448
1467
|
e.preventDefault(), e.stopPropagation();
|
|
1449
1468
|
let t = R.value?.pageId;
|
|
1450
|
-
$(),
|
|
1469
|
+
$(), j.get(t ?? "")?.focus();
|
|
1451
1470
|
}
|
|
1452
|
-
function
|
|
1471
|
+
function Is(e) {
|
|
1453
1472
|
if (e.key !== "Escape") return;
|
|
1454
1473
|
e.preventDefault(), e.stopPropagation();
|
|
1455
1474
|
let t = V.value?.pageId;
|
|
1456
|
-
$(),
|
|
1475
|
+
$(), j.get(t ?? "")?.focus();
|
|
1457
1476
|
}
|
|
1458
|
-
function
|
|
1477
|
+
function Ls(e) {
|
|
1459
1478
|
Q({ type: e }), L.value = !1, $();
|
|
1460
1479
|
}
|
|
1461
1480
|
return Xe({
|
|
1462
|
-
getValue:
|
|
1463
|
-
setValue:
|
|
1464
|
-
getFiles:
|
|
1465
|
-
setFiles:
|
|
1466
|
-
addFile:
|
|
1467
|
-
selectFile:
|
|
1468
|
-
renameFile:
|
|
1469
|
-
removeFile:
|
|
1470
|
-
moveFile:
|
|
1471
|
-
validate:
|
|
1472
|
-
exportTemplate:
|
|
1473
|
-
exportFiles:
|
|
1474
|
-
getSubmitData:
|
|
1475
|
-
clearTemplate:
|
|
1476
|
-
saveDraftCache:
|
|
1477
|
-
loadDraftCache:
|
|
1478
|
-
clearDraftCache:
|
|
1479
|
-
getDraftCacheStatus:
|
|
1480
|
-
insertVariable:
|
|
1481
|
-
insertImage:
|
|
1482
|
-
focus:
|
|
1483
|
-
openPreview:
|
|
1484
|
-
closePreview:
|
|
1485
|
-
openSubmitDataViewer:
|
|
1486
|
-
closeSubmitDataViewer:
|
|
1487
|
-
getVariableData:
|
|
1488
|
-
openVariableDataViewer:
|
|
1489
|
-
closeVariableDataViewer:
|
|
1490
|
-
setServerValidationErrors:
|
|
1491
|
-
clearValidationErrors:
|
|
1492
|
-
scrollToVariable:
|
|
1493
|
-
scrollToPage:
|
|
1494
|
-
setZoom:
|
|
1495
|
-
resetZoom:
|
|
1496
|
-
getZoom:
|
|
1497
|
-
fitWidth:
|
|
1498
|
-
}), (e, t) => (
|
|
1481
|
+
getValue: jo,
|
|
1482
|
+
setValue: Mo,
|
|
1483
|
+
getFiles: No,
|
|
1484
|
+
setFiles: Po,
|
|
1485
|
+
addFile: Fo,
|
|
1486
|
+
selectFile: Io,
|
|
1487
|
+
renameFile: Lo,
|
|
1488
|
+
removeFile: Ro,
|
|
1489
|
+
moveFile: Bo,
|
|
1490
|
+
validate: Vo,
|
|
1491
|
+
exportTemplate: Wo,
|
|
1492
|
+
exportFiles: Go,
|
|
1493
|
+
getSubmitData: ho,
|
|
1494
|
+
clearTemplate: xo,
|
|
1495
|
+
saveDraftCache: mi,
|
|
1496
|
+
loadDraftCache: hi,
|
|
1497
|
+
clearDraftCache: gi,
|
|
1498
|
+
getDraftCacheStatus: Wi,
|
|
1499
|
+
insertVariable: Ha,
|
|
1500
|
+
insertImage: ya,
|
|
1501
|
+
focus: Yo,
|
|
1502
|
+
openPreview: po,
|
|
1503
|
+
closePreview: mo,
|
|
1504
|
+
openSubmitDataViewer: go,
|
|
1505
|
+
closeSubmitDataViewer: _o,
|
|
1506
|
+
getVariableData: vo,
|
|
1507
|
+
openVariableDataViewer: yo,
|
|
1508
|
+
closeVariableDataViewer: bo,
|
|
1509
|
+
setServerValidationErrors: qo,
|
|
1510
|
+
clearValidationErrors: Jo,
|
|
1511
|
+
scrollToVariable: To,
|
|
1512
|
+
scrollToPage: Oo,
|
|
1513
|
+
setZoom: no,
|
|
1514
|
+
resetZoom: ro,
|
|
1515
|
+
getZoom: io,
|
|
1516
|
+
fitWidth: Qa
|
|
1517
|
+
}), (e, t) => (y(), xt("div", {
|
|
1499
1518
|
ref_key: "designerElement",
|
|
1500
1519
|
ref: rn,
|
|
1501
|
-
class:
|
|
1520
|
+
class: Ct(["gd-contract-template-designer", {
|
|
1502
1521
|
"is-disabled": s.disabled,
|
|
1503
1522
|
"is-readonly": W.value,
|
|
1504
|
-
"is-fullscreen":
|
|
1505
|
-
"is-immersive":
|
|
1523
|
+
"is-fullscreen": N.value,
|
|
1524
|
+
"is-immersive": In.value
|
|
1506
1525
|
}]),
|
|
1507
|
-
style:
|
|
1508
|
-
onKeydownCapture: t[31] ||= (...e) =>
|
|
1526
|
+
style: wt(nn.value),
|
|
1527
|
+
onKeydownCapture: t[31] ||= (...e) => x(Mr) && x(Mr)(...e)
|
|
1509
1528
|
}, [
|
|
1510
|
-
|
|
1529
|
+
C.value ? (y(), p(ft, {
|
|
1511
1530
|
key: 0,
|
|
1512
|
-
files:
|
|
1513
|
-
"active-file-id":
|
|
1531
|
+
files: w.value,
|
|
1532
|
+
"active-file-id": T.value,
|
|
1514
1533
|
readonly: W.value,
|
|
1515
|
-
onSelect:
|
|
1516
|
-
onAdd: t[0] ||= (e) =>
|
|
1517
|
-
onRename:
|
|
1518
|
-
onRemove:
|
|
1519
|
-
onMove:
|
|
1534
|
+
onSelect: Io,
|
|
1535
|
+
onAdd: t[0] ||= (e) => Fo(),
|
|
1536
|
+
onRename: Lo,
|
|
1537
|
+
onRemove: zo,
|
|
1538
|
+
onMove: Bo
|
|
1520
1539
|
}, null, 8, [
|
|
1521
1540
|
"files",
|
|
1522
1541
|
"active-file-id",
|
|
1523
1542
|
"readonly"
|
|
1524
|
-
])) :
|
|
1525
|
-
|
|
1526
|
-
"is-sidebar-collapsed":
|
|
1527
|
-
"is-inspector-collapsed":
|
|
1543
|
+
])) : m("", !0),
|
|
1544
|
+
h("div", { class: Ct(["gd-contract-template-designer__layout", {
|
|
1545
|
+
"is-sidebar-collapsed": Pn.value,
|
|
1546
|
+
"is-inspector-collapsed": Fn.value
|
|
1528
1547
|
}]) }, [
|
|
1529
|
-
|
|
1530
|
-
collapsed:
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
"
|
|
1535
|
-
"
|
|
1536
|
-
"
|
|
1537
|
-
"
|
|
1548
|
+
g(pt, {
|
|
1549
|
+
collapsed: Pn.value,
|
|
1550
|
+
"file-id": T.value,
|
|
1551
|
+
pages: E.value.pages,
|
|
1552
|
+
variables: E.value.variables,
|
|
1553
|
+
"decoration-variable-keys": ui.value,
|
|
1554
|
+
"active-page-id": O.value,
|
|
1555
|
+
"selected-variable-key": D.value,
|
|
1556
|
+
"normalized-max-pages": ci.value,
|
|
1557
|
+
"page-limit-reached": li.value,
|
|
1538
1558
|
"selected-page": G.value,
|
|
1539
|
-
"selected-page-size":
|
|
1540
|
-
"normalized-page-size-options":
|
|
1541
|
-
"page-size-options":
|
|
1542
|
-
"selected-page-size-option-value":
|
|
1559
|
+
"selected-page-size": zr.value,
|
|
1560
|
+
"normalized-page-size-options": ti.value,
|
|
1561
|
+
"page-size-options": ni.value,
|
|
1562
|
+
"selected-page-size-option-value": ri.value,
|
|
1543
1563
|
readonly: W.value,
|
|
1544
|
-
"get-page-size":
|
|
1545
|
-
onToggle: t[1] ||= (e) =>
|
|
1546
|
-
onAddPage:
|
|
1547
|
-
onActivatePage:
|
|
1548
|
-
onNavigateOutline:
|
|
1549
|
-
onDuplicatePage:
|
|
1550
|
-
onRemovePage:
|
|
1551
|
-
onPatchPageFormat:
|
|
1552
|
-
onScrollToVariable:
|
|
1564
|
+
"get-page-size": ea,
|
|
1565
|
+
onToggle: t[1] ||= (e) => Pn.value = !Pn.value,
|
|
1566
|
+
onAddPage: ra,
|
|
1567
|
+
onActivatePage: Eo,
|
|
1568
|
+
onNavigateOutline: Do,
|
|
1569
|
+
onDuplicatePage: ia,
|
|
1570
|
+
onRemovePage: oa,
|
|
1571
|
+
onPatchPageFormat: ta,
|
|
1572
|
+
onScrollToVariable: wo
|
|
1553
1573
|
}, null, 8, [
|
|
1554
1574
|
"collapsed",
|
|
1575
|
+
"file-id",
|
|
1555
1576
|
"pages",
|
|
1556
1577
|
"variables",
|
|
1557
1578
|
"decoration-variable-keys",
|
|
@@ -1566,71 +1587,71 @@ var Vt = {
|
|
|
1566
1587
|
"selected-page-size-option-value",
|
|
1567
1588
|
"readonly"
|
|
1568
1589
|
]),
|
|
1569
|
-
|
|
1590
|
+
h("main", {
|
|
1570
1591
|
ref_key: "workspaceElement",
|
|
1571
1592
|
ref: on,
|
|
1572
1593
|
class: "gd-contract-template-designer__workspace"
|
|
1573
1594
|
}, [
|
|
1574
|
-
Nt(
|
|
1595
|
+
Nt(h("div", {
|
|
1575
1596
|
id: un,
|
|
1576
1597
|
class: "gd-contract-template-designer__workspace-chrome"
|
|
1577
|
-
}, [
|
|
1598
|
+
}, [g(Re, {
|
|
1578
1599
|
ref_key: "workspaceHeaderElement",
|
|
1579
1600
|
ref: sn,
|
|
1580
|
-
summary:
|
|
1581
|
-
"draft-cache-status-text":
|
|
1582
|
-
"draft-cache-status-class":
|
|
1601
|
+
summary: Hr.value,
|
|
1602
|
+
"draft-cache-status-text": Kr.value,
|
|
1603
|
+
"draft-cache-status-class": qr.value,
|
|
1583
1604
|
"show-draft-cache-status": s.showDraftCacheStatus,
|
|
1584
1605
|
"show-clear-button": s.showClearButton,
|
|
1585
1606
|
"show-submit-data-viewer": s.showSubmitDataViewer,
|
|
1586
1607
|
"show-variable-data-viewer": s.showVariableDataViewer,
|
|
1587
1608
|
readonly: W.value,
|
|
1588
|
-
"zoom-percent":
|
|
1589
|
-
"zoom-out-disabled":
|
|
1590
|
-
"zoom-in-disabled":
|
|
1591
|
-
"is-fullscreen":
|
|
1592
|
-
immersive:
|
|
1609
|
+
"zoom-percent": Jr.value,
|
|
1610
|
+
"zoom-out-disabled": M.value <= Gt,
|
|
1611
|
+
"zoom-in-disabled": M.value >= Kt,
|
|
1612
|
+
"is-fullscreen": N.value,
|
|
1613
|
+
immersive: In.value,
|
|
1593
1614
|
"page-decorations-open": F.value,
|
|
1594
1615
|
"page-decorations-studio-id": ln,
|
|
1595
|
-
"page-decorations-preset-label":
|
|
1596
|
-
"page-decorations-enabled-count":
|
|
1597
|
-
"page-decorations-enabled-states":
|
|
1616
|
+
"page-decorations-preset-label": Ur.value,
|
|
1617
|
+
"page-decorations-enabled-count": Gr.value,
|
|
1618
|
+
"page-decorations-enabled-states": Wr.value,
|
|
1598
1619
|
"chrome-controls-id": un,
|
|
1599
|
-
onZoomOut:
|
|
1600
|
-
onZoomIn:
|
|
1601
|
-
onFitWidth:
|
|
1602
|
-
onResetZoom:
|
|
1603
|
-
onToggleFullscreen:
|
|
1604
|
-
onToggleImmersive:
|
|
1605
|
-
onClear:
|
|
1606
|
-
onValidate:
|
|
1607
|
-
onPreview:
|
|
1608
|
-
onSubmitData:
|
|
1609
|
-
onVariableData:
|
|
1610
|
-
onTogglePageDecorations:
|
|
1611
|
-
onToggleChrome:
|
|
1620
|
+
onZoomOut: oo,
|
|
1621
|
+
onZoomIn: ao,
|
|
1622
|
+
onFitWidth: x(Qa),
|
|
1623
|
+
onResetZoom: ro,
|
|
1624
|
+
onToggleFullscreen: so,
|
|
1625
|
+
onToggleImmersive: fo,
|
|
1626
|
+
onClear: So,
|
|
1627
|
+
onValidate: Vo,
|
|
1628
|
+
onPreview: po,
|
|
1629
|
+
onSubmitData: go,
|
|
1630
|
+
onVariableData: yo,
|
|
1631
|
+
onTogglePageDecorations: ko,
|
|
1632
|
+
onToggleChrome: hs
|
|
1612
1633
|
}, {
|
|
1613
|
-
authoring: Mt(() => [
|
|
1634
|
+
authoring: Mt(() => [g(Ve, {
|
|
1614
1635
|
ref_key: "authoringBarElement",
|
|
1615
1636
|
ref: pn,
|
|
1616
1637
|
compact: "",
|
|
1617
|
-
query:
|
|
1618
|
-
"onUpdate:query": t[2] ||= (e) =>
|
|
1619
|
-
replacement:
|
|
1620
|
-
"onUpdate:replacement": t[3] ||= (e) =>
|
|
1621
|
-
"match-case":
|
|
1622
|
-
"onUpdate:matchCase": t[4] ||= (e) =>
|
|
1623
|
-
panel:
|
|
1638
|
+
query: x(yr),
|
|
1639
|
+
"onUpdate:query": t[2] ||= (e) => St(yr) ? yr.value = e : null,
|
|
1640
|
+
replacement: x(br),
|
|
1641
|
+
"onUpdate:replacement": t[3] ||= (e) => St(br) ? br.value = e : null,
|
|
1642
|
+
"match-case": x(xr),
|
|
1643
|
+
"onUpdate:matchCase": t[4] ||= (e) => St(xr) ? xr.value = e : null,
|
|
1644
|
+
panel: x(vr),
|
|
1624
1645
|
readonly: W.value,
|
|
1625
|
-
total:
|
|
1626
|
-
"current-index":
|
|
1627
|
-
"current-page":
|
|
1628
|
-
feedback:
|
|
1629
|
-
onOpen:
|
|
1630
|
-
onClose: t[5] ||= (e) =>
|
|
1631
|
-
onNavigate:
|
|
1632
|
-
onReplaceCurrent:
|
|
1633
|
-
onReplaceAll:
|
|
1646
|
+
total: x(Sr).length,
|
|
1647
|
+
"current-index": x(Cr),
|
|
1648
|
+
"current-page": x(wr) ? x(wr).pageIndex + 1 : void 0,
|
|
1649
|
+
feedback: x(Tr),
|
|
1650
|
+
onOpen: x(Dr),
|
|
1651
|
+
onClose: t[5] ||= (e) => x(Or)(),
|
|
1652
|
+
onNavigate: x(kr),
|
|
1653
|
+
onReplaceCurrent: x(Ar),
|
|
1654
|
+
onReplaceAll: x(jr)
|
|
1634
1655
|
}, null, 8, [
|
|
1635
1656
|
"query",
|
|
1636
1657
|
"replacement",
|
|
@@ -1666,70 +1687,70 @@ var Vt = {
|
|
|
1666
1687
|
"page-decorations-enabled-count",
|
|
1667
1688
|
"page-decorations-enabled-states",
|
|
1668
1689
|
"onFitWidth"
|
|
1669
|
-
]),
|
|
1670
|
-
"variable-insert-popover-open":
|
|
1671
|
-
"onUpdate:variableInsertPopoverOpen": t[6] ||= (e) =>
|
|
1672
|
-
"signing-layout-popover-open":
|
|
1673
|
-
"onUpdate:signingLayoutPopoverOpen": t[7] ||= (e) =>
|
|
1674
|
-
"signing-mark-popover-open":
|
|
1675
|
-
"onUpdate:signingMarkPopoverOpen": t[8] ||= (e) =>
|
|
1676
|
-
"image-insert-popover-open":
|
|
1677
|
-
"onUpdate:imageInsertPopoverOpen": t[9] ||= (e) =>
|
|
1678
|
-
"image-insert-url":
|
|
1679
|
-
"onUpdate:imageInsertUrl": t[10] ||= (e) =>
|
|
1680
|
-
"image-insert-width":
|
|
1681
|
-
"onUpdate:imageInsertWidth": t[11] ||= (e) =>
|
|
1682
|
-
"image-insert-height":
|
|
1683
|
-
"onUpdate:imageInsertHeight": t[12] ||= (e) =>
|
|
1690
|
+
]), g(Be, {
|
|
1691
|
+
"variable-insert-popover-open": Hn.value,
|
|
1692
|
+
"onUpdate:variableInsertPopoverOpen": t[6] ||= (e) => Hn.value = e,
|
|
1693
|
+
"signing-layout-popover-open": Wn.value,
|
|
1694
|
+
"onUpdate:signingLayoutPopoverOpen": t[7] ||= (e) => Wn.value = e,
|
|
1695
|
+
"signing-mark-popover-open": Gn.value,
|
|
1696
|
+
"onUpdate:signingMarkPopoverOpen": t[8] ||= (e) => Gn.value = e,
|
|
1697
|
+
"image-insert-popover-open": Un.value,
|
|
1698
|
+
"onUpdate:imageInsertPopoverOpen": t[9] ||= (e) => Un.value = e,
|
|
1699
|
+
"image-insert-url": qn.value,
|
|
1700
|
+
"onUpdate:imageInsertUrl": t[10] ||= (e) => qn.value = e,
|
|
1701
|
+
"image-insert-width": Jn.value,
|
|
1702
|
+
"onUpdate:imageInsertWidth": t[11] ||= (e) => Jn.value = e,
|
|
1703
|
+
"image-insert-height": Yn.value,
|
|
1704
|
+
"onUpdate:imageInsertHeight": t[12] ||= (e) => Yn.value = e,
|
|
1684
1705
|
"table-insert-popover-open": I.value,
|
|
1685
1706
|
"onUpdate:tableInsertPopoverOpen": t[13] ||= (e) => I.value = e,
|
|
1686
1707
|
"table-actions-popover-open": L.value,
|
|
1687
1708
|
"onUpdate:tableActionsPopoverOpen": t[14] ||= (e) => L.value = e,
|
|
1688
|
-
"table-insert-draft":
|
|
1689
|
-
"onUpdate:tableInsertDraft": t[15] ||= (e) =>
|
|
1690
|
-
"toolbar-more-open":
|
|
1691
|
-
"onUpdate:toolbarMoreOpen": t[16] ||= (e) =>
|
|
1709
|
+
"table-insert-draft": ur.value,
|
|
1710
|
+
"onUpdate:tableInsertDraft": t[15] ||= (e) => ur.value = e,
|
|
1711
|
+
"toolbar-more-open": zn.value,
|
|
1712
|
+
"onUpdate:toolbarMoreOpen": t[16] ||= (e) => zn.value = e,
|
|
1692
1713
|
readonly: W.value,
|
|
1693
1714
|
"editor-state": J.value,
|
|
1694
|
-
"current-block-format":
|
|
1695
|
-
"block-format-options":
|
|
1696
|
-
"font-family-select-options":
|
|
1697
|
-
"current-editor-font-family":
|
|
1698
|
-
"font-size-preset-options":
|
|
1699
|
-
"current-editor-font-size":
|
|
1700
|
-
"editor-font-size-search-value":
|
|
1701
|
-
"current-editor-text-color":
|
|
1702
|
-
"body-control-tool-items":
|
|
1703
|
-
"signing-layout-presets":
|
|
1704
|
-
"page-limit-reached":
|
|
1705
|
-
"normalized-max-pages":
|
|
1706
|
-
"image-processing":
|
|
1707
|
-
"image-insert-error":
|
|
1715
|
+
"current-block-format": wi.value,
|
|
1716
|
+
"block-format-options": Qr,
|
|
1717
|
+
"font-family-select-options": Xr.value,
|
|
1718
|
+
"current-editor-font-family": Ti.value,
|
|
1719
|
+
"font-size-preset-options": ki.value,
|
|
1720
|
+
"current-editor-font-size": Ei.value,
|
|
1721
|
+
"editor-font-size-search-value": Vn.value,
|
|
1722
|
+
"current-editor-text-color": Di.value,
|
|
1723
|
+
"body-control-tool-items": si.value,
|
|
1724
|
+
"signing-layout-presets": oi.value,
|
|
1725
|
+
"page-limit-reached": li.value,
|
|
1726
|
+
"normalized-max-pages": ci.value,
|
|
1727
|
+
"image-processing": Zn.value,
|
|
1728
|
+
"image-insert-error": Xn.value,
|
|
1708
1729
|
onCommand: t[17] ||= (e) => Q(e),
|
|
1709
|
-
onPatchBlockFormat:
|
|
1710
|
-
onPatchFontFamily:
|
|
1711
|
-
onPatchFontSize:
|
|
1712
|
-
onPatchColor:
|
|
1713
|
-
onPatchTextAlign:
|
|
1714
|
-
onInsertVariable:
|
|
1715
|
-
onInsertSigningLayout:
|
|
1716
|
-
onInsertSigningMark:
|
|
1717
|
-
onOpenSigningLayoutCustom:
|
|
1718
|
-
onOpenImageFile:
|
|
1719
|
-
onInsertImageUrl:
|
|
1720
|
-
onAddPage:
|
|
1721
|
-
onInsertTable:
|
|
1722
|
-
onTableAction:
|
|
1723
|
-
onFontSizeSearch:
|
|
1724
|
-
onFontSizeCommit:
|
|
1725
|
-
onFontSizeDropdownChange:
|
|
1726
|
-
onFontSizeKeydown:
|
|
1727
|
-
}, null, 8, /* @__PURE__ */ "variable-insert-popover-open.signing-layout-popover-open.signing-mark-popover-open.image-insert-popover-open.image-insert-url.image-insert-width.image-insert-height.table-insert-popover-open.table-actions-popover-open.table-insert-draft.toolbar-more-open.readonly.editor-state.current-block-format.font-family-select-options.current-editor-font-family.font-size-preset-options.current-editor-font-size.editor-font-size-search-value.current-editor-text-color.body-control-tool-items.signing-layout-presets.page-limit-reached.normalized-max-pages.image-processing.image-insert-error".split("."))], 512), [[jt, !
|
|
1728
|
-
|
|
1730
|
+
onPatchBlockFormat: Zo,
|
|
1731
|
+
onPatchFontFamily: $o,
|
|
1732
|
+
onPatchFontSize: Qo,
|
|
1733
|
+
onPatchColor: es,
|
|
1734
|
+
onPatchTextAlign: Xo,
|
|
1735
|
+
onInsertVariable: Ca,
|
|
1736
|
+
onInsertSigningLayout: Ki,
|
|
1737
|
+
onInsertSigningMark: Yi,
|
|
1738
|
+
onOpenSigningLayoutCustom: Ji,
|
|
1739
|
+
onOpenImageFile: ba,
|
|
1740
|
+
onInsertImageUrl: Sa,
|
|
1741
|
+
onAddPage: ra,
|
|
1742
|
+
onInsertTable: js,
|
|
1743
|
+
onTableAction: Ls,
|
|
1744
|
+
onFontSizeSearch: ns,
|
|
1745
|
+
onFontSizeCommit: rs,
|
|
1746
|
+
onFontSizeDropdownChange: as,
|
|
1747
|
+
onFontSizeKeydown: is
|
|
1748
|
+
}, null, 8, /* @__PURE__ */ "variable-insert-popover-open.signing-layout-popover-open.signing-mark-popover-open.image-insert-popover-open.image-insert-url.image-insert-width.image-insert-height.table-insert-popover-open.table-actions-popover-open.table-insert-draft.toolbar-more-open.readonly.editor-state.current-block-format.font-family-select-options.current-editor-font-family.font-size-preset-options.current-editor-font-size.editor-font-size-search-value.current-editor-text-color.body-control-tool-items.signing-layout-presets.page-limit-reached.normalized-max-pages.image-processing.image-insert-error".split("."))], 512), [[jt, !P.value]]),
|
|
1749
|
+
P.value ? (y(), p(x(It), {
|
|
1729
1750
|
key: 0,
|
|
1730
1751
|
title: "展开工具区"
|
|
1731
1752
|
}, {
|
|
1732
|
-
default: Mt(() => [
|
|
1753
|
+
default: Mt(() => [h("button", {
|
|
1733
1754
|
ref_key: "workspaceChromeHandleElement",
|
|
1734
1755
|
ref: dn,
|
|
1735
1756
|
type: "button",
|
|
@@ -1737,64 +1758,66 @@ var Vt = {
|
|
|
1737
1758
|
"aria-label": "展开工具区",
|
|
1738
1759
|
"aria-expanded": !1,
|
|
1739
1760
|
"aria-controls": un,
|
|
1740
|
-
onClick:
|
|
1741
|
-
}, [
|
|
1761
|
+
onClick: hs
|
|
1762
|
+
}, [g(x(Bt), { "aria-hidden": "true" })], 512)]),
|
|
1742
1763
|
_: 1
|
|
1743
|
-
})) :
|
|
1744
|
-
|
|
1764
|
+
})) : m("", !0),
|
|
1765
|
+
In.value && !F.value ? (y(), xt("button", {
|
|
1745
1766
|
key: 1,
|
|
1746
1767
|
ref_key: "immersiveExitElement",
|
|
1747
|
-
ref:
|
|
1768
|
+
ref: Ln,
|
|
1748
1769
|
type: "button",
|
|
1749
1770
|
class: "gd-contract-template-designer__immersive-exit",
|
|
1750
1771
|
"aria-label": "退出沉浸写作",
|
|
1751
|
-
onClick:
|
|
1772
|
+
onClick: uo
|
|
1752
1773
|
}, [
|
|
1753
|
-
|
|
1754
|
-
t[32] ||=
|
|
1755
|
-
t[33] ||=
|
|
1756
|
-
], 512)) :
|
|
1757
|
-
|
|
1758
|
-
type:
|
|
1759
|
-
message:
|
|
1774
|
+
g(x(zt), { "aria-hidden": "true" }),
|
|
1775
|
+
t[32] ||= h("span", { class: "gd-contract-template-designer__immersive-exit-label" }, "退出沉浸", -1),
|
|
1776
|
+
t[33] ||= h("kbd", null, "Esc", -1)
|
|
1777
|
+
], 512)) : m("", !0),
|
|
1778
|
+
k.value ? (y(), xt("section", Vt, [g(x(Pt), {
|
|
1779
|
+
type: Br.value ? "success" : "error",
|
|
1780
|
+
message: Vr.value,
|
|
1760
1781
|
"show-icon": ""
|
|
1761
|
-
}, null, 8, ["type", "message"]),
|
|
1782
|
+
}, null, 8, ["type", "message"]), A.value.length ? (y(), xt("div", Ht, [(y(!0), xt(yt, null, Dt(A.value, (e) => (y(), xt("button", {
|
|
1762
1783
|
key: `${e.id}-${e.message}`,
|
|
1763
1784
|
type: "button",
|
|
1764
1785
|
class: "gd-contract-template-designer__validation-item",
|
|
1765
|
-
onClick: (t) =>
|
|
1766
|
-
}, [
|
|
1767
|
-
|
|
1786
|
+
onClick: (t) => Ho(e)
|
|
1787
|
+
}, [h("span", null, Ot(e.message), 1), h("small", null, Ot(Uo(e)), 1)], 8, Ut))), 128))])) : m("", !0)])) : m("", !0),
|
|
1788
|
+
h("div", {
|
|
1768
1789
|
ref_key: "canvasElement",
|
|
1769
1790
|
ref: an,
|
|
1770
1791
|
class: "gd-contract-template-designer__canvas"
|
|
1771
|
-
}, [(
|
|
1772
|
-
key: `${
|
|
1792
|
+
}, [(y(!0), xt(yt, null, Dt(E.value.pages, (e, n) => (y(), p(Ie, {
|
|
1793
|
+
key: `${T.value}:${e.id}`,
|
|
1773
1794
|
ref_for: !0,
|
|
1774
|
-
ref: (t) =>
|
|
1795
|
+
ref: (t) => Gi(e.id, t),
|
|
1775
1796
|
page: e,
|
|
1776
1797
|
"page-index": n,
|
|
1777
|
-
"page-size":
|
|
1778
|
-
"page-decorations":
|
|
1779
|
-
"total-pages":
|
|
1780
|
-
variables:
|
|
1781
|
-
"selected-variable-key":
|
|
1782
|
-
active:
|
|
1798
|
+
"page-size": ea(e),
|
|
1799
|
+
"page-decorations": E.value.pageDecorations,
|
|
1800
|
+
"total-pages": E.value.pages.length,
|
|
1801
|
+
variables: E.value.variables,
|
|
1802
|
+
"selected-variable-key": D.value,
|
|
1803
|
+
active: O.value === e.id,
|
|
1783
1804
|
readonly: s.readonly,
|
|
1784
1805
|
disabled: s.disabled,
|
|
1785
|
-
zoom:
|
|
1786
|
-
"process-image-file":
|
|
1787
|
-
"search-query":
|
|
1788
|
-
"search-match-case":
|
|
1789
|
-
"active-search-match":
|
|
1790
|
-
onPageUpdate:
|
|
1791
|
-
onVariableDrop:
|
|
1792
|
-
onVariableSelect:
|
|
1793
|
-
onEditorFocus: t[18] ||= (e) =>
|
|
1794
|
-
onEditorReady:
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1806
|
+
zoom: M.value,
|
|
1807
|
+
"process-image-file": va,
|
|
1808
|
+
"search-query": x(Er),
|
|
1809
|
+
"search-match-case": x(xr),
|
|
1810
|
+
"active-search-match": x(wr)?.pageId === e.id ? x(wr) : void 0,
|
|
1811
|
+
onPageUpdate: $i,
|
|
1812
|
+
onVariableDrop: Ta,
|
|
1813
|
+
onVariableSelect: Ea,
|
|
1814
|
+
onEditorFocus: t[18] ||= (e) => Eo(e, !1),
|
|
1815
|
+
onEditorReady: x(di),
|
|
1816
|
+
onCompositionEnd: x(di),
|
|
1817
|
+
onPageLayoutChange: x(di),
|
|
1818
|
+
onEditorStateChange: As,
|
|
1819
|
+
onEditorContextMenu: ps,
|
|
1820
|
+
onWordPaste: _a,
|
|
1798
1821
|
onVariableMoveBlocked: t[19] ||= (e) => H.value = "变量只能在当前页内移动,跨页移动尚未支持。"
|
|
1799
1822
|
}, null, 8, [
|
|
1800
1823
|
"page",
|
|
@@ -1811,41 +1834,43 @@ var Vt = {
|
|
|
1811
1834
|
"search-query",
|
|
1812
1835
|
"search-match-case",
|
|
1813
1836
|
"active-search-match",
|
|
1814
|
-
"onEditorReady"
|
|
1837
|
+
"onEditorReady",
|
|
1838
|
+
"onCompositionEnd",
|
|
1839
|
+
"onPageLayoutChange"
|
|
1815
1840
|
]))), 128))], 512)
|
|
1816
1841
|
], 512),
|
|
1817
|
-
|
|
1818
|
-
collapsed:
|
|
1842
|
+
g(mt, {
|
|
1843
|
+
collapsed: Fn.value,
|
|
1819
1844
|
readonly: s.readonly,
|
|
1820
1845
|
disabled: s.disabled,
|
|
1821
|
-
"body-control-tool-items":
|
|
1846
|
+
"body-control-tool-items": si.value,
|
|
1822
1847
|
"selected-variable": K.value,
|
|
1823
|
-
variables:
|
|
1824
|
-
"current-variable-font-family":
|
|
1825
|
-
"font-family-select-options":
|
|
1826
|
-
"text-align-options":
|
|
1827
|
-
"border-style-options":
|
|
1828
|
-
"object-fit-options":
|
|
1829
|
-
"selected-variable-width-max":
|
|
1830
|
-
"selected-variable-height-max":
|
|
1848
|
+
variables: E.value.variables,
|
|
1849
|
+
"current-variable-font-family": Oi.value,
|
|
1850
|
+
"font-family-select-options": Xr.value,
|
|
1851
|
+
"text-align-options": x(Zr),
|
|
1852
|
+
"border-style-options": $r,
|
|
1853
|
+
"object-fit-options": ei,
|
|
1854
|
+
"selected-variable-width-max": Si.value,
|
|
1855
|
+
"selected-variable-height-max": Ci.value,
|
|
1831
1856
|
"min-font-size": $t,
|
|
1832
1857
|
"max-font-size": en,
|
|
1833
|
-
"default-multiline-rows":
|
|
1834
|
-
onToggle: t[20] ||= (e) =>
|
|
1835
|
-
onVariableDragStart:
|
|
1836
|
-
onInsertVariable:
|
|
1837
|
-
onDuplicateVariable:
|
|
1838
|
-
onRemoveVariable:
|
|
1839
|
-
onPatchVariable:
|
|
1840
|
-
onRenameVariable:
|
|
1841
|
-
onPatchStyle:
|
|
1842
|
-
onPatchMultiline:
|
|
1843
|
-
onPatchRows:
|
|
1844
|
-
onPatchFontFamily:
|
|
1845
|
-
onPatchFontSize:
|
|
1846
|
-
onPatchTextAlign:
|
|
1847
|
-
onPatchBorderStyle:
|
|
1848
|
-
onPatchObjectFit:
|
|
1858
|
+
"default-multiline-rows": x(3),
|
|
1859
|
+
onToggle: t[20] ||= (e) => Fn.value = !Fn.value,
|
|
1860
|
+
onVariableDragStart: Ya,
|
|
1861
|
+
onInsertVariable: Ua,
|
|
1862
|
+
onDuplicateVariable: Va,
|
|
1863
|
+
onRemoveVariable: za,
|
|
1864
|
+
onPatchVariable: Oa,
|
|
1865
|
+
onRenameVariable: ka,
|
|
1866
|
+
onPatchStyle: Pa,
|
|
1867
|
+
onPatchMultiline: La,
|
|
1868
|
+
onPatchRows: Ra,
|
|
1869
|
+
onPatchFontFamily: Fa,
|
|
1870
|
+
onPatchFontSize: Ia,
|
|
1871
|
+
onPatchTextAlign: ja,
|
|
1872
|
+
onPatchBorderStyle: Ma,
|
|
1873
|
+
onPatchObjectFit: Na
|
|
1849
1874
|
}, null, 8, [
|
|
1850
1875
|
"collapsed",
|
|
1851
1876
|
"readonly",
|
|
@@ -1861,20 +1886,20 @@ var Vt = {
|
|
|
1861
1886
|
"default-multiline-rows"
|
|
1862
1887
|
])
|
|
1863
1888
|
], 2),
|
|
1864
|
-
Nt(
|
|
1889
|
+
Nt(g(ht, {
|
|
1865
1890
|
ref_key: "pageDecorationsStudioElement",
|
|
1866
1891
|
ref: cn,
|
|
1867
1892
|
id: ln,
|
|
1868
1893
|
open: F.value,
|
|
1869
|
-
decorations:
|
|
1870
|
-
variables:
|
|
1871
|
-
"font-family-options":
|
|
1894
|
+
decorations: E.value.pageDecorations,
|
|
1895
|
+
variables: E.value.variables,
|
|
1896
|
+
"font-family-options": Xr.value,
|
|
1872
1897
|
readonly: s.readonly,
|
|
1873
1898
|
disabled: s.disabled,
|
|
1874
|
-
"active-tab":
|
|
1875
|
-
"onUpdate:activeTab": t[21] ||= (e) =>
|
|
1876
|
-
onChange:
|
|
1877
|
-
onClose:
|
|
1899
|
+
"active-tab": Rn.value,
|
|
1900
|
+
"onUpdate:activeTab": t[21] ||= (e) => Rn.value = e,
|
|
1901
|
+
onChange: Aa,
|
|
1902
|
+
onClose: Ao
|
|
1878
1903
|
}, null, 8, [
|
|
1879
1904
|
"open",
|
|
1880
1905
|
"decorations",
|
|
@@ -1884,70 +1909,70 @@ var Vt = {
|
|
|
1884
1909
|
"disabled",
|
|
1885
1910
|
"active-tab"
|
|
1886
1911
|
]), [[jt, F.value]]),
|
|
1887
|
-
(
|
|
1888
|
-
B.value ? (
|
|
1912
|
+
(y(), p(bt, { to: "body" }, [
|
|
1913
|
+
B.value ? (y(), p(Le, {
|
|
1889
1914
|
key: 0,
|
|
1890
1915
|
ref_key: "tableContextMenuElement",
|
|
1891
|
-
ref:
|
|
1916
|
+
ref: or,
|
|
1892
1917
|
capabilities: B.value.capabilities,
|
|
1893
1918
|
"active-alignment": B.value.activeAlignment,
|
|
1894
|
-
style:
|
|
1919
|
+
style: wt({
|
|
1895
1920
|
left: `${B.value.x}px`,
|
|
1896
1921
|
top: `${B.value.y}px`
|
|
1897
1922
|
}),
|
|
1898
|
-
onExecute:
|
|
1899
|
-
onKeydown:
|
|
1923
|
+
onExecute: Ns,
|
|
1924
|
+
onKeydown: Ps
|
|
1900
1925
|
}, null, 8, [
|
|
1901
1926
|
"capabilities",
|
|
1902
1927
|
"active-alignment",
|
|
1903
1928
|
"style"
|
|
1904
|
-
])) :
|
|
1905
|
-
V.value ? (
|
|
1929
|
+
])) : m("", !0),
|
|
1930
|
+
V.value ? (y(), p(Ge, {
|
|
1906
1931
|
key: 1,
|
|
1907
1932
|
ref_key: "imageContextMenuElement",
|
|
1908
|
-
ref:
|
|
1909
|
-
width:
|
|
1910
|
-
"onUpdate:width": t[22] ||= (e) =>
|
|
1911
|
-
height:
|
|
1912
|
-
"onUpdate:height": t[23] ||= (e) =>
|
|
1933
|
+
ref: sr,
|
|
1934
|
+
width: cr.value,
|
|
1935
|
+
"onUpdate:width": t[22] ||= (e) => cr.value = e,
|
|
1936
|
+
height: lr.value,
|
|
1937
|
+
"onUpdate:height": t[23] ||= (e) => lr.value = e,
|
|
1913
1938
|
x: V.value.x,
|
|
1914
1939
|
y: V.value.y,
|
|
1915
1940
|
readonly: W.value,
|
|
1916
|
-
onRestore:
|
|
1917
|
-
onApply:
|
|
1918
|
-
onKeydown:
|
|
1941
|
+
onRestore: fs,
|
|
1942
|
+
onApply: ds,
|
|
1943
|
+
onKeydown: Is
|
|
1919
1944
|
}, null, 8, [
|
|
1920
1945
|
"width",
|
|
1921
1946
|
"height",
|
|
1922
1947
|
"x",
|
|
1923
1948
|
"y",
|
|
1924
1949
|
"readonly"
|
|
1925
|
-
])) :
|
|
1926
|
-
R.value ? (
|
|
1950
|
+
])) : m("", !0),
|
|
1951
|
+
R.value ? (y(), p(Ue, {
|
|
1927
1952
|
key: 2,
|
|
1928
1953
|
ref_key: "textContextMenuElement",
|
|
1929
|
-
ref:
|
|
1930
|
-
"bind-open":
|
|
1931
|
-
"onUpdate:bindOpen": t[24] ||= (e) =>
|
|
1932
|
-
"bind-keyword":
|
|
1933
|
-
"onUpdate:bindKeyword": t[25] ||= (e) =>
|
|
1954
|
+
ref: Qn,
|
|
1955
|
+
"bind-open": ir.value,
|
|
1956
|
+
"onUpdate:bindOpen": t[24] ||= (e) => ir.value = e,
|
|
1957
|
+
"bind-keyword": ar.value,
|
|
1958
|
+
"onUpdate:bindKeyword": t[25] ||= (e) => ar.value = e,
|
|
1934
1959
|
x: R.value.x,
|
|
1935
1960
|
y: R.value.y,
|
|
1936
1961
|
"has-selection": R.value.hasSelection,
|
|
1937
1962
|
"editor-state": J.value,
|
|
1938
|
-
"current-editor-text-color":
|
|
1939
|
-
"body-control-tool-items":
|
|
1940
|
-
"text-menu-bindable-variables":
|
|
1941
|
-
"variables-count":
|
|
1942
|
-
"resolve-bind-variable-type-label":
|
|
1943
|
-
onCommand:
|
|
1944
|
-
onClipboard:
|
|
1945
|
-
onAddPage:
|
|
1946
|
-
onInsertVariable:
|
|
1947
|
-
onBindVariable:
|
|
1948
|
-
onOpenBindPanel:
|
|
1949
|
-
onKeydown:
|
|
1950
|
-
onPatchColor:
|
|
1963
|
+
"current-editor-text-color": Di.value,
|
|
1964
|
+
"body-control-tool-items": si.value,
|
|
1965
|
+
"text-menu-bindable-variables": xi.value,
|
|
1966
|
+
"variables-count": E.value.variables.length,
|
|
1967
|
+
"resolve-bind-variable-type-label": qa,
|
|
1968
|
+
onCommand: Xi,
|
|
1969
|
+
onClipboard: Zi,
|
|
1970
|
+
onAddPage: wa,
|
|
1971
|
+
onInsertVariable: Wa,
|
|
1972
|
+
onBindVariable: Ka,
|
|
1973
|
+
onOpenBindPanel: Ja,
|
|
1974
|
+
onKeydown: Fs,
|
|
1975
|
+
onPatchColor: ts
|
|
1951
1976
|
}, null, 8, [
|
|
1952
1977
|
"bind-open",
|
|
1953
1978
|
"bind-keyword",
|
|
@@ -1959,28 +1984,28 @@ var Vt = {
|
|
|
1959
1984
|
"body-control-tool-items",
|
|
1960
1985
|
"text-menu-bindable-variables",
|
|
1961
1986
|
"variables-count"
|
|
1962
|
-
])) :
|
|
1963
|
-
z.value ? (
|
|
1987
|
+
])) : m("", !0),
|
|
1988
|
+
z.value ? (y(), p(We, {
|
|
1964
1989
|
key: 3,
|
|
1965
1990
|
ref_key: "textBubbleElement",
|
|
1966
|
-
ref:
|
|
1991
|
+
ref: $n,
|
|
1967
1992
|
x: z.value.x,
|
|
1968
1993
|
y: z.value.y,
|
|
1969
1994
|
"editor-state": J.value,
|
|
1970
|
-
"font-size-preset-options":
|
|
1971
|
-
"current-editor-font-size":
|
|
1972
|
-
"editor-font-size-search-value":
|
|
1973
|
-
"current-editor-text-color":
|
|
1974
|
-
"text-align-options":
|
|
1995
|
+
"font-size-preset-options": ki.value,
|
|
1996
|
+
"current-editor-font-size": Ei.value,
|
|
1997
|
+
"editor-font-size-search-value": Vn.value,
|
|
1998
|
+
"current-editor-text-color": Di.value,
|
|
1999
|
+
"text-align-options": x(Zr),
|
|
1975
2000
|
onCommand: Q,
|
|
1976
|
-
onPatchFontSize:
|
|
1977
|
-
onPatchTextAlign:
|
|
1978
|
-
onPatchColor:
|
|
1979
|
-
onFontSizeSearch:
|
|
1980
|
-
onFontSizeCommit:
|
|
1981
|
-
onFontSizeDropdownChange:
|
|
1982
|
-
onFontSizeKeydown:
|
|
1983
|
-
onMore:
|
|
2001
|
+
onPatchFontSize: Qo,
|
|
2002
|
+
onPatchTextAlign: Xo,
|
|
2003
|
+
onPatchColor: ts,
|
|
2004
|
+
onFontSizeSearch: ns,
|
|
2005
|
+
onFontSizeCommit: rs,
|
|
2006
|
+
onFontSizeDropdownChange: as,
|
|
2007
|
+
onFontSizeKeydown: is,
|
|
2008
|
+
onMore: ws
|
|
1984
2009
|
}, null, 8, [
|
|
1985
2010
|
"x",
|
|
1986
2011
|
"y",
|
|
@@ -1990,9 +2015,9 @@ var Vt = {
|
|
|
1990
2015
|
"editor-font-size-search-value",
|
|
1991
2016
|
"current-editor-text-color",
|
|
1992
2017
|
"text-align-options"
|
|
1993
|
-
])) :
|
|
2018
|
+
])) : m("", !0)
|
|
1994
2019
|
])),
|
|
1995
|
-
|
|
2020
|
+
h("input", {
|
|
1996
2021
|
ref_key: "imageFileInputElement",
|
|
1997
2022
|
ref: fn,
|
|
1998
2023
|
class: "gd-contract-template-designer__hidden-file-input",
|
|
@@ -2000,19 +2025,19 @@ var Vt = {
|
|
|
2000
2025
|
accept: "image/png,image/jpeg,image/webp,image/gif,image/bmp",
|
|
2001
2026
|
tabindex: "-1",
|
|
2002
2027
|
"aria-hidden": "true",
|
|
2003
|
-
onChange:
|
|
2028
|
+
onChange: xa
|
|
2004
2029
|
}, null, 544),
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
open:
|
|
2008
|
-
"onUpdate:open": t[26] ||= (e) =>
|
|
2009
|
-
"preview-pages":
|
|
2010
|
-
"preview-file-groups":
|
|
2011
|
-
"preview-active-group":
|
|
2012
|
-
"preview-snapshot":
|
|
2030
|
+
h("span", Wt, Ot(H.value), 1),
|
|
2031
|
+
g(Ke, {
|
|
2032
|
+
open: En.value,
|
|
2033
|
+
"onUpdate:open": t[26] ||= (e) => En.value = e,
|
|
2034
|
+
"preview-pages": Ir.value,
|
|
2035
|
+
"preview-file-groups": Lr.value,
|
|
2036
|
+
"preview-active-group": Rr.value,
|
|
2037
|
+
"preview-snapshot": Dn.value,
|
|
2013
2038
|
"font-base-url": s.contractFontBaseUrl,
|
|
2014
|
-
onCancel:
|
|
2015
|
-
onSelectFile: t[27] ||= (e) =>
|
|
2039
|
+
onCancel: mo,
|
|
2040
|
+
onSelectFile: t[27] ||= (e) => kn.value = e
|
|
2016
2041
|
}, null, 8, [
|
|
2017
2042
|
"open",
|
|
2018
2043
|
"preview-pages",
|
|
@@ -2021,28 +2046,28 @@ var Vt = {
|
|
|
2021
2046
|
"preview-snapshot",
|
|
2022
2047
|
"font-base-url"
|
|
2023
2048
|
]),
|
|
2024
|
-
|
|
2025
|
-
open: On.value,
|
|
2026
|
-
"onUpdate:open": t[28] ||= (e) => On.value = e,
|
|
2027
|
-
json: kn.value,
|
|
2028
|
-
onCancel: uo
|
|
2029
|
-
}, null, 8, ["open", "json"]),
|
|
2030
|
-
h(Je, {
|
|
2049
|
+
g(qe, {
|
|
2031
2050
|
open: An.value,
|
|
2032
|
-
"onUpdate:open": t[
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2051
|
+
"onUpdate:open": t[28] ||= (e) => An.value = e,
|
|
2052
|
+
json: jn.value,
|
|
2053
|
+
onCancel: _o
|
|
2054
|
+
}, null, 8, ["open", "json"]),
|
|
2055
|
+
g(Je, {
|
|
2056
|
+
open: Mn.value,
|
|
2057
|
+
"onUpdate:open": t[29] ||= (e) => Mn.value = e,
|
|
2058
|
+
data: Nn.value,
|
|
2059
|
+
"file-name": Fr.value?.name,
|
|
2060
|
+
onCancel: bo
|
|
2036
2061
|
}, null, 8, [
|
|
2037
2062
|
"open",
|
|
2038
2063
|
"data",
|
|
2039
2064
|
"file-name"
|
|
2040
2065
|
]),
|
|
2041
|
-
|
|
2042
|
-
open:
|
|
2043
|
-
"onUpdate:open": t[30] ||= (e) =>
|
|
2066
|
+
g(Ye, {
|
|
2067
|
+
open: Kn.value,
|
|
2068
|
+
"onUpdate:open": t[30] ||= (e) => Kn.value = e,
|
|
2044
2069
|
disabled: W.value,
|
|
2045
|
-
onInsert:
|
|
2070
|
+
onInsert: qi
|
|
2046
2071
|
}, null, 8, ["open", "disabled"])
|
|
2047
2072
|
], 38));
|
|
2048
2073
|
}
|