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