@guodun/antdv 1.3.2 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/components/contract-signing-location/index.mjs +1 -0
- package/dist/es/components/contract-signing-location/src/ContractSigningLocation.vue.mjs +304 -289
- package/dist/es/components/contract-signing-location/src/ContractSigningLocationCanvas.vue.mjs +337 -326
- package/dist/es/components/contract-signing-location/src/ContractSigningLocationNavigator.vue.mjs +41 -33
- package/dist/es/components/contract-signing-location/src/ContractSigningTemplatePage.mjs +5 -0
- package/dist/es/components/contract-signing-location/src/ContractSigningTemplatePage.vue.mjs +23 -0
- package/dist/es/components/contract-signing-location/src/location-rules.mjs +115 -77
- package/dist/es/components/contract-signing-location/src/template-source.mjs +85 -0
- package/dist/es/components/contract-signing-location/style/index.css +1 -1
- package/dist/es/components/index.mjs +8 -6
- package/dist/es/components/pro-contract-signing-flow/src/ContractSigningFlowCanvas.vue.mjs +164 -57
- package/dist/es/components/pro-contract-signing-flow/src/ContractSigningFlowInspector.vue.mjs +128 -125
- package/dist/es/components/pro-contract-signing-flow/src/ContractSigningFlowNodeCard.vue.mjs +75 -49
- package/dist/es/components/pro-contract-signing-flow/src/ProContractSigningFlow.vue.mjs +135 -91
- package/dist/es/components/pro-contract-signing-flow/src/constants.mjs +25 -5
- package/dist/es/components/pro-contract-signing-flow/style/index.css +1 -1
- package/dist/es/components/pro-contract-template-designer/index.mjs +5 -4
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.mjs +347 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.vue.mjs +171 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateFileBar.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateFileBar.vue.mjs +166 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateRendererField.vue.mjs +4 -4
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateRendererValidation.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateRendererValidation.vue.mjs +36 -0
- package/dist/es/components/pro-contract-template-designer/src/DesignerPage.vue.mjs +202 -202
- package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.mjs +1591 -1612
- package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue.mjs +235 -239
- package/dist/es/components/pro-contract-template-designer/src/SigningPlacementLayer.vue.mjs +16 -16
- package/dist/es/components/pro-contract-template-designer/src/composables/use-template-designer.mjs +166 -166
- package/dist/es/components/pro-contract-template-designer/src/composables/use-template-draft-cache.mjs +100 -33
- package/dist/es/components/pro-contract-template-designer/src/composables/use-template-files.mjs +77 -0
- package/dist/es/components/pro-contract-template-designer/src/extensions/word-paste.mjs +23 -23
- package/dist/es/components/pro-contract-template-designer/src/utils/file-tabs.mjs +14 -0
- package/dist/es/components/pro-contract-template-designer/src/utils/template-renderer.mjs +121 -121
- package/dist/es/components/pro-contract-template-designer/src/utils/toolbar-overflow.mjs +19 -0
- package/dist/es/components/pro-contract-template-designer/style/index.css +1 -1
- package/dist/es/index.mjs +23 -21
- package/dist/lib/components/contract-signing-location/index.cjs +1 -1
- package/dist/lib/components/contract-signing-location/src/ContractSigningLocation.vue.cjs +1 -1
- package/dist/lib/components/contract-signing-location/src/ContractSigningLocationCanvas.vue.cjs +1 -1
- package/dist/lib/components/contract-signing-location/src/ContractSigningLocationNavigator.vue.cjs +1 -1
- package/dist/lib/components/contract-signing-location/src/ContractSigningTemplatePage.cjs +1 -0
- package/dist/lib/components/contract-signing-location/src/ContractSigningTemplatePage.vue.cjs +1 -0
- package/dist/lib/components/contract-signing-location/src/location-rules.cjs +1 -1
- package/dist/lib/components/contract-signing-location/src/template-source.cjs +1 -0
- package/dist/lib/components/contract-signing-location/style/index.css +1 -1
- package/dist/lib/components/index.cjs +1 -1
- package/dist/lib/components/pro-contract-signing-flow/src/ContractSigningFlowCanvas.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-signing-flow/src/ContractSigningFlowInspector.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-signing-flow/src/ContractSigningFlowNodeCard.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-signing-flow/src/ProContractSigningFlow.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-signing-flow/src/constants.cjs +1 -1
- package/dist/lib/components/pro-contract-signing-flow/style/index.css +1 -1
- package/dist/lib/components/pro-contract-template-designer/index.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateFileBar.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateFileBar.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateRendererField.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateRendererValidation.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateRendererValidation.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/DesignerPage.vue.cjs +2 -2
- package/dist/lib/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/SigningPlacementLayer.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-designer.cjs +2 -2
- package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-draft-cache.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-files.cjs +2 -0
- package/dist/lib/components/pro-contract-template-designer/src/extensions/word-paste.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/utils/file-tabs.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/utils/template-renderer.cjs +2 -2
- package/dist/lib/components/pro-contract-template-designer/src/utils/toolbar-overflow.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/theme/contract-signing-location.css +1 -1
- package/dist/theme/icon.css +1 -1
- package/dist/theme/index.css +1 -1
- package/dist/theme/pro-contract-signing-flow.css +1 -1
- package/dist/types/components/contract-signing-location/index.d.ts +1 -0
- package/dist/types/components/contract-signing-location/src/ContractSigningLocation.vue.d.ts +3 -1
- package/dist/types/components/contract-signing-location/src/ContractSigningLocationInspector.vue.d.ts +2 -2
- package/dist/types/components/contract-signing-location/src/ContractSigningTemplatePage.vue.d.ts +6 -0
- package/dist/types/components/contract-signing-location/src/location-rules.d.ts +3 -3
- package/dist/types/components/contract-signing-location/src/template-source.d.ts +20 -0
- package/dist/types/components/contract-signing-location/src/types.d.ts +47 -2
- package/dist/types/components/pro-contract-signing-flow/src/ContractSigningFlowCanvas.vue.d.ts +19 -3
- package/dist/types/components/pro-contract-signing-flow/src/ProContractSigningFlow.vue.d.ts +223 -2
- package/dist/types/components/pro-contract-signing-flow/src/constants.d.ts +15 -0
- package/dist/types/components/pro-contract-signing-flow/src/types.d.ts +12 -0
- package/dist/types/components/pro-contract-template-designer/index.d.ts +1 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.d.ts +103 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.vue.d.ts +48 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateFileBar.vue.d.ts +231 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateRendererValidation.vue.d.ts +15 -0
- package/dist/types/components/pro-contract-template-designer/src/DesignerPage.vue.d.ts +1 -1
- package/dist/types/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.d.ts +25 -2
- package/dist/types/components/pro-contract-template-designer/src/SigningPlacementInspector.vue.d.ts +2 -2
- package/dist/types/components/pro-contract-template-designer/src/composables/use-template-designer.d.ts +1 -1
- package/dist/types/components/pro-contract-template-designer/src/composables/use-template-draft-cache.d.ts +29 -1
- package/dist/types/components/pro-contract-template-designer/src/composables/use-template-files.d.ts +24 -0
- package/dist/types/components/pro-contract-template-designer/src/constants.d.ts +2 -2
- package/dist/types/components/pro-contract-template-designer/src/types.d.ts +59 -1
- package/dist/types/components/pro-contract-template-designer/src/utils/file-tabs.d.ts +3 -0
- package/dist/types/components/pro-contract-template-designer/src/utils/toolbar-overflow.d.ts +11 -0
- package/package.json +2 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import { computed as
|
|
10
|
-
import { EditorContent as
|
|
11
|
-
import { generateHTML as
|
|
12
|
-
import { CellSelection as
|
|
13
|
-
import { NodeSelection as
|
|
1
|
+
import { SIGNING_PLACEMENT_MIME as e, canMutateSigningPlacements as t, getSigningPlacementDefaultSize as n, parseSigningPlacementDragPayload as r } from "./utils/signing-placement.mjs";
|
|
2
|
+
import { CONTRACT_TEXT_STYLE_PRESETS as i } from "./constants.mjs";
|
|
3
|
+
import { DEFAULT_FIELD_STYLE as a, resolvePageSize as o, splitPageContentByMeasurements as s } from "./composables/use-template-designer.mjs";
|
|
4
|
+
import { buildTemplateVariableAttrs as c, insertTemplateVariableNode as l } from "./extensions/template-variable.mjs";
|
|
5
|
+
import { normalizeContractImageDimension as u } from "./utils/content-image.mjs";
|
|
6
|
+
import { createEditorExtensions as ee, runContractTemplateEditorCommand as d } from "./extensions/editor-extensions.mjs";
|
|
7
|
+
import { resolveEditorContextMenuKind as f } from "./utils/context-variable.mjs";
|
|
8
|
+
import te from "./SigningPlacementLayer.mjs";
|
|
9
|
+
import { computed as p, createBlock as ne, createCommentVNode as re, createElementBlock as ie, createElementVNode as m, createVNode as ae, defineComponent as h, nextTick as oe, normalizeClass as se, normalizeStyle as g, onBeforeUnmount as ce, openBlock as _, ref as le, toDisplayString as v, unref as y, watch as b, withModifiers as ue } from "vue";
|
|
10
|
+
import { EditorContent as de, useEditor as fe } from "@tiptap/vue-3";
|
|
11
|
+
import { generateHTML as pe } from "@tiptap/core";
|
|
12
|
+
import { CellSelection as x, deleteColumn as me, deleteRow as he, deleteTable as ge } from "@tiptap/pm/tables";
|
|
13
|
+
import { NodeSelection as S } from "@tiptap/pm/state";
|
|
14
14
|
//#region src/components/pro-contract-template-designer/src/DesignerPage.vue?vue&type=script&setup=true&lang.ts
|
|
15
|
-
var
|
|
15
|
+
var _e = { class: "gd-contract-template-designer__page-title" }, C = "application/x-gd-contract-variable-move", ve = 8, w = /* @__PURE__ */ h({
|
|
16
16
|
name: "ProContractTemplateDesignerPage",
|
|
17
17
|
__name: "DesignerPage",
|
|
18
18
|
props: {
|
|
@@ -54,122 +54,122 @@ var be = { class: "gd-contract-template-designer__page-title" }, b = "applicatio
|
|
|
54
54
|
"editor-state-change",
|
|
55
55
|
"editor-context-menu"
|
|
56
56
|
],
|
|
57
|
-
setup(
|
|
58
|
-
let
|
|
59
|
-
processImageFile:
|
|
60
|
-
getZoom: () => Math.max(.1,
|
|
61
|
-
}),
|
|
62
|
-
content:
|
|
63
|
-
editable: !
|
|
64
|
-
extensions:
|
|
57
|
+
setup(h, { expose: w, emit: ye }) {
|
|
58
|
+
let T = h, E = ye, D = p(() => T.readonly || T.disabled), O = le(), k = ee("请输入合同正文,或从 WPS / Word 粘贴合同内容", {
|
|
59
|
+
processImageFile: T.processImageFile,
|
|
60
|
+
getZoom: () => Math.max(.1, T.zoom || 1)
|
|
61
|
+
}), A = fe({
|
|
62
|
+
content: T.page.contentHtml,
|
|
63
|
+
editable: !D.value,
|
|
64
|
+
extensions: k,
|
|
65
65
|
editorProps: {
|
|
66
66
|
attributes: { class: "gd-contract-template-designer__editor-prose" },
|
|
67
67
|
handleClick: (e, t, n) => {
|
|
68
68
|
let r = (n.target instanceof HTMLElement ? n.target.closest("[data-template-variable]") : void 0)?.dataset.key;
|
|
69
69
|
if (!r) return !1;
|
|
70
|
-
let i =
|
|
71
|
-
return i &&
|
|
70
|
+
let i = T.variables.find((e) => e.key === r);
|
|
71
|
+
return i && E("variable-select", i.key), !1;
|
|
72
72
|
},
|
|
73
73
|
handleDOMEvents: {
|
|
74
74
|
contextmenu: (e, t) => {
|
|
75
|
-
if (
|
|
75
|
+
if (D.value) return !1;
|
|
76
76
|
let n = Oe(e, t.target);
|
|
77
77
|
if (n) return t.preventDefault(), L({
|
|
78
|
-
pageId:
|
|
78
|
+
pageId: T.page.id,
|
|
79
79
|
clientX: t.clientX,
|
|
80
80
|
clientY: t.clientY
|
|
81
81
|
}, n), !0;
|
|
82
|
-
let r =
|
|
82
|
+
let r = A.value?.state.selection, i = r instanceof x, a = t.target instanceof HTMLElement ? !!t.target.closest("td, th") : !1, o = f({
|
|
83
83
|
isCellSelection: i,
|
|
84
84
|
selectionEmpty: !r || r.empty,
|
|
85
85
|
inTable: a
|
|
86
86
|
});
|
|
87
|
-
return t.preventDefault(),
|
|
88
|
-
pageId:
|
|
87
|
+
return t.preventDefault(), o === "table" && (i || Ee(t.clientX, t.clientY, t.target)) ? (B({
|
|
88
|
+
pageId: T.page.id,
|
|
89
89
|
clientX: t.clientX,
|
|
90
90
|
clientY: t.clientY
|
|
91
91
|
}), !0) : (I({
|
|
92
|
-
pageId:
|
|
92
|
+
pageId: T.page.id,
|
|
93
93
|
clientX: t.clientX,
|
|
94
94
|
clientY: t.clientY
|
|
95
95
|
}), !0);
|
|
96
96
|
},
|
|
97
|
-
dragstart: (e, t) =>
|
|
98
|
-
dragend: () => (
|
|
97
|
+
dragstart: (e, t) => D.value ? (t.preventDefault(), !0) : (t.target instanceof HTMLElement ? t.target : null)?.closest("[data-template-variable]") ? (t.dataTransfer?.setData(C, T.page.id), t.dataTransfer && (t.dataTransfer.effectAllowed = "move"), O.value?.classList.add("is-variable-dragging"), !1) : !1,
|
|
98
|
+
dragend: () => (O.value?.classList.remove("is-variable-dragging"), !1),
|
|
99
99
|
drop: (e, t) => {
|
|
100
|
-
if (
|
|
101
|
-
let n = t.dataTransfer?.getData(
|
|
102
|
-
return !n || n ===
|
|
100
|
+
if (D.value) return t.preventDefault(), t.stopPropagation(), !0;
|
|
101
|
+
let n = t.dataTransfer?.getData(C);
|
|
102
|
+
return !n || n === T.page.id ? !1 : (t.preventDefault(), E("variable-move-blocked", T.page.id), !0);
|
|
103
103
|
}
|
|
104
104
|
},
|
|
105
105
|
handleKeyDown: (e, t) => {
|
|
106
|
-
if (
|
|
107
|
-
let n =
|
|
106
|
+
if (D.value || !Ce(t)) return !1;
|
|
107
|
+
let n = A.value;
|
|
108
108
|
if (!n) return !1;
|
|
109
109
|
t.preventDefault();
|
|
110
110
|
let r = n.state.selection, i = z();
|
|
111
111
|
if (i) {
|
|
112
112
|
let e = n.view.coordsAtPos(r.from);
|
|
113
113
|
return L({
|
|
114
|
-
pageId:
|
|
114
|
+
pageId: T.page.id,
|
|
115
115
|
clientX: e.left,
|
|
116
116
|
clientY: e.bottom
|
|
117
117
|
}, i), !0;
|
|
118
118
|
}
|
|
119
|
-
let a = r instanceof
|
|
120
|
-
if (
|
|
119
|
+
let a = r instanceof x;
|
|
120
|
+
if (f({
|
|
121
121
|
isCellSelection: a,
|
|
122
122
|
selectionEmpty: r.empty,
|
|
123
123
|
inTable: n.isActive("table")
|
|
124
124
|
}) === "table") {
|
|
125
125
|
if (!a) {
|
|
126
126
|
let e = Te();
|
|
127
|
-
typeof e == "number" && n.view.dispatch(n.state.tr.setSelection(
|
|
127
|
+
typeof e == "number" && n.view.dispatch(n.state.tr.setSelection(x.create(n.state.doc, e)));
|
|
128
128
|
}
|
|
129
129
|
let e = n.view.coordsAtPos(n.state.selection.from);
|
|
130
130
|
return B({
|
|
131
|
-
pageId:
|
|
131
|
+
pageId: T.page.id,
|
|
132
132
|
clientX: e.left,
|
|
133
133
|
clientY: e.bottom
|
|
134
134
|
}), !0;
|
|
135
135
|
}
|
|
136
|
-
let
|
|
136
|
+
let o = n.view.coordsAtPos(n.state.selection.from);
|
|
137
137
|
return I({
|
|
138
|
-
pageId:
|
|
139
|
-
clientX:
|
|
140
|
-
clientY:
|
|
138
|
+
pageId: T.page.id,
|
|
139
|
+
clientX: o.left,
|
|
140
|
+
clientY: o.bottom
|
|
141
141
|
}), !0;
|
|
142
142
|
}
|
|
143
143
|
},
|
|
144
144
|
onUpdate: ({ editor: e }) => {
|
|
145
|
-
|
|
146
|
-
...
|
|
145
|
+
E("page-update", {
|
|
146
|
+
...T.page,
|
|
147
147
|
contentHtml: e.getHTML(),
|
|
148
148
|
contentJson: e.getJSON()
|
|
149
149
|
}), H();
|
|
150
150
|
},
|
|
151
151
|
onFocus: () => {
|
|
152
|
-
|
|
152
|
+
E("editor-focus", T.page.id), H();
|
|
153
153
|
},
|
|
154
154
|
onBlur: H,
|
|
155
155
|
onSelectionUpdate: H,
|
|
156
156
|
onCreate: H
|
|
157
157
|
});
|
|
158
|
-
function
|
|
158
|
+
function be(e) {
|
|
159
159
|
if (typeof e == "number" && Number.isFinite(e)) return e;
|
|
160
160
|
let t = String(e || "").match(/(\d+(\.\d+)?)/);
|
|
161
161
|
return t ? Number(t[1]) : void 0;
|
|
162
162
|
}
|
|
163
|
-
function
|
|
164
|
-
if (!
|
|
165
|
-
let { from: e, to: t } =
|
|
166
|
-
return
|
|
163
|
+
function xe() {
|
|
164
|
+
if (!A.value) return "";
|
|
165
|
+
let { from: e, to: t } = A.value.state.selection;
|
|
166
|
+
return A.value.state.doc.textBetween(e, t, "\n");
|
|
167
167
|
}
|
|
168
|
-
function
|
|
169
|
-
let e =
|
|
168
|
+
function Se() {
|
|
169
|
+
let e = A.value, t = e?.state.selection;
|
|
170
170
|
if (!(!e || !t || t.empty)) try {
|
|
171
171
|
let n = e.view.coordsAtPos(t.from), r = e.view.coordsAtPos(t.to, -1);
|
|
172
|
-
if (Math.abs(r.top - n.top) >
|
|
172
|
+
if (Math.abs(r.top - n.top) > ve) return;
|
|
173
173
|
let i = Math.abs(r.left - n.left) / U.value;
|
|
174
174
|
return Number.isFinite(i) && i > 0 ? i : void 0;
|
|
175
175
|
} catch {
|
|
@@ -177,7 +177,7 @@ var be = { class: "gd-contract-template-designer__page-title" }, b = "applicatio
|
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
179
|
function j() {
|
|
180
|
-
let e =
|
|
180
|
+
let e = A.value;
|
|
181
181
|
if (!e) return "";
|
|
182
182
|
let t = e.state.selection.$from, n = t.pos;
|
|
183
183
|
for (let e = t.depth; e > 0; --e) {
|
|
@@ -199,25 +199,25 @@ var be = { class: "gd-contract-template-designer__page-title" }, b = "applicatio
|
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
201
|
function we(e, t) {
|
|
202
|
-
let n =
|
|
202
|
+
let n = A.value, r = n?.view.posAtCoords({
|
|
203
203
|
left: e,
|
|
204
204
|
top: t
|
|
205
205
|
})?.pos;
|
|
206
206
|
if (!(!n || typeof r != "number")) return M(n.state.doc.resolve(r));
|
|
207
207
|
}
|
|
208
208
|
function Te() {
|
|
209
|
-
let e =
|
|
209
|
+
let e = A.value;
|
|
210
210
|
if (e) return M(e.state.selection.$from);
|
|
211
211
|
}
|
|
212
212
|
function Ee(e, t, n) {
|
|
213
|
-
let r =
|
|
213
|
+
let r = A.value, i = n instanceof HTMLElement ? n : null;
|
|
214
214
|
if (!r || !i?.closest("td,th")) return !1;
|
|
215
|
-
if (r.state.selection instanceof
|
|
215
|
+
if (r.state.selection instanceof x && i.closest("td.selectedCell,th.selectedCell")) return !0;
|
|
216
216
|
let a = we(e, t);
|
|
217
|
-
return typeof a == "number" ? (r.view.dispatch(r.state.tr.setSelection(
|
|
217
|
+
return typeof a == "number" ? (r.view.dispatch(r.state.tr.setSelection(x.create(r.state.doc, a))), !0) : !1;
|
|
218
218
|
}
|
|
219
219
|
function N() {
|
|
220
|
-
let e =
|
|
220
|
+
let e = A.value, t = e?.isActive("table") ? e.can() : void 0, n = (e) => !!(t && e(t));
|
|
221
221
|
return {
|
|
222
222
|
addRowBefore: n((e) => e.addRowBefore()),
|
|
223
223
|
addRowAfter: n((e) => e.addRowAfter()),
|
|
@@ -236,40 +236,40 @@ var be = { class: "gd-contract-template-designer__page-title" }, b = "applicatio
|
|
|
236
236
|
};
|
|
237
237
|
}
|
|
238
238
|
function De() {
|
|
239
|
-
let e =
|
|
240
|
-
if (!e || !(t instanceof
|
|
239
|
+
let e = A.value, t = e?.state.selection;
|
|
240
|
+
if (!e || !(t instanceof x)) return "left";
|
|
241
241
|
let n = /* @__PURE__ */ new Set();
|
|
242
242
|
return t.forEachCell((e) => {
|
|
243
243
|
let t = e.attrs.textAlign;
|
|
244
244
|
n.add(t === "center" || t === "right" ? t : "left");
|
|
245
245
|
}), n.size === 1 ? n.values().next().value ?? "left" : "mixed";
|
|
246
246
|
}
|
|
247
|
-
function P(e =
|
|
247
|
+
function P(e = A.value?.state.doc) {
|
|
248
248
|
let t = 0;
|
|
249
249
|
return e?.descendants((e) => {
|
|
250
250
|
e.type.name === "templateVariable" && (t += 1);
|
|
251
251
|
}), t;
|
|
252
252
|
}
|
|
253
253
|
function F(e) {
|
|
254
|
-
let t =
|
|
254
|
+
let t = A.value;
|
|
255
255
|
if (!t) return 0;
|
|
256
256
|
let n = P(t.state.doc), r = n, i = (e) => {
|
|
257
257
|
r = P(e.doc);
|
|
258
258
|
};
|
|
259
|
-
return e === "delete-table-row" ?
|
|
259
|
+
return e === "delete-table-row" ? he(t.state, i) : e === "delete-table-column" ? me(t.state, i) : ge(t.state, i), Math.max(0, n - r);
|
|
260
260
|
}
|
|
261
261
|
function I(e) {
|
|
262
|
-
let t =
|
|
263
|
-
|
|
262
|
+
let t = A.value?.state.selection, n = !!(t && !t.empty);
|
|
263
|
+
E("editor-context-menu", {
|
|
264
264
|
type: "text",
|
|
265
265
|
...e,
|
|
266
266
|
hasSelection: n,
|
|
267
|
-
selectionWidth: n ?
|
|
267
|
+
selectionWidth: n ? Se() : void 0,
|
|
268
268
|
leadingText: j()
|
|
269
269
|
});
|
|
270
270
|
}
|
|
271
271
|
function L(e, t) {
|
|
272
|
-
|
|
272
|
+
E("editor-context-menu", {
|
|
273
273
|
type: "image",
|
|
274
274
|
...e,
|
|
275
275
|
image: t
|
|
@@ -281,25 +281,25 @@ var be = { class: "gd-contract-template-designer__page-title" }, b = "applicatio
|
|
|
281
281
|
src: e.attrs.src,
|
|
282
282
|
alt: typeof e.attrs.alt == "string" ? e.attrs.alt : void 0,
|
|
283
283
|
title: typeof e.attrs.title == "string" ? e.attrs.title : void 0,
|
|
284
|
-
width:
|
|
285
|
-
height:
|
|
284
|
+
width: u(e.attrs.width),
|
|
285
|
+
height: u(e.attrs.height)
|
|
286
286
|
};
|
|
287
287
|
}
|
|
288
288
|
function z() {
|
|
289
|
-
let e =
|
|
290
|
-
if (e instanceof
|
|
289
|
+
let e = A.value?.state.selection;
|
|
290
|
+
if (e instanceof S) return R(e.node, e.from);
|
|
291
291
|
}
|
|
292
292
|
function Oe(e, t) {
|
|
293
293
|
let n = t instanceof HTMLElement ? t.closest("[data-template-variable], img[src]") : null;
|
|
294
294
|
if (n) try {
|
|
295
295
|
let t = e.posAtDOM(n, 0), r = e.state.doc.nodeAt(t);
|
|
296
|
-
return !r || r.type.name !== "templateVariable" && r.type.name !== "image" ? void 0 : (r.type.name === "templateVariable" && typeof r.attrs.key == "string" &&
|
|
296
|
+
return !r || r.type.name !== "templateVariable" && r.type.name !== "image" ? void 0 : (r.type.name === "templateVariable" && typeof r.attrs.key == "string" && E("variable-select", r.attrs.key), (!(e.state.selection instanceof S) || e.state.selection.from !== t) && e.dispatch(e.state.tr.setSelection(S.create(e.state.doc, t))), R(r, t));
|
|
297
297
|
} catch {
|
|
298
298
|
return;
|
|
299
299
|
}
|
|
300
300
|
}
|
|
301
301
|
function B(e) {
|
|
302
|
-
|
|
302
|
+
E("editor-context-menu", {
|
|
303
303
|
type: "table",
|
|
304
304
|
...e,
|
|
305
305
|
capabilities: N(),
|
|
@@ -312,20 +312,20 @@ var be = { class: "gd-contract-template-designer__page-title" }, b = "applicatio
|
|
|
312
312
|
});
|
|
313
313
|
}
|
|
314
314
|
function ke() {
|
|
315
|
-
return
|
|
315
|
+
return A.value ? [
|
|
316
316
|
1,
|
|
317
317
|
2,
|
|
318
318
|
3,
|
|
319
319
|
4,
|
|
320
320
|
5,
|
|
321
321
|
6
|
|
322
|
-
].find((e) =>
|
|
322
|
+
].find((e) => A.value?.isActive("heading", { level: e })) : void 0;
|
|
323
323
|
}
|
|
324
324
|
function Ae() {
|
|
325
|
-
return ["center", "right"].find((e) =>
|
|
325
|
+
return ["center", "right"].find((e) => A.value?.isActive("heading", { textAlign: e }) || A.value?.isActive("paragraph", { textAlign: e })) ?? "left";
|
|
326
326
|
}
|
|
327
327
|
function V() {
|
|
328
|
-
let e =
|
|
328
|
+
let e = A.value, t = (t) => !!e?.isActive(t), n = e?.getAttributes("textStyle") ?? {};
|
|
329
329
|
return {
|
|
330
330
|
isFocused: !!e?.isFocused,
|
|
331
331
|
canUndo: !!e?.can().undo(),
|
|
@@ -339,96 +339,96 @@ var be = { class: "gd-contract-template-designer__page-title" }, b = "applicatio
|
|
|
339
339
|
currentHeadingLevel: ke(),
|
|
340
340
|
textAlign: Ae(),
|
|
341
341
|
fontFamily: typeof n.fontFamily == "string" ? n.fontFamily : void 0,
|
|
342
|
-
fontSize:
|
|
342
|
+
fontSize: be(n.fontSize),
|
|
343
343
|
textColor: typeof n.color == "string" ? n.color : void 0,
|
|
344
|
-
selectionText:
|
|
344
|
+
selectionText: xe(),
|
|
345
345
|
selectedContentImage: z()
|
|
346
346
|
};
|
|
347
347
|
}
|
|
348
348
|
function H() {
|
|
349
|
-
|
|
349
|
+
E("editor-state-change", T.page.id, V());
|
|
350
350
|
}
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
}),
|
|
354
|
-
!
|
|
351
|
+
b(D, (e) => {
|
|
352
|
+
A.value?.setEditable(!e), H();
|
|
353
|
+
}), b(() => T.page.contentHtml, (e) => {
|
|
354
|
+
!A.value || e === A.value.getHTML() || (A.value.commands.setContent(e || "<p></p>", { emitUpdate: !1 }), H());
|
|
355
355
|
});
|
|
356
|
-
let je =
|
|
357
|
-
width: `${
|
|
358
|
-
height: `${
|
|
356
|
+
let je = p(() => ({
|
|
357
|
+
width: `${T.pageSize.width}px`,
|
|
358
|
+
height: `${T.pageSize.height}px`,
|
|
359
359
|
"--gd-contract-page-content-height": `${q()}px`
|
|
360
|
-
})), U =
|
|
361
|
-
width: `${Math.ceil((
|
|
362
|
-
height: `${Math.ceil((
|
|
363
|
-
})), Ne =
|
|
360
|
+
})), U = p(() => Math.max(.1, T.zoom || 1)), Me = p(() => ({
|
|
361
|
+
width: `${Math.ceil((T.pageSize.width + 10) * U.value)}px`,
|
|
362
|
+
height: `${Math.ceil((T.pageSize.height + 40) * U.value)}px`
|
|
363
|
+
})), Ne = p(() => ({ "--gd-contract-page-zoom": String(U.value) })), Pe = p(() => o(T.pageSize));
|
|
364
364
|
function W(e, t) {
|
|
365
|
-
let n =
|
|
365
|
+
let n = O.value?.getBoundingClientRect();
|
|
366
366
|
return n ? {
|
|
367
|
-
x: Math.min(
|
|
368
|
-
y: Math.min(
|
|
367
|
+
x: Math.min(T.pageSize.width, Math.max(0, (e - n.left) / U.value)),
|
|
368
|
+
y: Math.min(T.pageSize.height, Math.max(0, (t - n.top) / U.value))
|
|
369
369
|
} : {
|
|
370
|
-
x:
|
|
371
|
-
y:
|
|
370
|
+
x: T.pageSize.width / 2,
|
|
371
|
+
y: T.pageSize.height / 2
|
|
372
372
|
};
|
|
373
373
|
}
|
|
374
374
|
function Fe(e) {
|
|
375
|
-
let t =
|
|
376
|
-
if (!t || !
|
|
377
|
-
x: Math.max(0, (
|
|
378
|
-
y: Math.max(0, (
|
|
375
|
+
let t = O.value?.getBoundingClientRect(), r = O.value?.closest(".gd-contract-template-designer__canvas")?.getBoundingClientRect(), i = n(e);
|
|
376
|
+
if (!t || !r) return {
|
|
377
|
+
x: Math.max(0, (T.pageSize.width - i.width) / 2),
|
|
378
|
+
y: Math.max(0, (T.pageSize.height - i.height) / 2)
|
|
379
379
|
};
|
|
380
|
-
let
|
|
380
|
+
let a = Math.max(t.left, r.left), o = Math.max(t.top, r.top), s = Math.min(t.right, r.right), c = Math.min(t.bottom, r.bottom), l = W(s > a ? (a + s) / 2 : (t.left + t.right) / 2, c > o ? (o + c) / 2 : (t.top + t.bottom) / 2);
|
|
381
381
|
return {
|
|
382
|
-
x:
|
|
383
|
-
y:
|
|
382
|
+
x: l.x - i.width / 2,
|
|
383
|
+
y: l.y - i.height / 2
|
|
384
384
|
};
|
|
385
385
|
}
|
|
386
|
-
function Ie(
|
|
387
|
-
if (!
|
|
388
|
-
|
|
386
|
+
function Ie(n) {
|
|
387
|
+
if (!t(T.readonly, T.disabled)) {
|
|
388
|
+
n.preventDefault(), n.stopPropagation();
|
|
389
389
|
return;
|
|
390
390
|
}
|
|
391
|
-
let
|
|
392
|
-
if (
|
|
393
|
-
|
|
394
|
-
let
|
|
395
|
-
|
|
391
|
+
let i = r(n.dataTransfer?.getData(e));
|
|
392
|
+
if (i) {
|
|
393
|
+
n.preventDefault(), n.stopPropagation();
|
|
394
|
+
let e = W(n.clientX, n.clientY);
|
|
395
|
+
E("signing-placement-drop", T.page.id, i, e.x, e.y);
|
|
396
396
|
return;
|
|
397
397
|
}
|
|
398
|
-
let
|
|
399
|
-
if (
|
|
400
|
-
|
|
398
|
+
let a = n.dataTransfer?.getData("application/x-gd-contract-variable");
|
|
399
|
+
if (a) {
|
|
400
|
+
n.preventDefault(), n.stopPropagation(), E("variable-drop", T.page.id, a, n.clientX, n.clientY);
|
|
401
401
|
return;
|
|
402
402
|
}
|
|
403
|
-
let
|
|
404
|
-
|
|
403
|
+
let o = n.dataTransfer?.getData(C);
|
|
404
|
+
o && o !== T.page.id && (n.preventDefault(), n.stopPropagation(), E("variable-move-blocked", T.page.id));
|
|
405
405
|
}
|
|
406
406
|
function Le(e, t) {
|
|
407
|
-
let
|
|
408
|
-
return
|
|
407
|
+
let n = A.value;
|
|
408
|
+
return n ? (l(n, e, t ? n.view.posAtCoords(t)?.pos : void 0), $(), G()) : void 0;
|
|
409
409
|
}
|
|
410
410
|
function Re(e, t) {
|
|
411
|
-
let n =
|
|
412
|
-
if (n) return
|
|
411
|
+
let n = A.value;
|
|
412
|
+
if (n) return d(n, {
|
|
413
413
|
type: "insert-content-image",
|
|
414
414
|
image: e,
|
|
415
415
|
position: t
|
|
416
416
|
}), G();
|
|
417
417
|
}
|
|
418
418
|
function ze(e) {
|
|
419
|
-
let t =
|
|
420
|
-
if (!t || !(n instanceof
|
|
421
|
-
let
|
|
419
|
+
let t = A.value, n = t?.state.selection;
|
|
420
|
+
if (!t || !(n instanceof S) || n.node.type.name !== "image") return;
|
|
421
|
+
let r = { ...n.node.attrs }, i = !1;
|
|
422
422
|
if (["width", "height"].forEach((t) => {
|
|
423
423
|
if (!Object.prototype.hasOwnProperty.call(e, t)) return;
|
|
424
|
-
let n = e[t] === void 0 ? null :
|
|
425
|
-
|
|
426
|
-
}), !
|
|
427
|
-
let
|
|
428
|
-
return
|
|
424
|
+
let n = e[t] === void 0 ? null : u(e[t]) ?? null;
|
|
425
|
+
r[t] !== n && (r[t] = n, i = !0);
|
|
426
|
+
}), !i) return;
|
|
427
|
+
let a = t.state.tr.setNodeMarkup(n.from, void 0, r);
|
|
428
|
+
return a.setSelection(S.create(a.doc, n.from)), t.view.dispatch(a), G();
|
|
429
429
|
}
|
|
430
430
|
function Be() {
|
|
431
|
-
let e =
|
|
431
|
+
let e = A.value?.state.selection;
|
|
432
432
|
return e ? {
|
|
433
433
|
from: e.from,
|
|
434
434
|
to: e.to
|
|
@@ -436,10 +436,10 @@ var be = { class: "gd-contract-template-designer__page-title" }, b = "applicatio
|
|
|
436
436
|
}
|
|
437
437
|
function G() {
|
|
438
438
|
return {
|
|
439
|
-
...
|
|
439
|
+
...T.page,
|
|
440
440
|
pageSize: Pe.value,
|
|
441
|
-
contentHtml:
|
|
442
|
-
contentJson:
|
|
441
|
+
contentHtml: A.value?.getHTML() ?? T.page.contentHtml,
|
|
442
|
+
contentJson: A.value?.getJSON() ?? T.page.contentJson
|
|
443
443
|
};
|
|
444
444
|
}
|
|
445
445
|
function K(e) {
|
|
@@ -452,16 +452,16 @@ var be = { class: "gd-contract-template-designer__page-title" }, b = "applicatio
|
|
|
452
452
|
return e?.length ? e.length === 1 && e[0].type === "paragraph" && !e[0].content?.length : !0;
|
|
453
453
|
}
|
|
454
454
|
function He(e) {
|
|
455
|
-
return
|
|
455
|
+
return pe(K(e), k);
|
|
456
456
|
}
|
|
457
457
|
function q() {
|
|
458
|
-
let e =
|
|
459
|
-
if (!e) return
|
|
458
|
+
let e = O.value;
|
|
459
|
+
if (!e) return T.pageSize.height - 108;
|
|
460
460
|
let t = window.getComputedStyle(e), n = Number.parseFloat(t.paddingTop) || 0, r = Number.parseFloat(t.paddingBottom) || 0;
|
|
461
|
-
return Math.max(120,
|
|
461
|
+
return Math.max(120, T.pageSize.height - n - r);
|
|
462
462
|
}
|
|
463
463
|
function Ue() {
|
|
464
|
-
let e =
|
|
464
|
+
let e = O.value?.querySelector(".gd-contract-template-designer__editor-prose");
|
|
465
465
|
if (!e) return [];
|
|
466
466
|
let t = e.getBoundingClientRect(), n = U.value;
|
|
467
467
|
return Array.from(e.children).map((e) => {
|
|
@@ -473,24 +473,24 @@ var be = { class: "gd-contract-template-designer__page-title" }, b = "applicatio
|
|
|
473
473
|
});
|
|
474
474
|
}
|
|
475
475
|
function J() {
|
|
476
|
-
return
|
|
476
|
+
return A.value ? s(A.value.getJSON().content, Ue(), q()) : void 0;
|
|
477
477
|
}
|
|
478
478
|
function We() {
|
|
479
479
|
return !!J();
|
|
480
480
|
}
|
|
481
481
|
function Ge() {
|
|
482
|
-
if (!
|
|
482
|
+
if (!A.value) return;
|
|
483
483
|
let e = J();
|
|
484
|
-
if (e) return
|
|
484
|
+
if (e) return A.value.commands.setContent(K(e.currentContent), { emitUpdate: !1 }), {
|
|
485
485
|
page: G(),
|
|
486
486
|
overflowContent: e.overflowContent,
|
|
487
487
|
overflowHtml: He(e.overflowContent)
|
|
488
488
|
};
|
|
489
489
|
}
|
|
490
490
|
function Y(e) {
|
|
491
|
-
if (!
|
|
492
|
-
let t =
|
|
493
|
-
return
|
|
491
|
+
if (!A.value || !e.length) return;
|
|
492
|
+
let t = A.value.getJSON().content, n = [...e, ...Ve(t) ? [] : t ?? []];
|
|
493
|
+
return A.value.commands.setContent(K(n), { emitUpdate: !1 }), G();
|
|
494
494
|
}
|
|
495
495
|
function X(e, t) {
|
|
496
496
|
let n = [];
|
|
@@ -501,20 +501,20 @@ var be = { class: "gd-contract-template-designer__page-title" }, b = "applicatio
|
|
|
501
501
|
});
|
|
502
502
|
}), n;
|
|
503
503
|
}
|
|
504
|
-
function Ke(e,
|
|
505
|
-
if (!
|
|
506
|
-
let
|
|
507
|
-
return
|
|
508
|
-
e.setNodeMarkup(
|
|
504
|
+
function Ke(e, t = e.key) {
|
|
505
|
+
if (!A.value) return;
|
|
506
|
+
let n = c(e), r = !1;
|
|
507
|
+
return A.value.commands.command(({ tr: e, state: i, dispatch: a }) => (X(i.doc, t).forEach(({ node: t, pos: i }) => {
|
|
508
|
+
e.setNodeMarkup(i, void 0, {
|
|
509
509
|
...t.attrs,
|
|
510
|
-
...
|
|
511
|
-
}),
|
|
512
|
-
}),
|
|
510
|
+
...n
|
|
511
|
+
}), r = !0;
|
|
512
|
+
}), r && a?.(e), r)), $(), r ? G() : void 0;
|
|
513
513
|
}
|
|
514
514
|
function qe(e) {
|
|
515
|
-
if (!
|
|
515
|
+
if (!A.value) return;
|
|
516
516
|
let t = 0;
|
|
517
|
-
return
|
|
517
|
+
return A.value.commands.command(({ tr: n, state: r, dispatch: i }) => {
|
|
518
518
|
let a = X(r.doc, e).map(({ node: e, pos: t }) => ({
|
|
519
519
|
from: t,
|
|
520
520
|
to: t + e.nodeSize
|
|
@@ -523,10 +523,10 @@ var be = { class: "gd-contract-template-designer__page-title" }, b = "applicatio
|
|
|
523
523
|
}), t ? G() : void 0;
|
|
524
524
|
}
|
|
525
525
|
function Z() {
|
|
526
|
-
|
|
526
|
+
O.value?.querySelectorAll(".gd-contract-template-variable.is-active").forEach((e) => e.classList.remove("is-active"));
|
|
527
527
|
}
|
|
528
528
|
function Q(e) {
|
|
529
|
-
if (e) return Array.from(
|
|
529
|
+
if (e) return Array.from(O.value?.querySelectorAll("[data-template-variable]") ?? []).find((t) => t.dataset.key === e);
|
|
530
530
|
}
|
|
531
531
|
function Je(e) {
|
|
532
532
|
Z();
|
|
@@ -535,10 +535,10 @@ var be = { class: "gd-contract-template-designer__page-title" }, b = "applicatio
|
|
|
535
535
|
behavior: "smooth",
|
|
536
536
|
block: "center",
|
|
537
537
|
inline: "center"
|
|
538
|
-
}),
|
|
538
|
+
}), A.value?.commands.focus(), !0) : !1;
|
|
539
539
|
}
|
|
540
540
|
function Ye(e) {
|
|
541
|
-
let t = Array.from(
|
|
541
|
+
let t = Array.from(O.value?.querySelectorAll("[data-signing-placement-id]") ?? []).find((t) => t.dataset.signingPlacementId === e);
|
|
542
542
|
return t?.scrollIntoView({
|
|
543
543
|
behavior: "smooth",
|
|
544
544
|
block: "center",
|
|
@@ -546,49 +546,49 @@ var be = { class: "gd-contract-template-designer__page-title" }, b = "applicatio
|
|
|
546
546
|
}), !!t;
|
|
547
547
|
}
|
|
548
548
|
function $() {
|
|
549
|
-
Z(), Q(
|
|
549
|
+
Z(), Q(T.selectedVariableKey)?.classList.add("is-active");
|
|
550
550
|
}
|
|
551
|
-
function Xe(
|
|
552
|
-
let
|
|
553
|
-
if (!
|
|
554
|
-
let
|
|
555
|
-
|
|
551
|
+
function Xe(e) {
|
|
552
|
+
let t = i.find((t) => t.key === e), n = A.value;
|
|
553
|
+
if (!t || !n) return;
|
|
554
|
+
let r = n.chain().focus().clearNodes();
|
|
555
|
+
t.headingLevel ? r.setHeading({ level: t.headingLevel }) : r.setParagraph(), r.unsetAllMarks().unsetTextAlign().unsetFontSize().unsetFontFamily().unsetColor().setTextAlign(t.textAlign).setFontSize(`${t.fontSize}px`).setFontFamily(t.fontFamily || "Noto Serif SC, Source Han Serif SC, Songti SC, STSong, SimSun, serif").setColor(a.color || "#1f2937"), t.bold ? r.setBold() : r.unsetBold(), t.italic ? r.setItalic() : r.unsetItalic(), t.underline ? r.setUnderline() : r.unsetUnderline(), r.run();
|
|
556
556
|
}
|
|
557
|
-
|
|
558
|
-
|
|
557
|
+
b([() => T.selectedVariableKey, () => T.variables], () => {
|
|
558
|
+
oe($);
|
|
559
559
|
}, {
|
|
560
560
|
deep: !0,
|
|
561
561
|
flush: "post"
|
|
562
562
|
});
|
|
563
563
|
function Ze(e) {
|
|
564
|
-
e.type === "apply-text-style-preset" ? Xe(e.preset) :
|
|
564
|
+
e.type === "apply-text-style-preset" ? Xe(e.preset) : d(A.value, e), H();
|
|
565
565
|
}
|
|
566
566
|
function Qe() {
|
|
567
|
-
|
|
567
|
+
A.value?.commands.focus();
|
|
568
568
|
}
|
|
569
569
|
function $e() {
|
|
570
|
-
return
|
|
570
|
+
return A.value?.getJSON();
|
|
571
571
|
}
|
|
572
572
|
function et() {
|
|
573
|
-
return
|
|
573
|
+
return A.value?.getHTML() ?? T.page.contentHtml;
|
|
574
574
|
}
|
|
575
575
|
function tt(e) {
|
|
576
|
-
let t =
|
|
576
|
+
let t = T.variables.find((t) => t.id === e || t.key === e), n = t ? Q(t.key) : void 0;
|
|
577
577
|
$(), n?.scrollIntoView({
|
|
578
578
|
behavior: "smooth",
|
|
579
579
|
block: "center"
|
|
580
580
|
});
|
|
581
581
|
}
|
|
582
582
|
function nt() {
|
|
583
|
-
|
|
583
|
+
O.value?.scrollIntoView({
|
|
584
584
|
behavior: "smooth",
|
|
585
585
|
block: "start",
|
|
586
586
|
inline: "center"
|
|
587
587
|
});
|
|
588
588
|
}
|
|
589
|
-
return
|
|
590
|
-
|
|
591
|
-
}),
|
|
589
|
+
return ce(() => {
|
|
590
|
+
A.value?.destroy();
|
|
591
|
+
}), w({
|
|
592
592
|
focus: Qe,
|
|
593
593
|
getHTML: et,
|
|
594
594
|
getJSON: $e,
|
|
@@ -610,33 +610,33 @@ var be = { class: "gd-contract-template-designer__page-title" }, b = "applicatio
|
|
|
610
610
|
scrollIntoVariable: Je,
|
|
611
611
|
scrollIntoSigningPlacement: Ye,
|
|
612
612
|
scrollIntoPage: nt
|
|
613
|
-
}), (e, t) => (
|
|
613
|
+
}), (e, t) => (_(), ie("section", {
|
|
614
614
|
class: "gd-contract-template-designer__page-shell",
|
|
615
|
-
style:
|
|
616
|
-
}, [
|
|
617
|
-
class:
|
|
618
|
-
style:
|
|
619
|
-
}, [
|
|
615
|
+
style: g(Me.value)
|
|
616
|
+
}, [m("div", {
|
|
617
|
+
class: se(["gd-contract-template-designer__page-zoom", { "is-active": h.active }]),
|
|
618
|
+
style: g(Ne.value)
|
|
619
|
+
}, [m("header", _e, [m("span", null, v(h.page.title || `第 ${h.pageIndex + 1} 页`), 1), m("span", null, "第 " + v(h.pageIndex + 1) + " 页 · " + v(h.pageSize.label || "A4") + " · " + v(h.pageSize.width) + " × " + v(h.pageSize.height), 1)]), m("div", {
|
|
620
620
|
ref_key: "pageElement",
|
|
621
|
-
ref:
|
|
621
|
+
ref: O,
|
|
622
622
|
class: "gd-contract-template-designer__page",
|
|
623
|
-
style:
|
|
624
|
-
onDragover: t[3] ||=
|
|
623
|
+
style: g(je.value),
|
|
624
|
+
onDragover: t[3] ||= ue(() => {}, ["prevent"]),
|
|
625
625
|
onDrop: Ie,
|
|
626
|
-
onClick: t[4] ||= (e) =>
|
|
627
|
-
}, [
|
|
626
|
+
onClick: t[4] ||= (e) => E("editor-focus", h.page.id)
|
|
627
|
+
}, [y(A) ? (_(), ne(y(de), {
|
|
628
628
|
key: 0,
|
|
629
|
-
editor:
|
|
630
|
-
}, null, 8, ["editor"])) :
|
|
631
|
-
"page-size":
|
|
632
|
-
placements:
|
|
633
|
-
"selected-id":
|
|
629
|
+
editor: y(A)
|
|
630
|
+
}, null, 8, ["editor"])) : re("", !0), ae(te, {
|
|
631
|
+
"page-size": h.pageSize,
|
|
632
|
+
placements: h.signingPlacements,
|
|
633
|
+
"selected-id": h.selectedSigningPlacementId,
|
|
634
634
|
zoom: U.value,
|
|
635
|
-
readonly:
|
|
636
|
-
disabled:
|
|
637
|
-
onSelect: t[0] ||= (e) =>
|
|
638
|
-
onMove: t[1] ||= (e) =>
|
|
639
|
-
onRemove: t[2] ||= (e) =>
|
|
635
|
+
readonly: h.readonly,
|
|
636
|
+
disabled: h.disabled,
|
|
637
|
+
onSelect: t[0] ||= (e) => E("signing-placement-select", e),
|
|
638
|
+
onMove: t[1] ||= (e) => E("signing-placement-move", e),
|
|
639
|
+
onRemove: t[2] ||= (e) => E("signing-placement-remove", e)
|
|
640
640
|
}, null, 8, [
|
|
641
641
|
"page-size",
|
|
642
642
|
"placements",
|
|
@@ -648,4 +648,4 @@ var be = { class: "gd-contract-template-designer__page-title" }, b = "applicatio
|
|
|
648
648
|
}
|
|
649
649
|
});
|
|
650
650
|
//#endregion
|
|
651
|
-
export {
|
|
651
|
+
export { w as default };
|