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