@atlaskit/editor-core 172.1.1 → 172.2.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/CHANGELOG.md +30 -0
- package/dist/cjs/analytics-api/api.js +38 -0
- package/dist/cjs/analytics-api/attach-payload-into-transaction.js +36 -0
- package/dist/cjs/analytics-api/editor-state-context.js +96 -0
- package/dist/cjs/analytics-api/map-attributes.js +30 -0
- package/dist/cjs/create-editor/ReactEditorView.js +47 -6
- package/dist/cjs/create-editor/ReactEditorViewContext.js +2 -6
- package/dist/cjs/create-editor/create-plugins-list.js +12 -3
- package/dist/cjs/event-dispatcher/index.js +12 -81
- package/dist/cjs/insert-api/api.js +48 -0
- package/dist/cjs/insert-api/insert-content-handlers.js +101 -0
- package/dist/cjs/insert-api/insert-node-helpers.js +157 -0
- package/dist/cjs/{plugins/analytics/types/avatar.js → insert-api/types.js} +0 -0
- package/dist/cjs/keymaps/index.js +437 -288
- package/dist/cjs/messages.js +8 -125
- package/dist/cjs/plugins/analytics/index.js +26 -26
- package/dist/cjs/plugins/analytics/types/enums.js +49 -344
- package/dist/cjs/plugins/analytics/types/extension-events.js +19 -26
- package/dist/cjs/plugins/analytics/types/general-events.js +25 -34
- package/dist/cjs/plugins/analytics/types/index.js +10 -56
- package/dist/cjs/plugins/analytics/types/inline-comment-events.js +7 -8
- package/dist/cjs/plugins/analytics/types/node-events.js +13 -20
- package/dist/cjs/plugins/analytics/types/smart-links.js +8 -14
- package/dist/cjs/plugins/analytics/types/toolbar-button.js +7 -20
- package/dist/cjs/plugins/analytics/utils.js +37 -127
- package/dist/cjs/plugins/expand/utils.js +18 -45
- package/dist/cjs/plugins/extension/actions.js +10 -30
- package/dist/cjs/plugins/extension/ui/Extension/styles.js +18 -8
- package/dist/cjs/plugins/insert-block/index.js +1 -0
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +31 -22
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/messages.js +6 -170
- package/dist/cjs/plugins/layout/styles.js +14 -6
- package/dist/cjs/plugins/layout/utils.js +25 -66
- package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +10 -0
- package/dist/cjs/plugins/paste/handlers.js +19 -15
- package/dist/cjs/plugins/paste/util/index.js +30 -1
- package/dist/cjs/plugins/selection/gap-cursor/selection.js +23 -188
- package/dist/cjs/plugins/selection/gap-cursor/utils/is-ignored.js +7 -8
- package/dist/cjs/plugins/selection/gap-cursor/utils/is-valid-target-node.js +7 -8
- package/dist/cjs/plugins/selection/gap-cursor/utils.js +6 -6
- package/dist/cjs/plugins/selection/gap-cursor-selection.js +1 -1
- package/dist/cjs/plugins/selection/types.js +9 -11
- package/dist/cjs/plugins/selection/utils.js +2 -2
- package/dist/cjs/plugins/table/commands/go-to-next-cell.js +40 -38
- package/dist/cjs/plugins/table/commands/insert.js +57 -49
- package/dist/cjs/plugins/table/commands/selection.js +302 -218
- package/dist/cjs/plugins/table/commands-with-analytics.js +241 -219
- package/dist/cjs/plugins/table/event-handlers.js +60 -60
- package/dist/cjs/plugins/table/index.js +64 -20
- package/dist/cjs/plugins/table/nodeviews/TableComponent.js +20 -22
- package/dist/cjs/plugins/table/nodeviews/table.js +19 -11
- package/dist/cjs/plugins/table/nodeviews/tableCell.js +11 -13
- package/dist/cjs/plugins/table/nodeviews/update-overflow-shadows.js +25 -25
- package/dist/cjs/plugins/table/pm-plugins/keymap.js +15 -13
- package/dist/cjs/plugins/table/pm-plugins/main.js +8 -8
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +4 -8
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/plugin.js +2 -1
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/event-handlers.js +7 -10
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/plugin.js +2 -2
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/dom.js +30 -28
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/misc.js +4 -7
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +3 -2
- package/dist/cjs/plugins/table/pm-plugins/table-selection-keymap.js +3 -3
- package/dist/cjs/plugins/table/toolbar.js +74 -72
- package/dist/cjs/plugins/table/transforms/column-width.js +41 -38
- package/dist/cjs/plugins/table/transforms/replace-table.js +4 -4
- package/dist/cjs/plugins/table/ui/FloatingContextualButton/index.js +2 -4
- package/dist/cjs/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +25 -21
- package/dist/cjs/plugins/table/ui/FloatingContextualMenu/index.js +6 -2
- package/dist/cjs/plugins/table/ui/FloatingDeleteButton/index.js +7 -4
- package/dist/cjs/plugins/table/ui/FloatingInsertButton/index.js +12 -11
- package/dist/cjs/plugins/table/ui/LayoutButton/index.js +2 -2
- package/dist/cjs/plugins/table/ui/TableFloatingControls/index.js +4 -6
- package/dist/cjs/plugins/table/ui/common-styles.js +3 -3
- package/dist/cjs/plugins/table/utils/analytics.js +26 -1
- package/dist/cjs/plugins/table/utils/index.js +0 -6
- package/dist/cjs/selection-api/api.js +34 -0
- package/dist/cjs/types/browser.js +1 -2
- package/dist/cjs/ui/ColorPalette/Color/index.js +2 -106
- package/dist/cjs/ui/ColorPalette/Palettes/cellBackgroundColorPalette.js +2 -21
- package/dist/cjs/ui/ColorPalette/Palettes/common.js +7 -25
- package/dist/cjs/ui/ColorPalette/Palettes/paletteMessages.js +2 -114
- package/dist/cjs/ui/ColorPalette/Palettes/panelBackgroundPalette.js +12 -152
- package/dist/cjs/ui/ColorPalette/Palettes/statusColorPalette.js +13 -61
- package/dist/cjs/ui/ColorPalette/Palettes/textColorPalette.js +12 -34
- package/dist/cjs/ui/ColorPalette/index.js +2 -76
- package/dist/cjs/ui/Dropdown/index.js +3 -119
- package/dist/cjs/ui/DropdownMenu/index.js +3 -286
- package/dist/cjs/ui/Toolbar/types.js +19 -33
- package/dist/cjs/ui/ToolbarButton/index.js +8 -120
- package/dist/cjs/ui/WithPluginState/index.js +1 -3
- package/dist/cjs/ui/styles.js +35 -27
- package/dist/cjs/ui/with-outer-listeners.js +4 -152
- package/dist/cjs/utils/dom.js +46 -123
- package/dist/cjs/utils/index.js +40 -42
- package/dist/cjs/utils/node-width.js +7 -79
- package/dist/cjs/utils/nodes.js +57 -124
- package/dist/cjs/utils/plugin-state-factory.js +7 -107
- package/dist/cjs/utils/selection.js +11 -62
- package/dist/cjs/utils/slice.js +28 -68
- package/dist/cjs/utils/step.js +18 -46
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/analytics-api/api.js +30 -0
- package/dist/es2019/analytics-api/attach-payload-into-transaction.js +25 -0
- package/dist/es2019/analytics-api/editor-state-context.js +85 -0
- package/dist/es2019/analytics-api/map-attributes.js +14 -0
- package/dist/es2019/create-editor/ReactEditorView.js +33 -4
- package/dist/es2019/create-editor/ReactEditorViewContext.js +1 -2
- package/dist/es2019/create-editor/create-plugins-list.js +13 -4
- package/dist/es2019/event-dispatcher/index.js +1 -60
- package/dist/es2019/insert-api/api.js +43 -0
- package/dist/es2019/insert-api/insert-content-handlers.js +85 -0
- package/dist/es2019/insert-api/insert-node-helpers.js +149 -0
- package/dist/es2019/{plugins/analytics/types/avatar.js → insert-api/types.js} +0 -0
- package/dist/es2019/keymaps/index.js +1 -186
- package/dist/es2019/messages.js +2 -123
- package/dist/es2019/plugins/analytics/index.js +1 -1
- package/dist/es2019/plugins/analytics/types/enums.js +1 -336
- package/dist/es2019/plugins/analytics/types/extension-events.js +1 -22
- package/dist/es2019/plugins/analytics/types/general-events.js +1 -30
- package/dist/es2019/plugins/analytics/types/index.js +1 -6
- package/dist/es2019/plugins/analytics/types/inline-comment-events.js +1 -7
- package/dist/es2019/plugins/analytics/types/node-events.js +1 -18
- package/dist/es2019/plugins/analytics/types/smart-links.js +1 -12
- package/dist/es2019/plugins/analytics/types/toolbar-button.js +1 -19
- package/dist/es2019/plugins/analytics/utils.js +12 -113
- package/dist/es2019/plugins/expand/utils.js +1 -36
- package/dist/es2019/plugins/extension/actions.js +1 -26
- package/dist/es2019/plugins/extension/ui/Extension/styles.js +2 -3
- package/dist/es2019/plugins/insert-block/index.js +1 -0
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +22 -12
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/messages.js +1 -168
- package/dist/es2019/plugins/layout/styles.js +2 -3
- package/dist/es2019/plugins/layout/utils.js +1 -54
- package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +10 -0
- package/dist/es2019/plugins/paste/handlers.js +8 -4
- package/dist/es2019/plugins/paste/util/index.js +23 -0
- package/dist/es2019/plugins/selection/gap-cursor/selection.js +1 -136
- package/dist/es2019/plugins/selection/gap-cursor/utils/is-ignored.js +1 -5
- package/dist/es2019/plugins/selection/gap-cursor/utils/is-valid-target-node.js +1 -4
- package/dist/es2019/plugins/selection/gap-cursor/utils.js +4 -4
- package/dist/es2019/plugins/selection/gap-cursor-selection.js +1 -1
- package/dist/es2019/plugins/selection/types.js +2 -9
- package/dist/es2019/plugins/selection/utils.js +1 -1
- package/dist/es2019/plugins/table/commands/go-to-next-cell.js +4 -4
- package/dist/es2019/plugins/table/commands/insert.js +26 -24
- package/dist/es2019/plugins/table/commands/selection.js +109 -51
- package/dist/es2019/plugins/table/commands-with-analytics.js +39 -38
- package/dist/es2019/plugins/table/event-handlers.js +6 -7
- package/dist/es2019/plugins/table/index.js +56 -16
- package/dist/es2019/plugins/table/nodeviews/TableComponent.js +11 -12
- package/dist/es2019/plugins/table/nodeviews/table.js +18 -8
- package/dist/es2019/plugins/table/nodeviews/tableCell.js +2 -3
- package/dist/es2019/plugins/table/nodeviews/update-overflow-shadows.js +3 -4
- package/dist/es2019/plugins/table/pm-plugins/keymap.js +13 -12
- package/dist/es2019/plugins/table/pm-plugins/main.js +8 -8
- package/dist/es2019/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +4 -6
- package/dist/es2019/plugins/table/pm-plugins/sticky-headers/plugin.js +2 -2
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/event-handlers.js +7 -8
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/plugin.js +2 -2
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/dom.js +2 -2
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/misc.js +4 -4
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +3 -2
- package/dist/es2019/plugins/table/pm-plugins/table-selection-keymap.js +3 -3
- package/dist/es2019/plugins/table/toolbar.js +24 -24
- package/dist/es2019/plugins/table/transforms/column-width.js +3 -2
- package/dist/es2019/plugins/table/transforms/replace-table.js +4 -4
- package/dist/es2019/plugins/table/ui/FloatingContextualButton/index.js +2 -2
- package/dist/es2019/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +19 -16
- package/dist/es2019/plugins/table/ui/FloatingContextualMenu/index.js +6 -2
- package/dist/es2019/plugins/table/ui/FloatingDeleteButton/index.js +8 -4
- package/dist/es2019/plugins/table/ui/FloatingInsertButton/index.js +9 -6
- package/dist/es2019/plugins/table/ui/LayoutButton/index.js +2 -2
- package/dist/es2019/plugins/table/ui/TableFloatingControls/index.js +2 -3
- package/dist/es2019/plugins/table/ui/common-styles.js +1 -1
- package/dist/es2019/plugins/table/utils/analytics.js +16 -1
- package/dist/es2019/plugins/table/utils/index.js +1 -1
- package/dist/es2019/selection-api/api.js +22 -0
- package/dist/es2019/types/browser.js +0 -1
- package/dist/es2019/ui/ColorPalette/Color/index.js +1 -66
- package/dist/es2019/ui/ColorPalette/Palettes/cellBackgroundColorPalette.js +1 -14
- package/dist/es2019/ui/ColorPalette/Palettes/common.js +1 -20
- package/dist/es2019/ui/ColorPalette/Palettes/paletteMessages.js +2 -113
- package/dist/es2019/ui/ColorPalette/Palettes/panelBackgroundPalette.js +1 -137
- package/dist/es2019/ui/ColorPalette/Palettes/statusColorPalette.js +1 -51
- package/dist/es2019/ui/ColorPalette/Palettes/textColorPalette.js +1 -25
- package/dist/es2019/ui/ColorPalette/index.js +2 -62
- package/dist/es2019/ui/Dropdown/index.js +2 -84
- package/dist/es2019/ui/DropdownMenu/index.js +2 -244
- package/dist/es2019/ui/Toolbar/types.js +1 -30
- package/dist/es2019/ui/ToolbarButton/index.js +2 -94
- package/dist/es2019/ui/WithPluginState/index.js +1 -1
- package/dist/es2019/ui/styles.js +9 -47
- package/dist/es2019/ui/with-outer-listeners.js +2 -104
- package/dist/es2019/utils/dom.js +1 -113
- package/dist/es2019/utils/index.js +2 -21
- package/dist/es2019/utils/node-width.js +1 -75
- package/dist/es2019/utils/nodes.js +1 -88
- package/dist/es2019/utils/plugin-state-factory.js +1 -107
- package/dist/es2019/utils/selection.js +2 -52
- package/dist/es2019/utils/slice.js +1 -56
- package/dist/es2019/utils/step.js +1 -35
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/analytics-api/api.js +27 -0
- package/dist/esm/analytics-api/attach-payload-into-transaction.js +22 -0
- package/dist/esm/analytics-api/editor-state-context.js +81 -0
- package/dist/esm/analytics-api/map-attributes.js +20 -0
- package/dist/esm/create-editor/ReactEditorView.js +44 -6
- package/dist/esm/create-editor/ReactEditorViewContext.js +1 -2
- package/dist/esm/create-editor/create-plugins-list.js +15 -4
- package/dist/esm/event-dispatcher/index.js +1 -74
- package/dist/esm/insert-api/api.js +37 -0
- package/dist/esm/insert-api/insert-content-handlers.js +88 -0
- package/dist/esm/insert-api/insert-node-helpers.js +138 -0
- package/dist/{es2019/plugins/analytics/types/config-panel-events.js → esm/insert-api/types.js} +0 -0
- package/dist/esm/keymaps/index.js +1 -184
- package/dist/esm/messages.js +2 -123
- package/dist/esm/plugins/analytics/index.js +1 -1
- package/dist/esm/plugins/analytics/types/enums.js +1 -336
- package/dist/esm/plugins/analytics/types/extension-events.js +1 -22
- package/dist/esm/plugins/analytics/types/general-events.js +1 -30
- package/dist/esm/plugins/analytics/types/index.js +1 -6
- package/dist/esm/plugins/analytics/types/inline-comment-events.js +1 -7
- package/dist/esm/plugins/analytics/types/node-events.js +1 -18
- package/dist/esm/plugins/analytics/types/smart-links.js +1 -12
- package/dist/esm/plugins/analytics/types/toolbar-button.js +1 -19
- package/dist/esm/plugins/analytics/utils.js +12 -113
- package/dist/esm/plugins/expand/utils.js +1 -34
- package/dist/esm/plugins/extension/actions.js +1 -24
- package/dist/esm/plugins/extension/ui/Extension/styles.js +2 -3
- package/dist/esm/plugins/insert-block/index.js +1 -0
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +22 -12
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/messages.js +1 -168
- package/dist/esm/plugins/layout/styles.js +2 -3
- package/dist/esm/plugins/layout/utils.js +1 -58
- package/dist/esm/plugins/media/nodeviews/mediaSingle.js +10 -0
- package/dist/esm/plugins/paste/handlers.js +8 -4
- package/dist/esm/plugins/paste/util/index.js +23 -0
- package/dist/esm/plugins/selection/gap-cursor/selection.js +1 -176
- package/dist/esm/plugins/selection/gap-cursor/utils/is-ignored.js +1 -5
- package/dist/esm/plugins/selection/gap-cursor/utils/is-valid-target-node.js +1 -4
- package/dist/esm/plugins/selection/gap-cursor/utils.js +4 -4
- package/dist/esm/plugins/selection/gap-cursor-selection.js +1 -1
- package/dist/esm/plugins/selection/types.js +2 -9
- package/dist/esm/plugins/selection/utils.js +1 -1
- package/dist/esm/plugins/table/commands/go-to-next-cell.js +34 -32
- package/dist/esm/plugins/table/commands/insert.js +57 -49
- package/dist/esm/plugins/table/commands/selection.js +303 -215
- package/dist/esm/plugins/table/commands-with-analytics.js +241 -220
- package/dist/esm/plugins/table/event-handlers.js +60 -59
- package/dist/esm/plugins/table/index.js +62 -18
- package/dist/esm/plugins/table/nodeviews/TableComponent.js +20 -21
- package/dist/esm/plugins/table/nodeviews/table.js +19 -9
- package/dist/esm/plugins/table/nodeviews/tableCell.js +11 -12
- package/dist/esm/plugins/table/nodeviews/update-overflow-shadows.js +25 -24
- package/dist/esm/plugins/table/pm-plugins/keymap.js +14 -13
- package/dist/esm/plugins/table/pm-plugins/main.js +8 -8
- package/dist/esm/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +4 -6
- package/dist/esm/plugins/table/pm-plugins/sticky-headers/plugin.js +2 -1
- package/dist/esm/plugins/table/pm-plugins/table-resizing/event-handlers.js +7 -8
- package/dist/esm/plugins/table/pm-plugins/table-resizing/plugin.js +2 -2
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/dom.js +30 -28
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/misc.js +4 -4
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +3 -2
- package/dist/esm/plugins/table/pm-plugins/table-selection-keymap.js +3 -3
- package/dist/esm/plugins/table/toolbar.js +75 -73
- package/dist/esm/plugins/table/transforms/column-width.js +41 -38
- package/dist/esm/plugins/table/transforms/replace-table.js +4 -4
- package/dist/esm/plugins/table/ui/FloatingContextualButton/index.js +2 -2
- package/dist/esm/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +25 -21
- package/dist/esm/plugins/table/ui/FloatingContextualMenu/index.js +6 -2
- package/dist/esm/plugins/table/ui/FloatingDeleteButton/index.js +6 -4
- package/dist/esm/plugins/table/ui/FloatingInsertButton/index.js +9 -6
- package/dist/esm/plugins/table/ui/LayoutButton/index.js +2 -2
- package/dist/esm/plugins/table/ui/TableFloatingControls/index.js +4 -5
- package/dist/esm/plugins/table/ui/common-styles.js +1 -1
- package/dist/esm/plugins/table/utils/analytics.js +22 -1
- package/dist/esm/plugins/table/utils/index.js +1 -1
- package/dist/esm/selection-api/api.js +23 -0
- package/dist/esm/types/browser.js +0 -1
- package/dist/esm/ui/ColorPalette/Color/index.js +1 -93
- package/dist/esm/ui/ColorPalette/Palettes/cellBackgroundColorPalette.js +1 -14
- package/dist/esm/ui/ColorPalette/Palettes/common.js +1 -19
- package/dist/esm/ui/ColorPalette/Palettes/paletteMessages.js +2 -113
- package/dist/esm/ui/ColorPalette/Palettes/panelBackgroundPalette.js +1 -147
- package/dist/esm/ui/ColorPalette/Palettes/statusColorPalette.js +1 -51
- package/dist/esm/ui/ColorPalette/Palettes/textColorPalette.js +1 -25
- package/dist/esm/ui/ColorPalette/index.js +2 -64
- package/dist/esm/ui/Dropdown/index.js +2 -106
- package/dist/esm/ui/DropdownMenu/index.js +2 -265
- package/dist/esm/ui/Toolbar/types.js +1 -30
- package/dist/esm/ui/ToolbarButton/index.js +2 -102
- package/dist/esm/ui/WithPluginState/index.js +1 -1
- package/dist/esm/ui/styles.js +17 -20
- package/dist/esm/ui/with-outer-listeners.js +2 -139
- package/dist/esm/utils/dom.js +1 -113
- package/dist/esm/utils/index.js +5 -23
- package/dist/esm/utils/node-width.js +1 -73
- package/dist/esm/utils/nodes.js +1 -100
- package/dist/esm/utils/plugin-state-factory.js +1 -106
- package/dist/esm/utils/selection.js +2 -50
- package/dist/esm/utils/slice.js +1 -59
- package/dist/esm/utils/step.js +1 -37
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/actions/index.d.ts +2 -16
- package/dist/types/analytics-api/api.d.ts +9 -0
- package/dist/types/analytics-api/attach-payload-into-transaction.d.ts +10 -0
- package/dist/types/analytics-api/editor-state-context.d.ts +9 -0
- package/dist/types/analytics-api/map-attributes.d.ts +2 -0
- package/dist/types/create-editor/ReactEditorView.d.ts +1 -0
- package/dist/types/create-editor/ReactEditorViewContext.d.ts +1 -7
- package/dist/types/create-editor/create-plugins-list.d.ts +5 -1
- package/dist/types/event-dispatcher/index.d.ts +2 -19
- package/dist/types/insert-api/api.d.ts +9 -0
- package/dist/types/insert-api/insert-content-handlers.d.ts +9 -0
- package/dist/types/insert-api/insert-node-helpers.d.ts +30 -0
- package/dist/types/insert-api/types.d.ts +16 -0
- package/dist/types/keymaps/index.d.ts +2 -89
- package/dist/types/labs/next/presets/cxhtml.d.ts +1 -1
- package/dist/types/labs/next/presets/mobile.d.ts +1 -1
- package/dist/types/messages.d.ts +2 -124
- package/dist/types/plugins/analytics/index.d.ts +2 -2
- package/dist/types/plugins/analytics/types/dispatch-analytics-event.d.ts +1 -2
- package/dist/types/plugins/analytics/types/enums.d.ts +1 -313
- package/dist/types/plugins/analytics/types/events.d.ts +1 -111
- package/dist/types/plugins/analytics/types/experimental-events.d.ts +1 -17
- package/dist/types/plugins/analytics/types/extension-events.d.ts +2 -43
- package/dist/types/plugins/analytics/types/general-events.d.ts +2 -179
- package/dist/types/plugins/analytics/types/index.d.ts +4 -14
- package/dist/types/plugins/analytics/types/inline-comment-events.d.ts +2 -17
- package/dist/types/plugins/analytics/types/link-tool-bar-events.d.ts +1 -76
- package/dist/types/plugins/analytics/types/media-events.d.ts +1 -16
- package/dist/types/plugins/analytics/types/node-events.d.ts +2 -56
- package/dist/types/plugins/analytics/types/selection-events.d.ts +1 -18
- package/dist/types/plugins/analytics/types/smart-links.d.ts +2 -13
- package/dist/types/plugins/analytics/types/toolbar-button.d.ts +2 -22
- package/dist/types/plugins/analytics/types/type-ahead.d.ts +1 -27
- package/dist/types/plugins/analytics/utils.d.ts +3 -8
- package/dist/types/plugins/annotation/pm-plugins/plugin-factory.d.ts +1 -1
- package/dist/types/plugins/card/pm-plugins/util/state.d.ts +1 -1
- package/dist/types/plugins/code-bidi-warning/pm-plugins/plugin-factory.d.ts +1 -1
- package/dist/types/plugins/context-panel/types.d.ts +1 -3
- package/dist/types/plugins/expand/pm-plugins/plugin-factory.d.ts +1 -1
- package/dist/types/plugins/expand/utils.d.ts +1 -5
- package/dist/types/plugins/extension/actions.d.ts +2 -6
- package/dist/types/plugins/extension/commands.d.ts +7 -7
- package/dist/types/plugins/extension/plugin-factory.d.ts +2 -2
- package/dist/types/plugins/extension/ui/Extension/styles.d.ts +2 -2
- package/dist/types/plugins/find-replace/commands.d.ts +7 -7
- package/dist/types/plugins/find-replace/plugin.d.ts +1 -1
- package/dist/types/plugins/floating-toolbar/pm-plugins/toolbar-data/plugin-factory.d.ts +1 -1
- package/dist/types/plugins/floating-toolbar/types.d.ts +1 -153
- package/dist/types/plugins/floating-toolbar/ui/Button.d.ts +2 -1
- package/dist/types/plugins/floating-toolbar/ui/Select.d.ts +2 -12
- package/dist/types/plugins/floating-toolbar/ui/types.d.ts +1 -20
- package/dist/types/plugins/insert-block/index.d.ts +2 -0
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/messages.d.ts +1 -167
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/types.d.ts +3 -1
- package/dist/types/plugins/layout/styles.d.ts +2 -2
- package/dist/types/plugins/layout/utils.d.ts +1 -15
- package/dist/types/plugins/media/commands/linking.d.ts +3 -3
- package/dist/types/plugins/media/nodeviews/mediaNodeView/index.d.ts +1 -1
- package/dist/types/plugins/media/nodeviews/mediaSingle.d.ts +1 -1
- package/dist/types/plugins/media/pm-plugins/alt-text/commands.d.ts +2 -2
- package/dist/types/plugins/media/pm-plugins/alt-text/index.d.ts +1 -1
- package/dist/types/plugins/media/pm-plugins/linking/index.d.ts +1 -1
- package/dist/types/plugins/mobile-dimensions/commands.d.ts +4 -4
- package/dist/types/plugins/mobile-dimensions/plugin-factory.d.ts +1 -1
- package/dist/types/plugins/paste/util/index.d.ts +2 -1
- package/dist/types/plugins/selection/commands.d.ts +1 -1
- package/dist/types/plugins/selection/gap-cursor/selection.d.ts +1 -40
- package/dist/types/plugins/selection/gap-cursor/utils/is-ignored.d.ts +1 -2
- package/dist/types/plugins/selection/gap-cursor/utils/is-valid-target-node.d.ts +1 -2
- package/dist/types/plugins/selection/gap-cursor-selection.d.ts +1 -1
- package/dist/types/plugins/selection/plugin-factory.d.ts +1 -1
- package/dist/types/plugins/selection/types.d.ts +4 -19
- package/dist/types/plugins/table/commands/go-to-next-cell.d.ts +3 -2
- package/dist/types/plugins/table/commands/hover.d.ts +7 -7
- package/dist/types/plugins/table/commands/insert.d.ts +5 -4
- package/dist/types/plugins/table/commands/misc.d.ts +8 -8
- package/dist/types/plugins/table/commands/selection.d.ts +4 -3
- package/dist/types/plugins/table/commands/toggle.d.ts +1 -1
- package/dist/types/plugins/table/commands-with-analytics.d.ts +21 -19
- package/dist/types/plugins/table/event-handlers.d.ts +4 -2
- package/dist/types/plugins/table/index.d.ts +7 -0
- package/dist/types/plugins/table/nodeviews/TableComponent.d.ts +4 -2
- package/dist/types/plugins/table/nodeviews/table.d.ts +2 -1
- package/dist/types/plugins/table/nodeviews/tableCell.d.ts +2 -1
- package/dist/types/plugins/table/nodeviews/types.d.ts +3 -0
- package/dist/types/plugins/table/nodeviews/update-overflow-shadows.d.ts +2 -1
- package/dist/types/plugins/table/pm-plugins/keymap.d.ts +3 -1
- package/dist/types/plugins/table/pm-plugins/main.d.ts +4 -2
- package/dist/types/plugins/table/pm-plugins/plugin-factory.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/sticky-headers/commands.d.ts +2 -2
- package/dist/types/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.d.ts +2 -1
- package/dist/types/plugins/table/pm-plugins/sticky-headers/plugin-state.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/sticky-headers/plugin.d.ts +2 -1
- package/dist/types/plugins/table/pm-plugins/table-resizing/commands.d.ts +4 -4
- package/dist/types/plugins/table/pm-plugins/table-resizing/event-handlers.d.ts +3 -1
- package/dist/types/plugins/table/pm-plugins/table-resizing/plugin-factory.d.ts +2 -2
- package/dist/types/plugins/table/pm-plugins/table-resizing/plugin.d.ts +3 -1
- package/dist/types/plugins/table/pm-plugins/table-resizing/utils/dom.d.ts +2 -1
- package/dist/types/plugins/table/pm-plugins/table-resizing/utils/misc.d.ts +3 -1
- package/dist/types/plugins/table/pm-plugins/table-resizing/utils/resize-state.d.ts +2 -1
- package/dist/types/plugins/table/pm-plugins/table-selection-keymap.d.ts +2 -1
- package/dist/types/plugins/table/toolbar.d.ts +5 -3
- package/dist/types/plugins/table/transforms/column-width.d.ts +2 -1
- package/dist/types/plugins/table/transforms/replace-table.d.ts +3 -2
- package/dist/types/plugins/table/types.d.ts +3 -1
- package/dist/types/plugins/table/ui/FloatingContextualButton/index.d.ts +1 -1
- package/dist/types/plugins/table/ui/FloatingContextualMenu/ContextualMenu.d.ts +4 -0
- package/dist/types/plugins/table/ui/FloatingContextualMenu/index.d.ts +5 -1
- package/dist/types/plugins/table/ui/FloatingDeleteButton/index.d.ts +2 -0
- package/dist/types/plugins/table/ui/FloatingInsertButton/index.d.ts +5 -1
- package/dist/types/plugins/table/ui/LayoutButton/index.d.ts +2 -0
- package/dist/types/plugins/table/ui/TableFloatingControls/index.d.ts +2 -0
- package/dist/types/plugins/table/utils/analytics.d.ts +3 -0
- package/dist/types/plugins/table/utils/index.d.ts +1 -1
- package/dist/types/plugins/type-ahead/types.d.ts +2 -50
- package/dist/types/plugins/width/index.d.ts +3 -6
- package/dist/types/selection-api/api.d.ts +11 -0
- package/dist/types/types/browser.d.ts +1 -10
- package/dist/types/types/editor-appearance.d.ts +1 -1
- package/dist/types/types/editor-plugin.d.ts +1 -59
- package/dist/types/types/editor-react-context.d.ts +1 -6
- package/dist/types/types/empty-state-handler.d.ts +1 -7
- package/dist/types/types/feature-flags.d.ts +1 -343
- package/dist/types/types/pm-config.d.ts +1 -14
- package/dist/types/types/pm-plugin.d.ts +1 -27
- package/dist/types/types/ui-components.d.ts +1 -22
- package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +118 -118
- package/dist/types/ui/ColorPalette/Color/index.d.ts +1 -19
- package/dist/types/ui/ColorPalette/Palettes/cellBackgroundColorPalette.d.ts +1 -2
- package/dist/types/ui/ColorPalette/Palettes/common.d.ts +1 -1
- package/dist/types/ui/ColorPalette/Palettes/paletteMessages.d.ts +2 -113
- package/dist/types/ui/ColorPalette/Palettes/panelBackgroundPalette.d.ts +1 -3
- package/dist/types/ui/ColorPalette/Palettes/statusColorPalette.d.ts +1 -3
- package/dist/types/ui/ColorPalette/Palettes/textColorPalette.d.ts +1 -3
- package/dist/types/ui/ColorPalette/Palettes/type.d.ts +1 -8
- package/dist/types/ui/ColorPalette/index.d.ts +2 -23
- package/dist/types/ui/ColorPickerButton/index.d.ts +1 -1
- package/dist/types/ui/ConfigPanel/ConfigPanel.d.ts +1 -1
- package/dist/types/ui/ContentStyles/index.d.ts +2 -2
- package/dist/types/ui/Dropdown/index.d.ts +2 -33
- package/dist/types/ui/DropdownMenu/index.d.ts +2 -18
- package/dist/types/ui/DropdownMenu/types.d.ts +1 -43
- package/dist/types/ui/Toolbar/types.d.ts +2 -30
- package/dist/types/ui/ToolbarButton/index.d.ts +3 -52
- package/dist/types/ui/styles.d.ts +3 -3
- package/dist/types/ui/with-outer-listeners.d.ts +2 -10
- package/dist/types/utils/document-logger.d.ts +2 -7
- package/dist/types/utils/dom.d.ts +2 -26
- package/dist/types/utils/index.d.ts +3 -6
- package/dist/types/utils/node-width.d.ts +1 -7
- package/dist/types/utils/nodes.d.ts +1 -35
- package/dist/types/utils/performance/plugin-performance-report.d.ts +2 -25
- package/dist/types/utils/plugin-state-factory.d.ts +2 -16
- package/dist/types/utils/selection.d.ts +3 -6
- package/dist/types/utils/slice.d.ts +2 -11
- package/dist/types/utils/step.d.ts +1 -15
- package/package.json +8 -9
- package/dist/cjs/plugins/analytics/types/config-panel-events.js +0 -5
- package/dist/cjs/plugins/analytics/types/cut-copy-events.js +0 -5
- package/dist/cjs/plugins/analytics/types/date-events.js +0 -5
- package/dist/cjs/plugins/analytics/types/element-browser-events.js +0 -5
- package/dist/cjs/plugins/analytics/types/find-replace-events.js +0 -5
- package/dist/cjs/plugins/analytics/types/format-events.js +0 -24
- package/dist/cjs/plugins/analytics/types/insert-events.js +0 -51
- package/dist/cjs/plugins/analytics/types/list-events.js +0 -25
- package/dist/cjs/plugins/analytics/types/paste-events.js +0 -55
- package/dist/cjs/plugins/analytics/types/substitute-events.js +0 -24
- package/dist/cjs/plugins/analytics/types/table-events.js +0 -43
- package/dist/cjs/plugins/analytics/types/utils.js +0 -27
- package/dist/cjs/ui/ColorPalette/Color/styles.js +0 -21
- package/dist/cjs/ui/ColorPalette/Palettes/getColorMessage.js +0 -17
- package/dist/cjs/ui/ColorPalette/styles.js +0 -19
- package/dist/cjs/ui/DropList/index.js +0 -215
- package/dist/cjs/ui/Layer/index.js +0 -245
- package/dist/cjs/ui/Layer/internal/helpers.js +0 -70
- package/dist/cjs/ui/ToolbarButton/styles.js +0 -26
- package/dist/es2019/plugins/analytics/types/cut-copy-events.js +0 -1
- package/dist/es2019/plugins/analytics/types/date-events.js +0 -1
- package/dist/es2019/plugins/analytics/types/element-browser-events.js +0 -1
- package/dist/es2019/plugins/analytics/types/find-replace-events.js +0 -1
- package/dist/es2019/plugins/analytics/types/format-events.js +0 -16
- package/dist/es2019/plugins/analytics/types/insert-events.js +0 -41
- package/dist/es2019/plugins/analytics/types/list-events.js +0 -17
- package/dist/es2019/plugins/analytics/types/paste-events.js +0 -46
- package/dist/es2019/plugins/analytics/types/substitute-events.js +0 -16
- package/dist/es2019/plugins/analytics/types/table-events.js +0 -34
- package/dist/es2019/plugins/analytics/types/utils.js +0 -19
- package/dist/es2019/ui/ColorPalette/Color/styles.js +0 -24
- package/dist/es2019/ui/ColorPalette/Palettes/getColorMessage.js +0 -14
- package/dist/es2019/ui/ColorPalette/styles.js +0 -7
- package/dist/es2019/ui/DropList/index.js +0 -186
- package/dist/es2019/ui/Layer/index.js +0 -195
- package/dist/es2019/ui/Layer/internal/helpers.js +0 -62
- package/dist/es2019/ui/ToolbarButton/styles.js +0 -12
- package/dist/esm/plugins/analytics/types/avatar.js +0 -1
- package/dist/esm/plugins/analytics/types/config-panel-events.js +0 -1
- package/dist/esm/plugins/analytics/types/cut-copy-events.js +0 -1
- package/dist/esm/plugins/analytics/types/date-events.js +0 -1
- package/dist/esm/plugins/analytics/types/element-browser-events.js +0 -1
- package/dist/esm/plugins/analytics/types/find-replace-events.js +0 -1
- package/dist/esm/plugins/analytics/types/format-events.js +0 -16
- package/dist/esm/plugins/analytics/types/insert-events.js +0 -41
- package/dist/esm/plugins/analytics/types/list-events.js +0 -17
- package/dist/esm/plugins/analytics/types/paste-events.js +0 -46
- package/dist/esm/plugins/analytics/types/substitute-events.js +0 -16
- package/dist/esm/plugins/analytics/types/table-events.js +0 -34
- package/dist/esm/plugins/analytics/types/utils.js +0 -19
- package/dist/esm/ui/ColorPalette/Color/styles.js +0 -8
- package/dist/esm/ui/ColorPalette/Palettes/getColorMessage.js +0 -10
- package/dist/esm/ui/ColorPalette/styles.js +0 -7
- package/dist/esm/ui/DropList/index.js +0 -203
- package/dist/esm/ui/Layer/index.js +0 -228
- package/dist/esm/ui/Layer/internal/helpers.js +0 -62
- package/dist/esm/ui/ToolbarButton/styles.js +0 -12
- package/dist/types/plugins/analytics/types/avatar.d.ts +0 -5
- package/dist/types/plugins/analytics/types/config-panel-events.d.ts +0 -17
- package/dist/types/plugins/analytics/types/cut-copy-events.d.ts +0 -12
- package/dist/types/plugins/analytics/types/date-events.d.ts +0 -17
- package/dist/types/plugins/analytics/types/element-browser-events.d.ts +0 -11
- package/dist/types/plugins/analytics/types/find-replace-events.d.ts +0 -23
- package/dist/types/plugins/analytics/types/format-events.d.ts +0 -49
- package/dist/types/plugins/analytics/types/insert-events.d.ts +0 -128
- package/dist/types/plugins/analytics/types/list-events.d.ts +0 -52
- package/dist/types/plugins/analytics/types/paste-events.d.ts +0 -39
- package/dist/types/plugins/analytics/types/substitute-events.d.ts +0 -26
- package/dist/types/plugins/analytics/types/table-events.d.ts +0 -94
- package/dist/types/plugins/analytics/types/utils.d.ts +0 -45
- package/dist/types/ui/ColorPalette/Color/styles.d.ts +0 -2
- package/dist/types/ui/ColorPalette/Palettes/getColorMessage.d.ts +0 -2
- package/dist/types/ui/ColorPalette/styles.d.ts +0 -1
- package/dist/types/ui/DropList/index.d.ts +0 -22
- package/dist/types/ui/Layer/index.d.ts +0 -47
- package/dist/types/ui/Layer/internal/helpers.d.ts +0 -5
- package/dist/types/ui/ToolbarButton/styles.d.ts +0 -4
package/dist/cjs/utils/nodes.js
CHANGED
|
@@ -3,132 +3,65 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
* Uses from/to positions in transaction's steps to work out which nodes will
|
|
11
|
-
* be changed by the transaction
|
|
12
|
-
*/
|
|
13
|
-
var findChangedNodesFromTransaction = function findChangedNodesFromTransaction(tr) {
|
|
14
|
-
var nodes = [];
|
|
15
|
-
var steps = tr.steps || [];
|
|
16
|
-
steps.forEach(function (step) {
|
|
17
|
-
var to = step.to,
|
|
18
|
-
from = step.from,
|
|
19
|
-
slice = step.slice;
|
|
20
|
-
var size = slice && slice.content ? slice.content.size : 0;
|
|
21
|
-
|
|
22
|
-
for (var i = from; i <= to + size; i++) {
|
|
23
|
-
if (i <= tr.doc.content.size) {
|
|
24
|
-
(function () {
|
|
25
|
-
var topLevelNode = tr.doc.resolve(i).node(1);
|
|
26
|
-
|
|
27
|
-
if (topLevelNode && !nodes.find(function (n) {
|
|
28
|
-
return n === topLevelNode;
|
|
29
|
-
})) {
|
|
30
|
-
nodes.push(topLevelNode);
|
|
31
|
-
}
|
|
32
|
-
})();
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
return nodes;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
exports.findChangedNodesFromTransaction = findChangedNodesFromTransaction;
|
|
40
|
-
|
|
41
|
-
var validNode = function validNode(node) {
|
|
42
|
-
try {
|
|
43
|
-
node.check(); // this will throw an error if the node is invalid
|
|
44
|
-
} catch (error) {
|
|
45
|
-
return false;
|
|
6
|
+
Object.defineProperty(exports, "SelectedState", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _utils.SelectedState;
|
|
46
10
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
exports.validNode = validNode;
|
|
54
|
-
|
|
55
|
-
var validateNodes = function validateNodes(nodes) {
|
|
56
|
-
return nodes.every(validNode);
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
exports.validateNodes = validateNodes;
|
|
60
|
-
|
|
61
|
-
var isType = function isType(node, type) {
|
|
62
|
-
return type && node && node.type === type;
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
exports.isType = isType;
|
|
66
|
-
|
|
67
|
-
var isParagraph = function isParagraph(node, schema) {
|
|
68
|
-
return isType(node, schema.nodes.paragraph);
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
exports.isParagraph = isParagraph;
|
|
72
|
-
|
|
73
|
-
var isText = function isText(node, schema) {
|
|
74
|
-
return isType(node, schema.nodes.text);
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
exports.isText = isText;
|
|
78
|
-
|
|
79
|
-
var isLinkMark = function isLinkMark(node, schema) {
|
|
80
|
-
return isType(node, schema.marks.link);
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
exports.isLinkMark = isLinkMark;
|
|
84
|
-
var SelectedState;
|
|
85
|
-
/**
|
|
86
|
-
* Returns if the current selection from achor-head is selecting the node.
|
|
87
|
-
* If the node is not selected then null is returned.
|
|
88
|
-
* If the node is selected then an enum is returned that describes weather the node
|
|
89
|
-
* is fully selected by a range or if the "inside" of the node has been selected or clicked.
|
|
90
|
-
*/
|
|
91
|
-
|
|
92
|
-
exports.SelectedState = SelectedState;
|
|
93
|
-
|
|
94
|
-
(function (SelectedState) {
|
|
95
|
-
SelectedState[SelectedState["selectedInRange"] = 0] = "selectedInRange";
|
|
96
|
-
SelectedState[SelectedState["selectedInside"] = 1] = "selectedInside";
|
|
97
|
-
})(SelectedState || (exports.SelectedState = SelectedState = {}));
|
|
98
|
-
|
|
99
|
-
var isNodeSelectedOrInRange = function isNodeSelectedOrInRange(anchorPosition, headPosition, nodePosition, nodeSize) {
|
|
100
|
-
var rangeStart = Math.min(anchorPosition, headPosition);
|
|
101
|
-
var rangeEnd = Math.max(anchorPosition, headPosition);
|
|
102
|
-
var nodeStart = nodePosition;
|
|
103
|
-
var nodeEnd = nodePosition + nodeSize;
|
|
104
|
-
|
|
105
|
-
if (anchorPosition === headPosition) {
|
|
106
|
-
return null;
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "findChangedNodesFromTransaction", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _utils.findChangedNodesFromTransaction;
|
|
107
16
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "isLinkMark", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function get() {
|
|
21
|
+
return _utils.isLinkMark;
|
|
111
22
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "isNodeSelectedOrInRange", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function get() {
|
|
27
|
+
return _utils.isNodeSelectedOrInRange;
|
|
115
28
|
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "isParagraph", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function get() {
|
|
33
|
+
return _utils.isParagraph;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "isSupportedInParent", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function get() {
|
|
39
|
+
return _utils.isSupportedInParent;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(exports, "isText", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function get() {
|
|
45
|
+
return _utils.isText;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(exports, "isType", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function get() {
|
|
51
|
+
return _utils.isType;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
Object.defineProperty(exports, "validNode", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function get() {
|
|
57
|
+
return _utils.validNode;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
Object.defineProperty(exports, "validateNodes", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function get() {
|
|
63
|
+
return _utils.validateNodes;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
116
66
|
|
|
117
|
-
|
|
118
|
-
};
|
|
119
|
-
/**
|
|
120
|
-
* Checks if a particular node fragment is supported in the parent
|
|
121
|
-
* @param state EditorState
|
|
122
|
-
* @param fragment The fragment to be checked for
|
|
123
|
-
*/
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
exports.isNodeSelectedOrInRange = isNodeSelectedOrInRange;
|
|
127
|
-
|
|
128
|
-
var isSupportedInParent = function isSupportedInParent(state, fragment, currentAppearance) {
|
|
129
|
-
var depth = currentAppearance === 'embed' || currentAppearance === 'block' ? undefined : -1;
|
|
130
|
-
var parent = state.selection.$from.node(depth);
|
|
131
|
-
return parent && parent.type.validContent(fragment);
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
exports.isSupportedInParent = isSupportedInParent;
|
|
67
|
+
var _utils = require("@atlaskit/editor-common/utils");
|
|
@@ -3,111 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
* - plugin's state is stored as a single object
|
|
13
|
-
* - `Reducer` specifies how plugin's state changes in response to commands
|
|
14
|
-
* - `Command` describes only what happen, but not how state changes
|
|
15
|
-
* - `mapping` could be used to map ProseMirror positions stored in plugin's state
|
|
16
|
-
*
|
|
17
|
-
* Example:
|
|
18
|
-
* const { createPluginState, createCommand, getPluginState } = pluginFactory(
|
|
19
|
-
* reducer,
|
|
20
|
-
* pluginKey
|
|
21
|
-
* );
|
|
22
|
-
*
|
|
23
|
-
* export const createPlugin = (dispatch: Dispatch, initialState) =>
|
|
24
|
-
* new SafePlugin({
|
|
25
|
-
* state: createPluginState(dispatch, initialState),
|
|
26
|
-
* key: pluginKey
|
|
27
|
-
* });
|
|
28
|
-
*
|
|
29
|
-
* Example of a reducer:
|
|
30
|
-
*
|
|
31
|
-
* export const reducer = (
|
|
32
|
-
* state: TablePluginState,
|
|
33
|
-
* action: TableAction,
|
|
34
|
-
* ): TablePluginState => {
|
|
35
|
-
* switch (action.type) {
|
|
36
|
-
* case 'TOGGLE_CONTEXTUAL_MENU':
|
|
37
|
-
* return {
|
|
38
|
-
* ...state,
|
|
39
|
-
* isContextualMenuOpen: !state.isContextualMenuOpen,
|
|
40
|
-
* };
|
|
41
|
-
* default:
|
|
42
|
-
* return state;
|
|
43
|
-
* }
|
|
44
|
-
* };
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
* Example of a command:
|
|
48
|
-
*
|
|
49
|
-
* export const toggleContextualMenu = createCommand({
|
|
50
|
-
* type: 'TOGGLE_CONTEXTUAL_MENU',
|
|
51
|
-
* }, tr => tr.setMeta('addToHistory', false));
|
|
52
|
-
*
|
|
53
|
-
*/
|
|
54
|
-
function isFunction(x) {
|
|
55
|
-
return typeof x === 'function';
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function pluginFactory(pluginKey, reducer) {
|
|
59
|
-
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
60
|
-
var mapping = options.mapping,
|
|
61
|
-
onDocChanged = options.onDocChanged,
|
|
62
|
-
onSelectionChanged = options.onSelectionChanged;
|
|
63
|
-
return {
|
|
64
|
-
createPluginState: function createPluginState(dispatch, initialState) {
|
|
65
|
-
return {
|
|
66
|
-
init: function init(_, state) {
|
|
67
|
-
return isFunction(initialState) ? initialState(state) : initialState;
|
|
68
|
-
},
|
|
69
|
-
apply: function apply(tr, _pluginState) {
|
|
70
|
-
var oldState = mapping ? mapping(tr, _pluginState) : _pluginState;
|
|
71
|
-
var newState = oldState;
|
|
72
|
-
var meta = tr.getMeta(pluginKey);
|
|
73
|
-
|
|
74
|
-
if (meta) {
|
|
75
|
-
newState = reducer(oldState, meta);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
if (onDocChanged && tr.docChanged) {
|
|
79
|
-
newState = onDocChanged(tr, newState);
|
|
80
|
-
} else if (onSelectionChanged && tr.selectionSet) {
|
|
81
|
-
newState = onSelectionChanged(tr, newState);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
if (newState !== oldState) {
|
|
85
|
-
dispatch(pluginKey, newState);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
return newState;
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
},
|
|
92
|
-
createCommand: function createCommand(action, transform) {
|
|
93
|
-
return function (state, dispatch) {
|
|
94
|
-
if (dispatch) {
|
|
95
|
-
var _tr = transform ? transform(state.tr, state) : state.tr;
|
|
96
|
-
|
|
97
|
-
var resolvedAction = isFunction(action) ? action(state) : action;
|
|
98
|
-
|
|
99
|
-
if (_tr && resolvedAction) {
|
|
100
|
-
dispatch(_tr.setMeta(pluginKey, resolvedAction));
|
|
101
|
-
} else {
|
|
102
|
-
return false;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
6
|
+
Object.defineProperty(exports, "pluginFactory", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _utils.pluginFactory;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
105
12
|
|
|
106
|
-
|
|
107
|
-
};
|
|
108
|
-
},
|
|
109
|
-
getPluginState: function getPluginState(state) {
|
|
110
|
-
return pluginKey.getState(state);
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
}
|
|
13
|
+
var _utils = require("@atlaskit/editor-common/utils");
|
|
@@ -5,11 +5,16 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.normaliseNestedLayout = exports.isValidPosition = exports.
|
|
8
|
+
exports.normaliseNestedLayout = exports.isValidPosition = exports.duplicateSelection = void 0;
|
|
9
9
|
exports.setAllSelection = setAllSelection;
|
|
10
10
|
exports.setCellSelection = setCellSelection;
|
|
11
11
|
exports.setGapCursorSelection = setGapCursorSelection;
|
|
12
|
-
exports
|
|
12
|
+
Object.defineProperty(exports, "setNodeSelection", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _utils.setNodeSelection;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
13
18
|
exports.setTextSelection = setTextSelection;
|
|
14
19
|
|
|
15
20
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
@@ -18,26 +23,14 @@ var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
|
|
|
18
23
|
|
|
19
24
|
var _prosemirrorState = require("prosemirror-state");
|
|
20
25
|
|
|
21
|
-
var _selection = require("
|
|
26
|
+
var _selection = require("@atlaskit/editor-common/selection");
|
|
27
|
+
|
|
28
|
+
var _utils = require("@atlaskit/editor-common/utils");
|
|
22
29
|
|
|
23
30
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
24
31
|
|
|
25
32
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
26
33
|
|
|
27
|
-
var setNodeSelection = function setNodeSelection(view, pos) {
|
|
28
|
-
var state = view.state,
|
|
29
|
-
dispatch = view.dispatch;
|
|
30
|
-
|
|
31
|
-
if (!isFinite(pos)) {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
var tr = state.tr.setSelection(_prosemirrorState.NodeSelection.create(state.doc, pos));
|
|
36
|
-
dispatch(tr);
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
exports.setNodeSelection = setNodeSelection;
|
|
40
|
-
|
|
41
34
|
function setTextSelection(view, anchor, head) {
|
|
42
35
|
var state = view.state,
|
|
43
36
|
dispatch = view.dispatch;
|
|
@@ -85,54 +78,10 @@ var normaliseNestedLayout = function normaliseNestedLayout(_ref, node) {
|
|
|
85
78
|
}
|
|
86
79
|
|
|
87
80
|
return node;
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
exports.normaliseNestedLayout = normaliseNestedLayout;
|
|
91
|
-
|
|
92
|
-
var isSelectionAtStartOfNode = function isSelectionAtStartOfNode($pos, parentNode) {
|
|
93
|
-
if (!parentNode) {
|
|
94
|
-
return false;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
for (var i = $pos.depth + 1; i > 0; i--) {
|
|
98
|
-
var node = $pos.node(i);
|
|
99
|
-
|
|
100
|
-
if (node && node.eq(parentNode.node)) {
|
|
101
|
-
break;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
if (i > 1 && $pos.before(i) !== $pos.before(i - 1) + 1) {
|
|
105
|
-
return false;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
return true;
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
exports.isSelectionAtStartOfNode = isSelectionAtStartOfNode;
|
|
113
|
-
|
|
114
|
-
var isSelectionAtEndOfNode = function isSelectionAtEndOfNode($pos, parentNode) {
|
|
115
|
-
if (!parentNode) {
|
|
116
|
-
return false;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
for (var i = $pos.depth + 1; i > 0; i--) {
|
|
120
|
-
var node = $pos.node(i);
|
|
121
|
-
|
|
122
|
-
if (node && node.eq(parentNode.node)) {
|
|
123
|
-
break;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
if (i > 1 && $pos.after(i) !== $pos.after(i - 1) - 1) {
|
|
127
|
-
return false;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
return true;
|
|
132
81
|
}; // checks if the given position is within the ProseMirror document
|
|
133
82
|
|
|
134
83
|
|
|
135
|
-
exports.
|
|
84
|
+
exports.normaliseNestedLayout = normaliseNestedLayout;
|
|
136
85
|
|
|
137
86
|
var isValidPosition = function isValidPosition(pos, state) {
|
|
138
87
|
if (pos >= 0 && pos <= state.doc.resolve(0).end()) {
|
package/dist/cjs/utils/slice.js
CHANGED
|
@@ -1,77 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
|
-
exports
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
exports.mapSlice = mapSlice;
|
|
13
|
-
|
|
14
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
15
|
-
|
|
16
|
-
var _prosemirrorModel = require("prosemirror-model");
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* A helper to get the underlying array of a fragment.
|
|
20
|
-
*/
|
|
21
|
-
function getFragmentBackingArray(fragment) {
|
|
22
|
-
return fragment.content;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function mapFragment(content, callback) {
|
|
26
|
-
var parent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
27
|
-
var children = [];
|
|
28
|
-
|
|
29
|
-
for (var i = 0, size = content.childCount; i < size; i++) {
|
|
30
|
-
var _node = content.child(i);
|
|
31
|
-
|
|
32
|
-
var transformed = _node.isLeaf ? callback(_node, parent, i) : callback(_node.copy(mapFragment(_node.content, callback, _node)), parent, i);
|
|
33
|
-
|
|
34
|
-
if (transformed) {
|
|
35
|
-
if (transformed instanceof _prosemirrorModel.Fragment) {
|
|
36
|
-
children.push.apply(children, (0, _toConsumableArray2.default)(getFragmentBackingArray(transformed)));
|
|
37
|
-
} else if (Array.isArray(transformed)) {
|
|
38
|
-
children.push.apply(children, (0, _toConsumableArray2.default)(transformed));
|
|
39
|
-
} else {
|
|
40
|
-
children.push(transformed);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
6
|
+
Object.defineProperty(exports, "flatmap", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _utils.flatmap;
|
|
43
10
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
var fragment = mapFragment(slice.content, callback);
|
|
50
|
-
return new _prosemirrorModel.Slice(fragment, slice.openStart, slice.openEnd);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function flatmap(fragment, callback) {
|
|
54
|
-
var fragmentContent = [];
|
|
55
|
-
|
|
56
|
-
for (var i = 0; i < fragment.childCount; i++) {
|
|
57
|
-
var child = callback(fragment.child(i), i, fragment);
|
|
58
|
-
|
|
59
|
-
if (Array.isArray(child)) {
|
|
60
|
-
fragmentContent.push.apply(fragmentContent, (0, _toConsumableArray2.default)(child));
|
|
61
|
-
} else {
|
|
62
|
-
fragmentContent.push(child);
|
|
63
|
-
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "getFragmentBackingArray", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _utils.getFragmentBackingArray;
|
|
64
16
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
var array = [];
|
|
71
|
-
|
|
72
|
-
for (var i = 0; i < node.childCount; i++) {
|
|
73
|
-
array.push(callback(node.child(i), i, node instanceof _prosemirrorModel.Fragment ? node : node.content));
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "mapChildren", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function get() {
|
|
21
|
+
return _utils.mapChildren;
|
|
74
22
|
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "mapFragment", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function get() {
|
|
27
|
+
return _utils.mapFragment;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "mapSlice", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function get() {
|
|
33
|
+
return _utils.mapSlice;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
75
36
|
|
|
76
|
-
|
|
77
|
-
}
|
|
37
|
+
var _utils = require("@atlaskit/editor-common/utils");
|
package/dist/cjs/utils/step.js
CHANGED
|
@@ -3,51 +3,23 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var _prosemirrorTransform = require("prosemirror-transform");
|
|
11
|
-
|
|
12
|
-
var stepHasSlice = function stepHasSlice(step) {
|
|
13
|
-
return step && step.hasOwnProperty('slice');
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* Checks whether a given step is adding nodes of given nodeTypes
|
|
17
|
-
*
|
|
18
|
-
* @param step Step to check
|
|
19
|
-
* @param nodeTypes NodeTypes being added
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
exports.stepHasSlice = stepHasSlice;
|
|
24
|
-
|
|
25
|
-
function stepAddsOneOf(step, nodeTypes) {
|
|
26
|
-
var adds = false;
|
|
27
|
-
|
|
28
|
-
if (!stepHasSlice(step)) {
|
|
29
|
-
return adds;
|
|
6
|
+
Object.defineProperty(exports, "extractSliceFromStep", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _utils.extractSliceFromStep;
|
|
30
10
|
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "stepAddsOneOf", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _utils.stepAddsOneOf;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "stepHasSlice", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function get() {
|
|
21
|
+
return _utils.stepHasSlice;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
31
24
|
|
|
32
|
-
|
|
33
|
-
if (nodeTypes.has(node.type)) {
|
|
34
|
-
adds = true;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
return !adds;
|
|
38
|
-
});
|
|
39
|
-
return adds;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
var extractSliceFromStep = function extractSliceFromStep(step) {
|
|
43
|
-
if (!(step instanceof _prosemirrorTransform.ReplaceStep) && !(step instanceof _prosemirrorTransform.ReplaceAroundStep)) {
|
|
44
|
-
return null;
|
|
45
|
-
} // @ts-ignore This is by design. Slice is a private property, but accesible, from ReplaceStep.
|
|
46
|
-
// However, we need to read it to found if the step was adding a newline
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
var slice = step.slice;
|
|
50
|
-
return slice;
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
exports.extractSliceFromStep = extractSliceFromStep;
|
|
25
|
+
var _utils = require("@atlaskit/editor-common/utils");
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.version = exports.nextMajorVersion = exports.name = void 0;
|
|
7
7
|
var name = "@atlaskit/editor-core";
|
|
8
8
|
exports.name = name;
|
|
9
|
-
var version = "172.
|
|
9
|
+
var version = "172.2.0";
|
|
10
10
|
exports.version = version;
|
|
11
11
|
|
|
12
12
|
var nextMajorVersion = function nextMajorVersion() {
|
package/dist/cjs/version.json
CHANGED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { FabricChannel } from '@atlaskit/analytics-listeners';
|
|
2
|
+
import { attachPayloadIntoTransaction } from './attach-payload-into-transaction';
|
|
3
|
+
export const createEditorAnalyticsAPI = ({
|
|
4
|
+
getEditorView,
|
|
5
|
+
getCreateUIAnalyticsEvent
|
|
6
|
+
}) => {
|
|
7
|
+
return {
|
|
8
|
+
attachAnalyticsEvent: payload => {
|
|
9
|
+
return tr => {
|
|
10
|
+
const createAnalyticsEvent = getCreateUIAnalyticsEvent();
|
|
11
|
+
const editorView = getEditorView();
|
|
12
|
+
|
|
13
|
+
if (!tr || !createAnalyticsEvent || !editorView) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const {
|
|
18
|
+
state: editorState
|
|
19
|
+
} = editorView;
|
|
20
|
+
attachPayloadIntoTransaction({
|
|
21
|
+
tr,
|
|
22
|
+
editorState,
|
|
23
|
+
payload,
|
|
24
|
+
channel: FabricChannel.editor
|
|
25
|
+
});
|
|
26
|
+
return true;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { getStateContext } from './editor-state-context';
|
|
2
|
+
import { mapActionSubjectIdToAttributes } from './map-attributes';
|
|
3
|
+
import { AnalyticsStep } from '@atlaskit/adf-schema/steps';
|
|
4
|
+
import { ACTION } from '@atlaskit/editor-common/analytics';
|
|
5
|
+
const actionsToIgnore = [ACTION.INVOKED, ACTION.OPENED];
|
|
6
|
+
export const attachPayloadIntoTransaction = ({
|
|
7
|
+
payload,
|
|
8
|
+
editorState,
|
|
9
|
+
tr,
|
|
10
|
+
channel
|
|
11
|
+
}) => {
|
|
12
|
+
payload = getStateContext(editorState, payload);
|
|
13
|
+
payload = mapActionSubjectIdToAttributes(payload);
|
|
14
|
+
const {
|
|
15
|
+
storedMarks
|
|
16
|
+
} = tr;
|
|
17
|
+
tr.step(new AnalyticsStep([{
|
|
18
|
+
payload,
|
|
19
|
+
channel
|
|
20
|
+
}], actionsToIgnore, tr.selection.$from.pos)); // When you add a new step all the storedMarks are removed it
|
|
21
|
+
|
|
22
|
+
if (storedMarks) {
|
|
23
|
+
tr.setStoredMarks(storedMarks);
|
|
24
|
+
}
|
|
25
|
+
};
|