@guodun/antdv 1.2.5 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/components/contract-signing-location/index.mjs +11 -0
- package/dist/es/components/contract-signing-location/src/ContractSigningLocation.mjs +5 -0
- package/dist/es/components/contract-signing-location/src/ContractSigningLocation.vue.mjs +551 -0
- package/dist/es/components/contract-signing-location/src/ContractSigningLocationCanvas.mjs +5 -0
- package/dist/es/components/contract-signing-location/src/ContractSigningLocationCanvas.vue.mjs +612 -0
- package/dist/es/components/contract-signing-location/src/ContractSigningLocationInspector.mjs +5 -0
- package/dist/es/components/contract-signing-location/src/ContractSigningLocationInspector.vue.mjs +228 -0
- package/dist/es/components/contract-signing-location/src/ContractSigningLocationNavigator.mjs +5 -0
- package/dist/es/components/contract-signing-location/src/ContractSigningLocationNavigator.vue.mjs +71 -0
- package/dist/es/components/contract-signing-location/src/constants.mjs +42 -0
- package/dist/es/components/contract-signing-location/src/coordinates.mjs +182 -0
- package/dist/es/components/contract-signing-location/src/icons.mjs +114 -0
- package/dist/es/components/contract-signing-location/src/location-rules.mjs +296 -0
- package/dist/es/components/contract-signing-location/src/page-layout.mjs +115 -0
- package/dist/es/components/contract-signing-location/src/preview-requests.mjs +25 -0
- package/dist/es/components/contract-signing-location/src/style/index.mjs +1 -0
- package/dist/es/components/contract-signing-location/src/types.mjs +0 -0
- package/dist/es/components/contract-signing-location/style/index.css +1 -0
- package/dist/es/components/contract-signing-location/style/index.mjs +1 -0
- package/dist/es/components/index.mjs +12 -0
- package/dist/es/components/pro-contract-signing-flow/index.mjs +9 -0
- package/dist/es/components/pro-contract-signing-flow/src/ContractSigningFlowCanvas.mjs +5 -0
- package/dist/es/components/pro-contract-signing-flow/src/ContractSigningFlowCanvas.vue.mjs +74 -0
- package/dist/es/components/pro-contract-signing-flow/src/ContractSigningFlowInspector.mjs +5 -0
- package/dist/es/components/pro-contract-signing-flow/src/ContractSigningFlowInspector.vue.mjs +338 -0
- package/dist/es/components/pro-contract-signing-flow/src/ContractSigningFlowNodeCard.mjs +5 -0
- package/dist/es/components/pro-contract-signing-flow/src/ContractSigningFlowNodeCard.vue.mjs +115 -0
- package/dist/es/components/pro-contract-signing-flow/src/ProContractSigningFlow.mjs +5 -0
- package/dist/es/components/pro-contract-signing-flow/src/ProContractSigningFlow.vue.mjs +152 -0
- package/dist/es/components/pro-contract-signing-flow/src/composables/use-contract-signing-flow.mjs +365 -0
- package/dist/es/components/pro-contract-signing-flow/src/constants.mjs +48 -0
- package/dist/es/components/pro-contract-signing-flow/src/types.mjs +0 -0
- package/dist/es/components/pro-contract-signing-flow/style/index.css +1 -0
- package/dist/es/components/pro-contract-signing-flow/style/index.mjs +1 -0
- package/dist/es/components/pro-contract-template-designer/index.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePreviewPage.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePreviewPage.vue.mjs +43 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePreviewSigningLayer.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePreviewSigningLayer.vue.mjs +42 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateRendererField.vue.mjs +88 -78
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateRendererHeader.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateRendererHeader.vue.mjs +169 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateRendererToolbar.vue.mjs +18 -7
- package/dist/es/components/pro-contract-template-designer/src/DesignerPage.vue.mjs +522 -318
- package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.mjs +2440 -1166
- package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue.mjs +320 -198
- package/dist/es/components/pro-contract-template-designer/src/SigningPlacementInspector.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/SigningPlacementInspector.vue.mjs +142 -0
- package/dist/es/components/pro-contract-template-designer/src/SigningPlacementLayer.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/SigningPlacementLayer.vue.mjs +134 -0
- package/dist/es/components/pro-contract-template-designer/src/TableContextMenu.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/TableContextMenu.vue.mjs +189 -0
- package/dist/es/components/pro-contract-template-designer/src/TableSizePicker.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/TableSizePicker.vue.mjs +117 -0
- package/dist/es/components/pro-contract-template-designer/src/composables/use-fit-width-zoom.mjs +33 -0
- package/dist/es/components/pro-contract-template-designer/src/composables/use-template-designer.mjs +334 -322
- package/dist/es/components/pro-contract-template-designer/src/composables/use-template-draft-cache.mjs +1 -1
- package/dist/es/components/pro-contract-template-designer/src/extensions/ContentImageNodeView.mjs +7 -0
- package/dist/es/components/pro-contract-template-designer/src/extensions/ContentImageNodeView.vue.mjs +213 -0
- package/dist/es/components/pro-contract-template-designer/src/extensions/ContentImageNodeView.vue_vue_type_style_index_0_scoped_8082f8b4_lang.css +1 -0
- package/dist/es/components/pro-contract-template-designer/src/extensions/editor-extensions.mjs +62 -27
- package/dist/es/components/pro-contract-template-designer/src/extensions/office-content.mjs +241 -0
- package/dist/es/components/pro-contract-template-designer/src/extensions/template-variable.mjs +56 -119
- package/dist/es/components/pro-contract-template-designer/src/extensions/word-paste.mjs +145 -0
- package/dist/es/components/pro-contract-template-designer/src/types.mjs +13 -0
- package/dist/es/components/pro-contract-template-designer/src/utils/content-image.mjs +171 -0
- package/dist/es/components/pro-contract-template-designer/src/utils/context-variable.mjs +17 -0
- package/dist/es/components/pro-contract-template-designer/src/utils/html.mjs +59 -0
- package/dist/es/components/pro-contract-template-designer/src/utils/image-url.mjs +44 -0
- package/dist/es/components/pro-contract-template-designer/src/utils/signing-placement.mjs +292 -0
- package/dist/es/components/pro-contract-template-designer/src/utils/template-renderer.mjs +124 -167
- package/dist/es/components/pro-contract-template-designer/src/utils/template-tool-icons.mjs +28 -0
- package/dist/es/components/pro-contract-template-designer/src/utils/template-variable-render.mjs +1 -1
- package/dist/es/components/pro-contract-template-designer/src/utils/word-paste.mjs +737 -0
- package/dist/es/components/pro-contract-template-designer/style/index.css +1 -1
- package/dist/es/index.mjs +75 -63
- package/dist/lib/components/contract-signing-location/index.cjs +1 -0
- package/dist/lib/components/contract-signing-location/src/ContractSigningLocation.cjs +1 -0
- package/dist/lib/components/contract-signing-location/src/ContractSigningLocation.vue.cjs +1 -0
- package/dist/lib/components/contract-signing-location/src/ContractSigningLocationCanvas.cjs +1 -0
- package/dist/lib/components/contract-signing-location/src/ContractSigningLocationCanvas.vue.cjs +1 -0
- package/dist/lib/components/contract-signing-location/src/ContractSigningLocationInspector.cjs +1 -0
- package/dist/lib/components/contract-signing-location/src/ContractSigningLocationInspector.vue.cjs +1 -0
- package/dist/lib/components/contract-signing-location/src/ContractSigningLocationNavigator.cjs +1 -0
- package/dist/lib/components/contract-signing-location/src/ContractSigningLocationNavigator.vue.cjs +1 -0
- package/dist/lib/components/contract-signing-location/src/constants.cjs +1 -0
- package/dist/lib/components/contract-signing-location/src/coordinates.cjs +1 -0
- package/dist/lib/components/contract-signing-location/src/icons.cjs +1 -0
- package/dist/lib/components/contract-signing-location/src/location-rules.cjs +1 -0
- package/dist/lib/components/contract-signing-location/src/page-layout.cjs +1 -0
- package/dist/lib/components/contract-signing-location/src/preview-requests.cjs +1 -0
- package/dist/lib/components/contract-signing-location/src/style/index.cjs +1 -0
- package/dist/lib/components/contract-signing-location/src/types.cjs +0 -0
- package/dist/lib/components/contract-signing-location/style/index.cjs +1 -0
- package/dist/lib/components/contract-signing-location/style/index.css +1 -0
- package/dist/lib/components/index.cjs +1 -1
- package/dist/lib/components/pro-contract-signing-flow/index.cjs +1 -0
- package/dist/lib/components/pro-contract-signing-flow/src/ContractSigningFlowCanvas.cjs +1 -0
- package/dist/lib/components/pro-contract-signing-flow/src/ContractSigningFlowCanvas.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-signing-flow/src/ContractSigningFlowInspector.cjs +1 -0
- package/dist/lib/components/pro-contract-signing-flow/src/ContractSigningFlowInspector.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-signing-flow/src/ContractSigningFlowNodeCard.cjs +1 -0
- package/dist/lib/components/pro-contract-signing-flow/src/ContractSigningFlowNodeCard.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-signing-flow/src/ProContractSigningFlow.cjs +1 -0
- package/dist/lib/components/pro-contract-signing-flow/src/ProContractSigningFlow.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-signing-flow/src/composables/use-contract-signing-flow.cjs +1 -0
- package/dist/lib/components/pro-contract-signing-flow/src/constants.cjs +1 -0
- package/dist/lib/components/pro-contract-signing-flow/src/types.cjs +0 -0
- package/dist/lib/components/pro-contract-signing-flow/style/index.cjs +1 -0
- package/dist/lib/components/pro-contract-signing-flow/style/index.css +1 -0
- package/dist/lib/components/pro-contract-template-designer/index.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePreviewPage.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePreviewPage.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePreviewSigningLayer.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePreviewSigningLayer.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateRendererField.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateRendererHeader.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateRendererHeader.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateRendererToolbar.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/DesignerPage.vue.cjs +2 -2
- package/dist/lib/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/SigningPlacementInspector.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/SigningPlacementInspector.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/SigningPlacementLayer.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/SigningPlacementLayer.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/TableContextMenu.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/TableContextMenu.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/TableSizePicker.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/TableSizePicker.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/composables/use-fit-width-zoom.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-designer.cjs +4 -4
- package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-draft-cache.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/extensions/ContentImageNodeView.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/extensions/ContentImageNodeView.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/extensions/ContentImageNodeView.vue_vue_type_style_index_0_scoped_8082f8b4_lang.css +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/extensions/editor-extensions.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/extensions/office-content.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/extensions/template-variable.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/extensions/word-paste.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/types.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/utils/content-image.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/utils/context-variable.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/utils/html.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/utils/image-url.cjs +2 -0
- package/dist/lib/components/pro-contract-template-designer/src/utils/signing-placement.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/utils/template-renderer.cjs +3 -3
- package/dist/lib/components/pro-contract-template-designer/src/utils/template-tool-icons.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/utils/template-variable-render.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/utils/word-paste.cjs +3 -0
- package/dist/lib/components/pro-contract-template-designer/style/index.css +1 -1
- package/dist/lib/index.cjs +1 -1
- package/dist/theme/contract-signing-location.css +1 -0
- package/dist/theme/icon.css +1 -1
- package/dist/theme/index.css +1 -1
- package/dist/theme/pro-contract-signing-flow.css +1 -0
- package/dist/types/components/contract-signing-location/index.d.ts +9 -0
- package/dist/types/components/contract-signing-location/src/ContractSigningLocation.vue.d.ts +134 -0
- package/dist/types/components/contract-signing-location/src/ContractSigningLocationCanvas.vue.d.ts +49 -0
- package/dist/types/components/contract-signing-location/src/ContractSigningLocationInspector.vue.d.ts +32 -0
- package/dist/types/components/contract-signing-location/src/ContractSigningLocationNavigator.vue.d.ts +13 -0
- package/dist/types/components/contract-signing-location/src/constants.d.ts +40 -0
- package/dist/types/components/contract-signing-location/src/coordinates.d.ts +59 -0
- package/dist/types/components/contract-signing-location/src/icons.d.ts +12 -0
- package/dist/types/components/contract-signing-location/src/location-rules.d.ts +50 -0
- package/dist/types/components/contract-signing-location/src/page-layout.d.ts +49 -0
- package/dist/types/components/contract-signing-location/src/preview-requests.d.ts +8 -0
- package/dist/types/components/contract-signing-location/src/types.d.ts +223 -0
- package/dist/types/{antdv/src/components → components}/hooks/use-basic-app-config.d.ts +2 -2
- package/dist/types/{antdv/src/components → components}/index.d.ts +2 -0
- package/dist/types/components/pro-contract-signing-flow/index.d.ts +7 -0
- package/dist/types/components/pro-contract-signing-flow/src/ContractSigningFlowCanvas.vue.d.ts +42 -0
- package/dist/types/components/pro-contract-signing-flow/src/ContractSigningFlowInspector.vue.d.ts +15 -0
- package/dist/types/components/pro-contract-signing-flow/src/ContractSigningFlowNodeCard.vue.d.ts +19 -0
- package/dist/types/components/pro-contract-signing-flow/src/ProContractSigningFlow.vue.d.ts +59 -0
- package/dist/types/components/pro-contract-signing-flow/src/composables/use-contract-signing-flow.d.ts +217 -0
- package/dist/types/components/pro-contract-signing-flow/src/constants.d.ts +26 -0
- package/dist/types/components/pro-contract-signing-flow/src/types.d.ts +124 -0
- package/dist/types/{antdv/src/components → components}/pro-contract-template-agent/src/ContractTemplateAgentContext.vue.d.ts +1 -1
- package/dist/types/{antdv/src/components → components}/pro-contract-template-agent/src/ContractTemplateAgentPanel.vue.d.ts +5 -5
- package/dist/types/components/pro-contract-template-agent/src/ContractTemplateAgentPreview.vue.d.ts +11 -0
- package/dist/types/{antdv/src/components → components}/pro-contract-template-agent/src/ProContractTemplateAgentWorkbench.vue.d.ts +1 -1
- package/dist/types/{antdv/src/components → components}/pro-contract-template-agent/src/composables/use-contract-template-agent.d.ts +11 -11
- package/dist/types/{antdv/src/components → components}/pro-contract-template-agent/src/types.d.ts +39 -2
- package/dist/types/{antdv/src/components → components}/pro-contract-template-designer/index.d.ts +2 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplatePreviewPage.vue.d.ts +9 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplatePreviewSigningLayer.vue.d.ts +7 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateRendererHeader.vue.d.ts +71 -0
- package/dist/types/{antdv/src/components → components}/pro-contract-template-designer/src/ContractTemplateRendererToolbar.vue.d.ts +14 -3
- package/dist/types/components/pro-contract-template-designer/src/DesignerPage.vue.d.ts +197 -0
- package/dist/types/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.d.ts +120 -0
- package/dist/types/{antdv/src/components → components}/pro-contract-template-designer/src/ProContractTemplateRenderer.vue.d.ts +11 -3
- package/dist/types/components/pro-contract-template-designer/src/SigningPlacementInspector.vue.d.ts +17 -0
- package/dist/types/components/pro-contract-template-designer/src/SigningPlacementLayer.vue.d.ts +19 -0
- package/dist/types/components/pro-contract-template-designer/src/TableContextMenu.vue.d.ts +22 -0
- package/dist/types/components/pro-contract-template-designer/src/TableSizePicker.vue.d.ts +23 -0
- package/dist/types/components/pro-contract-template-designer/src/composables/use-fit-width-zoom.d.ts +28 -0
- package/dist/types/components/pro-contract-template-designer/src/composables/use-template-designer.d.ts +139 -0
- package/dist/types/components/pro-contract-template-designer/src/composables/use-template-draft-cache.d.ts +83 -0
- package/dist/types/{antdv/src/components → components}/pro-contract-template-designer/src/constants.d.ts +49 -0
- package/dist/types/components/pro-contract-template-designer/src/extensions/ContentImageNodeView.vue.d.ts +5 -0
- package/dist/types/components/pro-contract-template-designer/src/extensions/editor-extensions.d.ts +16 -0
- package/dist/types/{antdv/src/components → components}/pro-contract-template-designer/src/extensions/font-size.d.ts +6 -0
- package/dist/types/components/pro-contract-template-designer/src/extensions/office-content.d.ts +11 -0
- package/dist/types/{antdv/src/components → components}/pro-contract-template-designer/src/extensions/template-variable.d.ts +17 -2
- package/dist/types/components/pro-contract-template-designer/src/extensions/word-paste.d.ts +25 -0
- package/dist/types/{antdv/src/components → components}/pro-contract-template-designer/src/types.d.ts +253 -23
- package/dist/types/components/pro-contract-template-designer/src/utils/content-image.d.ts +80 -0
- package/dist/types/components/pro-contract-template-designer/src/utils/context-variable.d.ts +37 -0
- package/dist/types/components/pro-contract-template-designer/src/utils/html.d.ts +74 -0
- package/dist/types/components/pro-contract-template-designer/src/utils/image-url.d.ts +6 -0
- package/dist/types/components/pro-contract-template-designer/src/utils/signing-placement.d.ts +105 -0
- package/dist/types/{antdv/src/components → components}/pro-contract-template-designer/src/utils/template-renderer.d.ts +15 -1
- package/dist/types/components/pro-contract-template-designer/src/utils/template-tool-icons.d.ts +12 -0
- package/dist/types/{antdv/src/components → components}/pro-contract-template-designer/src/utils/template-variable-render.d.ts +39 -0
- package/dist/types/components/pro-contract-template-designer/src/utils/word-paste.d.ts +45 -0
- package/dist/types/{antdv/src/components → components}/pro-form-render/src/module/AioArrayInput.vue.d.ts +3 -3
- package/dist/types/{antdv/src/components → components}/pro-form-render/src/module/AioArraySubForm.vue.d.ts +3 -3
- package/dist/types/{antdv/src/components → components}/pro-form-render/src/module/AioKV.vue.d.ts +3 -3
- package/dist/types/{antdv/src/components → components}/pro-form-render/src/module/AioSubForm.vue.d.ts +9 -9
- package/dist/types/{antdv/src/components → components}/pro-selector/src/pro-user.d.ts +3 -3
- package/dist/types/{antdv/src/components → components}/pro-selector-group/src/hooks/useApi.d.ts +1 -1
- package/global.d.ts +2 -0
- package/package.json +13 -8
- package/dist/types/antdv/src/components/pro-contract-template-agent/src/ContractTemplateAgentPreview.vue.d.ts +0 -11
- package/dist/types/antdv/src/components/pro-contract-template-designer/src/DesignerPage.vue.d.ts +0 -79
- package/dist/types/antdv/src/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.d.ts +0 -57
- package/dist/types/antdv/src/components/pro-contract-template-designer/src/composables/use-template-designer.d.ts +0 -41
- package/dist/types/antdv/src/components/pro-contract-template-designer/src/composables/use-template-draft-cache.d.ts +0 -39
- package/dist/types/antdv/src/components/pro-contract-template-designer/src/extensions/editor-extensions.d.ts +0 -9
- package/dist/types/antdv/src/components/pro-contract-template-designer/src/extensions/template-field.d.ts +0 -5
- /package/dist/types/{antdv/src/components → components}/collapse-transtion/hooks/use-collapse-transtion.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/collapse-transtion/index.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/collapse-transtion/src/collapse-transtion.vue.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/collapse-transtion/src/types.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/cover-scroll-bar/hooks/use-has-scroll.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/cover-scroll-bar/index.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/cover-scroll-bar/src/cover-scroll-bar.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/cover-scroll-bar/src/types.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/dept-selector/index.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/dept-selector/src/dept.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/dept-selector/src/types.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/hooks/index.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/icon/index.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/icon/src/icon.vue.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/icon/src/types.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/plus-upload/apis/plus-upload.api.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/plus-upload/hook/useExtractPlusUpload.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/plus-upload/hook/usePlusUpload.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/plus-upload/index.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/plus-upload/src/plus-upload.vue.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/plus-upload/src/types.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-area/apis/pro-area.api.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-area/hooks/use-pro-area.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-area/index.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-area/src/ProArea.vue.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-area/src/types.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-cell/index.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-cell/src/index.vue.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-cell/src/types.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-cell-group/index.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-cell-group/src/index.vue.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-cell-group/src/types.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-contract-template-agent/index.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-contract-template-agent/src/composables/use-contract-template-agent-split.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-contract-template-agent/src/composables/use-contract-template-agent-workbench.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-contract-template-agent/src/utils/contract-template-agent-adapter.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-contract-template-designer/src/ContractTemplateRendererField.vue.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-contract-template-designer/src/ContractTemplateRendererPage.vue.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-drawer/index.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-drawer/src/index.vue.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-drawer/src/types.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-dynamic-tags/index.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-dynamic-tags/src/index.vue.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-dynamic-tags/src/types.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-form-render/index.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-form-render/src/index.vue.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-form-render/src/module/AioDatePicker.vue.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-form-render/src/module/AioInput.vue.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-form-render/src/module/AioInputNumber.vue.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-form-render/src/module/AioKeyValue.vue.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-form-render/src/module/AioSelect.vue.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-form-render/src/module/AioSwitch.vue.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-form-render/src/module/AioTextarea.vue.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-form-render/src/module/AioTimePicker.vue.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-form-render/src/module/index.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-form-render/src/types.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-form-render/src/utils.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-form-render/src/v-model-utils.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-loading/index.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-loading/src/pro-loading.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-loading/src/types.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-menu-tree/index.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-menu-tree/src/hooks.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-menu-tree/src/pro-menu-tree.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-menu-tree/src/types.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-modal/hooks/useProModal.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-modal/index.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-modal/src/Modal.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-modal/src/ProModal.vue.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-modal/src/types.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-overlay/index.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-overlay/src/pro-overlay.vue.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-picker/apis/pro-picker.api.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-picker/index.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-picker/src/ProPicker.vue.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-picker/src/types.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-selector/index.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-selector/src/components/org-tree.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-selector/src/components/user.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-selector/src/hooks/index.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-selector/src/hooks/useUserSelector.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-selector/src/types.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-selector/src/util.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-selector/src/utils/orgTree.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-selector-group/index.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-selector-group/src/compoents/dept-tree.vue.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-selector-group/src/compoents/dept.vue.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-selector-group/src/compoents/index.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-selector-group/src/compoents/role.vue.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-selector-group/src/compoents/select-box.vue.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-selector-group/src/compoents/user.vue.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-selector-group/src/index.vue.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-selector-group/src/types.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-selector-group/src/utils/index.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-signature/index.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-signature/src/ProSignature.vue.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-signature/src/types.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-table/hooks/use-pro-table.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-table/index.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-table/src/constants.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-table/src/field/field-date-range/field-date-range.vue.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-table/src/field/field-input/field-input.vue.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-table/src/field/field-radio/field-radio.vue.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-table/src/field/field-select/field-select.vue.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-table/src/field/field.vue.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-table/src/form-render.vue.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-table/src/hooks/use-form.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-table/src/hooks/use-table.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-table/src/pro-table.vue.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-table/src/types.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-table/utils.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-tag/index.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-tag/src/ProTag.vue.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-tag/src/types.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-tag-group/index.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-tag-group/src/ProTagGroup.vue.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-tag-group/src/types.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-title/index.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-title/src/ProTitle.vue.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-title/src/types.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-upload/index.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-upload/src/data.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-upload/src/file-list.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-upload/src/gd-upload.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-upload/src/hooks/index.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-upload/src/hooks/resType.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-upload/src/hooks/useHttp.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-upload/src/hooks/useUpload.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-upload/src/props.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-upload/src/types.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-upload/src/utils/emitter.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-upload/src/utils/index.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-user-avatar/index.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-user-avatar/src/index.vue.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-user-avatar/src/types.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/pro-user-avatar/src/util.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/role-selector/index.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/role-selector/src/role.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/role-selector/src/types.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/scale-virtual-list/component/scale-virtual-list.vue.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/scale-virtual-list/component/types.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/scale-virtual-list/hooks/useVirtualList.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/scale-virtual-list/index.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/scroll-bar/index.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/scroll-bar/src/scroll-bar.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/scroll-bar/src/types.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/utils/install.d.ts +0 -0
- /package/dist/types/{antdv/src/components → components}/utils/tool.d.ts +0 -0
- /package/dist/types/{antdv/src/extract.d.ts → extract.d.ts} +0 -0
- /package/dist/types/{antdv/src/hooks → hooks}/index.d.ts +0 -0
- /package/dist/types/{antdv/src/hooks → hooks}/setup-theme.d.ts +0 -0
- /package/dist/types/{antdv/src/hooks → hooks}/use-namespace/index.d.ts +0 -0
- /package/dist/types/{antdv/src/hooks → hooks}/useModelValue.d.ts +0 -0
- /package/dist/types/{antdv/src/hooks → hooks}/useProForm.d.ts +0 -0
- /package/dist/types/{antdv/src/index.d.ts → index.d.ts} +0 -0
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import { CONTRACT_TEXT_STYLE_PRESETS as e } from "./constants.mjs";
|
|
2
|
-
import { buildTemplateVariableAttrs as t } from "./extensions/template-variable.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
2
|
+
import { buildTemplateVariableAttrs as t, insertTemplateVariableNode as n } from "./extensions/template-variable.mjs";
|
|
3
|
+
import { normalizeContractImageDimension as r } from "./utils/content-image.mjs";
|
|
4
|
+
import { createEditorExtensions as i, runContractTemplateEditorCommand as a } from "./extensions/editor-extensions.mjs";
|
|
5
|
+
import { resolveEditorContextMenuKind as o } from "./utils/context-variable.mjs";
|
|
6
|
+
import { SIGNING_PLACEMENT_MIME as s, canMutateSigningPlacements as c, getSigningPlacementDefaultSize as ee, parseSigningPlacementDragPayload as te } from "./utils/signing-placement.mjs";
|
|
7
|
+
import { DEFAULT_FIELD_STYLE as ne, resolvePageSize as re, splitPageContentByMeasurements as l } from "./composables/use-template-designer.mjs";
|
|
8
|
+
import ie from "./SigningPlacementLayer.mjs";
|
|
9
|
+
import { computed as u, createBlock as ae, createCommentVNode as oe, createElementBlock as se, createElementVNode as d, createVNode as ce, defineComponent as f, nextTick as le, normalizeClass as ue, normalizeStyle as p, onBeforeUnmount as de, openBlock as m, ref as fe, toDisplayString as h, unref as g, watch as _, withModifiers as pe } from "vue";
|
|
10
|
+
import { EditorContent as me, useEditor as he } from "@tiptap/vue-3";
|
|
11
|
+
import { generateHTML as ge } from "@tiptap/core";
|
|
12
|
+
import { CellSelection as v, deleteColumn as _e, deleteRow as ve, deleteTable as ye } from "@tiptap/pm/tables";
|
|
13
|
+
import { NodeSelection as y } from "@tiptap/pm/state";
|
|
8
14
|
//#region src/components/pro-contract-template-designer/src/DesignerPage.vue?vue&type=script&setup=true&lang.ts
|
|
9
|
-
var
|
|
15
|
+
var be = { class: "gd-contract-template-designer__page-title" }, b = "application/x-gd-contract-variable-move", xe = 8, x = /* @__PURE__ */ f({
|
|
10
16
|
name: "ProContractTemplateDesignerPage",
|
|
11
17
|
__name: "DesignerPage",
|
|
12
18
|
props: {
|
|
@@ -27,162 +33,413 @@ var w = { class: "gd-contract-template-designer__page-title" }, T = /* @__PURE__
|
|
|
27
33
|
type: Boolean,
|
|
28
34
|
default: !1
|
|
29
35
|
},
|
|
30
|
-
zoom: { default: 1 }
|
|
36
|
+
zoom: { default: 1 },
|
|
37
|
+
signingPlacements: { default: () => [] },
|
|
38
|
+
selectedSigningPlacementId: { default: "" },
|
|
39
|
+
processImageFile: {
|
|
40
|
+
type: Function,
|
|
41
|
+
default: void 0
|
|
42
|
+
}
|
|
31
43
|
},
|
|
32
44
|
emits: [
|
|
33
45
|
"page-update",
|
|
34
46
|
"variable-drop",
|
|
47
|
+
"signing-placement-drop",
|
|
48
|
+
"signing-placement-select",
|
|
49
|
+
"signing-placement-move",
|
|
50
|
+
"signing-placement-remove",
|
|
35
51
|
"variable-select",
|
|
52
|
+
"variable-move-blocked",
|
|
36
53
|
"editor-focus",
|
|
37
54
|
"editor-state-change",
|
|
38
55
|
"editor-context-menu"
|
|
39
56
|
],
|
|
40
|
-
setup(
|
|
41
|
-
let
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
"font-weight",
|
|
49
|
-
"font-style",
|
|
50
|
-
"text-decoration",
|
|
51
|
-
"text-align",
|
|
52
|
-
"color",
|
|
53
|
-
"font-size",
|
|
54
|
-
"font-family"
|
|
55
|
-
].map((t) => {
|
|
56
|
-
let n = e.style.getPropertyValue(t);
|
|
57
|
-
return n ? `${t}:${n}` : "";
|
|
58
|
-
}).filter(Boolean).join(";");
|
|
59
|
-
t ? e.setAttribute("style", t) : e.removeAttribute("style");
|
|
60
|
-
}), t.body.innerHTML;
|
|
61
|
-
}
|
|
62
|
-
let M = ee({
|
|
63
|
-
content: E.page.contentHtml,
|
|
64
|
-
editable: !O.value,
|
|
65
|
-
extensions: A,
|
|
57
|
+
setup(f, { expose: x, emit: Se }) {
|
|
58
|
+
let S = f, C = Se, w = u(() => S.readonly || S.disabled), T = fe(), E = i("请输入合同正文,或从 WPS / Word 粘贴合同内容", {
|
|
59
|
+
processImageFile: S.processImageFile,
|
|
60
|
+
getZoom: () => Math.max(.1, S.zoom || 1)
|
|
61
|
+
}), D = he({
|
|
62
|
+
content: S.page.contentHtml,
|
|
63
|
+
editable: !w.value,
|
|
64
|
+
extensions: E,
|
|
66
65
|
editorProps: {
|
|
67
66
|
attributes: { class: "gd-contract-template-designer__editor-prose" },
|
|
68
|
-
transformPastedHTML: j,
|
|
69
67
|
handleClick: (e, t, n) => {
|
|
70
68
|
let r = (n.target instanceof HTMLElement ? n.target.closest("[data-template-variable]") : void 0)?.dataset.key;
|
|
71
69
|
if (!r) return !1;
|
|
72
|
-
let i =
|
|
73
|
-
return i
|
|
70
|
+
let i = S.variables.find((e) => e.key === r);
|
|
71
|
+
return i && C("variable-select", i.key), !1;
|
|
72
|
+
},
|
|
73
|
+
handleDOMEvents: {
|
|
74
|
+
contextmenu: (e, t) => {
|
|
75
|
+
if (w.value) return !1;
|
|
76
|
+
let n = Oe(e, t.target);
|
|
77
|
+
if (n) return t.preventDefault(), L({
|
|
78
|
+
pageId: S.page.id,
|
|
79
|
+
clientX: t.clientX,
|
|
80
|
+
clientY: t.clientY
|
|
81
|
+
}, n), !0;
|
|
82
|
+
let r = D.value?.state.selection, i = r instanceof v, a = t.target instanceof HTMLElement ? !!t.target.closest("td, th") : !1, s = o({
|
|
83
|
+
isCellSelection: i,
|
|
84
|
+
selectionEmpty: !r || r.empty,
|
|
85
|
+
inTable: a
|
|
86
|
+
});
|
|
87
|
+
return t.preventDefault(), s === "table" && (i || Ee(t.clientX, t.clientY, t.target)) ? (B({
|
|
88
|
+
pageId: S.page.id,
|
|
89
|
+
clientX: t.clientX,
|
|
90
|
+
clientY: t.clientY
|
|
91
|
+
}), !0) : (I({
|
|
92
|
+
pageId: S.page.id,
|
|
93
|
+
clientX: t.clientX,
|
|
94
|
+
clientY: t.clientY
|
|
95
|
+
}), !0);
|
|
96
|
+
},
|
|
97
|
+
dragstart: (e, t) => w.value ? (t.preventDefault(), !0) : (t.target instanceof HTMLElement ? t.target : null)?.closest("[data-template-variable]") ? (t.dataTransfer?.setData(b, S.page.id), t.dataTransfer && (t.dataTransfer.effectAllowed = "move"), T.value?.classList.add("is-variable-dragging"), !1) : !1,
|
|
98
|
+
dragend: () => (T.value?.classList.remove("is-variable-dragging"), !1),
|
|
99
|
+
drop: (e, t) => {
|
|
100
|
+
if (w.value) return t.preventDefault(), t.stopPropagation(), !0;
|
|
101
|
+
let n = t.dataTransfer?.getData(b);
|
|
102
|
+
return !n || n === S.page.id ? !1 : (t.preventDefault(), C("variable-move-blocked", S.page.id), !0);
|
|
103
|
+
}
|
|
74
104
|
},
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
105
|
+
handleKeyDown: (e, t) => {
|
|
106
|
+
if (w.value || !Ce(t)) return !1;
|
|
107
|
+
let n = D.value;
|
|
108
|
+
if (!n) return !1;
|
|
109
|
+
t.preventDefault();
|
|
110
|
+
let r = n.state.selection, i = z();
|
|
111
|
+
if (i) {
|
|
112
|
+
let e = n.view.coordsAtPos(r.from);
|
|
113
|
+
return L({
|
|
114
|
+
pageId: S.page.id,
|
|
115
|
+
clientX: e.left,
|
|
116
|
+
clientY: e.bottom
|
|
117
|
+
}, i), !0;
|
|
118
|
+
}
|
|
119
|
+
let a = r instanceof v;
|
|
120
|
+
if (o({
|
|
121
|
+
isCellSelection: a,
|
|
122
|
+
selectionEmpty: r.empty,
|
|
123
|
+
inTable: n.isActive("table")
|
|
124
|
+
}) === "table") {
|
|
125
|
+
if (!a) {
|
|
126
|
+
let e = Te();
|
|
127
|
+
typeof e == "number" && n.view.dispatch(n.state.tr.setSelection(v.create(n.state.doc, e)));
|
|
128
|
+
}
|
|
129
|
+
let e = n.view.coordsAtPos(n.state.selection.from);
|
|
130
|
+
return B({
|
|
131
|
+
pageId: S.page.id,
|
|
132
|
+
clientX: e.left,
|
|
133
|
+
clientY: e.bottom
|
|
134
|
+
}), !0;
|
|
135
|
+
}
|
|
136
|
+
let s = n.view.coordsAtPos(n.state.selection.from);
|
|
137
|
+
return I({
|
|
138
|
+
pageId: S.page.id,
|
|
139
|
+
clientX: s.left,
|
|
140
|
+
clientY: s.bottom
|
|
141
|
+
}), !0;
|
|
142
|
+
}
|
|
80
143
|
},
|
|
81
144
|
onUpdate: ({ editor: e }) => {
|
|
82
|
-
|
|
83
|
-
...
|
|
145
|
+
C("page-update", {
|
|
146
|
+
...S.page,
|
|
84
147
|
contentHtml: e.getHTML(),
|
|
85
148
|
contentJson: e.getJSON()
|
|
86
|
-
}),
|
|
149
|
+
}), H();
|
|
87
150
|
},
|
|
88
151
|
onFocus: () => {
|
|
89
|
-
|
|
152
|
+
C("editor-focus", S.page.id), H();
|
|
90
153
|
},
|
|
91
|
-
onBlur:
|
|
92
|
-
onSelectionUpdate:
|
|
93
|
-
onCreate:
|
|
154
|
+
onBlur: H,
|
|
155
|
+
onSelectionUpdate: H,
|
|
156
|
+
onCreate: H
|
|
94
157
|
});
|
|
95
|
-
function
|
|
158
|
+
function O(e) {
|
|
96
159
|
if (typeof e == "number" && Number.isFinite(e)) return e;
|
|
97
160
|
let t = String(e || "").match(/(\d+(\.\d+)?)/);
|
|
98
161
|
return t ? Number(t[1]) : void 0;
|
|
99
162
|
}
|
|
100
|
-
function
|
|
101
|
-
if (!
|
|
102
|
-
let { from: e, to: t } =
|
|
103
|
-
return
|
|
163
|
+
function k() {
|
|
164
|
+
if (!D.value) return "";
|
|
165
|
+
let { from: e, to: t } = D.value.state.selection;
|
|
166
|
+
return D.value.state.doc.textBetween(e, t, "\n");
|
|
167
|
+
}
|
|
168
|
+
function A() {
|
|
169
|
+
let e = D.value, t = e?.state.selection;
|
|
170
|
+
if (!(!e || !t || t.empty)) try {
|
|
171
|
+
let n = e.view.coordsAtPos(t.from), r = e.view.coordsAtPos(t.to, -1);
|
|
172
|
+
if (Math.abs(r.top - n.top) > xe) return;
|
|
173
|
+
let i = Math.abs(r.left - n.left) / U.value;
|
|
174
|
+
return Number.isFinite(i) && i > 0 ? i : void 0;
|
|
175
|
+
} catch {
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
function j() {
|
|
180
|
+
let e = D.value;
|
|
181
|
+
if (!e) return "";
|
|
182
|
+
let t = e.state.selection.$from, n = t.pos;
|
|
183
|
+
for (let e = t.depth; e > 0; --e) {
|
|
184
|
+
let r = t.node(e).type.name;
|
|
185
|
+
if (r === "paragraph" || r === "heading") {
|
|
186
|
+
n = t.start(e);
|
|
187
|
+
break;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
return e.state.doc.textBetween(n, e.state.selection.from, "");
|
|
191
|
+
}
|
|
192
|
+
function Ce(e) {
|
|
193
|
+
return e.key === "ContextMenu" || e.shiftKey && e.key === "F10";
|
|
194
|
+
}
|
|
195
|
+
function M(e) {
|
|
196
|
+
for (let t = e.depth; t > 0; --t) {
|
|
197
|
+
let n = e.node(t).type.spec.tableRole;
|
|
198
|
+
if (n === "cell" || n === "header_cell") return e.before(t);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
function we(e, t) {
|
|
202
|
+
let n = D.value, r = n?.view.posAtCoords({
|
|
203
|
+
left: e,
|
|
204
|
+
top: t
|
|
205
|
+
})?.pos;
|
|
206
|
+
if (!(!n || typeof r != "number")) return M(n.state.doc.resolve(r));
|
|
207
|
+
}
|
|
208
|
+
function Te() {
|
|
209
|
+
let e = D.value;
|
|
210
|
+
if (e) return M(e.state.selection.$from);
|
|
211
|
+
}
|
|
212
|
+
function Ee(e, t, n) {
|
|
213
|
+
let r = D.value, i = n instanceof HTMLElement ? n : null;
|
|
214
|
+
if (!r || !i?.closest("td,th")) return !1;
|
|
215
|
+
if (r.state.selection instanceof v && i.closest("td.selectedCell,th.selectedCell")) return !0;
|
|
216
|
+
let a = we(e, t);
|
|
217
|
+
return typeof a == "number" ? (r.view.dispatch(r.state.tr.setSelection(v.create(r.state.doc, a))), !0) : !1;
|
|
218
|
+
}
|
|
219
|
+
function N() {
|
|
220
|
+
let e = D.value, t = e?.isActive("table") ? e.can() : void 0, n = (e) => !!(t && e(t));
|
|
221
|
+
return {
|
|
222
|
+
addRowBefore: n((e) => e.addRowBefore()),
|
|
223
|
+
addRowAfter: n((e) => e.addRowAfter()),
|
|
224
|
+
deleteRow: n((e) => e.deleteRow()),
|
|
225
|
+
addColumnBefore: n((e) => e.addColumnBefore()),
|
|
226
|
+
addColumnAfter: n((e) => e.addColumnAfter()),
|
|
227
|
+
deleteColumn: n((e) => e.deleteColumn()),
|
|
228
|
+
mergeCells: n((e) => e.mergeCells()),
|
|
229
|
+
splitCell: n((e) => e.splitCell()),
|
|
230
|
+
alignLeft: n((e) => e.setCellAttribute("textAlign", "left")),
|
|
231
|
+
alignCenter: n((e) => e.setCellAttribute("textAlign", "center")),
|
|
232
|
+
alignRight: n((e) => e.setCellAttribute("textAlign", "right")),
|
|
233
|
+
toggleHeaderRow: n((e) => e.toggleHeaderRow()),
|
|
234
|
+
toggleHeaderColumn: n((e) => e.toggleHeaderColumn()),
|
|
235
|
+
deleteTable: n((e) => e.deleteTable())
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
function De() {
|
|
239
|
+
let e = D.value, t = e?.state.selection;
|
|
240
|
+
if (!e || !(t instanceof v)) return "left";
|
|
241
|
+
let n = /* @__PURE__ */ new Set();
|
|
242
|
+
return t.forEachCell((e) => {
|
|
243
|
+
let t = e.attrs.textAlign;
|
|
244
|
+
n.add(t === "center" || t === "right" ? t : "left");
|
|
245
|
+
}), n.size === 1 ? n.values().next().value ?? "left" : "mixed";
|
|
246
|
+
}
|
|
247
|
+
function P(e = D.value?.state.doc) {
|
|
248
|
+
let t = 0;
|
|
249
|
+
return e?.descendants((e) => {
|
|
250
|
+
e.type.name === "templateVariable" && (t += 1);
|
|
251
|
+
}), t;
|
|
252
|
+
}
|
|
253
|
+
function F(e) {
|
|
254
|
+
let t = D.value;
|
|
255
|
+
if (!t) return 0;
|
|
256
|
+
let n = P(t.state.doc), r = n, i = (e) => {
|
|
257
|
+
r = P(e.doc);
|
|
258
|
+
};
|
|
259
|
+
return e === "delete-table-row" ? ve(t.state, i) : e === "delete-table-column" ? _e(t.state, i) : ye(t.state, i), Math.max(0, n - r);
|
|
260
|
+
}
|
|
261
|
+
function I(e) {
|
|
262
|
+
let t = D.value?.state.selection, n = !!(t && !t.empty);
|
|
263
|
+
C("editor-context-menu", {
|
|
264
|
+
type: "text",
|
|
265
|
+
...e,
|
|
266
|
+
hasSelection: n,
|
|
267
|
+
selectionWidth: n ? A() : void 0,
|
|
268
|
+
leadingText: j()
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
function L(e, t) {
|
|
272
|
+
C("editor-context-menu", {
|
|
273
|
+
type: "image",
|
|
274
|
+
...e,
|
|
275
|
+
image: t
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
function R(e, t) {
|
|
279
|
+
if (!(e.type.name !== "image" || typeof e.attrs.src != "string" || !e.attrs.src)) return {
|
|
280
|
+
position: t,
|
|
281
|
+
src: e.attrs.src,
|
|
282
|
+
alt: typeof e.attrs.alt == "string" ? e.attrs.alt : void 0,
|
|
283
|
+
title: typeof e.attrs.title == "string" ? e.attrs.title : void 0,
|
|
284
|
+
width: r(e.attrs.width),
|
|
285
|
+
height: r(e.attrs.height)
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
function z() {
|
|
289
|
+
let e = D.value?.state.selection;
|
|
290
|
+
if (e instanceof y) return R(e.node, e.from);
|
|
291
|
+
}
|
|
292
|
+
function Oe(e, t) {
|
|
293
|
+
let n = t instanceof HTMLElement ? t.closest("[data-template-variable], img[src]") : null;
|
|
294
|
+
if (n) try {
|
|
295
|
+
let t = e.posAtDOM(n, 0), r = e.state.doc.nodeAt(t);
|
|
296
|
+
return !r || r.type.name !== "templateVariable" && r.type.name !== "image" ? void 0 : (r.type.name === "templateVariable" && typeof r.attrs.key == "string" && C("variable-select", r.attrs.key), (!(e.state.selection instanceof y) || e.state.selection.from !== t) && e.dispatch(e.state.tr.setSelection(y.create(e.state.doc, t))), R(r, t));
|
|
297
|
+
} catch {
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
function B(e) {
|
|
302
|
+
C("editor-context-menu", {
|
|
303
|
+
type: "table",
|
|
304
|
+
...e,
|
|
305
|
+
capabilities: N(),
|
|
306
|
+
activeAlignment: De(),
|
|
307
|
+
affectedVariableCounts: {
|
|
308
|
+
deleteRow: F("delete-table-row"),
|
|
309
|
+
deleteColumn: F("delete-table-column"),
|
|
310
|
+
deleteTable: F("delete-table")
|
|
311
|
+
}
|
|
312
|
+
});
|
|
104
313
|
}
|
|
105
|
-
function
|
|
106
|
-
return
|
|
314
|
+
function ke() {
|
|
315
|
+
return D.value ? [
|
|
107
316
|
1,
|
|
108
317
|
2,
|
|
109
318
|
3,
|
|
110
319
|
4,
|
|
111
320
|
5,
|
|
112
321
|
6
|
|
113
|
-
].find((e) =>
|
|
114
|
-
}
|
|
115
|
-
function
|
|
116
|
-
return
|
|
117
|
-
}
|
|
118
|
-
function
|
|
119
|
-
let e =
|
|
120
|
-
if (!e) return {
|
|
121
|
-
isFocused: !1,
|
|
122
|
-
canUndo: !1,
|
|
123
|
-
canRedo: !1,
|
|
124
|
-
isBold: !1,
|
|
125
|
-
isItalic: !1,
|
|
126
|
-
isUnderline: !1,
|
|
127
|
-
isBulletList: !1,
|
|
128
|
-
isOrderedList: !1,
|
|
129
|
-
isTableActive: !1,
|
|
130
|
-
textAlign: "left"
|
|
131
|
-
};
|
|
132
|
-
let t = e.getAttributes("textStyle");
|
|
322
|
+
].find((e) => D.value?.isActive("heading", { level: e })) : void 0;
|
|
323
|
+
}
|
|
324
|
+
function Ae() {
|
|
325
|
+
return ["center", "right"].find((e) => D.value?.isActive("heading", { textAlign: e }) || D.value?.isActive("paragraph", { textAlign: e })) ?? "left";
|
|
326
|
+
}
|
|
327
|
+
function V() {
|
|
328
|
+
let e = D.value, t = (t) => !!e?.isActive(t), n = e?.getAttributes("textStyle") ?? {};
|
|
133
329
|
return {
|
|
134
|
-
isFocused: e
|
|
135
|
-
canUndo: e
|
|
136
|
-
canRedo: e
|
|
137
|
-
isBold:
|
|
138
|
-
isItalic:
|
|
139
|
-
isUnderline:
|
|
140
|
-
isBulletList:
|
|
141
|
-
isOrderedList:
|
|
142
|
-
isTableActive:
|
|
143
|
-
currentHeadingLevel:
|
|
144
|
-
textAlign:
|
|
145
|
-
fontFamily: typeof
|
|
146
|
-
fontSize:
|
|
147
|
-
textColor: typeof
|
|
148
|
-
selectionText:
|
|
330
|
+
isFocused: !!e?.isFocused,
|
|
331
|
+
canUndo: !!e?.can().undo(),
|
|
332
|
+
canRedo: !!e?.can().redo(),
|
|
333
|
+
isBold: t("bold"),
|
|
334
|
+
isItalic: t("italic"),
|
|
335
|
+
isUnderline: t("underline"),
|
|
336
|
+
isBulletList: t("bulletList"),
|
|
337
|
+
isOrderedList: t("orderedList"),
|
|
338
|
+
isTableActive: t("table"),
|
|
339
|
+
currentHeadingLevel: ke(),
|
|
340
|
+
textAlign: Ae(),
|
|
341
|
+
fontFamily: typeof n.fontFamily == "string" ? n.fontFamily : void 0,
|
|
342
|
+
fontSize: O(n.fontSize),
|
|
343
|
+
textColor: typeof n.color == "string" ? n.color : void 0,
|
|
344
|
+
selectionText: k(),
|
|
345
|
+
selectedContentImage: z()
|
|
149
346
|
};
|
|
150
347
|
}
|
|
151
|
-
function
|
|
152
|
-
|
|
348
|
+
function H() {
|
|
349
|
+
C("editor-state-change", S.page.id, V());
|
|
153
350
|
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
}),
|
|
157
|
-
!
|
|
351
|
+
_(w, (e) => {
|
|
352
|
+
D.value?.setEditable(!e), H();
|
|
353
|
+
}), _(() => S.page.contentHtml, (e) => {
|
|
354
|
+
!D.value || e === D.value.getHTML() || (D.value.commands.setContent(e || "<p></p>", { emitUpdate: !1 }), H());
|
|
158
355
|
});
|
|
159
|
-
let
|
|
160
|
-
width: `${
|
|
161
|
-
height: `${
|
|
162
|
-
"--gd-contract-page-content-height": `${
|
|
163
|
-
})),
|
|
164
|
-
width: `${Math.ceil((
|
|
165
|
-
height: `${Math.ceil((
|
|
166
|
-
})),
|
|
167
|
-
function W(e) {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
356
|
+
let je = u(() => ({
|
|
357
|
+
width: `${S.pageSize.width}px`,
|
|
358
|
+
height: `${S.pageSize.height}px`,
|
|
359
|
+
"--gd-contract-page-content-height": `${q()}px`
|
|
360
|
+
})), U = u(() => Math.max(.1, S.zoom || 1)), Me = u(() => ({
|
|
361
|
+
width: `${Math.ceil((S.pageSize.width + 10) * U.value)}px`,
|
|
362
|
+
height: `${Math.ceil((S.pageSize.height + 40) * U.value)}px`
|
|
363
|
+
})), Ne = u(() => ({ "--gd-contract-page-zoom": String(U.value) })), Pe = u(() => re(S.pageSize));
|
|
364
|
+
function W(e, t) {
|
|
365
|
+
let n = T.value?.getBoundingClientRect();
|
|
366
|
+
return n ? {
|
|
367
|
+
x: Math.min(S.pageSize.width, Math.max(0, (e - n.left) / U.value)),
|
|
368
|
+
y: Math.min(S.pageSize.height, Math.max(0, (t - n.top) / U.value))
|
|
369
|
+
} : {
|
|
370
|
+
x: S.pageSize.width / 2,
|
|
371
|
+
y: S.pageSize.height / 2
|
|
372
|
+
};
|
|
373
|
+
}
|
|
374
|
+
function Fe(e) {
|
|
375
|
+
let t = T.value?.getBoundingClientRect(), n = T.value?.closest(".gd-contract-template-designer__canvas")?.getBoundingClientRect(), r = ee(e);
|
|
376
|
+
if (!t || !n) return {
|
|
377
|
+
x: Math.max(0, (S.pageSize.width - r.width) / 2),
|
|
378
|
+
y: Math.max(0, (S.pageSize.height - r.height) / 2)
|
|
379
|
+
};
|
|
380
|
+
let i = Math.max(t.left, n.left), a = Math.max(t.top, n.top), o = Math.min(t.right, n.right), s = Math.min(t.bottom, n.bottom), c = W(o > i ? (i + o) / 2 : (t.left + t.right) / 2, s > a ? (a + s) / 2 : (t.top + t.bottom) / 2);
|
|
381
|
+
return {
|
|
382
|
+
x: c.x - r.width / 2,
|
|
383
|
+
y: c.y - r.height / 2
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
function Ie(e) {
|
|
387
|
+
if (!c(S.readonly, S.disabled)) {
|
|
388
|
+
e.preventDefault(), e.stopPropagation();
|
|
389
|
+
return;
|
|
390
|
+
}
|
|
391
|
+
let t = te(e.dataTransfer?.getData(s));
|
|
392
|
+
if (t) {
|
|
393
|
+
e.preventDefault(), e.stopPropagation();
|
|
394
|
+
let n = W(e.clientX, e.clientY);
|
|
395
|
+
C("signing-placement-drop", S.page.id, t, n.x, n.y);
|
|
396
|
+
return;
|
|
397
|
+
}
|
|
398
|
+
let n = e.dataTransfer?.getData("application/x-gd-contract-variable");
|
|
399
|
+
if (n) {
|
|
400
|
+
e.preventDefault(), e.stopPropagation(), C("variable-drop", S.page.id, n, e.clientX, e.clientY);
|
|
401
|
+
return;
|
|
402
|
+
}
|
|
403
|
+
let r = e.dataTransfer?.getData(b);
|
|
404
|
+
r && r !== S.page.id && (e.preventDefault(), e.stopPropagation(), C("variable-move-blocked", S.page.id));
|
|
405
|
+
}
|
|
406
|
+
function Le(e, t) {
|
|
407
|
+
let r = D.value;
|
|
408
|
+
return r ? (n(r, e, t ? r.view.posAtCoords(t)?.pos : void 0), $(), G()) : void 0;
|
|
409
|
+
}
|
|
410
|
+
function Re(e, t) {
|
|
411
|
+
let n = D.value;
|
|
412
|
+
if (n) return a(n, {
|
|
413
|
+
type: "insert-content-image",
|
|
414
|
+
image: e,
|
|
415
|
+
position: t
|
|
416
|
+
}), G();
|
|
417
|
+
}
|
|
418
|
+
function ze(e) {
|
|
419
|
+
let t = D.value, n = t?.state.selection;
|
|
420
|
+
if (!t || !(n instanceof y) || n.node.type.name !== "image") return;
|
|
421
|
+
let i = { ...n.node.attrs }, a = !1;
|
|
422
|
+
if (["width", "height"].forEach((t) => {
|
|
423
|
+
if (!Object.prototype.hasOwnProperty.call(e, t)) return;
|
|
424
|
+
let n = e[t] === void 0 ? null : r(e[t]) ?? null;
|
|
425
|
+
i[t] !== n && (i[t] = n, a = !0);
|
|
426
|
+
}), !a) return;
|
|
427
|
+
let o = t.state.tr.setNodeMarkup(n.from, void 0, i);
|
|
428
|
+
return o.setSelection(y.create(o.doc, n.from)), t.view.dispatch(o), G();
|
|
429
|
+
}
|
|
430
|
+
function Be() {
|
|
431
|
+
let e = D.value?.state.selection;
|
|
432
|
+
return e ? {
|
|
433
|
+
from: e.from,
|
|
434
|
+
to: e.to
|
|
435
|
+
} : void 0;
|
|
179
436
|
}
|
|
180
437
|
function G() {
|
|
181
438
|
return {
|
|
182
|
-
...
|
|
183
|
-
pageSize:
|
|
184
|
-
contentHtml:
|
|
185
|
-
contentJson:
|
|
439
|
+
...S.page,
|
|
440
|
+
pageSize: Pe.value,
|
|
441
|
+
contentHtml: D.value?.getHTML() ?? S.page.contentHtml,
|
|
442
|
+
contentJson: D.value?.getJSON() ?? S.page.contentJson
|
|
186
443
|
};
|
|
187
444
|
}
|
|
188
445
|
function K(e) {
|
|
@@ -191,22 +448,22 @@ var w = { class: "gd-contract-template-designer__page-title" }, T = /* @__PURE__
|
|
|
191
448
|
content: e.length ? e : [{ type: "paragraph" }]
|
|
192
449
|
};
|
|
193
450
|
}
|
|
194
|
-
function
|
|
451
|
+
function Ve(e) {
|
|
195
452
|
return e?.length ? e.length === 1 && e[0].type === "paragraph" && !e[0].content?.length : !0;
|
|
196
453
|
}
|
|
197
|
-
function
|
|
198
|
-
return
|
|
454
|
+
function He(e) {
|
|
455
|
+
return ge(K(e), E);
|
|
199
456
|
}
|
|
200
|
-
function
|
|
201
|
-
let e =
|
|
202
|
-
if (!e) return
|
|
457
|
+
function q() {
|
|
458
|
+
let e = T.value;
|
|
459
|
+
if (!e) return S.pageSize.height - 108;
|
|
203
460
|
let t = window.getComputedStyle(e), n = Number.parseFloat(t.paddingTop) || 0, r = Number.parseFloat(t.paddingBottom) || 0;
|
|
204
|
-
return Math.max(120,
|
|
461
|
+
return Math.max(120, S.pageSize.height - n - r);
|
|
205
462
|
}
|
|
206
|
-
function
|
|
207
|
-
let e =
|
|
463
|
+
function Ue() {
|
|
464
|
+
let e = T.value?.querySelector(".gd-contract-template-designer__editor-prose");
|
|
208
465
|
if (!e) return [];
|
|
209
|
-
let t = e.getBoundingClientRect(), n =
|
|
466
|
+
let t = e.getBoundingClientRect(), n = U.value;
|
|
210
467
|
return Array.from(e.children).map((e) => {
|
|
211
468
|
let r = e.getBoundingClientRect();
|
|
212
469
|
return {
|
|
@@ -215,233 +472,180 @@ var w = { class: "gd-contract-template-designer__page-title" }, T = /* @__PURE__
|
|
|
215
472
|
};
|
|
216
473
|
});
|
|
217
474
|
}
|
|
218
|
-
function
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
475
|
+
function J() {
|
|
476
|
+
return D.value ? l(D.value.getJSON().content, Ue(), q()) : void 0;
|
|
477
|
+
}
|
|
478
|
+
function We() {
|
|
479
|
+
return !!J();
|
|
480
|
+
}
|
|
481
|
+
function Ge() {
|
|
482
|
+
if (!D.value) return;
|
|
483
|
+
let e = J();
|
|
484
|
+
if (e) return D.value.commands.setContent(K(e.currentContent), { emitUpdate: !1 }), {
|
|
222
485
|
page: G(),
|
|
223
486
|
overflowContent: e.overflowContent,
|
|
224
|
-
overflowHtml:
|
|
487
|
+
overflowHtml: He(e.overflowContent)
|
|
225
488
|
};
|
|
226
489
|
}
|
|
227
|
-
function
|
|
228
|
-
if (!
|
|
229
|
-
let t =
|
|
230
|
-
return
|
|
490
|
+
function Y(e) {
|
|
491
|
+
if (!D.value || !e.length) return;
|
|
492
|
+
let t = D.value.getJSON().content, n = [...e, ...Ve(t) ? [] : t ?? []];
|
|
493
|
+
return D.value.commands.setContent(K(n), { emitUpdate: !1 }), G();
|
|
494
|
+
}
|
|
495
|
+
function X(e, t) {
|
|
496
|
+
let n = [];
|
|
497
|
+
return e.descendants((e, r) => {
|
|
498
|
+
e.type.name === "templateVariable" && e.attrs.key === t && n.push({
|
|
499
|
+
node: e,
|
|
500
|
+
pos: r
|
|
501
|
+
});
|
|
502
|
+
}), n;
|
|
231
503
|
}
|
|
232
|
-
function
|
|
233
|
-
if (!
|
|
504
|
+
function Ke(e, n = e.key) {
|
|
505
|
+
if (!D.value) return;
|
|
234
506
|
let r = t(e), i = !1;
|
|
235
|
-
return
|
|
236
|
-
|
|
507
|
+
return D.value.commands.command(({ tr: e, state: t, dispatch: a }) => (X(t.doc, n).forEach(({ node: t, pos: n }) => {
|
|
508
|
+
e.setNodeMarkup(n, void 0, {
|
|
237
509
|
...t.attrs,
|
|
238
510
|
...r
|
|
239
|
-
}), i = !0
|
|
511
|
+
}), i = !0;
|
|
240
512
|
}), i && a?.(e), i)), $(), i ? G() : void 0;
|
|
241
513
|
}
|
|
242
|
-
function
|
|
243
|
-
if (!
|
|
244
|
-
let t =
|
|
245
|
-
return
|
|
246
|
-
r.doc.
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
}
|
|
256
|
-
function Q() {
|
|
257
|
-
|
|
258
|
-
}
|
|
259
|
-
function
|
|
260
|
-
|
|
261
|
-
let t =
|
|
514
|
+
function qe(e) {
|
|
515
|
+
if (!D.value) return;
|
|
516
|
+
let t = 0;
|
|
517
|
+
return D.value.commands.command(({ tr: n, state: r, dispatch: i }) => {
|
|
518
|
+
let a = X(r.doc, e).map(({ node: e, pos: t }) => ({
|
|
519
|
+
from: t,
|
|
520
|
+
to: t + e.nodeSize
|
|
521
|
+
})).sort((e, t) => t.from - e.from);
|
|
522
|
+
return a.forEach((e) => n.delete(e.from, e.to)), t = a.length, t && i?.(n), t > 0;
|
|
523
|
+
}), t ? G() : void 0;
|
|
524
|
+
}
|
|
525
|
+
function Z() {
|
|
526
|
+
T.value?.querySelectorAll(".gd-contract-template-variable.is-active").forEach((e) => e.classList.remove("is-active"));
|
|
527
|
+
}
|
|
528
|
+
function Q(e) {
|
|
529
|
+
if (e) return Array.from(T.value?.querySelectorAll("[data-template-variable]") ?? []).find((t) => t.dataset.key === e);
|
|
530
|
+
}
|
|
531
|
+
function Je(e) {
|
|
532
|
+
Z();
|
|
533
|
+
let t = Q(e);
|
|
262
534
|
return t ? (t.classList.add("is-active"), t.scrollIntoView({
|
|
263
535
|
behavior: "smooth",
|
|
264
536
|
block: "center",
|
|
265
537
|
inline: "center"
|
|
266
|
-
}),
|
|
538
|
+
}), D.value?.commands.focus(), !0) : !1;
|
|
267
539
|
}
|
|
268
|
-
function
|
|
269
|
-
|
|
540
|
+
function Ye(e) {
|
|
541
|
+
let t = Array.from(T.value?.querySelectorAll("[data-signing-placement-id]") ?? []).find((t) => t.dataset.signingPlacementId === e);
|
|
542
|
+
return t?.scrollIntoView({
|
|
543
|
+
behavior: "smooth",
|
|
544
|
+
block: "center",
|
|
545
|
+
inline: "center"
|
|
546
|
+
}), !!t;
|
|
270
547
|
}
|
|
271
|
-
function
|
|
272
|
-
|
|
548
|
+
function $() {
|
|
549
|
+
Z(), Q(S.selectedVariableKey)?.classList.add("is-active");
|
|
273
550
|
}
|
|
274
|
-
function
|
|
275
|
-
let
|
|
276
|
-
if (!
|
|
277
|
-
let i =
|
|
278
|
-
|
|
551
|
+
function Xe(t) {
|
|
552
|
+
let n = e.find((e) => e.key === t), r = D.value;
|
|
553
|
+
if (!n || !r) return;
|
|
554
|
+
let i = r.chain().focus().clearNodes();
|
|
555
|
+
n.headingLevel ? i.setHeading({ level: n.headingLevel }) : i.setParagraph(), i.unsetAllMarks().unsetTextAlign().unsetFontSize().unsetFontFamily().unsetColor().setTextAlign(n.textAlign).setFontSize(`${n.fontSize}px`).setFontFamily(n.fontFamily || "Noto Serif SC, Source Han Serif SC, Songti SC, STSong, SimSun, serif").setColor(ne.color || "#1f2937"), n.bold ? i.setBold() : i.unsetBold(), n.italic ? i.setItalic() : i.unsetItalic(), n.underline ? i.setUnderline() : i.unsetUnderline(), i.run();
|
|
279
556
|
}
|
|
280
|
-
|
|
281
|
-
|
|
557
|
+
_([() => S.selectedVariableKey, () => S.variables], () => {
|
|
558
|
+
le($);
|
|
282
559
|
}, {
|
|
283
560
|
deep: !0,
|
|
284
561
|
flush: "post"
|
|
285
562
|
});
|
|
286
|
-
function
|
|
287
|
-
|
|
288
|
-
if (t) {
|
|
289
|
-
switch (e.type) {
|
|
290
|
-
case "undo":
|
|
291
|
-
t.undo().run();
|
|
292
|
-
break;
|
|
293
|
-
case "redo":
|
|
294
|
-
t.redo().run();
|
|
295
|
-
break;
|
|
296
|
-
case "set-paragraph":
|
|
297
|
-
t.setParagraph().run();
|
|
298
|
-
break;
|
|
299
|
-
case "set-heading":
|
|
300
|
-
t.setHeading({ level: e.level }).run();
|
|
301
|
-
break;
|
|
302
|
-
case "toggle-heading":
|
|
303
|
-
t.toggleHeading({ level: e.level }).run();
|
|
304
|
-
break;
|
|
305
|
-
case "toggle-bold":
|
|
306
|
-
t.toggleBold().run();
|
|
307
|
-
break;
|
|
308
|
-
case "toggle-italic":
|
|
309
|
-
t.toggleItalic().run();
|
|
310
|
-
break;
|
|
311
|
-
case "toggle-underline":
|
|
312
|
-
t.toggleUnderline().run();
|
|
313
|
-
break;
|
|
314
|
-
case "toggle-bullet-list":
|
|
315
|
-
t.toggleBulletList().run();
|
|
316
|
-
break;
|
|
317
|
-
case "toggle-ordered-list":
|
|
318
|
-
t.toggleOrderedList().run();
|
|
319
|
-
break;
|
|
320
|
-
case "set-text-align":
|
|
321
|
-
t.setTextAlign(e.value).run();
|
|
322
|
-
break;
|
|
323
|
-
case "unset-text-align":
|
|
324
|
-
t.unsetTextAlign().run();
|
|
325
|
-
break;
|
|
326
|
-
case "set-color":
|
|
327
|
-
t.setColor(e.value || "#1f2937").run();
|
|
328
|
-
break;
|
|
329
|
-
case "set-font-size":
|
|
330
|
-
t.setFontSize(`${e.value || 14}px`).run();
|
|
331
|
-
break;
|
|
332
|
-
case "unset-font-size":
|
|
333
|
-
t.unsetFontSize().run();
|
|
334
|
-
break;
|
|
335
|
-
case "set-font-family":
|
|
336
|
-
t.setFontFamily(e.value || "Noto Serif SC, Source Han Serif SC, Songti SC, STSong, SimSun, serif").run();
|
|
337
|
-
break;
|
|
338
|
-
case "unset-font-family":
|
|
339
|
-
t.unsetFontFamily().run();
|
|
340
|
-
break;
|
|
341
|
-
case "clear-text-format":
|
|
342
|
-
t.unsetAllMarks().unsetColor().unsetFontSize().unsetFontFamily().run();
|
|
343
|
-
break;
|
|
344
|
-
case "clear-block-format":
|
|
345
|
-
t.clearNodes().unsetTextAlign().run();
|
|
346
|
-
break;
|
|
347
|
-
case "apply-text-style-preset":
|
|
348
|
-
ce(e.preset);
|
|
349
|
-
break;
|
|
350
|
-
case "insert-table":
|
|
351
|
-
t.insertTable(e.options).run();
|
|
352
|
-
break;
|
|
353
|
-
case "add-table-row-before":
|
|
354
|
-
t.addRowBefore().run();
|
|
355
|
-
break;
|
|
356
|
-
case "add-table-row-after":
|
|
357
|
-
t.addRowAfter().run();
|
|
358
|
-
break;
|
|
359
|
-
case "delete-table-row":
|
|
360
|
-
t.deleteRow().run();
|
|
361
|
-
break;
|
|
362
|
-
case "add-table-column-before":
|
|
363
|
-
t.addColumnBefore().run();
|
|
364
|
-
break;
|
|
365
|
-
case "add-table-column-after":
|
|
366
|
-
t.addColumnAfter().run();
|
|
367
|
-
break;
|
|
368
|
-
case "delete-table-column":
|
|
369
|
-
t.deleteColumn().run();
|
|
370
|
-
break;
|
|
371
|
-
case "toggle-table-header-row":
|
|
372
|
-
t.toggleHeaderRow().run();
|
|
373
|
-
break;
|
|
374
|
-
case "toggle-table-header-column":
|
|
375
|
-
t.toggleHeaderColumn().run();
|
|
376
|
-
break;
|
|
377
|
-
case "toggle-table-header-cell":
|
|
378
|
-
t.toggleHeaderCell().run();
|
|
379
|
-
break;
|
|
380
|
-
case "delete-table":
|
|
381
|
-
t.deleteTable().run();
|
|
382
|
-
break;
|
|
383
|
-
}
|
|
384
|
-
R();
|
|
385
|
-
}
|
|
563
|
+
function Ze(e) {
|
|
564
|
+
e.type === "apply-text-style-preset" ? Xe(e.preset) : a(D.value, e), H();
|
|
386
565
|
}
|
|
387
|
-
function
|
|
388
|
-
|
|
566
|
+
function Qe() {
|
|
567
|
+
D.value?.commands.focus();
|
|
389
568
|
}
|
|
390
|
-
function
|
|
391
|
-
return
|
|
569
|
+
function $e() {
|
|
570
|
+
return D.value?.getJSON();
|
|
392
571
|
}
|
|
393
|
-
function
|
|
394
|
-
return
|
|
572
|
+
function et() {
|
|
573
|
+
return D.value?.getHTML() ?? S.page.contentHtml;
|
|
395
574
|
}
|
|
396
|
-
function
|
|
397
|
-
let t =
|
|
575
|
+
function tt(e) {
|
|
576
|
+
let t = S.variables.find((t) => t.id === e || t.key === e), n = t ? Q(t.key) : void 0;
|
|
398
577
|
$(), n?.scrollIntoView({
|
|
399
578
|
behavior: "smooth",
|
|
400
579
|
block: "center"
|
|
401
580
|
});
|
|
402
581
|
}
|
|
403
|
-
function
|
|
404
|
-
|
|
582
|
+
function nt() {
|
|
583
|
+
T.value?.scrollIntoView({
|
|
405
584
|
behavior: "smooth",
|
|
406
585
|
block: "start",
|
|
407
586
|
inline: "center"
|
|
408
587
|
});
|
|
409
588
|
}
|
|
410
|
-
return
|
|
411
|
-
|
|
412
|
-
}),
|
|
413
|
-
focus:
|
|
414
|
-
getHTML:
|
|
415
|
-
getJSON:
|
|
416
|
-
getEditorState:
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
589
|
+
return de(() => {
|
|
590
|
+
D.value?.destroy();
|
|
591
|
+
}), x({
|
|
592
|
+
focus: Qe,
|
|
593
|
+
getHTML: et,
|
|
594
|
+
getJSON: $e,
|
|
595
|
+
getEditorState: V,
|
|
596
|
+
getTableCommandCapabilities: N,
|
|
597
|
+
getAffectedVariableCount: F,
|
|
598
|
+
getVisibleSigningPlacementPosition: Fe,
|
|
599
|
+
insertVariable: Le,
|
|
600
|
+
insertContentImage: Re,
|
|
601
|
+
updateSelectedContentImage: ze,
|
|
602
|
+
getSelectionRange: Be,
|
|
603
|
+
hasOverflowContent: We,
|
|
604
|
+
updateVariable: Ke,
|
|
605
|
+
removeVariable: qe,
|
|
606
|
+
splitOverflowContent: Ge,
|
|
607
|
+
prependContent: Y,
|
|
608
|
+
runCommand: Ze,
|
|
609
|
+
scrollIntoField: tt,
|
|
610
|
+
scrollIntoVariable: Je,
|
|
611
|
+
scrollIntoSigningPlacement: Ye,
|
|
612
|
+
scrollIntoPage: nt
|
|
613
|
+
}), (e, t) => (m(), se("section", {
|
|
427
614
|
class: "gd-contract-template-designer__page-shell",
|
|
428
|
-
style:
|
|
429
|
-
}, [
|
|
430
|
-
class:
|
|
431
|
-
style:
|
|
432
|
-
}, [
|
|
615
|
+
style: p(Me.value)
|
|
616
|
+
}, [d("div", {
|
|
617
|
+
class: ue(["gd-contract-template-designer__page-zoom", { "is-active": f.active }]),
|
|
618
|
+
style: p(Ne.value)
|
|
619
|
+
}, [d("header", be, [d("span", null, h(f.page.title || `第 ${f.pageIndex + 1} 页`), 1), d("span", null, "第 " + h(f.pageIndex + 1) + " 页 · " + h(f.pageSize.label || "A4") + " · " + h(f.pageSize.width) + " × " + h(f.pageSize.height), 1)]), d("div", {
|
|
433
620
|
ref_key: "pageElement",
|
|
434
|
-
ref:
|
|
621
|
+
ref: T,
|
|
435
622
|
class: "gd-contract-template-designer__page",
|
|
436
|
-
style:
|
|
437
|
-
onDragover: t[
|
|
438
|
-
onDrop:
|
|
439
|
-
onClick: t[
|
|
440
|
-
}, [
|
|
623
|
+
style: p(je.value),
|
|
624
|
+
onDragover: t[3] ||= pe(() => {}, ["prevent"]),
|
|
625
|
+
onDrop: Ie,
|
|
626
|
+
onClick: t[4] ||= (e) => C("editor-focus", f.page.id)
|
|
627
|
+
}, [g(D) ? (m(), ae(g(me), {
|
|
441
628
|
key: 0,
|
|
442
|
-
editor:
|
|
443
|
-
}, null, 8, ["editor"])) :
|
|
629
|
+
editor: g(D)
|
|
630
|
+
}, null, 8, ["editor"])) : oe("", !0), ce(ie, {
|
|
631
|
+
"page-size": f.pageSize,
|
|
632
|
+
placements: f.signingPlacements,
|
|
633
|
+
"selected-id": f.selectedSigningPlacementId,
|
|
634
|
+
zoom: U.value,
|
|
635
|
+
readonly: f.readonly,
|
|
636
|
+
disabled: f.disabled,
|
|
637
|
+
onSelect: t[0] ||= (e) => C("signing-placement-select", e),
|
|
638
|
+
onMove: t[1] ||= (e) => C("signing-placement-move", e),
|
|
639
|
+
onRemove: t[2] ||= (e) => C("signing-placement-remove", e)
|
|
640
|
+
}, null, 8, [
|
|
641
|
+
"page-size",
|
|
642
|
+
"placements",
|
|
643
|
+
"selected-id",
|
|
644
|
+
"zoom",
|
|
645
|
+
"readonly",
|
|
646
|
+
"disabled"
|
|
647
|
+
])], 36)], 6)], 4));
|
|
444
648
|
}
|
|
445
649
|
});
|
|
446
650
|
//#endregion
|
|
447
|
-
export {
|
|
651
|
+
export { x as default };
|