@guodun/antdv 1.3.2 → 1.4.1

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.
Files changed (111) hide show
  1. package/dist/es/components/contract-signing-location/index.mjs +1 -0
  2. package/dist/es/components/contract-signing-location/src/ContractSigningLocation.vue.mjs +311 -289
  3. package/dist/es/components/contract-signing-location/src/ContractSigningLocationCanvas.vue.mjs +337 -326
  4. package/dist/es/components/contract-signing-location/src/ContractSigningLocationInspector.vue.mjs +3 -2
  5. package/dist/es/components/contract-signing-location/src/ContractSigningLocationNavigator.vue.mjs +41 -33
  6. package/dist/es/components/contract-signing-location/src/ContractSigningTemplatePage.mjs +5 -0
  7. package/dist/es/components/contract-signing-location/src/ContractSigningTemplatePage.vue.mjs +23 -0
  8. package/dist/es/components/contract-signing-location/src/location-rules.mjs +115 -77
  9. package/dist/es/components/contract-signing-location/src/template-source.mjs +85 -0
  10. package/dist/es/components/contract-signing-location/style/index.css +1 -1
  11. package/dist/es/components/index.mjs +8 -6
  12. package/dist/es/components/pro-contract-signing-flow/src/ContractSigningFlowCanvas.vue.mjs +164 -57
  13. package/dist/es/components/pro-contract-signing-flow/src/ContractSigningFlowInspector.vue.mjs +132 -126
  14. package/dist/es/components/pro-contract-signing-flow/src/ContractSigningFlowNodeCard.vue.mjs +75 -49
  15. package/dist/es/components/pro-contract-signing-flow/src/ProContractSigningFlow.vue.mjs +136 -91
  16. package/dist/es/components/pro-contract-signing-flow/src/constants.mjs +25 -5
  17. package/dist/es/components/pro-contract-signing-flow/style/index.css +1 -1
  18. package/dist/es/components/pro-contract-template-designer/index.mjs +5 -4
  19. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.mjs +5 -0
  20. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.mjs +347 -0
  21. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.mjs +5 -0
  22. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.vue.mjs +171 -0
  23. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateFileBar.mjs +5 -0
  24. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateFileBar.vue.mjs +166 -0
  25. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateRendererField.vue.mjs +4 -4
  26. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateRendererValidation.mjs +5 -0
  27. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateRendererValidation.vue.mjs +36 -0
  28. package/dist/es/components/pro-contract-template-designer/src/DesignerPage.vue.mjs +202 -202
  29. package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.mjs +1591 -1612
  30. package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue.mjs +235 -239
  31. package/dist/es/components/pro-contract-template-designer/src/SigningPlacementLayer.vue.mjs +16 -16
  32. package/dist/es/components/pro-contract-template-designer/src/composables/use-template-designer.mjs +166 -166
  33. package/dist/es/components/pro-contract-template-designer/src/composables/use-template-draft-cache.mjs +100 -33
  34. package/dist/es/components/pro-contract-template-designer/src/composables/use-template-files.mjs +77 -0
  35. package/dist/es/components/pro-contract-template-designer/src/extensions/word-paste.mjs +23 -23
  36. package/dist/es/components/pro-contract-template-designer/src/utils/file-tabs.mjs +14 -0
  37. package/dist/es/components/pro-contract-template-designer/src/utils/template-renderer.mjs +121 -121
  38. package/dist/es/components/pro-contract-template-designer/src/utils/toolbar-overflow.mjs +19 -0
  39. package/dist/es/components/pro-contract-template-designer/style/index.css +1 -1
  40. package/dist/es/index.mjs +23 -21
  41. package/dist/lib/components/contract-signing-location/index.cjs +1 -1
  42. package/dist/lib/components/contract-signing-location/src/ContractSigningLocation.vue.cjs +1 -1
  43. package/dist/lib/components/contract-signing-location/src/ContractSigningLocationCanvas.vue.cjs +1 -1
  44. package/dist/lib/components/contract-signing-location/src/ContractSigningLocationInspector.vue.cjs +1 -1
  45. package/dist/lib/components/contract-signing-location/src/ContractSigningLocationNavigator.vue.cjs +1 -1
  46. package/dist/lib/components/contract-signing-location/src/ContractSigningTemplatePage.cjs +1 -0
  47. package/dist/lib/components/contract-signing-location/src/ContractSigningTemplatePage.vue.cjs +1 -0
  48. package/dist/lib/components/contract-signing-location/src/location-rules.cjs +1 -1
  49. package/dist/lib/components/contract-signing-location/src/template-source.cjs +1 -0
  50. package/dist/lib/components/contract-signing-location/style/index.css +1 -1
  51. package/dist/lib/components/index.cjs +1 -1
  52. package/dist/lib/components/pro-contract-signing-flow/src/ContractSigningFlowCanvas.vue.cjs +1 -1
  53. package/dist/lib/components/pro-contract-signing-flow/src/ContractSigningFlowInspector.vue.cjs +1 -1
  54. package/dist/lib/components/pro-contract-signing-flow/src/ContractSigningFlowNodeCard.vue.cjs +1 -1
  55. package/dist/lib/components/pro-contract-signing-flow/src/ProContractSigningFlow.vue.cjs +1 -1
  56. package/dist/lib/components/pro-contract-signing-flow/src/constants.cjs +1 -1
  57. package/dist/lib/components/pro-contract-signing-flow/style/index.css +1 -1
  58. package/dist/lib/components/pro-contract-template-designer/index.cjs +1 -1
  59. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.cjs +1 -0
  60. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.cjs +1 -0
  61. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.cjs +1 -0
  62. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.vue.cjs +1 -0
  63. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateFileBar.cjs +1 -0
  64. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateFileBar.vue.cjs +1 -0
  65. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateRendererField.vue.cjs +1 -1
  66. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateRendererValidation.cjs +1 -0
  67. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateRendererValidation.vue.cjs +1 -0
  68. package/dist/lib/components/pro-contract-template-designer/src/DesignerPage.vue.cjs +2 -2
  69. package/dist/lib/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.cjs +1 -1
  70. package/dist/lib/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue.cjs +1 -1
  71. package/dist/lib/components/pro-contract-template-designer/src/SigningPlacementLayer.vue.cjs +1 -1
  72. package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-designer.cjs +2 -2
  73. package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-draft-cache.cjs +1 -1
  74. package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-files.cjs +2 -0
  75. package/dist/lib/components/pro-contract-template-designer/src/extensions/word-paste.cjs +1 -1
  76. package/dist/lib/components/pro-contract-template-designer/src/utils/file-tabs.cjs +1 -0
  77. package/dist/lib/components/pro-contract-template-designer/src/utils/template-renderer.cjs +2 -2
  78. package/dist/lib/components/pro-contract-template-designer/src/utils/toolbar-overflow.cjs +1 -0
  79. package/dist/lib/components/pro-contract-template-designer/style/index.css +1 -1
  80. package/dist/lib/index.cjs +1 -1
  81. package/dist/theme/contract-signing-location.css +1 -1
  82. package/dist/theme/icon.css +1 -1
  83. package/dist/theme/index.css +1 -1
  84. package/dist/theme/pro-contract-signing-flow.css +1 -1
  85. package/dist/types/components/contract-signing-location/index.d.ts +1 -0
  86. package/dist/types/components/contract-signing-location/src/ContractSigningLocation.vue.d.ts +4 -1
  87. package/dist/types/components/contract-signing-location/src/ContractSigningLocationInspector.vue.d.ts +3 -2
  88. package/dist/types/components/contract-signing-location/src/ContractSigningTemplatePage.vue.d.ts +6 -0
  89. package/dist/types/components/contract-signing-location/src/location-rules.d.ts +3 -3
  90. package/dist/types/components/contract-signing-location/src/template-source.d.ts +20 -0
  91. package/dist/types/components/contract-signing-location/src/types.d.ts +49 -2
  92. package/dist/types/components/pro-contract-signing-flow/src/ContractSigningFlowCanvas.vue.d.ts +19 -3
  93. package/dist/types/components/pro-contract-signing-flow/src/ProContractSigningFlow.vue.d.ts +223 -2
  94. package/dist/types/components/pro-contract-signing-flow/src/constants.d.ts +15 -0
  95. package/dist/types/components/pro-contract-signing-flow/src/types.d.ts +14 -0
  96. package/dist/types/components/pro-contract-template-designer/index.d.ts +1 -0
  97. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.d.ts +103 -0
  98. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.vue.d.ts +48 -0
  99. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateFileBar.vue.d.ts +231 -0
  100. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateRendererValidation.vue.d.ts +15 -0
  101. package/dist/types/components/pro-contract-template-designer/src/DesignerPage.vue.d.ts +1 -1
  102. package/dist/types/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.d.ts +25 -2
  103. package/dist/types/components/pro-contract-template-designer/src/SigningPlacementInspector.vue.d.ts +2 -2
  104. package/dist/types/components/pro-contract-template-designer/src/composables/use-template-designer.d.ts +1 -1
  105. package/dist/types/components/pro-contract-template-designer/src/composables/use-template-draft-cache.d.ts +29 -1
  106. package/dist/types/components/pro-contract-template-designer/src/composables/use-template-files.d.ts +24 -0
  107. package/dist/types/components/pro-contract-template-designer/src/constants.d.ts +2 -2
  108. package/dist/types/components/pro-contract-template-designer/src/types.d.ts +59 -1
  109. package/dist/types/components/pro-contract-template-designer/src/utils/file-tabs.d.ts +3 -0
  110. package/dist/types/components/pro-contract-template-designer/src/utils/toolbar-overflow.d.ts +11 -0
  111. package/package.json +4 -3
@@ -1,18 +1,18 @@
1
- import { CONTRACT_TEXT_STYLE_PRESETS as e } from "./constants.mjs";
2
- import { buildTemplateVariableAttrs as t, insertTemplateVariableNode as n } from "./extensions/template-variable.mjs";
3
- import { normalizeContractImageDimension as r } from "./utils/content-image.mjs";
4
- import { createEditorExtensions as i, runContractTemplateEditorCommand as a } from "./extensions/editor-extensions.mjs";
5
- import { resolveEditorContextMenuKind as o } from "./utils/context-variable.mjs";
6
- import { SIGNING_PLACEMENT_MIME as s, canMutateSigningPlacements as c, getSigningPlacementDefaultSize as ee, parseSigningPlacementDragPayload as te } from "./utils/signing-placement.mjs";
7
- import { DEFAULT_FIELD_STYLE as ne, resolvePageSize as re, splitPageContentByMeasurements as l } from "./composables/use-template-designer.mjs";
8
- import ie from "./SigningPlacementLayer.mjs";
9
- import { computed as u, createBlock as ae, createCommentVNode as oe, createElementBlock as se, createElementVNode as d, createVNode as ce, defineComponent as f, nextTick as le, normalizeClass as ue, normalizeStyle as p, onBeforeUnmount as de, openBlock as m, ref as fe, toDisplayString as h, unref as g, watch as _, withModifiers as pe } from "vue";
10
- import { EditorContent as me, useEditor as he } from "@tiptap/vue-3";
11
- import { generateHTML as ge } from "@tiptap/core";
12
- import { CellSelection as v, deleteColumn as _e, deleteRow as ve, deleteTable as ye } from "@tiptap/pm/tables";
13
- import { NodeSelection as y } from "@tiptap/pm/state";
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 be = { class: "gd-contract-template-designer__page-title" }, b = "application/x-gd-contract-variable-move", xe = 8, x = /* @__PURE__ */ f({
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(f, { expose: x, emit: Se }) {
58
- let S = f, C = Se, w = u(() => S.readonly || S.disabled), T = fe(), E = i("请输入合同正文,或从 WPS / Word 粘贴合同内容", {
59
- processImageFile: S.processImageFile,
60
- getZoom: () => Math.max(.1, S.zoom || 1)
61
- }), D = he({
62
- content: S.page.contentHtml,
63
- editable: !w.value,
64
- extensions: E,
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 = S.variables.find((e) => e.key === r);
71
- return i && C("variable-select", i.key), !1;
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 (w.value) return !1;
75
+ if (D.value) return !1;
76
76
  let n = Oe(e, t.target);
77
77
  if (n) return t.preventDefault(), L({
78
- pageId: S.page.id,
78
+ pageId: T.page.id,
79
79
  clientX: t.clientX,
80
80
  clientY: t.clientY
81
81
  }, n), !0;
82
- let r = D.value?.state.selection, i = r instanceof v, a = t.target instanceof HTMLElement ? !!t.target.closest("td, th") : !1, s = o({
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(), s === "table" && (i || Ee(t.clientX, t.clientY, t.target)) ? (B({
88
- pageId: S.page.id,
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: S.page.id,
92
+ pageId: T.page.id,
93
93
  clientX: t.clientX,
94
94
  clientY: t.clientY
95
95
  }), !0);
96
96
  },
97
- dragstart: (e, t) => w.value ? (t.preventDefault(), !0) : (t.target instanceof HTMLElement ? t.target : null)?.closest("[data-template-variable]") ? (t.dataTransfer?.setData(b, S.page.id), t.dataTransfer && (t.dataTransfer.effectAllowed = "move"), T.value?.classList.add("is-variable-dragging"), !1) : !1,
98
- dragend: () => (T.value?.classList.remove("is-variable-dragging"), !1),
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 (w.value) return t.preventDefault(), t.stopPropagation(), !0;
101
- let n = t.dataTransfer?.getData(b);
102
- return !n || n === S.page.id ? !1 : (t.preventDefault(), C("variable-move-blocked", S.page.id), !0);
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 (w.value || !Ce(t)) return !1;
107
- let n = D.value;
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: S.page.id,
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 v;
120
- if (o({
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(v.create(n.state.doc, e)));
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: S.page.id,
131
+ pageId: T.page.id,
132
132
  clientX: e.left,
133
133
  clientY: e.bottom
134
134
  }), !0;
135
135
  }
136
- let s = n.view.coordsAtPos(n.state.selection.from);
136
+ let o = n.view.coordsAtPos(n.state.selection.from);
137
137
  return I({
138
- pageId: S.page.id,
139
- clientX: s.left,
140
- clientY: s.bottom
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
- C("page-update", {
146
- ...S.page,
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
- C("editor-focus", S.page.id), H();
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 O(e) {
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 k() {
164
- if (!D.value) return "";
165
- let { from: e, to: t } = D.value.state.selection;
166
- return D.value.state.doc.textBetween(e, t, "\n");
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 A() {
169
- let e = D.value, t = e?.state.selection;
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) > xe) return;
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 = D.value;
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 = D.value, r = n?.view.posAtCoords({
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 = D.value;
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 = D.value, i = n instanceof HTMLElement ? n : null;
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 v && i.closest("td.selectedCell,th.selectedCell")) return !0;
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(v.create(r.state.doc, a))), !0) : !1;
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 = D.value, t = e?.isActive("table") ? e.can() : void 0, n = (e) => !!(t && e(t));
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 = D.value, t = e?.state.selection;
240
- if (!e || !(t instanceof v)) return "left";
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 = D.value?.state.doc) {
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 = D.value;
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" ? ve(t.state, i) : e === "delete-table-column" ? _e(t.state, i) : ye(t.state, i), Math.max(0, n - r);
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 = D.value?.state.selection, n = !!(t && !t.empty);
263
- C("editor-context-menu", {
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 ? A() : void 0,
267
+ selectionWidth: n ? Se() : void 0,
268
268
  leadingText: j()
269
269
  });
270
270
  }
271
271
  function L(e, t) {
272
- C("editor-context-menu", {
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: r(e.attrs.width),
285
- height: r(e.attrs.height)
284
+ width: u(e.attrs.width),
285
+ height: u(e.attrs.height)
286
286
  };
287
287
  }
288
288
  function z() {
289
- let e = D.value?.state.selection;
290
- if (e instanceof y) return R(e.node, e.from);
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" && C("variable-select", r.attrs.key), (!(e.state.selection instanceof y) || e.state.selection.from !== t) && e.dispatch(e.state.tr.setSelection(y.create(e.state.doc, t))), R(r, t));
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
- C("editor-context-menu", {
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 D.value ? [
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) => D.value?.isActive("heading", { level: e })) : void 0;
322
+ ].find((e) => A.value?.isActive("heading", { level: e })) : void 0;
323
323
  }
324
324
  function Ae() {
325
- return ["center", "right"].find((e) => D.value?.isActive("heading", { textAlign: e }) || D.value?.isActive("paragraph", { textAlign: e })) ?? "left";
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 = D.value, t = (t) => !!e?.isActive(t), n = e?.getAttributes("textStyle") ?? {};
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: O(n.fontSize),
342
+ fontSize: be(n.fontSize),
343
343
  textColor: typeof n.color == "string" ? n.color : void 0,
344
- selectionText: k(),
344
+ selectionText: xe(),
345
345
  selectedContentImage: z()
346
346
  };
347
347
  }
348
348
  function H() {
349
- C("editor-state-change", S.page.id, V());
349
+ E("editor-state-change", T.page.id, V());
350
350
  }
351
- _(w, (e) => {
352
- D.value?.setEditable(!e), H();
353
- }), _(() => S.page.contentHtml, (e) => {
354
- !D.value || e === D.value.getHTML() || (D.value.commands.setContent(e || "<p></p>", { emitUpdate: !1 }), H());
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 = u(() => ({
357
- width: `${S.pageSize.width}px`,
358
- height: `${S.pageSize.height}px`,
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 = u(() => Math.max(.1, S.zoom || 1)), Me = u(() => ({
361
- width: `${Math.ceil((S.pageSize.width + 10) * U.value)}px`,
362
- height: `${Math.ceil((S.pageSize.height + 40) * U.value)}px`
363
- })), Ne = u(() => ({ "--gd-contract-page-zoom": String(U.value) })), Pe = u(() => re(S.pageSize));
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 = T.value?.getBoundingClientRect();
365
+ let n = O.value?.getBoundingClientRect();
366
366
  return n ? {
367
- x: Math.min(S.pageSize.width, Math.max(0, (e - n.left) / U.value)),
368
- y: Math.min(S.pageSize.height, Math.max(0, (t - n.top) / U.value))
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: S.pageSize.width / 2,
371
- y: S.pageSize.height / 2
370
+ x: T.pageSize.width / 2,
371
+ y: T.pageSize.height / 2
372
372
  };
373
373
  }
374
374
  function Fe(e) {
375
- let t = T.value?.getBoundingClientRect(), n = T.value?.closest(".gd-contract-template-designer__canvas")?.getBoundingClientRect(), r = ee(e);
376
- if (!t || !n) return {
377
- x: Math.max(0, (S.pageSize.width - r.width) / 2),
378
- y: Math.max(0, (S.pageSize.height - r.height) / 2)
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 i = Math.max(t.left, n.left), a = Math.max(t.top, n.top), o = Math.min(t.right, n.right), s = Math.min(t.bottom, n.bottom), c = W(o > i ? (i + o) / 2 : (t.left + t.right) / 2, s > a ? (a + s) / 2 : (t.top + t.bottom) / 2);
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: c.x - r.width / 2,
383
- y: c.y - r.height / 2
382
+ x: l.x - i.width / 2,
383
+ y: l.y - i.height / 2
384
384
  };
385
385
  }
386
- function Ie(e) {
387
- if (!c(S.readonly, S.disabled)) {
388
- e.preventDefault(), e.stopPropagation();
386
+ function Ie(n) {
387
+ if (!t(T.readonly, T.disabled)) {
388
+ n.preventDefault(), n.stopPropagation();
389
389
  return;
390
390
  }
391
- let t = te(e.dataTransfer?.getData(s));
392
- if (t) {
393
- e.preventDefault(), e.stopPropagation();
394
- let n = W(e.clientX, e.clientY);
395
- C("signing-placement-drop", S.page.id, t, n.x, n.y);
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 n = e.dataTransfer?.getData("application/x-gd-contract-variable");
399
- if (n) {
400
- e.preventDefault(), e.stopPropagation(), C("variable-drop", S.page.id, n, e.clientX, e.clientY);
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 r = e.dataTransfer?.getData(b);
404
- r && r !== S.page.id && (e.preventDefault(), e.stopPropagation(), C("variable-move-blocked", S.page.id));
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 r = D.value;
408
- return r ? (n(r, e, t ? r.view.posAtCoords(t)?.pos : void 0), $(), G()) : void 0;
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 = D.value;
412
- if (n) return a(n, {
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 = D.value, n = t?.state.selection;
420
- if (!t || !(n instanceof y) || n.node.type.name !== "image") return;
421
- let i = { ...n.node.attrs }, a = !1;
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 : r(e[t]) ?? null;
425
- i[t] !== n && (i[t] = n, a = !0);
426
- }), !a) return;
427
- let o = t.state.tr.setNodeMarkup(n.from, void 0, i);
428
- return o.setSelection(y.create(o.doc, n.from)), t.view.dispatch(o), G();
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 = D.value?.state.selection;
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
- ...S.page,
439
+ ...T.page,
440
440
  pageSize: Pe.value,
441
- contentHtml: D.value?.getHTML() ?? S.page.contentHtml,
442
- contentJson: D.value?.getJSON() ?? S.page.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 ge(K(e), E);
455
+ return pe(K(e), k);
456
456
  }
457
457
  function q() {
458
- let e = T.value;
459
- if (!e) return S.pageSize.height - 108;
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, S.pageSize.height - n - r);
461
+ return Math.max(120, T.pageSize.height - n - r);
462
462
  }
463
463
  function Ue() {
464
- let e = T.value?.querySelector(".gd-contract-template-designer__editor-prose");
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 D.value ? l(D.value.getJSON().content, Ue(), q()) : void 0;
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 (!D.value) return;
482
+ if (!A.value) return;
483
483
  let e = J();
484
- if (e) return D.value.commands.setContent(K(e.currentContent), { emitUpdate: !1 }), {
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 (!D.value || !e.length) return;
492
- let t = D.value.getJSON().content, n = [...e, ...Ve(t) ? [] : t ?? []];
493
- return D.value.commands.setContent(K(n), { emitUpdate: !1 }), G();
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, n = e.key) {
505
- if (!D.value) return;
506
- let r = t(e), i = !1;
507
- return D.value.commands.command(({ tr: e, state: t, dispatch: a }) => (X(t.doc, n).forEach(({ node: t, pos: n }) => {
508
- e.setNodeMarkup(n, void 0, {
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
- ...r
511
- }), i = !0;
512
- }), i && a?.(e), i)), $(), i ? G() : void 0;
510
+ ...n
511
+ }), r = !0;
512
+ }), r && a?.(e), r)), $(), r ? G() : void 0;
513
513
  }
514
514
  function qe(e) {
515
- if (!D.value) return;
515
+ if (!A.value) return;
516
516
  let t = 0;
517
- return D.value.commands.command(({ tr: n, state: r, dispatch: i }) => {
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
- T.value?.querySelectorAll(".gd-contract-template-variable.is-active").forEach((e) => e.classList.remove("is-active"));
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(T.value?.querySelectorAll("[data-template-variable]") ?? []).find((t) => t.dataset.key === e);
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
- }), D.value?.commands.focus(), !0) : !1;
538
+ }), A.value?.commands.focus(), !0) : !1;
539
539
  }
540
540
  function Ye(e) {
541
- let t = Array.from(T.value?.querySelectorAll("[data-signing-placement-id]") ?? []).find((t) => t.dataset.signingPlacementId === e);
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(S.selectedVariableKey)?.classList.add("is-active");
549
+ Z(), Q(T.selectedVariableKey)?.classList.add("is-active");
550
550
  }
551
- function Xe(t) {
552
- let n = e.find((e) => e.key === t), r = D.value;
553
- if (!n || !r) return;
554
- let i = r.chain().focus().clearNodes();
555
- n.headingLevel ? i.setHeading({ level: n.headingLevel }) : i.setParagraph(), i.unsetAllMarks().unsetTextAlign().unsetFontSize().unsetFontFamily().unsetColor().setTextAlign(n.textAlign).setFontSize(`${n.fontSize}px`).setFontFamily(n.fontFamily || "Noto Serif SC, Source Han Serif SC, Songti SC, STSong, SimSun, serif").setColor(ne.color || "#1f2937"), n.bold ? i.setBold() : i.unsetBold(), n.italic ? i.setItalic() : i.unsetItalic(), n.underline ? i.setUnderline() : i.unsetUnderline(), i.run();
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
- _([() => S.selectedVariableKey, () => S.variables], () => {
558
- le($);
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) : a(D.value, e), H();
564
+ e.type === "apply-text-style-preset" ? Xe(e.preset) : d(A.value, e), H();
565
565
  }
566
566
  function Qe() {
567
- D.value?.commands.focus();
567
+ A.value?.commands.focus();
568
568
  }
569
569
  function $e() {
570
- return D.value?.getJSON();
570
+ return A.value?.getJSON();
571
571
  }
572
572
  function et() {
573
- return D.value?.getHTML() ?? S.page.contentHtml;
573
+ return A.value?.getHTML() ?? T.page.contentHtml;
574
574
  }
575
575
  function tt(e) {
576
- let t = S.variables.find((t) => t.id === e || t.key === e), n = t ? Q(t.key) : void 0;
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
- T.value?.scrollIntoView({
583
+ O.value?.scrollIntoView({
584
584
  behavior: "smooth",
585
585
  block: "start",
586
586
  inline: "center"
587
587
  });
588
588
  }
589
- return de(() => {
590
- D.value?.destroy();
591
- }), x({
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) => (m(), se("section", {
613
+ }), (e, t) => (_(), ie("section", {
614
614
  class: "gd-contract-template-designer__page-shell",
615
- style: p(Me.value)
616
- }, [d("div", {
617
- class: ue(["gd-contract-template-designer__page-zoom", { "is-active": f.active }]),
618
- style: p(Ne.value)
619
- }, [d("header", be, [d("span", null, h(f.page.title || `第 ${f.pageIndex + 1} 页`), 1), d("span", null, "第 " + h(f.pageIndex + 1) + " 页 · " + h(f.pageSize.label || "A4") + " · " + h(f.pageSize.width) + " × " + h(f.pageSize.height), 1)]), d("div", {
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: T,
621
+ ref: O,
622
622
  class: "gd-contract-template-designer__page",
623
- style: p(je.value),
624
- onDragover: t[3] ||= pe(() => {}, ["prevent"]),
623
+ style: g(je.value),
624
+ onDragover: t[3] ||= ue(() => {}, ["prevent"]),
625
625
  onDrop: Ie,
626
- onClick: t[4] ||= (e) => C("editor-focus", f.page.id)
627
- }, [g(D) ? (m(), ae(g(me), {
626
+ onClick: t[4] ||= (e) => E("editor-focus", h.page.id)
627
+ }, [y(A) ? (_(), ne(y(de), {
628
628
  key: 0,
629
- editor: g(D)
630
- }, null, 8, ["editor"])) : oe("", !0), ce(ie, {
631
- "page-size": f.pageSize,
632
- placements: f.signingPlacements,
633
- "selected-id": f.selectedSigningPlacementId,
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: f.readonly,
636
- disabled: f.disabled,
637
- onSelect: t[0] ||= (e) => C("signing-placement-select", e),
638
- onMove: t[1] ||= (e) => C("signing-placement-move", e),
639
- onRemove: t[2] ||= (e) => C("signing-placement-remove", 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 { x as default };
651
+ export { w as default };