@guodun/antdv 1.5.3 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/components/contract-signing-location/src/ContractSigningLocationCanvas.vue.mjs +1 -1
- package/dist/es/components/contract-signing-location/src/template-source.mjs +16 -16
- package/dist/es/components/dept-selector/index.mjs +1 -1
- package/dist/es/components/dept-selector/src/DeptSelector.mjs +5 -0
- package/dist/es/components/dept-selector/src/DeptSelector.vue.mjs +90 -0
- package/dist/es/components/dept-selector/src/style/index.mjs +1 -0
- package/dist/es/components/dept-selector/src/types.mjs +4 -0
- package/dist/es/components/index.mjs +5 -3
- package/dist/es/components/plus-upload/apis/plus-upload.api.mjs +19 -9
- package/dist/es/components/plus-upload/hook/usePlusUpload.mjs +9 -9
- package/dist/es/components/plus-upload/src/plus-upload.vue.mjs +1 -1
- package/dist/es/components/plus-upload/src/types.mjs +4 -0
- package/dist/es/components/pro-contract-template-designer/index.mjs +2 -2
- package/dist/es/components/pro-contract-template-designer/src/{ContractTemplatePreviewSigningLayer.mjs → ContractTemplateAuthoringBar.mjs} +2 -2
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateAuthoringBar.vue.mjs +168 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateControlLibrary.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateControlLibrary.vue.mjs +120 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.mjs +382 -459
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.vue.mjs +278 -122
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerToolbar.vue.mjs +415 -288
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.vue.mjs +76 -75
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateFindReplace.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateFindReplace.vue.mjs +164 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsInspector.vue.mjs +380 -393
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsPageMap.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsPageMap.vue.mjs +108 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsPresetPicker.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsPresetPicker.vue.mjs +73 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsStudio.vue.mjs +109 -53
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePanelTabs.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePanelTabs.vue.mjs +52 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePreviewModal.vue.mjs +10 -14
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePreviewPage.vue.mjs +49 -58
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateTextContextMenu.vue.mjs +119 -196
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateVariableAdvanced.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateVariableAdvanced.vue.mjs +115 -0
- package/dist/es/components/pro-contract-template-designer/src/DesignerPage.vue.mjs +241 -290
- package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.mjs +1169 -1324
- package/dist/es/components/pro-contract-template-designer/src/{SigningPlacementInspector.mjs → SigningLayoutCustomModal.mjs} +2 -2
- package/dist/es/components/pro-contract-template-designer/src/SigningLayoutCustomModal.vue.mjs +110 -0
- package/dist/es/components/pro-contract-template-designer/src/SigningLayoutPresetPicker.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/SigningLayoutPresetPicker.vue.mjs +98 -0
- package/dist/es/components/pro-contract-template-designer/src/{SigningPlacementLayer.mjs → SigningLayoutPreview.mjs} +2 -2
- package/dist/es/components/pro-contract-template-designer/src/SigningLayoutPreview.vue.mjs +51 -0
- package/dist/es/components/pro-contract-template-designer/src/composables/use-designer-files.mjs +1 -2
- package/dist/es/components/pro-contract-template-designer/src/composables/use-draft-cache-session.mjs +2 -3
- package/dist/es/components/pro-contract-template-designer/src/composables/use-page-authoring.mjs +43 -0
- package/dist/es/components/pro-contract-template-designer/src/composables/use-template-authoring.mjs +99 -0
- package/dist/es/components/pro-contract-template-designer/src/composables/use-template-designer.mjs +128 -168
- 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/composables/use-template-files.mjs +7 -11
- package/dist/es/components/pro-contract-template-designer/src/composables/use-toolbar-overflow.mjs +1 -1
- package/dist/es/components/pro-contract-template-designer/src/constants.mjs +36 -25
- package/dist/es/components/pro-contract-template-designer/src/extensions/SigningMarkNodeView.mjs +7 -0
- package/dist/es/components/pro-contract-template-designer/src/extensions/SigningMarkNodeView.vue.mjs +192 -0
- package/dist/es/components/pro-contract-template-designer/src/extensions/SigningMarkNodeView.vue_vue_type_style_index_0_scoped_a2a8e01a_lang.css +1 -0
- package/dist/es/components/pro-contract-template-designer/src/extensions/authoring-search.mjs +43 -0
- package/dist/es/components/pro-contract-template-designer/src/extensions/editor-extensions.mjs +137 -93
- package/dist/es/components/pro-contract-template-designer/src/extensions/signing-mark.mjs +92 -0
- package/dist/es/components/pro-contract-template-designer/src/utils/authoring-search.mjs +59 -0
- package/dist/es/components/pro-contract-template-designer/src/utils/authoring-shortcuts.mjs +14 -0
- package/dist/es/components/pro-contract-template-designer/src/utils/clause-snippets.mjs +56 -0
- package/dist/es/components/pro-contract-template-designer/src/utils/document-outline.mjs +45 -0
- package/dist/es/components/pro-contract-template-designer/src/utils/panel-search.mjs +7 -0
- package/dist/es/components/pro-contract-template-designer/src/utils/signing-layout-presets.mjs +235 -0
- package/dist/es/components/pro-contract-template-designer/src/utils/signing-mark.mjs +152 -0
- package/dist/es/components/pro-contract-template-designer/src/utils/template-tool-icons.mjs +22 -20
- package/dist/es/components/pro-contract-template-designer/src/utils/toolbar-overflow.mjs +1 -0
- package/dist/es/components/pro-contract-template-designer/style/index.css +1 -1
- package/dist/es/components/pro-dynamic-tags/src/index.vue.mjs +74 -48
- package/dist/es/components/pro-selector/index.mjs +6 -5
- package/dist/es/components/pro-selector/src/ProUserSelector.mjs +5 -0
- package/dist/es/components/pro-selector/src/ProUserSelector.vue.mjs +95 -0
- package/dist/es/components/pro-selector/src/ProUserSelectorDrilldown.mjs +5 -0
- package/dist/es/components/pro-selector/src/ProUserSelectorDrilldown.vue.mjs +20 -0
- package/dist/es/components/pro-selector/src/components/user.mjs +38 -52
- package/dist/es/components/pro-selector/src/types.mjs +9 -0
- package/dist/es/components/pro-selector/style/index.mjs +1 -0
- package/dist/es/components/pro-selector-group/index.mjs +1 -1
- package/dist/es/components/pro-selector-group/src/index.vue.mjs +71 -142
- package/dist/es/components/pro-selector-group/src/style/index.mjs +1 -0
- package/dist/es/components/pro-selector-group/src/utils/index.mjs +16 -28
- package/dist/es/components/role-selector/index.mjs +2 -2
- package/dist/es/components/role-selector/src/RoleSelector.mjs +5 -0
- package/dist/es/components/role-selector/src/RoleSelector.vue.mjs +90 -0
- package/dist/es/components/role-selector/src/style/index.mjs +1 -0
- package/dist/es/components/role-selector/src/types.mjs +4 -0
- package/dist/es/components/selector-core/components/DepartmentTree.mjs +5 -0
- package/dist/es/components/selector-core/components/DepartmentTree.vue.mjs +141 -0
- package/dist/es/components/selector-core/components/EntityRow.mjs +5 -0
- package/dist/es/components/selector-core/components/EntityRow.vue.mjs +84 -0
- package/dist/es/components/selector-core/components/HighlightText.mjs +5 -0
- package/dist/es/components/selector-core/components/HighlightText.vue.mjs +19 -0
- package/dist/es/components/selector-core/components/PanelFeedback.mjs +5 -0
- package/dist/es/components/selector-core/components/PanelFeedback.vue.mjs +61 -0
- package/dist/es/components/selector-core/components/PeoplePane.mjs +5 -0
- package/dist/es/components/selector-core/components/PeoplePane.vue.mjs +237 -0
- package/dist/es/components/selector-core/components/RolePane.mjs +5 -0
- package/dist/es/components/selector-core/components/RolePane.vue.mjs +87 -0
- package/dist/es/components/selector-core/components/SelectionSummary.mjs +5 -0
- package/dist/es/components/selector-core/components/SelectionSummary.vue.mjs +73 -0
- package/dist/es/components/selector-core/components/SelectorDialog.mjs +5 -0
- package/dist/es/components/selector-core/components/SelectorDialog.vue.mjs +351 -0
- package/dist/es/components/selector-core/model.mjs +114 -0
- package/dist/es/components/selector-core/useSelectorData.mjs +87 -0
- package/dist/es/index.mjs +82 -80
- package/dist/es/node_modules/@tiptap/pm/dist/history/index.mjs +1 -0
- package/dist/es/node_modules/orderedmap/dist/index.mjs +67 -0
- package/dist/es/node_modules/prosemirror-history/dist/index.mjs +226 -0
- package/dist/es/node_modules/prosemirror-model/dist/index.mjs +1128 -0
- package/dist/es/node_modules/prosemirror-state/dist/index.mjs +325 -0
- package/dist/es/node_modules/prosemirror-transform/dist/index.mjs +1055 -0
- package/dist/es/node_modules/rope-sequence/dist/index.mjs +83 -0
- package/dist/lib/components/contract-signing-location/src/ContractSigningLocationCanvas.vue.cjs +1 -1
- package/dist/lib/components/contract-signing-location/src/template-source.cjs +1 -1
- package/dist/lib/components/dept-selector/index.cjs +1 -1
- package/dist/lib/components/dept-selector/src/DeptSelector.cjs +1 -0
- package/dist/lib/components/dept-selector/src/DeptSelector.vue.cjs +1 -0
- package/dist/lib/components/dept-selector/src/style/index.cjs +1 -1
- package/dist/lib/components/dept-selector/src/types.cjs +1 -1
- package/dist/lib/components/index.cjs +1 -1
- package/dist/lib/components/plus-upload/apis/plus-upload.api.cjs +1 -1
- package/dist/lib/components/plus-upload/hook/usePlusUpload.cjs +1 -1
- package/dist/lib/components/plus-upload/src/plus-upload.vue.cjs +1 -1
- package/dist/lib/components/plus-upload/src/types.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/index.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateAuthoringBar.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateAuthoringBar.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateControlLibrary.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateControlLibrary.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.cjs +2 -2
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerToolbar.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateFindReplace.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateFindReplace.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsInspector.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsPageMap.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsPageMap.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsPresetPicker.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsPresetPicker.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsStudio.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePanelTabs.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePanelTabs.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePreviewModal.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePreviewPage.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateTextContextMenu.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateVariableAdvanced.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateVariableAdvanced.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/DesignerPage.vue.cjs +2 -2
- package/dist/lib/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/SigningLayoutCustomModal.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/SigningLayoutCustomModal.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/SigningLayoutPresetPicker.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/SigningLayoutPresetPicker.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/SigningLayoutPreview.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/SigningLayoutPreview.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/composables/use-designer-files.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/composables/use-draft-cache-session.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/composables/use-page-authoring.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-authoring.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/composables/use-template-files.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/composables/use-toolbar-overflow.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/constants.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/extensions/SigningMarkNodeView.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/extensions/SigningMarkNodeView.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/extensions/SigningMarkNodeView.vue_vue_type_style_index_0_scoped_a2a8e01a_lang.css +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/extensions/authoring-search.cjs +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/signing-mark.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/utils/authoring-search.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/utils/authoring-shortcuts.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/utils/clause-snippets.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/utils/document-outline.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/utils/panel-search.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/utils/signing-layout-presets.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/utils/signing-mark.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/utils/template-tool-icons.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/utils/toolbar-overflow.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/style/index.css +1 -1
- package/dist/lib/components/pro-dynamic-tags/src/index.vue.cjs +1 -1
- package/dist/lib/components/pro-selector/index.cjs +1 -1
- package/dist/lib/components/pro-selector/src/ProUserSelector.cjs +1 -0
- package/dist/lib/components/pro-selector/src/ProUserSelector.vue.cjs +1 -0
- package/dist/lib/components/pro-selector/src/ProUserSelectorDrilldown.cjs +1 -0
- package/dist/lib/components/pro-selector/src/ProUserSelectorDrilldown.vue.cjs +1 -0
- package/dist/lib/components/pro-selector/src/components/user.cjs +1 -1
- package/dist/lib/components/pro-selector/src/types.cjs +1 -1
- package/dist/lib/components/pro-selector/style/index.cjs +1 -1
- package/dist/lib/components/pro-selector-group/index.cjs +1 -1
- package/dist/lib/components/pro-selector-group/src/index.vue.cjs +1 -1
- package/dist/lib/components/pro-selector-group/src/style/index.cjs +1 -1
- package/dist/lib/components/pro-selector-group/src/utils/index.cjs +1 -1
- package/dist/lib/components/role-selector/index.cjs +1 -1
- package/dist/lib/components/role-selector/src/RoleSelector.cjs +1 -0
- package/dist/lib/components/role-selector/src/RoleSelector.vue.cjs +1 -0
- package/dist/lib/components/role-selector/src/style/index.cjs +1 -1
- package/dist/lib/components/role-selector/src/types.cjs +1 -1
- package/dist/lib/components/selector-core/components/DepartmentTree.cjs +1 -0
- package/dist/lib/components/selector-core/components/DepartmentTree.vue.cjs +1 -0
- package/dist/lib/components/selector-core/components/EntityRow.cjs +1 -0
- package/dist/lib/components/selector-core/components/EntityRow.vue.cjs +1 -0
- package/dist/lib/components/selector-core/components/HighlightText.cjs +1 -0
- package/dist/lib/components/selector-core/components/HighlightText.vue.cjs +1 -0
- package/dist/lib/components/selector-core/components/PanelFeedback.cjs +1 -0
- package/dist/lib/components/selector-core/components/PanelFeedback.vue.cjs +1 -0
- package/dist/lib/components/selector-core/components/PeoplePane.cjs +1 -0
- package/dist/lib/components/selector-core/components/PeoplePane.vue.cjs +1 -0
- package/dist/lib/components/selector-core/components/RolePane.cjs +1 -0
- package/dist/lib/components/selector-core/components/RolePane.vue.cjs +1 -0
- package/dist/lib/components/selector-core/components/SelectionSummary.cjs +1 -0
- package/dist/lib/components/selector-core/components/SelectionSummary.vue.cjs +1 -0
- package/dist/lib/components/selector-core/components/SelectorDialog.cjs +1 -0
- package/dist/lib/components/selector-core/components/SelectorDialog.vue.cjs +1 -0
- package/dist/lib/components/selector-core/model.cjs +1 -0
- package/dist/lib/components/selector-core/useSelectorData.cjs +1 -0
- package/dist/lib/index.cjs +1 -1
- package/dist/lib/node_modules/@tiptap/pm/dist/history/index.cjs +1 -0
- package/dist/lib/node_modules/orderedmap/dist/index.cjs +1 -0
- package/dist/lib/node_modules/prosemirror-history/dist/index.cjs +1 -0
- package/dist/lib/node_modules/prosemirror-model/dist/index.cjs +2 -0
- package/dist/lib/node_modules/prosemirror-state/dist/index.cjs +1 -0
- package/dist/lib/node_modules/prosemirror-transform/dist/index.cjs +2 -0
- package/dist/lib/node_modules/rope-sequence/dist/index.cjs +1 -0
- package/dist/theme/dept-selector.css +1 -1
- package/dist/theme/icon.css +1 -1
- package/dist/theme/index.css +1 -1
- package/dist/theme/pro-dynamic-tags.css +1 -1
- package/dist/theme/pro-modal.css +1 -1
- package/dist/theme/pro-selector-group.css +1 -1
- package/dist/theme/pro-selector.css +1 -1
- package/dist/theme/role-selector.css +1 -1
- package/dist/theme/selector-core.css +1 -0
- package/dist/types/components/contract-signing-location/src/ContractSigningLocation.vue.d.ts +3 -3
- package/dist/types/components/contract-signing-location/src/ContractSigningLocationCanvas.vue.d.ts +2 -2
- package/dist/types/components/dept-selector/index.d.ts +156 -45
- package/dist/types/components/dept-selector/src/{dept.d.ts → DeptSelector.vue.d.ts} +38 -15
- package/dist/types/components/dept-selector/src/types.d.ts +10 -2
- package/dist/types/components/plus-upload/apis/plus-upload.api.d.ts +15 -0
- package/dist/types/components/plus-upload/hook/usePlusUpload.d.ts +1 -1
- package/dist/types/components/plus-upload/index.d.ts +21 -3
- package/dist/types/components/plus-upload/src/plus-upload.vue.d.ts +11 -1
- package/dist/types/components/plus-upload/src/types.d.ts +4 -0
- package/dist/types/components/pro-contract-template-designer/index.d.ts +2 -1
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateAuthoringBar.vue.d.ts +106 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateControlLibrary.vue.d.ts +18 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.d.ts +5 -42
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.vue.d.ts +9 -11
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerToolbar.vue.d.ts +42 -4
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.vue.d.ts +18 -1
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateFindReplace.vue.d.ts +37 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsPageMap.vue.d.ts +29 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsPresetPicker.vue.d.ts +16 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplatePanelTabs.vue.d.ts +15 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplatePreviewModal.vue.d.ts +1 -4
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplatePreviewPage.vue.d.ts +1 -2
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateTextContextMenu.vue.d.ts +1 -29
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateVariableAdvanced.vue.d.ts +14 -0
- package/dist/types/components/pro-contract-template-designer/src/DesignerPage.vue.d.ts +13 -29
- package/dist/types/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.d.ts +260 -121
- package/dist/types/components/pro-contract-template-designer/src/SigningLayoutCustomModal.vue.d.ts +15 -0
- package/dist/types/components/pro-contract-template-designer/src/SigningLayoutPresetPicker.vue.d.ts +19 -0
- package/dist/types/components/pro-contract-template-designer/src/{ContractTemplatePreviewSigningLayer.vue.d.ts → SigningLayoutPreview.vue.d.ts} +2 -3
- package/dist/types/components/pro-contract-template-designer/src/composables/use-designer-files.d.ts +1 -4
- package/dist/types/components/pro-contract-template-designer/src/composables/use-draft-cache-session.d.ts +1 -5
- package/dist/types/components/pro-contract-template-designer/src/composables/use-page-authoring.d.ts +13 -0
- package/dist/types/components/pro-contract-template-designer/src/composables/use-template-authoring.d.ts +44 -0
- package/dist/types/components/pro-contract-template-designer/src/composables/use-template-designer.d.ts +4 -20
- package/dist/types/components/pro-contract-template-designer/src/composables/use-template-draft-cache.d.ts +1 -1
- package/dist/types/components/pro-contract-template-designer/src/composables/use-template-files.d.ts +1 -2
- package/dist/types/components/pro-contract-template-designer/src/composables/use-toolbar-overflow.d.ts +1 -1
- package/dist/types/components/pro-contract-template-designer/src/constants.d.ts +20 -1
- package/dist/types/components/pro-contract-template-designer/src/extensions/SigningMarkNodeView.vue.d.ts +5 -0
- package/dist/types/components/pro-contract-template-designer/src/extensions/authoring-search.d.ts +12 -0
- package/dist/types/components/pro-contract-template-designer/src/extensions/signing-mark.d.ts +16 -0
- package/dist/types/components/pro-contract-template-designer/src/types.d.ts +64 -77
- package/dist/types/components/pro-contract-template-designer/src/utils/authoring-search.d.ts +23 -0
- package/dist/types/components/pro-contract-template-designer/src/utils/authoring-shortcuts.d.ts +3 -0
- package/dist/types/components/pro-contract-template-designer/src/utils/clause-snippets.d.ts +10 -0
- package/dist/types/components/pro-contract-template-designer/src/utils/document-outline.d.ts +20 -0
- package/dist/types/components/pro-contract-template-designer/src/utils/panel-search.d.ts +2 -0
- package/dist/types/components/pro-contract-template-designer/src/utils/signing-layout-presets.d.ts +49 -0
- package/dist/types/components/pro-contract-template-designer/src/utils/signing-mark.d.ts +57 -0
- package/dist/types/components/pro-contract-template-designer/src/utils/template-tool-icons.d.ts +4 -4
- package/dist/types/components/pro-contract-template-designer/src/utils/toolbar-overflow.d.ts +2 -2
- package/dist/types/components/pro-dynamic-tags/src/index.vue.d.ts +1 -0
- package/dist/types/components/pro-dynamic-tags/src/types.d.ts +9 -0
- package/dist/types/components/pro-menu-tree/index.d.ts +2 -2
- package/dist/types/components/pro-menu-tree/src/pro-menu-tree.d.ts +2 -2
- package/dist/types/components/pro-selector/index.d.ts +851 -13
- package/dist/types/components/pro-selector/src/{pro-user.d.ts → ProUserSelector.vue.d.ts} +50 -12
- package/dist/types/components/pro-selector/src/ProUserSelectorDrilldown.vue.d.ts +447 -0
- package/dist/types/components/pro-selector/src/components/user.d.ts +2 -2
- package/dist/types/components/pro-selector/src/types.d.ts +16 -0
- package/dist/types/components/pro-selector-group/index.d.ts +63 -13
- package/dist/types/components/pro-selector-group/src/index.vue.d.ts +21 -4
- package/dist/types/components/pro-selector-group/src/types.d.ts +6 -0
- package/dist/types/components/pro-selector-group/src/utils/index.d.ts +4 -2
- package/dist/types/components/role-selector/index.d.ts +276 -86
- package/dist/types/components/role-selector/src/{role.d.ts → RoleSelector.vue.d.ts} +37 -13
- package/dist/types/components/role-selector/src/types.d.ts +10 -2
- package/dist/types/components/selector-core/components/DepartmentTree.vue.d.ts +22 -0
- package/dist/types/components/selector-core/components/EntityRow.vue.d.ts +21 -0
- package/dist/types/components/selector-core/components/HighlightText.vue.d.ts +6 -0
- package/dist/types/components/selector-core/components/PanelFeedback.vue.d.ts +28 -0
- package/dist/types/components/selector-core/components/PeoplePane.vue.d.ts +31 -0
- package/dist/types/components/selector-core/components/RolePane.vue.d.ts +19 -0
- package/dist/types/components/selector-core/components/SelectionSummary.vue.d.ts +14 -0
- package/dist/types/components/selector-core/components/SelectorDialog.vue.d.ts +48 -0
- package/dist/types/components/selector-core/model.d.ts +75 -0
- package/dist/types/components/selector-core/useSelectorData.d.ts +104 -0
- package/global.d.ts +4 -0
- package/package.json +5 -3
- package/dist/es/components/dept-selector/src/dept.mjs +0 -294
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePreviewSigningLayer.vue.mjs +0 -42
- package/dist/es/components/pro-contract-template-designer/src/SigningPlacementInspector.vue.mjs +0 -141
- package/dist/es/components/pro-contract-template-designer/src/SigningPlacementLayer.vue.mjs +0 -151
- package/dist/es/components/pro-contract-template-designer/src/composables/use-signing-placement-editor.mjs +0 -79
- package/dist/es/components/pro-contract-template-designer/src/utils/signing-placement.mjs +0 -293
- package/dist/es/components/pro-selector/src/components/org-tree.mjs +0 -223
- package/dist/es/components/pro-selector/src/pro-user.mjs +0 -167
- package/dist/es/components/pro-selector/src/utils/orgTree.mjs +0 -50
- package/dist/es/components/pro-selector-group/src/compoents/dept-tree.mjs +0 -5
- package/dist/es/components/pro-selector-group/src/compoents/dept-tree.vue.mjs +0 -127
- package/dist/es/components/pro-selector-group/src/compoents/dept.mjs +0 -5
- package/dist/es/components/pro-selector-group/src/compoents/dept.vue.mjs +0 -52
- package/dist/es/components/pro-selector-group/src/compoents/index.mjs +0 -3
- package/dist/es/components/pro-selector-group/src/compoents/role.mjs +0 -5
- package/dist/es/components/pro-selector-group/src/compoents/role.vue.mjs +0 -120
- package/dist/es/components/pro-selector-group/src/compoents/select-box.mjs +0 -5
- package/dist/es/components/pro-selector-group/src/compoents/select-box.vue.mjs +0 -59
- package/dist/es/components/pro-selector-group/src/compoents/user.mjs +0 -5
- package/dist/es/components/pro-selector-group/src/compoents/user.vue.mjs +0 -154
- package/dist/es/components/pro-selector-group/src/hooks/useApi.mjs +0 -76
- package/dist/es/components/role-selector/src/role.mjs +0 -217
- package/dist/lib/components/dept-selector/src/dept.cjs +0 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePreviewSigningLayer.cjs +0 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePreviewSigningLayer.vue.cjs +0 -1
- package/dist/lib/components/pro-contract-template-designer/src/SigningPlacementInspector.cjs +0 -1
- package/dist/lib/components/pro-contract-template-designer/src/SigningPlacementInspector.vue.cjs +0 -1
- package/dist/lib/components/pro-contract-template-designer/src/SigningPlacementLayer.cjs +0 -1
- package/dist/lib/components/pro-contract-template-designer/src/SigningPlacementLayer.vue.cjs +0 -1
- package/dist/lib/components/pro-contract-template-designer/src/composables/use-signing-placement-editor.cjs +0 -1
- package/dist/lib/components/pro-contract-template-designer/src/utils/signing-placement.cjs +0 -1
- package/dist/lib/components/pro-selector/src/components/org-tree.cjs +0 -1
- package/dist/lib/components/pro-selector/src/pro-user.cjs +0 -1
- package/dist/lib/components/pro-selector/src/utils/orgTree.cjs +0 -1
- package/dist/lib/components/pro-selector-group/src/compoents/dept-tree.cjs +0 -1
- package/dist/lib/components/pro-selector-group/src/compoents/dept-tree.vue.cjs +0 -1
- package/dist/lib/components/pro-selector-group/src/compoents/dept.cjs +0 -1
- package/dist/lib/components/pro-selector-group/src/compoents/dept.vue.cjs +0 -1
- package/dist/lib/components/pro-selector-group/src/compoents/index.cjs +0 -1
- package/dist/lib/components/pro-selector-group/src/compoents/role.cjs +0 -1
- package/dist/lib/components/pro-selector-group/src/compoents/role.vue.cjs +0 -1
- package/dist/lib/components/pro-selector-group/src/compoents/select-box.cjs +0 -1
- package/dist/lib/components/pro-selector-group/src/compoents/select-box.vue.cjs +0 -1
- package/dist/lib/components/pro-selector-group/src/compoents/user.cjs +0 -1
- package/dist/lib/components/pro-selector-group/src/compoents/user.vue.cjs +0 -1
- package/dist/lib/components/pro-selector-group/src/hooks/useApi.cjs +0 -1
- package/dist/lib/components/role-selector/src/role.cjs +0 -1
- package/dist/types/components/pro-contract-template-designer/src/SigningPlacementInspector.vue.d.ts +0 -17
- package/dist/types/components/pro-contract-template-designer/src/SigningPlacementLayer.vue.d.ts +0 -19
- package/dist/types/components/pro-contract-template-designer/src/composables/use-signing-placement-editor.d.ts +0 -49
- package/dist/types/components/pro-contract-template-designer/src/utils/signing-placement.d.ts +0 -105
- package/dist/types/components/pro-selector/src/components/org-tree.d.ts +0 -45
- package/dist/types/components/pro-selector/src/util.d.ts +0 -26
- package/dist/types/components/pro-selector-group/src/compoents/dept-tree.vue.d.ts +0 -12
- package/dist/types/components/pro-selector-group/src/compoents/dept.vue.d.ts +0 -11
- package/dist/types/components/pro-selector-group/src/compoents/index.d.ts +0 -3
- package/dist/types/components/pro-selector-group/src/compoents/role.vue.d.ts +0 -11
- package/dist/types/components/pro-selector-group/src/compoents/select-box.vue.d.ts +0 -15
- package/dist/types/components/pro-selector-group/src/compoents/user.vue.d.ts +0 -12
- package/dist/types/components/pro-selector-group/src/hooks/useApi.d.ts +0 -112
|
@@ -0,0 +1,1055 @@
|
|
|
1
|
+
import { Fragment as e, Mark as t, MarkType as n, ReplaceError as r, Slice as i } from "../../prosemirror-model/dist/index.mjs";
|
|
2
|
+
//#region ../../node_modules/prosemirror-transform/dist/index.js
|
|
3
|
+
var a = 65535, o = 2 ** 16;
|
|
4
|
+
function s(e, t) {
|
|
5
|
+
return e + t * o;
|
|
6
|
+
}
|
|
7
|
+
function c(e) {
|
|
8
|
+
return e & a;
|
|
9
|
+
}
|
|
10
|
+
function l(e) {
|
|
11
|
+
return (e - (e & a)) / o;
|
|
12
|
+
}
|
|
13
|
+
var u = 1, d = 2, f = 4, p = 8, m = class {
|
|
14
|
+
constructor(e, t, n) {
|
|
15
|
+
this.pos = e, this.delInfo = t, this.recover = n;
|
|
16
|
+
}
|
|
17
|
+
get deleted() {
|
|
18
|
+
return (this.delInfo & p) > 0;
|
|
19
|
+
}
|
|
20
|
+
get deletedBefore() {
|
|
21
|
+
return (this.delInfo & (u | f)) > 0;
|
|
22
|
+
}
|
|
23
|
+
get deletedAfter() {
|
|
24
|
+
return (this.delInfo & (d | f)) > 0;
|
|
25
|
+
}
|
|
26
|
+
get deletedAcross() {
|
|
27
|
+
return (this.delInfo & f) > 0;
|
|
28
|
+
}
|
|
29
|
+
}, h = class e {
|
|
30
|
+
constructor(t, n = !1) {
|
|
31
|
+
if (this.ranges = t, this.inverted = n, !t.length && e.empty) return e.empty;
|
|
32
|
+
}
|
|
33
|
+
recover(e) {
|
|
34
|
+
let t = 0, n = c(e);
|
|
35
|
+
if (!this.inverted) for (let e = 0; e < n; e++) t += this.ranges[e * 3 + 2] - this.ranges[e * 3 + 1];
|
|
36
|
+
return this.ranges[n * 3] + t + l(e);
|
|
37
|
+
}
|
|
38
|
+
mapResult(e, t = 1) {
|
|
39
|
+
return this._map(e, t, !1);
|
|
40
|
+
}
|
|
41
|
+
map(e, t = 1) {
|
|
42
|
+
return this._map(e, t, !0);
|
|
43
|
+
}
|
|
44
|
+
_map(e, t, n) {
|
|
45
|
+
let r = 0, i = this.inverted ? 2 : 1, a = this.inverted ? 1 : 2;
|
|
46
|
+
for (let o = 0; o < this.ranges.length; o += 3) {
|
|
47
|
+
let c = this.ranges[o] - (this.inverted ? r : 0);
|
|
48
|
+
if (c > e) break;
|
|
49
|
+
let l = this.ranges[o + i], h = this.ranges[o + a], g = c + l;
|
|
50
|
+
if (e <= g) {
|
|
51
|
+
let i = l ? e == c ? -1 : e == g ? 1 : t : t, a = c + r + (i < 0 ? 0 : h);
|
|
52
|
+
if (n) return a;
|
|
53
|
+
let _ = e == (t < 0 ? c : g) ? null : s(o / 3, e - c), v = e == c ? d : e == g ? u : f;
|
|
54
|
+
return (t < 0 ? e != c : e != g) && (v |= p), new m(a, v, _);
|
|
55
|
+
}
|
|
56
|
+
r += h - l;
|
|
57
|
+
}
|
|
58
|
+
return n ? e + r : new m(e + r, 0, null);
|
|
59
|
+
}
|
|
60
|
+
touches(e, t) {
|
|
61
|
+
let n = 0, r = c(t), i = this.inverted ? 2 : 1, a = this.inverted ? 1 : 2;
|
|
62
|
+
for (let t = 0; t < this.ranges.length; t += 3) {
|
|
63
|
+
let o = this.ranges[t] - (this.inverted ? n : 0);
|
|
64
|
+
if (o > e) break;
|
|
65
|
+
let s = this.ranges[t + i];
|
|
66
|
+
if (e <= o + s && t == r * 3) return !0;
|
|
67
|
+
n += this.ranges[t + a] - s;
|
|
68
|
+
}
|
|
69
|
+
return !1;
|
|
70
|
+
}
|
|
71
|
+
forEach(e) {
|
|
72
|
+
let t = this.inverted ? 2 : 1, n = this.inverted ? 1 : 2;
|
|
73
|
+
for (let r = 0, i = 0; r < this.ranges.length; r += 3) {
|
|
74
|
+
let a = this.ranges[r], o = a - (this.inverted ? i : 0), s = a + (this.inverted ? 0 : i), c = this.ranges[r + t], l = this.ranges[r + n];
|
|
75
|
+
e(o, o + c, s, s + l), i += l - c;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
invert() {
|
|
79
|
+
return new e(this.ranges, !this.inverted);
|
|
80
|
+
}
|
|
81
|
+
toString() {
|
|
82
|
+
return (this.inverted ? "-" : "") + JSON.stringify(this.ranges);
|
|
83
|
+
}
|
|
84
|
+
static offset(t) {
|
|
85
|
+
return t == 0 ? e.empty : new e(t < 0 ? [
|
|
86
|
+
0,
|
|
87
|
+
-t,
|
|
88
|
+
0
|
|
89
|
+
] : [
|
|
90
|
+
0,
|
|
91
|
+
0,
|
|
92
|
+
t
|
|
93
|
+
]);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
h.empty = new h([]);
|
|
97
|
+
var g = class e {
|
|
98
|
+
constructor(e, t, n = 0, r = e ? e.length : 0) {
|
|
99
|
+
this.mirror = t, this.from = n, this.to = r, this._maps = e || [], this.ownData = !(e || t);
|
|
100
|
+
}
|
|
101
|
+
get maps() {
|
|
102
|
+
return this._maps;
|
|
103
|
+
}
|
|
104
|
+
slice(t = 0, n = this.maps.length) {
|
|
105
|
+
return new e(this._maps, this.mirror, t, n);
|
|
106
|
+
}
|
|
107
|
+
appendMap(e, t) {
|
|
108
|
+
this.ownData ||= (this._maps = this._maps.slice(), this.mirror = this.mirror && this.mirror.slice(), !0), this.to = this._maps.push(e), t != null && this.setMirror(this._maps.length - 1, t);
|
|
109
|
+
}
|
|
110
|
+
appendMapping(e) {
|
|
111
|
+
for (let t = 0, n = this._maps.length; t < e._maps.length; t++) {
|
|
112
|
+
let r = e.getMirror(t);
|
|
113
|
+
this.appendMap(e._maps[t], r != null && r < t ? n + r : void 0);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
getMirror(e) {
|
|
117
|
+
if (this.mirror) {
|
|
118
|
+
for (let t = 0; t < this.mirror.length; t++) if (this.mirror[t] == e) return this.mirror[t + (t % 2 ? -1 : 1)];
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
setMirror(e, t) {
|
|
122
|
+
this.mirror ||= [], this.mirror.push(e, t);
|
|
123
|
+
}
|
|
124
|
+
appendMappingInverted(e) {
|
|
125
|
+
for (let t = e.maps.length - 1, n = this._maps.length + e._maps.length; t >= 0; t--) {
|
|
126
|
+
let r = e.getMirror(t);
|
|
127
|
+
this.appendMap(e._maps[t].invert(), r != null && r > t ? n - r - 1 : void 0);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
invert() {
|
|
131
|
+
let t = new e();
|
|
132
|
+
return t.appendMappingInverted(this), t;
|
|
133
|
+
}
|
|
134
|
+
map(e, t = 1) {
|
|
135
|
+
if (this.mirror) return this._map(e, t, !0);
|
|
136
|
+
for (let n = this.from; n < this.to; n++) e = this._maps[n].map(e, t);
|
|
137
|
+
return e;
|
|
138
|
+
}
|
|
139
|
+
mapResult(e, t = 1) {
|
|
140
|
+
return this._map(e, t, !1);
|
|
141
|
+
}
|
|
142
|
+
_map(e, t, n) {
|
|
143
|
+
let r = 0;
|
|
144
|
+
for (let n = this.from; n < this.to; n++) {
|
|
145
|
+
let i = this._maps[n].mapResult(e, t);
|
|
146
|
+
if (i.recover != null) {
|
|
147
|
+
let t = this.getMirror(n);
|
|
148
|
+
if (t != null && t > n && t < this.to) {
|
|
149
|
+
n = t, e = this._maps[t].recover(i.recover);
|
|
150
|
+
continue;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
r |= i.delInfo, e = i.pos;
|
|
154
|
+
}
|
|
155
|
+
return n ? e : new m(e, r, null);
|
|
156
|
+
}
|
|
157
|
+
}, _ = Object.create(null), v = class {
|
|
158
|
+
getMap() {
|
|
159
|
+
return h.empty;
|
|
160
|
+
}
|
|
161
|
+
merge(e) {
|
|
162
|
+
return null;
|
|
163
|
+
}
|
|
164
|
+
static fromJSON(e, t) {
|
|
165
|
+
if (!t || !t.stepType) throw RangeError("Invalid input for Step.fromJSON");
|
|
166
|
+
let n = _[t.stepType];
|
|
167
|
+
if (!n) throw RangeError(`No step type ${t.stepType} defined`);
|
|
168
|
+
return n.fromJSON(e, t);
|
|
169
|
+
}
|
|
170
|
+
static jsonID(e, t) {
|
|
171
|
+
if (e in _) throw RangeError("Duplicate use of step JSON ID " + e);
|
|
172
|
+
return _[e] = t, t.prototype.jsonID = e, t;
|
|
173
|
+
}
|
|
174
|
+
}, y = class e {
|
|
175
|
+
constructor(e, t) {
|
|
176
|
+
this.doc = e, this.failed = t;
|
|
177
|
+
}
|
|
178
|
+
static ok(t) {
|
|
179
|
+
return new e(t, null);
|
|
180
|
+
}
|
|
181
|
+
static fail(t) {
|
|
182
|
+
return new e(null, t);
|
|
183
|
+
}
|
|
184
|
+
static fromReplace(t, n, i, a) {
|
|
185
|
+
try {
|
|
186
|
+
return e.ok(t.replace(n, i, a));
|
|
187
|
+
} catch (t) {
|
|
188
|
+
if (t instanceof r) return e.fail(t.message);
|
|
189
|
+
throw t;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
function b(t, n, r) {
|
|
194
|
+
let i = [];
|
|
195
|
+
for (let e = 0; e < t.childCount; e++) {
|
|
196
|
+
let a = t.child(e);
|
|
197
|
+
a.content.size && (a = a.copy(b(a.content, n, a))), a.isInline && (a = n(a, r, e)), i.push(a);
|
|
198
|
+
}
|
|
199
|
+
return e.fromArray(i);
|
|
200
|
+
}
|
|
201
|
+
var x = class e extends v {
|
|
202
|
+
constructor(e, t, n) {
|
|
203
|
+
super(), this.from = e, this.to = t, this.mark = n;
|
|
204
|
+
}
|
|
205
|
+
apply(e) {
|
|
206
|
+
let t = e.slice(this.from, this.to), n = e.resolve(this.from), r = n.node(n.sharedDepth(this.to)), a = new i(b(t.content, (e, t) => !e.isAtom || !t.type.allowsMarkType(this.mark.type) ? e : e.mark(this.mark.addToSet(e.marks)), r), t.openStart, t.openEnd);
|
|
207
|
+
return y.fromReplace(e, this.from, this.to, a);
|
|
208
|
+
}
|
|
209
|
+
invert() {
|
|
210
|
+
return new S(this.from, this.to, this.mark);
|
|
211
|
+
}
|
|
212
|
+
map(t) {
|
|
213
|
+
let n = t.mapResult(this.from, 1), r = t.mapResult(this.to, -1);
|
|
214
|
+
return n.deleted && r.deleted || n.pos >= r.pos ? null : new e(n.pos, r.pos, this.mark);
|
|
215
|
+
}
|
|
216
|
+
merge(t) {
|
|
217
|
+
return t instanceof e && t.mark.eq(this.mark) && this.from <= t.to && this.to >= t.from ? new e(Math.min(this.from, t.from), Math.max(this.to, t.to), this.mark) : null;
|
|
218
|
+
}
|
|
219
|
+
toJSON() {
|
|
220
|
+
return {
|
|
221
|
+
stepType: "addMark",
|
|
222
|
+
mark: this.mark.toJSON(),
|
|
223
|
+
from: this.from,
|
|
224
|
+
to: this.to
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
static fromJSON(t, n) {
|
|
228
|
+
if (typeof n.from != "number" || typeof n.to != "number") throw RangeError("Invalid input for AddMarkStep.fromJSON");
|
|
229
|
+
return new e(n.from, n.to, t.markFromJSON(n.mark));
|
|
230
|
+
}
|
|
231
|
+
};
|
|
232
|
+
v.jsonID("addMark", x);
|
|
233
|
+
var S = class e extends v {
|
|
234
|
+
constructor(e, t, n) {
|
|
235
|
+
super(), this.from = e, this.to = t, this.mark = n;
|
|
236
|
+
}
|
|
237
|
+
apply(e) {
|
|
238
|
+
let t = e.slice(this.from, this.to), n = new i(b(t.content, (e) => e.mark(this.mark.removeFromSet(e.marks)), e), t.openStart, t.openEnd);
|
|
239
|
+
return y.fromReplace(e, this.from, this.to, n);
|
|
240
|
+
}
|
|
241
|
+
invert() {
|
|
242
|
+
return new x(this.from, this.to, this.mark);
|
|
243
|
+
}
|
|
244
|
+
map(t) {
|
|
245
|
+
let n = t.mapResult(this.from, 1), r = t.mapResult(this.to, -1);
|
|
246
|
+
return n.deleted && r.deleted || n.pos >= r.pos ? null : new e(n.pos, r.pos, this.mark);
|
|
247
|
+
}
|
|
248
|
+
merge(t) {
|
|
249
|
+
return t instanceof e && t.mark.eq(this.mark) && this.from <= t.to && this.to >= t.from ? new e(Math.min(this.from, t.from), Math.max(this.to, t.to), this.mark) : null;
|
|
250
|
+
}
|
|
251
|
+
toJSON() {
|
|
252
|
+
return {
|
|
253
|
+
stepType: "removeMark",
|
|
254
|
+
mark: this.mark.toJSON(),
|
|
255
|
+
from: this.from,
|
|
256
|
+
to: this.to
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
static fromJSON(t, n) {
|
|
260
|
+
if (typeof n.from != "number" || typeof n.to != "number") throw RangeError("Invalid input for RemoveMarkStep.fromJSON");
|
|
261
|
+
return new e(n.from, n.to, t.markFromJSON(n.mark));
|
|
262
|
+
}
|
|
263
|
+
};
|
|
264
|
+
v.jsonID("removeMark", S);
|
|
265
|
+
var C = class t extends v {
|
|
266
|
+
constructor(e, t) {
|
|
267
|
+
super(), this.pos = e, this.mark = t;
|
|
268
|
+
}
|
|
269
|
+
apply(t) {
|
|
270
|
+
let n = t.nodeAt(this.pos);
|
|
271
|
+
if (!n) return y.fail("No node at mark step's position");
|
|
272
|
+
let r = n.type.create(n.attrs, null, this.mark.addToSet(n.marks));
|
|
273
|
+
return y.fromReplace(t, this.pos, this.pos + 1, new i(e.from(r), 0, +!n.isLeaf));
|
|
274
|
+
}
|
|
275
|
+
invert(e) {
|
|
276
|
+
let n = e.nodeAt(this.pos);
|
|
277
|
+
if (n) {
|
|
278
|
+
let e = this.mark.addToSet(n.marks);
|
|
279
|
+
if (e.length == n.marks.length) {
|
|
280
|
+
for (let r = 0; r < n.marks.length; r++) if (!n.marks[r].isInSet(e)) return new t(this.pos, n.marks[r]);
|
|
281
|
+
return new t(this.pos, this.mark);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
return new w(this.pos, this.mark);
|
|
285
|
+
}
|
|
286
|
+
map(e) {
|
|
287
|
+
let n = e.mapResult(this.pos, 1);
|
|
288
|
+
return n.deletedAfter ? null : new t(n.pos, this.mark);
|
|
289
|
+
}
|
|
290
|
+
toJSON() {
|
|
291
|
+
return {
|
|
292
|
+
stepType: "addNodeMark",
|
|
293
|
+
pos: this.pos,
|
|
294
|
+
mark: this.mark.toJSON()
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
static fromJSON(e, n) {
|
|
298
|
+
if (typeof n.pos != "number") throw RangeError("Invalid input for AddNodeMarkStep.fromJSON");
|
|
299
|
+
return new t(n.pos, e.markFromJSON(n.mark));
|
|
300
|
+
}
|
|
301
|
+
};
|
|
302
|
+
v.jsonID("addNodeMark", C);
|
|
303
|
+
var w = class t extends v {
|
|
304
|
+
constructor(e, t) {
|
|
305
|
+
super(), this.pos = e, this.mark = t;
|
|
306
|
+
}
|
|
307
|
+
apply(t) {
|
|
308
|
+
let n = t.nodeAt(this.pos);
|
|
309
|
+
if (!n) return y.fail("No node at mark step's position");
|
|
310
|
+
let r = n.type.create(n.attrs, null, this.mark.removeFromSet(n.marks));
|
|
311
|
+
return y.fromReplace(t, this.pos, this.pos + 1, new i(e.from(r), 0, +!n.isLeaf));
|
|
312
|
+
}
|
|
313
|
+
invert(e) {
|
|
314
|
+
let t = e.nodeAt(this.pos);
|
|
315
|
+
return !t || !this.mark.isInSet(t.marks) ? this : new C(this.pos, this.mark);
|
|
316
|
+
}
|
|
317
|
+
map(e) {
|
|
318
|
+
let n = e.mapResult(this.pos, 1);
|
|
319
|
+
return n.deletedAfter ? null : new t(n.pos, this.mark);
|
|
320
|
+
}
|
|
321
|
+
toJSON() {
|
|
322
|
+
return {
|
|
323
|
+
stepType: "removeNodeMark",
|
|
324
|
+
pos: this.pos,
|
|
325
|
+
mark: this.mark.toJSON()
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
static fromJSON(e, n) {
|
|
329
|
+
if (typeof n.pos != "number") throw RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");
|
|
330
|
+
return new t(n.pos, e.markFromJSON(n.mark));
|
|
331
|
+
}
|
|
332
|
+
};
|
|
333
|
+
v.jsonID("removeNodeMark", w);
|
|
334
|
+
var T = class e extends v {
|
|
335
|
+
constructor(e, t, n, r = !1) {
|
|
336
|
+
super(), this.from = e, this.to = t, this.slice = n, this.structure = r;
|
|
337
|
+
}
|
|
338
|
+
apply(e) {
|
|
339
|
+
return this.structure && D(e, this.from, this.to) ? y.fail("Structure replace would overwrite content") : y.fromReplace(e, this.from, this.to, this.slice);
|
|
340
|
+
}
|
|
341
|
+
getMap() {
|
|
342
|
+
return new h([
|
|
343
|
+
this.from,
|
|
344
|
+
this.to - this.from,
|
|
345
|
+
this.slice.size
|
|
346
|
+
]);
|
|
347
|
+
}
|
|
348
|
+
invert(t) {
|
|
349
|
+
return new e(this.from, this.from + this.slice.size, t.slice(this.from, this.to));
|
|
350
|
+
}
|
|
351
|
+
map(t) {
|
|
352
|
+
let n = t.mapResult(this.to, -1), r = this.from == this.to && e.MAP_BIAS < 0 ? n : t.mapResult(this.from, 1);
|
|
353
|
+
return r.deletedAcross && n.deletedAcross ? null : new e(r.pos, Math.max(r.pos, n.pos), this.slice, this.structure);
|
|
354
|
+
}
|
|
355
|
+
merge(t) {
|
|
356
|
+
if (!(t instanceof e) || t.structure || this.structure) return null;
|
|
357
|
+
if (this.from + this.slice.size == t.from && !this.slice.openEnd && !t.slice.openStart) {
|
|
358
|
+
let n = this.slice.size + t.slice.size == 0 ? i.empty : new i(this.slice.content.append(t.slice.content), this.slice.openStart, t.slice.openEnd);
|
|
359
|
+
return new e(this.from, this.to + (t.to - t.from), n, this.structure);
|
|
360
|
+
} else if (t.to == this.from && !this.slice.openStart && !t.slice.openEnd) {
|
|
361
|
+
let n = this.slice.size + t.slice.size == 0 ? i.empty : new i(t.slice.content.append(this.slice.content), t.slice.openStart, this.slice.openEnd);
|
|
362
|
+
return new e(t.from, this.to, n, this.structure);
|
|
363
|
+
} else return null;
|
|
364
|
+
}
|
|
365
|
+
toJSON() {
|
|
366
|
+
let e = {
|
|
367
|
+
stepType: "replace",
|
|
368
|
+
from: this.from,
|
|
369
|
+
to: this.to
|
|
370
|
+
};
|
|
371
|
+
return this.slice.size && (e.slice = this.slice.toJSON()), this.structure && (e.structure = !0), e;
|
|
372
|
+
}
|
|
373
|
+
static fromJSON(t, n) {
|
|
374
|
+
if (typeof n.from != "number" || typeof n.to != "number") throw RangeError("Invalid input for ReplaceStep.fromJSON");
|
|
375
|
+
return new e(n.from, n.to, i.fromJSON(t, n.slice), !!n.structure);
|
|
376
|
+
}
|
|
377
|
+
};
|
|
378
|
+
T.MAP_BIAS = 1, v.jsonID("replace", T);
|
|
379
|
+
var E = class e extends v {
|
|
380
|
+
constructor(e, t, n, r, i, a, o = !1) {
|
|
381
|
+
super(), this.from = e, this.to = t, this.gapFrom = n, this.gapTo = r, this.slice = i, this.insert = a, this.structure = o;
|
|
382
|
+
}
|
|
383
|
+
apply(e) {
|
|
384
|
+
if (this.structure && (D(e, this.from, this.gapFrom) || D(e, this.gapTo, this.to))) return y.fail("Structure gap-replace would overwrite content");
|
|
385
|
+
let t = e.slice(this.gapFrom, this.gapTo);
|
|
386
|
+
if (t.openStart || t.openEnd) return y.fail("Gap is not a flat range");
|
|
387
|
+
let n = this.slice.insertAt(this.insert, t.content);
|
|
388
|
+
return n ? y.fromReplace(e, this.from, this.to, n) : y.fail("Content does not fit in gap");
|
|
389
|
+
}
|
|
390
|
+
getMap() {
|
|
391
|
+
return new h([
|
|
392
|
+
this.from,
|
|
393
|
+
this.gapFrom - this.from,
|
|
394
|
+
this.insert,
|
|
395
|
+
this.gapTo,
|
|
396
|
+
this.to - this.gapTo,
|
|
397
|
+
this.slice.size - this.insert
|
|
398
|
+
]);
|
|
399
|
+
}
|
|
400
|
+
invert(t) {
|
|
401
|
+
let n = this.gapTo - this.gapFrom;
|
|
402
|
+
return new e(this.from, this.from + this.slice.size + n, this.from + this.insert, this.from + this.insert + n, t.slice(this.from, this.to).removeBetween(this.gapFrom - this.from, this.gapTo - this.from), this.gapFrom - this.from, this.structure);
|
|
403
|
+
}
|
|
404
|
+
map(t) {
|
|
405
|
+
let n = t.mapResult(this.from, 1), r = t.mapResult(this.to, -1), i = this.from == this.gapFrom ? n.pos : t.map(this.gapFrom, -1), a = this.to == this.gapTo ? r.pos : t.map(this.gapTo, 1);
|
|
406
|
+
return n.deletedAcross && r.deletedAcross || i < n.pos || a > r.pos ? null : new e(n.pos, r.pos, i, a, this.slice, this.insert, this.structure);
|
|
407
|
+
}
|
|
408
|
+
toJSON() {
|
|
409
|
+
let e = {
|
|
410
|
+
stepType: "replaceAround",
|
|
411
|
+
from: this.from,
|
|
412
|
+
to: this.to,
|
|
413
|
+
gapFrom: this.gapFrom,
|
|
414
|
+
gapTo: this.gapTo,
|
|
415
|
+
insert: this.insert
|
|
416
|
+
};
|
|
417
|
+
return this.slice.size && (e.slice = this.slice.toJSON()), this.structure && (e.structure = !0), e;
|
|
418
|
+
}
|
|
419
|
+
static fromJSON(t, n) {
|
|
420
|
+
if (typeof n.from != "number" || typeof n.to != "number" || typeof n.gapFrom != "number" || typeof n.gapTo != "number" || typeof n.insert != "number") throw RangeError("Invalid input for ReplaceAroundStep.fromJSON");
|
|
421
|
+
return new e(n.from, n.to, n.gapFrom, n.gapTo, i.fromJSON(t, n.slice), n.insert, !!n.structure);
|
|
422
|
+
}
|
|
423
|
+
};
|
|
424
|
+
v.jsonID("replaceAround", E);
|
|
425
|
+
function D(e, t, n) {
|
|
426
|
+
let r = e.resolve(t), i = n - t, a = r.depth;
|
|
427
|
+
for (; i > 0 && a > 0 && r.indexAfter(a) == r.node(a).childCount;) a--, i--;
|
|
428
|
+
if (i > 0) {
|
|
429
|
+
let e = r.node(a).maybeChild(r.indexAfter(a));
|
|
430
|
+
for (; i > 0;) {
|
|
431
|
+
if (!e || e.isLeaf) return !0;
|
|
432
|
+
e = e.firstChild, i--;
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
return !1;
|
|
436
|
+
}
|
|
437
|
+
function O(e, t, n, r) {
|
|
438
|
+
let i = [], a = [], o, s;
|
|
439
|
+
e.doc.nodesBetween(t, n, (e, c, l) => {
|
|
440
|
+
if (!e.isInline) return;
|
|
441
|
+
let u = e.marks;
|
|
442
|
+
if (!r.isInSet(u) && l.type.allowsMarkType(r.type)) {
|
|
443
|
+
let l = Math.max(c, t), d = Math.min(c + e.nodeSize, n), f = r.addToSet(u);
|
|
444
|
+
for (let e = 0; e < u.length; e++) u[e].isInSet(f) || (o && o.to == l && o.mark.eq(u[e]) ? o.to = d : i.push(o = new S(l, d, u[e])));
|
|
445
|
+
s && s.to == l ? s.to = d : a.push(s = new x(l, d, r));
|
|
446
|
+
}
|
|
447
|
+
}), i.forEach((t) => e.step(t)), a.forEach((t) => e.step(t));
|
|
448
|
+
}
|
|
449
|
+
function k(e, t, r, i) {
|
|
450
|
+
let a = [], o = 0;
|
|
451
|
+
e.doc.nodesBetween(t, r, (e, s) => {
|
|
452
|
+
if (!e.isInline) return;
|
|
453
|
+
o++;
|
|
454
|
+
let c = null;
|
|
455
|
+
if (i instanceof n) {
|
|
456
|
+
let t = e.marks, n;
|
|
457
|
+
for (; n = i.isInSet(t);) (c ||= []).push(n), t = n.removeFromSet(t);
|
|
458
|
+
} else i ? i.isInSet(e.marks) && (c = [i]) : c = e.marks;
|
|
459
|
+
if (c && c.length) {
|
|
460
|
+
let n = Math.min(s + e.nodeSize, r);
|
|
461
|
+
for (let e = 0; e < c.length; e++) {
|
|
462
|
+
let r = c[e], i;
|
|
463
|
+
for (let e = 0; e < a.length; e++) {
|
|
464
|
+
let t = a[e];
|
|
465
|
+
t.step == o - 1 && r.eq(a[e].style) && (i = t);
|
|
466
|
+
}
|
|
467
|
+
i ? (i.to = n, i.step = o) : a.push({
|
|
468
|
+
style: r,
|
|
469
|
+
from: Math.max(s, t),
|
|
470
|
+
to: n,
|
|
471
|
+
step: o
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
}), a.forEach((t) => e.step(new S(t.from, t.to, t.style)));
|
|
476
|
+
}
|
|
477
|
+
function A(t, n, r, a = r.contentMatch, o = !0) {
|
|
478
|
+
let s = t.doc.nodeAt(n), c = [], l = n + 1;
|
|
479
|
+
for (let n = 0; n < s.childCount; n++) {
|
|
480
|
+
let u = s.child(n), d = l + u.nodeSize, f = a.matchType(u.type);
|
|
481
|
+
if (!f) c.push(new T(l, d, i.empty));
|
|
482
|
+
else {
|
|
483
|
+
a = f;
|
|
484
|
+
for (let e = 0; e < u.marks.length; e++) r.allowsMarkType(u.marks[e].type) || t.step(new S(l, d, u.marks[e]));
|
|
485
|
+
if (o && u.isText && r.whitespace != "pre") {
|
|
486
|
+
let t, n = /\r?\n|\r/g, a;
|
|
487
|
+
for (; t = n.exec(u.text);) a ||= new i(e.from(r.schema.text(" ", r.allowedMarks(u.marks))), 0, 0), c.push(new T(l + t.index, l + t.index + t[0].length, a));
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
l = d;
|
|
491
|
+
}
|
|
492
|
+
if (!a.validEnd) {
|
|
493
|
+
let n = a.fillBefore(e.empty, !0);
|
|
494
|
+
t.replace(l, l, new i(n, 0, 0));
|
|
495
|
+
}
|
|
496
|
+
for (let e = c.length - 1; e >= 0; e--) t.step(c[e]);
|
|
497
|
+
}
|
|
498
|
+
function ee(t, n, r) {
|
|
499
|
+
let { $from: a, $to: o, depth: s } = n, c = a.before(s + 1), l = o.after(s + 1), u = c, d = l, f = e.empty, p = 0;
|
|
500
|
+
for (let t = s, n = !1; t > r; t--) n || a.index(t) > 0 ? (n = !0, f = e.from(a.node(t).copy(f)), p++) : u--;
|
|
501
|
+
let m = e.empty, h = 0;
|
|
502
|
+
for (let t = s, n = !1; t > r; t--) n || o.after(t + 1) < o.end(t) ? (n = !0, m = e.from(o.node(t).copy(m)), h++) : d++;
|
|
503
|
+
t.step(new E(u, d, c, l, new i(f.append(m), p, h), f.size - p, !0));
|
|
504
|
+
}
|
|
505
|
+
function j(t, n, r) {
|
|
506
|
+
let a = e.empty;
|
|
507
|
+
for (let t = r.length - 1; t >= 0; t--) {
|
|
508
|
+
if (a.size) {
|
|
509
|
+
let e = r[t].type.contentMatch.matchFragment(a);
|
|
510
|
+
if (!e || !e.validEnd) throw RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper");
|
|
511
|
+
}
|
|
512
|
+
a = e.from(r[t].type.create(r[t].attrs, a));
|
|
513
|
+
}
|
|
514
|
+
let o = n.start, s = n.end;
|
|
515
|
+
t.step(new E(o, s, o, s, new i(a, 0, 0), r.length, !0));
|
|
516
|
+
}
|
|
517
|
+
function M(t, n, r, a, o) {
|
|
518
|
+
if (!a.isTextblock) throw RangeError("Type given to setBlockType should be a textblock");
|
|
519
|
+
let s = t.steps.length;
|
|
520
|
+
t.doc.nodesBetween(n, r, (n, r) => {
|
|
521
|
+
let c = typeof o == "function" ? o(n) : o;
|
|
522
|
+
if (n.isTextblock && !n.hasMarkup(a, c) && F(t.doc, t.mapping.slice(s).map(r), a)) {
|
|
523
|
+
let o = null;
|
|
524
|
+
if (a.schema.linebreakReplacement) {
|
|
525
|
+
let e = a.whitespace == "pre", t = !!a.contentMatch.matchType(a.schema.linebreakReplacement);
|
|
526
|
+
e && !t ? o = !1 : !e && t && (o = !0);
|
|
527
|
+
}
|
|
528
|
+
o === !1 && P(t, n, r, s), A(t, t.mapping.slice(s).map(r, 1), a, void 0, o === null);
|
|
529
|
+
let l = t.mapping.slice(s), u = l.map(r, 1), d = l.map(r + n.nodeSize, 1);
|
|
530
|
+
return t.step(new E(u, d, u + 1, d - 1, new i(e.from(a.create(c, null, n.marks)), 0, 0), 1, !0)), o === !0 && N(t, n, r, s), !1;
|
|
531
|
+
}
|
|
532
|
+
});
|
|
533
|
+
}
|
|
534
|
+
function N(e, t, n, r) {
|
|
535
|
+
t.forEach((i, a) => {
|
|
536
|
+
if (i.isText) {
|
|
537
|
+
let o, s = /\r?\n|\r/g;
|
|
538
|
+
for (; o = s.exec(i.text);) {
|
|
539
|
+
let i = e.mapping.slice(r).map(n + 1 + a + o.index);
|
|
540
|
+
e.replaceWith(i, i + 1, t.type.schema.linebreakReplacement.create());
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
});
|
|
544
|
+
}
|
|
545
|
+
function P(e, t, n, r) {
|
|
546
|
+
t.forEach((i, a) => {
|
|
547
|
+
if (i.type == i.type.schema.linebreakReplacement) {
|
|
548
|
+
let i = e.mapping.slice(r).map(n + 1 + a);
|
|
549
|
+
e.replaceWith(i, i + 1, t.type.schema.text("\n"));
|
|
550
|
+
}
|
|
551
|
+
});
|
|
552
|
+
}
|
|
553
|
+
function F(e, t, n) {
|
|
554
|
+
let r = e.resolve(t), i = r.index();
|
|
555
|
+
return r.parent.canReplaceWith(i, i + 1, n);
|
|
556
|
+
}
|
|
557
|
+
function I(t, n, r, a, o) {
|
|
558
|
+
let s = t.doc.nodeAt(n);
|
|
559
|
+
if (!s) throw RangeError("No node at given position");
|
|
560
|
+
r ||= s.type;
|
|
561
|
+
let c = r.create(a, null, o || s.marks);
|
|
562
|
+
if (s.isLeaf) return t.replaceWith(n, n + s.nodeSize, c);
|
|
563
|
+
if (!r.validContent(s.content)) throw RangeError("Invalid content for node type " + r.name);
|
|
564
|
+
t.step(new E(n, n + s.nodeSize, n + 1, n + s.nodeSize - 1, new i(e.from(c), 0, 0), 1, !0));
|
|
565
|
+
}
|
|
566
|
+
function L(t, n, r = 1, a) {
|
|
567
|
+
let o = t.doc.resolve(n), s = e.empty, c = e.empty;
|
|
568
|
+
for (let t = o.depth, n = o.depth - r, i = r - 1; t > n; t--, i--) {
|
|
569
|
+
s = e.from(o.node(t).copy(s));
|
|
570
|
+
let n = a && a[i];
|
|
571
|
+
c = e.from(n ? n.type.create(n.attrs, c) : o.node(t).copy(c));
|
|
572
|
+
}
|
|
573
|
+
t.step(new T(n, n, new i(s.append(c), r, r), !0));
|
|
574
|
+
}
|
|
575
|
+
function te(e, t, n) {
|
|
576
|
+
let r = null, { linebreakReplacement: a } = e.doc.type.schema, o = e.doc.resolve(t - n), s = o.node().type;
|
|
577
|
+
if (a && s.inlineContent) {
|
|
578
|
+
let e = s.whitespace == "pre", t = !!s.contentMatch.matchType(a);
|
|
579
|
+
e && !t ? r = !1 : !e && t && (r = !0);
|
|
580
|
+
}
|
|
581
|
+
let c = e.steps.length;
|
|
582
|
+
if (r === !1) {
|
|
583
|
+
let r = e.doc.resolve(t + n);
|
|
584
|
+
P(e, r.node(), r.before(), c);
|
|
585
|
+
}
|
|
586
|
+
s.inlineContent && A(e, t + n - 1, s, o.node().contentMatchAt(o.index()), r == null);
|
|
587
|
+
let l = e.mapping.slice(c), u = l.map(t - n);
|
|
588
|
+
if (e.step(new T(u, l.map(t + n, -1), i.empty, !0)), r === !0) {
|
|
589
|
+
let t = e.doc.resolve(u);
|
|
590
|
+
N(e, t.node(), t.before(), e.steps.length);
|
|
591
|
+
}
|
|
592
|
+
return e;
|
|
593
|
+
}
|
|
594
|
+
function ne(e, t, n) {
|
|
595
|
+
let r = e.resolve(t);
|
|
596
|
+
if (r.parent.canReplaceWith(r.index(), r.index(), n)) return t;
|
|
597
|
+
if (r.parentOffset == 0) for (let e = r.depth - 1; e >= 0; e--) {
|
|
598
|
+
let t = r.index(e);
|
|
599
|
+
if (r.node(e).canReplaceWith(t, t, n)) return r.before(e + 1);
|
|
600
|
+
if (t > 0) return null;
|
|
601
|
+
}
|
|
602
|
+
if (r.parentOffset == r.parent.content.size) for (let e = r.depth - 1; e >= 0; e--) {
|
|
603
|
+
let t = r.indexAfter(e);
|
|
604
|
+
if (r.node(e).canReplaceWith(t, t, n)) return r.after(e + 1);
|
|
605
|
+
if (t < r.node(e).childCount) return null;
|
|
606
|
+
}
|
|
607
|
+
return null;
|
|
608
|
+
}
|
|
609
|
+
function re(e, t, n = t, r = i.empty) {
|
|
610
|
+
if (t == n && !r.size) return null;
|
|
611
|
+
let a = e.resolve(t), o = e.resolve(n);
|
|
612
|
+
return R(a, o, r) ? new T(t, n, r) : new z(a, o, r).fit();
|
|
613
|
+
}
|
|
614
|
+
function R(e, t, n) {
|
|
615
|
+
return !n.openStart && !n.openEnd && e.start() == t.start() && e.parent.canReplace(e.index(), t.index(), n.content);
|
|
616
|
+
}
|
|
617
|
+
var z = class {
|
|
618
|
+
constructor(t, n, r) {
|
|
619
|
+
this.$from = t, this.$to = n, this.unplaced = r, this.frontier = [], this.placed = e.empty;
|
|
620
|
+
for (let e = 0; e <= t.depth; e++) {
|
|
621
|
+
let n = t.node(e);
|
|
622
|
+
this.frontier.push({
|
|
623
|
+
type: n.type,
|
|
624
|
+
match: n.contentMatchAt(t.indexAfter(e))
|
|
625
|
+
});
|
|
626
|
+
}
|
|
627
|
+
for (let n = t.depth; n > 0; n--) this.placed = e.from(t.node(n).copy(this.placed));
|
|
628
|
+
}
|
|
629
|
+
get depth() {
|
|
630
|
+
return this.frontier.length - 1;
|
|
631
|
+
}
|
|
632
|
+
fit() {
|
|
633
|
+
for (; this.unplaced.size;) {
|
|
634
|
+
let e = this.findFittable();
|
|
635
|
+
e ? this.placeNodes(e) : this.openMore() || this.dropNode();
|
|
636
|
+
}
|
|
637
|
+
let e = this.mustMoveInline(), t = this.placed.size - this.depth - this.$from.depth, n = this.$from, r = this.close(e < 0 ? this.$to : n.doc.resolve(e));
|
|
638
|
+
if (!r) return null;
|
|
639
|
+
let a = this.placed, o = n.depth, s = r.depth;
|
|
640
|
+
for (; o && s && a.childCount == 1;) a = a.firstChild.content, o--, s--;
|
|
641
|
+
let c = new i(a, o, s);
|
|
642
|
+
return e > -1 ? new E(n.pos, e, this.$to.pos, this.$to.end(), c, t) : c.size || n.pos != this.$to.pos ? new T(n.pos, r.pos, c) : null;
|
|
643
|
+
}
|
|
644
|
+
findFittable() {
|
|
645
|
+
let t = this.unplaced.openStart;
|
|
646
|
+
for (let e = this.unplaced.content, n = 0, r = this.unplaced.openEnd; n < t; n++) {
|
|
647
|
+
let i = e.firstChild;
|
|
648
|
+
if (e.childCount > 1 && (r = 0), i.type.spec.isolating && r <= n) {
|
|
649
|
+
t = n;
|
|
650
|
+
break;
|
|
651
|
+
}
|
|
652
|
+
e = i.content;
|
|
653
|
+
}
|
|
654
|
+
for (let n = 1; n <= 2; n++) for (let r = n == 1 ? t : this.unplaced.openStart; r >= 0; r--) {
|
|
655
|
+
let t, i = null;
|
|
656
|
+
r ? (i = H(this.unplaced.content, r - 1).firstChild, t = i.content) : t = this.unplaced.content;
|
|
657
|
+
let a = t.firstChild;
|
|
658
|
+
for (let t = this.depth; t >= 0; t--) {
|
|
659
|
+
let { type: o, match: s } = this.frontier[t], c, l = null;
|
|
660
|
+
if (n == 1 && (a ? s.matchType(a.type) || (l = s.fillBefore(e.from(a), !1)) : i && o.compatibleContent(i.type))) return {
|
|
661
|
+
sliceDepth: r,
|
|
662
|
+
frontierDepth: t,
|
|
663
|
+
parent: i,
|
|
664
|
+
inject: l
|
|
665
|
+
};
|
|
666
|
+
if (n == 2 && a && (c = s.findWrapping(a.type))) return {
|
|
667
|
+
sliceDepth: r,
|
|
668
|
+
frontierDepth: t,
|
|
669
|
+
parent: i,
|
|
670
|
+
wrap: c
|
|
671
|
+
};
|
|
672
|
+
if (i && s.matchType(i.type)) break;
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
openMore() {
|
|
677
|
+
let { content: e, openStart: t, openEnd: n } = this.unplaced, r = H(e, t);
|
|
678
|
+
return !r.childCount || r.firstChild.isLeaf ? !1 : (this.unplaced = new i(e, t + 1, Math.max(n, r.size + t >= e.size - n ? t + 1 : 0)), !0);
|
|
679
|
+
}
|
|
680
|
+
dropNode() {
|
|
681
|
+
let { content: e, openStart: t, openEnd: n } = this.unplaced, r = H(e, t);
|
|
682
|
+
if (r.childCount <= 1 && t > 0) {
|
|
683
|
+
let a = e.size - t <= t + r.size;
|
|
684
|
+
this.unplaced = new i(B(e, t - 1, 1), t - 1, a ? t - 1 : n);
|
|
685
|
+
} else this.unplaced = new i(B(e, t, 1), t, n);
|
|
686
|
+
}
|
|
687
|
+
placeNodes({ sliceDepth: t, frontierDepth: n, parent: r, inject: a, wrap: o }) {
|
|
688
|
+
for (; this.depth > n;) this.closeFrontierNode();
|
|
689
|
+
if (o) for (let e = 0; e < o.length; e++) this.openFrontierNode(o[e]);
|
|
690
|
+
let s = this.unplaced, c = r ? r.content : s.content, l = s.openStart - t, u = 0, d = [], { match: f, type: p } = this.frontier[n];
|
|
691
|
+
if (a) {
|
|
692
|
+
for (let e = 0; e < a.childCount; e++) d.push(a.child(e));
|
|
693
|
+
f = f.matchFragment(a);
|
|
694
|
+
}
|
|
695
|
+
let m = c.size + t - (s.content.size - s.openEnd);
|
|
696
|
+
for (; u < c.childCount;) {
|
|
697
|
+
let e = c.child(u), t = f.matchType(e.type);
|
|
698
|
+
if (!t) break;
|
|
699
|
+
u++, (u > 1 || l == 0 || e.content.size) && (f = t, d.push(U(e.mark(p.allowedMarks(e.marks)), u == 1 ? l : 0, u == c.childCount ? m : -1)));
|
|
700
|
+
}
|
|
701
|
+
let h = u == c.childCount;
|
|
702
|
+
h || (m = -1), this.placed = V(this.placed, n, e.from(d)), this.frontier[n].match = f, h && m < 0 && r && r.type == this.frontier[this.depth].type && this.frontier.length > 1 && this.closeFrontierNode();
|
|
703
|
+
for (let e = 0, t = c; e < m; e++) {
|
|
704
|
+
let e = t.lastChild;
|
|
705
|
+
this.frontier.push({
|
|
706
|
+
type: e.type,
|
|
707
|
+
match: e.contentMatchAt(e.childCount)
|
|
708
|
+
}), t = e.content;
|
|
709
|
+
}
|
|
710
|
+
this.unplaced = h ? t == 0 ? i.empty : new i(B(s.content, t - 1, 1), t - 1, m < 0 ? s.openEnd : t - 1) : new i(B(s.content, t, u), s.openStart, s.openEnd);
|
|
711
|
+
}
|
|
712
|
+
mustMoveInline() {
|
|
713
|
+
if (!this.$to.parent.isTextblock) return -1;
|
|
714
|
+
let e = this.frontier[this.depth], t;
|
|
715
|
+
if (!e.type.isTextblock || !W(this.$to, this.$to.depth, e.type, e.match, !1) || this.$to.depth == this.depth && (t = this.findCloseLevel(this.$to)) && t.depth == this.depth) return -1;
|
|
716
|
+
let { depth: n } = this.$to, r = this.$to.after(n);
|
|
717
|
+
for (; n > 1 && r == this.$to.end(--n);) ++r;
|
|
718
|
+
return r;
|
|
719
|
+
}
|
|
720
|
+
findCloseLevel(e) {
|
|
721
|
+
scan: for (let t = Math.min(this.depth, e.depth); t >= 0; t--) {
|
|
722
|
+
let { match: n, type: r } = this.frontier[t], i = t < e.depth && e.end(t + 1) == e.pos + (e.depth - (t + 1)), a = W(e, t, r, n, i);
|
|
723
|
+
if (a) {
|
|
724
|
+
for (let n = t - 1; n >= 0; n--) {
|
|
725
|
+
let { match: t, type: r } = this.frontier[n], i = W(e, n, r, t, !0);
|
|
726
|
+
if (!i || i.childCount) continue scan;
|
|
727
|
+
}
|
|
728
|
+
return {
|
|
729
|
+
depth: t,
|
|
730
|
+
fit: a,
|
|
731
|
+
move: i ? e.doc.resolve(e.after(t + 1)) : e
|
|
732
|
+
};
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
close(e) {
|
|
737
|
+
let t = this.findCloseLevel(e);
|
|
738
|
+
if (!t) return null;
|
|
739
|
+
for (; this.depth > t.depth;) this.closeFrontierNode();
|
|
740
|
+
t.fit.childCount && (this.placed = V(this.placed, t.depth, t.fit)), e = t.move;
|
|
741
|
+
for (let n = t.depth + 1; n <= e.depth; n++) {
|
|
742
|
+
let t = e.node(n), r = t.type.contentMatch.fillBefore(t.content, !0, e.index(n));
|
|
743
|
+
this.openFrontierNode(t.type, t.attrs, r);
|
|
744
|
+
}
|
|
745
|
+
return e;
|
|
746
|
+
}
|
|
747
|
+
openFrontierNode(t, n = null, r) {
|
|
748
|
+
let i = this.frontier[this.depth];
|
|
749
|
+
i.match = i.match.matchType(t), this.placed = V(this.placed, this.depth, e.from(t.create(n, r))), this.frontier.push({
|
|
750
|
+
type: t,
|
|
751
|
+
match: t.contentMatch
|
|
752
|
+
});
|
|
753
|
+
}
|
|
754
|
+
closeFrontierNode() {
|
|
755
|
+
let t = this.frontier.pop().match.fillBefore(e.empty, !0);
|
|
756
|
+
t.childCount && (this.placed = V(this.placed, this.frontier.length, t));
|
|
757
|
+
}
|
|
758
|
+
};
|
|
759
|
+
function B(e, t, n) {
|
|
760
|
+
return t == 0 ? e.cutByIndex(n, e.childCount) : e.replaceChild(0, e.firstChild.copy(B(e.firstChild.content, t - 1, n)));
|
|
761
|
+
}
|
|
762
|
+
function V(e, t, n) {
|
|
763
|
+
return t == 0 ? e.append(n) : e.replaceChild(e.childCount - 1, e.lastChild.copy(V(e.lastChild.content, t - 1, n)));
|
|
764
|
+
}
|
|
765
|
+
function H(e, t) {
|
|
766
|
+
for (let n = 0; n < t; n++) e = e.firstChild.content;
|
|
767
|
+
return e;
|
|
768
|
+
}
|
|
769
|
+
function U(t, n, r) {
|
|
770
|
+
if (n <= 0) return t;
|
|
771
|
+
let i = t.content;
|
|
772
|
+
return n > 1 && (i = i.replaceChild(0, U(i.firstChild, n - 1, i.childCount == 1 ? r - 1 : 0))), n > 0 && (i = t.type.contentMatch.fillBefore(i).append(i), r <= 0 && (i = i.append(t.type.contentMatch.matchFragment(i).fillBefore(e.empty, !0)))), t.copy(i);
|
|
773
|
+
}
|
|
774
|
+
function W(e, t, n, r, i) {
|
|
775
|
+
let a = e.node(t), o = i ? e.indexAfter(t) : e.index(t);
|
|
776
|
+
if (o == a.childCount && !n.compatibleContent(a.type)) return null;
|
|
777
|
+
let s = r.fillBefore(a.content, !0, o);
|
|
778
|
+
return s && !G(n, a.content, o) ? s : null;
|
|
779
|
+
}
|
|
780
|
+
function G(e, t, n) {
|
|
781
|
+
for (let r = n; r < t.childCount; r++) if (!e.allowsMarks(t.child(r).marks)) return !0;
|
|
782
|
+
return !1;
|
|
783
|
+
}
|
|
784
|
+
function K(e) {
|
|
785
|
+
return e.spec.defining || e.spec.definingForContent;
|
|
786
|
+
}
|
|
787
|
+
function q(e, t, n, r) {
|
|
788
|
+
if (!r.size) return e.deleteRange(t, n);
|
|
789
|
+
let a = e.doc.resolve(t), o = e.doc.resolve(n);
|
|
790
|
+
if (R(a, o, r)) return e.step(new T(t, n, r));
|
|
791
|
+
let s = X(a, o);
|
|
792
|
+
s[s.length - 1] == 0 && s.pop();
|
|
793
|
+
let c = -(a.depth + 1);
|
|
794
|
+
s.unshift(c);
|
|
795
|
+
for (let e = a.depth, t = a.pos - 1; e > 0; e--, t--) {
|
|
796
|
+
let n = a.node(e).type.spec;
|
|
797
|
+
if (n.defining || n.definingAsContext || n.isolating) break;
|
|
798
|
+
s.indexOf(e) > -1 ? c = e : a.before(e) == t && s.splice(1, 0, -e);
|
|
799
|
+
}
|
|
800
|
+
let l = s.indexOf(c), u = [], d = r.openStart;
|
|
801
|
+
for (let e = r.content, t = 0;; t++) {
|
|
802
|
+
let n = e.firstChild;
|
|
803
|
+
if (u.push(n), t == r.openStart) break;
|
|
804
|
+
e = n.content;
|
|
805
|
+
}
|
|
806
|
+
for (let e = d - 1; e >= 0; e--) {
|
|
807
|
+
let t = u[e], n = K(t.type);
|
|
808
|
+
if (n && !t.sameMarkup(a.node(Math.abs(c) - 1))) d = e;
|
|
809
|
+
else if (n || !t.type.isTextblock) break;
|
|
810
|
+
}
|
|
811
|
+
for (let t = r.openStart; t >= 0; t--) {
|
|
812
|
+
let c = (t + d + 1) % (r.openStart + 1), f = u[c];
|
|
813
|
+
if (f) for (let t = 0; t < s.length; t++) {
|
|
814
|
+
let u = s[(t + l) % s.length], d = !0;
|
|
815
|
+
u < 0 && (d = !1, u = -u);
|
|
816
|
+
let p = a.node(u - 1), m = a.index(u - 1);
|
|
817
|
+
if (p.canReplaceWith(m, m, f.type, f.marks)) return e.replace(a.before(u), d ? o.after(u) : n, new i(J(r.content, 0, r.openStart, c), c, r.openEnd));
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
let f = e.steps.length;
|
|
821
|
+
for (let i = s.length - 1; i >= 0 && (e.replace(t, n, r), !(e.steps.length > f)); i--) {
|
|
822
|
+
let e = s[i];
|
|
823
|
+
e < 0 || (t = a.before(e), n = o.after(e));
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
function J(t, n, r, i, a) {
|
|
827
|
+
if (n < r) {
|
|
828
|
+
let e = t.firstChild;
|
|
829
|
+
t = t.replaceChild(0, e.copy(J(e.content, n + 1, r, i, e)));
|
|
830
|
+
}
|
|
831
|
+
if (n > i) {
|
|
832
|
+
let n = a.contentMatchAt(0), r = n.fillBefore(t).append(t);
|
|
833
|
+
t = r.append(n.matchFragment(r).fillBefore(e.empty, !0));
|
|
834
|
+
}
|
|
835
|
+
return t;
|
|
836
|
+
}
|
|
837
|
+
function Y(t, n, r, a) {
|
|
838
|
+
if (!a.isInline && n == r && t.doc.resolve(n).parent.content.size) {
|
|
839
|
+
let e = ne(t.doc, n, a.type);
|
|
840
|
+
e != null && (n = r = e);
|
|
841
|
+
}
|
|
842
|
+
t.replaceRange(n, r, new i(e.from(a), 0, 0));
|
|
843
|
+
}
|
|
844
|
+
function ie(e, t, n) {
|
|
845
|
+
let r = e.doc.resolve(t), i = e.doc.resolve(n);
|
|
846
|
+
if (r.parent.isTextblock && i.parent.isTextblock && r.start() != i.start() && r.parentOffset == 0 && i.parentOffset == 0) {
|
|
847
|
+
let a = r.sharedDepth(n), o = !1;
|
|
848
|
+
for (let e = r.depth; e > a; e--) r.node(e).type.spec.isolating && (o = !0);
|
|
849
|
+
for (let e = i.depth; e > a; e--) i.node(e).type.spec.isolating && (o = !0);
|
|
850
|
+
if (!o) {
|
|
851
|
+
for (let e = r.depth; e > 0 && t == r.start(e); e--) t = r.before(e);
|
|
852
|
+
for (let e = i.depth; e > 0 && n == i.start(e); e--) n = i.before(e);
|
|
853
|
+
r = e.doc.resolve(t), i = e.doc.resolve(n);
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
let a = X(r, i);
|
|
857
|
+
for (let t = 0; t < a.length; t++) {
|
|
858
|
+
let n = a[t], o = t == a.length - 1;
|
|
859
|
+
if (o && n == 0 || r.node(n).type.contentMatch.validEnd) return e.delete(r.start(n), i.end(n));
|
|
860
|
+
if (n > 0 && (o || r.node(n - 1).canReplace(r.index(n - 1), i.indexAfter(n - 1)))) return e.delete(r.before(n), i.after(n));
|
|
861
|
+
}
|
|
862
|
+
for (let a = 1; a <= r.depth && a <= i.depth; a++) if (t - r.start(a) == r.depth - a && n > r.end(a) && i.end(a) - n != i.depth - a && r.start(a - 1) == i.start(a - 1) && r.node(a - 1).canReplace(r.index(a - 1), i.index(a - 1))) return e.delete(r.before(a), n);
|
|
863
|
+
e.delete(t, n);
|
|
864
|
+
}
|
|
865
|
+
function X(e, t) {
|
|
866
|
+
let n = [], r = Math.min(e.depth, t.depth);
|
|
867
|
+
for (let i = r; i >= 0; i--) {
|
|
868
|
+
let r = e.start(i);
|
|
869
|
+
if (r < e.pos - (e.depth - i) || t.end(i) > t.pos + (t.depth - i) || e.node(i).type.spec.isolating || t.node(i).type.spec.isolating) break;
|
|
870
|
+
(r == t.start(i) || i == e.depth && i == t.depth && e.parent.inlineContent && t.parent.inlineContent && i && t.start(i - 1) == r - 1) && n.push(i);
|
|
871
|
+
}
|
|
872
|
+
return n;
|
|
873
|
+
}
|
|
874
|
+
var Z = class t extends v {
|
|
875
|
+
constructor(e, t, n) {
|
|
876
|
+
super(), this.pos = e, this.attr = t, this.value = n;
|
|
877
|
+
}
|
|
878
|
+
apply(t) {
|
|
879
|
+
let n = t.nodeAt(this.pos);
|
|
880
|
+
if (!n) return y.fail("No node at attribute step's position");
|
|
881
|
+
let r = Object.create(null);
|
|
882
|
+
for (let e in n.attrs) r[e] = n.attrs[e];
|
|
883
|
+
r[this.attr] = this.value;
|
|
884
|
+
let a = n.type.create(r, null, n.marks);
|
|
885
|
+
return y.fromReplace(t, this.pos, this.pos + 1, new i(e.from(a), 0, +!n.isLeaf));
|
|
886
|
+
}
|
|
887
|
+
getMap() {
|
|
888
|
+
return h.empty;
|
|
889
|
+
}
|
|
890
|
+
invert(e) {
|
|
891
|
+
return new t(this.pos, this.attr, e.nodeAt(this.pos).attrs[this.attr]);
|
|
892
|
+
}
|
|
893
|
+
map(e) {
|
|
894
|
+
let n = e.mapResult(this.pos, 1);
|
|
895
|
+
return n.deletedAfter ? null : new t(n.pos, this.attr, this.value);
|
|
896
|
+
}
|
|
897
|
+
toJSON() {
|
|
898
|
+
return {
|
|
899
|
+
stepType: "attr",
|
|
900
|
+
pos: this.pos,
|
|
901
|
+
attr: this.attr,
|
|
902
|
+
value: this.value
|
|
903
|
+
};
|
|
904
|
+
}
|
|
905
|
+
static fromJSON(e, n) {
|
|
906
|
+
if (typeof n.pos != "number" || typeof n.attr != "string") throw RangeError("Invalid input for AttrStep.fromJSON");
|
|
907
|
+
return new t(n.pos, n.attr, n.value);
|
|
908
|
+
}
|
|
909
|
+
};
|
|
910
|
+
v.jsonID("attr", Z);
|
|
911
|
+
var Q = class e extends v {
|
|
912
|
+
constructor(e, t) {
|
|
913
|
+
super(), this.attr = e, this.value = t;
|
|
914
|
+
}
|
|
915
|
+
apply(e) {
|
|
916
|
+
let t = Object.create(null);
|
|
917
|
+
for (let n in e.attrs) t[n] = e.attrs[n];
|
|
918
|
+
t[this.attr] = this.value;
|
|
919
|
+
let n = e.type.create(t, e.content, e.marks);
|
|
920
|
+
return y.ok(n);
|
|
921
|
+
}
|
|
922
|
+
getMap() {
|
|
923
|
+
return h.empty;
|
|
924
|
+
}
|
|
925
|
+
invert(t) {
|
|
926
|
+
return new e(this.attr, t.attrs[this.attr]);
|
|
927
|
+
}
|
|
928
|
+
map(e) {
|
|
929
|
+
return this;
|
|
930
|
+
}
|
|
931
|
+
toJSON() {
|
|
932
|
+
return {
|
|
933
|
+
stepType: "docAttr",
|
|
934
|
+
attr: this.attr,
|
|
935
|
+
value: this.value
|
|
936
|
+
};
|
|
937
|
+
}
|
|
938
|
+
static fromJSON(t, n) {
|
|
939
|
+
if (typeof n.attr != "string") throw RangeError("Invalid input for DocAttrStep.fromJSON");
|
|
940
|
+
return new e(n.attr, n.value);
|
|
941
|
+
}
|
|
942
|
+
};
|
|
943
|
+
v.jsonID("docAttr", Q);
|
|
944
|
+
var $ = class extends Error {};
|
|
945
|
+
$ = function e(t) {
|
|
946
|
+
let n = Error.call(this, t);
|
|
947
|
+
return n.__proto__ = e.prototype, n;
|
|
948
|
+
}, $.prototype = Object.create(Error.prototype), $.prototype.constructor = $, $.prototype.name = "TransformError";
|
|
949
|
+
var ae = class {
|
|
950
|
+
constructor(e) {
|
|
951
|
+
this.doc = e, this.steps = [], this.docs = [], this.mapping = new g();
|
|
952
|
+
}
|
|
953
|
+
get before() {
|
|
954
|
+
return this.docs.length ? this.docs[0] : this.doc;
|
|
955
|
+
}
|
|
956
|
+
step(e) {
|
|
957
|
+
let t = this.maybeStep(e);
|
|
958
|
+
if (t.failed) throw new $(t.failed);
|
|
959
|
+
return this;
|
|
960
|
+
}
|
|
961
|
+
maybeStep(e) {
|
|
962
|
+
let t = e.apply(this.doc);
|
|
963
|
+
return t.failed || this.addStep(e, t.doc), t;
|
|
964
|
+
}
|
|
965
|
+
get docChanged() {
|
|
966
|
+
return this.steps.length > 0;
|
|
967
|
+
}
|
|
968
|
+
changedRange() {
|
|
969
|
+
let e = 1e9, t = -1e9;
|
|
970
|
+
for (let n = 0; n < this.mapping.maps.length; n++) {
|
|
971
|
+
let r = this.mapping.maps[n];
|
|
972
|
+
n && (e = r.map(e, 1), t = r.map(t, -1)), r.forEach((n, r, i, a) => {
|
|
973
|
+
e = Math.min(e, i), t = Math.max(t, a);
|
|
974
|
+
});
|
|
975
|
+
}
|
|
976
|
+
return e == 1e9 ? null : {
|
|
977
|
+
from: e,
|
|
978
|
+
to: t
|
|
979
|
+
};
|
|
980
|
+
}
|
|
981
|
+
addStep(e, t) {
|
|
982
|
+
this.docs.push(this.doc), this.steps.push(e), this.mapping.appendMap(e.getMap()), this.doc = t;
|
|
983
|
+
}
|
|
984
|
+
replace(e, t = e, n = i.empty) {
|
|
985
|
+
let r = re(this.doc, e, t, n);
|
|
986
|
+
return r && this.step(r), this;
|
|
987
|
+
}
|
|
988
|
+
replaceWith(t, n, r) {
|
|
989
|
+
return this.replace(t, n, new i(e.from(r), 0, 0));
|
|
990
|
+
}
|
|
991
|
+
delete(e, t) {
|
|
992
|
+
return this.replace(e, t, i.empty);
|
|
993
|
+
}
|
|
994
|
+
insert(e, t) {
|
|
995
|
+
return this.replaceWith(e, e, t);
|
|
996
|
+
}
|
|
997
|
+
replaceRange(e, t, n) {
|
|
998
|
+
return q(this, e, t, n), this;
|
|
999
|
+
}
|
|
1000
|
+
replaceRangeWith(e, t, n) {
|
|
1001
|
+
return Y(this, e, t, n), this;
|
|
1002
|
+
}
|
|
1003
|
+
deleteRange(e, t) {
|
|
1004
|
+
return ie(this, e, t), this;
|
|
1005
|
+
}
|
|
1006
|
+
lift(e, t) {
|
|
1007
|
+
return ee(this, e, t), this;
|
|
1008
|
+
}
|
|
1009
|
+
join(e, t = 1) {
|
|
1010
|
+
return te(this, e, t), this;
|
|
1011
|
+
}
|
|
1012
|
+
wrap(e, t) {
|
|
1013
|
+
return j(this, e, t), this;
|
|
1014
|
+
}
|
|
1015
|
+
setBlockType(e, t = e, n, r = null) {
|
|
1016
|
+
return M(this, e, t, n, r), this;
|
|
1017
|
+
}
|
|
1018
|
+
setNodeMarkup(e, t, n = null, r) {
|
|
1019
|
+
return I(this, e, t, n, r), this;
|
|
1020
|
+
}
|
|
1021
|
+
setNodeAttribute(e, t, n) {
|
|
1022
|
+
return this.step(new Z(e, t, n)), this;
|
|
1023
|
+
}
|
|
1024
|
+
setDocAttribute(e, t) {
|
|
1025
|
+
return this.step(new Q(e, t)), this;
|
|
1026
|
+
}
|
|
1027
|
+
addNodeMark(e, t) {
|
|
1028
|
+
return this.step(new C(e, t)), this;
|
|
1029
|
+
}
|
|
1030
|
+
removeNodeMark(e, n) {
|
|
1031
|
+
let r = this.doc.nodeAt(e);
|
|
1032
|
+
if (!r) throw RangeError("No node at position " + e);
|
|
1033
|
+
if (n instanceof t) n.isInSet(r.marks) && this.step(new w(e, n));
|
|
1034
|
+
else {
|
|
1035
|
+
let t = r.marks, i, a = [];
|
|
1036
|
+
for (; i = n.isInSet(t);) a.push(new w(e, i)), t = i.removeFromSet(t);
|
|
1037
|
+
for (let e = a.length - 1; e >= 0; e--) this.step(a[e]);
|
|
1038
|
+
}
|
|
1039
|
+
return this;
|
|
1040
|
+
}
|
|
1041
|
+
split(e, t = 1, n) {
|
|
1042
|
+
return L(this, e, t, n), this;
|
|
1043
|
+
}
|
|
1044
|
+
addMark(e, t, n) {
|
|
1045
|
+
return O(this, e, t, n), this;
|
|
1046
|
+
}
|
|
1047
|
+
removeMark(e, t, n) {
|
|
1048
|
+
return k(this, e, t, n), this;
|
|
1049
|
+
}
|
|
1050
|
+
clearIncompatible(e, t, n) {
|
|
1051
|
+
return A(this, e, t, n), this;
|
|
1052
|
+
}
|
|
1053
|
+
};
|
|
1054
|
+
//#endregion
|
|
1055
|
+
export { g as Mapping, E as ReplaceAroundStep, T as ReplaceStep, ae as Transform };
|