@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
|
@@ -0,0 +1,737 @@
|
|
|
1
|
+
import { isSafeContractImageUrl as e } from "./image-url.mjs";
|
|
2
|
+
import t from "dompurify";
|
|
3
|
+
//#region src/components/pro-contract-template-designer/src/utils/word-paste.ts
|
|
4
|
+
var n = 4 * 1024 * 1024, r = new Set([
|
|
5
|
+
"image/png",
|
|
6
|
+
"image/jpeg",
|
|
7
|
+
"image/gif",
|
|
8
|
+
"image/webp",
|
|
9
|
+
"image/bmp"
|
|
10
|
+
]), i = "(?:file:|cid:|mhtml:|wordml:|blob:)", a = RegExp(`^${i}`, "i");
|
|
11
|
+
RegExp(`<(?:img|v:imagedata)\\b[^>]+\\bsrc\\s*=\\s*["']\\s*${i}`, "i");
|
|
12
|
+
var o = /* @__PURE__ */ "p.div.span.br.hr.h1.h2.h3.h4.h5.h6.strong.b.em.i.u.s.strike.del.sup.sub.blockquote.pre.code.a.ul.ol.li.table.thead.tbody.tfoot.tr.th.td.img".split("."), s = [
|
|
13
|
+
"style",
|
|
14
|
+
"href",
|
|
15
|
+
"target",
|
|
16
|
+
"rel",
|
|
17
|
+
"start",
|
|
18
|
+
"type",
|
|
19
|
+
"rowspan",
|
|
20
|
+
"colspan",
|
|
21
|
+
"colwidth",
|
|
22
|
+
"src",
|
|
23
|
+
"alt",
|
|
24
|
+
"title",
|
|
25
|
+
"width",
|
|
26
|
+
"height"
|
|
27
|
+
], c = new Set(s), l = new Set([
|
|
28
|
+
"script",
|
|
29
|
+
"style",
|
|
30
|
+
"meta",
|
|
31
|
+
"link",
|
|
32
|
+
"base",
|
|
33
|
+
"object",
|
|
34
|
+
"embed",
|
|
35
|
+
"iframe",
|
|
36
|
+
"frame",
|
|
37
|
+
"frameset",
|
|
38
|
+
"form",
|
|
39
|
+
"input",
|
|
40
|
+
"button",
|
|
41
|
+
"textarea",
|
|
42
|
+
"select",
|
|
43
|
+
"option",
|
|
44
|
+
"audio",
|
|
45
|
+
"video",
|
|
46
|
+
"source",
|
|
47
|
+
"track",
|
|
48
|
+
"canvas",
|
|
49
|
+
"svg",
|
|
50
|
+
"math",
|
|
51
|
+
"xml",
|
|
52
|
+
"template"
|
|
53
|
+
]), u = new Set([
|
|
54
|
+
"font-weight",
|
|
55
|
+
"font-style",
|
|
56
|
+
"text-decoration",
|
|
57
|
+
"text-decoration-line",
|
|
58
|
+
"color",
|
|
59
|
+
"background-color",
|
|
60
|
+
"font-size",
|
|
61
|
+
"font-family",
|
|
62
|
+
"vertical-align"
|
|
63
|
+
]), d = new Set([
|
|
64
|
+
"font-weight",
|
|
65
|
+
"font-style",
|
|
66
|
+
"text-decoration",
|
|
67
|
+
"text-decoration-line",
|
|
68
|
+
"color",
|
|
69
|
+
"background-color",
|
|
70
|
+
"font-size",
|
|
71
|
+
"font-family",
|
|
72
|
+
"text-align",
|
|
73
|
+
"line-height",
|
|
74
|
+
"margin-top",
|
|
75
|
+
"margin-bottom",
|
|
76
|
+
"margin-left",
|
|
77
|
+
"padding-left",
|
|
78
|
+
"text-indent",
|
|
79
|
+
"direction"
|
|
80
|
+
]), f = new Set([
|
|
81
|
+
"font-weight",
|
|
82
|
+
"font-style",
|
|
83
|
+
"text-decoration",
|
|
84
|
+
"text-decoration-line",
|
|
85
|
+
"color",
|
|
86
|
+
"background-color",
|
|
87
|
+
"font-size",
|
|
88
|
+
"font-family",
|
|
89
|
+
"text-align",
|
|
90
|
+
"line-height",
|
|
91
|
+
"margin-top",
|
|
92
|
+
"margin-bottom",
|
|
93
|
+
"margin-left",
|
|
94
|
+
"padding-left",
|
|
95
|
+
"text-indent",
|
|
96
|
+
"direction",
|
|
97
|
+
"list-style-type"
|
|
98
|
+
]), p = new Set([
|
|
99
|
+
"width",
|
|
100
|
+
"max-width",
|
|
101
|
+
"min-width",
|
|
102
|
+
"table-layout",
|
|
103
|
+
"border-collapse",
|
|
104
|
+
"margin-left",
|
|
105
|
+
"margin-right"
|
|
106
|
+
]), m = new Set(/* @__PURE__ */ "font-weight.font-style.text-decoration.text-decoration-line.color.background-color.font-size.font-family.text-align.line-height.margin-top.margin-bottom.margin-left.text-indent.direction.width.height.min-width.vertical-align.padding.padding-top.padding-right.padding-bottom.padding-left.border.border-top.border-right.border-bottom.border-left".split(".")), h = [
|
|
107
|
+
/urn:schemas-microsoft-com:office/i,
|
|
108
|
+
/xmlns:(?:o|w|m)\s*=/i,
|
|
109
|
+
/class\s*=\s*["'][^"']*\bMso/i,
|
|
110
|
+
/\bmso-[\w-]+\s*:/i,
|
|
111
|
+
/\[if\s+(?:gte\s+)?mso/i,
|
|
112
|
+
/Microsoft Word/i
|
|
113
|
+
], g = [
|
|
114
|
+
/\bListContainerWrapper\b/i,
|
|
115
|
+
/\bdata-listid\s*=/i,
|
|
116
|
+
/\bdata-list-defn-props\s*=/i,
|
|
117
|
+
/\bdata-ccp-props\s*=/i,
|
|
118
|
+
/\bdata-contrast\s*=/i
|
|
119
|
+
], ee = [
|
|
120
|
+
/\b(?:WPS Office|Kingsoft)\b/i,
|
|
121
|
+
/\bwpsoffice\b/i,
|
|
122
|
+
/\bwps-(?:office|list|paragraph)\b/i
|
|
123
|
+
];
|
|
124
|
+
function _(e) {
|
|
125
|
+
return /\bdata-pm-slice\s*=/i.test(e) ? "internal" : ee.some((t) => t.test(e)) ? "wps" : g.some((t) => t.test(e)) ? "word-online" : h.some((t) => t.test(e)) ? /Microsoft Word|Mso|xmlns:w/i.test(e) ? "word" : "office" : "generic";
|
|
126
|
+
}
|
|
127
|
+
function v(e) {
|
|
128
|
+
return e.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll("\"", """).replaceAll("'", "'").split(/\r?\n\r?\n/).map((e) => `<p>${e.replace(/\r?\n/g, "<br>") || "<br>"}</p>`).join("");
|
|
129
|
+
}
|
|
130
|
+
function te(e) {
|
|
131
|
+
let t = /(?:^|;)\s*mso-list\s*:\s*(?:l(\d+)\s+)?level(\d+)(?:\s+lfo(\d+))?/i.exec(e);
|
|
132
|
+
if (t) return {
|
|
133
|
+
id: t[1] ?? "0",
|
|
134
|
+
level: Math.max(1, Math.min(9, Number.parseInt(t[2] ?? "1", 10) || 1)),
|
|
135
|
+
lfo: t[3] ?? "0"
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
function y(e, t = "span") {
|
|
139
|
+
let n = t.toLowerCase(), r = n === "td" || n === "th" ? m : n === "table" ? p : n === "ul" || n === "ol" ? f : /^(?:p|div|h[1-6]|blockquote|li)$/.test(n) ? d : u, i = C(e), a = i.find(([e]) => e.trim().toLowerCase() === "direction")?.[1]?.trim().toLowerCase() === "rtl" ? "rtl" : "ltr", o = /* @__PURE__ */ new Map();
|
|
140
|
+
for (let [e, t] of i) {
|
|
141
|
+
let n = e.toLowerCase().trim(), i = t.trim().replace(/\s*!important\s*$/i, "");
|
|
142
|
+
if (n === "mso-highlight" || n === "background") n = "background-color";
|
|
143
|
+
else if (n === "mso-padding-alt") n = "padding";
|
|
144
|
+
else if (n === "mso-border-alt") n = "border";
|
|
145
|
+
else if (/^mso-border-(top|right|bottom|left)-alt$/.test(n)) n = n.replace(/^mso-border-(top|right|bottom|left)-alt$/, "border-$1");
|
|
146
|
+
else if (n.startsWith("mso-")) continue;
|
|
147
|
+
r.has(n) && (n === "text-align" && /^(?:start|end)$/i.test(i) && (i = T(i, a)), i = w(n, i), i && o.set(n === "text-decoration-line" ? "text-decoration" : n, i));
|
|
148
|
+
}
|
|
149
|
+
return Array.from(o.entries()).map(([e, t]) => `${e}: ${t}`).join("; ");
|
|
150
|
+
}
|
|
151
|
+
function b(e) {
|
|
152
|
+
if (!e || e.length > 12582912 * 3) return [];
|
|
153
|
+
let t = [], n = 0, r = 0;
|
|
154
|
+
for (; r < e.length;) {
|
|
155
|
+
let i = e.indexOf("{\\pict", r);
|
|
156
|
+
if (i < 0) break;
|
|
157
|
+
let a = fe(e, i);
|
|
158
|
+
if (a < 0) break;
|
|
159
|
+
let o = e.slice(i, a + 1);
|
|
160
|
+
r = i + 6;
|
|
161
|
+
let s = pe(o), c = /\\pngblip\b/i.test(s) ? "image/png" : /\\jpe?gblip\b/i.test(s) ? "image/jpeg" : "";
|
|
162
|
+
if (!c) continue;
|
|
163
|
+
let l = s.replace(/^\{\\pict\b/i, "").replace(/\\[a-z]+-?\d*\s?/gi, "").replace(/\\[^a-z]/gi, "").replace(/[{}\s]/g, "");
|
|
164
|
+
if (!l || l.length % 2 || /[^\da-f]/i.test(l)) continue;
|
|
165
|
+
let u = l.length / 2;
|
|
166
|
+
u > 5242880 || n + u > 12582912 || he(l, c) && (n += u, t.push(`data:${c};base64,${me(l)}`));
|
|
167
|
+
}
|
|
168
|
+
return t;
|
|
169
|
+
}
|
|
170
|
+
async function x(e, t) {
|
|
171
|
+
let n = [], i = 0;
|
|
172
|
+
for (let a of e) {
|
|
173
|
+
let e = a.type.toLowerCase();
|
|
174
|
+
if (!r.has(e) || a.size <= 0 || a.size > 5242880) {
|
|
175
|
+
n.push(Promise.resolve(null));
|
|
176
|
+
continue;
|
|
177
|
+
}
|
|
178
|
+
if (i + a.size > 12582912) {
|
|
179
|
+
n.push(Promise.resolve(null));
|
|
180
|
+
continue;
|
|
181
|
+
}
|
|
182
|
+
i += a.size, n.push((t ? t(a) : ge(a)).then((e) => e && Y(e) ? e : null).catch(() => null));
|
|
183
|
+
}
|
|
184
|
+
return Promise.all(n);
|
|
185
|
+
}
|
|
186
|
+
function S(e, r = {}) {
|
|
187
|
+
let i = _(e);
|
|
188
|
+
if (i === "internal" && r.trustedInternal) return {
|
|
189
|
+
html: e,
|
|
190
|
+
source: i,
|
|
191
|
+
converted: !1,
|
|
192
|
+
fallback: !1,
|
|
193
|
+
recoveredImageCount: 0
|
|
194
|
+
};
|
|
195
|
+
let a = v(r.plainText ?? ie(e));
|
|
196
|
+
if (!e || e.length > n || typeof window > "u" || typeof DOMParser > "u") return {
|
|
197
|
+
html: a,
|
|
198
|
+
source: i,
|
|
199
|
+
converted: !0,
|
|
200
|
+
fallback: !0,
|
|
201
|
+
recoveredImageCount: 0
|
|
202
|
+
};
|
|
203
|
+
try {
|
|
204
|
+
let n = i !== "generic" && i !== "internal", c = ne(e), l = new DOMParser().parseFromString(n ? re(c) : c, "text/html"), u = k(l), d = u.size > 0 || j(l);
|
|
205
|
+
(n || d) && A(l, u), n && (M(l), N(l));
|
|
206
|
+
let f = n ? b(r.rtf ?? "") : [], p = !!r.preferClipboardImages && f.length === 0, m = U(l, {
|
|
207
|
+
office: n,
|
|
208
|
+
replacementImages: f.length ? f : r.clipboardImages ?? [],
|
|
209
|
+
appendClipboardImages: f.length === 0 ? r.clipboardImages ?? [] : [],
|
|
210
|
+
preferClipboardImages: p
|
|
211
|
+
}), h = t(window), g = String(h.sanitize(l.body.innerHTML, {
|
|
212
|
+
ALLOWED_TAGS: o,
|
|
213
|
+
ALLOWED_ATTR: s,
|
|
214
|
+
ALLOW_DATA_ATTR: !1,
|
|
215
|
+
ALLOW_ARIA_ATTR: !1,
|
|
216
|
+
KEEP_CONTENT: !0,
|
|
217
|
+
RETURN_TRUSTED_TYPE: !1
|
|
218
|
+
}));
|
|
219
|
+
return {
|
|
220
|
+
html: g || a,
|
|
221
|
+
source: i,
|
|
222
|
+
converted: !0,
|
|
223
|
+
fallback: !g,
|
|
224
|
+
recoveredImageCount: m
|
|
225
|
+
};
|
|
226
|
+
} catch {
|
|
227
|
+
return {
|
|
228
|
+
html: a,
|
|
229
|
+
source: i,
|
|
230
|
+
converted: !0,
|
|
231
|
+
fallback: !0,
|
|
232
|
+
recoveredImageCount: 0
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
function ne(e) {
|
|
237
|
+
return /<!--StartFragment-->([\s\S]*?)<!--EndFragment-->/i.exec(e)?.[1] ?? e;
|
|
238
|
+
}
|
|
239
|
+
function re(e) {
|
|
240
|
+
return e.replace(/<!--\s*\[if\s+!supportLists\]\s*>([\s\S]*?)<!\s*\[endif\]\s*-->/gi, "$1").replace(/<!\s*\[if\s+!supportLists\]\s*>([\s\S]*?)<!\s*\[endif\]\s*>/gi, "$1");
|
|
241
|
+
}
|
|
242
|
+
function ie(e) {
|
|
243
|
+
return e.replace(/<br\s*\/?>/gi, "\n").replace(/<\/(?:p|div|li|h[1-6]|tr)>/gi, "\n").replace(/<[^>]*>/g, "").replace(/ /gi, " ").replace(/&/gi, "&").replace(/</gi, "<").replace(/>/gi, ">").trim();
|
|
244
|
+
}
|
|
245
|
+
function C(e) {
|
|
246
|
+
let t = [], n = 0, r = "", i = 0;
|
|
247
|
+
for (let a = 0; a <= e.length; a++) {
|
|
248
|
+
let o = e[a] ?? ";";
|
|
249
|
+
if (r) {
|
|
250
|
+
o === r && e[a - 1] !== "\\" && (r = "");
|
|
251
|
+
continue;
|
|
252
|
+
}
|
|
253
|
+
if (o === "\"" || o === "'") {
|
|
254
|
+
r = o;
|
|
255
|
+
continue;
|
|
256
|
+
}
|
|
257
|
+
if (o === "(") i++;
|
|
258
|
+
else if (o === ")") i = Math.max(0, i - 1);
|
|
259
|
+
else if (o === ";" && i === 0) {
|
|
260
|
+
let r = e.slice(n, a), i = r.indexOf(":");
|
|
261
|
+
i > 0 && t.push([r.slice(0, i), r.slice(i + 1)]), n = a + 1;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
return t;
|
|
265
|
+
}
|
|
266
|
+
function w(e, t) {
|
|
267
|
+
let n = t.trim();
|
|
268
|
+
if (!n || n.length > 220 || /(?:url\s*\(|expression\s*\(|javascript:|vbscript:|data:|@import|var\s*\()/i.test(n)) return "";
|
|
269
|
+
if (e === "font-size") return E(n, {
|
|
270
|
+
min: 8,
|
|
271
|
+
max: 120,
|
|
272
|
+
convertPt: !0,
|
|
273
|
+
allowPercent: !0
|
|
274
|
+
});
|
|
275
|
+
if (e === "padding") return oe(n);
|
|
276
|
+
if (/^(?:margin-(?:top|bottom|left|right)|text-indent)$/.test(e)) return E(n, {
|
|
277
|
+
min: -2e3,
|
|
278
|
+
max: 2e3,
|
|
279
|
+
allowPercent: !0
|
|
280
|
+
});
|
|
281
|
+
if (/^(?:padding-(?:top|right|bottom|left)|width|height|min-width|max-width)$/.test(e)) return E(n, {
|
|
282
|
+
min: 0,
|
|
283
|
+
max: 2400,
|
|
284
|
+
allowPercent: !0
|
|
285
|
+
});
|
|
286
|
+
if (e === "line-height") {
|
|
287
|
+
let e = Number(n);
|
|
288
|
+
return Number.isFinite(e) && e >= .5 && e <= 4 ? String(e) : E(n, {
|
|
289
|
+
min: 8,
|
|
290
|
+
max: 160,
|
|
291
|
+
convertPt: !0,
|
|
292
|
+
allowPercent: !0
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
return e === "color" || e === "background-color" ? O(n) : e === "font-family" ? /^[\w\s,'"\-\u00A0-\uFFFF]+$/.test(n) ? n : "" : e === "font-weight" ? /^(?:normal|bold|bolder|lighter|[1-9]00)$/i.test(n) ? n.toLowerCase() : "" : e === "font-style" ? /^(?:normal|italic|oblique)$/i.test(n) ? n.toLowerCase() : "" : e === "text-decoration" ? /^(?:(?:none|underline|line-through|overline)\s*)+$/i.test(n) ? n.toLowerCase() : "" : e === "text-align" ? /^(?:left|right|center|justify|start|end)$/i.test(n) ? T(n, "ltr") : "" : e === "vertical-align" ? /^(?:top|middle|bottom|baseline|sub|super)$/i.test(n) ? n.toLowerCase() : "" : e === "direction" ? /^(?:ltr|rtl)$/i.test(n) ? n.toLowerCase() : "" : e === "list-style-type" ? /^(?:disc|circle|square|decimal|lower-alpha|upper-alpha|lower-roman|upper-roman|cjk-ideographic)$/i.test(n) ? n.toLowerCase() : "" : e === "table-layout" ? /^(?:auto|fixed)$/i.test(n) ? n.toLowerCase() : "" : e === "border-collapse" ? /^(?:collapse|separate)$/i.test(n) ? n.toLowerCase() : "" : /^border(?:-(?:top|right|bottom|left))?$/.test(e) ? ae(n) : "";
|
|
296
|
+
}
|
|
297
|
+
function T(e, t) {
|
|
298
|
+
let n = e.toLowerCase();
|
|
299
|
+
return n === "start" ? t === "rtl" ? "right" : "left" : n === "end" ? t === "rtl" ? "left" : "right" : n;
|
|
300
|
+
}
|
|
301
|
+
function E(e, t) {
|
|
302
|
+
if (e === "0") return "0";
|
|
303
|
+
let n = /^(-?(?:\d+(?:\.\d+)?|\.\d+))(px|pt|cm|mm|in|pc|em|rem|%)$/i.exec(e);
|
|
304
|
+
if (!n || !t.allowPercent && n[2] === "%") return "";
|
|
305
|
+
let r = Number(n[1]), i = n[2].toLowerCase();
|
|
306
|
+
if (i === "%" && (r < Math.max(t.min, -500) || r > Math.min(t.max, 500))) return "";
|
|
307
|
+
let a = i === "%" ? r : r * D(i);
|
|
308
|
+
return !Number.isFinite(r) || a < t.min || a > t.max ? "" : r === 0 ? "0" : (t.convertPt && i === "pt" && (r = Math.round(r * 4 / 3 * 100) / 100, i = "px"), `${r}${i}`);
|
|
309
|
+
}
|
|
310
|
+
function D(e) {
|
|
311
|
+
return e === "pt" ? 4 / 3 : e === "cm" ? 96 / 2.54 : e === "mm" ? 96 / 25.4 : e === "in" ? 96 : e === "pc" || e === "em" || e === "rem" ? 16 : 1;
|
|
312
|
+
}
|
|
313
|
+
function O(e) {
|
|
314
|
+
return /^(?:windowtext|buttontext|canvastext)$/i.test(e) ? "black" : /^(?:window|buttonface|canvas)$/i.test(e) ? "white" : /^(?:transparent|currentcolor|black|white|red|green|blue|gray|grey|yellow|orange|purple|navy|teal|maroon|silver|fuchsia|aqua|lime)$/i.test(e) || /^#[\da-f]{3,8}$/i.test(e) ? e.toLowerCase() : /^(?:rgb|rgba|hsl|hsla)\(\s*[-\d.%]+(?:\s*[,/]\s*[-\d.%]+){2,3}\s*\)$/i.test(e) ? e : "";
|
|
315
|
+
}
|
|
316
|
+
function ae(e) {
|
|
317
|
+
if (/^none$/i.test(e)) return "none";
|
|
318
|
+
let t = /^((?:\d+(?:\.\d+)?|\.\d+)(?:px|pt))\s+(solid|dashed|dotted|double)\s+(.+)$/i.exec(e), n = /^(solid|dashed|dotted|double)\s+(.+?)\s+((?:\d+(?:\.\d+)?|\.\d+)(?:px|pt))$/i.exec(e), r = t?.[1] ?? n?.[3], i = t?.[2] ?? n?.[1], a = t?.[3] ?? n?.[2];
|
|
319
|
+
if (!r || !i || !a) return "";
|
|
320
|
+
let o = E(r, {
|
|
321
|
+
min: 0,
|
|
322
|
+
max: 24,
|
|
323
|
+
convertPt: !0
|
|
324
|
+
}), s = O(a.trim());
|
|
325
|
+
return o && s ? `${o} ${i.toLowerCase()} ${s}` : "";
|
|
326
|
+
}
|
|
327
|
+
function oe(e) {
|
|
328
|
+
let t = e.trim().split(/\s+/);
|
|
329
|
+
if (t.length < 1 || t.length > 4) return "";
|
|
330
|
+
let n = t.map((e) => E(e, {
|
|
331
|
+
min: 0,
|
|
332
|
+
max: 2400,
|
|
333
|
+
allowPercent: !0
|
|
334
|
+
}));
|
|
335
|
+
return n.every(Boolean) ? n.join(" ") : "";
|
|
336
|
+
}
|
|
337
|
+
function k(e) {
|
|
338
|
+
let t = /* @__PURE__ */ new Map();
|
|
339
|
+
for (let n of Array.from(e.querySelectorAll("style"))) {
|
|
340
|
+
let e = n.textContent ?? "", r = /([^{}]+)\{([^{}]*)\}/g, i = r.exec(e);
|
|
341
|
+
for (; i;) {
|
|
342
|
+
for (let e of i[1].split(",")) {
|
|
343
|
+
let n = /\.([_a-z][\w-]*)/i.exec(e)?.[1];
|
|
344
|
+
n && t.set(n, `${t.get(n) ?? ""};${i[2]}`);
|
|
345
|
+
}
|
|
346
|
+
i = r.exec(e);
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
return t;
|
|
350
|
+
}
|
|
351
|
+
function A(e, t) {
|
|
352
|
+
for (let n of Array.from(e.body.querySelectorAll("[class]"))) {
|
|
353
|
+
let e = Array.from(n.classList).map((e) => t.get(e) ?? "").filter(Boolean).join(";");
|
|
354
|
+
e && n.setAttribute("style", `${e};${n.getAttribute("style") ?? ""}`);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
function j(e) {
|
|
358
|
+
return !!e.body.querySelector("p[align],div[align],h1[align],h2[align],h3[align],h4[align],h5[align],h6[align],center,font");
|
|
359
|
+
}
|
|
360
|
+
function M(e) {
|
|
361
|
+
for (let t of Array.from(e.body.querySelectorAll("p,div"))) {
|
|
362
|
+
let n = t.className, r = t.getAttribute("style") ?? "", i = /(?:Mso)?Heading\s*([1-6])|MsoHeading([1-6])/i.exec(`${n};${r}`), a = i ? Number(i[1] ?? i[2]) : /MsoTitle/i.test(n) ? 1 : /MsoSubtitle/i.test(n) ? 2 : 0;
|
|
363
|
+
a && H(e, t, `h${a}`);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
function N(e) {
|
|
367
|
+
let t = [e.body, ...Array.from(e.body.querySelectorAll("td,th,div,blockquote"))];
|
|
368
|
+
for (let n of t.reverse()) P(e, n);
|
|
369
|
+
}
|
|
370
|
+
function P(e, t) {
|
|
371
|
+
let n = Array.from(t.childNodes), r = [];
|
|
372
|
+
for (let i of n) {
|
|
373
|
+
if (i.nodeType === 3 && !(i.textContent ?? "").trim()) continue;
|
|
374
|
+
if (i.nodeType !== 1) {
|
|
375
|
+
r = [];
|
|
376
|
+
continue;
|
|
377
|
+
}
|
|
378
|
+
let n = i, a = F(n);
|
|
379
|
+
if (!a) {
|
|
380
|
+
r = [];
|
|
381
|
+
continue;
|
|
382
|
+
}
|
|
383
|
+
let o = Math.min(a.level, r.length + 1);
|
|
384
|
+
o <= r.length && (r = r.slice(0, o));
|
|
385
|
+
let s = r[o - 1];
|
|
386
|
+
if (!s || s.kind !== a.kind || a.type != null && s.type !== a.type || s.session !== a.session || a.kind === "ol" && a.start != null && s.expectedStart != null && a.start !== s.expectedStart) {
|
|
387
|
+
let i = e.createElement(a.kind);
|
|
388
|
+
if (a.kind === "ol" && a.start && a.start !== 1 && i.setAttribute("start", String(a.start)), a.kind === "ol" && a.type && i.setAttribute("type", a.type), a.listStyleType && i.setAttribute("style", `list-style-type: ${a.listStyleType}`), o === 1) t.insertBefore(i, n);
|
|
389
|
+
else {
|
|
390
|
+
let e = r[o - 2];
|
|
391
|
+
e?.lastItem ? e.lastItem.appendChild(i) : (t.insertBefore(i, n), r = []);
|
|
392
|
+
}
|
|
393
|
+
s = {
|
|
394
|
+
...a,
|
|
395
|
+
level: o,
|
|
396
|
+
list: i
|
|
397
|
+
}, r[o - 1] = s;
|
|
398
|
+
}
|
|
399
|
+
let c = e.createElement("li");
|
|
400
|
+
for (z(n); n.firstChild;) c.appendChild(n.firstChild);
|
|
401
|
+
s.list.appendChild(c), s.lastItem = c, s.expectedStart = a.kind === "ol" ? (a.start ?? s.expectedStart ?? 1) + 1 : void 0, n.remove();
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
function F(e) {
|
|
405
|
+
if (!/^(?:p|div)$/i.test(e.tagName)) return;
|
|
406
|
+
let t = te(e.getAttribute("style") ?? "");
|
|
407
|
+
if (!t) return;
|
|
408
|
+
let n = B(e), r = n.text, i = n.font;
|
|
409
|
+
if (/[•·●○■□◆◇▪▫]/.test(r) || /(?:Symbol|Wingdings|Webdings)/i.test(i)) {
|
|
410
|
+
let e = /[○◇▫]/.test(r) ? "circle" : /[■□▪]/.test(r) ? "square" : "disc";
|
|
411
|
+
return {
|
|
412
|
+
...t,
|
|
413
|
+
session: `${t.id}:${t.lfo}`,
|
|
414
|
+
kind: "ul",
|
|
415
|
+
listStyleType: e
|
|
416
|
+
};
|
|
417
|
+
}
|
|
418
|
+
let a = I(r);
|
|
419
|
+
return {
|
|
420
|
+
...t,
|
|
421
|
+
session: `${t.id}:${t.lfo}`,
|
|
422
|
+
kind: "ol",
|
|
423
|
+
type: a?.type,
|
|
424
|
+
listStyleType: a?.listStyleType ?? "decimal",
|
|
425
|
+
start: a?.start
|
|
426
|
+
};
|
|
427
|
+
}
|
|
428
|
+
function I(e) {
|
|
429
|
+
let t = e.trim().replace(/^[((]/, "").replace(/[))\..、]\s*$/, "").trim();
|
|
430
|
+
if (/^\d+$/.test(t)) return {
|
|
431
|
+
start: Math.max(1, Number(t)),
|
|
432
|
+
type: "1",
|
|
433
|
+
listStyleType: "decimal"
|
|
434
|
+
};
|
|
435
|
+
if (/^[ivxlcdm]+$/i.test(t)) {
|
|
436
|
+
let e = t === t.toUpperCase();
|
|
437
|
+
return {
|
|
438
|
+
start: R(t),
|
|
439
|
+
type: e ? "I" : "i",
|
|
440
|
+
listStyleType: e ? "upper-roman" : "lower-roman"
|
|
441
|
+
};
|
|
442
|
+
}
|
|
443
|
+
if (/^[a-z]$/i.test(t)) {
|
|
444
|
+
let e = t === t.toUpperCase();
|
|
445
|
+
return {
|
|
446
|
+
start: t.toLowerCase().charCodeAt(0) - 96,
|
|
447
|
+
type: e ? "A" : "a",
|
|
448
|
+
listStyleType: e ? "upper-alpha" : "lower-alpha"
|
|
449
|
+
};
|
|
450
|
+
}
|
|
451
|
+
if (/^[零〇一二三四五六七八九十百千万]+$/.test(t)) return {
|
|
452
|
+
start: L(t),
|
|
453
|
+
type: void 0,
|
|
454
|
+
listStyleType: "cjk-ideographic"
|
|
455
|
+
};
|
|
456
|
+
}
|
|
457
|
+
function L(e) {
|
|
458
|
+
let t = {
|
|
459
|
+
零: 0,
|
|
460
|
+
〇: 0,
|
|
461
|
+
一: 1,
|
|
462
|
+
二: 2,
|
|
463
|
+
三: 3,
|
|
464
|
+
四: 4,
|
|
465
|
+
五: 5,
|
|
466
|
+
六: 6,
|
|
467
|
+
七: 7,
|
|
468
|
+
八: 8,
|
|
469
|
+
九: 9
|
|
470
|
+
}, n = {
|
|
471
|
+
十: 10,
|
|
472
|
+
百: 100,
|
|
473
|
+
千: 1e3,
|
|
474
|
+
万: 1e4
|
|
475
|
+
}, r = 0, i = 0, a = 0;
|
|
476
|
+
for (let o of e) {
|
|
477
|
+
if (o in t) {
|
|
478
|
+
a = t[o];
|
|
479
|
+
continue;
|
|
480
|
+
}
|
|
481
|
+
let e = n[o];
|
|
482
|
+
e && (e === 1e4 ? (i = (i + a || 1) * e, r += i, i = 0, a = 0) : (i += (a || 1) * e, a = 0));
|
|
483
|
+
}
|
|
484
|
+
return Math.max(1, r + i + a);
|
|
485
|
+
}
|
|
486
|
+
function R(e) {
|
|
487
|
+
let t = {
|
|
488
|
+
i: 1,
|
|
489
|
+
v: 5,
|
|
490
|
+
x: 10,
|
|
491
|
+
l: 50,
|
|
492
|
+
c: 100,
|
|
493
|
+
d: 500,
|
|
494
|
+
m: 1e3
|
|
495
|
+
}, n = 0, r = 0;
|
|
496
|
+
for (let i of e.toLowerCase().split("").reverse()) {
|
|
497
|
+
let e = t[i] ?? 0;
|
|
498
|
+
n += e < r ? -e : e, r = Math.max(r, e);
|
|
499
|
+
}
|
|
500
|
+
return Math.max(1, n);
|
|
501
|
+
}
|
|
502
|
+
function z(e) {
|
|
503
|
+
B(e).element?.remove(), e.firstChild?.nodeType === 3 && (e.firstChild.textContent = e.firstChild.textContent?.replace(/^[\s\u00A0]+/, "") ?? "");
|
|
504
|
+
}
|
|
505
|
+
function B(e) {
|
|
506
|
+
let t = Array.from(e.querySelectorAll("span")).find((e) => /mso-list\s*:\s*ignore/i.test(e.getAttribute("style") ?? ""));
|
|
507
|
+
if (t) return {
|
|
508
|
+
element: t,
|
|
509
|
+
text: V(t.textContent ?? ""),
|
|
510
|
+
font: t.style.fontFamily
|
|
511
|
+
};
|
|
512
|
+
let n = e.querySelector("span"), r = V(n?.textContent ?? ""), i = n?.style.fontFamily ?? "";
|
|
513
|
+
return /[•·●○■□◆◇▪▫]/.test(r) || /(?:Symbol|Wingdings|Webdings)/i.test(i) || /^(?:\d+|[a-z]|[ivxlcdm]+)[.)、]$/i.test(r) || /^[((]?[零〇一二三四五六七八九十百千万]+[))\..、]$/.test(r) ? {
|
|
514
|
+
element: n ?? void 0,
|
|
515
|
+
text: r,
|
|
516
|
+
font: i
|
|
517
|
+
} : {
|
|
518
|
+
text: "",
|
|
519
|
+
font: ""
|
|
520
|
+
};
|
|
521
|
+
}
|
|
522
|
+
function V(e) {
|
|
523
|
+
return e.replace(/[\u00A0\s]+/g, " ").trim();
|
|
524
|
+
}
|
|
525
|
+
function H(e, t, n) {
|
|
526
|
+
let r = e.createElement(n);
|
|
527
|
+
for (let e of Array.from(t.attributes)) r.setAttribute(e.name, e.value);
|
|
528
|
+
for (; t.firstChild;) r.appendChild(t.firstChild);
|
|
529
|
+
return t.replaceWith(r), r;
|
|
530
|
+
}
|
|
531
|
+
function U(e, t) {
|
|
532
|
+
$(e.body), K(e), ce(e), W(e);
|
|
533
|
+
let n = 0, r = 0, i = 0;
|
|
534
|
+
for (let a of Array.from(e.body.querySelectorAll("*"))) {
|
|
535
|
+
let o = a.tagName.toLowerCase();
|
|
536
|
+
if (l.has(o)) {
|
|
537
|
+
a.remove();
|
|
538
|
+
continue;
|
|
539
|
+
}
|
|
540
|
+
if (q(a), o === "img") {
|
|
541
|
+
let e = n < t.replacementImages.length, o = le(a, t.replacementImages[n], e, t.preferClipboardImages === !0);
|
|
542
|
+
if (o.consumedReplacement && n++, o.usedReplacement && r++, !o.kept) continue;
|
|
543
|
+
i++;
|
|
544
|
+
} else o === "a" && ue(a);
|
|
545
|
+
let s = y(a.getAttribute("style") ?? "", o);
|
|
546
|
+
s ? a.setAttribute("style", s) : a.removeAttribute("style"), G(e, a), se(e, a), Z(a);
|
|
547
|
+
for (let e of Array.from(a.attributes)) {
|
|
548
|
+
let t = e.name.toLowerCase();
|
|
549
|
+
(!c.has(t) || t.startsWith("on") || t.startsWith("data-") || t === "class" || t === "id" || t === "lang" || t.includes(":")) && a.removeAttribute(e.name);
|
|
550
|
+
}
|
|
551
|
+
let u = a.style.verticalAlign;
|
|
552
|
+
(u === "super" || u === "sub") && o === "span" && H(e, a, u === "super" ? "sup" : "sub");
|
|
553
|
+
}
|
|
554
|
+
if (!i && t.appendClipboardImages.length) for (let n of t.appendClipboardImages) {
|
|
555
|
+
if (!n || !Y(n)) continue;
|
|
556
|
+
let t = e.createElement("p"), i = e.createElement("img");
|
|
557
|
+
i.setAttribute("src", n), i.setAttribute("alt", ""), t.appendChild(i), e.body.appendChild(t), r++;
|
|
558
|
+
}
|
|
559
|
+
return r;
|
|
560
|
+
}
|
|
561
|
+
function W(e) {
|
|
562
|
+
for (let t of Array.from(e.body.querySelectorAll("font"))) q(t), H(e, t, "span");
|
|
563
|
+
for (let t of Array.from(e.body.querySelectorAll("center"))) t.setAttribute("style", `${t.getAttribute("style") ?? ""};text-align:center`), H(e, t, "div");
|
|
564
|
+
}
|
|
565
|
+
function se(e, t) {
|
|
566
|
+
let n = t.tagName.toLowerCase();
|
|
567
|
+
if (!/^(?:b|strong|em|i|u|s|strike|del|sup|sub|a)$/.test(n)) return;
|
|
568
|
+
let r = C(t.getAttribute("style") ?? ""), i = [], a = [];
|
|
569
|
+
for (let [e, t] of r) {
|
|
570
|
+
let n = e.trim().toLowerCase(), r = t.trim();
|
|
571
|
+
(n === "font-family" || n === "font-size" || n === "color" || n === "background-color" ? i : a).push(`${n}: ${r}`);
|
|
572
|
+
}
|
|
573
|
+
if (!i.length) return;
|
|
574
|
+
a.length ? t.setAttribute("style", a.join("; ")) : t.removeAttribute("style");
|
|
575
|
+
let o = e.createElement("span");
|
|
576
|
+
for (o.setAttribute("style", i.join("; ")); t.firstChild;) o.appendChild(t.firstChild);
|
|
577
|
+
t.appendChild(o);
|
|
578
|
+
}
|
|
579
|
+
function G(e, t) {
|
|
580
|
+
let n = t.tagName.toLowerCase();
|
|
581
|
+
if (!/^(?:p|div|h[1-6]|blockquote|li|td|th)$/.test(n)) return;
|
|
582
|
+
let r = C(t.getAttribute("style") ?? ""), i = [], a = [];
|
|
583
|
+
for (let [e, t] of r) {
|
|
584
|
+
let r = e.trim().toLowerCase(), o = t.trim();
|
|
585
|
+
(u.has(r) && r !== "vertical-align" && !((n === "td" || n === "th") && r === "background-color") ? i : a).push(`${r}: ${o}`);
|
|
586
|
+
}
|
|
587
|
+
if (!i.length) return;
|
|
588
|
+
a.length ? t.setAttribute("style", a.join("; ")) : t.removeAttribute("style");
|
|
589
|
+
let o = e.createElement("span");
|
|
590
|
+
for (o.setAttribute("style", i.join("; ")); t.firstChild;) o.appendChild(t.firstChild);
|
|
591
|
+
t.appendChild(o);
|
|
592
|
+
}
|
|
593
|
+
function K(e) {
|
|
594
|
+
for (let t of Array.from(e.body.querySelectorAll("*"))) {
|
|
595
|
+
if (t.tagName.toLowerCase() !== "v:imagedata") continue;
|
|
596
|
+
let n = e.createElement("img");
|
|
597
|
+
n.setAttribute("src", t.getAttribute("src") ?? t.getAttribute("o:href") ?? ""), n.setAttribute("alt", t.getAttribute("o:title") ?? t.getAttribute("title") ?? "");
|
|
598
|
+
let r = t.parentElement?.tagName.toLowerCase() === "v:shape" ? t.parentElement : void 0;
|
|
599
|
+
if (r) {
|
|
600
|
+
let e = X(r.style.width), t = X(r.style.height);
|
|
601
|
+
e && n.setAttribute("width", e), t && n.setAttribute("height", t), r.replaceWith(n);
|
|
602
|
+
} else t.replaceWith(n);
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
function ce(e) {
|
|
606
|
+
for (let t of Array.from(e.body.querySelectorAll("*")).reverse()) {
|
|
607
|
+
let e = t.tagName.toLowerCase();
|
|
608
|
+
if (e.includes(":")) {
|
|
609
|
+
if (/^(?:v|m):/.test(e)) {
|
|
610
|
+
t.remove();
|
|
611
|
+
continue;
|
|
612
|
+
}
|
|
613
|
+
t.replaceWith(...Array.from(t.childNodes));
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
function q(e) {
|
|
618
|
+
let t = e.tagName.toLowerCase(), n = [e.getAttribute("style") ?? ""], r = (e, t) => {
|
|
619
|
+
t && n.push(`${e}:${t}`);
|
|
620
|
+
};
|
|
621
|
+
t === "font" && (r("font-family", e.getAttribute("face")), r("color", e.getAttribute("color"))), (t === "table" || t === "td" || t === "th") && (r("width", J(e.getAttribute("width"))), r("height", J(e.getAttribute("height"))), r("background-color", e.getAttribute("bgcolor")), r("text-align", e.getAttribute("align")), r("vertical-align", e.getAttribute("valign"))), /^(?:p|div|h[1-6])$/.test(t) && r("text-align", e.getAttribute("align")), e.setAttribute("style", n.join(";"));
|
|
622
|
+
}
|
|
623
|
+
function J(e) {
|
|
624
|
+
return e ? /^\d+(?:\.\d+)?$/.test(e.trim()) ? `${e.trim()}px` : e.trim() : "";
|
|
625
|
+
}
|
|
626
|
+
function le(e, t, n = !1, r = !1) {
|
|
627
|
+
let i = e.getAttribute("src") ?? "", o = a.test(i.trim()), s = (r || o) && n, c = !!(t && Y(t)), l = s && c, u = l && t ? t : i;
|
|
628
|
+
if (a.test(u.trim()) || !Y(u)) return e.remove(), {
|
|
629
|
+
kept: !1,
|
|
630
|
+
usedReplacement: !1,
|
|
631
|
+
consumedReplacement: s
|
|
632
|
+
};
|
|
633
|
+
e.setAttribute("src", u.trim());
|
|
634
|
+
let d = X(e.getAttribute("width") ?? e.style.width), f = X(e.getAttribute("height") ?? e.style.height);
|
|
635
|
+
return d ? e.setAttribute("width", d) : e.removeAttribute("width"), f ? e.setAttribute("height", f) : e.removeAttribute("height"), e.setAttribute("alt", (e.getAttribute("alt") ?? "").slice(0, 500)), e.hasAttribute("title") && e.setAttribute("title", (e.getAttribute("title") ?? "").slice(0, 500)), {
|
|
636
|
+
kept: !0,
|
|
637
|
+
usedReplacement: l,
|
|
638
|
+
consumedReplacement: s
|
|
639
|
+
};
|
|
640
|
+
}
|
|
641
|
+
function Y(t) {
|
|
642
|
+
let n = t.trim();
|
|
643
|
+
return !!n && e(n);
|
|
644
|
+
}
|
|
645
|
+
function X(e) {
|
|
646
|
+
let t = /^(\d+(?:\.\d+)?)(px|pt|cm|mm|in|pc)?$/i.exec((e ?? "").trim());
|
|
647
|
+
if (!t) return "";
|
|
648
|
+
let n = Number(t[1]), r = D((t[2] ?? "px").toLowerCase()), i = Math.round(n * r);
|
|
649
|
+
return i >= 1 && i <= 2400 ? String(i) : "";
|
|
650
|
+
}
|
|
651
|
+
function ue(e) {
|
|
652
|
+
let t = (e.getAttribute("href") ?? "").trim();
|
|
653
|
+
if (!de(t)) {
|
|
654
|
+
e.removeAttribute("href"), e.removeAttribute("target"), e.removeAttribute("rel");
|
|
655
|
+
return;
|
|
656
|
+
}
|
|
657
|
+
e.setAttribute("href", t), e.getAttribute("target") === "_blank" ? e.setAttribute("rel", "noopener noreferrer") : (e.removeAttribute("target"), e.removeAttribute("rel"));
|
|
658
|
+
}
|
|
659
|
+
function de(e) {
|
|
660
|
+
if (!e) return !1;
|
|
661
|
+
let t = e.replace(/[\u0000-\u0020\u007F]+/g, "");
|
|
662
|
+
return /^(?:javascript|vbscript|data|file):/i.test(t) ? !1 : /^(?:https?:|mailto:|tel:|#|\/|\.\/|\.\.\/)/i.test(t) || !/^[a-z][a-z\d+.-]*:/i.test(t);
|
|
663
|
+
}
|
|
664
|
+
function Z(e) {
|
|
665
|
+
let t = e.tagName.toLowerCase();
|
|
666
|
+
if ((t === "td" || t === "th") && (Q(e, "rowspan", 1, 100), Q(e, "colspan", 1, 100)), t === "td" || t === "th") {
|
|
667
|
+
let t = (e.getAttribute("colwidth") ?? "").split(",").map((e) => Number.parseInt(e.trim(), 10)).filter((e) => Number.isFinite(e) && e >= 1 && e <= 2400).slice(0, 100);
|
|
668
|
+
t.length ? e.setAttribute("colwidth", t.join(",")) : e.removeAttribute("colwidth");
|
|
669
|
+
}
|
|
670
|
+
if (t === "ol") {
|
|
671
|
+
Q(e, "start", 1, 1e5);
|
|
672
|
+
let t = e.getAttribute("type");
|
|
673
|
+
(!t || !/^(?:1|a|A|i|I)$/.test(t)) && e.removeAttribute("type");
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
function Q(e, t, n, r) {
|
|
677
|
+
let i = Number.parseInt(e.getAttribute(t) ?? "", 10);
|
|
678
|
+
if (!Number.isFinite(i)) {
|
|
679
|
+
e.removeAttribute(t);
|
|
680
|
+
return;
|
|
681
|
+
}
|
|
682
|
+
e.setAttribute(t, String(Math.max(n, Math.min(r, i))));
|
|
683
|
+
}
|
|
684
|
+
function $(e) {
|
|
685
|
+
for (let t of Array.from(e.childNodes)) t.nodeType === 8 ? t.remove() : $(t);
|
|
686
|
+
}
|
|
687
|
+
function fe(e, t) {
|
|
688
|
+
let n = 0;
|
|
689
|
+
for (let r = t; r < e.length; r++) {
|
|
690
|
+
if (e[r] === "\\") {
|
|
691
|
+
r++;
|
|
692
|
+
continue;
|
|
693
|
+
}
|
|
694
|
+
if (e[r] === "{") n++;
|
|
695
|
+
else if (e[r] === "}" && --n === 0) return r;
|
|
696
|
+
}
|
|
697
|
+
return -1;
|
|
698
|
+
}
|
|
699
|
+
function pe(e) {
|
|
700
|
+
let t = 0, n = "";
|
|
701
|
+
for (let r = 0; r < e.length; r++) {
|
|
702
|
+
let i = e[r];
|
|
703
|
+
if (i === "\\") {
|
|
704
|
+
t <= 1 && (n += i);
|
|
705
|
+
let a = e[r + 1];
|
|
706
|
+
a && t <= 1 && (n += a), r++;
|
|
707
|
+
continue;
|
|
708
|
+
}
|
|
709
|
+
if (i === "{") {
|
|
710
|
+
t++, t === 1 && (n += i);
|
|
711
|
+
continue;
|
|
712
|
+
}
|
|
713
|
+
if (i === "}") {
|
|
714
|
+
t === 1 && (n += i), t = Math.max(0, t - 1);
|
|
715
|
+
continue;
|
|
716
|
+
}
|
|
717
|
+
t <= 1 && (n += i);
|
|
718
|
+
}
|
|
719
|
+
return n;
|
|
720
|
+
}
|
|
721
|
+
function me(e) {
|
|
722
|
+
let t = [], n = new Uint8Array(e.length / 2);
|
|
723
|
+
for (let t = 0; t < n.length; t++) n[t] = Number.parseInt(e.slice(t * 2, t * 2 + 2), 16);
|
|
724
|
+
for (let e = 0; e < n.length; e += 32768) t.push(String.fromCharCode(...Array.from(n.subarray(e, e + 32768))));
|
|
725
|
+
return btoa(t.join(""));
|
|
726
|
+
}
|
|
727
|
+
function he(e, t) {
|
|
728
|
+
return t === "image/png" ? e.toLowerCase().startsWith("89504e470d0a1a0a") : t === "image/jpeg" ? e.toLowerCase().startsWith("ffd8ff") : !1;
|
|
729
|
+
}
|
|
730
|
+
function ge(e) {
|
|
731
|
+
return new Promise((t, n) => {
|
|
732
|
+
let r = new FileReader();
|
|
733
|
+
r.onerror = () => n(r.error ?? /* @__PURE__ */ Error("clipboard image read failed")), r.onload = () => t(typeof r.result == "string" ? r.result : ""), r.readAsDataURL(e);
|
|
734
|
+
});
|
|
735
|
+
}
|
|
736
|
+
//#endregion
|
|
737
|
+
export { _ as detectClipboardHtmlSource, b as extractRtfImageDataUrls, y as normalizeOfficeStyle, S as normalizeWordClipboardHtml, v as plainTextToSafeHtml, x as readClipboardImageFiles };
|