roosterjs-content-model-core 0.28.0 → 9.0.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/README.md +47 -37
- package/lib/command/createModelFromHtml/convertInlineCss.js +75 -0
- package/lib/command/createModelFromHtml/convertInlineCss.js.map +1 -0
- package/lib/command/createModelFromHtml/createDomToModelContextForSanitizing.d.ts +5 -0
- package/lib/command/createModelFromHtml/createDomToModelContextForSanitizing.js +43 -0
- package/lib/command/createModelFromHtml/createDomToModelContextForSanitizing.js.map +1 -0
- package/lib/command/createModelFromHtml/createModelFromHtml.d.ts +9 -0
- package/lib/command/createModelFromHtml/createModelFromHtml.js +31 -0
- package/lib/command/createModelFromHtml/createModelFromHtml.js.map +1 -0
- package/lib/command/createModelFromHtml/sanitizeElement.js.map +1 -0
- package/lib/command/exportContent/exportContent.js.map +1 -0
- package/lib/command/paste/createPasteFragment.js.map +1 -0
- package/lib/command/paste/generatePasteOptionFromPlugins.js.map +1 -0
- package/lib/command/paste/mergePasteContent.d.ts +9 -0
- package/lib/command/paste/mergePasteContent.js +76 -0
- package/lib/command/paste/mergePasteContent.js.map +1 -0
- package/lib/command/paste/paste.js +42 -0
- package/lib/command/paste/paste.js.map +1 -0
- package/lib/command/paste/retrieveHtmlInfo.d.ts +15 -0
- package/lib/command/paste/retrieveHtmlInfo.js +69 -0
- package/lib/command/paste/retrieveHtmlInfo.js.map +1 -0
- package/lib/command/redo/redo.js.map +1 -0
- package/lib/command/undo/undo.js.map +1 -0
- package/lib/coreApi/addUndoSnapshot/addUndoSnapshot.js +69 -0
- package/lib/coreApi/addUndoSnapshot/addUndoSnapshot.js.map +1 -0
- package/lib/coreApi/addUndoSnapshot/createSnapshotSelection.d.ts +5 -0
- package/lib/coreApi/addUndoSnapshot/createSnapshotSelection.js +117 -0
- package/lib/coreApi/addUndoSnapshot/createSnapshotSelection.js.map +1 -0
- package/lib/coreApi/addUndoSnapshot/getPath.d.ts +15 -0
- package/lib/coreApi/addUndoSnapshot/getPath.js +60 -0
- package/lib/coreApi/addUndoSnapshot/getPath.js.map +1 -0
- package/lib/coreApi/attachDomEvent/attachDomEvent.js.map +1 -0
- package/lib/coreApi/coreApiMap.js +40 -0
- package/lib/coreApi/coreApiMap.js.map +1 -0
- package/lib/coreApi/createContentModel/createContentModel.js +47 -0
- package/lib/coreApi/createContentModel/createContentModel.js.map +1 -0
- package/lib/coreApi/createEditorContext/createEditorContext.js +26 -0
- package/lib/coreApi/createEditorContext/createEditorContext.js.map +1 -0
- package/lib/coreApi/createEditorContext/getRootComputedStyleForContext.js.map +1 -0
- package/lib/coreApi/focus/focus.js.map +1 -0
- package/lib/coreApi/formatContentModel/formatContentModel.js +122 -0
- package/lib/coreApi/formatContentModel/formatContentModel.js.map +1 -0
- package/lib/coreApi/getDOMSelection/getDOMSelection.js +32 -0
- package/lib/coreApi/getDOMSelection/getDOMSelection.js.map +1 -0
- package/lib/coreApi/getVisibleViewport/getVisibleViewport.js.map +1 -0
- package/lib/coreApi/restoreUndoSnapshot/getPositionFromPath.d.ts +7 -0
- package/lib/coreApi/restoreUndoSnapshot/getPositionFromPath.js +29 -0
- package/lib/coreApi/restoreUndoSnapshot/getPositionFromPath.js.map +1 -0
- package/lib/coreApi/restoreUndoSnapshot/restoreSnapshotColors.js +16 -0
- package/lib/coreApi/restoreUndoSnapshot/restoreSnapshotColors.js.map +1 -0
- package/lib/coreApi/restoreUndoSnapshot/restoreSnapshotHTML.js.map +1 -0
- package/lib/coreApi/restoreUndoSnapshot/restoreSnapshotLogicalRoot.d.ts +5 -0
- package/lib/coreApi/restoreUndoSnapshot/restoreSnapshotLogicalRoot.js +21 -0
- package/lib/coreApi/restoreUndoSnapshot/restoreSnapshotLogicalRoot.js.map +1 -0
- package/lib/coreApi/restoreUndoSnapshot/restoreSnapshotSelection.js +59 -0
- package/lib/coreApi/restoreUndoSnapshot/restoreSnapshotSelection.js.map +1 -0
- package/lib/coreApi/restoreUndoSnapshot/restoreUndoSnapshot.js +38 -0
- package/lib/coreApi/restoreUndoSnapshot/restoreUndoSnapshot.js.map +1 -0
- package/lib/coreApi/setContentModel/setContentModel.js +36 -0
- package/lib/coreApi/setContentModel/setContentModel.js.map +1 -0
- package/lib/coreApi/setDOMSelection/addRangeToSelection.js.map +1 -0
- package/lib/coreApi/setDOMSelection/findLastedCoInMergedCell.d.ts +9 -0
- package/lib/coreApi/setDOMSelection/findLastedCoInMergedCell.js +33 -0
- package/lib/coreApi/setDOMSelection/findLastedCoInMergedCell.js.map +1 -0
- package/lib/coreApi/setDOMSelection/findTableCellElement.d.ts +16 -0
- package/lib/coreApi/setDOMSelection/findTableCellElement.js +36 -0
- package/lib/coreApi/setDOMSelection/findTableCellElement.js.map +1 -0
- package/lib/coreApi/setDOMSelection/setDOMSelection.js +151 -0
- package/lib/coreApi/setDOMSelection/setDOMSelection.js.map +1 -0
- package/lib/coreApi/setEditorStyle/ensureUniqueId.d.ts +4 -0
- package/lib/coreApi/setEditorStyle/ensureUniqueId.js +17 -0
- package/lib/coreApi/setEditorStyle/ensureUniqueId.js.map +1 -0
- package/lib/coreApi/setEditorStyle/setEditorStyle.d.ts +5 -0
- package/lib/coreApi/setEditorStyle/setEditorStyle.js +57 -0
- package/lib/coreApi/setEditorStyle/setEditorStyle.js.map +1 -0
- package/lib/coreApi/setLogicalRoot/setLogicalRoot.d.ts +8 -0
- package/lib/coreApi/setLogicalRoot/setLogicalRoot.js +41 -0
- package/lib/coreApi/setLogicalRoot/setLogicalRoot.js.map +1 -0
- package/lib/coreApi/switchShadowEdit/switchShadowEdit.js +45 -0
- package/lib/coreApi/switchShadowEdit/switchShadowEdit.js.map +1 -0
- package/lib/coreApi/triggerEvent/triggerEvent.js.map +1 -0
- package/lib/corePlugin/cache/CachePlugin.js +158 -0
- package/lib/corePlugin/cache/CachePlugin.js.map +1 -0
- package/lib/corePlugin/cache/areSameSelection.d.ts +6 -0
- package/lib/corePlugin/cache/areSameSelection.js +32 -0
- package/lib/corePlugin/cache/areSameSelection.js.map +1 -0
- package/lib/corePlugin/cache/domIndexerImpl.js +193 -0
- package/lib/corePlugin/cache/domIndexerImpl.js.map +1 -0
- package/lib/corePlugin/cache/textMutationObserver.js.map +1 -0
- package/lib/corePlugin/cache/updateCachedSelection.d.ts +5 -0
- package/lib/corePlugin/cache/updateCachedSelection.js +28 -0
- package/lib/corePlugin/cache/updateCachedSelection.js.map +1 -0
- package/lib/corePlugin/contextMenu/ContextMenuPlugin.js +112 -0
- package/lib/corePlugin/contextMenu/ContextMenuPlugin.js.map +1 -0
- package/lib/corePlugin/copyPaste/CopyPastePlugin.js +269 -0
- package/lib/corePlugin/copyPaste/CopyPastePlugin.js.map +1 -0
- package/lib/corePlugin/copyPaste/deleteEmptyList.js +42 -0
- package/lib/corePlugin/copyPaste/deleteEmptyList.js.map +1 -0
- package/lib/corePlugin/createEditorCorePlugins.js +9 -9
- package/lib/corePlugin/createEditorCorePlugins.js.map +1 -1
- package/lib/corePlugin/domEvent/DOMEventPlugin.js +199 -0
- package/lib/corePlugin/domEvent/DOMEventPlugin.js.map +1 -0
- package/lib/corePlugin/entity/EntityPlugin.js +216 -0
- package/lib/corePlugin/entity/EntityPlugin.js.map +1 -0
- package/lib/corePlugin/entity/entityDelimiterUtils.js +279 -0
- package/lib/corePlugin/entity/entityDelimiterUtils.js.map +1 -0
- package/lib/corePlugin/entity/findAllEntities.js.map +1 -0
- package/lib/corePlugin/format/FormatPlugin.js +188 -0
- package/lib/corePlugin/format/FormatPlugin.js.map +1 -0
- package/lib/corePlugin/format/applyDefaultFormat.js +53 -0
- package/lib/corePlugin/format/applyDefaultFormat.js.map +1 -0
- package/lib/corePlugin/format/applyPendingFormat.js +50 -0
- package/lib/corePlugin/format/applyPendingFormat.js.map +1 -0
- package/lib/corePlugin/lifecycle/LifecyclePlugin.js +121 -0
- package/lib/corePlugin/lifecycle/LifecyclePlugin.js.map +1 -0
- package/lib/corePlugin/selection/SelectionPlugin.js +420 -0
- package/lib/corePlugin/selection/SelectionPlugin.js.map +1 -0
- package/lib/corePlugin/selection/findCoordinate.d.ts +6 -0
- package/lib/corePlugin/selection/findCoordinate.js +29 -0
- package/lib/corePlugin/selection/findCoordinate.js.map +1 -0
- package/lib/corePlugin/selection/normalizePos.d.ts +5 -0
- package/lib/corePlugin/selection/normalizePos.js +29 -0
- package/lib/corePlugin/selection/normalizePos.js.map +1 -0
- package/lib/corePlugin/undo/SnapshotsManagerImpl.js.map +1 -0
- package/lib/corePlugin/undo/UndoPlugin.js +218 -0
- package/lib/corePlugin/undo/UndoPlugin.js.map +1 -0
- package/lib/editor/Editor.d.ts +16 -5
- package/lib/editor/Editor.js +36 -22
- package/lib/editor/Editor.js.map +1 -1
- package/lib/editor/core/DOMHelperImpl.js.map +1 -0
- package/lib/editor/core/DarkColorHandlerImpl.js.map +1 -0
- package/lib/editor/core/createEditorCore.js +86 -0
- package/lib/editor/core/createEditorCore.js.map +1 -0
- package/lib/editor/core/createEditorDefaultSettings.js +48 -0
- package/lib/editor/core/createEditorDefaultSettings.js.map +1 -0
- package/lib/index.d.ts +5 -42
- package/lib/index.js +10 -95
- package/lib/index.js.map +1 -1
- package/lib/override/listMetadataApplier.d.ts +9 -0
- package/lib/override/listMetadataApplier.js +140 -0
- package/lib/override/listMetadataApplier.js.map +1 -0
- package/lib/override/pasteEntityProcessor.js +1 -1
- package/lib/override/pasteEntityProcessor.js.map +1 -1
- package/lib/override/pasteGeneralProcessor.js +1 -1
- package/lib/override/pasteGeneralProcessor.js.map +1 -1
- package/lib/override/tablePreProcessor.js +1 -2
- package/lib/override/tablePreProcessor.js.map +1 -1
- package/lib-amd/command/createModelFromHtml/convertInlineCss.js +75 -0
- package/lib-amd/command/createModelFromHtml/convertInlineCss.js.map +1 -0
- package/lib-amd/command/createModelFromHtml/createDomToModelContextForSanitizing.d.ts +5 -0
- package/lib-amd/command/createModelFromHtml/createDomToModelContextForSanitizing.js +36 -0
- package/lib-amd/command/createModelFromHtml/createDomToModelContextForSanitizing.js.map +1 -0
- package/lib-amd/command/createModelFromHtml/createModelFromHtml.d.ts +9 -0
- package/lib-amd/command/createModelFromHtml/createModelFromHtml.js +30 -0
- package/lib-amd/command/createModelFromHtml/createModelFromHtml.js.map +1 -0
- package/lib-amd/command/createModelFromHtml/sanitizeElement.js.map +1 -0
- package/lib-amd/command/exportContent/exportContent.js.map +1 -0
- package/lib-amd/command/paste/createPasteFragment.js.map +1 -0
- package/lib-amd/command/paste/generatePasteOptionFromPlugins.js.map +1 -0
- package/lib-amd/command/paste/mergePasteContent.d.ts +9 -0
- package/lib-amd/command/paste/mergePasteContent.js +75 -0
- package/lib-amd/command/paste/mergePasteContent.js.map +1 -0
- package/lib-amd/command/paste/paste.js +39 -0
- package/lib-amd/command/paste/paste.js.map +1 -0
- package/lib-amd/command/paste/retrieveHtmlInfo.d.ts +15 -0
- package/lib-amd/command/paste/retrieveHtmlInfo.js +68 -0
- package/lib-amd/command/paste/retrieveHtmlInfo.js.map +1 -0
- package/lib-amd/command/redo/redo.js.map +1 -0
- package/lib-amd/command/undo/undo.js.map +1 -0
- package/lib-amd/coreApi/addUndoSnapshot/addUndoSnapshot.js +68 -0
- package/lib-amd/coreApi/addUndoSnapshot/addUndoSnapshot.js.map +1 -0
- package/lib-amd/coreApi/addUndoSnapshot/createSnapshotSelection.d.ts +5 -0
- package/lib-amd/coreApi/addUndoSnapshot/createSnapshotSelection.js +117 -0
- package/lib-amd/coreApi/addUndoSnapshot/createSnapshotSelection.js.map +1 -0
- package/lib-amd/coreApi/addUndoSnapshot/getPath.d.ts +15 -0
- package/lib-amd/coreApi/addUndoSnapshot/getPath.js +61 -0
- package/lib-amd/coreApi/addUndoSnapshot/getPath.js.map +1 -0
- package/lib-amd/coreApi/attachDomEvent/attachDomEvent.js.map +1 -0
- package/lib-amd/coreApi/coreApiMap.js +27 -0
- package/lib-amd/coreApi/coreApiMap.js.map +1 -0
- package/lib-amd/coreApi/createContentModel/createContentModel.js +47 -0
- package/lib-amd/coreApi/createContentModel/createContentModel.js.map +1 -0
- package/lib-amd/coreApi/createEditorContext/createEditorContext.js +26 -0
- package/lib-amd/coreApi/createEditorContext/createEditorContext.js.map +1 -0
- package/lib-amd/coreApi/createEditorContext/getRootComputedStyleForContext.js.map +1 -0
- package/lib-amd/coreApi/focus/focus.js.map +1 -0
- package/lib-amd/coreApi/formatContentModel/formatContentModel.js +122 -0
- package/lib-amd/coreApi/formatContentModel/formatContentModel.js.map +1 -0
- package/lib-amd/coreApi/getDOMSelection/getDOMSelection.js +34 -0
- package/lib-amd/coreApi/getDOMSelection/getDOMSelection.js.map +1 -0
- package/lib-amd/coreApi/getVisibleViewport/getVisibleViewport.js.map +1 -0
- package/lib-amd/coreApi/restoreUndoSnapshot/getPositionFromPath.d.ts +7 -0
- package/lib-amd/coreApi/restoreUndoSnapshot/getPositionFromPath.js +30 -0
- package/lib-amd/coreApi/restoreUndoSnapshot/getPositionFromPath.js.map +1 -0
- package/lib-amd/coreApi/restoreUndoSnapshot/restoreSnapshotColors.js +17 -0
- package/lib-amd/coreApi/restoreUndoSnapshot/restoreSnapshotColors.js.map +1 -0
- package/lib-amd/coreApi/restoreUndoSnapshot/restoreSnapshotHTML.js.map +1 -0
- package/lib-amd/coreApi/restoreUndoSnapshot/restoreSnapshotLogicalRoot.d.ts +5 -0
- package/lib-amd/coreApi/restoreUndoSnapshot/restoreSnapshotLogicalRoot.js +22 -0
- package/lib-amd/coreApi/restoreUndoSnapshot/restoreSnapshotLogicalRoot.js.map +1 -0
- package/lib-amd/coreApi/restoreUndoSnapshot/restoreSnapshotSelection.js +60 -0
- package/lib-amd/coreApi/restoreUndoSnapshot/restoreSnapshotSelection.js.map +1 -0
- package/lib-amd/coreApi/restoreUndoSnapshot/restoreUndoSnapshot.js +35 -0
- package/lib-amd/coreApi/restoreUndoSnapshot/restoreUndoSnapshot.js.map +1 -0
- package/lib-amd/coreApi/setContentModel/setContentModel.js +36 -0
- package/lib-amd/coreApi/setContentModel/setContentModel.js.map +1 -0
- package/lib-amd/coreApi/setDOMSelection/addRangeToSelection.js.map +1 -0
- package/lib-amd/coreApi/setDOMSelection/findLastedCoInMergedCell.d.ts +9 -0
- package/lib-amd/coreApi/setDOMSelection/findLastedCoInMergedCell.js +35 -0
- package/lib-amd/coreApi/setDOMSelection/findLastedCoInMergedCell.js.map +1 -0
- package/lib-amd/coreApi/setDOMSelection/findTableCellElement.d.ts +16 -0
- package/lib-amd/coreApi/setDOMSelection/findTableCellElement.js +38 -0
- package/lib-amd/coreApi/setDOMSelection/findTableCellElement.js.map +1 -0
- package/lib-amd/coreApi/setDOMSelection/setDOMSelection.js +148 -0
- package/lib-amd/coreApi/setDOMSelection/setDOMSelection.js.map +1 -0
- package/lib-amd/coreApi/setEditorStyle/ensureUniqueId.d.ts +4 -0
- package/lib-amd/coreApi/setEditorStyle/ensureUniqueId.js +19 -0
- package/lib-amd/coreApi/setEditorStyle/ensureUniqueId.js.map +1 -0
- package/lib-amd/coreApi/setEditorStyle/setEditorStyle.d.ts +5 -0
- package/lib-amd/coreApi/setEditorStyle/setEditorStyle.js +58 -0
- package/lib-amd/coreApi/setEditorStyle/setEditorStyle.js.map +1 -0
- package/lib-amd/coreApi/setLogicalRoot/setLogicalRoot.d.ts +8 -0
- package/lib-amd/coreApi/setLogicalRoot/setLogicalRoot.js +43 -0
- package/lib-amd/coreApi/setLogicalRoot/setLogicalRoot.js.map +1 -0
- package/lib-amd/coreApi/switchShadowEdit/switchShadowEdit.js +46 -0
- package/lib-amd/coreApi/switchShadowEdit/switchShadowEdit.js.map +1 -0
- package/lib-amd/coreApi/triggerEvent/triggerEvent.js.map +1 -0
- package/lib-amd/corePlugin/cache/CachePlugin.js +156 -0
- package/lib-amd/corePlugin/cache/CachePlugin.js.map +1 -0
- package/lib-amd/corePlugin/cache/areSameSelection.d.ts +6 -0
- package/lib-amd/corePlugin/cache/areSameSelection.js +34 -0
- package/lib-amd/corePlugin/cache/areSameSelection.js.map +1 -0
- package/lib-amd/corePlugin/cache/domIndexerImpl.js +193 -0
- package/lib-amd/corePlugin/cache/domIndexerImpl.js.map +1 -0
- package/lib-amd/corePlugin/cache/textMutationObserver.js.map +1 -0
- package/lib-amd/corePlugin/cache/updateCachedSelection.d.ts +5 -0
- package/lib-amd/corePlugin/cache/updateCachedSelection.js +30 -0
- package/lib-amd/corePlugin/cache/updateCachedSelection.js.map +1 -0
- package/lib-amd/corePlugin/contextMenu/ContextMenuPlugin.js +112 -0
- package/lib-amd/corePlugin/contextMenu/ContextMenuPlugin.js.map +1 -0
- package/lib-amd/corePlugin/copyPaste/CopyPastePlugin.js +265 -0
- package/lib-amd/corePlugin/copyPaste/CopyPastePlugin.js.map +1 -0
- package/lib-amd/corePlugin/copyPaste/deleteEmptyList.js +43 -0
- package/lib-amd/corePlugin/copyPaste/deleteEmptyList.js.map +1 -0
- package/lib-amd/corePlugin/createEditorCorePlugins.js +1 -1
- package/lib-amd/corePlugin/createEditorCorePlugins.js.map +1 -1
- package/lib-amd/corePlugin/domEvent/DOMEventPlugin.js +200 -0
- package/lib-amd/corePlugin/domEvent/DOMEventPlugin.js.map +1 -0
- package/lib-amd/corePlugin/entity/EntityPlugin.js +215 -0
- package/lib-amd/corePlugin/entity/EntityPlugin.js.map +1 -0
- package/lib-amd/corePlugin/entity/entityDelimiterUtils.js +278 -0
- package/lib-amd/corePlugin/entity/entityDelimiterUtils.js.map +1 -0
- package/lib-amd/corePlugin/entity/findAllEntities.js.map +1 -0
- package/lib-amd/corePlugin/format/FormatPlugin.js +186 -0
- package/lib-amd/corePlugin/format/FormatPlugin.js.map +1 -0
- package/lib-amd/corePlugin/format/applyDefaultFormat.js +53 -0
- package/lib-amd/corePlugin/format/applyDefaultFormat.js.map +1 -0
- package/lib-amd/corePlugin/format/applyPendingFormat.js +50 -0
- package/lib-amd/corePlugin/format/applyPendingFormat.js.map +1 -0
- package/lib-amd/corePlugin/lifecycle/LifecyclePlugin.js +122 -0
- package/lib-amd/corePlugin/lifecycle/LifecyclePlugin.js.map +1 -0
- package/lib-amd/corePlugin/selection/SelectionPlugin.js +418 -0
- package/lib-amd/corePlugin/selection/SelectionPlugin.js.map +1 -0
- package/lib-amd/corePlugin/selection/findCoordinate.d.ts +6 -0
- package/lib-amd/corePlugin/selection/findCoordinate.js +31 -0
- package/lib-amd/corePlugin/selection/findCoordinate.js.map +1 -0
- package/lib-amd/corePlugin/selection/normalizePos.d.ts +5 -0
- package/lib-amd/corePlugin/selection/normalizePos.js +30 -0
- package/lib-amd/corePlugin/selection/normalizePos.js.map +1 -0
- package/lib-amd/corePlugin/undo/SnapshotsManagerImpl.js.map +1 -0
- package/lib-amd/corePlugin/undo/UndoPlugin.js +217 -0
- package/lib-amd/corePlugin/undo/UndoPlugin.js.map +1 -0
- package/lib-amd/editor/Editor.d.ts +16 -5
- package/lib-amd/editor/Editor.js +36 -18
- package/lib-amd/editor/Editor.js.map +1 -1
- package/lib-amd/editor/core/DOMHelperImpl.js.map +1 -0
- package/lib-amd/editor/core/DarkColorHandlerImpl.js.map +1 -0
- package/lib-amd/editor/core/createEditorCore.js +82 -0
- package/lib-amd/editor/core/createEditorCore.js.map +1 -0
- package/lib-amd/editor/core/createEditorDefaultSettings.js +47 -0
- package/lib-amd/editor/core/createEditorDefaultSettings.js.map +1 -0
- package/lib-amd/index.d.ts +5 -42
- package/lib-amd/index.js +3 -52
- package/lib-amd/index.js.map +1 -1
- package/lib-amd/override/listMetadataApplier.d.ts +9 -0
- package/lib-amd/override/listMetadataApplier.js +140 -0
- package/lib-amd/override/listMetadataApplier.js.map +1 -0
- package/lib-amd/override/pasteEntityProcessor.js +1 -1
- package/lib-amd/override/pasteEntityProcessor.js.map +1 -1
- package/lib-amd/override/pasteGeneralProcessor.js +1 -1
- package/lib-amd/override/pasteGeneralProcessor.js.map +1 -1
- package/lib-amd/override/tablePreProcessor.js +2 -2
- package/lib-amd/override/tablePreProcessor.js.map +1 -1
- package/lib-mjs/command/createModelFromHtml/convertInlineCss.js +70 -0
- package/lib-mjs/command/createModelFromHtml/convertInlineCss.js.map +1 -0
- package/lib-mjs/command/createModelFromHtml/createDomToModelContextForSanitizing.d.ts +5 -0
- package/lib-mjs/command/createModelFromHtml/createDomToModelContextForSanitizing.js +39 -0
- package/lib-mjs/command/createModelFromHtml/createDomToModelContextForSanitizing.js.map +1 -0
- package/lib-mjs/command/createModelFromHtml/createModelFromHtml.d.ts +9 -0
- package/lib-mjs/command/createModelFromHtml/createModelFromHtml.js +27 -0
- package/lib-mjs/command/createModelFromHtml/createModelFromHtml.js.map +1 -0
- package/lib-mjs/command/createModelFromHtml/sanitizeElement.js.map +1 -0
- package/lib-mjs/command/exportContent/exportContent.js.map +1 -0
- package/lib-mjs/command/paste/createPasteFragment.js.map +1 -0
- package/lib-mjs/command/paste/generatePasteOptionFromPlugins.js.map +1 -0
- package/lib-mjs/command/paste/mergePasteContent.d.ts +9 -0
- package/lib-mjs/command/paste/mergePasteContent.js +71 -0
- package/lib-mjs/command/paste/mergePasteContent.js.map +1 -0
- package/lib-mjs/command/paste/paste.js +38 -0
- package/lib-mjs/command/paste/paste.js.map +1 -0
- package/lib-mjs/command/paste/retrieveHtmlInfo.d.ts +15 -0
- package/lib-mjs/command/paste/retrieveHtmlInfo.js +65 -0
- package/lib-mjs/command/paste/retrieveHtmlInfo.js.map +1 -0
- package/lib-mjs/command/redo/redo.js.map +1 -0
- package/lib-mjs/command/undo/undo.js.map +1 -0
- package/lib-mjs/coreApi/addUndoSnapshot/addUndoSnapshot.js +65 -0
- package/lib-mjs/coreApi/addUndoSnapshot/addUndoSnapshot.js.map +1 -0
- package/lib-mjs/coreApi/addUndoSnapshot/createSnapshotSelection.d.ts +5 -0
- package/lib-mjs/coreApi/addUndoSnapshot/createSnapshotSelection.js +113 -0
- package/lib-mjs/coreApi/addUndoSnapshot/createSnapshotSelection.js.map +1 -0
- package/lib-mjs/coreApi/addUndoSnapshot/getPath.d.ts +15 -0
- package/lib-mjs/coreApi/addUndoSnapshot/getPath.js +56 -0
- package/lib-mjs/coreApi/addUndoSnapshot/getPath.js.map +1 -0
- package/lib-mjs/coreApi/attachDomEvent/attachDomEvent.js.map +1 -0
- package/lib-mjs/coreApi/coreApiMap.js +37 -0
- package/lib-mjs/coreApi/coreApiMap.js.map +1 -0
- package/lib-mjs/coreApi/createContentModel/createContentModel.js +43 -0
- package/lib-mjs/coreApi/createContentModel/createContentModel.js.map +1 -0
- package/lib-mjs/coreApi/createEditorContext/createEditorContext.js +22 -0
- package/lib-mjs/coreApi/createEditorContext/createEditorContext.js.map +1 -0
- package/lib-mjs/coreApi/createEditorContext/getRootComputedStyleForContext.js.map +1 -0
- package/lib-mjs/coreApi/focus/focus.js.map +1 -0
- package/lib-mjs/coreApi/formatContentModel/formatContentModel.js +118 -0
- package/lib-mjs/coreApi/formatContentModel/formatContentModel.js.map +1 -0
- package/lib-mjs/coreApi/getDOMSelection/getDOMSelection.js +28 -0
- package/lib-mjs/coreApi/getDOMSelection/getDOMSelection.js.map +1 -0
- package/lib-mjs/coreApi/getVisibleViewport/getVisibleViewport.js.map +1 -0
- package/lib-mjs/coreApi/restoreUndoSnapshot/getPositionFromPath.d.ts +7 -0
- package/lib-mjs/coreApi/restoreUndoSnapshot/getPositionFromPath.js +25 -0
- package/lib-mjs/coreApi/restoreUndoSnapshot/getPositionFromPath.js.map +1 -0
- package/lib-mjs/coreApi/restoreUndoSnapshot/restoreSnapshotColors.js +12 -0
- package/lib-mjs/coreApi/restoreUndoSnapshot/restoreSnapshotColors.js.map +1 -0
- package/lib-mjs/coreApi/restoreUndoSnapshot/restoreSnapshotHTML.js.map +1 -0
- package/lib-mjs/coreApi/restoreUndoSnapshot/restoreSnapshotLogicalRoot.d.ts +5 -0
- package/lib-mjs/coreApi/restoreUndoSnapshot/restoreSnapshotLogicalRoot.js +17 -0
- package/lib-mjs/coreApi/restoreUndoSnapshot/restoreSnapshotLogicalRoot.js.map +1 -0
- package/lib-mjs/coreApi/restoreUndoSnapshot/restoreSnapshotSelection.js +55 -0
- package/lib-mjs/coreApi/restoreUndoSnapshot/restoreSnapshotSelection.js.map +1 -0
- package/lib-mjs/coreApi/restoreUndoSnapshot/restoreUndoSnapshot.js +34 -0
- package/lib-mjs/coreApi/restoreUndoSnapshot/restoreUndoSnapshot.js.map +1 -0
- package/lib-mjs/coreApi/setContentModel/setContentModel.js +32 -0
- package/lib-mjs/coreApi/setContentModel/setContentModel.js.map +1 -0
- package/lib-mjs/coreApi/setDOMSelection/addRangeToSelection.js.map +1 -0
- package/lib-mjs/coreApi/setDOMSelection/findLastedCoInMergedCell.d.ts +9 -0
- package/lib-mjs/coreApi/setDOMSelection/findLastedCoInMergedCell.js +29 -0
- package/lib-mjs/coreApi/setDOMSelection/findLastedCoInMergedCell.js.map +1 -0
- package/lib-mjs/coreApi/setDOMSelection/findTableCellElement.d.ts +16 -0
- package/lib-mjs/coreApi/setDOMSelection/findTableCellElement.js +32 -0
- package/lib-mjs/coreApi/setDOMSelection/findTableCellElement.js.map +1 -0
- package/lib-mjs/coreApi/setDOMSelection/setDOMSelection.js +147 -0
- package/lib-mjs/coreApi/setDOMSelection/setDOMSelection.js.map +1 -0
- package/lib-mjs/coreApi/setEditorStyle/ensureUniqueId.d.ts +4 -0
- package/lib-mjs/coreApi/setEditorStyle/ensureUniqueId.js +13 -0
- package/lib-mjs/coreApi/setEditorStyle/ensureUniqueId.js.map +1 -0
- package/lib-mjs/coreApi/setEditorStyle/setEditorStyle.d.ts +5 -0
- package/lib-mjs/coreApi/setEditorStyle/setEditorStyle.js +53 -0
- package/lib-mjs/coreApi/setEditorStyle/setEditorStyle.js.map +1 -0
- package/lib-mjs/coreApi/setLogicalRoot/setLogicalRoot.d.ts +8 -0
- package/lib-mjs/coreApi/setLogicalRoot/setLogicalRoot.js +37 -0
- package/lib-mjs/coreApi/setLogicalRoot/setLogicalRoot.js.map +1 -0
- package/lib-mjs/coreApi/switchShadowEdit/switchShadowEdit.js +41 -0
- package/lib-mjs/coreApi/switchShadowEdit/switchShadowEdit.js.map +1 -0
- package/lib-mjs/coreApi/triggerEvent/triggerEvent.js.map +1 -0
- package/lib-mjs/corePlugin/cache/CachePlugin.js +154 -0
- package/lib-mjs/corePlugin/cache/CachePlugin.js.map +1 -0
- package/lib-mjs/corePlugin/cache/areSameSelection.d.ts +6 -0
- package/lib-mjs/corePlugin/cache/areSameSelection.js +28 -0
- package/lib-mjs/corePlugin/cache/areSameSelection.js.map +1 -0
- package/lib-mjs/corePlugin/cache/domIndexerImpl.js +190 -0
- package/lib-mjs/corePlugin/cache/domIndexerImpl.js.map +1 -0
- package/lib-mjs/corePlugin/cache/textMutationObserver.js.map +1 -0
- package/lib-mjs/corePlugin/cache/updateCachedSelection.d.ts +5 -0
- package/lib-mjs/corePlugin/cache/updateCachedSelection.js +24 -0
- package/lib-mjs/corePlugin/cache/updateCachedSelection.js.map +1 -0
- package/lib-mjs/corePlugin/contextMenu/ContextMenuPlugin.js +108 -0
- package/lib-mjs/corePlugin/contextMenu/ContextMenuPlugin.js.map +1 -0
- package/lib-mjs/corePlugin/copyPaste/CopyPastePlugin.js +262 -0
- package/lib-mjs/corePlugin/copyPaste/CopyPastePlugin.js.map +1 -0
- package/lib-mjs/corePlugin/copyPaste/deleteEmptyList.js +38 -0
- package/lib-mjs/corePlugin/copyPaste/deleteEmptyList.js.map +1 -0
- package/lib-mjs/corePlugin/createEditorCorePlugins.js +9 -9
- package/lib-mjs/corePlugin/createEditorCorePlugins.js.map +1 -1
- package/lib-mjs/corePlugin/domEvent/DOMEventPlugin.js +195 -0
- package/lib-mjs/corePlugin/domEvent/DOMEventPlugin.js.map +1 -0
- package/lib-mjs/corePlugin/entity/EntityPlugin.js +212 -0
- package/lib-mjs/corePlugin/entity/EntityPlugin.js.map +1 -0
- package/lib-mjs/corePlugin/entity/entityDelimiterUtils.js +270 -0
- package/lib-mjs/corePlugin/entity/entityDelimiterUtils.js.map +1 -0
- package/lib-mjs/corePlugin/entity/findAllEntities.js.map +1 -0
- package/lib-mjs/corePlugin/format/FormatPlugin.js +184 -0
- package/lib-mjs/corePlugin/format/FormatPlugin.js.map +1 -0
- package/lib-mjs/corePlugin/format/applyDefaultFormat.js +49 -0
- package/lib-mjs/corePlugin/format/applyDefaultFormat.js.map +1 -0
- package/lib-mjs/corePlugin/format/applyPendingFormat.js +46 -0
- package/lib-mjs/corePlugin/format/applyPendingFormat.js.map +1 -0
- package/lib-mjs/corePlugin/lifecycle/LifecyclePlugin.js +117 -0
- package/lib-mjs/corePlugin/lifecycle/LifecyclePlugin.js.map +1 -0
- package/lib-mjs/corePlugin/selection/SelectionPlugin.js +416 -0
- package/lib-mjs/corePlugin/selection/SelectionPlugin.js.map +1 -0
- package/lib-mjs/corePlugin/selection/findCoordinate.d.ts +6 -0
- package/lib-mjs/corePlugin/selection/findCoordinate.js +25 -0
- package/lib-mjs/corePlugin/selection/findCoordinate.js.map +1 -0
- package/lib-mjs/corePlugin/selection/normalizePos.d.ts +5 -0
- package/lib-mjs/corePlugin/selection/normalizePos.js +25 -0
- package/lib-mjs/corePlugin/selection/normalizePos.js.map +1 -0
- package/lib-mjs/corePlugin/undo/SnapshotsManagerImpl.js.map +1 -0
- package/lib-mjs/corePlugin/undo/UndoPlugin.js +214 -0
- package/lib-mjs/corePlugin/undo/UndoPlugin.js.map +1 -0
- package/lib-mjs/editor/Editor.d.ts +16 -5
- package/lib-mjs/editor/Editor.js +33 -19
- package/lib-mjs/editor/Editor.js.map +1 -1
- package/lib-mjs/editor/core/DOMHelperImpl.js.map +1 -0
- package/lib-mjs/editor/core/DarkColorHandlerImpl.js.map +1 -0
- package/lib-mjs/editor/core/createEditorCore.js +80 -0
- package/lib-mjs/editor/core/createEditorCore.js.map +1 -0
- package/lib-mjs/editor/core/createEditorDefaultSettings.js +43 -0
- package/lib-mjs/editor/core/createEditorDefaultSettings.js.map +1 -0
- package/lib-mjs/index.d.ts +5 -42
- package/lib-mjs/index.js +7 -42
- package/lib-mjs/index.js.map +1 -1
- package/lib-mjs/override/listMetadataApplier.d.ts +9 -0
- package/lib-mjs/override/listMetadataApplier.js +137 -0
- package/lib-mjs/override/listMetadataApplier.js.map +1 -0
- package/lib-mjs/override/pasteEntityProcessor.js +1 -1
- package/lib-mjs/override/pasteEntityProcessor.js.map +1 -1
- package/lib-mjs/override/pasteGeneralProcessor.js +1 -1
- package/lib-mjs/override/pasteGeneralProcessor.js.map +1 -1
- package/lib-mjs/override/tablePreProcessor.js +1 -2
- package/lib-mjs/override/tablePreProcessor.js.map +1 -1
- package/package.json +4 -4
- package/lib/constants/BulletListType.d.ts +0 -49
- package/lib/constants/BulletListType.js +0 -53
- package/lib/constants/BulletListType.js.map +0 -1
- package/lib/constants/ChangeSource.d.ts +0 -59
- package/lib/constants/ChangeSource.js +0 -63
- package/lib/constants/ChangeSource.js.map +0 -1
- package/lib/constants/NumberingListType.d.ts +0 -93
- package/lib/constants/NumberingListType.js +0 -97
- package/lib/constants/NumberingListType.js.map +0 -1
- package/lib/constants/TableBorderFormat.d.ts +0 -81
- package/lib/constants/TableBorderFormat.js +0 -85
- package/lib/constants/TableBorderFormat.js.map +0 -1
- package/lib/coreApi/addUndoSnapshot.js +0 -33
- package/lib/coreApi/addUndoSnapshot.js.map +0 -1
- package/lib/coreApi/attachDomEvent.js.map +0 -1
- package/lib/coreApi/createContentModel.js +0 -44
- package/lib/coreApi/createContentModel.js.map +0 -1
- package/lib/coreApi/createEditorContext.js +0 -25
- package/lib/coreApi/createEditorContext.js.map +0 -1
- package/lib/coreApi/focus.js.map +0 -1
- package/lib/coreApi/formatContentModel.js +0 -118
- package/lib/coreApi/formatContentModel.js.map +0 -1
- package/lib/coreApi/getDOMSelection.js +0 -40
- package/lib/coreApi/getDOMSelection.js.map +0 -1
- package/lib/coreApi/getVisibleViewport.js.map +0 -1
- package/lib/coreApi/restoreUndoSnapshot.js +0 -36
- package/lib/coreApi/restoreUndoSnapshot.js.map +0 -1
- package/lib/coreApi/setContentModel.js +0 -35
- package/lib/coreApi/setContentModel.js.map +0 -1
- package/lib/coreApi/setDOMSelection.js +0 -163
- package/lib/coreApi/setDOMSelection.js.map +0 -1
- package/lib/coreApi/switchShadowEdit.js +0 -46
- package/lib/coreApi/switchShadowEdit.js.map +0 -1
- package/lib/coreApi/triggerEvent.js.map +0 -1
- package/lib/corePlugin/CachePlugin.js +0 -157
- package/lib/corePlugin/CachePlugin.js.map +0 -1
- package/lib/corePlugin/ContextMenuPlugin.js +0 -112
- package/lib/corePlugin/ContextMenuPlugin.js.map +0 -1
- package/lib/corePlugin/CopyPastePlugin.js +0 -274
- package/lib/corePlugin/CopyPastePlugin.js.map +0 -1
- package/lib/corePlugin/DOMEventPlugin.js +0 -201
- package/lib/corePlugin/DOMEventPlugin.js.map +0 -1
- package/lib/corePlugin/EntityPlugin.js +0 -217
- package/lib/corePlugin/EntityPlugin.js.map +0 -1
- package/lib/corePlugin/FormatPlugin.js +0 -189
- package/lib/corePlugin/FormatPlugin.js.map +0 -1
- package/lib/corePlugin/LifecyclePlugin.js +0 -114
- package/lib/corePlugin/LifecyclePlugin.js.map +0 -1
- package/lib/corePlugin/SelectionPlugin.js +0 -189
- package/lib/corePlugin/SelectionPlugin.js.map +0 -1
- package/lib/corePlugin/UndoPlugin.js +0 -221
- package/lib/corePlugin/UndoPlugin.js.map +0 -1
- package/lib/corePlugin/utils/addRangeToSelection.js.map +0 -1
- package/lib/corePlugin/utils/applyDefaultFormat.js +0 -54
- package/lib/corePlugin/utils/applyDefaultFormat.js.map +0 -1
- package/lib/corePlugin/utils/applyPendingFormat.js +0 -51
- package/lib/corePlugin/utils/applyPendingFormat.js.map +0 -1
- package/lib/corePlugin/utils/areSameSelection.d.ts +0 -6
- package/lib/corePlugin/utils/areSameSelection.js +0 -36
- package/lib/corePlugin/utils/areSameSelection.js.map +0 -1
- package/lib/corePlugin/utils/deleteEmptyList.js +0 -44
- package/lib/corePlugin/utils/deleteEmptyList.js.map +0 -1
- package/lib/corePlugin/utils/domIndexerImpl.js +0 -190
- package/lib/corePlugin/utils/domIndexerImpl.js.map +0 -1
- package/lib/corePlugin/utils/entityDelimiterUtils.js +0 -259
- package/lib/corePlugin/utils/entityDelimiterUtils.js.map +0 -1
- package/lib/corePlugin/utils/findAllEntities.js.map +0 -1
- package/lib/corePlugin/utils/textMutationObserver.js.map +0 -1
- package/lib/editor/DOMHelperImpl.js.map +0 -1
- package/lib/editor/DarkColorHandlerImpl.js.map +0 -1
- package/lib/editor/SnapshotsManagerImpl.js.map +0 -1
- package/lib/editor/coreApiMap.js +0 -36
- package/lib/editor/coreApiMap.js.map +0 -1
- package/lib/editor/createEditorCore.js +0 -86
- package/lib/editor/createEditorCore.js.map +0 -1
- package/lib/editor/createEditorDefaultSettings.js +0 -48
- package/lib/editor/createEditorDefaultSettings.js.map +0 -1
- package/lib/metadata/definitionCreators.d.ts +0 -48
- package/lib/metadata/definitionCreators.js +0 -95
- package/lib/metadata/definitionCreators.js.map +0 -1
- package/lib/metadata/updateImageMetadata.d.ts +0 -7
- package/lib/metadata/updateImageMetadata.js +0 -28
- package/lib/metadata/updateImageMetadata.js.map +0 -1
- package/lib/metadata/updateListMetadata.d.ts +0 -22
- package/lib/metadata/updateListMetadata.js +0 -207
- package/lib/metadata/updateListMetadata.js.map +0 -1
- package/lib/metadata/updateTableCellMetadata.d.ts +0 -7
- package/lib/metadata/updateTableCellMetadata.js +0 -20
- package/lib/metadata/updateTableCellMetadata.js.map +0 -1
- package/lib/metadata/updateTableMetadata.d.ts +0 -7
- package/lib/metadata/updateTableMetadata.js +0 -32
- package/lib/metadata/updateTableMetadata.js.map +0 -1
- package/lib/modelApi/edit/deleteExpandedSelection.d.ts +0 -7
- package/lib/modelApi/edit/deleteExpandedSelection.js +0 -100
- package/lib/modelApi/edit/deleteExpandedSelection.js.map +0 -1
- package/lib/modelApi/edit/deleteSingleChar.d.ts +0 -4
- package/lib/modelApi/edit/deleteSingleChar.js +0 -36
- package/lib/modelApi/edit/deleteSingleChar.js.map +0 -1
- package/lib/override/reducedModelChildProcessor.d.ts +0 -21
- package/lib/override/reducedModelChildProcessor.js +0 -66
- package/lib/override/reducedModelChildProcessor.js.map +0 -1
- package/lib/publicApi/color/transformColor.d.ts +0 -9
- package/lib/publicApi/color/transformColor.js +0 -41
- package/lib/publicApi/color/transformColor.js.map +0 -1
- package/lib/publicApi/domUtils/borderValues.d.ts +0 -13
- package/lib/publicApi/domUtils/borderValues.js +0 -48
- package/lib/publicApi/domUtils/borderValues.js.map +0 -1
- package/lib/publicApi/domUtils/cacheGetEventData.d.ts +0 -9
- package/lib/publicApi/domUtils/cacheGetEventData.js +0 -20
- package/lib/publicApi/domUtils/cacheGetEventData.js.map +0 -1
- package/lib/publicApi/domUtils/eventUtils.d.ts +0 -20
- package/lib/publicApi/domUtils/eventUtils.js +0 -49
- package/lib/publicApi/domUtils/eventUtils.js.map +0 -1
- package/lib/publicApi/domUtils/getSegmentTextFormat.d.ts +0 -7
- package/lib/publicApi/domUtils/getSegmentTextFormat.js +0 -33
- package/lib/publicApi/domUtils/getSegmentTextFormat.js.map +0 -1
- package/lib/publicApi/domUtils/readFile.d.ts +0 -7
- package/lib/publicApi/domUtils/readFile.js +0 -23
- package/lib/publicApi/domUtils/readFile.js.map +0 -1
- package/lib/publicApi/domUtils/stringUtil.d.ts +0 -18
- package/lib/publicApi/domUtils/stringUtil.js +0 -35
- package/lib/publicApi/domUtils/stringUtil.js.map +0 -1
- package/lib/publicApi/domUtils/tableCellUtils.d.ts +0 -13
- package/lib/publicApi/domUtils/tableCellUtils.js +0 -57
- package/lib/publicApi/domUtils/tableCellUtils.js.map +0 -1
- package/lib/publicApi/format/retrieveModelFormatState.d.ts +0 -8
- package/lib/publicApi/format/retrieveModelFormatState.js +0 -178
- package/lib/publicApi/format/retrieveModelFormatState.js.map +0 -1
- package/lib/publicApi/model/cloneModel.d.ts +0 -7
- package/lib/publicApi/model/cloneModel.js +0 -207
- package/lib/publicApi/model/cloneModel.js.map +0 -1
- package/lib/publicApi/model/createModelFromHtml.d.ts +0 -9
- package/lib/publicApi/model/createModelFromHtml.js +0 -31
- package/lib/publicApi/model/createModelFromHtml.js.map +0 -1
- package/lib/publicApi/model/exportContent.js.map +0 -1
- package/lib/publicApi/model/getClosestAncestorBlockGroupIndex.d.ts +0 -12
- package/lib/publicApi/model/getClosestAncestorBlockGroupIndex.js +0 -28
- package/lib/publicApi/model/getClosestAncestorBlockGroupIndex.js.map +0 -1
- package/lib/publicApi/model/isBlockGroupOfType.d.ts +0 -8
- package/lib/publicApi/model/isBlockGroupOfType.js +0 -14
- package/lib/publicApi/model/isBlockGroupOfType.js.map +0 -1
- package/lib/publicApi/model/isBold.d.ts +0 -5
- package/lib/publicApi/model/isBold.js +0 -12
- package/lib/publicApi/model/isBold.js.map +0 -1
- package/lib/publicApi/model/mergeModel.d.ts +0 -36
- package/lib/publicApi/model/mergeModel.js +0 -271
- package/lib/publicApi/model/mergeModel.js.map +0 -1
- package/lib/publicApi/paste/paste.js +0 -42
- package/lib/publicApi/paste/paste.js.map +0 -1
- package/lib/publicApi/selection/collectSelections.d.ts +0 -54
- package/lib/publicApi/selection/collectSelections.js +0 -184
- package/lib/publicApi/selection/collectSelections.js.map +0 -1
- package/lib/publicApi/selection/deleteBlock.d.ts +0 -11
- package/lib/publicApi/selection/deleteBlock.js +0 -56
- package/lib/publicApi/selection/deleteBlock.js.map +0 -1
- package/lib/publicApi/selection/deleteSegment.d.ts +0 -10
- package/lib/publicApi/selection/deleteSegment.js +0 -86
- package/lib/publicApi/selection/deleteSegment.js.map +0 -1
- package/lib/publicApi/selection/deleteSelection.d.ts +0 -9
- package/lib/publicApi/selection/deleteSelection.js +0 -42
- package/lib/publicApi/selection/deleteSelection.js.map +0 -1
- package/lib/publicApi/selection/getSelectionRootNode.d.ts +0 -9
- package/lib/publicApi/selection/getSelectionRootNode.js +0 -23
- package/lib/publicApi/selection/getSelectionRootNode.js.map +0 -1
- package/lib/publicApi/selection/hasSelectionInBlock.d.ts +0 -6
- package/lib/publicApi/selection/hasSelectionInBlock.js +0 -26
- package/lib/publicApi/selection/hasSelectionInBlock.js.map +0 -1
- package/lib/publicApi/selection/hasSelectionInBlockGroup.d.ts +0 -6
- package/lib/publicApi/selection/hasSelectionInBlockGroup.js +0 -19
- package/lib/publicApi/selection/hasSelectionInBlockGroup.js.map +0 -1
- package/lib/publicApi/selection/hasSelectionInSegment.d.ts +0 -6
- package/lib/publicApi/selection/hasSelectionInSegment.js +0 -14
- package/lib/publicApi/selection/hasSelectionInSegment.js.map +0 -1
- package/lib/publicApi/selection/iterateSelections.d.ts +0 -48
- package/lib/publicApi/selection/iterateSelections.js +0 -145
- package/lib/publicApi/selection/iterateSelections.js.map +0 -1
- package/lib/publicApi/selection/setSelection.d.ts +0 -8
- package/lib/publicApi/selection/setSelection.js +0 -131
- package/lib/publicApi/selection/setSelection.js.map +0 -1
- package/lib/publicApi/table/applyTableFormat.d.ts +0 -8
- package/lib/publicApi/table/applyTableFormat.js +0 -243
- package/lib/publicApi/table/applyTableFormat.js.map +0 -1
- package/lib/publicApi/table/getSelectedCells.d.ts +0 -6
- package/lib/publicApi/table/getSelectedCells.js +0 -33
- package/lib/publicApi/table/getSelectedCells.js.map +0 -1
- package/lib/publicApi/table/normalizeTable.d.ts +0 -17
- package/lib/publicApi/table/normalizeTable.js +0 -128
- package/lib/publicApi/table/normalizeTable.js.map +0 -1
- package/lib/publicApi/table/setTableCellBackgroundColor.d.ts +0 -9
- package/lib/publicApi/table/setTableCellBackgroundColor.js +0 -121
- package/lib/publicApi/table/setTableCellBackgroundColor.js.map +0 -1
- package/lib/publicApi/undo/redo.js.map +0 -1
- package/lib/publicApi/undo/undo.js.map +0 -1
- package/lib/utils/convertInlineCss.js +0 -64
- package/lib/utils/convertInlineCss.js.map +0 -1
- package/lib/utils/createDomToModelContextForSanitizing.d.ts +0 -5
- package/lib/utils/createDomToModelContextForSanitizing.js +0 -43
- package/lib/utils/createDomToModelContextForSanitizing.js.map +0 -1
- package/lib/utils/createSnapshotSelection.d.ts +0 -5
- package/lib/utils/createSnapshotSelection.js +0 -168
- package/lib/utils/createSnapshotSelection.js.map +0 -1
- package/lib/utils/extractClipboardItems.d.ts +0 -8
- package/lib/utils/extractClipboardItems.js +0 -83
- package/lib/utils/extractClipboardItems.js.map +0 -1
- package/lib/utils/getRootComputedStyleForContext.js.map +0 -1
- package/lib/utils/paste/createPasteFragment.js.map +0 -1
- package/lib/utils/paste/generatePasteOptionFromPlugins.js.map +0 -1
- package/lib/utils/paste/mergePasteContent.d.ts +0 -5
- package/lib/utils/paste/mergePasteContent.js +0 -74
- package/lib/utils/paste/mergePasteContent.js.map +0 -1
- package/lib/utils/paste/retrieveHtmlInfo.d.ts +0 -15
- package/lib/utils/paste/retrieveHtmlInfo.js +0 -69
- package/lib/utils/paste/retrieveHtmlInfo.js.map +0 -1
- package/lib/utils/restoreSnapshotColors.js +0 -16
- package/lib/utils/restoreSnapshotColors.js.map +0 -1
- package/lib/utils/restoreSnapshotHTML.js.map +0 -1
- package/lib/utils/restoreSnapshotSelection.js +0 -73
- package/lib/utils/restoreSnapshotSelection.js.map +0 -1
- package/lib/utils/sanitizeElement.js.map +0 -1
- package/lib-amd/constants/BulletListType.d.ts +0 -49
- package/lib-amd/constants/BulletListType.js +0 -55
- package/lib-amd/constants/BulletListType.js.map +0 -1
- package/lib-amd/constants/ChangeSource.d.ts +0 -59
- package/lib-amd/constants/ChangeSource.js +0 -65
- package/lib-amd/constants/ChangeSource.js.map +0 -1
- package/lib-amd/constants/NumberingListType.d.ts +0 -93
- package/lib-amd/constants/NumberingListType.js +0 -99
- package/lib-amd/constants/NumberingListType.js.map +0 -1
- package/lib-amd/constants/TableBorderFormat.d.ts +0 -81
- package/lib-amd/constants/TableBorderFormat.js +0 -87
- package/lib-amd/constants/TableBorderFormat.js.map +0 -1
- package/lib-amd/coreApi/addUndoSnapshot.js +0 -34
- package/lib-amd/coreApi/addUndoSnapshot.js.map +0 -1
- package/lib-amd/coreApi/attachDomEvent.js.map +0 -1
- package/lib-amd/coreApi/createContentModel.js +0 -44
- package/lib-amd/coreApi/createContentModel.js.map +0 -1
- package/lib-amd/coreApi/createEditorContext.js +0 -25
- package/lib-amd/coreApi/createEditorContext.js.map +0 -1
- package/lib-amd/coreApi/focus.js.map +0 -1
- package/lib-amd/coreApi/formatContentModel.js +0 -118
- package/lib-amd/coreApi/formatContentModel.js.map +0 -1
- package/lib-amd/coreApi/getDOMSelection.js +0 -42
- package/lib-amd/coreApi/getDOMSelection.js.map +0 -1
- package/lib-amd/coreApi/getVisibleViewport.js.map +0 -1
- package/lib-amd/coreApi/restoreUndoSnapshot.js +0 -34
- package/lib-amd/coreApi/restoreUndoSnapshot.js.map +0 -1
- package/lib-amd/coreApi/setContentModel.js +0 -36
- package/lib-amd/coreApi/setContentModel.js.map +0 -1
- package/lib-amd/coreApi/setDOMSelection.js +0 -162
- package/lib-amd/coreApi/setDOMSelection.js.map +0 -1
- package/lib-amd/coreApi/switchShadowEdit.js +0 -46
- package/lib-amd/coreApi/switchShadowEdit.js.map +0 -1
- package/lib-amd/coreApi/triggerEvent.js.map +0 -1
- package/lib-amd/corePlugin/CachePlugin.js +0 -156
- package/lib-amd/corePlugin/CachePlugin.js.map +0 -1
- package/lib-amd/corePlugin/ContextMenuPlugin.js +0 -112
- package/lib-amd/corePlugin/ContextMenuPlugin.js.map +0 -1
- package/lib-amd/corePlugin/CopyPastePlugin.js +0 -265
- package/lib-amd/corePlugin/CopyPastePlugin.js.map +0 -1
- package/lib-amd/corePlugin/DOMEventPlugin.js +0 -200
- package/lib-amd/corePlugin/DOMEventPlugin.js.map +0 -1
- package/lib-amd/corePlugin/EntityPlugin.js +0 -215
- package/lib-amd/corePlugin/EntityPlugin.js.map +0 -1
- package/lib-amd/corePlugin/FormatPlugin.js +0 -186
- package/lib-amd/corePlugin/FormatPlugin.js.map +0 -1
- package/lib-amd/corePlugin/LifecyclePlugin.js +0 -114
- package/lib-amd/corePlugin/LifecyclePlugin.js.map +0 -1
- package/lib-amd/corePlugin/SelectionPlugin.js +0 -189
- package/lib-amd/corePlugin/SelectionPlugin.js.map +0 -1
- package/lib-amd/corePlugin/UndoPlugin.js +0 -219
- package/lib-amd/corePlugin/UndoPlugin.js.map +0 -1
- package/lib-amd/corePlugin/utils/addRangeToSelection.js.map +0 -1
- package/lib-amd/corePlugin/utils/applyDefaultFormat.js +0 -53
- package/lib-amd/corePlugin/utils/applyDefaultFormat.js.map +0 -1
- package/lib-amd/corePlugin/utils/applyPendingFormat.js +0 -50
- package/lib-amd/corePlugin/utils/applyPendingFormat.js.map +0 -1
- package/lib-amd/corePlugin/utils/areSameSelection.d.ts +0 -6
- package/lib-amd/corePlugin/utils/areSameSelection.js +0 -38
- package/lib-amd/corePlugin/utils/areSameSelection.js.map +0 -1
- package/lib-amd/corePlugin/utils/deleteEmptyList.js +0 -43
- package/lib-amd/corePlugin/utils/deleteEmptyList.js.map +0 -1
- package/lib-amd/corePlugin/utils/domIndexerImpl.js +0 -189
- package/lib-amd/corePlugin/utils/domIndexerImpl.js.map +0 -1
- package/lib-amd/corePlugin/utils/entityDelimiterUtils.js +0 -257
- package/lib-amd/corePlugin/utils/entityDelimiterUtils.js.map +0 -1
- package/lib-amd/corePlugin/utils/findAllEntities.js.map +0 -1
- package/lib-amd/corePlugin/utils/textMutationObserver.js.map +0 -1
- package/lib-amd/editor/DOMHelperImpl.js.map +0 -1
- package/lib-amd/editor/DarkColorHandlerImpl.js.map +0 -1
- package/lib-amd/editor/SnapshotsManagerImpl.js.map +0 -1
- package/lib-amd/editor/coreApiMap.js +0 -25
- package/lib-amd/editor/coreApiMap.js.map +0 -1
- package/lib-amd/editor/createEditorCore.js +0 -82
- package/lib-amd/editor/createEditorCore.js.map +0 -1
- package/lib-amd/editor/createEditorDefaultSettings.js +0 -47
- package/lib-amd/editor/createEditorDefaultSettings.js.map +0 -1
- package/lib-amd/metadata/definitionCreators.d.ts +0 -48
- package/lib-amd/metadata/definitionCreators.js +0 -97
- package/lib-amd/metadata/definitionCreators.js.map +0 -1
- package/lib-amd/metadata/updateImageMetadata.d.ts +0 -7
- package/lib-amd/metadata/updateImageMetadata.js +0 -28
- package/lib-amd/metadata/updateImageMetadata.js.map +0 -1
- package/lib-amd/metadata/updateListMetadata.d.ts +0 -22
- package/lib-amd/metadata/updateListMetadata.js +0 -204
- package/lib-amd/metadata/updateListMetadata.js.map +0 -1
- package/lib-amd/metadata/updateTableCellMetadata.d.ts +0 -7
- package/lib-amd/metadata/updateTableCellMetadata.js +0 -20
- package/lib-amd/metadata/updateTableCellMetadata.js.map +0 -1
- package/lib-amd/metadata/updateTableMetadata.d.ts +0 -7
- package/lib-amd/metadata/updateTableMetadata.js +0 -31
- package/lib-amd/metadata/updateTableMetadata.js.map +0 -1
- package/lib-amd/modelApi/edit/deleteExpandedSelection.d.ts +0 -7
- package/lib-amd/modelApi/edit/deleteExpandedSelection.js +0 -96
- package/lib-amd/modelApi/edit/deleteExpandedSelection.js.map +0 -1
- package/lib-amd/modelApi/edit/deleteSingleChar.d.ts +0 -4
- package/lib-amd/modelApi/edit/deleteSingleChar.js +0 -37
- package/lib-amd/modelApi/edit/deleteSingleChar.js.map +0 -1
- package/lib-amd/override/reducedModelChildProcessor.d.ts +0 -21
- package/lib-amd/override/reducedModelChildProcessor.js +0 -65
- package/lib-amd/override/reducedModelChildProcessor.js.map +0 -1
- package/lib-amd/publicApi/color/transformColor.d.ts +0 -9
- package/lib-amd/publicApi/color/transformColor.js +0 -42
- package/lib-amd/publicApi/color/transformColor.js.map +0 -1
- package/lib-amd/publicApi/domUtils/borderValues.d.ts +0 -13
- package/lib-amd/publicApi/domUtils/borderValues.js +0 -50
- package/lib-amd/publicApi/domUtils/borderValues.js.map +0 -1
- package/lib-amd/publicApi/domUtils/cacheGetEventData.d.ts +0 -9
- package/lib-amd/publicApi/domUtils/cacheGetEventData.js +0 -22
- package/lib-amd/publicApi/domUtils/cacheGetEventData.js.map +0 -1
- package/lib-amd/publicApi/domUtils/eventUtils.d.ts +0 -20
- package/lib-amd/publicApi/domUtils/eventUtils.js +0 -51
- package/lib-amd/publicApi/domUtils/eventUtils.js.map +0 -1
- package/lib-amd/publicApi/domUtils/getSegmentTextFormat.d.ts +0 -7
- package/lib-amd/publicApi/domUtils/getSegmentTextFormat.js +0 -35
- package/lib-amd/publicApi/domUtils/getSegmentTextFormat.js.map +0 -1
- package/lib-amd/publicApi/domUtils/readFile.d.ts +0 -7
- package/lib-amd/publicApi/domUtils/readFile.js +0 -25
- package/lib-amd/publicApi/domUtils/readFile.js.map +0 -1
- package/lib-amd/publicApi/domUtils/stringUtil.d.ts +0 -18
- package/lib-amd/publicApi/domUtils/stringUtil.js +0 -37
- package/lib-amd/publicApi/domUtils/stringUtil.js.map +0 -1
- package/lib-amd/publicApi/domUtils/tableCellUtils.d.ts +0 -13
- package/lib-amd/publicApi/domUtils/tableCellUtils.js +0 -58
- package/lib-amd/publicApi/domUtils/tableCellUtils.js.map +0 -1
- package/lib-amd/publicApi/format/retrieveModelFormatState.d.ts +0 -8
- package/lib-amd/publicApi/format/retrieveModelFormatState.js +0 -174
- package/lib-amd/publicApi/format/retrieveModelFormatState.js.map +0 -1
- package/lib-amd/publicApi/model/cloneModel.d.ts +0 -7
- package/lib-amd/publicApi/model/cloneModel.js +0 -208
- package/lib-amd/publicApi/model/cloneModel.js.map +0 -1
- package/lib-amd/publicApi/model/createModelFromHtml.d.ts +0 -9
- package/lib-amd/publicApi/model/createModelFromHtml.js +0 -30
- package/lib-amd/publicApi/model/createModelFromHtml.js.map +0 -1
- package/lib-amd/publicApi/model/exportContent.js.map +0 -1
- package/lib-amd/publicApi/model/getClosestAncestorBlockGroupIndex.d.ts +0 -12
- package/lib-amd/publicApi/model/getClosestAncestorBlockGroupIndex.js +0 -30
- package/lib-amd/publicApi/model/getClosestAncestorBlockGroupIndex.js.map +0 -1
- package/lib-amd/publicApi/model/isBlockGroupOfType.d.ts +0 -8
- package/lib-amd/publicApi/model/isBlockGroupOfType.js +0 -16
- package/lib-amd/publicApi/model/isBlockGroupOfType.js.map +0 -1
- package/lib-amd/publicApi/model/isBold.d.ts +0 -5
- package/lib-amd/publicApi/model/isBold.js +0 -14
- package/lib-amd/publicApi/model/isBold.js.map +0 -1
- package/lib-amd/publicApi/model/mergeModel.d.ts +0 -36
- package/lib-amd/publicApi/model/mergeModel.js +0 -267
- package/lib-amd/publicApi/model/mergeModel.js.map +0 -1
- package/lib-amd/publicApi/paste/paste.js +0 -39
- package/lib-amd/publicApi/paste/paste.js.map +0 -1
- package/lib-amd/publicApi/selection/collectSelections.d.ts +0 -54
- package/lib-amd/publicApi/selection/collectSelections.js +0 -182
- package/lib-amd/publicApi/selection/collectSelections.js.map +0 -1
- package/lib-amd/publicApi/selection/deleteBlock.d.ts +0 -11
- package/lib-amd/publicApi/selection/deleteBlock.js +0 -58
- package/lib-amd/publicApi/selection/deleteBlock.js.map +0 -1
- package/lib-amd/publicApi/selection/deleteSegment.d.ts +0 -10
- package/lib-amd/publicApi/selection/deleteSegment.js +0 -85
- package/lib-amd/publicApi/selection/deleteSegment.js.map +0 -1
- package/lib-amd/publicApi/selection/deleteSelection.d.ts +0 -9
- package/lib-amd/publicApi/selection/deleteSelection.js +0 -42
- package/lib-amd/publicApi/selection/deleteSelection.js.map +0 -1
- package/lib-amd/publicApi/selection/getSelectionRootNode.d.ts +0 -9
- package/lib-amd/publicApi/selection/getSelectionRootNode.js +0 -25
- package/lib-amd/publicApi/selection/getSelectionRootNode.js.map +0 -1
- package/lib-amd/publicApi/selection/hasSelectionInBlock.d.ts +0 -6
- package/lib-amd/publicApi/selection/hasSelectionInBlock.js +0 -26
- package/lib-amd/publicApi/selection/hasSelectionInBlock.js.map +0 -1
- package/lib-amd/publicApi/selection/hasSelectionInBlockGroup.d.ts +0 -6
- package/lib-amd/publicApi/selection/hasSelectionInBlockGroup.js +0 -20
- package/lib-amd/publicApi/selection/hasSelectionInBlockGroup.js.map +0 -1
- package/lib-amd/publicApi/selection/hasSelectionInSegment.d.ts +0 -6
- package/lib-amd/publicApi/selection/hasSelectionInSegment.js +0 -15
- package/lib-amd/publicApi/selection/hasSelectionInSegment.js.map +0 -1
- package/lib-amd/publicApi/selection/iterateSelections.d.ts +0 -48
- package/lib-amd/publicApi/selection/iterateSelections.js +0 -146
- package/lib-amd/publicApi/selection/iterateSelections.js.map +0 -1
- package/lib-amd/publicApi/selection/setSelection.d.ts +0 -8
- package/lib-amd/publicApi/selection/setSelection.js +0 -132
- package/lib-amd/publicApi/selection/setSelection.js.map +0 -1
- package/lib-amd/publicApi/table/applyTableFormat.d.ts +0 -8
- package/lib-amd/publicApi/table/applyTableFormat.js +0 -238
- package/lib-amd/publicApi/table/applyTableFormat.js.map +0 -1
- package/lib-amd/publicApi/table/getSelectedCells.d.ts +0 -6
- package/lib-amd/publicApi/table/getSelectedCells.js +0 -34
- package/lib-amd/publicApi/table/getSelectedCells.js.map +0 -1
- package/lib-amd/publicApi/table/normalizeTable.d.ts +0 -17
- package/lib-amd/publicApi/table/normalizeTable.js +0 -128
- package/lib-amd/publicApi/table/normalizeTable.js.map +0 -1
- package/lib-amd/publicApi/table/setTableCellBackgroundColor.d.ts +0 -9
- package/lib-amd/publicApi/table/setTableCellBackgroundColor.js +0 -120
- package/lib-amd/publicApi/table/setTableCellBackgroundColor.js.map +0 -1
- package/lib-amd/publicApi/undo/redo.js.map +0 -1
- package/lib-amd/publicApi/undo/undo.js.map +0 -1
- package/lib-amd/utils/convertInlineCss.js +0 -64
- package/lib-amd/utils/convertInlineCss.js.map +0 -1
- package/lib-amd/utils/createDomToModelContextForSanitizing.d.ts +0 -5
- package/lib-amd/utils/createDomToModelContextForSanitizing.js +0 -36
- package/lib-amd/utils/createDomToModelContextForSanitizing.js.map +0 -1
- package/lib-amd/utils/createSnapshotSelection.d.ts +0 -5
- package/lib-amd/utils/createSnapshotSelection.js +0 -169
- package/lib-amd/utils/createSnapshotSelection.js.map +0 -1
- package/lib-amd/utils/extractClipboardItems.d.ts +0 -8
- package/lib-amd/utils/extractClipboardItems.js +0 -84
- package/lib-amd/utils/extractClipboardItems.js.map +0 -1
- package/lib-amd/utils/getRootComputedStyleForContext.js.map +0 -1
- package/lib-amd/utils/paste/createPasteFragment.js.map +0 -1
- package/lib-amd/utils/paste/generatePasteOptionFromPlugins.js.map +0 -1
- package/lib-amd/utils/paste/mergePasteContent.d.ts +0 -5
- package/lib-amd/utils/paste/mergePasteContent.js +0 -68
- package/lib-amd/utils/paste/mergePasteContent.js.map +0 -1
- package/lib-amd/utils/paste/retrieveHtmlInfo.d.ts +0 -15
- package/lib-amd/utils/paste/retrieveHtmlInfo.js +0 -68
- package/lib-amd/utils/paste/retrieveHtmlInfo.js.map +0 -1
- package/lib-amd/utils/restoreSnapshotColors.js +0 -17
- package/lib-amd/utils/restoreSnapshotColors.js.map +0 -1
- package/lib-amd/utils/restoreSnapshotHTML.js.map +0 -1
- package/lib-amd/utils/restoreSnapshotSelection.js +0 -74
- package/lib-amd/utils/restoreSnapshotSelection.js.map +0 -1
- package/lib-amd/utils/sanitizeElement.js.map +0 -1
- package/lib-mjs/constants/BulletListType.d.ts +0 -49
- package/lib-mjs/constants/BulletListType.js +0 -50
- package/lib-mjs/constants/BulletListType.js.map +0 -1
- package/lib-mjs/constants/ChangeSource.d.ts +0 -59
- package/lib-mjs/constants/ChangeSource.js +0 -60
- package/lib-mjs/constants/ChangeSource.js.map +0 -1
- package/lib-mjs/constants/NumberingListType.d.ts +0 -93
- package/lib-mjs/constants/NumberingListType.js +0 -94
- package/lib-mjs/constants/NumberingListType.js.map +0 -1
- package/lib-mjs/constants/TableBorderFormat.d.ts +0 -81
- package/lib-mjs/constants/TableBorderFormat.js +0 -82
- package/lib-mjs/constants/TableBorderFormat.js.map +0 -1
- package/lib-mjs/coreApi/addUndoSnapshot.js +0 -29
- package/lib-mjs/coreApi/addUndoSnapshot.js.map +0 -1
- package/lib-mjs/coreApi/attachDomEvent.js.map +0 -1
- package/lib-mjs/coreApi/createContentModel.js +0 -40
- package/lib-mjs/coreApi/createContentModel.js.map +0 -1
- package/lib-mjs/coreApi/createEditorContext.js +0 -21
- package/lib-mjs/coreApi/createEditorContext.js.map +0 -1
- package/lib-mjs/coreApi/focus.js.map +0 -1
- package/lib-mjs/coreApi/formatContentModel.js +0 -114
- package/lib-mjs/coreApi/formatContentModel.js.map +0 -1
- package/lib-mjs/coreApi/getDOMSelection.js +0 -36
- package/lib-mjs/coreApi/getDOMSelection.js.map +0 -1
- package/lib-mjs/coreApi/getVisibleViewport.js.map +0 -1
- package/lib-mjs/coreApi/restoreUndoSnapshot.js +0 -32
- package/lib-mjs/coreApi/restoreUndoSnapshot.js.map +0 -1
- package/lib-mjs/coreApi/setContentModel.js +0 -31
- package/lib-mjs/coreApi/setContentModel.js.map +0 -1
- package/lib-mjs/coreApi/setDOMSelection.js +0 -159
- package/lib-mjs/coreApi/setDOMSelection.js.map +0 -1
- package/lib-mjs/coreApi/switchShadowEdit.js +0 -42
- package/lib-mjs/coreApi/switchShadowEdit.js.map +0 -1
- package/lib-mjs/coreApi/triggerEvent.js.map +0 -1
- package/lib-mjs/corePlugin/CachePlugin.js +0 -153
- package/lib-mjs/corePlugin/CachePlugin.js.map +0 -1
- package/lib-mjs/corePlugin/ContextMenuPlugin.js +0 -108
- package/lib-mjs/corePlugin/ContextMenuPlugin.js.map +0 -1
- package/lib-mjs/corePlugin/CopyPastePlugin.js +0 -267
- package/lib-mjs/corePlugin/CopyPastePlugin.js.map +0 -1
- package/lib-mjs/corePlugin/DOMEventPlugin.js +0 -197
- package/lib-mjs/corePlugin/DOMEventPlugin.js.map +0 -1
- package/lib-mjs/corePlugin/EntityPlugin.js +0 -213
- package/lib-mjs/corePlugin/EntityPlugin.js.map +0 -1
- package/lib-mjs/corePlugin/FormatPlugin.js +0 -185
- package/lib-mjs/corePlugin/FormatPlugin.js.map +0 -1
- package/lib-mjs/corePlugin/LifecyclePlugin.js +0 -110
- package/lib-mjs/corePlugin/LifecyclePlugin.js.map +0 -1
- package/lib-mjs/corePlugin/SelectionPlugin.js +0 -185
- package/lib-mjs/corePlugin/SelectionPlugin.js.map +0 -1
- package/lib-mjs/corePlugin/UndoPlugin.js +0 -217
- package/lib-mjs/corePlugin/UndoPlugin.js.map +0 -1
- package/lib-mjs/corePlugin/utils/addRangeToSelection.js.map +0 -1
- package/lib-mjs/corePlugin/utils/applyDefaultFormat.js +0 -50
- package/lib-mjs/corePlugin/utils/applyDefaultFormat.js.map +0 -1
- package/lib-mjs/corePlugin/utils/applyPendingFormat.js +0 -47
- package/lib-mjs/corePlugin/utils/applyPendingFormat.js.map +0 -1
- package/lib-mjs/corePlugin/utils/areSameSelection.d.ts +0 -6
- package/lib-mjs/corePlugin/utils/areSameSelection.js +0 -32
- package/lib-mjs/corePlugin/utils/areSameSelection.js.map +0 -1
- package/lib-mjs/corePlugin/utils/deleteEmptyList.js +0 -40
- package/lib-mjs/corePlugin/utils/deleteEmptyList.js.map +0 -1
- package/lib-mjs/corePlugin/utils/domIndexerImpl.js +0 -187
- package/lib-mjs/corePlugin/utils/domIndexerImpl.js.map +0 -1
- package/lib-mjs/corePlugin/utils/entityDelimiterUtils.js +0 -250
- package/lib-mjs/corePlugin/utils/entityDelimiterUtils.js.map +0 -1
- package/lib-mjs/corePlugin/utils/findAllEntities.js.map +0 -1
- package/lib-mjs/corePlugin/utils/textMutationObserver.js.map +0 -1
- package/lib-mjs/editor/DOMHelperImpl.js.map +0 -1
- package/lib-mjs/editor/DarkColorHandlerImpl.js.map +0 -1
- package/lib-mjs/editor/SnapshotsManagerImpl.js.map +0 -1
- package/lib-mjs/editor/coreApiMap.js +0 -33
- package/lib-mjs/editor/coreApiMap.js.map +0 -1
- package/lib-mjs/editor/createEditorCore.js +0 -80
- package/lib-mjs/editor/createEditorCore.js.map +0 -1
- package/lib-mjs/editor/createEditorDefaultSettings.js +0 -43
- package/lib-mjs/editor/createEditorDefaultSettings.js.map +0 -1
- package/lib-mjs/metadata/definitionCreators.d.ts +0 -48
- package/lib-mjs/metadata/definitionCreators.js +0 -87
- package/lib-mjs/metadata/definitionCreators.js.map +0 -1
- package/lib-mjs/metadata/updateImageMetadata.d.ts +0 -7
- package/lib-mjs/metadata/updateImageMetadata.js +0 -24
- package/lib-mjs/metadata/updateImageMetadata.js.map +0 -1
- package/lib-mjs/metadata/updateListMetadata.d.ts +0 -22
- package/lib-mjs/metadata/updateListMetadata.js +0 -202
- package/lib-mjs/metadata/updateListMetadata.js.map +0 -1
- package/lib-mjs/metadata/updateTableCellMetadata.d.ts +0 -7
- package/lib-mjs/metadata/updateTableCellMetadata.js +0 -16
- package/lib-mjs/metadata/updateTableCellMetadata.js.map +0 -1
- package/lib-mjs/metadata/updateTableMetadata.d.ts +0 -7
- package/lib-mjs/metadata/updateTableMetadata.js +0 -28
- package/lib-mjs/metadata/updateTableMetadata.js.map +0 -1
- package/lib-mjs/modelApi/edit/deleteExpandedSelection.d.ts +0 -7
- package/lib-mjs/modelApi/edit/deleteExpandedSelection.js +0 -96
- package/lib-mjs/modelApi/edit/deleteExpandedSelection.js.map +0 -1
- package/lib-mjs/modelApi/edit/deleteSingleChar.d.ts +0 -4
- package/lib-mjs/modelApi/edit/deleteSingleChar.js +0 -32
- package/lib-mjs/modelApi/edit/deleteSingleChar.js.map +0 -1
- package/lib-mjs/override/reducedModelChildProcessor.d.ts +0 -21
- package/lib-mjs/override/reducedModelChildProcessor.js +0 -62
- package/lib-mjs/override/reducedModelChildProcessor.js.map +0 -1
- package/lib-mjs/publicApi/color/transformColor.d.ts +0 -9
- package/lib-mjs/publicApi/color/transformColor.js +0 -37
- package/lib-mjs/publicApi/color/transformColor.js.map +0 -1
- package/lib-mjs/publicApi/domUtils/borderValues.d.ts +0 -13
- package/lib-mjs/publicApi/domUtils/borderValues.js +0 -43
- package/lib-mjs/publicApi/domUtils/borderValues.js.map +0 -1
- package/lib-mjs/publicApi/domUtils/cacheGetEventData.d.ts +0 -9
- package/lib-mjs/publicApi/domUtils/cacheGetEventData.js +0 -16
- package/lib-mjs/publicApi/domUtils/cacheGetEventData.js.map +0 -1
- package/lib-mjs/publicApi/domUtils/eventUtils.d.ts +0 -20
- package/lib-mjs/publicApi/domUtils/eventUtils.js +0 -43
- package/lib-mjs/publicApi/domUtils/eventUtils.js.map +0 -1
- package/lib-mjs/publicApi/domUtils/getSegmentTextFormat.d.ts +0 -7
- package/lib-mjs/publicApi/domUtils/getSegmentTextFormat.js +0 -29
- package/lib-mjs/publicApi/domUtils/getSegmentTextFormat.js.map +0 -1
- package/lib-mjs/publicApi/domUtils/readFile.d.ts +0 -7
- package/lib-mjs/publicApi/domUtils/readFile.js +0 -19
- package/lib-mjs/publicApi/domUtils/readFile.js.map +0 -1
- package/lib-mjs/publicApi/domUtils/stringUtil.d.ts +0 -18
- package/lib-mjs/publicApi/domUtils/stringUtil.js +0 -29
- package/lib-mjs/publicApi/domUtils/stringUtil.js.map +0 -1
- package/lib-mjs/publicApi/domUtils/tableCellUtils.d.ts +0 -13
- package/lib-mjs/publicApi/domUtils/tableCellUtils.js +0 -52
- package/lib-mjs/publicApi/domUtils/tableCellUtils.js.map +0 -1
- package/lib-mjs/publicApi/format/retrieveModelFormatState.d.ts +0 -8
- package/lib-mjs/publicApi/format/retrieveModelFormatState.js +0 -174
- package/lib-mjs/publicApi/format/retrieveModelFormatState.js.map +0 -1
- package/lib-mjs/publicApi/model/cloneModel.d.ts +0 -7
- package/lib-mjs/publicApi/model/cloneModel.js +0 -203
- package/lib-mjs/publicApi/model/cloneModel.js.map +0 -1
- package/lib-mjs/publicApi/model/createModelFromHtml.d.ts +0 -9
- package/lib-mjs/publicApi/model/createModelFromHtml.js +0 -27
- package/lib-mjs/publicApi/model/createModelFromHtml.js.map +0 -1
- package/lib-mjs/publicApi/model/exportContent.js.map +0 -1
- package/lib-mjs/publicApi/model/getClosestAncestorBlockGroupIndex.d.ts +0 -12
- package/lib-mjs/publicApi/model/getClosestAncestorBlockGroupIndex.js +0 -24
- package/lib-mjs/publicApi/model/getClosestAncestorBlockGroupIndex.js.map +0 -1
- package/lib-mjs/publicApi/model/isBlockGroupOfType.d.ts +0 -8
- package/lib-mjs/publicApi/model/isBlockGroupOfType.js +0 -10
- package/lib-mjs/publicApi/model/isBlockGroupOfType.js.map +0 -1
- package/lib-mjs/publicApi/model/isBold.d.ts +0 -5
- package/lib-mjs/publicApi/model/isBold.js +0 -8
- package/lib-mjs/publicApi/model/isBold.js.map +0 -1
- package/lib-mjs/publicApi/model/mergeModel.d.ts +0 -36
- package/lib-mjs/publicApi/model/mergeModel.js +0 -267
- package/lib-mjs/publicApi/model/mergeModel.js.map +0 -1
- package/lib-mjs/publicApi/paste/paste.js +0 -38
- package/lib-mjs/publicApi/paste/paste.js.map +0 -1
- package/lib-mjs/publicApi/selection/collectSelections.d.ts +0 -54
- package/lib-mjs/publicApi/selection/collectSelections.js +0 -175
- package/lib-mjs/publicApi/selection/collectSelections.js.map +0 -1
- package/lib-mjs/publicApi/selection/deleteBlock.d.ts +0 -11
- package/lib-mjs/publicApi/selection/deleteBlock.js +0 -52
- package/lib-mjs/publicApi/selection/deleteBlock.js.map +0 -1
- package/lib-mjs/publicApi/selection/deleteSegment.d.ts +0 -10
- package/lib-mjs/publicApi/selection/deleteSegment.js +0 -82
- package/lib-mjs/publicApi/selection/deleteSegment.js.map +0 -1
- package/lib-mjs/publicApi/selection/deleteSelection.d.ts +0 -9
- package/lib-mjs/publicApi/selection/deleteSelection.js +0 -38
- package/lib-mjs/publicApi/selection/deleteSelection.js.map +0 -1
- package/lib-mjs/publicApi/selection/getSelectionRootNode.d.ts +0 -9
- package/lib-mjs/publicApi/selection/getSelectionRootNode.js +0 -19
- package/lib-mjs/publicApi/selection/getSelectionRootNode.js.map +0 -1
- package/lib-mjs/publicApi/selection/hasSelectionInBlock.d.ts +0 -6
- package/lib-mjs/publicApi/selection/hasSelectionInBlock.js +0 -22
- package/lib-mjs/publicApi/selection/hasSelectionInBlock.js.map +0 -1
- package/lib-mjs/publicApi/selection/hasSelectionInBlockGroup.d.ts +0 -6
- package/lib-mjs/publicApi/selection/hasSelectionInBlockGroup.js +0 -15
- package/lib-mjs/publicApi/selection/hasSelectionInBlockGroup.js.map +0 -1
- package/lib-mjs/publicApi/selection/hasSelectionInSegment.d.ts +0 -6
- package/lib-mjs/publicApi/selection/hasSelectionInSegment.js +0 -10
- package/lib-mjs/publicApi/selection/hasSelectionInSegment.js.map +0 -1
- package/lib-mjs/publicApi/selection/iterateSelections.d.ts +0 -48
- package/lib-mjs/publicApi/selection/iterateSelections.js +0 -141
- package/lib-mjs/publicApi/selection/iterateSelections.js.map +0 -1
- package/lib-mjs/publicApi/selection/setSelection.d.ts +0 -8
- package/lib-mjs/publicApi/selection/setSelection.js +0 -127
- package/lib-mjs/publicApi/selection/setSelection.js.map +0 -1
- package/lib-mjs/publicApi/table/applyTableFormat.d.ts +0 -8
- package/lib-mjs/publicApi/table/applyTableFormat.js +0 -239
- package/lib-mjs/publicApi/table/applyTableFormat.js.map +0 -1
- package/lib-mjs/publicApi/table/getSelectedCells.d.ts +0 -6
- package/lib-mjs/publicApi/table/getSelectedCells.js +0 -29
- package/lib-mjs/publicApi/table/getSelectedCells.js.map +0 -1
- package/lib-mjs/publicApi/table/normalizeTable.d.ts +0 -17
- package/lib-mjs/publicApi/table/normalizeTable.js +0 -124
- package/lib-mjs/publicApi/table/normalizeTable.js.map +0 -1
- package/lib-mjs/publicApi/table/setTableCellBackgroundColor.d.ts +0 -9
- package/lib-mjs/publicApi/table/setTableCellBackgroundColor.js +0 -117
- package/lib-mjs/publicApi/table/setTableCellBackgroundColor.js.map +0 -1
- package/lib-mjs/publicApi/undo/redo.js.map +0 -1
- package/lib-mjs/publicApi/undo/undo.js.map +0 -1
- package/lib-mjs/utils/convertInlineCss.js +0 -59
- package/lib-mjs/utils/convertInlineCss.js.map +0 -1
- package/lib-mjs/utils/createDomToModelContextForSanitizing.d.ts +0 -5
- package/lib-mjs/utils/createDomToModelContextForSanitizing.js +0 -39
- package/lib-mjs/utils/createDomToModelContextForSanitizing.js.map +0 -1
- package/lib-mjs/utils/createSnapshotSelection.d.ts +0 -5
- package/lib-mjs/utils/createSnapshotSelection.js +0 -164
- package/lib-mjs/utils/createSnapshotSelection.js.map +0 -1
- package/lib-mjs/utils/extractClipboardItems.d.ts +0 -8
- package/lib-mjs/utils/extractClipboardItems.js +0 -79
- package/lib-mjs/utils/extractClipboardItems.js.map +0 -1
- package/lib-mjs/utils/getRootComputedStyleForContext.js.map +0 -1
- package/lib-mjs/utils/paste/createPasteFragment.js.map +0 -1
- package/lib-mjs/utils/paste/generatePasteOptionFromPlugins.js.map +0 -1
- package/lib-mjs/utils/paste/mergePasteContent.d.ts +0 -5
- package/lib-mjs/utils/paste/mergePasteContent.js +0 -70
- package/lib-mjs/utils/paste/mergePasteContent.js.map +0 -1
- package/lib-mjs/utils/paste/retrieveHtmlInfo.d.ts +0 -15
- package/lib-mjs/utils/paste/retrieveHtmlInfo.js +0 -65
- package/lib-mjs/utils/paste/retrieveHtmlInfo.js.map +0 -1
- package/lib-mjs/utils/restoreSnapshotColors.js +0 -12
- package/lib-mjs/utils/restoreSnapshotColors.js.map +0 -1
- package/lib-mjs/utils/restoreSnapshotHTML.js.map +0 -1
- package/lib-mjs/utils/restoreSnapshotSelection.js +0 -69
- package/lib-mjs/utils/restoreSnapshotSelection.js.map +0 -1
- package/lib-mjs/utils/sanitizeElement.js.map +0 -1
- /package/lib/{utils → command/createModelFromHtml}/convertInlineCss.d.ts +0 -0
- /package/lib/{utils → command/createModelFromHtml}/sanitizeElement.d.ts +0 -0
- /package/lib/{utils → command/createModelFromHtml}/sanitizeElement.js +0 -0
- /package/lib/{publicApi/model → command/exportContent}/exportContent.d.ts +0 -0
- /package/lib/{publicApi/model → command/exportContent}/exportContent.js +0 -0
- /package/lib/{utils → command}/paste/createPasteFragment.d.ts +0 -0
- /package/lib/{utils → command}/paste/createPasteFragment.js +0 -0
- /package/lib/{utils → command}/paste/generatePasteOptionFromPlugins.d.ts +0 -0
- /package/lib/{utils → command}/paste/generatePasteOptionFromPlugins.js +0 -0
- /package/lib/{publicApi → command}/paste/paste.d.ts +0 -0
- /package/lib/{publicApi/undo → command/redo}/redo.d.ts +0 -0
- /package/lib/{publicApi/undo → command/redo}/redo.js +0 -0
- /package/lib/{publicApi → command}/undo/undo.d.ts +0 -0
- /package/lib/{publicApi → command}/undo/undo.js +0 -0
- /package/lib/coreApi/{addUndoSnapshot.d.ts → addUndoSnapshot/addUndoSnapshot.d.ts} +0 -0
- /package/lib/coreApi/{attachDomEvent.d.ts → attachDomEvent/attachDomEvent.d.ts} +0 -0
- /package/lib/coreApi/{attachDomEvent.js → attachDomEvent/attachDomEvent.js} +0 -0
- /package/lib/{editor → coreApi}/coreApiMap.d.ts +0 -0
- /package/lib/coreApi/{createContentModel.d.ts → createContentModel/createContentModel.d.ts} +0 -0
- /package/lib/coreApi/{createEditorContext.d.ts → createEditorContext/createEditorContext.d.ts} +0 -0
- /package/lib/{utils → coreApi/createEditorContext}/getRootComputedStyleForContext.d.ts +0 -0
- /package/lib/{utils → coreApi/createEditorContext}/getRootComputedStyleForContext.js +0 -0
- /package/lib/coreApi/{focus.d.ts → focus/focus.d.ts} +0 -0
- /package/lib/coreApi/{focus.js → focus/focus.js} +0 -0
- /package/lib/coreApi/{formatContentModel.d.ts → formatContentModel/formatContentModel.d.ts} +0 -0
- /package/lib/coreApi/{getDOMSelection.d.ts → getDOMSelection/getDOMSelection.d.ts} +0 -0
- /package/lib/coreApi/{getVisibleViewport.d.ts → getVisibleViewport/getVisibleViewport.d.ts} +0 -0
- /package/lib/coreApi/{getVisibleViewport.js → getVisibleViewport/getVisibleViewport.js} +0 -0
- /package/lib/{utils → coreApi/restoreUndoSnapshot}/restoreSnapshotColors.d.ts +0 -0
- /package/lib/{utils → coreApi/restoreUndoSnapshot}/restoreSnapshotHTML.d.ts +0 -0
- /package/lib/{utils → coreApi/restoreUndoSnapshot}/restoreSnapshotHTML.js +0 -0
- /package/lib/{utils → coreApi/restoreUndoSnapshot}/restoreSnapshotSelection.d.ts +0 -0
- /package/lib/coreApi/{restoreUndoSnapshot.d.ts → restoreUndoSnapshot/restoreUndoSnapshot.d.ts} +0 -0
- /package/lib/coreApi/{setContentModel.d.ts → setContentModel/setContentModel.d.ts} +0 -0
- /package/lib/{corePlugin/utils → coreApi/setDOMSelection}/addRangeToSelection.d.ts +0 -0
- /package/lib/{corePlugin/utils → coreApi/setDOMSelection}/addRangeToSelection.js +0 -0
- /package/lib/coreApi/{setDOMSelection.d.ts → setDOMSelection/setDOMSelection.d.ts} +0 -0
- /package/lib/coreApi/{switchShadowEdit.d.ts → switchShadowEdit/switchShadowEdit.d.ts} +0 -0
- /package/lib/coreApi/{triggerEvent.d.ts → triggerEvent/triggerEvent.d.ts} +0 -0
- /package/lib/coreApi/{triggerEvent.js → triggerEvent/triggerEvent.js} +0 -0
- /package/lib/corePlugin/{CachePlugin.d.ts → cache/CachePlugin.d.ts} +0 -0
- /package/lib/corePlugin/{utils → cache}/domIndexerImpl.d.ts +0 -0
- /package/lib/corePlugin/{utils → cache}/textMutationObserver.d.ts +0 -0
- /package/lib/corePlugin/{utils → cache}/textMutationObserver.js +0 -0
- /package/lib/corePlugin/{ContextMenuPlugin.d.ts → contextMenu/ContextMenuPlugin.d.ts} +0 -0
- /package/lib/corePlugin/{CopyPastePlugin.d.ts → copyPaste/CopyPastePlugin.d.ts} +0 -0
- /package/lib/corePlugin/{utils → copyPaste}/deleteEmptyList.d.ts +0 -0
- /package/lib/corePlugin/{DOMEventPlugin.d.ts → domEvent/DOMEventPlugin.d.ts} +0 -0
- /package/lib/corePlugin/{EntityPlugin.d.ts → entity/EntityPlugin.d.ts} +0 -0
- /package/lib/corePlugin/{utils → entity}/entityDelimiterUtils.d.ts +0 -0
- /package/lib/corePlugin/{utils → entity}/findAllEntities.d.ts +0 -0
- /package/lib/corePlugin/{utils → entity}/findAllEntities.js +0 -0
- /package/lib/corePlugin/{FormatPlugin.d.ts → format/FormatPlugin.d.ts} +0 -0
- /package/lib/corePlugin/{utils → format}/applyDefaultFormat.d.ts +0 -0
- /package/lib/corePlugin/{utils → format}/applyPendingFormat.d.ts +0 -0
- /package/lib/corePlugin/{LifecyclePlugin.d.ts → lifecycle/LifecyclePlugin.d.ts} +0 -0
- /package/lib/corePlugin/{SelectionPlugin.d.ts → selection/SelectionPlugin.d.ts} +0 -0
- /package/lib/{editor → corePlugin/undo}/SnapshotsManagerImpl.d.ts +0 -0
- /package/lib/{editor → corePlugin/undo}/SnapshotsManagerImpl.js +0 -0
- /package/lib/corePlugin/{UndoPlugin.d.ts → undo/UndoPlugin.d.ts} +0 -0
- /package/lib/editor/{DOMHelperImpl.d.ts → core/DOMHelperImpl.d.ts} +0 -0
- /package/lib/editor/{DOMHelperImpl.js → core/DOMHelperImpl.js} +0 -0
- /package/lib/editor/{DarkColorHandlerImpl.d.ts → core/DarkColorHandlerImpl.d.ts} +0 -0
- /package/lib/editor/{DarkColorHandlerImpl.js → core/DarkColorHandlerImpl.js} +0 -0
- /package/lib/editor/{createEditorCore.d.ts → core/createEditorCore.d.ts} +0 -0
- /package/lib/editor/{createEditorDefaultSettings.d.ts → core/createEditorDefaultSettings.d.ts} +0 -0
- /package/lib-amd/{utils → command/createModelFromHtml}/convertInlineCss.d.ts +0 -0
- /package/lib-amd/{utils → command/createModelFromHtml}/sanitizeElement.d.ts +0 -0
- /package/lib-amd/{utils → command/createModelFromHtml}/sanitizeElement.js +0 -0
- /package/lib-amd/{publicApi/model → command/exportContent}/exportContent.d.ts +0 -0
- /package/lib-amd/{publicApi/model → command/exportContent}/exportContent.js +0 -0
- /package/lib-amd/{utils → command}/paste/createPasteFragment.d.ts +0 -0
- /package/lib-amd/{utils → command}/paste/createPasteFragment.js +0 -0
- /package/lib-amd/{utils → command}/paste/generatePasteOptionFromPlugins.d.ts +0 -0
- /package/lib-amd/{utils → command}/paste/generatePasteOptionFromPlugins.js +0 -0
- /package/lib-amd/{publicApi → command}/paste/paste.d.ts +0 -0
- /package/lib-amd/{publicApi/undo → command/redo}/redo.d.ts +0 -0
- /package/lib-amd/{publicApi/undo → command/redo}/redo.js +0 -0
- /package/lib-amd/{publicApi → command}/undo/undo.d.ts +0 -0
- /package/lib-amd/{publicApi → command}/undo/undo.js +0 -0
- /package/lib-amd/coreApi/{addUndoSnapshot.d.ts → addUndoSnapshot/addUndoSnapshot.d.ts} +0 -0
- /package/lib-amd/coreApi/{attachDomEvent.d.ts → attachDomEvent/attachDomEvent.d.ts} +0 -0
- /package/lib-amd/coreApi/{attachDomEvent.js → attachDomEvent/attachDomEvent.js} +0 -0
- /package/lib-amd/{editor → coreApi}/coreApiMap.d.ts +0 -0
- /package/lib-amd/coreApi/{createContentModel.d.ts → createContentModel/createContentModel.d.ts} +0 -0
- /package/lib-amd/coreApi/{createEditorContext.d.ts → createEditorContext/createEditorContext.d.ts} +0 -0
- /package/lib-amd/{utils → coreApi/createEditorContext}/getRootComputedStyleForContext.d.ts +0 -0
- /package/lib-amd/{utils → coreApi/createEditorContext}/getRootComputedStyleForContext.js +0 -0
- /package/lib-amd/coreApi/{focus.d.ts → focus/focus.d.ts} +0 -0
- /package/lib-amd/coreApi/{focus.js → focus/focus.js} +0 -0
- /package/lib-amd/coreApi/{formatContentModel.d.ts → formatContentModel/formatContentModel.d.ts} +0 -0
- /package/lib-amd/coreApi/{getDOMSelection.d.ts → getDOMSelection/getDOMSelection.d.ts} +0 -0
- /package/lib-amd/coreApi/{getVisibleViewport.d.ts → getVisibleViewport/getVisibleViewport.d.ts} +0 -0
- /package/lib-amd/coreApi/{getVisibleViewport.js → getVisibleViewport/getVisibleViewport.js} +0 -0
- /package/lib-amd/{utils → coreApi/restoreUndoSnapshot}/restoreSnapshotColors.d.ts +0 -0
- /package/lib-amd/{utils → coreApi/restoreUndoSnapshot}/restoreSnapshotHTML.d.ts +0 -0
- /package/lib-amd/{utils → coreApi/restoreUndoSnapshot}/restoreSnapshotHTML.js +0 -0
- /package/lib-amd/{utils → coreApi/restoreUndoSnapshot}/restoreSnapshotSelection.d.ts +0 -0
- /package/lib-amd/coreApi/{restoreUndoSnapshot.d.ts → restoreUndoSnapshot/restoreUndoSnapshot.d.ts} +0 -0
- /package/lib-amd/coreApi/{setContentModel.d.ts → setContentModel/setContentModel.d.ts} +0 -0
- /package/lib-amd/{corePlugin/utils → coreApi/setDOMSelection}/addRangeToSelection.d.ts +0 -0
- /package/lib-amd/{corePlugin/utils → coreApi/setDOMSelection}/addRangeToSelection.js +0 -0
- /package/lib-amd/coreApi/{setDOMSelection.d.ts → setDOMSelection/setDOMSelection.d.ts} +0 -0
- /package/lib-amd/coreApi/{switchShadowEdit.d.ts → switchShadowEdit/switchShadowEdit.d.ts} +0 -0
- /package/lib-amd/coreApi/{triggerEvent.d.ts → triggerEvent/triggerEvent.d.ts} +0 -0
- /package/lib-amd/coreApi/{triggerEvent.js → triggerEvent/triggerEvent.js} +0 -0
- /package/lib-amd/corePlugin/{CachePlugin.d.ts → cache/CachePlugin.d.ts} +0 -0
- /package/lib-amd/corePlugin/{utils → cache}/domIndexerImpl.d.ts +0 -0
- /package/lib-amd/corePlugin/{utils → cache}/textMutationObserver.d.ts +0 -0
- /package/lib-amd/corePlugin/{utils → cache}/textMutationObserver.js +0 -0
- /package/lib-amd/corePlugin/{ContextMenuPlugin.d.ts → contextMenu/ContextMenuPlugin.d.ts} +0 -0
- /package/lib-amd/corePlugin/{CopyPastePlugin.d.ts → copyPaste/CopyPastePlugin.d.ts} +0 -0
- /package/lib-amd/corePlugin/{utils → copyPaste}/deleteEmptyList.d.ts +0 -0
- /package/lib-amd/corePlugin/{DOMEventPlugin.d.ts → domEvent/DOMEventPlugin.d.ts} +0 -0
- /package/lib-amd/corePlugin/{EntityPlugin.d.ts → entity/EntityPlugin.d.ts} +0 -0
- /package/lib-amd/corePlugin/{utils → entity}/entityDelimiterUtils.d.ts +0 -0
- /package/lib-amd/corePlugin/{utils → entity}/findAllEntities.d.ts +0 -0
- /package/lib-amd/corePlugin/{utils → entity}/findAllEntities.js +0 -0
- /package/lib-amd/corePlugin/{FormatPlugin.d.ts → format/FormatPlugin.d.ts} +0 -0
- /package/lib-amd/corePlugin/{utils → format}/applyDefaultFormat.d.ts +0 -0
- /package/lib-amd/corePlugin/{utils → format}/applyPendingFormat.d.ts +0 -0
- /package/lib-amd/corePlugin/{LifecyclePlugin.d.ts → lifecycle/LifecyclePlugin.d.ts} +0 -0
- /package/lib-amd/corePlugin/{SelectionPlugin.d.ts → selection/SelectionPlugin.d.ts} +0 -0
- /package/lib-amd/{editor → corePlugin/undo}/SnapshotsManagerImpl.d.ts +0 -0
- /package/lib-amd/{editor → corePlugin/undo}/SnapshotsManagerImpl.js +0 -0
- /package/lib-amd/corePlugin/{UndoPlugin.d.ts → undo/UndoPlugin.d.ts} +0 -0
- /package/lib-amd/editor/{DOMHelperImpl.d.ts → core/DOMHelperImpl.d.ts} +0 -0
- /package/lib-amd/editor/{DOMHelperImpl.js → core/DOMHelperImpl.js} +0 -0
- /package/lib-amd/editor/{DarkColorHandlerImpl.d.ts → core/DarkColorHandlerImpl.d.ts} +0 -0
- /package/lib-amd/editor/{DarkColorHandlerImpl.js → core/DarkColorHandlerImpl.js} +0 -0
- /package/lib-amd/editor/{createEditorCore.d.ts → core/createEditorCore.d.ts} +0 -0
- /package/lib-amd/editor/{createEditorDefaultSettings.d.ts → core/createEditorDefaultSettings.d.ts} +0 -0
- /package/lib-mjs/{utils → command/createModelFromHtml}/convertInlineCss.d.ts +0 -0
- /package/lib-mjs/{utils → command/createModelFromHtml}/sanitizeElement.d.ts +0 -0
- /package/lib-mjs/{utils → command/createModelFromHtml}/sanitizeElement.js +0 -0
- /package/lib-mjs/{publicApi/model → command/exportContent}/exportContent.d.ts +0 -0
- /package/lib-mjs/{publicApi/model → command/exportContent}/exportContent.js +0 -0
- /package/lib-mjs/{utils → command}/paste/createPasteFragment.d.ts +0 -0
- /package/lib-mjs/{utils → command}/paste/createPasteFragment.js +0 -0
- /package/lib-mjs/{utils → command}/paste/generatePasteOptionFromPlugins.d.ts +0 -0
- /package/lib-mjs/{utils → command}/paste/generatePasteOptionFromPlugins.js +0 -0
- /package/lib-mjs/{publicApi → command}/paste/paste.d.ts +0 -0
- /package/lib-mjs/{publicApi/undo → command/redo}/redo.d.ts +0 -0
- /package/lib-mjs/{publicApi/undo → command/redo}/redo.js +0 -0
- /package/lib-mjs/{publicApi → command}/undo/undo.d.ts +0 -0
- /package/lib-mjs/{publicApi → command}/undo/undo.js +0 -0
- /package/lib-mjs/coreApi/{addUndoSnapshot.d.ts → addUndoSnapshot/addUndoSnapshot.d.ts} +0 -0
- /package/lib-mjs/coreApi/{attachDomEvent.d.ts → attachDomEvent/attachDomEvent.d.ts} +0 -0
- /package/lib-mjs/coreApi/{attachDomEvent.js → attachDomEvent/attachDomEvent.js} +0 -0
- /package/lib-mjs/{editor → coreApi}/coreApiMap.d.ts +0 -0
- /package/lib-mjs/coreApi/{createContentModel.d.ts → createContentModel/createContentModel.d.ts} +0 -0
- /package/lib-mjs/coreApi/{createEditorContext.d.ts → createEditorContext/createEditorContext.d.ts} +0 -0
- /package/lib-mjs/{utils → coreApi/createEditorContext}/getRootComputedStyleForContext.d.ts +0 -0
- /package/lib-mjs/{utils → coreApi/createEditorContext}/getRootComputedStyleForContext.js +0 -0
- /package/lib-mjs/coreApi/{focus.d.ts → focus/focus.d.ts} +0 -0
- /package/lib-mjs/coreApi/{focus.js → focus/focus.js} +0 -0
- /package/lib-mjs/coreApi/{formatContentModel.d.ts → formatContentModel/formatContentModel.d.ts} +0 -0
- /package/lib-mjs/coreApi/{getDOMSelection.d.ts → getDOMSelection/getDOMSelection.d.ts} +0 -0
- /package/lib-mjs/coreApi/{getVisibleViewport.d.ts → getVisibleViewport/getVisibleViewport.d.ts} +0 -0
- /package/lib-mjs/coreApi/{getVisibleViewport.js → getVisibleViewport/getVisibleViewport.js} +0 -0
- /package/lib-mjs/{utils → coreApi/restoreUndoSnapshot}/restoreSnapshotColors.d.ts +0 -0
- /package/lib-mjs/{utils → coreApi/restoreUndoSnapshot}/restoreSnapshotHTML.d.ts +0 -0
- /package/lib-mjs/{utils → coreApi/restoreUndoSnapshot}/restoreSnapshotHTML.js +0 -0
- /package/lib-mjs/{utils → coreApi/restoreUndoSnapshot}/restoreSnapshotSelection.d.ts +0 -0
- /package/lib-mjs/coreApi/{restoreUndoSnapshot.d.ts → restoreUndoSnapshot/restoreUndoSnapshot.d.ts} +0 -0
- /package/lib-mjs/coreApi/{setContentModel.d.ts → setContentModel/setContentModel.d.ts} +0 -0
- /package/lib-mjs/{corePlugin/utils → coreApi/setDOMSelection}/addRangeToSelection.d.ts +0 -0
- /package/lib-mjs/{corePlugin/utils → coreApi/setDOMSelection}/addRangeToSelection.js +0 -0
- /package/lib-mjs/coreApi/{setDOMSelection.d.ts → setDOMSelection/setDOMSelection.d.ts} +0 -0
- /package/lib-mjs/coreApi/{switchShadowEdit.d.ts → switchShadowEdit/switchShadowEdit.d.ts} +0 -0
- /package/lib-mjs/coreApi/{triggerEvent.d.ts → triggerEvent/triggerEvent.d.ts} +0 -0
- /package/lib-mjs/coreApi/{triggerEvent.js → triggerEvent/triggerEvent.js} +0 -0
- /package/lib-mjs/corePlugin/{CachePlugin.d.ts → cache/CachePlugin.d.ts} +0 -0
- /package/lib-mjs/corePlugin/{utils → cache}/domIndexerImpl.d.ts +0 -0
- /package/lib-mjs/corePlugin/{utils → cache}/textMutationObserver.d.ts +0 -0
- /package/lib-mjs/corePlugin/{utils → cache}/textMutationObserver.js +0 -0
- /package/lib-mjs/corePlugin/{ContextMenuPlugin.d.ts → contextMenu/ContextMenuPlugin.d.ts} +0 -0
- /package/lib-mjs/corePlugin/{CopyPastePlugin.d.ts → copyPaste/CopyPastePlugin.d.ts} +0 -0
- /package/lib-mjs/corePlugin/{utils → copyPaste}/deleteEmptyList.d.ts +0 -0
- /package/lib-mjs/corePlugin/{DOMEventPlugin.d.ts → domEvent/DOMEventPlugin.d.ts} +0 -0
- /package/lib-mjs/corePlugin/{EntityPlugin.d.ts → entity/EntityPlugin.d.ts} +0 -0
- /package/lib-mjs/corePlugin/{utils → entity}/entityDelimiterUtils.d.ts +0 -0
- /package/lib-mjs/corePlugin/{utils → entity}/findAllEntities.d.ts +0 -0
- /package/lib-mjs/corePlugin/{utils → entity}/findAllEntities.js +0 -0
- /package/lib-mjs/corePlugin/{FormatPlugin.d.ts → format/FormatPlugin.d.ts} +0 -0
- /package/lib-mjs/corePlugin/{utils → format}/applyDefaultFormat.d.ts +0 -0
- /package/lib-mjs/corePlugin/{utils → format}/applyPendingFormat.d.ts +0 -0
- /package/lib-mjs/corePlugin/{LifecyclePlugin.d.ts → lifecycle/LifecyclePlugin.d.ts} +0 -0
- /package/lib-mjs/corePlugin/{SelectionPlugin.d.ts → selection/SelectionPlugin.d.ts} +0 -0
- /package/lib-mjs/{editor → corePlugin/undo}/SnapshotsManagerImpl.d.ts +0 -0
- /package/lib-mjs/{editor → corePlugin/undo}/SnapshotsManagerImpl.js +0 -0
- /package/lib-mjs/corePlugin/{UndoPlugin.d.ts → undo/UndoPlugin.d.ts} +0 -0
- /package/lib-mjs/editor/{DOMHelperImpl.d.ts → core/DOMHelperImpl.d.ts} +0 -0
- /package/lib-mjs/editor/{DOMHelperImpl.js → core/DOMHelperImpl.js} +0 -0
- /package/lib-mjs/editor/{DarkColorHandlerImpl.d.ts → core/DarkColorHandlerImpl.d.ts} +0 -0
- /package/lib-mjs/editor/{DarkColorHandlerImpl.js → core/DarkColorHandlerImpl.js} +0 -0
- /package/lib-mjs/editor/{createEditorCore.d.ts → core/createEditorCore.d.ts} +0 -0
- /package/lib-mjs/editor/{createEditorDefaultSettings.d.ts → core/createEditorDefaultSettings.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -6,13 +6,17 @@ Rooster is a framework-independent JavaScript rich-text editor neatly nested
|
|
|
6
6
|
inside one HTML `<div>` element. Editing operations performed by end users are
|
|
7
7
|
handled in simple ways to generate the final HTML.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Rooster is working on top of a middle layer data structure called "Content Model".
|
|
10
|
+
All format API and editing operation are using this Content Model layer as content format,
|
|
11
|
+
and finally convert to HTML and show it in editor.
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
To view the demo site, please click the link below:
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
[RoosterJs Demo Site](https://microsoft.github.io/roosterjs/index.html).
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
## Upgrade from RoosterJs 8.\*
|
|
18
|
+
|
|
19
|
+
Please see [here](https://github.com/microsoft/roosterjs/wiki/RoosterJs-9).
|
|
16
20
|
|
|
17
21
|
## Features
|
|
18
22
|
|
|
@@ -25,24 +29,22 @@ Rooster contains 6 basic packages.
|
|
|
25
29
|
`createEditor()` function in roosterjs to create an editor with default
|
|
26
30
|
configurations.
|
|
27
31
|
|
|
28
|
-
2. [roosterjs-
|
|
29
|
-
Defines the core editor and plugin infrastructure. Use `roosterjs-
|
|
32
|
+
2. [roosterjs-content-model-core](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_content_model_core.html):
|
|
33
|
+
Defines the core editor and plugin infrastructure. Use `roosterjs-content-model-core`
|
|
30
34
|
instead of `roosterjs` to build and customize your own editor.
|
|
31
35
|
|
|
32
|
-
3. [roosterjs-
|
|
36
|
+
3. [roosterjs-content-model-api](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_content_model_api.html):
|
|
33
37
|
Defines APIs for editor operations. Use these APIs to modify content and
|
|
34
|
-
formatting in the editor you built using `roosterjs-
|
|
38
|
+
formatting in the editor you built using `roosterjs-content-model-core`.
|
|
35
39
|
|
|
36
|
-
4. [roosterjs-
|
|
37
|
-
Defines APIs for DOM operations.
|
|
38
|
-
you want to access DOM API directly.
|
|
40
|
+
4. [roosterjs-content-model-dom](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_content_model_dom.html):
|
|
41
|
+
Defines APIs for Content Model and DOM operations. This package do conversion between DOM tree and roosterjs Content Model.
|
|
39
42
|
|
|
40
|
-
5. [roosterjs-
|
|
41
|
-
Defines basic plugins for common features.
|
|
42
|
-
pasting HTML content, inserting inline images.
|
|
43
|
+
5. [roosterjs-content-model-plugins](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_content_model_plugins.html):
|
|
44
|
+
Defines basic plugins for common features.
|
|
43
45
|
|
|
44
|
-
6. [roosterjs-
|
|
45
|
-
Defines public interfaces and enumerations.
|
|
46
|
+
6. [roosterjs-content-model-types](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_content_model_types.html):
|
|
47
|
+
Defines public interfaces and enumerations, including Content Model types, API parameters and other types.
|
|
46
48
|
|
|
47
49
|
There are also some extension packages to provide additional functionalities.
|
|
48
50
|
|
|
@@ -52,30 +54,38 @@ There are also some extension packages to provide additional functionalities.
|
|
|
52
54
|
2. [roosterjs-react](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_react.html):
|
|
53
55
|
Provide a React wrapper of roosterjs so it can be easily used with React.
|
|
54
56
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
To be compatible with old (8.\*) versions, you can use `EditorAdapter` class from the following package which can act as a 8.\* Editor:
|
|
58
|
+
|
|
59
|
+
1. [roosterjs-editor-adapter](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_editor_adapter.html):
|
|
60
|
+
Provide a adapter class `EditorAdapter` to work with Editor (9.\*) and legacy plugins (via [EditorAdapterOptions.legacyPlugins](https://microsoft.github.io/roosterjs/docs/interfaces/roosterjs_editor_adapter.editoradapteroptions.html#legacyplugins))
|
|
61
|
+
|
|
62
|
+
And the following packages are for old (8.\*) compatibility:
|
|
63
|
+
|
|
64
|
+
1. [roosterjs-editor-core](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_editor_core.html):
|
|
65
|
+
2. [roosterjs-editor-api](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_editor_api.html):
|
|
66
|
+
3. [roosterjs-editor-dom](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_editor_dom.html):
|
|
67
|
+
4. [roosterjs-editor-plugins](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_editor_plugins.html):
|
|
68
|
+
5. [roosterjs-editor-types](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_editor_types.html):
|
|
69
|
+
6. [roosterjs-editor-types-compatible](https://microsoft.github.io/roosterjs/docs/modules/roosterjs_editor_types_compatible.html):
|
|
59
70
|
|
|
60
71
|
### APIs
|
|
61
72
|
|
|
62
|
-
Rooster provides
|
|
63
|
-
(in `roosterjs-
|
|
73
|
+
Rooster provides Content Model level APIs (in `roosterjs-content-model-dom`), core APIs (in `roosterjs-content-model-core`), and formatting APIs
|
|
74
|
+
(in `roosterjs-content-modelapi`) to perform editing operations.
|
|
64
75
|
|
|
65
|
-
`roosterjs-
|
|
76
|
+
`roosterjs-content-model-dom` provides several levels of Content Model operations:
|
|
66
77
|
|
|
67
|
-
-
|
|
68
|
-
-
|
|
69
|
-
|
|
70
|
-
-
|
|
71
|
-
-
|
|
72
|
-
ContentTraverser API.
|
|
78
|
+
- Create Content Model elements
|
|
79
|
+
- Convert DOM tree to Content Model
|
|
80
|
+
- Convert Content Model to DOM tree
|
|
81
|
+
- Format handlers
|
|
82
|
+
- A few DOM level API
|
|
73
83
|
|
|
74
|
-
`roosterjs-
|
|
75
|
-
APIs to perform basic editor operations. These APIs
|
|
84
|
+
`roosterjs-content-model-core` provides APIs for editor core. Editor class will call such
|
|
85
|
+
APIs to perform basic editor operations. These APIs can be overridden by specifying
|
|
76
86
|
API overrides in Editor options when creating the editor.
|
|
77
87
|
|
|
78
|
-
`roosterjs-
|
|
88
|
+
`roosterjs-content-model-api` provides APIs for scenario-based operations triggered by
|
|
79
89
|
user interaction.
|
|
80
90
|
|
|
81
91
|
## Plugins
|
|
@@ -99,7 +109,7 @@ class HelloRooster implements EditorPlugin {
|
|
|
99
109
|
dispose() {}
|
|
100
110
|
|
|
101
111
|
onPluginEvent(e: PluginEvent) {
|
|
102
|
-
if (e.eventType ==
|
|
112
|
+
if (e.eventType == 'input' && e.rawEvent.which == 65) {
|
|
103
113
|
alert('Hello Rooster');
|
|
104
114
|
}
|
|
105
115
|
}
|
|
@@ -114,9 +124,9 @@ Install via NPM or Yarn:
|
|
|
114
124
|
|
|
115
125
|
You can also install sub packages separately:
|
|
116
126
|
|
|
117
|
-
`yarn add roosterjs-
|
|
127
|
+
`yarn add roosterjs-content-model-core`
|
|
118
128
|
|
|
119
|
-
`yarn add roosterjs-
|
|
129
|
+
`yarn add roosterjs-content-model-api`
|
|
120
130
|
|
|
121
131
|
`...`
|
|
122
132
|
|
|
@@ -161,9 +171,9 @@ In order to run the code below, you may also need to install [webpack](https://w
|
|
|
161
171
|
|
|
162
172
|
## Sample code
|
|
163
173
|
|
|
164
|
-
To view the
|
|
174
|
+
To view the demo site, please click [here](https://microsoft.github.io/roosterjs/index.html).
|
|
165
175
|
|
|
166
|
-
To build the
|
|
176
|
+
To build the demo site code yourself, follow these instructions:
|
|
167
177
|
|
|
168
178
|
1. Get dependencies using [yarn](https://yarnpkg.com) or [npm](https://www.npmjs.com/):
|
|
169
179
|
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.convertInlineCss = exports.retrieveCssRules = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var roosterjs_content_model_dom_1 = require("roosterjs-content-model-dom");
|
|
6
|
+
/**
|
|
7
|
+
* @internal
|
|
8
|
+
*
|
|
9
|
+
* Splits CSS selectors, avoiding splits within parentheses
|
|
10
|
+
* @param selectorText The CSS selector string
|
|
11
|
+
* @return Array of trimmed selectors
|
|
12
|
+
*/
|
|
13
|
+
function splitSelectors(selectorText) {
|
|
14
|
+
var regex = /(?![^(]*\)),/;
|
|
15
|
+
return selectorText.split(regex).map(function (s) { return s.trim(); });
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
function retrieveCssRules(doc) {
|
|
21
|
+
var styles = (0, roosterjs_content_model_dom_1.toArray)(doc.querySelectorAll('style'));
|
|
22
|
+
var result = [];
|
|
23
|
+
styles.forEach(function (styleNode) {
|
|
24
|
+
var _a;
|
|
25
|
+
var sheet = styleNode.sheet;
|
|
26
|
+
for (var ruleIndex = 0; ruleIndex < sheet.cssRules.length; ruleIndex++) {
|
|
27
|
+
var rule = sheet.cssRules[ruleIndex];
|
|
28
|
+
if (rule.type == CSSRule.STYLE_RULE && rule.selectorText) {
|
|
29
|
+
result.push({
|
|
30
|
+
selectors: splitSelectors(rule.selectorText),
|
|
31
|
+
text: rule.style.cssText,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
(_a = styleNode.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(styleNode);
|
|
36
|
+
});
|
|
37
|
+
return result;
|
|
38
|
+
}
|
|
39
|
+
exports.retrieveCssRules = retrieveCssRules;
|
|
40
|
+
/**
|
|
41
|
+
* @internal
|
|
42
|
+
*/
|
|
43
|
+
function convertInlineCss(root, cssRules) {
|
|
44
|
+
var _loop_1 = function (i) {
|
|
45
|
+
var e_1, _a;
|
|
46
|
+
var _b = cssRules[i], selectors = _b.selectors, text = _b.text;
|
|
47
|
+
try {
|
|
48
|
+
for (var selectors_1 = (e_1 = void 0, (0, tslib_1.__values)(selectors)), selectors_1_1 = selectors_1.next(); !selectors_1_1.done; selectors_1_1 = selectors_1.next()) {
|
|
49
|
+
var selector = selectors_1_1.value;
|
|
50
|
+
if (!selector || !selector.trim()) {
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
var nodes = (0, roosterjs_content_model_dom_1.toArray)(root.querySelectorAll(selector));
|
|
54
|
+
// Always put existing styles after so that they have higher priority
|
|
55
|
+
// Which means if both global style and inline style apply to the same element,
|
|
56
|
+
// inline style will have higher priority
|
|
57
|
+
nodes.forEach(function (node) {
|
|
58
|
+
return node.setAttribute('style', text + (node.getAttribute('style') || ''));
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
63
|
+
finally {
|
|
64
|
+
try {
|
|
65
|
+
if (selectors_1_1 && !selectors_1_1.done && (_a = selectors_1.return)) _a.call(selectors_1);
|
|
66
|
+
}
|
|
67
|
+
finally { if (e_1) throw e_1.error; }
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
for (var i = cssRules.length - 1; i >= 0; i--) {
|
|
71
|
+
_loop_1(i);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
exports.convertInlineCss = convertInlineCss;
|
|
75
|
+
//# sourceMappingURL=convertInlineCss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convertInlineCss.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-core/lib/command/createModelFromHtml/convertInlineCss.ts"],"names":[],"mappings":";;;;AAAA,2EAAsD;AAUtD;;;;;;GAMG;AACH,SAAS,cAAc,CAAC,YAAoB;IACxC,IAAM,KAAK,GAAG,cAAc,CAAC;IAC7B,OAAO,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,IAAI,EAAE,EAAR,CAAQ,CAAC,CAAC;AACxD,CAAC;AAED;;GAEG;AACH,SAAgB,gBAAgB,CAAC,GAAa;IAC1C,IAAM,MAAM,GAAG,IAAA,qCAAO,EAAC,GAAG,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC;IACtD,IAAM,MAAM,GAAc,EAAE,CAAC;IAE7B,MAAM,CAAC,OAAO,CAAC,UAAA,SAAS;;QACpB,IAAM,KAAK,GAAG,SAAS,CAAC,KAAsB,CAAC;QAE/C,KAAK,IAAI,SAAS,GAAG,CAAC,EAAE,SAAS,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,EAAE,EAAE;YACpE,IAAM,IAAI,GAAG,K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E,CAAC,EAAE;gBAApC,CAAC;KAiBT;AACL,CAAC;AAnBD,4CAmBC","sourcesContent":["import { toArray } from 'roosterjs-content-model-dom';\n\n/**\n * @internal\n */\nexport interface CssRule {\n selectors: string[];\n text: string;\n}\n\n/**\n * @internal\n *\n * Splits CSS selectors, avoiding splits within parentheses\n * @param selectorText The CSS selector string\n * @return Array of trimmed selectors\n */\nfunction splitSelectors(selectorText: string) {\n const regex = /(?![^(]*\\)),/;\n return selectorText.split(regex).map(s => s.trim());\n}\n\n/**\n * @internal\n */\nexport function retrieveCssRules(doc: Document): CssRule[] {\n const styles = toArray(doc.querySelectorAll('style'));\n const result: CssRule[] = [];\n\n styles.forEach(styleNode => {\n const sheet = styleNode.sheet as CSSStyleSheet;\n\n for (let ruleIndex = 0; ruleIndex < sheet.cssRules.length; ruleIndex++) {\n const rule = sheet.cssRules[ruleIndex] as CSSStyleRule;\n\n if (rule.type == CSSRule.STYLE_RULE && rule.selectorText) {\n result.push({\n selectors: splitSelectors(rule.selectorText),\n text: rule.style.cssText,\n });\n }\n }\n\n styleNode.parentNode?.removeChild(styleNode);\n });\n\n return result;\n}\n\n/**\n * @internal\n */\nexport function convertInlineCss(root: ParentNode, cssRules: CssRule[]) {\n for (let i = cssRules.length - 1; i >= 0; i--) {\n const { selectors, text } = cssRules[i];\n\n for (const selector of selectors) {\n if (!selector || !selector.trim()) {\n continue;\n }\n\n const nodes = toArray(root.querySelectorAll(selector));\n\n // Always put existing styles after so that they have higher priority\n // Which means if both global style and inline style apply to the same element,\n // inline style will have higher priority\n nodes.forEach(node =>\n node.setAttribute('style', text + (node.getAttribute('style') || ''))\n );\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ContentModelSegmentFormat, DomToModelContext, DomToModelOption, DomToModelOptionForSanitizing } from 'roosterjs-content-model-types';
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
export declare function createDomToModelContextForSanitizing(document: Document, defaultFormat?: ContentModelSegmentFormat, defaultOption?: DomToModelOption, additionalSanitizingOption?: Partial<DomToModelOptionForSanitizing>): DomToModelContext;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createDomToModelContextForSanitizing = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var containerSizeFormatParser_1 = require("../../override/containerSizeFormatParser");
|
|
6
|
+
var roosterjs_content_model_dom_1 = require("roosterjs-content-model-dom");
|
|
7
|
+
var pasteEntityProcessor_1 = require("../../override/pasteEntityProcessor");
|
|
8
|
+
var pasteGeneralProcessor_1 = require("../../override/pasteGeneralProcessor");
|
|
9
|
+
var getRootComputedStyleForContext_1 = require("../../coreApi/createEditorContext/getRootComputedStyleForContext");
|
|
10
|
+
var pasteCopyBlockEntityParser_1 = require("../../override/pasteCopyBlockEntityParser");
|
|
11
|
+
var pasteDisplayFormatParser_1 = require("../../override/pasteDisplayFormatParser");
|
|
12
|
+
var pasteTextProcessor_1 = require("../../override/pasteTextProcessor");
|
|
13
|
+
var DefaultSanitizingOption = {
|
|
14
|
+
processorOverride: {},
|
|
15
|
+
formatParserOverride: {},
|
|
16
|
+
additionalFormatParsers: {},
|
|
17
|
+
additionalAllowedTags: [],
|
|
18
|
+
additionalDisallowedTags: [],
|
|
19
|
+
styleSanitizers: {},
|
|
20
|
+
attributeSanitizers: {},
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
function createDomToModelContextForSanitizing(document, defaultFormat, defaultOption, additionalSanitizingOption) {
|
|
26
|
+
var sanitizingOption = (0, tslib_1.__assign)((0, tslib_1.__assign)({}, DefaultSanitizingOption), additionalSanitizingOption);
|
|
27
|
+
return (0, roosterjs_content_model_dom_1.createDomToModelContext)((0, tslib_1.__assign)({ defaultFormat: defaultFormat }, (0, getRootComputedStyleForContext_1.getRootComputedStyleForContext)(document)), defaultOption, {
|
|
28
|
+
processorOverride: {
|
|
29
|
+
'#text': pasteTextProcessor_1.pasteTextProcessor,
|
|
30
|
+
entity: (0, pasteEntityProcessor_1.createPasteEntityProcessor)(sanitizingOption),
|
|
31
|
+
'*': (0, pasteGeneralProcessor_1.createPasteGeneralProcessor)(sanitizingOption),
|
|
32
|
+
},
|
|
33
|
+
formatParserOverride: {
|
|
34
|
+
display: pasteDisplayFormatParser_1.pasteDisplayFormatParser,
|
|
35
|
+
},
|
|
36
|
+
additionalFormatParsers: {
|
|
37
|
+
container: [containerSizeFormatParser_1.containerSizeFormatParser],
|
|
38
|
+
entity: [pasteCopyBlockEntityParser_1.pasteBlockEntityParser],
|
|
39
|
+
},
|
|
40
|
+
}, sanitizingOption);
|
|
41
|
+
}
|
|
42
|
+
exports.createDomToModelContextForSanitizing = createDomToModelContextForSanitizing;
|
|
43
|
+
//# sourceMappingURL=createDomToModelContextForSanitizing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createDomToModelContextForSanitizing.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-core/lib/command/createModelFromHtml/createDomToModelContextForSanitizing.ts"],"names":[],"mappings":";;;;AAAA,sFAAqF;AACrF,2EAAsE;AACtE,4EAAiF;AACjF,8EAAmF;AACnF,mHAAkH;AAClH,wFAAmF;AACnF,oFAAmF;AACnF,wEAAuE;AAQvE,IAAM,uBAAuB,GAAkC;IAC3D,iBAAiB,EAAE,EAAE;IACrB,oBAAoB,EAAE,EAAE;IACxB,uBAAuB,EAAE,EAAE;IAC3B,qBAAqB,EAAE,EAAE;IACzB,wBAAwB,EAAE,EAAE;IAC5B,eAAe,EAAE,EAAE;IACnB,mBAAmB,EAAE,EAAE;CAC1B,CAAC;AAEF;;GAEG;AACH,SAAgB,oCAAoC,CAChD,QAAkB,EAClB,aAAyC,EACzC,aAAgC,EAChC,0BAAmE;IAEnE,IAAM,gBAAgB,mDACf,uBAAuB,GACvB,0BAA0B,CAChC,CAAC;IAEF,OAAO,IAAA,qDAAuB,0BAEtB,aAAa,eAAA,IACV,IAAA,+DAA8B,EAAC,QAAQ,CAAC,GAE/C,aAAa,EACb;QACI,iBAAiB,EAAE;YACf,OAAO,EAAE,uCAAkB;YAC3B,MAAM,EAAE,IAAA,iDAA0B,EAAC,gBAAgB,CAAC;YACpD,GAAG,EAAE,IAAA,mDAA2B,EAAC,gBAAgB,CAAC;SACrD;QACD,oBAAoB,EAAE;YAClB,OAAO,EAAE,mDAAwB;SACpC;QACD,uBAAuB,EAAE;YACrB,SAAS,EAAE,CAAC,qDAAyB,CAAC;YACtC,MAAM,EAAE,CAAC,mDAAsB,CAAC;SACnC;KACJ,EACD,gBAAgB,CACnB,CAAC;AACN,CAAC;AAjCD,oFAiCC","sourcesContent":["import { containerSizeFormatParser } from '../../override/containerSizeFormatParser';\nimport { createDomToModelContext } from 'roosterjs-content-model-dom';\nimport { createPasteEntityProcessor } from '../../override/pasteEntityProcessor';\nimport { createPasteGeneralProcessor } from '../../override/pasteGeneralProcessor';\nimport { getRootComputedStyleForContext } from '../../coreApi/createEditorContext/getRootComputedStyleForContext';\nimport { pasteBlockEntityParser } from '../../override/pasteCopyBlockEntityParser';\nimport { pasteDisplayFormatParser } from '../../override/pasteDisplayFormatParser';\nimport { pasteTextProcessor } from '../../override/pasteTextProcessor';\nimport type {\n ContentModelSegmentFormat,\n DomToModelContext,\n DomToModelOption,\n DomToModelOptionForSanitizing,\n} from 'roosterjs-content-model-types';\n\nconst DefaultSanitizingOption: DomToModelOptionForSanitizing = {\n processorOverride: {},\n formatParserOverride: {},\n additionalFormatParsers: {},\n additionalAllowedTags: [],\n additionalDisallowedTags: [],\n styleSanitizers: {},\n attributeSanitizers: {},\n};\n\n/**\n * @internal\n */\nexport function createDomToModelContextForSanitizing(\n document: Document,\n defaultFormat?: ContentModelSegmentFormat,\n defaultOption?: DomToModelOption,\n additionalSanitizingOption?: Partial<DomToModelOptionForSanitizing>\n): DomToModelContext {\n const sanitizingOption: DomToModelOptionForSanitizing = {\n ...DefaultSanitizingOption,\n ...additionalSanitizingOption,\n };\n\n return createDomToModelContext(\n {\n defaultFormat,\n ...getRootComputedStyleForContext(document),\n },\n defaultOption,\n {\n processorOverride: {\n '#text': pasteTextProcessor,\n entity: createPasteEntityProcessor(sanitizingOption),\n '*': createPasteGeneralProcessor(sanitizingOption),\n },\n formatParserOverride: {\n display: pasteDisplayFormatParser,\n },\n additionalFormatParsers: {\n container: [containerSizeFormatParser],\n entity: [pasteBlockEntityParser],\n },\n },\n sanitizingOption\n );\n}\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ContentModelDocument, ContentModelSegmentFormat, DomToModelOptionForSanitizing, TrustedHTMLHandler } from 'roosterjs-content-model-types';
|
|
2
|
+
/**
|
|
3
|
+
* Create Content Model from HTML string
|
|
4
|
+
* @param html The source HTML string
|
|
5
|
+
* @param options Options for DOM to Content Model conversion
|
|
6
|
+
* @param trustedHTMLHandler A string handler to convert string to trusted string
|
|
7
|
+
* @returns A Content Model Document object that contains the Content Model from the give HTML, or undefined if failed to parse the source HTML
|
|
8
|
+
*/
|
|
9
|
+
export declare function createModelFromHtml(html: string, options?: Partial<DomToModelOptionForSanitizing>, trustedHTMLHandler?: TrustedHTMLHandler, defaultSegmentFormat?: ContentModelSegmentFormat): ContentModelDocument;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createModelFromHtml = void 0;
|
|
4
|
+
var convertInlineCss_1 = require("./convertInlineCss");
|
|
5
|
+
var createDomToModelContextForSanitizing_1 = require("./createDomToModelContextForSanitizing");
|
|
6
|
+
var roosterjs_content_model_dom_1 = require("roosterjs-content-model-dom");
|
|
7
|
+
/**
|
|
8
|
+
* Create Content Model from HTML string
|
|
9
|
+
* @param html The source HTML string
|
|
10
|
+
* @param options Options for DOM to Content Model conversion
|
|
11
|
+
* @param trustedHTMLHandler A string handler to convert string to trusted string
|
|
12
|
+
* @returns A Content Model Document object that contains the Content Model from the give HTML, or undefined if failed to parse the source HTML
|
|
13
|
+
*/
|
|
14
|
+
function createModelFromHtml(html, options, trustedHTMLHandler, defaultSegmentFormat) {
|
|
15
|
+
var _a;
|
|
16
|
+
var doc = html
|
|
17
|
+
? new DOMParser().parseFromString((_a = trustedHTMLHandler === null || trustedHTMLHandler === void 0 ? void 0 : trustedHTMLHandler(html)) !== null && _a !== void 0 ? _a : html, 'text/html')
|
|
18
|
+
: null;
|
|
19
|
+
if (doc === null || doc === void 0 ? void 0 : doc.body) {
|
|
20
|
+
var context = (0, createDomToModelContextForSanitizing_1.createDomToModelContextForSanitizing)(doc, defaultSegmentFormat, undefined /*defaultOptions*/, options);
|
|
21
|
+
var cssRules = doc ? (0, convertInlineCss_1.retrieveCssRules)(doc) : [];
|
|
22
|
+
(0, convertInlineCss_1.convertInlineCss)(doc, cssRules);
|
|
23
|
+
(0, roosterjs_content_model_dom_1.parseFormat)(doc.body, context.formatParsers.segmentOnBlock, context.segmentFormat, context);
|
|
24
|
+
return (0, roosterjs_content_model_dom_1.domToContentModel)(doc.body, context);
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
return (0, roosterjs_content_model_dom_1.createEmptyModel)(defaultSegmentFormat);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.createModelFromHtml = createModelFromHtml;
|
|
31
|
+
//# sourceMappingURL=createModelFromHtml.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createModelFromHtml.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-core/lib/command/createModelFromHtml/createModelFromHtml.ts"],"names":[],"mappings":";;;AAAA,uDAAwE;AACxE,+FAA8F;AAC9F,2EAA+F;AAQ/F;;;;;;GAMG;AACH,SAAgB,mBAAmB,CAC/B,IAAY,EACZ,OAAgD,EAChD,kBAAuC,EACvC,oBAAgD;;IAEhD,IAAM,GAAG,GAAG,IAAI;QACZ,CAAC,CAAC,IAAI,SAAS,EAAE,CAAC,eAAe,CAAC,MAAA,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAG,IAAI,CAAC,mCAAI,IAAI,EAAE,WAAW,CAAC;QAClF,CAAC,CAAC,IAAI,CAAC;IAEX,IAAI,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,IAAI,EAAE;QACX,IAAM,OAAO,GAAG,IAAA,2EAAoC,EAChD,GAAG,EACH,oBAAoB,EACpB,SAAS,CAAC,kBAAkB,EAC5B,OAAO,CACV,CAAC;QACF,IAAM,QAAQ,GAAG,GAAG,CAAC,CAAC,CAAC,IAAA,mCAAgB,EAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAElD,IAAA,mCAAgB,EAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QAChC,IAAA,yCAAW,EAAC,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,aAAa,CAAC,cAAc,EAAE,OAAO,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;QAE5F,OAAO,IAAA,+CAAiB,EAAC,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;KAC/C;SAAM;QACH,OAAO,IAAA,8CAAgB,EAAC,oBAAoB,CAAC,CAAC;KACjD;AACL,CAAC;AA1BD,kDA0BC","sourcesContent":["import { convertInlineCss, retrieveCssRules } from './convertInlineCss';\nimport { createDomToModelContextForSanitizing } from './createDomToModelContextForSanitizing';\nimport { createEmptyModel, domToContentModel, parseFormat } from 'roosterjs-content-model-dom';\nimport type {\n ContentModelDocument,\n ContentModelSegmentFormat,\n DomToModelOptionForSanitizing,\n TrustedHTMLHandler,\n} from 'roosterjs-content-model-types';\n\n/**\n * Create Content Model from HTML string\n * @param html The source HTML string\n * @param options Options for DOM to Content Model conversion\n * @param trustedHTMLHandler A string handler to convert string to trusted string\n * @returns A Content Model Document object that contains the Content Model from the give HTML, or undefined if failed to parse the source HTML\n */\nexport function createModelFromHtml(\n html: string,\n options?: Partial<DomToModelOptionForSanitizing>,\n trustedHTMLHandler?: TrustedHTMLHandler,\n defaultSegmentFormat?: ContentModelSegmentFormat\n): ContentModelDocument {\n const doc = html\n ? new DOMParser().parseFromString(trustedHTMLHandler?.(html) ?? html, 'text/html')\n : null;\n\n if (doc?.body) {\n const context = createDomToModelContextForSanitizing(\n doc,\n defaultSegmentFormat,\n undefined /*defaultOptions*/,\n options\n );\n const cssRules = doc ? retrieveCssRules(doc) : [];\n\n convertInlineCss(doc, cssRules);\n parseFormat(doc.body, context.formatParsers.segmentOnBlock, context.segmentFormat, context);\n\n return domToContentModel(doc.body, context);\n } else {\n return createEmptyModel(defaultSegmentFormat);\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sanitizeElement.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-core/lib/command/createModelFromHtml/sanitizeElement.ts"],"names":[],"mappings":";;;AAAA,2EAA2D;AAG3D;;GAEG;AACU,QAAA,WAAW,GAA0B;IAC9C,GAAG;IACH,MAAM;IACN,SAAS;IACT,MAAM;IACN,SAAS;IACT,OAAO;IACP,GAAG;IACH,KAAK;IACL,KAAK;IACL,YAAY;IACZ,MAAM;IACN,IAAI;IACJ,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,MAAM;IACN,MAAM;IACN,KAAK;IACL,UAAU;IACV,MAAM;IACN,UAAU;IACV,IAAI;IACJ,KAAK;IACL,SAAS;IACT,KAAK;IACL,QAAQ;IACR,KAAK;IACL,KAAK;IACL,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,UAAU;IACV,YAAY;IACZ,QAAQ;IACR,MAAM;IACN,QAAQ;IACR,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,IAAI;IACJ,MAAM;I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AO,SAAS,IAAI,UAAU;gBAC1B,CAAC,CAAC,SAAS,CAAC,KAAK,EAAE,OAAO,CAAC;gBAC3B,CAAC,CAAC,SAAS,KAAK,KAAK;oBACrB,CAAC,CAAC,IAAI;oBACN,CAAC,CAAC,KAAK,CAAC;YAEhB,IACI,CAAC,CAAC,cAAc;gBAChB,cAAc,IAAI,SAAS;gBAC3B,cAAc,IAAI,SAAS;gBAC3B,cAAc,CAAC,OAAO,CAAC,YAAY,CAAC,GAAG,CAAC;gBACxC,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;gBACrB,iBAAiB,CAAC,IAAI,CAAC,IAAI,cAAc,EAC3C;gBACE,MAAM,CAAC,IAAI,CAAI,IAAI,SAAI,cAAgB,CAAC,CAAC;aAC5C;SACJ;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC5B,CAAC;AAED,SAAS,kBAAkB,CAAC,KAAa;IACrC,IAAM,KAAK,GAAG,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACzC,OAAO,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAG,CAAC,CAAC,KAAI,EAAE,CAAC,CAAC,wFAAwF;AACrH,CAAC;AAED,SAAS,aAAa,CAAC,KAAa;IAChC,OAAO,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;AAC/C,CAAC","sourcesContent":["import { isNodeOfType } from 'roosterjs-content-model-dom';\nimport type { ValueSanitizer } from 'roosterjs-content-model-types';\n\n/**\n * @internal\n */\nexport const AllowedTags: ReadonlyArray<string> = [\n 'a',\n 'abbr',\n 'address',\n 'area',\n 'article',\n 'aside',\n 'b',\n 'bdi',\n 'bdo',\n 'blockquote',\n 'body',\n 'br',\n 'button',\n 'canvas',\n 'caption',\n 'center',\n 'cite',\n 'code',\n 'col',\n 'colgroup',\n 'data',\n 'datalist',\n 'dd',\n 'del',\n 'details',\n 'dfn',\n 'dialog',\n 'dir',\n 'div',\n 'dl',\n 'dt',\n 'em',\n 'fieldset',\n 'figcaption',\n 'figure',\n 'font',\n 'footer',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'head',\n 'header',\n 'hgroup',\n 'hr',\n 'html',\n 'i',\n 'img',\n 'input',\n 'ins',\n 'kbd',\n 'label',\n 'legend',\n 'li',\n 'main',\n 'map',\n 'mark',\n 'menu',\n 'menuitem',\n 'meter',\n 'nav',\n 'ol',\n 'optgroup',\n 'option',\n 'output',\n 'p',\n 'picture',\n 'pre',\n 'progress',\n 'q',\n 'rp',\n 'rt',\n 'ruby',\n 's',\n 'samp',\n 'section',\n 'select',\n 'small',\n 'span',\n 'strike',\n 'strong',\n 'sub',\n 'summary',\n 'sup',\n 'table',\n 'tbody',\n 'td',\n 'textarea',\n 'tfoot',\n 'th',\n 'thead',\n 'time',\n 'tr',\n 'tt',\n 'u',\n 'ul',\n 'var',\n 'wbr',\n 'xmp',\n];\n\n/**\n * @internal\n */\nexport const DisallowedTags: ReadonlyArray<string> = [\n 'applet',\n 'audio',\n 'base',\n 'basefont',\n 'embed',\n 'frame',\n 'frameset',\n 'iframe',\n 'link',\n 'meta',\n 'noscript',\n 'object',\n 'param',\n 'script',\n 'slot',\n 'source',\n 'style',\n 'template',\n 'title',\n 'track',\n 'video',\n];\n\nconst VARIABLE_REGEX = /^\\s*var\\(\\s*[a-zA-Z0-9-_]+\\s*(,\\s*(.*))?\\)\\s*$/;\nconst VARIABLE_PREFIX = 'var(';\n\nconst AllowedAttributes = [\n 'accept',\n 'align',\n 'alt',\n 'checked',\n 'cite',\n 'class',\n 'color',\n 'cols',\n 'colspan',\n 'contextmenu',\n 'coords',\n 'datetime',\n 'default',\n 'dir',\n 'dirname',\n 'disabled',\n 'download',\n 'face',\n 'headers',\n 'height',\n 'hidden',\n 'high',\n 'href',\n 'hreflang',\n 'ismap',\n 'kind',\n 'label',\n 'lang',\n 'list',\n 'low',\n 'max',\n 'maxlength',\n 'media',\n 'min',\n 'multiple',\n 'open',\n 'optimum',\n 'pattern',\n 'placeholder',\n 'readonly',\n 'rel',\n 'required',\n 'reversed',\n 'rows',\n 'rowspan',\n 'scope',\n 'selected',\n 'shape',\n 'size',\n 'sizes',\n 'span',\n 'spellcheck',\n 'src',\n 'srclang',\n 'srcset',\n 'start',\n 'step',\n 'style',\n 'tabindex',\n 'target',\n 'title',\n 'translate',\n 'type',\n 'usemap',\n 'valign',\n 'value',\n 'width',\n 'wrap',\n 'bgColor',\n];\n\nconst DefaultStyleValue: { [name: string]: string } = {\n 'background-color': 'transparent',\n 'border-bottom-color': 'rgb(0, 0, 0)',\n 'border-bottom-style': 'none',\n 'border-bottom-width': '0px',\n 'border-image-outset': '0',\n 'border-image-repeat': 'stretch',\n 'border-image-slice': '100%',\n 'border-image-source': 'none',\n 'border-image-width': '1',\n 'border-left-color': 'rgb(0, 0, 0)',\n 'border-left-style': 'none',\n 'border-left-width': '0px',\n 'border-right-color': 'rgb(0, 0, 0)',\n 'border-right-style': 'none',\n 'border-right-width': '0px',\n 'border-top-color': 'rgb(0, 0, 0)',\n 'border-top-style': 'none',\n 'border-top-width': '0px',\n 'outline-color': 'transparent',\n 'outline-style': 'none',\n 'outline-width': '0px',\n overflow: 'visible',\n '-webkit-text-stroke-width': '0px',\n 'word-wrap': 'break-word',\n 'margin-left': '0px',\n 'margin-right': '0px',\n padding: '0px',\n 'padding-top': '0px',\n 'padding-left': '0px',\n 'padding-right': '0px',\n 'padding-bottom': '0px',\n border: '0px',\n 'border-top': '0px',\n 'border-left': '0px',\n 'border-right': '0px',\n 'border-bottom': '0px',\n 'vertical-align': 'baseline',\n float: 'none',\n 'font-style': 'normal',\n 'font-variant-ligatures': 'normal',\n 'font-variant-caps': 'normal',\n 'font-weight': '400',\n 'letter-spacing': 'normal',\n orphans: '2',\n 'text-align': 'start',\n 'text-indent': '0px',\n 'text-transform': 'none',\n widows: '2',\n 'word-spacing': '0px',\n 'white-space': 'normal',\n};\n\n/**\n * @internal\n */\nexport function sanitizeElement(\n element: HTMLElement,\n allowedTags: ReadonlyArray<string>,\n disallowedTags: ReadonlyArray<string>,\n styleSanitizers?: Readonly<Record<string, ValueSanitizer>>,\n attributeSanitizers?: Readonly<Record<string, ValueSanitizer>>\n): HTMLElement | null {\n const tag = element.tagName.toLowerCase();\n const sanitizedElement =\n disallowedTags.indexOf(tag) >= 0\n ? null\n : createSanitizedElement(\n element.ownerDocument,\n allowedTags.indexOf(tag) >= 0 ? tag : 'span',\n element.attributes,\n styleSanitizers,\n attributeSanitizers\n );\n\n if (sanitizedElement) {\n for (let child = element.firstChild; child; child = child.nextSibling) {\n const newChild = isNodeOfType(child, 'ELEMENT_NODE')\n ? sanitizeElement(\n child,\n allowedTags,\n disallowedTags,\n styleSanitizers,\n attributeSanitizers\n )\n : isNodeOfType(child, 'TEXT_NODE')\n ? child.cloneNode()\n : null;\n\n if (newChild) {\n sanitizedElement?.appendChild(newChild);\n }\n }\n }\n\n return sanitizedElement;\n}\n\n/**\n * @internal\n */\nexport function createSanitizedElement(\n doc: Document,\n tag: string,\n attributes: NamedNodeMap,\n styleSanitizers?: Readonly<Record<string, ValueSanitizer>>,\n attributeSanitizers?: Readonly<Record<string, ValueSanitizer>>\n): HTMLElement {\n const element = doc.createElement(tag);\n\n for (let i = 0; i < attributes.length; i++) {\n const attribute = attributes[i];\n const name = attribute.name.toLowerCase().trim();\n const value = attribute.value;\n\n const sanitizer = attributeSanitizers?.[name];\n const newValue =\n name == 'style'\n ? processStyles(tag, value, styleSanitizers)\n : typeof sanitizer == 'function'\n ? sanitizer(value, tag)\n : typeof sanitizer === 'boolean'\n ? sanitizer\n ? value\n : null\n : AllowedAttributes.indexOf(name) >= 0 || name.indexOf('data-') == 0\n ? value\n : null;\n\n if (\n newValue !== null &&\n newValue !== undefined &&\n !newValue.match(/s\\n*c\\n*r\\n*i\\n*p\\n*t\\n*:/i) // match script: with any NewLine inside. Browser will ignore those NewLine char and still treat it as script prefix\n ) {\n element.setAttribute(name, newValue);\n }\n }\n\n return element;\n}\n\nfunction processStyles(\n tagName: string,\n value: string,\n styleSanitizers?: Readonly<Record<string, ValueSanitizer>>\n) {\n const pairs = value.split(';');\n const result: string[] = [];\n\n pairs.forEach(pair => {\n const valueIndex = pair.indexOf(':');\n const name = pair.slice(0, valueIndex).trim();\n let value: string = pair.slice(valueIndex + 1).trim();\n\n if (name && value) {\n if (isCssVariable(value)) {\n value = processCssVariable(value);\n }\n\n const sanitizer = styleSanitizers?.[name];\n const sanitizedValue =\n typeof sanitizer == 'function'\n ? sanitizer(value, tagName)\n : sanitizer === false\n ? null\n : value;\n\n if (\n !!sanitizedValue &&\n sanitizedValue != 'inherit' &&\n sanitizedValue != 'initial' &&\n sanitizedValue.indexOf('expression') < 0 &&\n !name.startsWith('-') &&\n DefaultStyleValue[name] != sanitizedValue\n ) {\n result.push(`${name}:${sanitizedValue}`);\n }\n }\n });\n\n return result.join(';');\n}\n\nfunction processCssVariable(value: string): string {\n const match = VARIABLE_REGEX.exec(value);\n return match?.[2] || ''; // Without fallback value, we don't know what does the original value mean, so ignore it\n}\n\nfunction isCssVariable(value: string): boolean {\n return value.indexOf(VARIABLE_PREFIX) == 0;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exportContent.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-core/lib/command/exportContent/exportContent.ts"],"names":[],"mappings":";;;AAAA,2EAIqC;AAGrC;;;;;;;;GAQG;AACH,SAAgB,aAAa,CACzB,MAAe,EACf,IAAgC,EAChC,OAA0B;IAD1B,qBAAA,EAAA,aAAgC;IAGhC,IAAI,IAAI,IAAI,eAAe,EAAE;QACzB,OAAO,MAAM,CAAC,YAAY,EAAE,CAAC,cAAc,EAAE,CAAC;KACjD;SAAM;QACH,IAAM,KAAK,GAAG,MAAM,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;QAElD,IAAI,IAAI,IAAI,WAAW,EAAE;YACrB,OAAO,IAAA,gDAAkB,EAAC,KAAK,CAAC,CAAC;SACpC;aAAM;YACH,IAAM,GAAG,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;YACjC,IAAM,GAAG,GAAG,GAAG,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;YAErC,IAAA,+CAAiB,EACb,GAAG,EACH,GAAG,EACH,KAAK,EACL,IAAA,qDAAuB,EAAC,SAAS,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAChE,CAAC;YAEF,MAAM,CAAC,YAAY,CAAC,uBAAuB,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;YAEtF,OAAO,GAAG,CAAC,SAAS,CAAC;SACxB;KACJ;AACL,CAAC;AA5BD,sCA4BC","sourcesContent":["import {\n contentModelToDom,\n contentModelToText,\n createModelToDomContext,\n} from 'roosterjs-content-model-dom';\nimport type { ExportContentMode, IEditor, ModelToDomOption } from 'roosterjs-content-model-types';\n\n/**\n * Export string content of editor\n * @param editor The editor to get content from\n * @param mode Mode of content to export. It supports:\n * - HTML: Export HTML content. If there are entities, this will cause EntityOperation event with option = 'replaceTemporaryContent' to get a dehydrated entity\n * - PlainText: Export plain text content\n * - PlainTextFast: Export plain text using editor's textContent property directly\n * @param options @optional Options for Model to DOM conversion\n */\nexport function exportContent(\n editor: IEditor,\n mode: ExportContentMode = 'HTML',\n options?: ModelToDomOption\n): string {\n if (mode == 'PlainTextFast') {\n return editor.getDOMHelper().getTextContent();\n } else {\n const model = editor.getContentModelCopy('clean');\n\n if (mode == 'PlainText') {\n return contentModelToText(model);\n } else {\n const doc = editor.getDocument();\n const div = doc.createElement('div');\n\n contentModelToDom(\n doc,\n div,\n model,\n createModelToDomContext(undefined /*editorContext*/, options)\n );\n\n editor.triggerEvent('extractContentWithDom', { clonedRoot: div }, true /*broadcast*/);\n\n return div.innerHTML;\n }\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createPasteFragment.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-core/lib/command/paste/createPasteFragment.ts"],"names":[],"mappings":";;;AAAA,2EAAmE;AAGnE,IAAM,SAAS,GAAG,QAAQ,CAAC;AAC3B,IAAM,SAAS,GAAG,QAAQ,CAAC;AAC3B,IAAM,UAAU,GAAG,CAAC,CAAC;AAErB;;GAEG;AACH,SAAgB,mBAAmB,CAC/B,QAAkB,EAClB,aAA4B,EAC5B,SAAoB,EACpB,IAA6B;IAErB,IAAA,YAAY,GAAW,aAAa,aAAxB,EAAE,IAAI,GAAK,aAAa,KAAlB,CAAmB;IAC7C,IAAM,QAAQ,GAAG,QAAQ,CAAC,sBAAsB,EAAE,CAAC;IAEnD,IACI,CAAC,SAAS,IAAI,SAAS,IAAI,YAAY,CAAC;QACxC,CAAC,SAAS,IAAI,aAAa,IAAI,CAAC,IAAI,IAAI,YAAY,CAAC,EACvD;QACE,cAAc;QACd,IAAM,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAC1C,GAAG,CAAC,KAAK,CAAC,QAAQ,GAAG,MAAM,CAAC;QAC5B,GAAG,CAAC,GAAG,GAAG,YAAY,CAAC;QACvB,QAAQ,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;KAC7B;SAAM,IAAI,SAAS,IAAI,aAAa,IAAI,IAAI,EAAE;QAC3C,IAAA,4CAAc,EAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;KAClC;SAAM,IAAI,IAAI,EAAE;QACb,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,UAAC,IAAI,EAAE,KAAK,EAAE,KAAK;YACxC,IAAI,GAAG,IAAI;iBACN,OAAO,CAAC,KAAK,EAAE,SAAS,CAAC;iBACzB,OAAO,CAAC,KAAK,EAAE,SAAS,CAAC;iBACzB,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;iBAClB,OAAO,CAAC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,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;QACzC,IAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACzC,IAAM,QAAQ,GAAG,UAAU,GAAG,CAAC,CAAC,UAAU,CAAC,MAAM,GAAG,aAAa,CAAC,GAAG,UAAU,CAAC,CAAC;QACjF,IAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACxD,IAAI,GAAG,UAAU,GAAG,MAAM,GAAG,SAAS,CAAC;KAC1C;IACD,OAAO,IAAI,CAAC;AAChB,CAAC","sourcesContent":["import { moveChildNodes, wrap } from 'roosterjs-content-model-dom';\nimport type { ClipboardData, PasteType } from 'roosterjs-content-model-types';\n\nconst NBSP_HTML = '\\u00A0';\nconst ENSP_HTML = '\\u2002';\nconst TAB_SPACES = 6;\n\n/**\n * @internal\n */\nexport function createPasteFragment(\n document: Document,\n clipboardData: ClipboardData,\n pasteType: PasteType,\n root: HTMLElement | undefined\n): DocumentFragment {\n const { imageDataUri, text } = clipboardData;\n const fragment = document.createDocumentFragment();\n\n if (\n (pasteType == 'asImage' && imageDataUri) ||\n (pasteType != 'asPlainText' && !text && imageDataUri)\n ) {\n // Paste image\n const img = document.createElement('img');\n img.style.maxWidth = '100%';\n img.src = imageDataUri;\n fragment.appendChild(img);\n } else if (pasteType != 'asPlainText' && root) {\n moveChildNodes(fragment, root);\n } else if (text) {\n text.split('\\n').forEach((line, index, lines) => {\n line = line\n .replace(/^ /g, NBSP_HTML)\n .replace(/ $/g, NBSP_HTML)\n .replace(/\\r/g, '')\n .replace(/ {2}/g, ' ' + NBSP_HTML);\n\n if (line.includes('\\t')) {\n line = transformTabCharacters(line);\n }\n\n const textNode = document.createTextNode(line);\n\n // There are 3 scenarios:\n // 1. Single line: Paste as it is\n // 2. Two lines: Add <br> between the lines\n // 3. 3 or More lines, For first and last line, paste as it is. For middle lines, wrap with DIV, and add BR if it is empty line\n if (lines.length == 2 && index == 0) {\n // 1 of 2 lines scenario, add BR\n fragment.appendChild(textNode);\n fragment.appendChild(document.createElement('br'));\n } else if (index > 0 && index < lines.length - 1) {\n // Middle line of >=3 lines scenario, wrap with DIV\n fragment.appendChild(\n wrap(document, line == '' ? document.createElement('br') : textNode, 'div')\n );\n } else {\n // All others, paste as it is\n fragment.appendChild(textNode);\n }\n });\n }\n\n return fragment;\n}\n\n/**\n * Transform \\t characters into EN SPACE characters\n * @param input string NOT containing \\n characters\n * @example t(\"\\thello\", 2) => \"    hello\"\n */\nfunction transformTabCharacters(input: string, initialOffset: number = 0) {\n let line = input;\n let tIndex: number;\n while ((tIndex = line.indexOf('\\t')) != -1) {\n const lineBefore = line.slice(0, tIndex);\n const lineAfter = line.slice(tIndex + 1);\n const tabCount = TAB_SPACES - ((lineBefore.length + initialOffset) % TAB_SPACES);\n const tabStr = Array(tabCount).fill(ENSP_HTML).join('');\n line = lineBefore + tabStr + lineAfter;\n }\n return line;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generatePasteOptionFromPlugins.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-core/lib/command/paste/generatePasteOptionFromPlugins.ts"],"names":[],"mappings":";;;AASA;;GAEG;AACH,SAAgB,8BAA8B,CAC1C,MAAe,EACf,aAA4B,EAC5B,QAA0B,EAC1B,iBAAoC,EACpC,SAAoB;;IAEpB,IAAM,gBAAgB,GAAkC;QACpD,qBAAqB,EAAE,EAAE;QACzB,wBAAwB,EAAE,EAAE;QAC5B,uBAAuB,EAAE,EAAE;QAC3B,oBAAoB,EAAE,EAAE;QACxB,iBAAiB,EAAE,EAAE;QACrB,eAAe,EAAE,EAAE;QACnB,mBAAmB,EAAE,EAAE;KAC1B,CAAC;IAEF,IAAM,KAAK,GAAqB;QAC5B,SAAS,EAAE,aAAa;QACxB,aAAa,eAAA;QACb,QAAQ,UAAA;QACR,UAAU,EAAE,MAAA,iBAAiB,CAAC,UAAU,mCAAI,EAAE;QAC9C,SAAS,EAAE,MAAA,iBAAiB,CAAC,SAAS,mCAAI,EAAE;QAC5C,cAAc,EAAE,iBAAiB,CAAC,QAAQ;QAC1C,SAAS,EAAE,SAAS;QACpB,gBAAgB,kBAAA;KACnB,CAAC;IAEF,OAAO,SAAS,IAAI,aAAa;QAC7B,CAAC,CAAC,KAAK;QACP,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,aAAa,EAAE,KAAK,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;AAC1E,CAAC;AA/BD,wEA+BC","sourcesContent":["import type { HtmlFromClipboard } from './retrieveHtmlInfo';\nimport type {\n BeforePasteEvent,\n ClipboardData,\n DomToModelOptionForSanitizing,\n PasteType,\n IEditor,\n} from 'roosterjs-content-model-types';\n\n/**\n * @internal\n */\nexport function generatePasteOptionFromPlugins(\n editor: IEditor,\n clipboardData: ClipboardData,\n fragment: DocumentFragment,\n htmlFromClipboard: HtmlFromClipboard,\n pasteType: PasteType\n): BeforePasteEvent {\n const domToModelOption: DomToModelOptionForSanitizing = {\n additionalAllowedTags: [],\n additionalDisallowedTags: [],\n additionalFormatParsers: {},\n formatParserOverride: {},\n processorOverride: {},\n styleSanitizers: {},\n attributeSanitizers: {},\n };\n\n const event: BeforePasteEvent = {\n eventType: 'beforePaste',\n clipboardData,\n fragment,\n htmlBefore: htmlFromClipboard.htmlBefore ?? '',\n htmlAfter: htmlFromClipboard.htmlAfter ?? '',\n htmlAttributes: htmlFromClipboard.metadata,\n pasteType: pasteType,\n domToModelOption,\n };\n\n return pasteType == 'asPlainText'\n ? event\n : editor.triggerEvent('beforePaste', event, true /* broadcast */);\n}\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { BeforePasteEvent, ClipboardData, ContentModelDocument, IEditor } from 'roosterjs-content-model-types';
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
export declare function cloneModelForPaste(model: ContentModelDocument): ContentModelDocument;
|
|
6
|
+
/**
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export declare function mergePasteContent(editor: IEditor, eventResult: BeforePasteEvent, clipboardData: ClipboardData): void;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mergePasteContent = exports.cloneModelForPaste = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var createDomToModelContextForSanitizing_1 = require("../createModelFromHtml/createDomToModelContextForSanitizing");
|
|
6
|
+
var roosterjs_content_model_dom_1 = require("roosterjs-content-model-dom");
|
|
7
|
+
var EmptySegmentFormat = {
|
|
8
|
+
backgroundColor: '',
|
|
9
|
+
fontFamily: '',
|
|
10
|
+
fontSize: '',
|
|
11
|
+
fontWeight: '',
|
|
12
|
+
italic: false,
|
|
13
|
+
letterSpacing: '',
|
|
14
|
+
lineHeight: '',
|
|
15
|
+
strikethrough: false,
|
|
16
|
+
superOrSubScriptSequence: '',
|
|
17
|
+
textColor: '',
|
|
18
|
+
underline: false,
|
|
19
|
+
};
|
|
20
|
+
var CloneOption = {
|
|
21
|
+
includeCachedElement: function (node, type) { return (type == 'cache' ? undefined : node); },
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
function cloneModelForPaste(model) {
|
|
27
|
+
return (0, roosterjs_content_model_dom_1.cloneModel)(model, CloneOption);
|
|
28
|
+
}
|
|
29
|
+
exports.cloneModelForPaste = cloneModelForPaste;
|
|
30
|
+
/**
|
|
31
|
+
* @internal
|
|
32
|
+
*/
|
|
33
|
+
function mergePasteContent(editor, eventResult, clipboardData) {
|
|
34
|
+
var fragment = eventResult.fragment, domToModelOption = eventResult.domToModelOption, customizedMerge = eventResult.customizedMerge, pasteType = eventResult.pasteType;
|
|
35
|
+
editor.formatContentModel(function (model, context) {
|
|
36
|
+
if (clipboardData.modelBeforePaste) {
|
|
37
|
+
var clonedModel = cloneModelForPaste(clipboardData.modelBeforePaste);
|
|
38
|
+
model.blocks = clonedModel.blocks;
|
|
39
|
+
}
|
|
40
|
+
var selectedSegment = (0, roosterjs_content_model_dom_1.getSelectedSegments)(model, true /*includeFormatHolder*/)[0];
|
|
41
|
+
var domToModelContext = (0, createDomToModelContextForSanitizing_1.createDomToModelContextForSanitizing)(editor.getDocument(), undefined /*defaultFormat*/, editor.getEnvironment().domToModelSettings.customized, domToModelOption);
|
|
42
|
+
domToModelContext.segmentFormat = selectedSegment
|
|
43
|
+
? (0, roosterjs_content_model_dom_1.getSegmentTextFormat)(selectedSegment)
|
|
44
|
+
: {};
|
|
45
|
+
var pasteModel = (0, roosterjs_content_model_dom_1.domToContentModel)(fragment, domToModelContext);
|
|
46
|
+
var mergeOption = {
|
|
47
|
+
mergeFormat: pasteType == 'mergeFormat' ? 'keepSourceEmphasisFormat' : 'none',
|
|
48
|
+
mergeTable: shouldMergeTable(pasteModel),
|
|
49
|
+
};
|
|
50
|
+
var insertPoint = customizedMerge
|
|
51
|
+
? customizedMerge(model, pasteModel)
|
|
52
|
+
: (0, roosterjs_content_model_dom_1.mergeModel)(model, pasteModel, context, mergeOption);
|
|
53
|
+
if (insertPoint) {
|
|
54
|
+
context.newPendingFormat = (0, tslib_1.__assign)((0, tslib_1.__assign)((0, tslib_1.__assign)({}, EmptySegmentFormat), model.format), insertPoint.marker.format);
|
|
55
|
+
}
|
|
56
|
+
return true;
|
|
57
|
+
}, {
|
|
58
|
+
changeSource: roosterjs_content_model_dom_1.ChangeSource.Paste,
|
|
59
|
+
getChangeData: function () { return clipboardData; },
|
|
60
|
+
apiName: 'paste',
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
exports.mergePasteContent = mergePasteContent;
|
|
64
|
+
function shouldMergeTable(pasteModel) {
|
|
65
|
+
// If model contains a table and a paragraph element after the table with a single BR segment, remove the Paragraph after the table
|
|
66
|
+
if (pasteModel.blocks.length == 2 &&
|
|
67
|
+
pasteModel.blocks[0].blockType === 'Table' &&
|
|
68
|
+
pasteModel.blocks[1].blockType === 'Paragraph' &&
|
|
69
|
+
pasteModel.blocks[1].segments.length === 1 &&
|
|
70
|
+
pasteModel.blocks[1].segments[0].segmentType === 'Br') {
|
|
71
|
+
pasteModel.blocks.splice(1);
|
|
72
|
+
}
|
|
73
|
+
// Only merge table when the document contain a single table.
|
|
74
|
+
return pasteModel.blocks.length === 1 && pasteModel.blocks[0].blockType === 'Table';
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=mergePasteContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mergePasteContent.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-core/lib/command/paste/mergePasteContent.ts"],"names":[],"mappings":";;;;AAAA,oHAAmH;AACnH,2EAOqC;AAWrC,IAAM,kBAAkB,GAAwC;IAC5D,eAAe,EAAE,EAAE;IACnB,UAAU,EAAE,EAAE;IACd,QAAQ,EAAE,EAAE;IACZ,UAAU,EAAE,EAAE;IACd,MAAM,EAAE,KAAK;IACb,aAAa,EAAE,EAAE;IACjB,UAAU,EAAE,EAAE;IACd,aAAa,EAAE,KAAK;IACpB,wBAAwB,EAAE,EAAE;IAC5B,SAAS,EAAE,EAAE;IACb,SAAS,EAAE,KAAK;CACnB,CAAC;AAEF,IAAM,WAAW,GAAsB;IACnC,oBAAoB,EAAE,UAAC,IAAI,EAAE,IAAI,IAAK,OAAA,CAAC,IAAI,IAAI,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,EAApC,CAAoC;CAC7E,CAAC;AAEF;;GAEG;AACH,SAAgB,kBAAkB,CAAC,KAA2B;IAC1D,OAAO,IAAA,wCAAU,EAAC,KAAK,EAAE,WAAW,CAAC,CAAC;AAC1C,CAAC;A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,EAAC,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;QAE1D,IAAI,WAAW,EAAE;YACb,OAAO,CAAC,gBAAgB,yEACjB,kBAAkB,GAClB,KAAK,CAAC,MAAM,GACZ,WAAW,CAAC,MAAM,CAAC,MAAM,CAC/B,CAAC;SACL;QAED,OAAO,IAAI,CAAC;IAChB,CAAC,EACD;QACI,YAAY,EAAE,0CAAY,CAAC,KAAK;QAChC,aAAa,EAAE,cAAM,OAAA,aAAa,EAAb,CAAa;QAClC,OAAO,EAAE,OAAO;KACnB,CACJ,CAAC;AACN,CAAC;AApDD,8CAoDC;AAED,SAAS,gBAAgB,CAAC,UAAgC;IACtD,mIAAmI;IACnI,IACI,UAAU,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC;QAC7B,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,KAAK,OAAO;QAC1C,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,KAAK,WAAW;QAC9C,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC;QAC1C,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,WAAW,KAAK,IAAI,EACvD;QACE,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;KAC/B;IACD,6DAA6D;IAC7D,OAAO,UAAU,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,KAAK,OAAO,CAAC;AACxF,CAAC","sourcesContent":["import { createDomToModelContextForSanitizing } from '../createModelFromHtml/createDomToModelContextForSanitizing';\nimport {\n ChangeSource,\n cloneModel,\n domToContentModel,\n getSegmentTextFormat,\n getSelectedSegments,\n mergeModel,\n} from 'roosterjs-content-model-dom';\nimport type {\n BeforePasteEvent,\n ClipboardData,\n CloneModelOptions,\n ContentModelDocument,\n ContentModelSegmentFormat,\n IEditor,\n MergeModelOption,\n} from 'roosterjs-content-model-types';\n\nconst EmptySegmentFormat: Required<ContentModelSegmentFormat> = {\n backgroundColor: '',\n fontFamily: '',\n fontSize: '',\n fontWeight: '',\n italic: false,\n letterSpacing: '',\n lineHeight: '',\n strikethrough: false,\n superOrSubScriptSequence: '',\n textColor: '',\n underline: false,\n};\n\nconst CloneOption: CloneModelOptions = {\n includeCachedElement: (node, type) => (type == 'cache' ? undefined : node),\n};\n\n/**\n * @internal\n */\nexport function cloneModelForPaste(model: ContentModelDocument) {\n return cloneModel(model, CloneOption);\n}\n\n/**\n * @internal\n */\nexport function mergePasteContent(\n editor: IEditor,\n eventResult: BeforePasteEvent,\n clipboardData: ClipboardData\n) {\n const { fragment, domToModelOption, customizedMerge, pasteType } = eventResult;\n\n editor.formatContentModel(\n (model, context) => {\n if (clipboardData.modelBeforePaste) {\n const clonedModel = cloneModelForPaste(clipboardData.modelBeforePaste);\n model.blocks = clonedModel.blocks;\n }\n\n const selectedSegment = getSelectedSegments(model, true /*includeFormatHolder*/)[0];\n const domToModelContext = createDomToModelContextForSanitizing(\n editor.getDocument(),\n undefined /*defaultFormat*/,\n editor.getEnvironment().domToModelSettings.customized,\n domToModelOption\n );\n\n domToModelContext.segmentFormat = selectedSegment\n ? getSegmentTextFormat(selectedSegment)\n : {};\n\n const pasteModel = domToContentModel(fragment, domToModelContext);\n const mergeOption: MergeModelOption = {\n mergeFormat: pasteType == 'mergeFormat' ? 'keepSourceEmphasisFormat' : 'none',\n mergeTable: shouldMergeTable(pasteModel),\n };\n\n const insertPoint = customizedMerge\n ? customizedMerge(model, pasteModel)\n : mergeModel(model, pasteModel, context, mergeOption);\n\n if (insertPoint) {\n context.newPendingFormat = {\n ...EmptySegmentFormat,\n ...model.format,\n ...insertPoint.marker.format,\n };\n }\n\n return true;\n },\n {\n changeSource: ChangeSource.Paste,\n getChangeData: () => clipboardData,\n apiName: 'paste',\n }\n );\n}\n\nfunction shouldMergeTable(pasteModel: ContentModelDocument): boolean | undefined {\n // If model contains a table and a paragraph element after the table with a single BR segment, remove the Paragraph after the table\n if (\n pasteModel.blocks.length == 2 &&\n pasteModel.blocks[0].blockType === 'Table' &&\n pasteModel.blocks[1].blockType === 'Paragraph' &&\n pasteModel.blocks[1].segments.length === 1 &&\n pasteModel.blocks[1].segments[0].segmentType === 'Br'\n ) {\n pasteModel.blocks.splice(1);\n }\n // Only merge table when the document contain a single table.\n return pasteModel.blocks.length === 1 && pasteModel.blocks[0].blockType === 'Table';\n}\n"]}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.paste = void 0;
|
|
4
|
+
var mergePasteContent_1 = require("./mergePasteContent");
|
|
5
|
+
var convertInlineCss_1 = require("../createModelFromHtml/convertInlineCss");
|
|
6
|
+
var createPasteFragment_1 = require("./createPasteFragment");
|
|
7
|
+
var generatePasteOptionFromPlugins_1 = require("./generatePasteOptionFromPlugins");
|
|
8
|
+
var retrieveHtmlInfo_1 = require("./retrieveHtmlInfo");
|
|
9
|
+
/**
|
|
10
|
+
* Paste into editor using a clipboardData object
|
|
11
|
+
* @param editor The Editor object.
|
|
12
|
+
* @param clipboardData Clipboard data retrieved from clipboard
|
|
13
|
+
* @param pasteType Type of content to paste. @default normal
|
|
14
|
+
*/
|
|
15
|
+
function paste(editor, clipboardData, pasteType) {
|
|
16
|
+
var _a;
|
|
17
|
+
if (pasteType === void 0) { pasteType = 'normal'; }
|
|
18
|
+
editor.focus();
|
|
19
|
+
var trustedHTMLHandler = editor.getTrustedHTMLHandler();
|
|
20
|
+
if (!clipboardData.modelBeforePaste) {
|
|
21
|
+
clipboardData.modelBeforePaste = (0, mergePasteContent_1.cloneModelForPaste)(editor.getContentModelCopy('connected'));
|
|
22
|
+
}
|
|
23
|
+
// 1. Prepare variables
|
|
24
|
+
var doc = createDOMFromHtml(clipboardData.rawHtml, trustedHTMLHandler);
|
|
25
|
+
// 2. Handle HTML from clipboard
|
|
26
|
+
var htmlFromClipboard = (0, retrieveHtmlInfo_1.retrieveHtmlInfo)(doc, clipboardData);
|
|
27
|
+
// 3. Create target fragment
|
|
28
|
+
var sourceFragment = (0, createPasteFragment_1.createPasteFragment)(editor.getDocument(), clipboardData, pasteType, (_a = (clipboardData.rawHtml == clipboardData.html
|
|
29
|
+
? doc
|
|
30
|
+
: createDOMFromHtml(clipboardData.html, trustedHTMLHandler))) === null || _a === void 0 ? void 0 : _a.body);
|
|
31
|
+
// 4. Trigger BeforePaste event to allow plugins modify the fragment
|
|
32
|
+
var eventResult = (0, generatePasteOptionFromPlugins_1.generatePasteOptionFromPlugins)(editor, clipboardData, sourceFragment, htmlFromClipboard, pasteType);
|
|
33
|
+
// 5. Convert global CSS to inline CSS
|
|
34
|
+
(0, convertInlineCss_1.convertInlineCss)(eventResult.fragment, htmlFromClipboard.globalCssRules);
|
|
35
|
+
// 6. Merge pasted content into main Content Model
|
|
36
|
+
(0, mergePasteContent_1.mergePasteContent)(editor, eventResult, clipboardData);
|
|
37
|
+
}
|
|
38
|
+
exports.paste = paste;
|
|
39
|
+
function createDOMFromHtml(html, trustedHTMLHandler) {
|
|
40
|
+
return html ? new DOMParser().parseFromString(trustedHTMLHandler(html), 'text/html') : null;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=paste.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paste.js","sourceRoot":"","sources":["../../../../../packages/roosterjs-content-model-core/lib/command/paste/paste.ts"],"names":[],"mappings":";;;AAAA,yDAA4E;AAC5E,4EAA2E;AAC3E,6DAA4D;AAC5D,mFAAkF;AAClF,uDAAsD;AAQtD;;;;;GAKG;AACH,SAAgB,KAAK,CACjB,MAAe,EACf,aAA4B,EAC5B,SAA+B;;IAA/B,0BAAA,EAAA,oBAA+B;IAE/B,MAAM,CAAC,KAAK,EAAE,C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C;AAChG,CAAC","sourcesContent":["import { cloneModelForPaste, mergePasteContent } from './mergePasteContent';\nimport { convertInlineCss } from '../createModelFromHtml/convertInlineCss';\nimport { createPasteFragment } from './createPasteFragment';\nimport { generatePasteOptionFromPlugins } from './generatePasteOptionFromPlugins';\nimport { retrieveHtmlInfo } from './retrieveHtmlInfo';\nimport type {\n PasteType,\n ClipboardData,\n TrustedHTMLHandler,\n IEditor,\n} from 'roosterjs-content-model-types';\n\n/**\n * Paste into editor using a clipboardData object\n * @param editor The Editor object.\n * @param clipboardData Clipboard data retrieved from clipboard\n * @param pasteType Type of content to paste. @default normal\n */\nexport function paste(\n editor: IEditor,\n clipboardData: ClipboardData,\n pasteType: PasteType = 'normal'\n) {\n editor.focus();\n\n const trustedHTMLHandler = editor.getTrustedHTMLHandler();\n\n if (!clipboardData.modelBeforePaste) {\n clipboardData.modelBeforePaste = cloneModelForPaste(\n editor.getContentModelCopy('connected')\n );\n }\n\n // 1. Prepare variables\n const doc = createDOMFromHtml(clipboardData.rawHtml, trustedHTMLHandler);\n\n // 2. Handle HTML from clipboard\n const htmlFromClipboard = retrieveHtmlInfo(doc, clipboardData);\n\n // 3. Create target fragment\n const sourceFragment = createPasteFragment(\n editor.getDocument(),\n clipboardData,\n pasteType,\n (clipboardData.rawHtml == clipboardData.html\n ? doc\n : createDOMFromHtml(clipboardData.html, trustedHTMLHandler)\n )?.body\n );\n\n // 4. Trigger BeforePaste event to allow plugins modify the fragment\n const eventResult = generatePasteOptionFromPlugins(\n editor,\n clipboardData,\n sourceFragment,\n htmlFromClipboard,\n pasteType\n );\n\n // 5. Convert global CSS to inline CSS\n convertInlineCss(eventResult.fragment, htmlFromClipboard.globalCssRules);\n\n // 6. Merge pasted content into main Content Model\n mergePasteContent(editor, eventResult, clipboardData);\n}\n\nfunction createDOMFromHtml(\n html: string | null | undefined,\n trustedHTMLHandler: TrustedHTMLHandler\n): Document | null {\n return html ? new DOMParser().parseFromString(trustedHTMLHandler(html), 'text/html') : null;\n}\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ClipboardData } from 'roosterjs-content-model-types';
|
|
2
|
+
import type { CssRule } from '../createModelFromHtml/convertInlineCss';
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export interface HtmlFromClipboard {
|
|
7
|
+
metadata: Record<string, string>;
|
|
8
|
+
globalCssRules: CssRule[];
|
|
9
|
+
htmlBefore?: string;
|
|
10
|
+
htmlAfter?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export declare function retrieveHtmlInfo(doc: Document | null, clipboardData: Partial<ClipboardData>): HtmlFromClipboard;
|