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