@guodun/antdv 1.4.0 → 1.4.2

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 (128) hide show
  1. package/dist/es/components/contract-signing-location/src/ContractSigningLocation.vue.mjs +8 -1
  2. package/dist/es/components/contract-signing-location/src/ContractSigningLocationInspector.vue.mjs +3 -2
  3. package/dist/es/components/pro-contract-signing-flow/src/ContractSigningFlowInspector.vue.mjs +4 -1
  4. package/dist/es/components/pro-contract-signing-flow/src/ProContractSigningFlow.vue.mjs +67 -66
  5. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.mjs +208 -180
  6. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.vue.mjs +2 -1
  7. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerToolbar.mjs +5 -0
  8. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerToolbar.vue.mjs +690 -0
  9. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.mjs +5 -0
  10. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.vue.mjs +215 -0
  11. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateImageContextMenu.mjs +5 -0
  12. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateImageContextMenu.vue.mjs +87 -0
  13. package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePageDecorations.mjs +5 -0
  14. package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePageDecorations.vue.mjs +98 -0
  15. package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsInspector.mjs +5 -0
  16. package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsInspector.vue.mjs +550 -0
  17. package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsStudio.mjs +5 -0
  18. package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsStudio.vue.mjs +117 -0
  19. package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePreviewModal.mjs +5 -0
  20. package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePreviewModal.vue.mjs +96 -0
  21. package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePreviewPage.vue.mjs +51 -26
  22. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateRendererPage.vue.mjs +56 -33
  23. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateSubmitDataModal.mjs +5 -0
  24. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateSubmitDataModal.vue.mjs +29 -0
  25. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateTextContextMenu.mjs +5 -0
  26. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateTextContextMenu.vue.mjs +390 -0
  27. package/dist/es/components/pro-contract-template-designer/src/DesignerPage.vue.mjs +313 -267
  28. package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.mjs +1278 -2293
  29. package/dist/es/components/pro-contract-template-designer/src/composables/use-auto-pagination.mjs +71 -0
  30. package/dist/es/components/pro-contract-template-designer/src/composables/use-designer-files.mjs +11 -0
  31. package/dist/es/components/pro-contract-template-designer/src/composables/use-draft-cache-session.mjs +111 -0
  32. package/dist/es/components/pro-contract-template-designer/src/composables/use-signing-placement-editor.mjs +79 -0
  33. package/dist/es/components/pro-contract-template-designer/src/composables/use-template-designer.mjs +189 -160
  34. package/dist/es/components/pro-contract-template-designer/src/composables/use-template-files.mjs +35 -22
  35. package/dist/es/components/pro-contract-template-designer/src/composables/use-toolbar-overflow.mjs +71 -0
  36. package/dist/es/components/pro-contract-template-designer/src/constants.mjs +71 -10
  37. package/dist/es/components/pro-contract-template-designer/src/extensions/editor-extensions.mjs +1 -0
  38. package/dist/es/components/pro-contract-template-designer/src/utils/block-style.mjs +43 -0
  39. package/dist/es/components/pro-contract-template-designer/src/utils/context-menu-viewport.mjs +13 -0
  40. package/dist/es/components/pro-contract-template-designer/src/utils/editor-state.mjs +7 -0
  41. package/dist/es/components/pro-contract-template-designer/src/utils/page-decorations.mjs +398 -0
  42. package/dist/es/components/pro-contract-template-designer/src/utils/serialize-fingerprint.mjs +6 -0
  43. package/dist/es/components/pro-contract-template-designer/src/utils/template-renderer.mjs +88 -72
  44. package/dist/es/components/pro-contract-template-designer/style/index.css +1 -1
  45. package/dist/es/index.mjs +20 -20
  46. package/dist/lib/components/contract-signing-location/src/ContractSigningLocation.vue.cjs +1 -1
  47. package/dist/lib/components/contract-signing-location/src/ContractSigningLocationInspector.vue.cjs +1 -1
  48. package/dist/lib/components/pro-contract-signing-flow/src/ContractSigningFlowInspector.vue.cjs +1 -1
  49. package/dist/lib/components/pro-contract-signing-flow/src/ProContractSigningFlow.vue.cjs +1 -1
  50. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.cjs +1 -1
  51. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.vue.cjs +1 -1
  52. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerToolbar.cjs +1 -0
  53. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerToolbar.vue.cjs +1 -0
  54. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.cjs +1 -0
  55. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.vue.cjs +1 -0
  56. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateImageContextMenu.cjs +1 -0
  57. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateImageContextMenu.vue.cjs +1 -0
  58. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePageDecorations.cjs +1 -0
  59. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePageDecorations.vue.cjs +1 -0
  60. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsInspector.cjs +1 -0
  61. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsInspector.vue.cjs +1 -0
  62. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsStudio.cjs +1 -0
  63. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsStudio.vue.cjs +1 -0
  64. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePreviewModal.cjs +1 -0
  65. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePreviewModal.vue.cjs +1 -0
  66. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePreviewPage.vue.cjs +1 -1
  67. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateRendererPage.vue.cjs +1 -1
  68. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateSubmitDataModal.cjs +1 -0
  69. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateSubmitDataModal.vue.cjs +1 -0
  70. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateTextContextMenu.cjs +1 -0
  71. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateTextContextMenu.vue.cjs +1 -0
  72. package/dist/lib/components/pro-contract-template-designer/src/DesignerPage.vue.cjs +2 -2
  73. package/dist/lib/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.cjs +1 -1
  74. package/dist/lib/components/pro-contract-template-designer/src/composables/use-auto-pagination.cjs +1 -0
  75. package/dist/lib/components/pro-contract-template-designer/src/composables/use-designer-files.cjs +1 -0
  76. package/dist/lib/components/pro-contract-template-designer/src/composables/use-draft-cache-session.cjs +1 -0
  77. package/dist/lib/components/pro-contract-template-designer/src/composables/use-signing-placement-editor.cjs +1 -0
  78. package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-designer.cjs +4 -4
  79. package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-files.cjs +2 -2
  80. package/dist/lib/components/pro-contract-template-designer/src/composables/use-toolbar-overflow.cjs +1 -0
  81. package/dist/lib/components/pro-contract-template-designer/src/constants.cjs +1 -1
  82. package/dist/lib/components/pro-contract-template-designer/src/extensions/editor-extensions.cjs +1 -1
  83. package/dist/lib/components/pro-contract-template-designer/src/utils/block-style.cjs +1 -0
  84. package/dist/lib/components/pro-contract-template-designer/src/utils/context-menu-viewport.cjs +1 -0
  85. package/dist/lib/components/pro-contract-template-designer/src/utils/editor-state.cjs +1 -0
  86. package/dist/lib/components/pro-contract-template-designer/src/utils/page-decorations.cjs +1 -0
  87. package/dist/lib/components/pro-contract-template-designer/src/utils/serialize-fingerprint.cjs +1 -0
  88. package/dist/lib/components/pro-contract-template-designer/src/utils/template-renderer.cjs +3 -3
  89. package/dist/lib/components/pro-contract-template-designer/style/index.css +1 -1
  90. package/dist/lib/index.cjs +1 -1
  91. package/dist/theme/icon.css +1 -1
  92. package/dist/theme/index.css +1 -1
  93. package/dist/types/components/contract-signing-location/src/ContractSigningLocation.vue.d.ts +1 -0
  94. package/dist/types/components/contract-signing-location/src/ContractSigningLocationInspector.vue.d.ts +1 -0
  95. package/dist/types/components/contract-signing-location/src/types.d.ts +2 -0
  96. package/dist/types/components/pro-contract-signing-flow/src/types.d.ts +2 -0
  97. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.d.ts +3 -0
  98. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.vue.d.ts +1 -0
  99. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerToolbar.vue.d.ts +104 -0
  100. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.vue.d.ts +50 -0
  101. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateImageContextMenu.vue.d.ts +27 -0
  102. package/dist/types/components/pro-contract-template-designer/src/ContractTemplatePageDecorations.vue.d.ts +13 -0
  103. package/dist/types/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsInspector.vue.d.ts +28 -0
  104. package/dist/types/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsStudio.vue.d.ts +77 -0
  105. package/dist/types/components/pro-contract-template-designer/src/ContractTemplatePreviewModal.vue.d.ts +36 -0
  106. package/dist/types/components/pro-contract-template-designer/src/ContractTemplatePreviewPage.vue.d.ts +5 -1
  107. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateRendererHeader.vue.d.ts +4 -4
  108. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateRendererToolbar.vue.d.ts +4 -4
  109. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateSubmitDataModal.vue.d.ts +12 -0
  110. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateTextContextMenu.vue.d.ts +77 -0
  111. package/dist/types/components/pro-contract-template-designer/src/DesignerPage.vue.d.ts +8 -32
  112. package/dist/types/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.d.ts +366 -12
  113. package/dist/types/components/pro-contract-template-designer/src/composables/use-auto-pagination.d.ts +43 -0
  114. package/dist/types/components/pro-contract-template-designer/src/composables/use-designer-files.d.ts +22 -0
  115. package/dist/types/components/pro-contract-template-designer/src/composables/use-draft-cache-session.d.ts +41 -0
  116. package/dist/types/components/pro-contract-template-designer/src/composables/use-signing-placement-editor.d.ts +49 -0
  117. package/dist/types/components/pro-contract-template-designer/src/composables/use-template-designer.d.ts +15 -1
  118. package/dist/types/components/pro-contract-template-designer/src/composables/use-template-files.d.ts +13 -0
  119. package/dist/types/components/pro-contract-template-designer/src/composables/use-toolbar-overflow.d.ts +19 -0
  120. package/dist/types/components/pro-contract-template-designer/src/constants.d.ts +7 -1
  121. package/dist/types/components/pro-contract-template-designer/src/types.d.ts +89 -0
  122. package/dist/types/components/pro-contract-template-designer/src/utils/block-style.d.ts +4 -0
  123. package/dist/types/components/pro-contract-template-designer/src/utils/context-menu-viewport.d.ts +22 -0
  124. package/dist/types/components/pro-contract-template-designer/src/utils/editor-state.d.ts +8 -0
  125. package/dist/types/components/pro-contract-template-designer/src/utils/page-decorations.d.ts +90 -0
  126. package/dist/types/components/pro-contract-template-designer/src/utils/serialize-fingerprint.d.ts +8 -0
  127. package/dist/types/components/pro-contract-template-designer/src/utils/template-renderer.d.ts +4 -1
  128. package/package.json +3 -3
@@ -1,98 +1,48 @@
1
1
  import { isContractTemplateFieldType as e } from "./types.mjs";
2
- import { ContractTemplateLocationRuleBuildError as t, SIGNING_PLACEMENT_MIME as n, SIGNING_PLACEMENT_TYPE_LABELS as r, applySigningPlacementPatch as i, buildContractLocationRules as a, buildSigningPlacementLocationRules as o, canMutateSigningPlacements as s, clampSigningPlacement as ee, createSigningPlacement as te, getSigningPlacementDefaultSize as ne, resolveSigningPlacementToolItems as re, scaleSigningPlacementToPage as ie, serializeSigningPlacementDragPayload as ae } from "./utils/signing-placement.mjs";
3
- import { CONTRACT_TEXT_STYLE_PRESETS as oe, DEFAULT_CONTRACT_FONT_FAMILY as se, DEFAULT_FONT_SIZE_PRESETS as ce, DEFAULT_TEXT_ALIGN_OPTIONS as le, resolveFontFamilyOptions as ue } from "./constants.mjs";
4
- import { DEFAULT_FIELD_STYLE as de, DEFAULT_FIELD_TYPES as fe, DEFAULT_PAGE_SIZE as pe, buildTemplatePreviewPages as me, cloneTemplateValue as c, collectTemplateLocationRuleExportErrors as he, constrainTemplatePageSizes as ge, createBlankPage as _e, createBlankTemplate as ve, createDefaultPage as ye, createTemplateVariable as be, exportTemplateValue as xe, getFieldOption as Se, getPageSizeKey as Ce, normalizeContractTemplateMaxPages as we, normalizePageSizeOptions as Te, normalizeTemplateValue as Ee, resolvePageSize as De, syncTemplateVariablesWithPages as Oe, validateTemplateValue as ke } from "./composables/use-template-designer.mjs";
5
- import { isSafeContractImageUrl as Ae } from "./utils/image-url.mjs";
6
- import { useFitWidthZoom as je } from "./composables/use-fit-width-zoom.mjs";
7
- import { MAX_CONTRACT_IMAGE_DIMENSION as Me, normalizeContractImageDimension as Ne, processContractImageFile as Pe } from "./utils/content-image.mjs";
2
+ import { ContractTemplateLocationRuleBuildError as t, SIGNING_PLACEMENT_TYPE_LABELS as n, buildContractLocationRules as r, buildSigningPlacementLocationRules as i, createSigningPlacement as a, resolveSigningPlacementToolItems as o, scaleSigningPlacementToPage as ee } from "./utils/signing-placement.mjs";
3
+ import { CONTRACT_BLOCK_STYLES as te, DEFAULT_CONTRACT_FONT_FAMILY as ne, DEFAULT_FONT_SIZE_PRESETS as re, DEFAULT_TEXT_ALIGN_OPTIONS as ie, resolveFontFamilyOptions as ae } from "./constants.mjs";
4
+ import { collectPageDecorationVariableKeys as oe, normalizePageDecorations as se, resolvePageDecorationPreset as ce, resolvePageDecorationValidationPath as le, rewritePageDecorationVariableTokens as ue } from "./utils/page-decorations.mjs";
5
+ import { DEFAULT_FIELD_STYLE as de, DEFAULT_FIELD_TYPES as s, DEFAULT_PAGE_SIZE as fe, buildTemplatePreviewPages as pe, cloneTemplateValue as c, collectTemplateLocationRuleExportErrors as me, collectTemplateValueVariableKeys as he, constrainTemplatePageSizes as ge, createBlankPage as _e, createBlankTemplate as ve, createDefaultPage as ye, createTemplateVariable as be, exportTemplateValue as xe, getFieldOption as Se, getPageSizeKey as Ce, normalizeContractTemplateMaxPages as we, normalizePageSizeOptions as Te, normalizeTemplateValue as Ee, resolvePageSize as De, syncTemplateVariablesWithPages as Oe, validateContractTemplateVariableKey as ke, validateTemplateValue as Ae } from "./composables/use-template-designer.mjs";
6
+ import { isSafeContractImageUrl as je } from "./utils/image-url.mjs";
7
+ import { useFitWidthZoom as Me } from "./composables/use-fit-width-zoom.mjs";
8
+ import { normalizeContractImageDimension as Ne, processContractImageFile as Pe } from "./utils/content-image.mjs";
8
9
  import { inferContextVariableLabel as Fe, resolveContextVariableWidth as Ie } from "./utils/context-variable.mjs";
9
10
  import Le from "./DesignerPage.mjs";
10
- import Re from "./ContractTemplatePreviewPage.mjs";
11
- import ze from "./TableContextMenu.mjs";
12
- import Be from "./TableSizePicker.mjs";
13
- import { DEFAULT_DRAFT_CACHE_INTERVAL as Ve, DEFAULT_DRAFT_CACHE_KEY as He, DEFAULT_DRAFT_CACHE_MAX_BYTES as l, clearTemplateDraftCache as Ue, createDraftCacheStatus as We, formatDraftCacheSavedAt as Ge, getBrowserDraftCacheStorage as Ke, isBlankTemplateDraftValue as qe, isBlankTemplateFilesDraftValue as Je, loadTemplateDraftCache as Ye, loadTemplateFilesDraftCache as Xe, saveTemplateDraftCache as Ze, saveTemplateFilesDraftCache as Qe } from "./composables/use-template-draft-cache.mjs";
14
- import { cloneContractTemplateFiles as u, createContractTemplateFile as $e, exportContractTemplateFiles as et, moveContractTemplateFile as tt, normalizeContractTemplateFiles as nt, removeContractTemplateFile as rt, renameContractTemplateFile as it, replaceContractTemplateFile as at, resolveContractTemplateActiveFileId as ot } from "./composables/use-template-files.mjs";
15
- import { resolveFieldTypeIcon as st, resolveSigningPlacementTypeIcon as ct } from "./utils/template-tool-icons.mjs";
16
- import lt from "./ContractTemplateFileBar.mjs";
17
- import ut from "./ContractTemplateDesignerSidebar.mjs";
18
- import dt from "./ContractTemplateDesignerInspector.mjs";
19
- import { CONTRACT_TEMPLATE_TOOLBAR_OVERFLOW_PRIORITY as ft, resolveContractTemplateToolbarOverflowKeys as pt } from "./utils/toolbar-overflow.mjs";
20
- import { Fragment as mt, Teleport as ht, computed as d, createBlock as f, createCommentVNode as p, createElementBlock as m, createElementVNode as h, createTextVNode as g, createVNode as _, defineComponent as v, nextTick as y, normalizeClass as b, normalizeStyle as gt, onBeforeUnmount as _t, onMounted as vt, openBlock as x, ref as S, renderList as yt, resolveDynamicComponent as bt, toDisplayString as C, unref as w, vShow as xt, watch as St, withCtx as T, withDirectives as Ct, withModifiers as wt } from "vue";
21
- import { Alert as Tt, Button as E, Input as Et, InputNumber as Dt, Modal as Ot, Popover as kt, Select as At, Switch as jt, Tooltip as D } from "ant-design-vue";
22
- import { useElementSize as Mt } from "@vueuse/core";
23
- import { AlignCenterOutlined as Nt, AlignLeftOutlined as Pt, AlignRightOutlined as Ft, AuditOutlined as It, BoldOutlined as Lt, ClearOutlined as Rt, ColumnWidthOutlined as zt, CopyOutlined as Bt, DatabaseOutlined as Vt, DeleteOutlined as Ht, DownOutlined as Ut, EllipsisOutlined as Wt, EyeOutlined as Gt, FileAddOutlined as Kt, FormatPainterOutlined as qt, FullscreenExitOutlined as Jt, FullscreenOutlined as Yt, ItalicOutlined as Xt, MinusOutlined as Zt, OrderedListOutlined as Qt, PictureOutlined as $t, PlusOutlined as en, RedoOutlined as tn, ReloadOutlined as nn, ScissorOutlined as rn, TableOutlined as an, UnderlineOutlined as on, UndoOutlined as sn, UnorderedListOutlined as cn, ZoomInOutlined as ln, ZoomOutOutlined as un } from "@ant-design/icons-vue";
11
+ import Re from "./TableContextMenu.mjs";
12
+ import ze from "./ContractTemplateDesignerWorkspaceHeader.mjs";
13
+ import Be from "./ContractTemplateDesignerToolbar.mjs";
14
+ import Ve from "./ContractTemplateTextContextMenu.mjs";
15
+ import He from "./ContractTemplateImageContextMenu.mjs";
16
+ import Ue from "./ContractTemplatePreviewModal.mjs";
17
+ import We from "./ContractTemplateSubmitDataModal.mjs";
18
+ import { DEFAULT_DRAFT_CACHE_INTERVAL as Ge, DEFAULT_DRAFT_CACHE_KEY as Ke, DEFAULT_DRAFT_CACHE_MAX_BYTES as l, createDraftCacheStatus as qe, formatDraftCacheSavedAt as Je } from "./composables/use-template-draft-cache.mjs";
19
+ import { useAutoPagination as Ye } from "./composables/use-auto-pagination.mjs";
20
+ import { resolveSetActiveFileIdOptions as Xe } from "./composables/use-designer-files.mjs";
21
+ import { cloneContractTemplateFiles as u, constrainContractTemplateFiles as Ze, createContractTemplateFile as Qe, exportContractTemplateFiles as $e, moveContractTemplateFile as et, normalizeContractTemplateFiles as tt, removeContractTemplateFile as nt, renameContractTemplateFile as rt, replaceContractTemplateFile as it, resolveContractTemplateActiveFileId as at } from "./composables/use-template-files.mjs";
22
+ import { useDraftCacheSession as ot } from "./composables/use-draft-cache-session.mjs";
23
+ import { cloneSigningPlacement as st, useSigningPlacementEditor as ct } from "./composables/use-signing-placement-editor.mjs";
24
+ import { resolveFieldTypeIcon as lt, resolveSigningPlacementTypeIcon as ut } from "./utils/template-tool-icons.mjs";
25
+ import dt from "./ContractTemplateFileBar.mjs";
26
+ import ft from "./ContractTemplateDesignerSidebar.mjs";
27
+ import pt from "./ContractTemplateDesignerInspector.mjs";
28
+ import mt from "./ContractTemplatePageDecorationsStudio.mjs";
29
+ import { serializeFingerprint as d } from "./utils/serialize-fingerprint.mjs";
30
+ import { isSameEditorState as ht } from "./utils/editor-state.mjs";
31
+ import { clampContextMenuPosition as gt, clampContextMenuToElement as _t } from "./utils/context-menu-viewport.mjs";
32
+ import { Fragment as vt, Teleport as yt, computed as f, createBlock as bt, createCommentVNode as xt, createElementBlock as St, createElementVNode as Ct, createVNode as wt, defineComponent as p, nextTick as m, normalizeClass as Tt, normalizeStyle as Et, onBeforeUnmount as Dt, onMounted as Ot, openBlock as h, ref as g, renderList as kt, toDisplayString as At, unref as _, useId as jt, vShow as Mt, watch as v, withDirectives as Nt } from "vue";
33
+ import { Alert as Pt, Modal as Ft } from "ant-design-vue";
34
+ import { useElementSize as It } from "@vueuse/core";
24
35
  //#region src/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue?vue&type=script&setup=true&lang.ts
25
- var dn = { class: "gd-contract-template-designer__workspace-header" }, fn = { class: "gd-contract-template-designer__workspace-meta" }, pn = { class: "gd-contract-template-designer__workspace-actions" }, mn = { class: "gd-contract-template-designer__workspace-controls" }, hn = { class: "gd-contract-template-designer__zoom" }, gn = { class: "gd-contract-template-designer__workspace-buttons" }, _n = { class: "gd-contract-template-designer__toolbar" }, vn = { class: "gd-contract-template-designer__toolbar-group" }, yn = { class: "gd-contract-template-designer__toolbar-group gd-contract-template-designer__toolbar-group--style" }, bn = { class: "gd-contract-template-designer__toolbar-group gd-contract-template-designer__toolbar-group--format" }, xn = {
26
- class: "gd-contract-template-designer__toolbar-group gd-contract-template-designer__toolbar-group--insert",
27
- "data-toolbar-overflow-key": "insert"
28
- }, Sn = { class: "gd-contract-template-designer__popover gd-contract-template-designer__control-insert-popover" }, Cn = { class: "gd-contract-template-designer__text-menu-control-options" }, wn = ["aria-label", "onClick"], Tn = { class: "gd-contract-template-designer__popover gd-contract-template-designer__image-insert-popover" }, En = {
29
- class: "gd-contract-template-designer__image-size-fields",
30
- role: "group",
31
- "aria-label": "图片尺寸"
32
- }, Dn = {
33
- class: "gd-contract-template-designer__toolbar-group gd-contract-template-designer__toolbar-group--typography",
34
- "data-toolbar-overflow-key": "typography"
35
- }, On = ["value", "disabled"], kn = {
36
- class: "gd-contract-template-designer__toolbar-group gd-contract-template-designer__toolbar-group--cleanup",
37
- "data-toolbar-overflow-key": "cleanup"
38
- }, An = {
39
- class: "gd-contract-template-designer__toolbar-group gd-contract-template-designer__toolbar-group--table",
40
- "data-toolbar-overflow-key": "table"
41
- }, jn = { class: "gd-contract-template-designer__popover" }, Mn = { class: "gd-contract-template-designer__switch-row" }, Nn = { class: "gd-contract-template-designer__popover" }, Pn = { class: "gd-contract-template-designer__table-actions" }, Fn = {
42
- class: "gd-contract-template-designer__toolbar-more-panel",
43
- role: "menu",
44
- "aria-label": "更多编辑工具"
45
- }, In = { class: "gd-contract-template-designer__toolbar-more-section" }, Ln = { class: "gd-contract-template-designer__toolbar-more-section" }, Rn = { class: "gd-contract-template-designer__toolbar-more-section" }, zn = { class: "gd-contract-template-designer__toolbar-more-section" }, Bn = {
36
+ var Lt = {
46
37
  key: 0,
47
38
  class: "gd-contract-template-designer__validation"
48
- }, Vn = {
39
+ }, Rt = {
49
40
  key: 0,
50
41
  class: "gd-contract-template-designer__validation-list"
51
- }, Hn = ["onClick"], Un = {
52
- class: "gd-contract-template-designer__image-size-fields",
53
- role: "group",
54
- "aria-label": "图片尺寸"
55
- }, Wn = { class: "gd-contract-template-designer__popover-actions" }, Gn = {
56
- class: "gd-contract-template-designer__text-menu-row",
57
- role: "group",
58
- "aria-label": "编辑历史与剪贴板"
59
- }, Kn = {
60
- key: 0,
61
- class: "gd-contract-template-designer__text-menu-quick-insert",
62
- role: "group",
63
- "aria-label": "光标处插入"
64
- }, qn = {
65
- class: "gd-contract-template-designer__text-menu-row gd-contract-template-designer__text-menu-row--controls",
66
- role: "group",
67
- "aria-label": "文字样式"
68
- }, Jn = ["value"], Yn = ["aria-label"], Xn = { class: "gd-contract-template-designer__text-menu-control-head" }, Zn = { class: "gd-contract-template-designer__text-menu-control-options" }, Qn = ["aria-label", "onClick"], $n = ["disabled"], er = {
69
- class: "gd-contract-template-designer__text-menu-bind-list",
70
- role: "listbox",
71
- "aria-label": "已有正文控件"
72
- }, tr = ["onClick"], nr = { class: "gd-contract-template-designer__text-menu-bind-item-label" }, rr = { class: "gd-contract-template-designer__text-menu-bind-item-meta" }, ir = {
73
- key: 0,
74
- class: "gd-contract-template-designer__text-menu-bind-empty"
75
- }, ar = {
76
- class: "gd-contract-template-designer__text-menu-row",
77
- role: "group",
78
- "aria-label": "常用格式与列表"
79
- }, or = {
80
- class: "gd-contract-template-designer__text-menu-row gd-contract-template-designer__text-menu-row--cleanup",
81
- role: "group",
82
- "aria-label": "清理格式"
83
- }, sr = {
42
+ }, zt = ["onClick"], Bt = {
84
43
  class: "gd-contract-template-designer__sr-status",
85
44
  "aria-live": "polite"
86
- }, cr = {
87
- key: 0,
88
- class: "gd-contract-template-designer__preview-layout"
89
- }, lr = {
90
- class: "gd-contract-template-designer__preview-file-nav",
91
- "aria-label": "合同文件预览切换"
92
- }, ur = ["aria-current", "onClick"], dr = {
93
- key: 0,
94
- class: "gd-contract-template-designer__preview-file"
95
- }, fr = { class: "gd-contract-template-designer__preview-file-title" }, pr = { class: "gd-contract-template-designer__submit-data" }, mr = .5, hr = 1.5, gr = .1, _r = 128, vr = 108, yr = 48, br = 24, xr = 10, Sr = 48, Cr = 304, wr = 300, Tr = 288, Er = 196, O = 12, Dr = 43, Or = 6, kr = 4, Ar = /* @__PURE__ */ v({
45
+ }, Vt = .5, Ht = 1.5, Ut = .1, Wt = 120, Gt = 128, Kt = 108, qt = 48, Jt = 24, Yt = 10, Xt = 48, Zt = /* @__PURE__ */ p({
96
46
  name: "ProContractTemplateDesigner",
97
47
  __name: "ProContractTemplateDesigner",
98
48
  props: {
@@ -108,12 +58,12 @@ var dn = { class: "gd-contract-template-designer__workspace-header" }, fn = { cl
108
58
  default: !1
109
59
  },
110
60
  height: { default: 760 },
111
- pageSize: { default: () => pe },
61
+ pageSize: { default: () => fe },
112
62
  pageSizeOptions: {},
113
63
  maxPages: { default: 20 },
114
64
  imageCompression: { type: [Object, Boolean] },
115
65
  imageUpload: {},
116
- variableTypes: { default: () => fe },
66
+ variableTypes: { default: () => s },
117
67
  defaultVariableStyle: { default: () => de },
118
68
  fontFamilies: { default: void 0 },
119
69
  fontFamilyMode: { default: "append" },
@@ -133,8 +83,8 @@ var dn = { class: "gd-contract-template-designer__workspace-header" }, fn = { cl
133
83
  type: Boolean,
134
84
  default: !0
135
85
  },
136
- draftCacheKey: { default: He },
137
- draftCacheInterval: { default: Ve },
86
+ draftCacheKey: { default: Ke },
87
+ draftCacheInterval: { default: Ge },
138
88
  draftCacheMaxBytes: { default: l },
139
89
  showDraftCacheStatus: {
140
90
  type: Boolean,
@@ -161,62 +111,62 @@ var dn = { class: "gd-contract-template-designer__workspace-header" }, fn = { cl
161
111
  "signing-placement-remove",
162
112
  "signing-placement-select"
163
113
  ],
164
- setup(fe, { expose: Ve, emit: He }) {
165
- let l = fe, v = He, Ar = d(() => ({ height: typeof l.height == "number" ? `${l.height}px` : l.height })), jr = S(), Mr = S(), Nr = S(), Pr = S(), Fr = S(), Ir = S(), Lr = S(), Rr = S(), zr = S(), Br = S();
166
- function Vr(e) {
114
+ setup(s, { expose: Ge, emit: Ke }) {
115
+ let l = s, p = Ke, Zt = f(() => ({ height: typeof l.height == "number" ? `${l.height}px` : l.height })), Qt = g(), $t = g(), en = g(), tn = g(), nn = g(), rn = `gd-contract-template-page-decorations-studio-${jt()}`, an = g();
116
+ function on(e) {
167
117
  if (!e || !Array.isArray(e.pages) || !Array.isArray(e.signingPlacements)) return [];
168
118
  try {
169
- return ke(e).filter((e) => e.type === "signing-placement");
119
+ return Ae(e).filter((e) => e.type === "signing-placement");
170
120
  } catch {
171
121
  return [];
172
122
  }
173
123
  }
174
- function Hr(e, t) {
175
- return Object.fromEntries(e.map((e, n) => [e.id, Vr(t?.[n]?.template ?? e.template)]));
176
- }
177
- function Ur(e, t) {
178
- let n = /* @__PURE__ */ new Map();
179
- return {
180
- files: e.map((e) => {
181
- let r = ge(e.template, t);
182
- return r.resizedSigningPlacementIds.length && n.set(e.id, r.resizedSigningPlacementIds), {
183
- ...e,
184
- template: r.value
185
- };
186
- }),
187
- resizedSigningPlacementIds: n
188
- };
124
+ function sn(e, t) {
125
+ return Object.fromEntries(e.map((e, n) => [e.id, on(t?.[n]?.template ?? e.template)]));
189
126
  }
190
- let Wr = "", Gr = "", Kr = S(!1), k = d(() => Kr.value || Array.isArray(l.files)), qr = nt(l.files, l.modelValue, l.pageSize), Jr = Ur(qr, l.pageSizeOptions), Yr = k.value ? Jr.files : qr, Xr = ot(Yr, l.activeFileId), A = S(Yr), j = S(Xr), Zr = Yr.find((e) => e.id === Xr) ?? Yr[0], M = S(Hr(Yr, Array.isArray(l.files) ? l.files : l.modelValue ? [{ template: l.modelValue }] : void 0)), N = S(M.value[Xr] ?? Vr(Zr?.template)), Qr = Ee(Zr?.template ?? l.modelValue, l.pageSize), $r = ge(Qr, l.pageSizeOptions), P = S($r.value);
191
- if (k.value) {
192
- if (A.value = at(A.value, j.value, $r.value), JSON.stringify(A.value) !== JSON.stringify(qr)) {
193
- let e = u(A.value);
194
- Wr = JSON.stringify(e), v("update:files", e), v("files-change", u(e));
127
+ let cn = "", ln = "", un = g(!1), y = f(() => un.value || Array.isArray(l.files)), dn = tt(l.files, l.modelValue, l.pageSize), fn = Ze(dn, l.pageSizeOptions), pn = y.value ? fn.files : dn, mn = at(pn, l.activeFileId), b = g(pn), x = g(mn), hn = pn.find((e) => e.id === mn) ?? pn[0], S = g(sn(pn, Array.isArray(l.files) ? l.files : l.modelValue ? [{ template: l.modelValue }] : void 0)), C = g(S.value[mn] ?? on(hn?.template)), gn = Ee(hn?.template ?? l.modelValue, l.pageSize), _n = ge(gn, l.pageSizeOptions), w = g(_n.value);
128
+ if (y.value) {
129
+ if (b.value = it(b.value, x.value, _n.value), d(b.value) !== d(dn)) {
130
+ let e = u(b.value);
131
+ cn = d(e), p("update:files", e), p("files-change", u(e));
195
132
  }
196
- } else l.modelValue && JSON.stringify($r.value) !== JSON.stringify(Qr) && (Gr = JSON.stringify($r.value), v("update:modelValue", c($r.value)), v("change", c($r.value)), Xa($r.resizedSigningPlacementIds, $r.value));
197
- let F = S(""), I = S(""), L = S(P.value.pages[0]?.id ?? ""), ei = S(!1), ti = S([]), R = /* @__PURE__ */ new Map(), ni = S(!1), ri = S(""), ii = S(!1), ai = S(), oi = S(), si = S(""), ci = S(!1), li = S(""), ui = S(1), di = S(!1), fi = S(!1), pi = S(!1), mi = S(!1), hi = S({}), gi = S(), _i = S(""), vi = S(!1), yi = S(!1), bi = S(!1), xi = S(!1), Si = S(""), Ci = S(), wi = S(), Ti = S(""), Ei = S(!1), z = S(), Di = S(), Oi = S(!1), ki = S(""), B = S(), Ai = S(), V = S(), ji = S(), Mi = S(), Ni = S(), Pi = S(""), Fi = S(We("idle", "暂无本地草稿")), Ii = S({
133
+ } else l.modelValue && d(_n.value) !== d(gn) && (ln = d(_n.value), p("update:modelValue", c(_n.value)), p("change", c(_n.value)), wi(_n.resizedSigningPlacementIds, _n.value));
134
+ let T = g(""), E = g(""), D = g(w.value.pages[0]?.id ?? ""), O = g(!1), k = g([]), A = /* @__PURE__ */ new Map(), vn = g(!1), yn = g(""), bn = g(!1), j = g(), xn = g(), Sn = g(""), Cn = g(!1), wn = g(""), M = g(1), Tn = g(!1), En = g(!1), Dn = g(!1), N = g(!1), On = g("header"), kn = g(!1), An = g({}), jn = g(""), P = g(!1), F = g(!1), Mn = g(!1), Nn = g(!1), Pn = g(""), Fn = g(), In = g(), Ln = g(""), Rn = g(!1), I = g(), zn = g(), Bn = g(!1), Vn = g(""), L = g(), Hn = g(), R = g(), Un = g(), Wn = g(), Gn = g(), z = g(""), B = g(qe("idle", "暂无本地草稿")), Kn = g({
198
135
  rows: 3,
199
136
  cols: 3,
200
137
  withHeaderRow: !0
201
- }), Li, Ri, zi = "", H = d(() => l.readonly || l.disabled), Bi = d(() => !!l.enableDraftCache && !H.value), Vi = d(() => A.value.find((e) => e.id === j.value) ?? A.value[0]), Hi = d(() => l.draftCacheKey), Ui = d(() => P.value.variables.find((e) => e.key === F.value)), U = d(() => P.value.signingPlacements ?? []), Wi = d(() => ai.value ? me(ai.value) : []), Gi = d(() => (oi.value ?? []).map((e) => ({
138
+ }), qn = /* @__PURE__ */ new WeakSet(), Jn = [".gd-contract-template-designer__page-decorations-select-popup", ".gd-contract-template-designer__page-decorations-dropdown-popup"].join(","), Yn, Xn = !1, Zn = !1, Qn, V = f(() => l.readonly || l.disabled), $n = f(() => !!l.enableDraftCache && !V.value), er = f(() => b.value.find((e) => e.id === x.value) ?? b.value[0]), tr = f(() => l.draftCacheKey), H = f(() => w.value.variables.find((e) => e.key === T.value)), U = f(() => w.value.signingPlacements ?? []), nr = f(() => j.value ? pe(j.value) : []), rr = f(() => (xn.value ?? []).map((e) => ({
202
139
  file: e,
203
- pages: me(e.template)
204
- }))), Ki = d(() => Gi.value.find((e) => e.file.id === si.value) ?? Gi.value[0]), qi = d(() => U.value.find((e) => e.id === I.value)), Ji = d(() => U.value.map((e) => {
205
- let t = P.value.pages.findIndex((t) => t.id === e.pageId);
140
+ pages: pe(e.template)
141
+ }))), ir = f(() => rr.value.find((e) => e.file.id === Sn.value) ?? rr.value[0]), ar = f(() => U.value.find((e) => e.id === E.value)), or = f(() => U.value.map((e) => {
142
+ let t = w.value.pages.findIndex((t) => t.id === e.pageId);
206
143
  return {
207
144
  placement: e,
208
- label: r[e.type],
209
- detail: `${r[e.type]} · 第 ${Math.max(0, t) + 1} 页`
145
+ label: n[e.type],
146
+ detail: `${n[e.type]} · 第 ${Math.max(0, t) + 1} 页`
210
147
  };
211
- })), Yi = d(() => {
212
- let e = qi.value?.pageId;
213
- return X(P.value.pages.find((t) => t.id === e));
214
- }), W = d(() => P.value.pages.find((e) => e.id === L.value) ?? P.value.pages[0]), Xi = d(() => De(W.value?.pageSize, P.value.pageSize)), Zi = d(() => ei.value && ti.value.length === 0), Qi = d(() => ei.value ? Zi.value ? "校验通过,正文变量与变量配置一致" : `发现 ${ti.value.length} 个校验问题` : ""), $i = d(() => {
148
+ })), sr = f(() => {
149
+ let e = ar.value?.pageId;
150
+ return Z(w.value.pages.find((t) => t.id === e));
151
+ }), W = f(() => w.value.pages.find((e) => e.id === D.value) ?? w.value.pages[0]), cr = f(() => De(W.value?.pageSize, w.value.pageSize)), lr = f(() => O.value && k.value.length === 0), ur = f(() => O.value ? lr.value ? "校验通过,正文变量与变量配置一致" : `发现 ${k.value.length} 个校验问题` : ""), dr = f(() => {
215
152
  let e = W.value?.title || "合同正文";
216
- return `${k.value && Vi.value ? `${Vi.value.name} · ` : ""}${e} · ${Xi.value.label} · 共 ${P.value.pages.length} 页`;
217
- }), ea = d(() => {
218
- switch (Fi.value.type) {
219
- case "saved": return `草稿已缓存 ${Ge(Fi.value.savedAt)}`;
153
+ return `${y.value && er.value ? `${er.value.name} · ` : ""}${e} · ${cr.value.label} · 共 ${w.value.pages.length} 页`;
154
+ }), fr = f(() => ({
155
+ none: "无装饰",
156
+ "page-number": "标准页码",
157
+ "internal-review": "内部审阅",
158
+ draft: "草稿",
159
+ custom: "自定义"
160
+ })[ce(w.value.pageDecorations)]), pr = f(() => {
161
+ let e = se(w.value.pageDecorations);
162
+ return {
163
+ header: e.header.enabled,
164
+ footer: e.footer.enabled,
165
+ watermark: e.watermark.enabled
166
+ };
167
+ }), mr = f(() => Object.values(pr.value).filter(Boolean).length), hr = f(() => {
168
+ switch (B.value.type) {
169
+ case "saved": return `草稿已缓存 ${Je(B.value.savedAt)}`;
220
170
  case "restored": return "已恢复本地草稿";
221
171
  case "too-large": return "草稿过大,未缓存";
222
172
  case "unavailable":
@@ -225,52 +175,23 @@ var dn = { class: "gd-contract-template-designer__workspace-header" }, fn = { cl
225
175
  case "cleared": return "草稿缓存已清理";
226
176
  default: return "";
227
177
  }
228
- }), ta = d(() => ({
229
- "is-success": Fi.value.type === "saved" || Fi.value.type === "restored",
230
- "is-warning": Fi.value.type === "too-large",
231
- "is-error": Fi.value.type === "unavailable" || Fi.value.type === "read-failed" || Fi.value.type === "write-failed"
232
- })), na = d(() => `${Math.round(ui.value * 100)}%`), ra = d(() => ue(l.fontFamilies, l.fontFamilyMode)), ia = d(() => ra.value.map((e) => ({
178
+ }), gr = f(() => ({
179
+ "is-success": B.value.type === "saved" || B.value.type === "restored",
180
+ "is-warning": B.value.type === "too-large",
181
+ "is-error": B.value.type === "unavailable" || B.value.type === "read-failed" || B.value.type === "write-failed"
182
+ })), _r = f(() => `${Math.round(M.value * 100)}%`), vr = f(() => ae(l.fontFamilies, l.fontFamilyMode)), yr = f(() => vr.value.map((e) => ({
233
183
  label: e.label,
234
184
  value: e.value
235
- }))), aa = d(() => oe.map((e) => ({
185
+ }))), br = ie, xr = [...te.map((e) => ({
236
186
  label: e.label,
237
- value: e.key
238
- }))), oa = le, sa = [
239
- {
240
- label: "正文",
241
- value: "paragraph"
242
- },
243
- {
244
- label: "H1",
245
- value: 1
246
- },
247
- {
248
- label: "H2",
249
- value: 2
250
- },
251
- {
252
- label: "H3",
253
- value: 3
254
- },
255
- {
256
- label: "H4",
257
- value: 4
258
- },
259
- {
260
- label: "H5",
261
- value: 5
262
- },
263
- {
264
- label: "H6",
265
- value: 6
266
- }
267
- ], ca = [{
187
+ value: e.format
188
+ }))], Sr = [{
268
189
  label: "实线",
269
190
  value: "solid"
270
191
  }, {
271
192
  label: "虚线",
272
193
  value: "dashed"
273
- }], la = [
194
+ }], Cr = [
274
195
  {
275
196
  label: "完整显示",
276
197
  value: "contain"
@@ -283,89 +204,156 @@ var dn = { class: "gd-contract-template-designer__workspace-header" }, fn = { cl
283
204
  label: "拉伸填充",
284
205
  value: "fill"
285
206
  }
286
- ], ua = d(() => Te(l.pageSizeOptions)), da = d(() => ua.value.map((e) => ({
207
+ ], wr = f(() => Te(l.pageSizeOptions)), Tr = f(() => wr.value.map((e) => ({
287
208
  label: `${e.label} · ${e.width} × ${e.height}`,
288
209
  value: Ce(e)
289
- }))), fa = d(() => Ce(Xi.value)), pa = d(() => re({ showSigningPlacementTools: l.showSigningPlacementTools })), ma = d(() => l.variableTypes.filter((t) => e(t?.type))), ha = d(() => ma.value.map((e) => ({
210
+ }))), Er = f(() => Ce(cr.value)), Dr = f(() => o({ showSigningPlacementTools: l.showSigningPlacementTools })), Or = f(() => l.variableTypes.filter((t) => e(t?.type))), kr = f(() => Or.value.map((e) => ({
290
211
  ...e,
291
- icon: st(e.type)
292
- }))), ga = d(() => we(l.maxPages)), _a = d(() => P.value.pages.length >= ga.value), va = d(() => {
293
- let e = ki.value.trim().toLowerCase(), t = P.value.variables;
212
+ icon: lt(e.type)
213
+ }))), Ar = f(() => we(l.maxPages)), jr = f(() => w.value.pages.length >= Ar.value), Mr = f(() => {
214
+ let e = he(w.value);
215
+ return Array.from(oe(w.value.pageDecorations)).filter((t) => !e.has(t));
216
+ }), { scheduleAutoPaginate: G } = Ye({
217
+ templateValue: w,
218
+ readonlyState: V,
219
+ isAutoPaginating: vn,
220
+ pendingPaginationPageId: yn,
221
+ activePageId: D,
222
+ normalizedMaxPages: Ar,
223
+ pageRefs: A,
224
+ syncPageEditors: K,
225
+ commitBodyChange: xi,
226
+ getPageSize: Z,
227
+ notifyPageLimit: Ai
228
+ }), { insertSigningPlacement: Nr, handleSigningPlacementDrop: Pr, insertSigningPlacementTool: Fr, handleSigningPlacementDragStart: Ir, updateSigningPlacement: Lr, patchSelectedSigningPlacement: Rr, duplicateSigningPlacement: zr, removeSigningPlacement: Br } = ct({
229
+ templateValue: w,
230
+ signingPlacements: U,
231
+ selectedSigningPlacement: ar,
232
+ selectedSigningPlacementId: E,
233
+ selectedPage: W,
234
+ activePageId: D,
235
+ readonly: () => l.readonly,
236
+ disabled: () => l.disabled,
237
+ showSigningPlacementTools: () => !!l.showSigningPlacementTools,
238
+ getPageSize: Z,
239
+ getVisiblePosition: (e, t) => A.get(e)?.getVisibleSigningPlacementPosition(t),
240
+ commitSigningPlacements: Oi,
241
+ selectSigningPlacement: Q,
242
+ emitAdd: (e) => p("signing-placement-add", e),
243
+ emitChange: (e) => p("signing-placement-change", e),
244
+ emitRemove: (e) => p("signing-placement-remove", e)
245
+ }), { saveDraftCache: Vr, loadDraftCache: Hr, clearDraftCache: Ur, restoreDraftCacheIfNeeded: Wr, stopDraftCacheTimer: Gr, restartDraftCacheTimer: Kr, resetDraftFingerprint: qr } = ot({
246
+ draftCacheWritable: $n,
247
+ multipleFilesMode: y,
248
+ filesValue: b,
249
+ activeFileIdValue: x,
250
+ templateValue: w,
251
+ draftCacheKey: tr,
252
+ draftCacheInterval: () => l.draftCacheInterval,
253
+ draftCacheMaxBytes: () => l.draftCacheMaxBytes,
254
+ pageSize: () => l.pageSize,
255
+ pageSizeOptions: () => l.pageSizeOptions,
256
+ syncActiveFileSnapshot: q,
257
+ syncPageEditors: K,
258
+ setActiveFileId: hi,
259
+ emitFilesChange: J,
260
+ commit: Y,
261
+ setSigningPlacementInputErrorsByFile: (e) => {
262
+ S.value = e;
263
+ },
264
+ buildSigningPlacementInputErrorsByFile: sn,
265
+ updateDraftCacheStatus: gi,
266
+ scheduleAutoPaginate: G,
267
+ activePageId: D,
268
+ selectedVariableKey: T
269
+ }), Jr = f(() => {
270
+ let e = Vn.value.trim().toLowerCase(), t = w.value.variables;
294
271
  return e ? t.filter((t) => t.label.toLowerCase().includes(e) || t.key.toLowerCase().includes(e)) : t;
295
- }), ya = d(() => Math.max(yr, Xi.value.width - _r)), ba = d(() => Math.max(br, Xi.value.height - vr)), G = d(() => hi.value[L.value] ?? Oa()), xa = d(() => G.value.currentHeadingLevel ?? "paragraph"), Sa = d(() => G.value.fontFamily || "Noto Serif SC, Source Han Serif SC, Songti SC, STSong, SimSun, serif"), Ca = d(() => G.value.fontSize ?? de.fontSize ?? 14), wa = d(() => G.value.textColor || de.color || "#1f2937"), Ta = d(() => Ui.value?.style?.fontFamily || de.fontFamily || "Noto Serif SC, Source Han Serif SC, Songti SC, STSong, SimSun, serif"), Ea = d(() => {
296
- let e = ce.map((e) => ({
272
+ }), Yr = f(() => Math.max(qt, cr.value.width - Gt)), Xr = f(() => Math.max(Jt, cr.value.height - Kt)), Zr = f(() => An.value[D.value] ?? ai()), Qr = f(() => Zr.value.hasMixedBlockFormats ? void 0 : Zr.value.currentHeadingLevel ?? "paragraph"), $r = f(() => Zr.value.fontFamily || "Noto Serif SC, Source Han Serif SC, Songti SC, STSong, SimSun, serif"), ei = f(() => Zr.value.fontSize ?? de.fontSize ?? 14), ti = f(() => Zr.value.textColor || de.color || "#1f2937"), ni = f(() => H.value?.style?.fontFamily || de.fontFamily || "Noto Serif SC, Source Han Serif SC, Songti SC, STSong, SimSun, serif"), ri = f(() => {
273
+ let e = re.map((e) => ({
297
274
  label: `${e}px`,
298
275
  value: e
299
- })), t = Na(Ca.value), n = Na(_i.value), r = /* @__PURE__ */ new Map();
300
- return n && !ce.includes(n) && r.set(n, {
276
+ })), t = li(ei.value), n = li(jn.value), r = /* @__PURE__ */ new Map();
277
+ return n && !re.includes(n) && r.set(n, {
301
278
  label: `使用 ${n}px`,
302
279
  value: n
303
- }), t && !ce.includes(t) && r.set(t, {
280
+ }), t && !re.includes(t) && r.set(t, {
304
281
  label: n === t ? `使用 ${t}px` : `${t}px`,
305
282
  value: t
306
283
  }), [...Array.from(r.values()), ...e];
307
284
  });
308
- St(() => l.modelValue, (e) => {
309
- if (!e || k.value) return;
310
- let t = Ee(e, l.pageSize), n = ge(t, l.pageSizeOptions), r = n.value, i = JSON.stringify(r) !== JSON.stringify(P.value), a = JSON.stringify(r), o = a === Gr;
311
- o && (Gr = ""), (i || !o) && (N.value = Vr(e), M.value = {
312
- ...M.value,
313
- [j.value]: N.value
314
- }, P.value = r, A.value = at(A.value, j.value, r), L.value = r.pages[0]?.id ?? "", F.value = "", I.value = "", mo(L.value)), JSON.stringify(r) !== JSON.stringify(t) && (Gr = a, v("update:modelValue", c(r)), v("change", c(r)), Xa(n.resizedSigningPlacementIds, r));
315
- }, { deep: !0 }), St(() => l.files, (e) => {
285
+ v(() => l.modelValue, (e) => {
286
+ if (!e || y.value) return;
287
+ let t = Ee(e, l.pageSize), n = ge(t, l.pageSizeOptions), r = n.value, i = d(r) !== d(w.value), a = d(r), o = a === ln;
288
+ o && (ln = ""), (i || !o) && (C.value = on(e), S.value = {
289
+ ...S.value,
290
+ [x.value]: C.value
291
+ }, w.value = r, b.value = it(b.value, x.value, r), D.value = r.pages[0]?.id ?? "", T.value = "", E.value = "", G(D.value)), d(r) !== d(t) && (ln = a, p("update:modelValue", c(r)), p("change", c(r)), wi(n.resizedSigningPlacementIds, r));
292
+ }, { deep: !0 }), v(() => l.files, (e) => {
316
293
  if (!Array.isArray(e)) return;
317
- let t = nt(e, void 0, l.pageSize), n = Ur(t, l.pageSizeOptions).files, r = JSON.stringify(n), i = JSON.stringify(A.value), a = r === Wr;
318
- a || (M.value = Hr(n, e)), a && (Wr = "");
319
- let o = ot(n, l.activeFileId || j.value);
320
- if (r === i ? o !== j.value && Ia(o, !1, !1) : (A.value = n, Ia(o, !1, !1, !0, !1)), r !== JSON.stringify(t)) {
294
+ let t = tt(e, void 0, l.pageSize), n = Ze(t, l.pageSizeOptions).files, r = d(n), i = d(b.value), a = r === cn;
295
+ a || (S.value = sn(n, e)), a && (cn = "");
296
+ let o = at(n, l.activeFileId || x.value);
297
+ if (r === i ? o !== x.value && hi(o, {
298
+ syncCurrent: !1,
299
+ shouldEmit: !1
300
+ }) : (b.value = n, hi(o, {
301
+ syncCurrent: !1,
302
+ shouldEmit: !1,
303
+ forceRefresh: !0,
304
+ persistCurrentErrors: !1
305
+ })), r !== d(t)) {
321
306
  let e = u(n);
322
- Wr = JSON.stringify(e), v("update:files", e), v("files-change", u(e));
307
+ cn = d(e), p("update:files", e), p("files-change", u(e));
323
308
  }
324
- }, { deep: !0 }), St(() => l.activeFileId, (e) => {
325
- !k.value || !e || e === j.value || Ia(e, !0, !1);
309
+ }, { deep: !0 }), v(() => l.activeFileId, (e) => {
310
+ !y.value || !e || e === x.value || hi(e, {
311
+ syncCurrent: !0,
312
+ shouldEmit: !1
313
+ });
326
314
  });
327
- function Da(e, t) {
328
- let n = JSON.stringify(A.value);
329
- K(!1);
330
- let { files: r, resizedSigningPlacementIds: i } = Ur(nt(A.value, void 0, e), t), a = JSON.stringify(r) !== n, o = r.find((e) => e.id === j.value);
331
- o && JSON.stringify(o.template) !== JSON.stringify(P.value) && (P.value = c(o.template), N.value = [...M.value[j.value] ?? []]), a && (ei.value = !1, ti.value = [], Fa(r, ""));
332
- let s = i.get(j.value);
333
- return s?.length && o && Xa(s, o.template), a;
334
- }
335
- St([() => l.pageSize, () => l.pageSizeOptions], ([e, t]) => {
336
- if (k.value) {
337
- Da(e, t), mo(L.value);
315
+ function ii(e, t) {
316
+ let n = d(b.value);
317
+ q(!1);
318
+ let { files: r, resizedSigningPlacementIds: i } = Ze(tt(b.value, void 0, e), t), a = d(r) !== n, o = r.find((e) => e.id === x.value);
319
+ o && d(o.template) !== d(w.value) && (w.value = c(o.template), C.value = [...S.value[x.value] ?? []]), a && (O.value = !1, k.value = [], J(r, ""));
320
+ let ee = i.get(x.value);
321
+ return ee?.length && o && wi(ee, o.template), a;
322
+ }
323
+ v([() => l.pageSize, () => l.pageSizeOptions], ([e, t]) => {
324
+ if (y.value) {
325
+ ii(e, t), G(D.value);
338
326
  return;
339
327
  }
340
- let n = ge(Ee(P.value, e), t);
341
- JSON.stringify(n.value) !== JSON.stringify(P.value) && q(n.value), mo(L.value);
342
- }, { deep: !0 }), St(ga, () => {
343
- mo(P.value.pages[0]?.id);
344
- }), St(H, (e) => {
345
- e && ($(), vi.value = !1, yi.value = !1);
346
- }), St(U, (e) => {
347
- I.value && !e.some((e) => e.id === I.value) && (I.value = "", v("signing-placement-select", void 0));
348
- }, { deep: !0 }), St(() => [
328
+ let n = ge(Ee(w.value, e), t);
329
+ d(n.value) !== d(w.value) && Y(n.value), G(D.value);
330
+ }, { deep: !0 }), v(Ar, () => {
331
+ G(w.value.pages[0]?.id);
332
+ }), v(V, (e) => {
333
+ e && ($(), P.value = !1, F.value = !1);
334
+ }), v(U, (e) => {
335
+ E.value && !e.some((e) => e.id === E.value) && (E.value = "", p("signing-placement-select", void 0));
336
+ }, { deep: !0 }), v(() => [
349
337
  l.enableDraftCache,
350
- Hi.value,
338
+ tr.value,
351
339
  l.draftCacheInterval,
352
- H.value
340
+ V.value
353
341
  ], () => {
354
- zi = "", Wa();
355
- }), St(di, (e) => {
342
+ qr(), Kr();
343
+ }), v(Tn, (e) => {
356
344
  if (!(typeof document > "u")) {
357
345
  if (e) {
358
- Li = document.body.style.overflow, document.body.style.overflow = "hidden";
346
+ Yn = document.body.style.overflow, document.body.style.overflow = "hidden";
359
347
  return;
360
348
  }
361
- document.body.style.overflow = Li ?? "", Li = void 0;
349
+ document.body.style.overflow = Yn ?? "", Yn = void 0;
362
350
  }
363
- }), vt(() => {
364
- Ha(), Wa(), mo(L.value), window.addEventListener("pointerdown", Ec, !0), window.addEventListener("keydown", Oc), window.addEventListener("resize", $), window.addEventListener("scroll", $, !0);
365
- }), _t(() => {
366
- di.value && typeof document < "u" && (document.body.style.overflow = Li ?? ""), window.removeEventListener("pointerdown", Ec, !0), window.removeEventListener("keydown", Oc), window.removeEventListener("resize", $), window.removeEventListener("scroll", $, !0), Ua();
351
+ }), Ot(() => {
352
+ Wr(), Kr(), G(D.value), window.addEventListener("pointerdown", Fo, !0), window.addEventListener("keydown", Ro, !0), window.addEventListener("keydown", zo), window.addEventListener("resize", $), window.addEventListener("scroll", Io, !0);
353
+ }), Dt(() => {
354
+ di(), Xn = !0, Tn.value && typeof document < "u" && (document.body.style.overflow = Yn ?? ""), window.removeEventListener("pointerdown", Fo, !0), window.removeEventListener("keydown", Ro, !0), window.removeEventListener("keydown", zo), window.removeEventListener("resize", $), window.removeEventListener("scroll", Io, !0), Gr();
367
355
  });
368
- function Oa() {
356
+ function ai() {
369
357
  return {
370
358
  isFocused: !1,
371
359
  canUndo: !1,
@@ -377,36 +365,34 @@ var dn = { class: "gd-contract-template-designer__workspace-header" }, fn = { cl
377
365
  isOrderedList: !1,
378
366
  isTableActive: !1,
379
367
  textAlign: "left",
380
- fontFamily: se,
368
+ fontFamily: ne,
381
369
  fontSize: de.fontSize ?? 14,
382
370
  textColor: de.color ?? "#1f2937",
383
- selectionText: ""
371
+ selectionText: "",
372
+ hasMixedBlockFormats: !1
384
373
  };
385
374
  }
386
- function ka(e) {
375
+ function oi(e) {
387
376
  return e === "left" || e === "center" || e === "right";
388
377
  }
389
- function Aa(e) {
378
+ function si(e) {
390
379
  return typeof e == "number" && Number.isInteger(e) && e >= 1 && e <= 6;
391
380
  }
392
- function ja(e) {
393
- return typeof e == "string" && oe.some((t) => t.key === e);
394
- }
395
- function Ma(e, t = Ca.value) {
381
+ function ci(e, t = ei.value) {
396
382
  let n = Number(e);
397
- return Number.isFinite(n) ? Math.min(Sr, Math.max(xr, Math.round(n))) : t;
383
+ return Number.isFinite(n) ? Math.min(Xt, Math.max(Yt, Math.round(n))) : t;
398
384
  }
399
- function Na(e) {
385
+ function li(e) {
400
386
  let t = String(e || "").trim().match(/(\d+(\.\d+)?)/);
401
387
  if (!t) return;
402
388
  let n = Number(t[1]);
403
- if (Number.isFinite(n)) return Math.min(Sr, Math.max(xr, Math.round(n)));
389
+ if (Number.isFinite(n)) return Math.min(Xt, Math.max(Yt, Math.round(n)));
404
390
  }
405
- function Pa(e = P.value) {
391
+ function K(e = w.value) {
406
392
  return {
407
393
  ...e,
408
394
  pages: e.pages.map((e) => {
409
- let t = R.get(e.id);
395
+ let t = A.get(e.id);
410
396
  return {
411
397
  ...e,
412
398
  contentHtml: t?.getHTML() ?? e.contentHtml,
@@ -415,408 +401,241 @@ var dn = { class: "gd-contract-template-designer__workspace-header" }, fn = { cl
415
401
  })
416
402
  };
417
403
  }
418
- function K(e = !1) {
419
- let t = c(Pa());
420
- if (!k.value) return t;
421
- let n = A.value.find((e) => e.id === j.value)?.template, r = JSON.stringify(n) !== JSON.stringify(t), i = at(A.value, j.value, t);
422
- return A.value = i, r && e && Fa(i), t;
404
+ function ui() {
405
+ Zn = !1, Qn &&= (clearTimeout(Qn), void 0);
406
+ }
407
+ function di() {
408
+ let e = Zn;
409
+ ui(), e && mi();
410
+ }
411
+ function fi() {
412
+ Zn = !0, Qn && clearTimeout(Qn), Qn = setTimeout(() => {
413
+ Qn = void 0, !(!Zn || Xn) && (Zn = !1, mi());
414
+ }, Wt);
415
+ }
416
+ function pi(e) {
417
+ let t = w.value.pages, n = t.findIndex((t) => t.id === e.id);
418
+ if (n < 0) return;
419
+ let r = t[n];
420
+ if (r.contentHtml === e.contentHtml && r.contentJson === e.contentJson && r.title === e.title && r.pageSize === e.pageSize) return;
421
+ let i = t.slice();
422
+ i[n] = e, w.value = {
423
+ ...w.value,
424
+ pages: i
425
+ };
426
+ }
427
+ function mi() {
428
+ let e = Oe(K());
429
+ T.value && !e.variables.some((e) => e.key === T.value) && (T.value = ""), Y(e);
423
430
  }
424
- function Fa(e, t = j.value) {
425
- if (!k.value) return;
431
+ function q(e = !1) {
432
+ di();
433
+ let t = c(K());
434
+ if (!y.value) return t;
435
+ let n = b.value.find((e) => e.id === x.value)?.template, r = d(n) !== d(t), i = it(b.value, x.value, t);
436
+ return b.value = i, r && e && J(i), t;
437
+ }
438
+ function J(e, t = x.value) {
439
+ if (!y.value) return;
426
440
  let n = u(e);
427
- A.value = n, Wr = JSON.stringify(n), v("update:files", u(n)), v("files-change", u(n));
441
+ b.value = n, cn = d(n), p("update:files", u(n)), p("files-change", u(n));
428
442
  let r = n.find((e) => e.id === t);
429
- r && v("file-change", u([r])[0]);
430
- }
431
- function Ia(e, t = !0, n = !0, r = !1, i = !0) {
432
- let a = ot(A.value, e), o = a !== j.value;
433
- if (i && k.value && j.value && (M.value = {
434
- ...M.value,
435
- [j.value]: [...N.value]
436
- }), t && K(!0), !o && !r) return;
437
- let s = A.value.find((e) => e.id === a);
438
- s && (j.value = a, P.value = c(s.template), N.value = [...M.value[a] ?? []], F.value = "", I.value = "", L.value = P.value.pages[0]?.id ?? "", hi.value = {}, R.clear(), ri.value = "", ei.value = !1, ti.value = [], ii.value = !1, ai.value = void 0, oi.value = void 0, zi = "", n && o && v("update:activeFileId", a), t && o && Bi.value && Ra(), y(() => {
439
- mo(L.value);
443
+ r && p("file-change", u([r])[0]);
444
+ }
445
+ function hi(e, t = {}) {
446
+ let { syncCurrent: n, shouldEmit: r, forceRefresh: i, persistCurrentErrors: a } = Xe(t), o = at(b.value, e), ee = o !== x.value;
447
+ if (a && y.value && x.value && (S.value = {
448
+ ...S.value,
449
+ [x.value]: [...C.value]
450
+ }), n ? q(!0) : ui(), !ee && !i) return;
451
+ let te = b.value.find((e) => e.id === o);
452
+ te && (x.value = o, w.value = c(te.template), C.value = [...S.value[o] ?? []], T.value = "", E.value = "", D.value = w.value.pages[0]?.id ?? "", An.value = {}, A.clear(), yn.value = "", O.value = !1, k.value = [], bn.value = !1, j.value = void 0, xn.value = void 0, qr(), r && ee && p("update:activeFileId", o), n && ee && $n.value && Vr(), m(() => {
453
+ G(D.value);
440
454
  }));
441
455
  }
442
- function q(e) {
456
+ function Y(e) {
457
+ ui();
443
458
  let t = ge(Ee(e, l.pageSize), l.pageSizeOptions), n = t.value;
444
- return P.value = n, ei.value = !1, ti.value = [], k.value ? Fa(at(A.value, j.value, n)) : (A.value = at(A.value, j.value, n), Gr = JSON.stringify(n), v("update:modelValue", c(n)), v("change", c(n))), Xa(t.resizedSigningPlacementIds, n), n;
459
+ return w.value = n, O.value = !1, k.value = [], y.value ? J(it(b.value, x.value, n)) : (b.value = it(b.value, x.value, n), ln = d(n), p("update:modelValue", c(n)), p("change", c(n))), wi(t.resizedSigningPlacementIds, n), n;
445
460
  }
446
- function La(e, t = e.type !== "unchanged") {
447
- Fi.value = e, t && v("draft-cache-change", { ...e });
461
+ function gi(e, t = e.type !== "unchanged") {
462
+ B.value = e, t && p("draft-cache-change", { ...e });
448
463
  }
449
- function Ra() {
450
- if (!Bi.value) {
451
- let e = We("unavailable", "草稿缓存未启用");
452
- return La(e), e;
453
- }
454
- let e = Ke();
455
- k.value && K(!1);
456
- let t = k.value ? Qe({
457
- storage: e,
458
- key: Hi.value,
459
- value: {
460
- files: u(A.value),
461
- activeFileId: j.value
462
- },
463
- maxBytes: l.draftCacheMaxBytes,
464
- previousValueSerialized: zi
465
- }) : Ze({
466
- storage: e,
467
- key: Hi.value,
468
- value: c(Pa()),
469
- maxBytes: l.draftCacheMaxBytes,
470
- previousValueSerialized: zi
471
- });
472
- return t.valueSerialized && (zi = t.valueSerialized), t.status.type !== "unchanged" && La(t.status), t.status;
464
+ function _i() {
465
+ return { ...B.value };
473
466
  }
474
- function za() {
475
- if (k.value) {
476
- let e = Xe(Ke(), Hi.value);
477
- e.valueSerialized && (zi = e.valueSerialized), e.status.type !== "idle" && La(e.status);
478
- let t = ot(e.value?.files ?? [], e.value?.activeFileId), n = e.value?.files.find((e) => e.id === t)?.template;
479
- return n ? c(n) : void 0;
480
- }
481
- let e = Ye(Ke(), Hi.value);
482
- return e.valueSerialized && (zi = e.valueSerialized), e.status.type !== "idle" && La(e.status), e.value ? c(e.value) : void 0;
483
- }
484
- function Ba() {
485
- let e = Ue(Ke(), Hi.value);
486
- zi = "", La(e);
487
- }
488
- function Va() {
489
- return { ...Fi.value };
490
- }
491
- function Ha() {
492
- if (!Bi.value) return;
493
- if (k.value) {
494
- if (!Je({
495
- files: u(A.value),
496
- activeFileId: j.value
497
- })) return;
498
- let e = Xe(Ke(), Hi.value);
499
- if (e.valueSerialized && (zi = e.valueSerialized), e.value) {
500
- let t = Ur(nt(e.value.files, void 0, l.pageSize), l.pageSizeOptions);
501
- A.value = t.files, M.value = Hr(t.files, e.value.files), Ia(ot(A.value, e.value.activeFileId), !1, !0, !0, !1), Fa(A.value, ""), La(e.status);
502
- return;
503
- }
504
- e.status.type !== "idle" && e.status.type !== "invalid" && La(e.status);
505
- return;
506
- }
507
- if (!qe(P.value)) return;
508
- let e = Ye(Ke(), Hi.value);
509
- if (e.valueSerialized && (zi = e.valueSerialized), e.value) {
510
- L.value = q(e.value).pages[0]?.id ?? "", F.value = "", mo(L.value), La(e.status);
511
- return;
512
- }
513
- e.status.type !== "idle" && e.status.type !== "invalid" && La(e.status);
514
- }
515
- function Ua() {
516
- Ri &&= (clearInterval(Ri), void 0);
467
+ function vi(e, t) {
468
+ t ? A.set(e, t) : A.delete(e);
517
469
  }
518
- function Wa() {
519
- if (Ua(), !Bi.value || typeof window > "u") return;
520
- let e = Math.max(1e3, Math.round(Number(l.draftCacheInterval) || 5e3));
521
- Ri = window.setInterval(() => {
522
- Ra();
523
- }, e);
470
+ function X(e, t = W.value?.id ?? D.value) {
471
+ V.value || A.get(t)?.runCommand(e);
524
472
  }
525
- function Ga(e, t) {
526
- t ? R.set(e, t) : R.delete(e);
527
- }
528
- function J(e, t = W.value?.id ?? L.value) {
529
- H.value || R.get(t)?.runCommand(e);
530
- }
531
- function Y(e) {
532
- J(e), $();
473
+ function yi(e) {
474
+ X(e), $();
533
475
  }
534
- function Ka(e) {
535
- let t = z.value?.pageId;
536
- t && (R.get(t)?.focus(), Pi.value = typeof document < "u" && document.execCommand(e) ? `${e === "copy" ? "已复制" : e === "cut" ? "已剪切" : "已粘贴"}` : "浏览器未授权剪贴板操作,请使用系统快捷键。", $());
476
+ function bi(e) {
477
+ let t = I.value?.pageId;
478
+ t && (A.get(t)?.focus(), z.value = typeof document < "u" && document.execCommand(e) ? `${e === "copy" ? "已复制" : e === "cut" ? "已剪切" : "已粘贴"}` : "浏览器未授权剪贴板操作,请使用系统快捷键。", $());
537
479
  }
538
- function qa(e) {
539
- let t = q(Oe(e));
540
- return F.value && !t.variables.some((e) => e.key === F.value) && (F.value = ""), t;
480
+ function xi(e) {
481
+ let t = Y(Oe(e));
482
+ return T.value && !t.variables.some((e) => e.key === T.value) && (T.value = ""), t;
541
483
  }
542
- function Ja(e) {
543
- qa({
544
- ...P.value,
545
- pages: P.value.pages.map((t) => t.id === e.id ? e : t)
546
- }), mo(e.id);
484
+ function Si(e) {
485
+ pi(e), fi(), G(e.id);
547
486
  }
548
- function X(e) {
549
- return De(e?.pageSize, P.value.pageSize);
487
+ function Z(e) {
488
+ return De(e?.pageSize, w.value.pageSize);
550
489
  }
551
- function Ya(e) {
490
+ function Ci(e) {
552
491
  return U.value.filter((t) => t.pageId === e);
553
492
  }
554
- function Z(e) {
555
- return {
556
- ...e,
557
- ...e.sealTypes ? { sealTypes: [...e.sealTypes] } : {}
558
- };
559
- }
560
- function Xa(e, t = P.value) {
493
+ function wi(e, t = w.value) {
561
494
  let n = new Set(e);
562
- n.size && (Qa(n), (t.signingPlacements ?? []).filter((e) => n.has(e.id)).forEach((e) => v("signing-placement-change", Z(e))));
495
+ n.size && (Ei(n), (t.signingPlacements ?? []).filter((e) => n.has(e.id)).forEach((e) => p("signing-placement-change", st(e))));
563
496
  }
564
497
  function Q(e) {
565
498
  let t = e ? U.value.find((t) => t.id === e) : void 0;
566
- I.value = t?.id ?? "", t && (F.value = "", L.value = t.pageId), v("signing-placement-select", t ? Z(t) : void 0);
499
+ E.value = t?.id ?? "", t && (T.value = "", D.value = t.pageId), p("signing-placement-select", t ? st(t) : void 0);
567
500
  }
568
- function Za(e) {
501
+ function Ti(e) {
569
502
  Q(e.id);
570
503
  }
571
- function Qa(e) {
504
+ function Ei(e) {
572
505
  let t = new Set(e);
573
506
  if (!t.size) return;
574
- let n = N.value.filter((e) => e.type !== "signing-placement" || !t.has(e.id));
575
- N.value = n, M.value = {
576
- ...M.value,
577
- [j.value]: n
507
+ let n = C.value.filter((e) => e.type !== "signing-placement" || !t.has(e.id));
508
+ C.value = n, S.value = {
509
+ ...S.value,
510
+ [x.value]: n
578
511
  };
579
512
  }
580
- function $a(e) {
581
- let t = N.value.filter((t) => t.type !== "signing-placement" || t.pageId !== e);
582
- N.value = t, M.value = {
583
- ...M.value,
584
- [j.value]: t
513
+ function Di(e) {
514
+ let t = C.value.filter((t) => t.type !== "signing-placement" || t.pageId !== e);
515
+ C.value = t, S.value = {
516
+ ...S.value,
517
+ [x.value]: t
585
518
  };
586
519
  }
587
- function eo(e, t = []) {
588
- return Qa(t), q({
589
- ...P.value,
520
+ function Oi(e, t = []) {
521
+ return Ei(t), Y({
522
+ ...w.value,
590
523
  signingPlacements: e
591
524
  });
592
525
  }
593
- function to(e, t = W.value?.id ?? P.value.pages[0]?.id, n) {
594
- if (!s(l.readonly, l.disabled) || !t) return;
595
- let r = P.value.pages.find((e) => e.id === t);
596
- if (!r) return;
597
- let i = te(e, t, X(r), { ...n ?? R.get(t)?.getVisibleSigningPlacementPosition(e) });
598
- return eo([...U.value, i]), L.value = t, Q(i.id), v("signing-placement-add", Z(i)), i;
599
- }
600
- function no(e, t, n, r) {
601
- if (!l.showSigningPlacementTools) return;
602
- let i = ne(t.type);
603
- to(t.type, e, {
604
- x: n - i.width / 2,
605
- y: r - i.height / 2
606
- });
607
- }
608
- function ro(e) {
609
- return to(e.type);
610
- }
611
- function io(e, t) {
612
- if (!s(l.readonly, l.disabled)) {
613
- e.preventDefault();
614
- return;
615
- }
616
- e.dataTransfer?.setData(n, ae(t)), e.dataTransfer && (e.dataTransfer.effectAllowed = "copy");
617
- }
618
- function ao(e) {
619
- if (!s(l.readonly, l.disabled)) return;
620
- let t = P.value.pages.find((t) => t.id === e.pageId);
621
- if (!t) return;
622
- let n = ee({
623
- ...e,
624
- ...e.type === "seal" ? {} : { sealTypes: void 0 }
625
- }, X(t));
626
- eo(U.value.map((e) => e.id === n.id ? n : e), [n.id]), I.value = n.id, v("signing-placement-change", Z(n));
627
- }
628
- function oo(e) {
629
- let t = qi.value;
526
+ function ki(e) {
527
+ if (V.value || !W.value) return;
528
+ let t = wr.value.find((t) => Ce(t) === e);
630
529
  if (!t) return;
631
- let n = P.value.pages.find((e) => e.id === t.pageId);
632
- n && ao(i(t, e, X(n)));
633
- }
634
- function so(e = qi.value) {
635
- if (!s(l.readonly, l.disabled) || !e) return;
636
- let t = P.value.pages.find((t) => t.id === e.pageId);
637
- if (!t) return;
638
- let n = te(e.type, e.pageId, X(t), {
639
- ...Z(e),
640
- id: void 0,
641
- x: e.x + 16,
642
- y: e.y + 16
643
- });
644
- eo([...U.value, n]), Q(n.id), v("signing-placement-add", Z(n));
645
- }
646
- function co(e = qi.value) {
647
- !s(l.readonly, l.disabled) || !e || (eo(U.value.filter((t) => t.id !== e.id), [e.id]), I.value === e.id && Q(), v("signing-placement-remove", Z(e)));
648
- }
649
- function lo(e) {
650
- if (H.value || !W.value) return;
651
- let t = ua.value.find((t) => Ce(t) === e);
652
- if (!t) return;
653
- let n = W.value.id, r = X(W.value), i = De(t, P.value.pageSize), a = U.value.map((e) => e.pageId === n ? ie(e, r, i) : e);
654
- Qa(a.filter((e) => e.pageId === n).map((e) => e.id)), q({
655
- ...P.value,
656
- pages: P.value.pages.map((e) => e.id === n ? {
530
+ let n = W.value.id, r = Z(W.value), i = De(t, w.value.pageSize), a = U.value.map((e) => e.pageId === n ? ee(e, r, i) : e);
531
+ Ei(a.filter((e) => e.pageId === n).map((e) => e.id)), Y({
532
+ ...w.value,
533
+ pages: w.value.pages.map((e) => e.id === n ? {
657
534
  ...e,
658
535
  pageSize: i
659
536
  } : e),
660
537
  signingPlacements: a
661
- }), a.filter((e) => e.pageId === n).forEach((e) => v("signing-placement-change", Z(e))), mo(n);
662
- }
663
- function uo(e) {
664
- return {
665
- type: "doc",
666
- content: e.length ? e : [{ type: "paragraph" }]
667
- };
668
- }
669
- function fo(e) {
670
- return e.replace(/<p>\s*(<br>)?\s*<\/p>/gi, "").trim().length === 0;
538
+ }), a.filter((e) => e.pageId === n).forEach((e) => p("signing-placement-change", st(e))), G(n);
671
539
  }
672
- function po(e, t, n) {
673
- let r = e.contentJson?.content, i = [...t, ...r?.length ? r : []], a = fo(e.contentHtml || "") ? "" : e.contentHtml;
674
- return {
675
- ...e,
676
- contentHtml: `${n}${a}`,
677
- contentJson: uo(i)
678
- };
679
- }
680
- function mo(e = L.value) {
681
- if (H.value) return;
682
- let t = P.value.pages.findIndex((e) => e.id === ri.value), n = P.value.pages.findIndex((t) => t.id === e);
683
- (!ri.value || t < 0 || n >= 0 && n < t) && (ri.value = e), !ni.value && y(() => go());
684
- }
685
- function ho(e) {
686
- let t = ga.value;
687
- Pi.value = `合同最多支持 ${t} 页`, v("page-limit", t, e);
688
- }
689
- async function go() {
690
- if (!ni.value) {
691
- ni.value = !0;
692
- try {
693
- let e = ri.value;
694
- ri.value = "";
695
- let t = 0, n = Math.max(40, ga.value + 1);
696
- for (; t < n;) {
697
- await y();
698
- let n = Pa().pages, r = Math.max(0, n.findIndex((t) => t.id === e)), i = !1;
699
- for (let t = r; t < n.length; t += 1) {
700
- let r = n[t];
701
- if (t === n.length - 1 && n.length >= ga.value && R.get(r.id)?.hasOverflowContent()) {
702
- ho("auto-pagination");
703
- break;
704
- }
705
- let a = R.get(r.id)?.splitOverflowContent();
706
- if (!a) continue;
707
- let o = Pa().pages, s = o.findIndex((e) => e.id === r.id);
708
- if (s < 0) break;
709
- o[s] = a.page;
710
- let ee = o[s + 1];
711
- ee ? o[s + 1] = R.get(ee.id)?.prependContent(a.overflowContent) ?? po(ee, a.overflowContent, a.overflowHtml) : o.push(_e(o.length + 1, X(a.page), a.overflowHtml, uo(a.overflowContent))), qa({
712
- ...P.value,
713
- pages: o
714
- }), e = o[s + 1]?.id ?? a.page.id, i = !0;
715
- break;
716
- }
717
- if (!i) break;
718
- t += 1;
719
- }
720
- } finally {
721
- ni.value = !1, ri.value && y(() => go());
722
- }
723
- }
540
+ function Ai(e) {
541
+ let t = Ar.value;
542
+ z.value = `合同最多支持 ${t} 页`, p("page-limit", t, e);
724
543
  }
725
- function _o() {
726
- if (H.value) return;
727
- if (_a.value) {
728
- ho("add");
544
+ function ji() {
545
+ if (V.value) return;
546
+ if (jr.value) {
547
+ Ai("add");
729
548
  return;
730
549
  }
731
- let e = ye(P.value.pages.length + 1, Xi.value);
732
- q({
733
- ...P.value,
734
- pages: [...P.value.pages, e]
735
- }), L.value = e.id;
736
- }
737
- function vo(e) {
738
- if (H.value) return;
739
- if (_a.value) {
740
- ho("duplicate");
550
+ let e = ye(w.value.pages.length + 1, cr.value);
551
+ Y({
552
+ ...w.value,
553
+ pages: [...w.value.pages, e]
554
+ }), D.value = e.id;
555
+ }
556
+ function Mi(e) {
557
+ if (V.value) return;
558
+ if (jr.value) {
559
+ Ai("duplicate");
741
560
  return;
742
561
  }
743
- let t = P.value.pages.findIndex((t) => t.id === e.id);
562
+ let t = w.value.pages.findIndex((t) => t.id === e.id);
744
563
  if (t < 0) return;
745
564
  let n = c({
746
565
  pages: [e],
747
566
  variables: [],
748
- pageSize: P.value.pageSize,
567
+ pageSize: w.value.pageSize,
749
568
  signingPlacements: []
750
- }).pages[0], r = _e(t + 2, X(e), n.contentHtml, n.contentJson);
569
+ }).pages[0], r = _e(t + 2, Z(e), n.contentHtml, n.contentJson);
751
570
  r.title = `${e.title || `第 ${t + 1} 页`}副本`;
752
- let i = [...P.value.pages];
571
+ let i = [...w.value.pages];
753
572
  i.splice(t + 1, 0, r);
754
- let a = Ya(e.id).map((e) => te(e.type, r.id, X(r), {
755
- ...Z(e),
573
+ let o = Ci(e.id).map((e) => a(e.type, r.id, Z(r), {
574
+ ...st(e),
756
575
  id: void 0,
757
576
  pageId: r.id
758
577
  }));
759
- q({
760
- ...P.value,
578
+ Y({
579
+ ...w.value,
761
580
  pages: i,
762
- signingPlacements: [...U.value, ...a]
763
- }), L.value = r.id, a.forEach((e) => v("signing-placement-add", Z(e))), a[0] && Q(a[0].id);
581
+ signingPlacements: [...U.value, ...o]
582
+ }), D.value = r.id, o.forEach((e) => p("signing-placement-add", st(e))), o[0] && Q(o[0].id);
764
583
  }
765
- function yo(e) {
766
- if (H.value || P.value.pages.length <= 1) return;
767
- let t = P.value.pages.findIndex((t) => t.id === e.id);
584
+ function Ni(e) {
585
+ if (V.value || w.value.pages.length <= 1) return;
586
+ let t = w.value.pages.findIndex((t) => t.id === e.id);
768
587
  if (t < 0) return;
769
- let n = Ya(e.id);
770
- $a(e.id);
771
- let r = P.value.pages.filter((t) => t.id !== e.id), i = qa({
772
- ...P.value,
588
+ let n = Ci(e.id);
589
+ Di(e.id);
590
+ let r = w.value.pages.filter((t) => t.id !== e.id), i = xi({
591
+ ...w.value,
773
592
  pages: r,
774
593
  signingPlacements: U.value.filter((t) => t.pageId !== e.id)
775
594
  });
776
- L.value = i.pages[Math.min(t, i.pages.length - 1)]?.id ?? "", n.some((e) => e.id === I.value) && Q(), n.forEach((e) => v("signing-placement-remove", Z(e)));
595
+ D.value = i.pages[Math.min(t, i.pages.length - 1)]?.id ?? "", n.some((e) => e.id === E.value) && Q(), n.forEach((e) => p("signing-placement-remove", st(e)));
777
596
  }
778
- function bo(e) {
779
- if (H.value || P.value.pages.length <= 1) return;
780
- let t = Ya(e.id).length;
597
+ function Pi(e) {
598
+ if (V.value || w.value.pages.length <= 1) return;
599
+ let t = Ci(e.id).length;
781
600
  if (!t) {
782
- yo(e);
601
+ Ni(e);
783
602
  return;
784
603
  }
785
- Ot.confirm({
604
+ Ft.confirm({
786
605
  title: "删除合同页面",
787
606
  content: `此页包含 ${t} 个签署位置,删除页面会同时移除这些位置,是否继续?`,
788
607
  okText: "确认删除",
789
608
  okType: "danger",
790
609
  cancelText: "取消",
791
610
  onOk: () => {
792
- yo(e);
611
+ Ni(e);
793
612
  }
794
613
  });
795
614
  }
796
- function xo(e) {
797
- let t = new Set(P.value.variables.map((e) => e.key)), n = 1;
615
+ function Fi(e) {
616
+ let t = new Set(w.value.variables.map((e) => e.key)), n = 1;
798
617
  for (; t.has(`${e}_${n}`);) n += 1;
799
618
  return `${e}_${n}`;
800
619
  }
801
- function So(e) {
620
+ function Ii(e) {
802
621
  let t = e.type ?? "text";
803
622
  return be({
804
623
  ...e,
805
624
  type: t,
806
- key: e.key || xo(t),
625
+ key: e.key || Fi(t),
807
626
  label: e.label || Se(t, l.variableTypes).label
808
627
  }, l.variableTypes, l.defaultVariableStyle);
809
628
  }
810
- function Co(e, t = W.value?.id ?? P.value.pages[0].id, n) {
811
- if (H.value) return e;
812
- let r = R.get(t)?.insertVariable(e, n), i = !P.value.variables.some((t) => t.key === e.key);
813
- return q({
814
- ...P.value,
815
- pages: r ? P.value.pages.map((e) => e.id === r.id ? r : e) : P.value.pages,
816
- variables: i ? [...P.value.variables, e] : P.value.variables
817
- }), F.value = e.key, Q(), L.value = t, i && v("variable-add", e), mo(t), e;
629
+ function Li(e, t = W.value?.id ?? w.value.pages[0].id, n) {
630
+ if (V.value) return e;
631
+ let r = A.get(t)?.insertVariable(e, n), i = !w.value.variables.some((t) => t.key === e.key);
632
+ return Y({
633
+ ...w.value,
634
+ pages: r ? w.value.pages.map((e) => e.id === r.id ? r : e) : w.value.pages,
635
+ variables: i ? [...w.value.variables, e] : w.value.variables
636
+ }), T.value = e.key, Q(), D.value = t, i && p("variable-add", e), G(t), e;
818
637
  }
819
- function wo(e) {
638
+ function Ri(e) {
820
639
  let { width: t, height: n, ...r } = e, i = Ne(t), a = Ne(n);
821
640
  return {
822
641
  ...r,
@@ -824,709 +643,723 @@ var dn = { class: "gd-contract-template-designer__workspace-header" }, fn = { cl
824
643
  ...a === void 0 ? {} : { height: a }
825
644
  };
826
645
  }
827
- function To(e = {}) {
828
- let t = Ne(Ci.value), n = Ne(wi.value);
646
+ function zi(e = {}) {
647
+ let t = Ne(Fn.value), n = Ne(In.value);
829
648
  return {
830
649
  ...e,
831
650
  ...t === void 0 ? {} : { width: t },
832
651
  ...n === void 0 ? {} : { height: n }
833
652
  };
834
653
  }
835
- function Eo() {
836
- Si.value = "", Ci.value = void 0, wi.value = void 0, Ti.value = "";
654
+ function Bi() {
655
+ Pn.value = "", Fn.value = void 0, In.value = void 0, Ln.value = "";
837
656
  }
838
- function Do(e, t = W.value?.id ?? P.value.pages[0]?.id, n) {
839
- let r = wo({
657
+ function Vi(e, t = W.value?.id ?? w.value.pages[0]?.id, n) {
658
+ let r = Ri({
840
659
  ...e,
841
660
  src: e.src.trim()
842
661
  });
843
- if (!(H.value || !t || !Ae(r.src) || !r.src || !R.get(t)?.insertContentImage(r, n))) return L.value = t, F.value = "", Q(), r.src;
662
+ if (!(V.value || !t || !je(r.src) || !r.src || !A.get(t)?.insertContentImage(r, n))) return D.value = t, T.value = "", Q(), r.src;
844
663
  }
845
- function Oo(e) {
664
+ function Hi(e) {
846
665
  return e instanceof Error ? e : /* @__PURE__ */ Error("图片处理失败");
847
666
  }
848
- async function ko(e, t) {
849
- t === "toolbar" && (Ei.value = !0, Ti.value = "");
667
+ async function Ui(e, t) {
668
+ t === "toolbar" && (Rn.value = !0, Ln.value = "");
850
669
  try {
851
- return (await Pe(e, {
670
+ let n = await Pe(e, {
852
671
  source: t,
853
672
  compression: l.imageCompression,
854
673
  upload: l.imageUpload
855
- })).src;
674
+ });
675
+ return Xn ? void 0 : n.src;
856
676
  } catch (e) {
857
- let n = Oo(e);
858
- t === "toolbar" && (Ti.value = n.message), Pi.value = n.message, v("image-error", n, t);
677
+ let n = Hi(e);
678
+ t === "toolbar" && (Ln.value = n.message), z.value = n.message, p("image-error", n, t);
859
679
  return;
860
680
  } finally {
861
- t === "toolbar" && (Ei.value = !1);
681
+ t === "toolbar" && (Rn.value = !1);
862
682
  }
863
683
  }
864
- async function Ao(e) {
865
- return await ko(e, "paste") ?? null;
684
+ async function Wi(e) {
685
+ return await Ui(e, "paste") ?? null;
866
686
  }
867
- async function jo(e, t = {}) {
868
- if (H.value) return;
869
- let n = W.value?.id ?? P.value.pages[0]?.id, r = n ? R.get(n)?.getSelectionRange() : void 0, i = typeof e == "string" ? e.trim() : await ko(e, "toolbar");
870
- if (!i || !Ae(i)) {
871
- typeof e == "string" && (Ti.value = "请输入安全的图片 URL");
687
+ async function Gi(e, t = {}) {
688
+ if (V.value) return;
689
+ let n = W.value?.id ?? w.value.pages[0]?.id, r = n ? A.get(n)?.getSelectionRange() : void 0, i = typeof e == "string" ? e.trim() : await Ui(e, "toolbar");
690
+ if (Xn) return;
691
+ if (!i || !je(i)) {
692
+ typeof e == "string" && (Ln.value = "请输入安全的图片 URL");
872
693
  return;
873
694
  }
874
- let a = Do({
695
+ if (n && !A.has(n)) return;
696
+ let a = Vi({
875
697
  ...t,
876
698
  src: i
877
699
  }, n, r);
878
- return a && (xi.value = !1, Eo(), Pi.value = "已插入图片"), a;
700
+ return a && (Nn.value = !1, Bi(), z.value = "已插入图片"), a;
879
701
  }
880
- function Mo() {
881
- H.value || Ei.value || ($(), Ti.value = "", Br.value && (Br.value.value = ""), Br.value?.click());
702
+ function Ki() {
703
+ V.value || Rn.value || ($(), Ln.value = "", an.value && (an.value.value = ""), an.value?.click());
882
704
  }
883
- async function No(e) {
705
+ async function qi(e) {
884
706
  let t = e.target.files?.[0];
885
- t && await jo(t, To({ alt: t.name }));
707
+ t && await Gi(t, zi({ alt: t.name }));
886
708
  }
887
- async function Po() {
888
- let e = Si.value;
889
- await jo(e, To());
709
+ async function Ji() {
710
+ let e = Pn.value;
711
+ await Gi(e, zi());
890
712
  }
891
- function Fo(e) {
892
- $o(e), bi.value = !1;
713
+ function Yi(e) {
714
+ ha(e), Mn.value = !1;
893
715
  }
894
- function Io() {
895
- $(), _o();
716
+ function Xi() {
717
+ $(), ji();
896
718
  }
897
- function Lo(e, t, n, r) {
898
- $(), Co(So({ type: t }), e, {
719
+ function Zi(e, t, n, r) {
720
+ $(), Li(Ii({ type: t }), e, {
899
721
  left: n,
900
722
  top: r
901
723
  });
902
724
  }
903
- function Ro(e) {
904
- $(), F.value = e, Q();
725
+ function Qi(e) {
726
+ $(), T.value = e, Q();
905
727
  }
906
- function zo(e) {
907
- let t = P.value.variables.find((t) => t.id === e.id), n = [...P.value.pages], r = t?.key ?? e.key, i = "";
908
- R.forEach((t, a) => {
909
- let o = t.updateVariable(e, r);
728
+ function $i(e) {
729
+ let t = w.value.variables.find((t) => t.id === e.id);
730
+ if (!t) return;
731
+ let n = e.key.trim();
732
+ if (n !== t.key) {
733
+ let t = ke(n, w.value.variables, e.id);
734
+ if (t) {
735
+ z.value = t;
736
+ return;
737
+ }
738
+ }
739
+ e = {
740
+ ...e,
741
+ key: n
742
+ };
743
+ let r = [...w.value.pages], i = t.key, a = "";
744
+ A.forEach((t, n) => {
745
+ let o = t.updateVariable(e, i);
910
746
  if (o) {
911
- i ||= a;
912
- let e = n.findIndex((e) => e.id === a);
913
- e >= 0 && (n[e] = o);
747
+ a ||= n;
748
+ let e = r.findIndex((e) => e.id === n);
749
+ e >= 0 && (r[e] = o);
914
750
  }
915
- }), q({
916
- ...P.value,
917
- pages: n,
918
- variables: P.value.variables.map((t) => t.id === e.id ? e : t)
919
- }), F.value = e.key, mo(i || L.value);
920
- }
921
- function Bo(e) {
922
- Ui.value && zo({
923
- ...Ui.value,
751
+ }), Y({
752
+ ...w.value,
753
+ pages: r,
754
+ variables: w.value.variables.map((t) => t.id === e.id ? e : t),
755
+ ...i !== e.key && w.value.pageDecorations ? { pageDecorations: ue(w.value.pageDecorations, i, e.key) } : {}
756
+ }), T.value = e.key, G(a || D.value);
757
+ }
758
+ function ea(e) {
759
+ H.value && $i({
760
+ ...H.value,
924
761
  ...e,
925
762
  style: {
926
- ...Ui.value.style,
763
+ ...H.value.style,
927
764
  ...e.style
928
765
  }
929
766
  });
930
767
  }
931
- function Vo(e) {
932
- (e === "left" || e === "center" || e === "right") && Bo({ style: { textAlign: e } });
768
+ function ta(e) {
769
+ V.value || !H.value || ea({ key: e });
933
770
  }
934
- function Ho(e) {
935
- (e === "solid" || e === "dashed") && Bo({ style: { borderStyle: e } });
771
+ function na(e) {
772
+ V.value || (Y({
773
+ ...w.value,
774
+ pageDecorations: se(e)
775
+ }), G(w.value.pages[0]?.id));
936
776
  }
937
- function Uo(e) {
938
- (e === "contain" || e === "cover" || e === "fill") && Bo({ style: { objectFit: e } });
777
+ function ra(e) {
778
+ (e === "left" || e === "center" || e === "right") && ea({ style: { textAlign: e } });
939
779
  }
940
- function Wo(e) {
941
- Bo({ style: e });
780
+ function ia(e) {
781
+ (e === "solid" || e === "dashed") && ea({ style: { borderStyle: e } });
942
782
  }
943
- function Go(e) {
944
- Wo({ fontFamily: String(e || "").trim() || "Noto Serif SC, Source Han Serif SC, Songti SC, STSong, SimSun, serif" });
783
+ function aa(e) {
784
+ (e === "contain" || e === "cover" || e === "fill") && ea({ style: { objectFit: e } });
945
785
  }
946
- function Ko(e) {
947
- Wo({ fontSize: Ma(e, Ui.value?.style?.fontSize ?? 14) });
786
+ function oa(e) {
787
+ ea({ style: e });
948
788
  }
949
- function qo(e) {
950
- Ui.value && Bo({
789
+ function sa(e) {
790
+ oa({ fontFamily: String(e || "").trim() || "Noto Serif SC, Source Han Serif SC, Songti SC, STSong, SimSun, serif" });
791
+ }
792
+ function ca(e) {
793
+ oa({ fontSize: ci(e, H.value?.style?.fontSize ?? 14) });
794
+ }
795
+ function la(e) {
796
+ H.value && ea({
951
797
  multiline: e,
952
- rows: Ui.value.rows || 3,
953
- lineHeight: Ui.value.lineHeight || 28,
798
+ rows: H.value.rows || 3,
799
+ lineHeight: H.value.lineHeight || 28,
954
800
  style: e ? { underline: !0 } : void 0
955
801
  });
956
802
  }
957
- function Jo(e) {
958
- Ui.value && Bo({
803
+ function ua(e) {
804
+ H.value && ea({
959
805
  rows: Number(e || 3),
960
- lineHeight: Ui.value.lineHeight || 28
806
+ lineHeight: H.value.lineHeight || 28
961
807
  });
962
808
  }
963
- function Yo(e) {
964
- if (H.value) return;
965
- let t = [...P.value.pages];
966
- R.forEach((n, r) => {
809
+ function da(e) {
810
+ if (V.value) return;
811
+ let t = [...w.value.pages];
812
+ A.forEach((n, r) => {
967
813
  let i = n.removeVariable(e.key);
968
814
  if (i) {
969
815
  let e = t.findIndex((e) => e.id === r);
970
816
  e >= 0 && (t[e] = i);
971
817
  }
972
- }), q({
973
- ...P.value,
818
+ }), Y({
819
+ ...w.value,
974
820
  pages: t,
975
- variables: P.value.variables.filter((t) => t.id !== e.id)
976
- }), F.value = "", I.value = "";
821
+ variables: w.value.variables.filter((t) => t.id !== e.id),
822
+ ...w.value.pageDecorations ? { pageDecorations: ue(w.value.pageDecorations, e.key) } : {}
823
+ }), T.value = "", E.value = "";
977
824
  }
978
- function Xo(e) {
979
- let t = (e.trim() || "variable").replace(/\s+/g, "_"), n = new Set(P.value.variables.map((e) => e.key));
825
+ function fa(e) {
826
+ let t = (e.trim() || "variable").replace(/\s+/g, "_"), n = new Set(w.value.variables.map((e) => e.key));
980
827
  if (!n.has(t)) return t;
981
828
  let r = 2;
982
829
  for (; n.has(`${t}_${r}`);) r += 1;
983
830
  return `${t}_${r}`;
984
831
  }
985
- function Zo(e) {
986
- H.value || Co(be({
832
+ function pa(e) {
833
+ V.value || Li(be({
987
834
  ...e,
988
835
  id: void 0,
989
- key: Xo(`${e.key || e.type}_copy`),
836
+ key: fa(`${e.key || e.type}_copy`),
990
837
  label: `${e.label}副本`,
991
838
  style: { ...e.style }
992
839
  }, l.variableTypes, l.defaultVariableStyle));
993
840
  }
994
- function Qo(e) {
995
- return H.value ? void 0 : Co(P.value.variables.find((t) => t.key === e.key) ?? be(e, l.variableTypes, l.defaultVariableStyle));
841
+ function ma(e) {
842
+ return V.value ? void 0 : Li(w.value.variables.find((t) => t.key === e.key) ?? be(e, l.variableTypes, l.defaultVariableStyle));
996
843
  }
997
- function $o(e) {
998
- if (!H.value) return Co(So({ type: e }));
844
+ function ha(e) {
845
+ if (!V.value) return Li(Ii({ type: e }));
999
846
  }
1000
- function es(t) {
1001
- if (H.value || !e(t)) return;
1002
- let n = z.value, r = ma.value.find((e) => e.type === t);
847
+ function ga(t) {
848
+ if (V.value || !e(t)) return;
849
+ let n = I.value, r = Or.value.find((e) => e.type === t);
1003
850
  if (!n || !r) return;
1004
- let i = Fe(n.leadingText) || r.label, a = Ie(n.selectionWidth, yr, ya.value), o = ts();
1005
- Co(So({
851
+ let i = Fe(n.leadingText) || r.label, a = Ie(n.selectionWidth, qt, Yr.value), o = _a();
852
+ Li(Ii({
1006
853
  type: t,
1007
854
  label: i,
1008
855
  ...a ? { width: a } : {},
1009
856
  ...o ? { style: o } : {}
1010
- }), n.pageId), Pi.value = n.hasSelection ? `已将选中内容替换为${r.label}控件` : `已插入${r.label}控件`, $();
857
+ }), n.pageId), z.value = n.hasSelection ? `已将选中内容替换为${r.label}控件` : `已插入${r.label}控件`, $();
1011
858
  }
1012
- function ts() {
1013
- let e = G.value, t = {};
859
+ function _a() {
860
+ let e = Zr.value, t = {};
1014
861
  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;
1015
862
  }
1016
- function ns(e) {
1017
- if (H.value) return;
1018
- let t = z.value;
1019
- t && (Co(e, t.pageId), Pi.value = `已绑定到${e.label},沿用原控件尺寸`, $());
863
+ function va(e) {
864
+ if (V.value) return;
865
+ let t = I.value;
866
+ t && (Li(e, t.pageId), z.value = `已绑定到${e.label},沿用原控件尺寸`, $());
1020
867
  }
1021
- function rs(t) {
1022
- return Se(t.type && e(t.type) ? t.type : "text", ma.value).label;
868
+ function ya(t) {
869
+ return Se(t.type && e(t.type) ? t.type : "text", Or.value).label;
1023
870
  }
1024
- function is() {
1025
- P.value.variables.length && (Oi.value = !0, y(() => {
1026
- yc(), Di.value?.querySelector(".gd-contract-template-designer__text-menu-bind-search input")?.focus();
871
+ function ba() {
872
+ w.value.variables.length && (Bn.value = !0, m(() => {
873
+ Oo(), zn.value?.focusBindSearch();
1027
874
  }));
1028
875
  }
1029
- function as(e, t) {
876
+ function xa(e, t) {
1030
877
  e.dataTransfer?.setData("application/x-gd-contract-variable", t), e.dataTransfer && (e.dataTransfer.effectAllowed = "copy");
1031
878
  }
1032
- function os(e) {
1033
- return ui.value = Math.round(Math.min(hr, Math.max(mr, Number.isFinite(e) ? e : 1)) * 100) / 100, ui.value;
1034
- }
1035
- let { width: ss } = Mt(Mr), { width: cs } = Mt(Pr), ls = d(() => Math.max(...P.value.pages.map((e) => X(e).width), pe.width) + 10), us = S([]), ds = /* @__PURE__ */ new Map(), fs = 0, ps = d(() => us.value.length > 0);
1036
- function ms(e) {
1037
- return us.value.includes(e);
879
+ function Sa(e) {
880
+ return M.value = Math.round(Math.min(Ht, Math.max(Vt, Number.isFinite(e) ? e : 1)) * 100) / 100, M.value;
1038
881
  }
1039
- function hs(e, t) {
1040
- let n = us.value;
1041
- n.length === e.length && e.every((e) => n.includes(e)) || (us.value = e, e.length || (mi.value = !1), !(t >= kr) && y(() => gs(t + 1)));
1042
- }
1043
- function gs(e = 0) {
1044
- let t = Pr.value;
1045
- if (!t) return;
1046
- if (typeof window < "u" && window.matchMedia("(max-width: 760px)").matches) {
1047
- hs([], e);
1048
- return;
1049
- }
1050
- let n = t.clientWidth;
1051
- if (n <= 0) return;
1052
- let r = Fr.value, i = 0;
1053
- for (let e of Array.from(t.children)) {
1054
- if (!(e instanceof HTMLElement)) continue;
1055
- if (e === r) {
1056
- e.offsetWidth > 0 && (fs = e.offsetWidth);
1057
- continue;
1058
- }
1059
- let t = e.dataset.toolbarOverflowKey;
1060
- if (t) {
1061
- e.offsetWidth > 0 && ds.set(t, e.offsetWidth);
1062
- continue;
1063
- }
1064
- i += e.offsetWidth;
1065
- }
1066
- let a = Object.fromEntries(ft.map((e) => [e, ds.get(e) ?? 0]));
1067
- hs(pt({
1068
- availableWidth: n,
1069
- fixedWidth: i,
1070
- groupWidths: a,
1071
- moreWidth: fs || Dr,
1072
- buffer: Or
1073
- }), e);
1074
- }
1075
- St([
1076
- cs,
1077
- xa,
1078
- gi,
1079
- Sa,
1080
- Ca,
1081
- H
1082
- ], () => {
1083
- y(() => gs());
1084
- }, { immediate: !0 }), vt(() => {
1085
- y(() => gs()), typeof document < "u" && document.fonts?.ready && document.fonts.ready.then(() => {
1086
- Pr.value && y(() => gs());
1087
- });
1088
- });
1089
- let { fitWidth: _s, applyAutoFit: vs, markUserAdjusted: ys } = je({
1090
- viewportWidth: ss,
1091
- widestPageWidth: ls,
882
+ let { width: Ca } = It($t), { fitWidth: wa, applyAutoFit: Ta, markUserAdjusted: Ea } = Me({
883
+ viewportWidth: Ca,
884
+ widestPageWidth: f(() => Math.max(...w.value.pages.map((e) => Z(e).width), fe.width) + 10),
1092
885
  padding: 48,
1093
- minZoom: mr,
1094
- maxZoom: hr,
1095
- getZoom: () => ui.value,
1096
- applyZoom: os
886
+ minZoom: Vt,
887
+ maxZoom: Ht,
888
+ getZoom: () => M.value,
889
+ applyZoom: Sa
1097
890
  });
1098
- function bs(e) {
1099
- return ys(), os(e);
891
+ function Da(e) {
892
+ return Ea(), Sa(e);
1100
893
  }
1101
- function xs() {
1102
- return vs();
1103
- }
1104
- function Ss() {
1105
- return ui.value;
894
+ function Oa() {
895
+ return Ta();
1106
896
  }
1107
- function Cs() {
1108
- bs(ui.value + gr);
897
+ function ka() {
898
+ return M.value;
1109
899
  }
1110
- function ws() {
1111
- bs(ui.value - gr);
900
+ function Aa() {
901
+ Da(M.value + Ut);
1112
902
  }
1113
- function Ts(e) {
1114
- let t = e.target instanceof HTMLElement ? e.target : null;
1115
- t && (t.closest(".gd-contract-template-designer__toolbar-more, .ant-popover, .ant-select-dropdown") || (mi.value = !1));
903
+ function ja() {
904
+ Da(M.value - Ut);
1116
905
  }
1117
- St(mi, (e) => {
1118
- typeof document > "u" || (e ? document.addEventListener("mousedown", Ts, !0) : document.removeEventListener("mousedown", Ts, !0));
1119
- }), _t(() => {
1120
- typeof document < "u" && document.removeEventListener("mousedown", Ts, !0);
1121
- });
1122
- function Es() {
1123
- $(), vi.value = !1, yi.value = !1, mi.value = !1, di.value = !di.value;
906
+ function Ma() {
907
+ $(), P.value = !1, F.value = !1, kn.value = !1, Tn.value = !Tn.value;
1124
908
  }
1125
- function Ds() {
909
+ function Na() {
1126
910
  $();
1127
- let e = K(!1);
1128
- k.value ? (oi.value = u(A.value), ai.value = void 0, si.value = j.value || A.value[0]?.id || "") : (ai.value = c(e), oi.value = void 0, si.value = ""), ii.value = !0;
911
+ let e = q(!1);
912
+ y.value ? (xn.value = u(b.value), j.value = void 0, Sn.value = x.value || b.value[0]?.id || "") : (j.value = c(e), xn.value = void 0, Sn.value = ""), bn.value = !0;
1129
913
  }
1130
- function Os() {
1131
- ii.value = !1, ai.value = void 0, oi.value = void 0, si.value = "";
914
+ function Pa() {
915
+ bn.value = !1, j.value = void 0, xn.value = void 0, Sn.value = "";
1132
916
  }
1133
- function ks() {
1134
- return Qs();
917
+ function Fa() {
918
+ return so();
1135
919
  }
1136
- function As() {
920
+ function Ia() {
1137
921
  $();
1138
- let e = ks();
1139
- return li.value = JSON.stringify(e, null, 2), ci.value = !0, e;
1140
- }
1141
- function js() {
1142
- ci.value = !1;
1143
- }
1144
- function Ms() {
1145
- $(), vi.value = !1, yi.value = !1;
1146
- let e = U.value.map(Z);
1147
- N.value = [], M.value = {
1148
- ...M.value,
1149
- [j.value]: []
922
+ let e = Fa();
923
+ return wn.value = JSON.stringify(e, null, 2), Cn.value = !0, e;
924
+ }
925
+ function La() {
926
+ Cn.value = !1;
927
+ }
928
+ function Ra() {
929
+ $(), P.value = !1, F.value = !1;
930
+ let e = U.value.map(st);
931
+ C.value = [], S.value = {
932
+ ...S.value,
933
+ [x.value]: []
1150
934
  };
1151
- let t = !!I.value;
1152
- F.value = "", I.value = "", L.value = "", ii.value = !1, ai.value = void 0, oi.value = void 0, ci.value = !1, li.value = "", hi.value = {}, ri.value = "";
1153
- let n = q(ve(pe));
1154
- return t && v("signing-placement-select", void 0), e.forEach((e) => v("signing-placement-remove", e)), L.value = n.pages[0]?.id ?? "", c(n);
935
+ let t = !!E.value;
936
+ T.value = "", E.value = "", D.value = "", bn.value = !1, j.value = void 0, xn.value = void 0, Cn.value = !1, wn.value = "", An.value = {}, yn.value = "";
937
+ let n = Y(ve(fe));
938
+ return t && p("signing-placement-select", void 0), e.forEach((e) => p("signing-placement-remove", e)), D.value = n.pages[0]?.id ?? "", c(n);
1155
939
  }
1156
- function Ns() {
1157
- H.value || ($(), Ot.confirm({
940
+ function za() {
941
+ V.value || ($(), Ft.confirm({
1158
942
  title: "清空合同内容",
1159
943
  content: "将清空全部合同正文、页面、模板变量和签署位置,仅保留一个空白 A4 合同页。此操作不可撤销。",
1160
944
  okText: "确认清空",
1161
945
  okType: "danger",
1162
946
  cancelText: "取消",
1163
947
  onOk: () => {
1164
- Ms();
948
+ Ra();
1165
949
  }
1166
950
  }));
1167
951
  }
1168
- function Ps(e) {
1169
- let t = Pa().pages, n = t.find((e) => e.id === L.value);
952
+ function Ba(e) {
953
+ let t = K().pages, n = t.find((e) => e.id === D.value);
1170
954
  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}'`));
1171
955
  }
1172
- function Fs(e) {
1173
- $(), F.value = e.key, Q();
1174
- let t = Ps(e);
1175
- t && (L.value = t.id, y(() => {
1176
- R.get(t.id)?.scrollIntoVariable(e.key);
956
+ function Va(e) {
957
+ $(), T.value = e.key, Q();
958
+ let t = Ba(e);
959
+ t && (D.value = t.id, m(() => {
960
+ A.get(t.id)?.scrollIntoVariable(e.key);
1177
961
  }));
1178
962
  }
1179
- function Is(e) {
1180
- let t = P.value.variables.find((t) => t.key === e || t.id === e);
1181
- t && Fs(t);
963
+ function Ha(e) {
964
+ let t = w.value.variables.find((t) => t.key === e || t.id === e);
965
+ t && Va(t);
1182
966
  }
1183
- function Ls(e) {
967
+ function Ua(e) {
1184
968
  let t = U.value.find((t) => t.id === e);
1185
- t && ($(), F.value = "", L.value = t.pageId, Q(t.id), y(() => {
1186
- R.get(t.pageId)?.scrollIntoSigningPlacement(t.id);
969
+ t && ($(), T.value = "", D.value = t.pageId, Q(t.id), m(() => {
970
+ A.get(t.pageId)?.scrollIntoSigningPlacement(t.id);
1187
971
  }));
1188
972
  }
1189
- function Rs(e, t = !0) {
1190
- $(), L.value = e, t && y(() => {
1191
- R.get(e)?.scrollIntoPage();
973
+ function Wa(e, t = !0) {
974
+ $(), D.value = e, t && m(() => {
975
+ A.get(e)?.scrollIntoPage();
1192
976
  });
1193
977
  }
1194
- function zs(e) {
1195
- P.value.pages.some((t) => t.id === e) && Rs(e);
978
+ function Ga(e) {
979
+ w.value.pages.some((t) => t.id === e) && Wa(e);
980
+ }
981
+ function Ka() {
982
+ if (N.value) {
983
+ qa();
984
+ return;
985
+ }
986
+ N.value = !0;
987
+ }
988
+ function qa() {
989
+ N.value = !1, m(() => tn.value?.focusPageDecorations());
1196
990
  }
1197
- function Bs() {
1198
- return c(Pa());
991
+ function Ja() {
992
+ return di(), c(K());
1199
993
  }
1200
- function Vs(e) {
1201
- N.value = Vr(e), M.value = {
1202
- ...M.value,
1203
- [j.value]: N.value
994
+ function Ya(e) {
995
+ C.value = on(e), S.value = {
996
+ ...S.value,
997
+ [x.value]: C.value
1204
998
  };
1205
- let t = q(Ee(e, l.pageSize));
1206
- t.signingPlacements?.some((e) => e.id === I.value) || Q(), mo(t.pages[0]?.id);
1207
- }
1208
- function Hs() {
1209
- let e = K(!1);
1210
- return k.value ? u(A.value) : u(at(A.value, j.value, e));
1211
- }
1212
- function Us(e, t) {
1213
- let n = Ur(nt(e, void 0, l.pageSize), l.pageSizeOptions), r = A.value;
1214
- Kr.value = !0, K(!1), A.value = n.files, M.value = Hr(n.files, e), Ia(ot(A.value, t ?? j.value), !1, !0, !0, !1), JSON.stringify(r) !== JSON.stringify(A.value) && Fa(A.value, "");
1215
- }
1216
- function Ws(e) {
1217
- if (H.value) return;
1218
- Kr.value = !0, K(!0);
1219
- let t = $e(e || `合同文件 ${A.value.length + 1}`, l.pageSize);
1220
- return A.value = [...A.value, t], M.value = {
1221
- ...M.value,
1222
- [t.id]: []
1223
- }, Fa(A.value, ""), v("file-add", u([t])[0]), Ia(t.id, !1, !0, !0), u([t])[0];
999
+ let t = Y(Ee(e, l.pageSize));
1000
+ t.signingPlacements?.some((e) => e.id === E.value) || Q(), G(t.pages[0]?.id);
1001
+ }
1002
+ function Xa() {
1003
+ let e = q(!1);
1004
+ return y.value ? u(b.value) : u(it(b.value, x.value, e));
1005
+ }
1006
+ function Za(e, t) {
1007
+ let n = Ze(tt(e, void 0, l.pageSize), l.pageSizeOptions), r = b.value;
1008
+ un.value = !0, q(!1), b.value = n.files, S.value = sn(n.files, e), hi(at(b.value, t ?? x.value), {
1009
+ syncCurrent: !1,
1010
+ shouldEmit: !0,
1011
+ forceRefresh: !0,
1012
+ persistCurrentErrors: !1
1013
+ }), d(r) !== d(b.value) && J(b.value, "");
1224
1014
  }
1225
- function Gs(e) {
1226
- !k.value && !A.value.some((t) => t.id === e) || (Kr.value = !0, Ia(e));
1227
- }
1228
- function Ks(e, t) {
1229
- if (H.value) return;
1230
- Kr.value = !0, K(!1);
1231
- let n = it(A.value, e, t), r = n.find((t) => t.id === e);
1232
- if (r) return A.value = n, Fa(n, e), u([r])[0];
1015
+ function Qa(e) {
1016
+ if (V.value) return;
1017
+ un.value = !0, q(!0);
1018
+ let t = Qe(e || `合同文件 ${b.value.length + 1}`, l.pageSize);
1019
+ return b.value = [...b.value, t], S.value = {
1020
+ ...S.value,
1021
+ [t.id]: []
1022
+ }, J(b.value, ""), p("file-add", u([t])[0]), hi(t.id, {
1023
+ syncCurrent: !1,
1024
+ shouldEmit: !0,
1025
+ forceRefresh: !0
1026
+ }), u([t])[0];
1233
1027
  }
1234
- function qs(e) {
1235
- if (H.value || A.value.length <= 1) return;
1236
- Kr.value = !0, K(!1);
1237
- let t = A.value.find((t) => t.id === e);
1028
+ function $a(e) {
1029
+ !y.value && !b.value.some((t) => t.id === e) || (un.value = !0, hi(e));
1030
+ }
1031
+ function eo(e, t) {
1032
+ if (V.value) return;
1033
+ un.value = !0, q(!1);
1034
+ let n = rt(b.value, e, t), r = n.find((t) => t.id === e);
1035
+ if (r) return b.value = n, J(n, e), u([r])[0];
1036
+ }
1037
+ function to(e) {
1038
+ if (V.value || b.value.length <= 1) return;
1039
+ un.value = !0, q(!1);
1040
+ let t = b.value.find((t) => t.id === e);
1238
1041
  if (!t) return;
1239
- let n = rt(A.value, e);
1240
- if (n.length === A.value.length) return;
1241
- A.value = n;
1242
- let { [e]: r, ...i } = M.value;
1243
- M.value = i, Fa(n, ""), v("file-remove", u([t])[0]);
1042
+ let n = nt(b.value, e);
1043
+ if (n.length === b.value.length) return;
1044
+ b.value = n;
1045
+ let { [e]: r, ...i } = S.value;
1046
+ S.value = i, J(n, ""), p("file-remove", u([t])[0]);
1244
1047
  let a = t.template.signingPlacements ?? [];
1245
- return a.forEach((e) => v("signing-placement-remove", Z(e))), a.some((e) => e.id === I.value) && v("signing-placement-select", void 0), j.value === e && Ia(ot(n, n[0]?.id), !1, !0, !0, !1), u([t])[0];
1246
- }
1247
- function Js(e) {
1248
- if (H.value || A.value.length <= 1) return;
1249
- let t = A.value.find((t) => t.id === e);
1048
+ return a.forEach((e) => p("signing-placement-remove", st(e))), a.some((e) => e.id === E.value) && p("signing-placement-select", void 0), x.value === e && hi(at(n, n[0]?.id), {
1049
+ syncCurrent: !1,
1050
+ shouldEmit: !0,
1051
+ forceRefresh: !0,
1052
+ persistCurrentErrors: !1
1053
+ }), u([t])[0];
1054
+ }
1055
+ function no(e) {
1056
+ if (V.value || b.value.length <= 1) return;
1057
+ let t = b.value.find((t) => t.id === e);
1250
1058
  if (!t) return;
1251
1059
  let n = t.template.signingPlacements?.length ?? 0;
1252
- Ot.confirm({
1060
+ Ft.confirm({
1253
1061
  title: "删除合同文件",
1254
1062
  content: n ? `“${t.name}”包含 ${n} 个签署位置,删除后文件内正文、变量和签署位置都会移除,是否继续?` : `删除“${t.name}”后,其正文和变量将无法恢复,是否继续?`,
1255
1063
  okText: "确认删除",
1256
1064
  okType: "danger",
1257
1065
  cancelText: "取消",
1258
1066
  onOk: () => {
1259
- qs(e);
1067
+ to(e);
1260
1068
  }
1261
1069
  });
1262
1070
  }
1263
- function Ys(e, t) {
1264
- if (H.value) return;
1265
- Kr.value = !0, K(!1);
1266
- let n = A.value.findIndex((t) => t.id === e), r = tt(A.value, e, t), i = r.findIndex((t) => t.id === e), a = r[i];
1267
- if (!(!a || n === i)) return A.value = r, Fa(r, ""), v("file-move", u([a])[0], n, i), u([a])[0];
1268
- }
1269
- function Xs() {
1270
- K(!1);
1271
- let e = rc(k.value ? A.value.flatMap((e) => {
1272
- let t = ke(e.template, { maxPages: ga.value });
1273
- return [...M.value[e.id] ?? [], ...t].map((t) => ({
1071
+ function ro(e, t) {
1072
+ if (V.value) return;
1073
+ un.value = !0, q(!1);
1074
+ let n = b.value.findIndex((t) => t.id === e), r = et(b.value, e, t), i = r.findIndex((t) => t.id === e), a = r[i];
1075
+ if (!(!a || n === i)) return b.value = r, J(r, ""), p("file-move", u([a])[0], n, i), u([a])[0];
1076
+ }
1077
+ function io() {
1078
+ q(!1);
1079
+ let e = po(y.value ? b.value.flatMap((e) => {
1080
+ let t = Ae(e.template, { maxPages: Ar.value });
1081
+ return [...S.value[e.id] ?? [], ...t].map((t) => ({
1274
1082
  ...t,
1275
1083
  fileId: e.id
1276
1084
  }));
1277
- }) : [...N.value, ...ke(Pa(), { maxPages: ga.value })]);
1278
- return ti.value = e, ei.value = !0, v("validate", e), e;
1085
+ }) : [...C.value, ...Ae(K(), { maxPages: Ar.value })]);
1086
+ return k.value = e, O.value = !0, p("validate", e), e;
1279
1087
  }
1280
- function Zs(e) {
1281
- if (e.fileId && e.fileId !== j.value) {
1282
- Gs(e.fileId), y(() => Zs({
1088
+ function ao(e) {
1089
+ if (e.fileId && e.fileId !== x.value) {
1090
+ $a(e.fileId), m(() => ao({
1283
1091
  ...e,
1284
1092
  fileId: void 0
1285
1093
  }));
1286
1094
  return;
1287
1095
  }
1096
+ let t = le(e);
1097
+ if (t) {
1098
+ N.value = !0, m(() => nn.value?.focusField(t));
1099
+ return;
1100
+ }
1288
1101
  if (e.type === "signing-placement") {
1289
1102
  let t = U.value.find((t) => t.id === e.id);
1290
1103
  if (t) {
1291
- Rs(t.pageId), Q(t.id);
1104
+ Wa(t.pageId), Q(t.id);
1292
1105
  return;
1293
1106
  }
1294
1107
  }
1295
1108
  if (e.variableKey) {
1296
- Is(e.variableKey);
1109
+ Ha(e.variableKey);
1297
1110
  return;
1298
1111
  }
1299
1112
  if (e.pageId) {
1300
- zs(e.pageId);
1113
+ Ga(e.pageId);
1301
1114
  return;
1302
1115
  }
1303
- let t = P.value.variables.find((t) => t.id === e.id || t.key === e.id);
1304
- if (t) {
1305
- Fs(t);
1116
+ let n = w.value.variables.find((t) => t.id === e.id || t.key === e.id);
1117
+ if (n) {
1118
+ Va(n);
1306
1119
  return;
1307
1120
  }
1308
- P.value.pages.some((t) => t.id === e.id) && Rs(e.id);
1121
+ w.value.pages.some((t) => t.id === e.id) && Wa(e.id);
1309
1122
  }
1310
- function Qs() {
1311
- return xe(Pa());
1123
+ function oo(e) {
1124
+ return le(e) ? "页面装饰" : e.type === "signing-placement" ? "签署位置" : e.type === "variable" ? "变量" : "字段";
1125
+ }
1126
+ function so() {
1127
+ return di(), xe(K());
1312
1128
  }
1313
- function $s() {
1314
- let e = K(!1);
1315
- return et(k.value ? A.value : at(A.value, j.value, e));
1129
+ function co() {
1130
+ let e = q(!1);
1131
+ return $e(y.value ? b.value : it(b.value, x.value, e));
1316
1132
  }
1317
- function ec(e) {
1318
- let n = Pa();
1133
+ function lo(e) {
1134
+ let n = K();
1319
1135
  try {
1320
- let r = he(n, N.value);
1136
+ let r = me(n, C.value);
1321
1137
  if (r.length) throw new t(r);
1322
1138
  return e(n);
1323
1139
  } catch (e) {
1324
- throw e instanceof t && (ti.value = [...e.errors], ei.value = !0, v("validate", [...e.errors])), e;
1140
+ throw e instanceof t && (k.value = [...e.errors], O.value = !0, p("validate", [...e.errors])), e;
1325
1141
  }
1326
1142
  }
1327
- function tc(e) {
1328
- return ec((t) => o(t, e));
1143
+ function uo(e) {
1144
+ return lo((t) => i(t, e));
1329
1145
  }
1330
- function nc(e) {
1331
- return ec((t) => a(t, e));
1146
+ function fo(e) {
1147
+ return lo((t) => r(t, e));
1332
1148
  }
1333
- function rc(e) {
1149
+ function po(e) {
1334
1150
  let t = /* @__PURE__ */ new Set();
1335
1151
  return e.filter((e) => {
1336
1152
  let n = `${e.fileId ?? ""}|${e.code ?? ""}|${e.id}|${e.pageId ?? ""}|${e.message}`;
1337
1153
  return t.has(n) ? !1 : (t.add(n), !0);
1338
1154
  });
1339
1155
  }
1340
- function ic(e) {
1341
- ti.value = [...e], ei.value = !0;
1156
+ function mo(e) {
1157
+ k.value = [...e], O.value = !0;
1342
1158
  }
1343
- function ac() {
1344
- ti.value = [], ei.value = !1;
1159
+ function ho() {
1160
+ k.value = [], O.value = !1;
1345
1161
  }
1346
- function oc() {
1347
- R.get(W.value?.id ?? L.value)?.focus();
1162
+ function go() {
1163
+ A.get(W.value?.id ?? D.value)?.focus();
1348
1164
  }
1349
- function sc(e) {
1350
- ka(e) && J({
1165
+ function _o(e) {
1166
+ oi(e) && X({
1351
1167
  type: "set-text-align",
1352
1168
  value: e
1353
1169
  });
1354
1170
  }
1355
- function cc(e) {
1356
- if (e === "paragraph") {
1357
- J({ type: "set-paragraph" });
1358
- return;
1359
- }
1360
- Aa(e) && J({
1361
- type: "set-heading",
1362
- level: e
1171
+ function vo(e) {
1172
+ (e === "paragraph" || si(e)) && X({
1173
+ type: "apply-block-style",
1174
+ format: e
1363
1175
  });
1364
1176
  }
1365
- function lc(e) {
1366
- let t = Na(e);
1367
- t && (J({
1177
+ function yo(e) {
1178
+ let t = li(e);
1179
+ t && (X({
1368
1180
  type: "set-font-size",
1369
1181
  value: t
1370
- }), _i.value = "");
1182
+ }), jn.value = "");
1371
1183
  }
1372
- function uc(e) {
1184
+ function bo(e) {
1373
1185
  let t = String(e || "").trim();
1374
1186
  if (!t) {
1375
- J({ type: "unset-font-family" });
1187
+ X({ type: "unset-font-family" });
1376
1188
  return;
1377
1189
  }
1378
- J({
1190
+ X({
1379
1191
  type: "set-font-family",
1380
1192
  value: t
1381
1193
  });
1382
1194
  }
1383
- function dc(e) {
1384
- fc(e.target?.value ?? "");
1195
+ function xo(e) {
1196
+ So(e.target?.value ?? "");
1385
1197
  }
1386
- function fc(e) {
1198
+ function So(e) {
1387
1199
  let t = e.trim();
1388
- t && J({
1200
+ t && X({
1389
1201
  type: "set-color",
1390
1202
  value: t
1391
1203
  });
1392
1204
  }
1393
- function pc(e) {
1394
- _i.value = e;
1395
- }
1396
- function mc() {
1397
- _i.value.trim() && lc(_i.value);
1205
+ function Co(e) {
1206
+ jn.value = e;
1398
1207
  }
1399
- function hc(e) {
1400
- e.key === "Enter" && (e.preventDefault(), mc());
1208
+ function wo() {
1209
+ jn.value.trim() && yo(jn.value);
1401
1210
  }
1402
- function gc(e) {
1403
- e || (mc(), _i.value = "");
1211
+ function To(e) {
1212
+ e.key === "Enter" && (e.preventDefault(), wo());
1404
1213
  }
1405
- function _c(e) {
1406
- ja(e) && (J({
1407
- type: "apply-text-style-preset",
1408
- preset: e
1409
- }), gi.value = void 0, $());
1214
+ function Eo(e) {
1215
+ e || (wo(), jn.value = "");
1410
1216
  }
1411
- function vc(e) {
1412
- if (H.value) return;
1413
- L.value = e.pageId, vi.value = !1, yi.value = !1, B.value = void 0, V.value = void 0, Oi.value = !1, ki.value = "";
1414
- let t = Math.max(O, Math.min(e.clientX, window.innerWidth - Cr)), n = Math.max(O, Math.min(e.clientY, window.innerHeight - wr));
1415
- z.value = {
1217
+ function Do(e) {
1218
+ if (V.value) return;
1219
+ D.value = e.pageId, P.value = !1, F.value = !1, L.value = void 0, R.value = void 0, Bn.value = !1, Vn.value = "";
1220
+ let t = gt(e.clientX, e.clientY, 304, 300);
1221
+ I.value = {
1416
1222
  pageId: e.pageId,
1417
- x: t,
1418
- y: n,
1223
+ x: t.x,
1224
+ y: t.y,
1419
1225
  hasSelection: e.hasSelection,
1420
1226
  selectionWidth: e.selectionWidth,
1421
1227
  leadingText: e.leadingText
1422
- }, y(() => {
1423
- yc(), Di.value?.querySelector("button:not(:disabled)")?.focus();
1228
+ }, m(() => {
1229
+ Oo(), zn.value?.focusFirstButton();
1424
1230
  });
1425
1231
  }
1426
- function yc() {
1427
- let e = Di.value, t = z.value;
1232
+ function Oo() {
1233
+ let e = zn.value?.getMenuElement(), t = I.value;
1428
1234
  if (!e || !t) return;
1429
- let n = e.getBoundingClientRect();
1430
- z.value = {
1235
+ let n = _t(t.x, t.y, e);
1236
+ I.value = {
1431
1237
  ...t,
1432
- x: Math.max(O, Math.min(t.x, window.innerWidth - n.width - O)),
1433
- y: Math.max(O, Math.min(t.y, window.innerHeight - n.height - O))
1238
+ x: n.x,
1239
+ y: n.y
1434
1240
  };
1435
1241
  }
1436
- function bc(e) {
1437
- H.value || (L.value = e.pageId, vi.value = !1, yi.value = !1, z.value = void 0, V.value = void 0, B.value = {
1242
+ function ko(e) {
1243
+ if (V.value) return;
1244
+ D.value = e.pageId, P.value = !1, F.value = !1, I.value = void 0, R.value = void 0;
1245
+ let t = gt(e.clientX, e.clientY, 248, 400);
1246
+ L.value = {
1438
1247
  ...e,
1439
- x: Math.max(8, Math.min(e.clientX, window.innerWidth - 248)),
1440
- y: Math.max(8, Math.min(e.clientY, window.innerHeight - 400))
1441
- }, y(() => {
1442
- let e = Ai.value?.getMenuElement(), t = B.value;
1248
+ x: t.x,
1249
+ y: t.y
1250
+ }, m(() => {
1251
+ let e = Hn.value?.getMenuElement(), t = L.value;
1443
1252
  if (e && t) {
1444
- let n = e.getBoundingClientRect();
1445
- B.value = {
1253
+ let n = _t(t.x, t.y, e);
1254
+ L.value = {
1446
1255
  ...t,
1447
- x: Math.max(8, Math.min(t.x, window.innerWidth - n.width - 8)),
1448
- y: Math.max(8, Math.min(t.y, window.innerHeight - n.height - 8))
1256
+ x: n.x,
1257
+ y: n.y
1449
1258
  };
1450
1259
  }
1451
- Ai.value?.focusFirstItem();
1452
- }));
1260
+ Hn.value?.focusFirstItem();
1261
+ });
1453
1262
  }
1454
- function xc(e) {
1455
- H.value || (L.value = e.pageId, vi.value = !1, yi.value = !1, z.value = void 0, B.value = void 0, Mi.value = e.image.width, Ni.value = e.image.height, F.value = "", I.value && Q(), V.value = {
1263
+ function Ao(e) {
1264
+ if (V.value) return;
1265
+ D.value = e.pageId, P.value = !1, F.value = !1, I.value = void 0, L.value = void 0, Wn.value = e.image.width, Gn.value = e.image.height, T.value = "", E.value && Q();
1266
+ let t = gt(e.clientX, e.clientY, 288, 196);
1267
+ R.value = {
1456
1268
  pageId: e.pageId,
1457
1269
  image: e.image,
1458
- x: Math.max(O, Math.min(e.clientX, window.innerWidth - Tr)),
1459
- y: Math.max(O, Math.min(e.clientY, window.innerHeight - Er))
1460
- }, y(() => {
1461
- Sc(), ji.value?.querySelector("input, button:not(:disabled)")?.focus();
1462
- }));
1270
+ x: t.x,
1271
+ y: t.y
1272
+ }, m(() => {
1273
+ jo(), Un.value?.getMenuElement()?.querySelector("input, button:not(:disabled)")?.focus();
1274
+ });
1463
1275
  }
1464
- function Sc() {
1465
- let e = ji.value, t = V.value;
1276
+ function jo() {
1277
+ let e = Un.value?.getMenuElement(), t = R.value;
1466
1278
  if (!e || !t) return;
1467
- let n = e.getBoundingClientRect();
1468
- V.value = {
1279
+ let n = _t(t.x, t.y, e);
1280
+ R.value = {
1469
1281
  ...t,
1470
- x: Math.max(O, Math.min(t.x, window.innerWidth - n.width - O)),
1471
- y: Math.max(O, Math.min(t.y, window.innerHeight - n.height - O))
1282
+ x: n.x,
1283
+ y: n.y
1472
1284
  };
1473
1285
  }
1474
- function Cc() {
1475
- let e = V.value;
1476
- !e || H.value || (R.get(e.pageId)?.updateSelectedContentImage({
1477
- width: Ne(Mi.value),
1478
- height: Ne(Ni.value)
1479
- }) && (Pi.value = "已更新图片尺寸"), $());
1480
- }
1481
- function wc() {
1482
- let e = V.value;
1483
- !e || H.value || (R.get(e.pageId)?.updateSelectedContentImage({
1286
+ function Mo() {
1287
+ let e = R.value;
1288
+ !e || V.value || (A.get(e.pageId)?.updateSelectedContentImage({
1289
+ width: Ne(Wn.value),
1290
+ height: Ne(Gn.value)
1291
+ }) && (z.value = "已更新图片尺寸"), $());
1292
+ }
1293
+ function No() {
1294
+ let e = R.value;
1295
+ !e || V.value || (A.get(e.pageId)?.updateSelectedContentImage({
1484
1296
  width: void 0,
1485
1297
  height: void 0
1486
- }) && (Pi.value = "已恢复图片自然尺寸"), $());
1298
+ }) && (z.value = "已恢复图片自然尺寸"), $());
1487
1299
  }
1488
- function Tc(e) {
1489
- e.type === "table" ? bc(e) : e.type === "image" ? xc(e) : vc(e);
1300
+ function Po(e) {
1301
+ e.type === "table" ? ko(e) : e.type === "image" ? Ao(e) : Do(e);
1490
1302
  }
1491
1303
  function $() {
1492
- z.value = void 0, B.value = void 0, V.value = void 0, Oi.value = !1, ki.value = "";
1304
+ I.value = void 0, L.value = void 0, R.value = void 0, Bn.value = !1, Vn.value = "";
1305
+ }
1306
+ function Fo(e) {
1307
+ !I.value && !L.value && !R.value || (e.target instanceof HTMLElement ? e.target : null)?.closest(".gd-contract-template-designer__context-menu") || $();
1493
1308
  }
1494
- function Ec(e) {
1495
- !z.value && !B.value && !V.value || (e.target instanceof HTMLElement ? e.target : null)?.closest(".gd-contract-template-designer__context-menu") || $();
1309
+ function Io(e) {
1310
+ (e.target instanceof Element ? e.target : null)?.closest(".gd-contract-template-designer__context-menu") || $();
1496
1311
  }
1497
- function Dc(e) {
1498
- let t = jr.value;
1312
+ function Lo(e) {
1313
+ let t = Qt.value;
1499
1314
  if (!t || typeof document > "u") return !1;
1500
1315
  let n = e.target instanceof Node ? e.target : void 0, r = document.activeElement;
1501
1316
  return !!(n && t.contains(n) || r && t.contains(r) || n instanceof Element && n.closest(".gd-contract-template-designer__context-menu"));
1502
1317
  }
1503
- function Oc(e) {
1318
+ function Ro(e) {
1319
+ if (e.key !== "Escape" || !N.value || typeof document > "u") return;
1320
+ let t = Qt.value?.querySelector(".gd-contract-template-designer__page-decorations-studio");
1321
+ if (!t) return;
1322
+ let n = e.target instanceof Element ? e.target : null, r = document.activeElement instanceof Element ? document.activeElement : null, i = !!(n?.closest(Jn) || r?.closest(Jn)), a = !!(n && t.contains(n) || r && t.contains(r)), o = !!t.querySelector(".ant-select-open, .ant-dropdown-open");
1323
+ if (i || a && o) {
1324
+ qn.add(e);
1325
+ return;
1326
+ }
1327
+ !(I.value || L.value || R.value || P.value || F.value || kn.value || Mn.value || Nn.value) && (a || e.target === document) && (e.preventDefault(), e.stopPropagation(), qa());
1328
+ }
1329
+ function zo(e) {
1504
1330
  if ((e.ctrlKey || e.metaKey) && !e.altKey && e.key.toLowerCase() === "s") {
1505
- if (!Bi.value || !Dc(e)) return;
1506
- e.preventDefault(), Ra();
1331
+ if (!$n.value || !Lo(e)) return;
1332
+ e.preventDefault(), Vr();
1507
1333
  return;
1508
1334
  }
1509
- e.key === "Escape" && ($(), vi.value = !1, yi.value = !1, di.value = !1);
1335
+ if (e.key === "Escape") {
1336
+ if (qn.has(e)) {
1337
+ qn.delete(e);
1338
+ return;
1339
+ }
1340
+ let t = !!(I.value || L.value || R.value || P.value || F.value || kn.value || Mn.value || Nn.value), n = t || N.value;
1341
+ !t && N.value && qa(), $(), P.value = !1, F.value = !1, kn.value = !1, Mn.value = !1, Nn.value = !1, n && e.stopPropagation(), n || (Tn.value = !1);
1342
+ }
1510
1343
  }
1511
- function kc(e, t) {
1512
- e === L.value && t.selectedContentImage && (F.value = "", I.value && Q());
1513
- let n = hi.value[e];
1514
- n && JSON.stringify(n) === JSON.stringify(t) || (hi.value = {
1515
- ...hi.value,
1344
+ function Bo(e, t) {
1345
+ e === D.value && t.selectedContentImage && (T.value = "", E.value && Q());
1346
+ let n = An.value[e];
1347
+ n && ht(n, t) || (An.value = {
1348
+ ...An.value,
1516
1349
  [e]: t
1517
1350
  });
1518
1351
  }
1519
- function Ac(e = Ii.value.rows, t = Ii.value.cols) {
1520
- J({
1352
+ function Vo(e = Kn.value.rows, t = Kn.value.cols) {
1353
+ X({
1521
1354
  type: "insert-table",
1522
1355
  options: {
1523
1356
  rows: Math.min(10, Math.max(1, Math.round(Number(e) || 3))),
1524
1357
  cols: Math.min(10, Math.max(1, Math.round(Number(t) || 3))),
1525
- withHeaderRow: !!Ii.value.withHeaderRow
1358
+ withHeaderRow: !!Kn.value.withHeaderRow
1526
1359
  }
1527
- }), vi.value = !1, $();
1360
+ }), P.value = !1, $();
1528
1361
  }
1529
- let jc = {
1362
+ let Ho = {
1530
1363
  "delete-table-row": {
1531
1364
  label: "删除当前行",
1532
1365
  countKey: "deleteRow"
@@ -1540,34 +1373,34 @@ var dn = { class: "gd-contract-template-designer__workspace-header" }, fn = { cl
1540
1373
  countKey: "deleteTable"
1541
1374
  }
1542
1375
  };
1543
- function Mc(e) {
1544
- let t = B.value;
1376
+ function Uo(e) {
1377
+ let t = L.value;
1545
1378
  if (!t) return;
1546
1379
  let n = () => {
1547
- J(e, t.pageId), $();
1548
- }, r = jc[e.type];
1380
+ X(e, t.pageId), $();
1381
+ }, r = Ho[e.type];
1549
1382
  if (!r) {
1550
1383
  n();
1551
1384
  return;
1552
1385
  }
1553
1386
  let i = t.affectedVariableCounts[r.countKey];
1554
- $(), Ot.confirm({
1387
+ $(), Ft.confirm({
1555
1388
  title: r.label,
1556
1389
  content: i ? `此操作将移除 ${i} 个正文变量节点,是否继续?` : "此操作将修改表格结构,是否继续?",
1557
1390
  okText: "确认",
1558
1391
  okType: "danger",
1559
1392
  cancelText: "取消",
1560
1393
  onOk: n,
1561
- onCancel: () => R.get(t.pageId)?.focus()
1394
+ onCancel: () => A.get(t.pageId)?.focus()
1562
1395
  });
1563
1396
  }
1564
- function Nc(e) {
1565
- let t = Ai.value?.getMenuElement();
1397
+ function Wo(e) {
1398
+ let t = Hn.value?.getMenuElement();
1566
1399
  if (!t) return;
1567
1400
  if (e.key === "Escape") {
1568
- e.preventDefault();
1569
- let t = B.value?.pageId;
1570
- $(), R.get(t ?? "")?.focus();
1401
+ e.preventDefault(), e.stopPropagation();
1402
+ let t = L.value?.pageId;
1403
+ $(), A.get(t ?? "")?.focus();
1571
1404
  return;
1572
1405
  }
1573
1406
  let n = Array.from(t.querySelectorAll("button:not(:disabled)"));
@@ -1585,120 +1418,122 @@ var dn = { class: "gd-contract-template-designer__workspace-header" }, fn = { cl
1585
1418
  let r = (Math.max(0, n.indexOf(document.activeElement)) + (e.key === "ArrowUp" || e.key === "ArrowLeft" ? -1 : 1) + n.length) % n.length;
1586
1419
  e.preventDefault(), n[r]?.focus();
1587
1420
  }
1588
- function Pc(e) {
1421
+ function Go(e) {
1589
1422
  if (e.key !== "Escape") return;
1590
- e.preventDefault();
1591
- let t = z.value?.pageId;
1592
- $(), R.get(t ?? "")?.focus();
1423
+ e.preventDefault(), e.stopPropagation();
1424
+ let t = I.value?.pageId;
1425
+ $(), A.get(t ?? "")?.focus();
1593
1426
  }
1594
- function Fc(e) {
1427
+ function Ko(e) {
1595
1428
  if (e.key !== "Escape") return;
1596
- e.preventDefault();
1597
- let t = V.value?.pageId;
1598
- $(), R.get(t ?? "")?.focus();
1599
- }
1600
- function Ic(e) {
1601
- J({ type: e }), yi.value = !1, $();
1602
- }
1603
- return Ve({
1604
- getValue: Bs,
1605
- setValue: Vs,
1606
- getFiles: Hs,
1607
- setFiles: Us,
1608
- addFile: Ws,
1609
- selectFile: Gs,
1610
- renameFile: Ks,
1611
- removeFile: qs,
1612
- moveFile: Ys,
1613
- validate: Xs,
1614
- exportTemplate: Qs,
1615
- exportFiles: $s,
1616
- getSubmitData: ks,
1617
- clearTemplate: Ms,
1618
- saveDraftCache: Ra,
1619
- loadDraftCache: za,
1620
- clearDraftCache: Ba,
1621
- getDraftCacheStatus: Va,
1622
- insertVariable: Qo,
1623
- insertImage: jo,
1624
- focus: oc,
1625
- openPreview: Ds,
1626
- closePreview: Os,
1627
- openSubmitDataViewer: As,
1628
- closeSubmitDataViewer: js,
1629
- setServerValidationErrors: ic,
1630
- clearValidationErrors: ac,
1631
- scrollToVariable: Is,
1632
- scrollToSigningPlacement: Ls,
1633
- scrollToPage: zs,
1634
- setZoom: bs,
1635
- resetZoom: xs,
1636
- getZoom: Ss,
1637
- fitWidth: _s,
1638
- insertSigningPlacement: to,
1429
+ e.preventDefault(), e.stopPropagation();
1430
+ let t = R.value?.pageId;
1431
+ $(), A.get(t ?? "")?.focus();
1432
+ }
1433
+ function qo(e) {
1434
+ X({ type: e }), F.value = !1, $();
1435
+ }
1436
+ return Ge({
1437
+ getValue: Ja,
1438
+ setValue: Ya,
1439
+ getFiles: Xa,
1440
+ setFiles: Za,
1441
+ addFile: Qa,
1442
+ selectFile: $a,
1443
+ renameFile: eo,
1444
+ removeFile: to,
1445
+ moveFile: ro,
1446
+ validate: io,
1447
+ exportTemplate: so,
1448
+ exportFiles: co,
1449
+ getSubmitData: Fa,
1450
+ clearTemplate: Ra,
1451
+ saveDraftCache: Vr,
1452
+ loadDraftCache: Hr,
1453
+ clearDraftCache: Ur,
1454
+ getDraftCacheStatus: _i,
1455
+ insertVariable: ma,
1456
+ insertImage: Gi,
1457
+ focus: go,
1458
+ openPreview: Na,
1459
+ closePreview: Pa,
1460
+ openSubmitDataViewer: Ia,
1461
+ closeSubmitDataViewer: La,
1462
+ setServerValidationErrors: mo,
1463
+ clearValidationErrors: ho,
1464
+ scrollToVariable: Ha,
1465
+ scrollToSigningPlacement: Ua,
1466
+ scrollToPage: Ga,
1467
+ setZoom: Da,
1468
+ resetZoom: Oa,
1469
+ getZoom: ka,
1470
+ fitWidth: wa,
1471
+ insertSigningPlacement: Nr,
1639
1472
  selectSigningPlacement: Q,
1640
- buildLocationRules: tc,
1641
- buildContractLocationRules: nc
1642
- }), (e, t) => (x(), m("div", {
1473
+ buildLocationRules: uo,
1474
+ buildContractLocationRules: fo
1475
+ }), (e, t) => (h(), St("div", {
1643
1476
  ref_key: "designerElement",
1644
- ref: jr,
1645
- class: b(["gd-contract-template-designer", {
1646
- "is-disabled": fe.disabled,
1647
- "is-readonly": H.value,
1648
- "is-fullscreen": di.value
1477
+ ref: Qt,
1478
+ class: Tt(["gd-contract-template-designer", {
1479
+ "is-disabled": s.disabled,
1480
+ "is-readonly": V.value,
1481
+ "is-fullscreen": Tn.value
1649
1482
  }]),
1650
- style: gt(Ar.value)
1483
+ style: Et(Zt.value)
1651
1484
  }, [
1652
- k.value ? (x(), f(lt, {
1485
+ y.value ? (h(), bt(dt, {
1653
1486
  key: 0,
1654
- files: A.value,
1655
- "active-file-id": j.value,
1656
- readonly: H.value,
1657
- onSelect: Gs,
1658
- onAdd: t[0] ||= (e) => Ws(),
1659
- onRename: Ks,
1660
- onRemove: Js,
1661
- onMove: Ys
1487
+ files: b.value,
1488
+ "active-file-id": x.value,
1489
+ readonly: V.value,
1490
+ onSelect: $a,
1491
+ onAdd: t[0] ||= (e) => Qa(),
1492
+ onRename: eo,
1493
+ onRemove: no,
1494
+ onMove: ro
1662
1495
  }, null, 8, [
1663
1496
  "files",
1664
1497
  "active-file-id",
1665
1498
  "readonly"
1666
- ])) : p("", !0),
1667
- h("div", { class: b(["gd-contract-template-designer__layout", {
1668
- "is-sidebar-collapsed": fi.value,
1669
- "is-inspector-collapsed": pi.value
1499
+ ])) : xt("", !0),
1500
+ Ct("div", { class: Tt(["gd-contract-template-designer__layout", {
1501
+ "is-sidebar-collapsed": En.value,
1502
+ "is-inspector-collapsed": Dn.value
1670
1503
  }]) }, [
1671
- _(ut, {
1672
- collapsed: fi.value,
1673
- pages: P.value.pages,
1674
- variables: P.value.variables,
1675
- "signing-placement-navigation-items": Ji.value,
1676
- "active-page-id": L.value,
1677
- "selected-variable-key": F.value,
1678
- "selected-signing-placement-id": I.value,
1679
- "normalized-max-pages": ga.value,
1680
- "page-limit-reached": _a.value,
1504
+ wt(ft, {
1505
+ collapsed: En.value,
1506
+ pages: w.value.pages,
1507
+ variables: w.value.variables,
1508
+ "decoration-variable-keys": Mr.value,
1509
+ "signing-placement-navigation-items": or.value,
1510
+ "active-page-id": D.value,
1511
+ "selected-variable-key": T.value,
1512
+ "selected-signing-placement-id": E.value,
1513
+ "normalized-max-pages": Ar.value,
1514
+ "page-limit-reached": jr.value,
1681
1515
  "selected-page": W.value,
1682
- "selected-page-size": Xi.value,
1683
- "normalized-page-size-options": ua.value,
1684
- "page-size-options": da.value,
1685
- "selected-page-size-option-value": fa.value,
1516
+ "selected-page-size": cr.value,
1517
+ "normalized-page-size-options": wr.value,
1518
+ "page-size-options": Tr.value,
1519
+ "selected-page-size-option-value": Er.value,
1686
1520
  "show-signing-placement-tools": l.showSigningPlacementTools,
1687
- readonly: H.value,
1688
- "get-page-size": X,
1689
- "get-page-signing-placements": Ya,
1690
- onToggle: t[1] ||= (e) => fi.value = !fi.value,
1691
- onAddPage: _o,
1692
- onActivatePage: Rs,
1693
- onDuplicatePage: vo,
1694
- onRemovePage: bo,
1695
- onPatchPageFormat: lo,
1696
- onScrollToVariable: Fs,
1697
- onScrollToSigningPlacement: Ls
1521
+ readonly: V.value,
1522
+ "get-page-size": Z,
1523
+ "get-page-signing-placements": Ci,
1524
+ onToggle: t[1] ||= (e) => En.value = !En.value,
1525
+ onAddPage: ji,
1526
+ onActivatePage: Wa,
1527
+ onDuplicatePage: Mi,
1528
+ onRemovePage: Pi,
1529
+ onPatchPageFormat: ki,
1530
+ onScrollToVariable: Va,
1531
+ onScrollToSigningPlacement: Ua
1698
1532
  }, null, 8, [
1699
1533
  "collapsed",
1700
1534
  "pages",
1701
1535
  "variables",
1536
+ "decoration-variable-keys",
1702
1537
  "signing-placement-navigation-items",
1703
1538
  "active-page-id",
1704
1539
  "selected-variable-key",
@@ -1713,749 +1548,182 @@ var dn = { class: "gd-contract-template-designer__workspace-header" }, fn = { cl
1713
1548
  "show-signing-placement-tools",
1714
1549
  "readonly"
1715
1550
  ]),
1716
- h("main", {
1551
+ Ct("main", {
1717
1552
  ref_key: "workspaceElement",
1718
- ref: Nr,
1553
+ ref: en,
1719
1554
  class: "gd-contract-template-designer__workspace"
1720
1555
  }, [
1721
- h("header", dn, [h("div", fn, [h("strong", null, C($i.value), 1), fe.showDraftCacheStatus && ea.value ? (x(), m("small", {
1722
- key: 0,
1723
- class: b(["gd-contract-template-designer__draft-cache-status", ta.value])
1724
- }, C(ea.value), 3)) : p("", !0)]), h("div", pn, [h("div", mn, [h("div", hn, [
1725
- _(w(D), { title: "缩小" }, {
1726
- default: T(() => [_(w(E), {
1727
- size: "small",
1728
- class: "gd-contract-template-designer__icon-button",
1729
- disabled: ui.value <= mr,
1730
- "aria-label": "缩小",
1731
- onClick: ws
1732
- }, {
1733
- default: T(() => [_(w(un), { "aria-hidden": "true" })]),
1734
- _: 1
1735
- }, 8, ["disabled"])]),
1736
- _: 1
1737
- }),
1738
- h("span", null, C(na.value), 1),
1739
- _(w(D), { title: "放大" }, {
1740
- default: T(() => [_(w(E), {
1741
- size: "small",
1742
- class: "gd-contract-template-designer__icon-button",
1743
- disabled: ui.value >= hr,
1744
- "aria-label": "放大",
1745
- onClick: Cs
1746
- }, {
1747
- default: T(() => [_(w(ln), { "aria-hidden": "true" })]),
1748
- _: 1
1749
- }, 8, ["disabled"])]),
1750
- _: 1
1751
- }),
1752
- _(w(D), { title: "适应宽度" }, {
1753
- default: T(() => [_(w(E), {
1754
- size: "small",
1755
- class: "gd-contract-template-designer__icon-button",
1756
- "aria-label": "适应宽度",
1757
- onClick: w(_s)
1758
- }, {
1759
- default: T(() => [_(w(zt), { "aria-hidden": "true" })]),
1760
- _: 1
1761
- }, 8, ["onClick"])]),
1762
- _: 1
1763
- }),
1764
- _(w(D), { title: "重置缩放" }, {
1765
- default: T(() => [_(w(E), {
1766
- size: "small",
1767
- class: "gd-contract-template-designer__icon-button",
1768
- "aria-label": "重置缩放",
1769
- onClick: xs
1770
- }, {
1771
- default: T(() => [_(w(nn), { "aria-hidden": "true" })]),
1772
- _: 1
1773
- })]),
1774
- _: 1
1775
- }),
1776
- _(w(D), { title: di.value ? "退出全屏" : "全屏显示" }, {
1777
- default: T(() => [_(w(E), {
1778
- size: "small",
1779
- class: "gd-contract-template-designer__icon-button",
1780
- "aria-label": di.value ? "退出全屏" : "全屏显示",
1781
- onClick: Es
1782
- }, {
1783
- default: T(() => [di.value ? (x(), f(w(Jt), {
1784
- key: 0,
1785
- "aria-hidden": "true"
1786
- })) : (x(), f(w(Yt), {
1787
- key: 1,
1788
- "aria-hidden": "true"
1789
- }))]),
1790
- _: 1
1791
- }, 8, ["aria-label"])]),
1792
- _: 1
1793
- }, 8, ["title"])
1794
- ])]), h("div", gn, [
1795
- fe.showClearButton ? (x(), f(w(D), {
1796
- key: 0,
1797
- title: "清空合同"
1798
- }, {
1799
- default: T(() => [_(w(E), {
1800
- size: "small",
1801
- danger: "",
1802
- class: "gd-contract-template-designer__icon-button",
1803
- disabled: H.value,
1804
- "aria-label": "清空合同",
1805
- onClick: Ns
1806
- }, {
1807
- default: T(() => [_(w(Ht), { "aria-hidden": "true" })]),
1808
- _: 1
1809
- }, 8, ["disabled"])]),
1810
- _: 1
1811
- })) : p("", !0),
1812
- _(w(D), { title: "校验" }, {
1813
- default: T(() => [_(w(E), {
1814
- size: "small",
1815
- class: "gd-contract-template-designer__icon-button",
1816
- "aria-label": "校验",
1817
- onClick: Xs
1818
- }, {
1819
- default: T(() => [_(w(It), { "aria-hidden": "true" })]),
1820
- _: 1
1821
- })]),
1822
- _: 1
1823
- }),
1824
- _(w(D), { title: "预览" }, {
1825
- default: T(() => [_(w(E), {
1826
- size: "small",
1827
- type: "primary",
1828
- class: "gd-contract-template-designer__icon-button",
1829
- "aria-label": "预览",
1830
- onClick: Ds
1831
- }, {
1832
- default: T(() => [_(w(Gt), { "aria-hidden": "true" })]),
1833
- _: 1
1834
- })]),
1835
- _: 1
1836
- }),
1837
- fe.showSubmitDataViewer ? (x(), f(w(D), {
1838
- key: 1,
1839
- title: "数据查看"
1840
- }, {
1841
- default: T(() => [_(w(E), {
1842
- size: "small",
1843
- class: "gd-contract-template-designer__icon-button",
1844
- "aria-label": "数据查看",
1845
- onClick: As
1846
- }, {
1847
- default: T(() => [_(w(Vt), { "aria-hidden": "true" })]),
1848
- _: 1
1849
- })]),
1850
- _: 1
1851
- })) : p("", !0)
1852
- ])])]),
1853
- h("header", _n, [h("div", {
1854
- ref_key: "toolbarMainElement",
1855
- ref: Pr,
1856
- class: "gd-contract-template-designer__toolbar-section gd-contract-template-designer__toolbar-section--main"
1857
- }, [
1858
- h("div", vn, [_(w(D), { title: "撤销" }, {
1859
- default: T(() => [_(w(E), {
1860
- size: "small",
1861
- class: "gd-contract-template-designer__icon-button",
1862
- disabled: H.value || !G.value.canUndo,
1863
- "aria-label": "撤销",
1864
- onClick: t[2] ||= (e) => J({ type: "undo" })
1865
- }, {
1866
- default: T(() => [_(w(sn), { "aria-hidden": "true" })]),
1867
- _: 1
1868
- }, 8, ["disabled"])]),
1869
- _: 1
1870
- }), _(w(D), { title: "重做" }, {
1871
- default: T(() => [_(w(E), {
1872
- size: "small",
1873
- class: "gd-contract-template-designer__icon-button",
1874
- disabled: H.value || !G.value.canRedo,
1875
- "aria-label": "重做",
1876
- onClick: t[3] ||= (e) => J({ type: "redo" })
1877
- }, {
1878
- default: T(() => [_(w(tn), { "aria-hidden": "true" })]),
1879
- _: 1
1880
- }, 8, ["disabled"])]),
1881
- _: 1
1882
- })]),
1883
- h("div", yn, [_(w(At), {
1884
- value: gi.value,
1885
- "onUpdate:value": t[4] ||= (e) => gi.value = e,
1886
- class: "gd-contract-template-designer__toolbar-select",
1887
- options: aa.value,
1888
- placeholder: "合同样式",
1889
- disabled: H.value,
1890
- onChange: _c
1891
- }, null, 8, [
1892
- "value",
1893
- "options",
1894
- "disabled"
1895
- ]), _(w(At), {
1896
- class: "gd-contract-template-designer__toolbar-select",
1897
- value: xa.value,
1898
- options: sa,
1899
- disabled: H.value,
1900
- onChange: cc
1901
- }, null, 8, ["value", "disabled"])]),
1902
- h("div", bn, [
1903
- _(w(D), { title: "加粗" }, {
1904
- default: T(() => [_(w(E), {
1905
- size: "small",
1906
- class: "gd-contract-template-designer__icon-button",
1907
- type: G.value.isBold ? "primary" : "default",
1908
- disabled: H.value,
1909
- "aria-label": "加粗",
1910
- onClick: t[5] ||= (e) => J({ type: "toggle-bold" })
1911
- }, {
1912
- default: T(() => [_(w(Lt), { "aria-hidden": "true" })]),
1913
- _: 1
1914
- }, 8, ["type", "disabled"])]),
1915
- _: 1
1916
- }),
1917
- _(w(D), { title: "斜体" }, {
1918
- default: T(() => [_(w(E), {
1919
- size: "small",
1920
- class: "gd-contract-template-designer__icon-button",
1921
- type: G.value.isItalic ? "primary" : "default",
1922
- disabled: H.value,
1923
- "aria-label": "斜体",
1924
- onClick: t[6] ||= (e) => J({ type: "toggle-italic" })
1925
- }, {
1926
- default: T(() => [_(w(Xt), { "aria-hidden": "true" })]),
1927
- _: 1
1928
- }, 8, ["type", "disabled"])]),
1929
- _: 1
1930
- }),
1931
- _(w(D), { title: "下划线" }, {
1932
- default: T(() => [_(w(E), {
1933
- size: "small",
1934
- class: "gd-contract-template-designer__icon-button",
1935
- type: G.value.isUnderline ? "primary" : "default",
1936
- disabled: H.value,
1937
- "aria-label": "下划线",
1938
- onClick: t[7] ||= (e) => J({ type: "toggle-underline" })
1939
- }, {
1940
- default: T(() => [_(w(on), { "aria-hidden": "true" })]),
1941
- _: 1
1942
- }, 8, ["type", "disabled"])]),
1943
- _: 1
1944
- }),
1945
- _(w(D), { title: "编号列表" }, {
1946
- default: T(() => [_(w(E), {
1947
- size: "small",
1948
- class: "gd-contract-template-designer__icon-button",
1949
- type: G.value.isOrderedList ? "primary" : "default",
1950
- disabled: H.value,
1951
- "aria-label": "编号列表",
1952
- onClick: t[8] ||= (e) => J({ type: "toggle-ordered-list" })
1953
- }, {
1954
- default: T(() => [_(w(Qt), { "aria-hidden": "true" })]),
1955
- _: 1
1956
- }, 8, ["type", "disabled"])]),
1957
- _: 1
1958
- }),
1959
- _(w(D), { title: "项目列表" }, {
1960
- default: T(() => [_(w(E), {
1961
- size: "small",
1962
- class: "gd-contract-template-designer__icon-button",
1963
- type: G.value.isBulletList ? "primary" : "default",
1964
- disabled: H.value,
1965
- "aria-label": "项目列表",
1966
- onClick: t[9] ||= (e) => J({ type: "toggle-bullet-list" })
1967
- }, {
1968
- default: T(() => [_(w(cn), { "aria-hidden": "true" })]),
1969
- _: 1
1970
- }, 8, ["type", "disabled"])]),
1971
- _: 1
1972
- })
1973
- ]),
1974
- (x(), f(ht, {
1975
- disabled: !ms("insert") || !Ir.value,
1976
- to: Ir.value || "body"
1977
- }, [h("div", xn, [
1978
- _(w(kt), {
1979
- open: bi.value,
1980
- "onUpdate:open": t[10] ||= (e) => bi.value = e,
1981
- trigger: "click",
1982
- placement: "bottom"
1983
- }, {
1984
- content: T(() => [h("div", Sn, [t[62] ||= h("strong", null, "插入正文控件", -1), h("div", Cn, [(x(!0), m(mt, null, yt(ha.value, (e) => (x(), f(w(D), {
1985
- key: e.type,
1986
- title: `插入${e.label}控件`
1987
- }, {
1988
- default: T(() => [h("button", {
1989
- type: "button",
1990
- class: "gd-contract-template-designer__text-menu-control-option",
1991
- "aria-label": `插入${e.label}控件`,
1992
- onClick: (t) => Fo(e.type)
1993
- }, [(x(), f(bt(e.icon), { "aria-hidden": "true" })), h("span", null, C(e.label), 1)], 8, wn)]),
1994
- _: 2
1995
- }, 1032, ["title"]))), 128))])])]),
1996
- default: T(() => [_(w(D), { title: "插入正文控件" }, {
1997
- default: T(() => [_(w(E), {
1998
- size: "small",
1999
- class: "gd-contract-template-designer__icon-button",
2000
- disabled: H.value,
2001
- "aria-label": "插入正文控件"
2002
- }, {
2003
- default: T(() => [_(w(en), { "aria-hidden": "true" })]),
2004
- _: 1
2005
- }, 8, ["disabled"])]),
2006
- _: 1
2007
- })]),
2008
- _: 1
2009
- }, 8, ["open"]),
2010
- _(w(kt), {
2011
- open: xi.value,
2012
- "onUpdate:open": t[14] ||= (e) => xi.value = e,
2013
- trigger: "click",
2014
- placement: "bottom"
2015
- }, {
2016
- content: T(() => [h("div", Tn, [
2017
- t[67] ||= h("strong", null, "插入正文图片", -1),
2018
- _(w(E), {
2019
- block: "",
2020
- loading: Ei.value,
2021
- disabled: H.value,
2022
- onClick: Mo
2023
- }, {
2024
- default: T(() => [_(w($t), { "aria-hidden": "true" }), t[63] ||= g(" 本地图片 ", -1)]),
2025
- _: 1
2026
- }, 8, ["loading", "disabled"]),
2027
- _(w(Et), {
2028
- value: Si.value,
2029
- "onUpdate:value": t[11] ||= (e) => Si.value = e,
2030
- "allow-clear": "",
2031
- disabled: H.value || Ei.value,
2032
- placeholder: "https:// 或 data:image/...",
2033
- "aria-label": "图片 URL",
2034
- onPressEnter: Po
2035
- }, null, 8, ["value", "disabled"]),
2036
- h("div", En, [h("label", null, [t[64] ||= h("span", null, "宽度", -1), _(w(Dt), {
2037
- value: Ci.value,
2038
- "onUpdate:value": t[12] ||= (e) => Ci.value = e,
2039
- min: w(16),
2040
- max: w(Me),
2041
- disabled: H.value || Ei.value,
2042
- placeholder: "自然",
2043
- "aria-label": "图片宽度"
2044
- }, null, 8, [
2045
- "value",
2046
- "min",
2047
- "max",
2048
- "disabled"
2049
- ])]), h("label", null, [t[65] ||= h("span", null, "高度", -1), _(w(Dt), {
2050
- value: wi.value,
2051
- "onUpdate:value": t[13] ||= (e) => wi.value = e,
2052
- min: w(16),
2053
- max: w(Me),
2054
- disabled: H.value || Ei.value,
2055
- placeholder: "自然",
2056
- "aria-label": "图片高度"
2057
- }, null, 8, [
2058
- "value",
2059
- "min",
2060
- "max",
2061
- "disabled"
2062
- ])])]),
2063
- _(w(E), {
2064
- type: "primary",
2065
- block: "",
2066
- disabled: H.value || Ei.value || !Si.value.trim(),
2067
- onClick: Po
2068
- }, {
2069
- default: T(() => [...t[66] ||= [g(" 插入 URL ", -1)]]),
2070
- _: 1
2071
- }, 8, ["disabled"]),
2072
- Ti.value ? (x(), f(w(Tt), {
2073
- key: 0,
2074
- type: "error",
2075
- "show-icon": "",
2076
- message: Ti.value
2077
- }, null, 8, ["message"])) : p("", !0)
2078
- ])]),
2079
- default: T(() => [_(w(D), { title: "插入图片" }, {
2080
- default: T(() => [_(w(E), {
2081
- size: "small",
2082
- class: "gd-contract-template-designer__icon-button",
2083
- disabled: H.value,
2084
- "aria-label": "插入图片"
2085
- }, {
2086
- default: T(() => [_(w($t), { "aria-hidden": "true" })]),
2087
- _: 1
2088
- }, 8, ["disabled"])]),
2089
- _: 1
2090
- })]),
2091
- _: 1
2092
- }, 8, ["open"]),
2093
- _(w(D), { title: "插入分隔线" }, {
2094
- default: T(() => [_(w(E), {
2095
- size: "small",
2096
- class: "gd-contract-template-designer__icon-button",
2097
- disabled: H.value,
2098
- "aria-label": "插入分隔线",
2099
- onClick: t[15] ||= (e) => J({ type: "insert-horizontal-rule" })
2100
- }, {
2101
- default: T(() => [_(w(Zt), { "aria-hidden": "true" })]),
2102
- _: 1
2103
- }, 8, ["disabled"])]),
2104
- _: 1
2105
- }),
2106
- _(w(D), { title: _a.value ? `已达 ${ga.value} 页上限` : "新增页面" }, {
2107
- default: T(() => [_(w(E), {
2108
- size: "small",
2109
- class: "gd-contract-template-designer__icon-button",
2110
- disabled: H.value || _a.value,
2111
- "aria-label": "新增页面",
2112
- onClick: _o
2113
- }, {
2114
- default: T(() => [_(w(Kt), { "aria-hidden": "true" })]),
2115
- _: 1
2116
- }, 8, ["disabled"])]),
2117
- _: 1
2118
- }, 8, ["title"])
2119
- ])], 8, ["disabled", "to"])),
2120
- (x(), f(ht, {
2121
- disabled: !ms("typography") || !Lr.value,
2122
- to: Lr.value || "body"
2123
- }, [h("div", Dn, [
2124
- _(w(At), {
2125
- class: "gd-contract-template-designer__toolbar-select is-wide",
2126
- value: Sa.value,
2127
- options: ia.value,
2128
- disabled: H.value,
2129
- onChange: uc
2130
- }, null, 8, [
2131
- "value",
2132
- "options",
2133
- "disabled"
2134
- ]),
2135
- _(w(At), {
2136
- class: "gd-contract-template-designer__toolbar-select",
2137
- value: Ca.value,
2138
- options: Ea.value,
2139
- "show-search": "",
2140
- "filter-option": !1,
2141
- "search-value": _i.value,
2142
- disabled: H.value,
2143
- onBlur: mc,
2144
- onChange: lc,
2145
- onDropdownVisibleChange: gc,
2146
- onInputKeyDown: hc,
2147
- onSearch: pc
2148
- }, null, 8, [
2149
- "value",
2150
- "options",
2151
- "search-value",
2152
- "disabled"
2153
- ]),
2154
- h("input", {
2155
- class: "gd-contract-template-designer__color",
2156
- type: "color",
2157
- value: wa.value,
2158
- disabled: H.value,
2159
- onInput: dc
2160
- }, null, 40, On),
2161
- _(w(D), { title: "左对齐" }, {
2162
- default: T(() => [_(w(E), {
2163
- size: "small",
2164
- class: b(["gd-contract-template-designer__icon-button", { "is-selected": G.value.textAlign === "left" }]),
2165
- type: G.value.textAlign === "left" ? "primary" : "default",
2166
- disabled: H.value,
2167
- "aria-label": "左对齐",
2168
- onClick: t[16] ||= (e) => sc("left")
2169
- }, {
2170
- default: T(() => [_(w(Pt), { "aria-hidden": "true" })]),
2171
- _: 1
2172
- }, 8, [
2173
- "class",
2174
- "type",
2175
- "disabled"
2176
- ])]),
2177
- _: 1
2178
- }),
2179
- _(w(D), { title: "居中对齐" }, {
2180
- default: T(() => [_(w(E), {
2181
- size: "small",
2182
- class: b(["gd-contract-template-designer__icon-button", { "is-selected": G.value.textAlign === "center" }]),
2183
- type: G.value.textAlign === "center" ? "primary" : "default",
2184
- disabled: H.value,
2185
- "aria-label": "居中对齐",
2186
- onClick: t[17] ||= (e) => sc("center")
2187
- }, {
2188
- default: T(() => [_(w(Nt), { "aria-hidden": "true" })]),
2189
- _: 1
2190
- }, 8, [
2191
- "class",
2192
- "type",
2193
- "disabled"
2194
- ])]),
2195
- _: 1
2196
- }),
2197
- _(w(D), { title: "右对齐" }, {
2198
- default: T(() => [_(w(E), {
2199
- size: "small",
2200
- class: b(["gd-contract-template-designer__icon-button", { "is-selected": G.value.textAlign === "right" }]),
2201
- type: G.value.textAlign === "right" ? "primary" : "default",
2202
- disabled: H.value,
2203
- "aria-label": "右对齐",
2204
- onClick: t[18] ||= (e) => sc("right")
2205
- }, {
2206
- default: T(() => [_(w(Ft), { "aria-hidden": "true" })]),
2207
- _: 1
2208
- }, 8, [
2209
- "class",
2210
- "type",
2211
- "disabled"
2212
- ])]),
2213
- _: 1
2214
- })
2215
- ])], 8, ["disabled", "to"])),
2216
- (x(), f(ht, {
2217
- disabled: !ms("cleanup") || !Rr.value,
2218
- to: Rr.value || "body"
2219
- }, [h("div", kn, [_(w(D), { title: "清文字" }, {
2220
- default: T(() => [_(w(E), {
2221
- size: "small",
2222
- class: "gd-contract-template-designer__icon-button",
2223
- disabled: H.value,
2224
- "aria-label": "清文字",
2225
- onClick: t[19] ||= (e) => J({ type: "clear-text-format" })
2226
- }, {
2227
- default: T(() => [_(w(Rt), { "aria-hidden": "true" })]),
2228
- _: 1
2229
- }, 8, ["disabled"])]),
2230
- _: 1
2231
- }), _(w(D), { title: "清段落" }, {
2232
- default: T(() => [_(w(E), {
2233
- size: "small",
2234
- class: "gd-contract-template-designer__icon-button",
2235
- disabled: H.value,
2236
- "aria-label": "清段落",
2237
- onClick: t[20] ||= (e) => J({ type: "clear-block-format" })
2238
- }, {
2239
- default: T(() => [_(w(qt), { "aria-hidden": "true" })]),
2240
- _: 1
2241
- }, 8, ["disabled"])]),
2242
- _: 1
2243
- })])], 8, ["disabled", "to"])),
2244
- (x(), f(ht, {
2245
- disabled: !ms("table") || !zr.value,
2246
- to: zr.value || "body"
2247
- }, [h("div", An, [_(w(kt), {
2248
- open: vi.value,
2249
- "onUpdate:open": t[24] ||= (e) => vi.value = e,
2250
- trigger: "click",
2251
- placement: "bottom"
2252
- }, {
2253
- content: T(() => [h("div", jn, [
2254
- t[69] ||= h("strong", null, "插入表格", -1),
2255
- _(Be, {
2256
- disabled: H.value,
2257
- onSelect: t[21] ||= (e) => Ac(e.rows, e.cols),
2258
- onClose: t[22] ||= (e) => vi.value = !1
2259
- }, null, 8, ["disabled"]),
2260
- h("label", Mn, [t[68] ||= h("span", null, "表头行", -1), _(w(jt), {
2261
- checked: Ii.value.withHeaderRow,
2262
- "onUpdate:checked": t[23] ||= (e) => Ii.value.withHeaderRow = e,
2263
- disabled: H.value
2264
- }, null, 8, ["checked", "disabled"])])
2265
- ])]),
2266
- default: T(() => [_(w(D), { title: "插入表格" }, {
2267
- default: T(() => [_(w(E), {
2268
- size: "small",
2269
- class: "gd-contract-template-designer__icon-button",
2270
- disabled: H.value,
2271
- "aria-label": "插入表格"
2272
- }, {
2273
- default: T(() => [_(w(an), { "aria-hidden": "true" })]),
2274
- _: 1
2275
- }, 8, ["disabled"])]),
2276
- _: 1
2277
- })]),
2278
- _: 1
2279
- }, 8, ["open"]), _(w(kt), {
2280
- open: yi.value,
2281
- "onUpdate:open": t[34] ||= (e) => yi.value = e,
2282
- trigger: "click",
2283
- placement: "bottom"
2284
- }, {
2285
- content: T(() => [h("div", Nn, [t[79] ||= h("strong", null, "表格操作", -1), h("div", Pn, [
2286
- _(w(E), {
2287
- size: "small",
2288
- disabled: H.value,
2289
- onClick: t[25] ||= (e) => Ic("add-table-row-before")
2290
- }, {
2291
- default: T(() => [...t[70] ||= [g(" 上方插行 ", -1)]]),
2292
- _: 1
2293
- }, 8, ["disabled"]),
2294
- _(w(E), {
2295
- size: "small",
2296
- disabled: H.value,
2297
- onClick: t[26] ||= (e) => Ic("add-table-row-after")
2298
- }, {
2299
- default: T(() => [...t[71] ||= [g(" 下方插行 ", -1)]]),
2300
- _: 1
2301
- }, 8, ["disabled"]),
2302
- _(w(E), {
2303
- size: "small",
2304
- disabled: H.value,
2305
- onClick: t[27] ||= (e) => Ic("add-table-column-before")
2306
- }, {
2307
- default: T(() => [...t[72] ||= [g(" 左侧插列 ", -1)]]),
2308
- _: 1
2309
- }, 8, ["disabled"]),
2310
- _(w(E), {
2311
- size: "small",
2312
- disabled: H.value,
2313
- onClick: t[28] ||= (e) => Ic("add-table-column-after")
2314
- }, {
2315
- default: T(() => [...t[73] ||= [g(" 右侧插列 ", -1)]]),
2316
- _: 1
2317
- }, 8, ["disabled"]),
2318
- _(w(E), {
2319
- size: "small",
2320
- disabled: H.value,
2321
- onClick: t[29] ||= (e) => Ic("delete-table-row")
2322
- }, {
2323
- default: T(() => [...t[74] ||= [g(" 删除当前行 ", -1)]]),
2324
- _: 1
2325
- }, 8, ["disabled"]),
2326
- _(w(E), {
2327
- size: "small",
2328
- disabled: H.value,
2329
- onClick: t[30] ||= (e) => Ic("delete-table-column")
2330
- }, {
2331
- default: T(() => [...t[75] ||= [g(" 删除当前列 ", -1)]]),
2332
- _: 1
2333
- }, 8, ["disabled"]),
2334
- _(w(E), {
2335
- size: "small",
2336
- disabled: H.value,
2337
- onClick: t[31] ||= (e) => Ic("toggle-table-header-row")
2338
- }, {
2339
- default: T(() => [...t[76] ||= [g(" 切换表头行 ", -1)]]),
2340
- _: 1
2341
- }, 8, ["disabled"]),
2342
- _(w(E), {
2343
- size: "small",
2344
- disabled: H.value,
2345
- onClick: t[32] ||= (e) => Ic("toggle-table-header-column")
2346
- }, {
2347
- default: T(() => [...t[77] ||= [g(" 切换表头列 ", -1)]]),
2348
- _: 1
2349
- }, 8, ["disabled"]),
2350
- _(w(E), {
2351
- danger: "",
2352
- size: "small",
2353
- disabled: H.value,
2354
- onClick: t[33] ||= (e) => Ic("delete-table")
2355
- }, {
2356
- default: T(() => [...t[78] ||= [g(" 删除表格 ", -1)]]),
2357
- _: 1
2358
- }, 8, ["disabled"])
2359
- ])])]),
2360
- default: T(() => [_(w(D), { title: "表格操作" }, {
2361
- default: T(() => [_(w(E), {
2362
- size: "small",
2363
- class: "gd-contract-template-designer__icon-button",
2364
- disabled: H.value || !G.value.isTableActive,
2365
- "aria-label": "表格操作"
2366
- }, {
2367
- default: T(() => [_(w(an), { "aria-hidden": "true" })]),
2368
- _: 1
2369
- }, 8, ["disabled"])]),
2370
- _: 1
2371
- })]),
2372
- _: 1
2373
- }, 8, ["open"])])], 8, ["disabled", "to"])),
2374
- Ct(h("div", {
2375
- ref_key: "toolbarMoreElement",
2376
- ref: Fr,
2377
- class: "gd-contract-template-designer__toolbar-more"
2378
- }, [_(w(D), { title: "更多工具" }, {
2379
- default: T(() => [_(w(E), {
2380
- size: "small",
2381
- class: b(["gd-contract-template-designer__icon-button", { "is-selected": mi.value }]),
2382
- "aria-label": "更多工具",
2383
- "aria-haspopup": "true",
2384
- "aria-expanded": mi.value,
2385
- onClick: t[35] ||= wt((e) => mi.value = !mi.value, ["stop"])
2386
- }, {
2387
- default: T(() => [_(w(Wt), { "aria-hidden": "true" })]),
2388
- _: 1
2389
- }, 8, ["class", "aria-expanded"])]),
2390
- _: 1
2391
- }), Ct(h("div", Fn, [
2392
- Ct(h("div", In, [t[80] ||= h("span", { class: "gd-contract-template-designer__toolbar-more-title" }, "插入", -1), h("div", {
2393
- ref_key: "toolbarInsertSlotElement",
2394
- ref: Ir,
2395
- class: "gd-contract-template-designer__toolbar-more-slot"
2396
- }, null, 512)], 512), [[xt, ms("insert")]]),
2397
- Ct(h("div", Ln, [t[81] ||= h("span", { class: "gd-contract-template-designer__toolbar-more-title" }, "文字排版", -1), h("div", {
2398
- ref_key: "toolbarTypographySlotElement",
2399
- ref: Lr,
2400
- class: "gd-contract-template-designer__toolbar-more-slot"
2401
- }, null, 512)], 512), [[xt, ms("typography")]]),
2402
- Ct(h("div", Rn, [t[82] ||= h("span", { class: "gd-contract-template-designer__toolbar-more-title" }, "清除格式", -1), h("div", {
2403
- ref_key: "toolbarCleanupSlotElement",
2404
- ref: Rr,
2405
- class: "gd-contract-template-designer__toolbar-more-slot"
2406
- }, null, 512)], 512), [[xt, ms("cleanup")]]),
2407
- Ct(h("div", zn, [t[83] ||= h("span", { class: "gd-contract-template-designer__toolbar-more-title" }, "表格", -1), h("div", {
2408
- ref_key: "toolbarTableSlotElement",
2409
- ref: zr,
2410
- class: "gd-contract-template-designer__toolbar-more-slot"
2411
- }, null, 512)], 512), [[xt, ms("table")]])
2412
- ], 512), [[xt, mi.value]])], 512), [[xt, ps.value]])
2413
- ], 512)]),
2414
- ei.value ? (x(), m("section", Bn, [_(w(Tt), {
2415
- type: Zi.value ? "success" : "error",
2416
- message: Qi.value,
1556
+ wt(ze, {
1557
+ ref_key: "workspaceHeaderElement",
1558
+ ref: tn,
1559
+ summary: dr.value,
1560
+ "draft-cache-status-text": hr.value,
1561
+ "draft-cache-status-class": gr.value,
1562
+ "show-draft-cache-status": s.showDraftCacheStatus,
1563
+ "show-clear-button": s.showClearButton,
1564
+ "show-submit-data-viewer": s.showSubmitDataViewer,
1565
+ readonly: V.value,
1566
+ "zoom-percent": _r.value,
1567
+ "zoom-out-disabled": M.value <= Vt,
1568
+ "zoom-in-disabled": M.value >= Ht,
1569
+ "is-fullscreen": Tn.value,
1570
+ "page-decorations-open": N.value,
1571
+ "page-decorations-studio-id": rn,
1572
+ "page-decorations-preset-label": fr.value,
1573
+ "page-decorations-enabled-count": mr.value,
1574
+ "page-decorations-enabled-states": pr.value,
1575
+ onZoomOut: ja,
1576
+ onZoomIn: Aa,
1577
+ onFitWidth: _(wa),
1578
+ onResetZoom: Oa,
1579
+ onToggleFullscreen: Ma,
1580
+ onClear: za,
1581
+ onValidate: io,
1582
+ onPreview: Na,
1583
+ onSubmitData: Ia,
1584
+ onTogglePageDecorations: Ka
1585
+ }, null, 8, [
1586
+ "summary",
1587
+ "draft-cache-status-text",
1588
+ "draft-cache-status-class",
1589
+ "show-draft-cache-status",
1590
+ "show-clear-button",
1591
+ "show-submit-data-viewer",
1592
+ "readonly",
1593
+ "zoom-percent",
1594
+ "zoom-out-disabled",
1595
+ "zoom-in-disabled",
1596
+ "is-fullscreen",
1597
+ "page-decorations-open",
1598
+ "page-decorations-preset-label",
1599
+ "page-decorations-enabled-count",
1600
+ "page-decorations-enabled-states",
1601
+ "onFitWidth"
1602
+ ]),
1603
+ wt(Be, {
1604
+ "variable-insert-popover-open": Mn.value,
1605
+ "onUpdate:variableInsertPopoverOpen": t[2] ||= (e) => Mn.value = e,
1606
+ "image-insert-popover-open": Nn.value,
1607
+ "onUpdate:imageInsertPopoverOpen": t[3] ||= (e) => Nn.value = e,
1608
+ "image-insert-url": Pn.value,
1609
+ "onUpdate:imageInsertUrl": t[4] ||= (e) => Pn.value = e,
1610
+ "image-insert-width": Fn.value,
1611
+ "onUpdate:imageInsertWidth": t[5] ||= (e) => Fn.value = e,
1612
+ "image-insert-height": In.value,
1613
+ "onUpdate:imageInsertHeight": t[6] ||= (e) => In.value = e,
1614
+ "table-insert-popover-open": P.value,
1615
+ "onUpdate:tableInsertPopoverOpen": t[7] ||= (e) => P.value = e,
1616
+ "table-actions-popover-open": F.value,
1617
+ "onUpdate:tableActionsPopoverOpen": t[8] ||= (e) => F.value = e,
1618
+ "table-insert-draft": Kn.value,
1619
+ "onUpdate:tableInsertDraft": t[9] ||= (e) => Kn.value = e,
1620
+ "toolbar-more-open": kn.value,
1621
+ "onUpdate:toolbarMoreOpen": t[10] ||= (e) => kn.value = e,
1622
+ readonly: V.value,
1623
+ "editor-state": Zr.value,
1624
+ "current-block-format": Qr.value,
1625
+ "block-format-options": xr,
1626
+ "font-family-select-options": yr.value,
1627
+ "current-editor-font-family": $r.value,
1628
+ "font-size-preset-options": ri.value,
1629
+ "current-editor-font-size": ei.value,
1630
+ "editor-font-size-search-value": jn.value,
1631
+ "current-editor-text-color": ti.value,
1632
+ "body-control-tool-items": kr.value,
1633
+ "page-limit-reached": jr.value,
1634
+ "normalized-max-pages": Ar.value,
1635
+ "image-processing": Rn.value,
1636
+ "image-insert-error": Ln.value,
1637
+ onCommand: t[11] ||= (e) => X(e),
1638
+ onPatchBlockFormat: vo,
1639
+ onPatchFontFamily: bo,
1640
+ onPatchFontSize: yo,
1641
+ onPatchColor: xo,
1642
+ onPatchTextAlign: _o,
1643
+ onInsertVariable: Yi,
1644
+ onOpenImageFile: Ki,
1645
+ onInsertImageUrl: Ji,
1646
+ onAddPage: ji,
1647
+ onInsertTable: Vo,
1648
+ onTableAction: qo,
1649
+ onFontSizeSearch: Co,
1650
+ onFontSizeCommit: wo,
1651
+ onFontSizeDropdownChange: Eo,
1652
+ onFontSizeKeydown: To
1653
+ }, null, 8, [
1654
+ "variable-insert-popover-open",
1655
+ "image-insert-popover-open",
1656
+ "image-insert-url",
1657
+ "image-insert-width",
1658
+ "image-insert-height",
1659
+ "table-insert-popover-open",
1660
+ "table-actions-popover-open",
1661
+ "table-insert-draft",
1662
+ "toolbar-more-open",
1663
+ "readonly",
1664
+ "editor-state",
1665
+ "current-block-format",
1666
+ "font-family-select-options",
1667
+ "current-editor-font-family",
1668
+ "font-size-preset-options",
1669
+ "current-editor-font-size",
1670
+ "editor-font-size-search-value",
1671
+ "current-editor-text-color",
1672
+ "body-control-tool-items",
1673
+ "page-limit-reached",
1674
+ "normalized-max-pages",
1675
+ "image-processing",
1676
+ "image-insert-error"
1677
+ ]),
1678
+ O.value ? (h(), St("section", Lt, [wt(_(Pt), {
1679
+ type: lr.value ? "success" : "error",
1680
+ message: ur.value,
2417
1681
  "show-icon": ""
2418
- }, null, 8, ["type", "message"]), ti.value.length ? (x(), m("div", Vn, [(x(!0), m(mt, null, yt(ti.value, (e) => (x(), m("button", {
1682
+ }, null, 8, ["type", "message"]), k.value.length ? (h(), St("div", Rt, [(h(!0), St(vt, null, kt(k.value, (e) => (h(), St("button", {
2419
1683
  key: `${e.id}-${e.message}`,
2420
1684
  type: "button",
2421
1685
  class: "gd-contract-template-designer__validation-item",
2422
- onClick: (t) => Zs(e)
2423
- }, [h("span", null, C(e.message), 1), h("small", null, C(e.type === "signing-placement" ? "签署位置" : e.type === "variable" ? "变量" : "字段"), 1)], 8, Hn))), 128))])) : p("", !0)])) : p("", !0),
2424
- h("div", {
1686
+ onClick: (t) => ao(e)
1687
+ }, [Ct("span", null, At(e.message), 1), Ct("small", null, At(oo(e)), 1)], 8, zt))), 128))])) : xt("", !0)])) : xt("", !0),
1688
+ Ct("div", {
2425
1689
  ref_key: "canvasElement",
2426
- ref: Mr,
1690
+ ref: $t,
2427
1691
  class: "gd-contract-template-designer__canvas"
2428
- }, [(x(!0), m(mt, null, yt(P.value.pages, (e, n) => (x(), f(Le, {
2429
- key: `${j.value}:${e.id}`,
1692
+ }, [(h(!0), St(vt, null, kt(w.value.pages, (e, n) => (h(), bt(Le, {
1693
+ key: `${x.value}:${e.id}`,
2430
1694
  ref_for: !0,
2431
- ref: (t) => Ga(e.id, t),
1695
+ ref: (t) => vi(e.id, t),
2432
1696
  page: e,
2433
1697
  "page-index": n,
2434
- "page-size": X(e),
2435
- variables: P.value.variables,
2436
- "selected-variable-key": F.value,
2437
- "signing-placements": l.showSigningPlacementTools ? Ya(e.id) : [],
2438
- "selected-signing-placement-id": I.value,
2439
- active: L.value === e.id,
2440
- readonly: fe.readonly,
2441
- disabled: fe.disabled,
2442
- zoom: ui.value,
2443
- "process-image-file": Ao,
2444
- onPageUpdate: Ja,
2445
- onVariableDrop: Lo,
2446
- onVariableSelect: Ro,
2447
- onSigningPlacementDrop: no,
2448
- onSigningPlacementSelect: Za,
2449
- onSigningPlacementMove: ao,
2450
- onSigningPlacementRemove: co,
2451
- onEditorFocus: t[36] ||= (e) => Rs(e, !1),
2452
- onEditorStateChange: kc,
2453
- onEditorContextMenu: Tc,
2454
- onVariableMoveBlocked: t[37] ||= (e) => Pi.value = "变量只能在当前页内移动,跨页移动尚未支持。"
1698
+ "page-size": Z(e),
1699
+ "page-decorations": w.value.pageDecorations,
1700
+ "total-pages": w.value.pages.length,
1701
+ variables: w.value.variables,
1702
+ "selected-variable-key": T.value,
1703
+ "signing-placements": l.showSigningPlacementTools ? Ci(e.id) : [],
1704
+ "selected-signing-placement-id": E.value,
1705
+ active: D.value === e.id,
1706
+ readonly: s.readonly,
1707
+ disabled: s.disabled,
1708
+ zoom: M.value,
1709
+ "process-image-file": Wi,
1710
+ onPageUpdate: Si,
1711
+ onVariableDrop: Zi,
1712
+ onVariableSelect: Qi,
1713
+ onSigningPlacementDrop: _(Pr),
1714
+ onSigningPlacementSelect: Ti,
1715
+ onSigningPlacementMove: _(Lr),
1716
+ onSigningPlacementRemove: _(Br),
1717
+ onEditorFocus: t[12] ||= (e) => Wa(e, !1),
1718
+ onEditorStateChange: Bo,
1719
+ onEditorContextMenu: Po,
1720
+ onVariableMoveBlocked: t[13] ||= (e) => z.value = "变量只能在当前页内移动,跨页移动尚未支持。"
2455
1721
  }, null, 8, [
2456
1722
  "page",
2457
1723
  "page-index",
2458
1724
  "page-size",
1725
+ "page-decorations",
1726
+ "total-pages",
2459
1727
  "variables",
2460
1728
  "selected-variable-key",
2461
1729
  "signing-placements",
@@ -2463,51 +1731,79 @@ var dn = { class: "gd-contract-template-designer__workspace-header" }, fn = { cl
2463
1731
  "active",
2464
1732
  "readonly",
2465
1733
  "disabled",
2466
- "zoom"
2467
- ]))), 128))], 512)
1734
+ "zoom",
1735
+ "onSigningPlacementDrop",
1736
+ "onSigningPlacementMove",
1737
+ "onSigningPlacementRemove"
1738
+ ]))), 128))], 512),
1739
+ Nt(wt(mt, {
1740
+ ref_key: "pageDecorationsStudioElement",
1741
+ ref: nn,
1742
+ id: rn,
1743
+ open: N.value,
1744
+ decorations: w.value.pageDecorations,
1745
+ variables: w.value.variables,
1746
+ "font-family-options": yr.value,
1747
+ readonly: s.readonly,
1748
+ disabled: s.disabled,
1749
+ "active-tab": On.value,
1750
+ "onUpdate:activeTab": t[14] ||= (e) => On.value = e,
1751
+ onChange: na,
1752
+ onClose: qa
1753
+ }, null, 8, [
1754
+ "open",
1755
+ "decorations",
1756
+ "variables",
1757
+ "font-family-options",
1758
+ "readonly",
1759
+ "disabled",
1760
+ "active-tab"
1761
+ ]), [[Mt, N.value]])
2468
1762
  ], 512),
2469
- _(dt, {
2470
- collapsed: pi.value,
2471
- readonly: fe.readonly,
2472
- disabled: fe.disabled,
1763
+ wt(pt, {
1764
+ collapsed: Dn.value,
1765
+ readonly: s.readonly,
1766
+ disabled: s.disabled,
2473
1767
  "show-signing-placement-tools": l.showSigningPlacementTools,
2474
- "body-control-tool-items": ha.value,
2475
- "signing-placement-tools": pa.value,
1768
+ "body-control-tool-items": kr.value,
1769
+ "signing-placement-tools": Dr.value,
2476
1770
  "signing-placements": U.value,
2477
- "selected-signing-placement": qi.value,
2478
- "selected-signing-placement-page-size": Yi.value,
2479
- "selected-variable": Ui.value,
2480
- "current-variable-font-family": Ta.value,
2481
- "font-family-select-options": ia.value,
2482
- "text-align-options": w(oa),
2483
- "border-style-options": ca,
2484
- "object-fit-options": la,
2485
- "selected-variable-width-max": ya.value,
2486
- "selected-variable-height-max": ba.value,
2487
- "min-font-size": xr,
2488
- "max-font-size": Sr,
2489
- "default-multiline-rows": w(3),
2490
- "resolve-signing-placement-type-icon": w(ct),
2491
- "signing-placement-type-labels": w(r),
2492
- onToggle: t[38] ||= (e) => pi.value = !pi.value,
2493
- onVariableDragStart: as,
2494
- onInsertVariable: $o,
2495
- onSigningPlacementDragStart: io,
2496
- onInsertSigningPlacement: ro,
2497
- onPatchSigningPlacement: oo,
2498
- onDuplicateSigningPlacement: t[39] ||= (e) => so(),
2499
- onRemoveSigningPlacement: t[40] ||= (e) => co(),
2500
- onDuplicateVariable: Zo,
2501
- onRemoveVariable: Yo,
2502
- onPatchVariable: Bo,
2503
- onPatchStyle: Wo,
2504
- onPatchMultiline: qo,
2505
- onPatchRows: Jo,
2506
- onPatchFontFamily: Go,
2507
- onPatchFontSize: Ko,
2508
- onPatchTextAlign: Vo,
2509
- onPatchBorderStyle: Ho,
2510
- onPatchObjectFit: Uo
1771
+ "selected-signing-placement": ar.value,
1772
+ "selected-signing-placement-page-size": sr.value,
1773
+ "selected-variable": H.value,
1774
+ variables: w.value.variables,
1775
+ "current-variable-font-family": ni.value,
1776
+ "font-family-select-options": yr.value,
1777
+ "text-align-options": _(br),
1778
+ "border-style-options": Sr,
1779
+ "object-fit-options": Cr,
1780
+ "selected-variable-width-max": Yr.value,
1781
+ "selected-variable-height-max": Xr.value,
1782
+ "min-font-size": Yt,
1783
+ "max-font-size": Xt,
1784
+ "default-multiline-rows": _(3),
1785
+ "resolve-signing-placement-type-icon": _(ut),
1786
+ "signing-placement-type-labels": _(n),
1787
+ onToggle: t[15] ||= (e) => Dn.value = !Dn.value,
1788
+ onVariableDragStart: xa,
1789
+ onInsertVariable: ha,
1790
+ onSigningPlacementDragStart: _(Ir),
1791
+ onInsertSigningPlacement: _(Fr),
1792
+ onPatchSigningPlacement: _(Rr),
1793
+ onDuplicateSigningPlacement: t[16] ||= (e) => _(zr)(),
1794
+ onRemoveSigningPlacement: t[17] ||= (e) => _(Br)(),
1795
+ onDuplicateVariable: pa,
1796
+ onRemoveVariable: da,
1797
+ onPatchVariable: ea,
1798
+ onRenameVariable: ta,
1799
+ onPatchStyle: oa,
1800
+ onPatchMultiline: la,
1801
+ onPatchRows: ua,
1802
+ onPatchFontFamily: sa,
1803
+ onPatchFontSize: ca,
1804
+ onPatchTextAlign: ra,
1805
+ onPatchBorderStyle: ia,
1806
+ onPatchObjectFit: aa
2511
1807
  }, null, 8, [
2512
1808
  "collapsed",
2513
1809
  "readonly",
@@ -2519,6 +1815,7 @@ var dn = { class: "gd-contract-template-designer__workspace-header" }, fn = { cl
2519
1815
  "selected-signing-placement",
2520
1816
  "selected-signing-placement-page-size",
2521
1817
  "selected-variable",
1818
+ "variables",
2522
1819
  "current-variable-font-family",
2523
1820
  "font-family-select-options",
2524
1821
  "text-align-options",
@@ -2526,455 +1823,143 @@ var dn = { class: "gd-contract-template-designer__workspace-header" }, fn = { cl
2526
1823
  "selected-variable-height-max",
2527
1824
  "default-multiline-rows",
2528
1825
  "resolve-signing-placement-type-icon",
2529
- "signing-placement-type-labels"
1826
+ "signing-placement-type-labels",
1827
+ "onSigningPlacementDragStart",
1828
+ "onInsertSigningPlacement",
1829
+ "onPatchSigningPlacement"
2530
1830
  ])
2531
1831
  ], 2),
2532
- (x(), f(ht, { to: "body" }, [
2533
- B.value ? (x(), f(ze, {
1832
+ (h(), bt(yt, { to: "body" }, [
1833
+ L.value ? (h(), bt(Re, {
2534
1834
  key: 0,
2535
1835
  ref_key: "tableContextMenuElement",
2536
- ref: Ai,
2537
- capabilities: B.value.capabilities,
2538
- "active-alignment": B.value.activeAlignment,
2539
- style: gt({
2540
- left: `${B.value.x}px`,
2541
- top: `${B.value.y}px`
1836
+ ref: Hn,
1837
+ capabilities: L.value.capabilities,
1838
+ "active-alignment": L.value.activeAlignment,
1839
+ style: Et({
1840
+ left: `${L.value.x}px`,
1841
+ top: `${L.value.y}px`
2542
1842
  }),
2543
- onExecute: Mc,
2544
- onKeydown: Nc
1843
+ onExecute: Uo,
1844
+ onKeydown: Wo
2545
1845
  }, null, 8, [
2546
1846
  "capabilities",
2547
1847
  "active-alignment",
2548
1848
  "style"
2549
- ])) : p("", !0),
2550
- V.value ? (x(), m("div", {
1849
+ ])) : xt("", !0),
1850
+ R.value ? (h(), bt(He, {
2551
1851
  key: 1,
2552
1852
  ref_key: "imageContextMenuElement",
2553
- ref: ji,
2554
- class: "gd-contract-template-designer__context-menu gd-contract-template-designer__image-context-menu",
2555
- style: gt({
2556
- left: `${V.value.x}px`,
2557
- top: `${V.value.y}px`
2558
- }),
2559
- role: "dialog",
2560
- "aria-label": "图片尺寸",
2561
- onKeydown: Fc
2562
- }, [
2563
- t[88] ||= h("div", { class: "gd-contract-template-designer__image-context-title" }, [h("strong", null, "图片尺寸"), h("span", null, "单位:px;留空可恢复自然尺寸")], -1),
2564
- h("div", Un, [h("label", null, [t[84] ||= h("span", null, "宽度", -1), _(w(Dt), {
2565
- value: Mi.value,
2566
- "onUpdate:value": t[41] ||= (e) => Mi.value = e,
2567
- min: w(16),
2568
- max: w(Me),
2569
- disabled: H.value,
2570
- placeholder: "自然",
2571
- "aria-label": "图片宽度"
2572
- }, null, 8, [
2573
- "value",
2574
- "min",
2575
- "max",
2576
- "disabled"
2577
- ])]), h("label", null, [t[85] ||= h("span", null, "高度", -1), _(w(Dt), {
2578
- value: Ni.value,
2579
- "onUpdate:value": t[42] ||= (e) => Ni.value = e,
2580
- min: w(16),
2581
- max: w(Me),
2582
- disabled: H.value,
2583
- placeholder: "自然",
2584
- "aria-label": "图片高度"
2585
- }, null, 8, [
2586
- "value",
2587
- "min",
2588
- "max",
2589
- "disabled"
2590
- ])])]),
2591
- h("div", Wn, [_(w(E), {
2592
- size: "small",
2593
- onClick: wc
2594
- }, {
2595
- default: T(() => [...t[86] ||= [g("恢复自然尺寸", -1)]]),
2596
- _: 1
2597
- }), _(w(E), {
2598
- size: "small",
2599
- type: "primary",
2600
- onClick: Cc
2601
- }, {
2602
- default: T(() => [...t[87] ||= [g("应用", -1)]]),
2603
- _: 1
2604
- })])
2605
- ], 36)) : p("", !0),
2606
- z.value ? (x(), m("div", {
1853
+ ref: Un,
1854
+ width: Wn.value,
1855
+ "onUpdate:width": t[18] ||= (e) => Wn.value = e,
1856
+ height: Gn.value,
1857
+ "onUpdate:height": t[19] ||= (e) => Gn.value = e,
1858
+ x: R.value.x,
1859
+ y: R.value.y,
1860
+ readonly: V.value,
1861
+ onRestore: No,
1862
+ onApply: Mo,
1863
+ onKeydown: Ko
1864
+ }, null, 8, [
1865
+ "width",
1866
+ "height",
1867
+ "x",
1868
+ "y",
1869
+ "readonly"
1870
+ ])) : xt("", !0),
1871
+ I.value ? (h(), bt(Ve, {
2607
1872
  key: 2,
2608
1873
  ref_key: "textContextMenuElement",
2609
- ref: Di,
2610
- class: "gd-contract-template-designer__context-menu gd-contract-template-designer__text-context-menu",
2611
- style: gt({
2612
- left: `${z.value.x}px`,
2613
- top: `${z.value.y}px`
2614
- }),
2615
- role: "toolbar",
2616
- "aria-label": "正文快捷操作",
2617
- onKeydown: Pc
2618
- }, [
2619
- h("div", Gn, [
2620
- _(w(D), { title: "撤销" }, {
2621
- default: T(() => [_(w(E), {
2622
- size: "small",
2623
- class: "gd-contract-template-designer__text-menu-icon-button",
2624
- disabled: !G.value.canUndo,
2625
- "aria-label": "撤销",
2626
- onClick: t[43] ||= (e) => Y({ type: "undo" })
2627
- }, {
2628
- default: T(() => [_(w(sn), { "aria-hidden": "true" })]),
2629
- _: 1
2630
- }, 8, ["disabled"])]),
2631
- _: 1
2632
- }),
2633
- _(w(D), { title: "重做" }, {
2634
- default: T(() => [_(w(E), {
2635
- size: "small",
2636
- class: "gd-contract-template-designer__text-menu-icon-button",
2637
- disabled: !G.value.canRedo,
2638
- "aria-label": "重做",
2639
- onClick: t[44] ||= (e) => Y({ type: "redo" })
2640
- }, {
2641
- default: T(() => [_(w(tn), { "aria-hidden": "true" })]),
2642
- _: 1
2643
- }, 8, ["disabled"])]),
2644
- _: 1
2645
- }),
2646
- t[89] ||= h("span", {
2647
- class: "gd-contract-template-designer__text-menu-divider",
2648
- "aria-hidden": "true"
2649
- }, null, -1),
2650
- z.value.hasSelection ? (x(), f(w(D), {
2651
- key: 0,
2652
- title: "复制"
2653
- }, {
2654
- default: T(() => [_(w(E), {
2655
- size: "small",
2656
- class: "gd-contract-template-designer__text-menu-icon-button",
2657
- "aria-label": "复制",
2658
- onClick: t[45] ||= (e) => Ka("copy")
2659
- }, {
2660
- default: T(() => [_(w(Bt), { "aria-hidden": "true" })]),
2661
- _: 1
2662
- })]),
2663
- _: 1
2664
- })) : p("", !0),
2665
- z.value.hasSelection ? (x(), f(w(D), {
2666
- key: 1,
2667
- title: "剪切"
2668
- }, {
2669
- default: T(() => [_(w(E), {
2670
- size: "small",
2671
- class: "gd-contract-template-designer__text-menu-icon-button",
2672
- "aria-label": "剪切",
2673
- onClick: t[46] ||= (e) => Ka("cut")
2674
- }, {
2675
- default: T(() => [_(w(rn), { "aria-hidden": "true" })]),
2676
- _: 1
2677
- })]),
2678
- _: 1
2679
- })) : p("", !0),
2680
- _(w(D), { title: "粘贴" }, {
2681
- default: T(() => [_(w(E), {
2682
- size: "small",
2683
- class: "gd-contract-template-designer__text-menu-icon-button",
2684
- "aria-label": "粘贴",
2685
- onClick: t[47] ||= (e) => Ka("paste")
2686
- }, {
2687
- default: T(() => [_(w(Bt), { "aria-hidden": "true" })]),
2688
- _: 1
2689
- })]),
2690
- _: 1
2691
- })
2692
- ]),
2693
- z.value.hasSelection ? p("", !0) : (x(), m("div", Kn, [
2694
- _(w(E), {
2695
- size: "small",
2696
- onClick: Mo
2697
- }, {
2698
- default: T(() => [_(w($t), { "aria-hidden": "true" }), t[90] ||= h("span", null, "图片", -1)]),
2699
- _: 1
2700
- }),
2701
- _(w(E), {
2702
- size: "small",
2703
- onClick: t[48] ||= (e) => Y({
2704
- type: "insert-table",
2705
- options: Ii.value
2706
- })
2707
- }, {
2708
- default: T(() => [_(w(an), { "aria-hidden": "true" }), t[91] ||= h("span", null, "表格", -1)]),
2709
- _: 1
2710
- }),
2711
- _(w(E), {
2712
- size: "small",
2713
- onClick: t[49] ||= (e) => Y({ type: "insert-horizontal-rule" })
2714
- }, {
2715
- default: T(() => [_(w(Zt), { "aria-hidden": "true" }), t[92] ||= h("span", null, "分隔线", -1)]),
2716
- _: 1
2717
- }),
2718
- _(w(E), {
2719
- size: "small",
2720
- disabled: _a.value,
2721
- onClick: Io
2722
- }, {
2723
- default: T(() => [_(w(Kt), { "aria-hidden": "true" }), t[93] ||= h("span", null, "新页面", -1)]),
2724
- _: 1
2725
- }, 8, ["disabled"]),
2726
- _(w(E), {
2727
- size: "small",
2728
- onClick: t[50] ||= (e) => Y({ type: "select-all" })
2729
- }, {
2730
- default: T(() => [...t[94] ||= [h("span", null, "全选正文", -1)]]),
2731
- _: 1
2732
- })
2733
- ])),
2734
- h("div", qn, [
2735
- _(w(At), {
2736
- class: "gd-contract-template-designer__context-menu-field gd-contract-template-designer__text-menu-font-size",
2737
- value: Ca.value,
2738
- options: Ea.value,
2739
- "show-search": "",
2740
- "filter-option": !1,
2741
- "search-value": _i.value,
2742
- onBlur: mc,
2743
- onChange: lc,
2744
- onDropdownVisibleChange: gc,
2745
- onInputKeyDown: hc,
2746
- onSearch: pc
2747
- }, null, 8, [
2748
- "value",
2749
- "options",
2750
- "search-value"
2751
- ]),
2752
- _(w(At), {
2753
- class: "gd-contract-template-designer__context-menu-field gd-contract-template-designer__text-menu-alignment",
2754
- value: G.value.textAlign,
2755
- options: w(oa),
2756
- onChange: sc
2757
- }, null, 8, ["value", "options"]),
2758
- _(w(D), { title: "文字颜色" }, {
2759
- default: T(() => [h("input", {
2760
- class: "gd-contract-template-designer__context-menu-color",
2761
- type: "color",
2762
- "aria-label": "文字颜色",
2763
- value: wa.value,
2764
- onInput: t[51] ||= (e) => fc(e.target.value)
2765
- }, null, 40, Jn)]),
2766
- _: 1
2767
- })
2768
- ]),
2769
- h("div", {
2770
- class: "gd-contract-template-designer__text-menu-control-group",
2771
- role: "group",
2772
- "aria-label": z.value.hasSelection ? "转换为正文控件" : "插入正文控件"
2773
- }, [
2774
- h("div", Xn, [h("strong", null, C(z.value.hasSelection ? "转换为正文控件" : "插入正文控件"), 1), h("span", null, C(z.value.hasSelection ? "替换选中内容" : "在光标处插入"), 1)]),
2775
- h("div", Zn, [(x(!0), m(mt, null, yt(ha.value, (e) => (x(), f(w(D), {
2776
- key: e.type,
2777
- title: z.value.hasSelection ? `转换为${e.label}控件` : `插入${e.label}控件`
2778
- }, {
2779
- default: T(() => [h("button", {
2780
- type: "button",
2781
- class: "gd-contract-template-designer__text-menu-control-option",
2782
- "aria-label": z.value.hasSelection ? `转换为${e.label}控件` : `插入${e.label}控件`,
2783
- onClick: (t) => es(e.type)
2784
- }, [(x(), f(bt(e.icon), { "aria-hidden": "true" })), h("span", null, C(e.label), 1)], 8, Qn)]),
2785
- _: 2
2786
- }, 1032, ["title"]))), 128))]),
2787
- Oi.value ? (x(), m(mt, { key: 1 }, [_(w(Et), {
2788
- value: ki.value,
2789
- "onUpdate:value": t[52] ||= (e) => ki.value = e,
2790
- class: "gd-contract-template-designer__text-menu-bind-search",
2791
- size: "small",
2792
- "allow-clear": "",
2793
- placeholder: "搜索已有控件",
2794
- "aria-label": "搜索已有控件"
2795
- }, null, 8, ["value"]), h("div", er, [(x(!0), m(mt, null, yt(va.value, (e) => (x(), m("button", {
2796
- key: e.id,
2797
- type: "button",
2798
- class: "gd-contract-template-designer__text-menu-bind-item",
2799
- role: "option",
2800
- onClick: (t) => ns(e)
2801
- }, [h("span", nr, C(e.label), 1), h("span", rr, C(rs(e)) + " · " + C(e.key), 1)], 8, tr))), 128)), va.value.length ? p("", !0) : (x(), m("p", ir, " 暂无已有控件 "))])], 64)) : (x(), m("button", {
2802
- key: 0,
2803
- type: "button",
2804
- class: "gd-contract-template-designer__text-menu-bind-toggle",
2805
- disabled: !P.value.variables.length,
2806
- "aria-expanded": !1,
2807
- "aria-label": "绑定已有控件",
2808
- onClick: is
2809
- }, [t[95] ||= h("span", null, "绑定已有", -1), _(w(Ut), { "aria-hidden": "true" })], 8, $n))
2810
- ], 8, Yn),
2811
- h("div", ar, [
2812
- _(w(D), { title: "加粗" }, {
2813
- default: T(() => [_(w(E), {
2814
- size: "small",
2815
- class: b(["gd-contract-template-designer__text-menu-icon-button", { "is-selected": G.value.isBold }]),
2816
- "aria-pressed": G.value.isBold,
2817
- "aria-label": "加粗",
2818
- onClick: t[53] ||= (e) => Y({ type: "toggle-bold" })
2819
- }, {
2820
- default: T(() => [_(w(Lt), { "aria-hidden": "true" })]),
2821
- _: 1
2822
- }, 8, ["class", "aria-pressed"])]),
2823
- _: 1
2824
- }),
2825
- _(w(D), { title: "斜体" }, {
2826
- default: T(() => [_(w(E), {
2827
- size: "small",
2828
- class: b(["gd-contract-template-designer__text-menu-icon-button", { "is-selected": G.value.isItalic }]),
2829
- "aria-pressed": G.value.isItalic,
2830
- "aria-label": "斜体",
2831
- onClick: t[54] ||= (e) => Y({ type: "toggle-italic" })
2832
- }, {
2833
- default: T(() => [_(w(Xt), { "aria-hidden": "true" })]),
2834
- _: 1
2835
- }, 8, ["class", "aria-pressed"])]),
2836
- _: 1
2837
- }),
2838
- _(w(D), { title: "下划线" }, {
2839
- default: T(() => [_(w(E), {
2840
- size: "small",
2841
- class: b(["gd-contract-template-designer__text-menu-icon-button", { "is-selected": G.value.isUnderline }]),
2842
- "aria-pressed": G.value.isUnderline,
2843
- "aria-label": "下划线",
2844
- onClick: t[55] ||= (e) => Y({ type: "toggle-underline" })
2845
- }, {
2846
- default: T(() => [_(w(on), { "aria-hidden": "true" })]),
2847
- _: 1
2848
- }, 8, ["class", "aria-pressed"])]),
2849
- _: 1
2850
- }),
2851
- t[96] ||= h("span", {
2852
- class: "gd-contract-template-designer__text-menu-divider",
2853
- "aria-hidden": "true"
2854
- }, null, -1),
2855
- _(w(D), { title: "有序列表" }, {
2856
- default: T(() => [_(w(E), {
2857
- size: "small",
2858
- class: b(["gd-contract-template-designer__text-menu-icon-button", { "is-selected": G.value.isOrderedList }]),
2859
- "aria-pressed": G.value.isOrderedList,
2860
- "aria-label": "有序列表",
2861
- onClick: t[56] ||= (e) => Y({ type: "toggle-ordered-list" })
2862
- }, {
2863
- default: T(() => [_(w(Qt), { "aria-hidden": "true" })]),
2864
- _: 1
2865
- }, 8, ["class", "aria-pressed"])]),
2866
- _: 1
2867
- }),
2868
- _(w(D), { title: "无序列表" }, {
2869
- default: T(() => [_(w(E), {
2870
- size: "small",
2871
- class: b(["gd-contract-template-designer__text-menu-icon-button", { "is-selected": G.value.isBulletList }]),
2872
- "aria-pressed": G.value.isBulletList,
2873
- "aria-label": "无序列表",
2874
- onClick: t[57] ||= (e) => Y({ type: "toggle-bullet-list" })
2875
- }, {
2876
- default: T(() => [_(w(cn), { "aria-hidden": "true" })]),
2877
- _: 1
2878
- }, 8, ["class", "aria-pressed"])]),
2879
- _: 1
2880
- })
2881
- ]),
2882
- h("div", or, [_(w(D), { title: "清除文字格式" }, {
2883
- default: T(() => [_(w(E), {
2884
- size: "small",
2885
- class: "gd-contract-template-designer__text-menu-clear-action",
2886
- "aria-label": "清除文字格式",
2887
- onClick: t[58] ||= (e) => Y({ type: "clear-text-format" })
2888
- }, {
2889
- default: T(() => [_(w(Rt), { "aria-hidden": "true" }), t[97] ||= h("span", null, "清文字", -1)]),
2890
- _: 1
2891
- })]),
2892
- _: 1
2893
- }), _(w(D), { title: "清除段落格式" }, {
2894
- default: T(() => [_(w(E), {
2895
- size: "small",
2896
- class: "gd-contract-template-designer__text-menu-clear-action",
2897
- "aria-label": "清除段落格式",
2898
- onClick: t[59] ||= (e) => Y({ type: "clear-block-format" })
2899
- }, {
2900
- default: T(() => [_(w(qt), { "aria-hidden": "true" }), t[98] ||= h("span", null, "清段落", -1)]),
2901
- _: 1
2902
- })]),
2903
- _: 1
2904
- })])
2905
- ], 36)) : p("", !0)
1874
+ ref: zn,
1875
+ "bind-open": Bn.value,
1876
+ "onUpdate:bindOpen": t[20] ||= (e) => Bn.value = e,
1877
+ "bind-keyword": Vn.value,
1878
+ "onUpdate:bindKeyword": t[21] ||= (e) => Vn.value = e,
1879
+ x: I.value.x,
1880
+ y: I.value.y,
1881
+ "has-selection": I.value.hasSelection,
1882
+ "editor-state": Zr.value,
1883
+ "font-size-preset-options": ri.value,
1884
+ "current-editor-font-size": ei.value,
1885
+ "editor-font-size-search-value": jn.value,
1886
+ "text-align-options": _(br),
1887
+ "current-editor-text-color": ti.value,
1888
+ "body-control-tool-items": kr.value,
1889
+ "text-menu-bindable-variables": Jr.value,
1890
+ "page-limit-reached": jr.value,
1891
+ "table-insert-draft": Kn.value,
1892
+ "variables-count": w.value.variables.length,
1893
+ "resolve-bind-variable-type-label": ya,
1894
+ onCommand: yi,
1895
+ onClipboard: bi,
1896
+ onOpenImage: Ki,
1897
+ onAddPage: Xi,
1898
+ onInsertVariable: ga,
1899
+ onBindVariable: va,
1900
+ onOpenBindPanel: ba,
1901
+ onKeydown: Go,
1902
+ onPatchFontSize: yo,
1903
+ onPatchTextAlign: _o,
1904
+ onPatchColor: So,
1905
+ onFontSizeSearch: Co,
1906
+ onFontSizeCommit: wo,
1907
+ onFontSizeDropdownChange: Eo,
1908
+ onFontSizeKeydown: To
1909
+ }, null, 8, [
1910
+ "bind-open",
1911
+ "bind-keyword",
1912
+ "x",
1913
+ "y",
1914
+ "has-selection",
1915
+ "editor-state",
1916
+ "font-size-preset-options",
1917
+ "current-editor-font-size",
1918
+ "editor-font-size-search-value",
1919
+ "text-align-options",
1920
+ "current-editor-text-color",
1921
+ "body-control-tool-items",
1922
+ "text-menu-bindable-variables",
1923
+ "page-limit-reached",
1924
+ "table-insert-draft",
1925
+ "variables-count"
1926
+ ])) : xt("", !0)
2906
1927
  ])),
2907
- h("input", {
1928
+ Ct("input", {
2908
1929
  ref_key: "imageFileInputElement",
2909
- ref: Br,
1930
+ ref: an,
2910
1931
  class: "gd-contract-template-designer__hidden-file-input",
2911
1932
  type: "file",
2912
1933
  accept: "image/png,image/jpeg,image/webp,image/gif,image/bmp",
2913
1934
  tabindex: "-1",
2914
1935
  "aria-hidden": "true",
2915
- onChange: No
1936
+ onChange: qi
2916
1937
  }, null, 544),
2917
- h("span", sr, C(Pi.value), 1),
2918
- _(w(Ot), {
2919
- open: ii.value,
2920
- "onUpdate:open": t[60] ||= (e) => ii.value = e,
2921
- title: "模板预览",
2922
- width: "min(1440px, calc(100vw - 32px))",
2923
- centered: "",
2924
- footer: null,
2925
- "wrap-class-name": "gd-contract-template-designer__preview-modal",
2926
- onCancel: Os
2927
- }, {
2928
- default: T(() => [h("div", { class: b(["gd-contract-template-designer__preview", { "is-multi-file": Gi.value.length > 0 }]) }, [Gi.value.length ? (x(), m("div", cr, [h("nav", lr, [t[99] ||= h("span", { class: "gd-contract-template-designer__preview-file-nav-title" }, "合同文件", -1), (x(!0), m(mt, null, yt(Gi.value, (e) => (x(), m("button", {
2929
- key: e.file.id,
2930
- type: "button",
2931
- class: b(["gd-contract-template-designer__preview-file-tab", { "is-active": e.file.id === Ki.value?.file.id }]),
2932
- "aria-current": e.file.id === Ki.value?.file.id ? "page" : void 0,
2933
- onClick: (t) => si.value = e.file.id
2934
- }, [
2935
- _(w(Kt), { "aria-hidden": "true" }),
2936
- h("span", null, C(e.file.name), 1),
2937
- h("small", null, C(e.pages.length) + " 页", 1)
2938
- ], 10, ur))), 128))]), Ki.value ? (x(), m("section", dr, [h("h3", fr, C(Ki.value.file.name), 1), (x(!0), m(mt, null, yt(Ki.value.pages, (e) => (x(), f(Re, {
2939
- key: `${Ki.value.file.id}:${e.page.id}`,
2940
- page: e.page,
2941
- "fallback-page-size": Ki.value.file.template.pageSize,
2942
- "content-html": e.contentHtml,
2943
- "signing-placements": e.signingPlacements
2944
- }, null, 8, [
2945
- "page",
2946
- "fallback-page-size",
2947
- "content-html",
2948
- "signing-placements"
2949
- ]))), 128))])) : p("", !0)])) : (x(!0), m(mt, { key: 1 }, yt(Wi.value, (e) => (x(), f(Re, {
2950
- key: e.page.id,
2951
- page: e.page,
2952
- "fallback-page-size": ai.value?.pageSize ?? w(pe),
2953
- "content-html": e.contentHtml,
2954
- "signing-placements": e.signingPlacements
2955
- }, null, 8, [
2956
- "page",
2957
- "fallback-page-size",
2958
- "content-html",
2959
- "signing-placements"
2960
- ]))), 128))], 2)]),
2961
- _: 1
2962
- }, 8, ["open"]),
2963
- _(w(Ot), {
2964
- open: ci.value,
2965
- "onUpdate:open": t[61] ||= (e) => ci.value = e,
2966
- title: "提交数据查看",
2967
- width: "min(960px, calc(100vw - 48px))",
2968
- centered: "",
2969
- footer: null,
2970
- "wrap-class-name": "gd-contract-template-designer__submit-data-modal",
2971
- onCancel: js
2972
- }, {
2973
- default: T(() => [h("pre", pr, C(li.value), 1)]),
2974
- _: 1
2975
- }, 8, ["open"])
1938
+ Ct("span", Bt, At(z.value), 1),
1939
+ wt(Ue, {
1940
+ open: bn.value,
1941
+ "onUpdate:open": t[22] ||= (e) => bn.value = e,
1942
+ "preview-pages": nr.value,
1943
+ "preview-file-groups": rr.value,
1944
+ "preview-active-group": ir.value,
1945
+ "preview-snapshot": j.value,
1946
+ onCancel: Pa,
1947
+ onSelectFile: t[23] ||= (e) => Sn.value = e
1948
+ }, null, 8, [
1949
+ "open",
1950
+ "preview-pages",
1951
+ "preview-file-groups",
1952
+ "preview-active-group",
1953
+ "preview-snapshot"
1954
+ ]),
1955
+ wt(We, {
1956
+ open: Cn.value,
1957
+ "onUpdate:open": t[24] ||= (e) => Cn.value = e,
1958
+ json: wn.value,
1959
+ onCancel: La
1960
+ }, null, 8, ["open", "json"])
2976
1961
  ], 6));
2977
1962
  }
2978
1963
  });
2979
1964
  //#endregion
2980
- export { Ar as default };
1965
+ export { Zt as default };