@atlaskit/editor-core 180.1.0 → 181.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/CHANGELOG.md +43 -0
- package/dist/cjs/actions/index.js +25 -10
- package/dist/cjs/analytics-api/attach-payload-into-transaction.js +1 -1
- package/dist/cjs/create-editor/ReactEditorView.js +0 -5
- package/dist/cjs/create-editor/ReactEditorViewInternal.js +73 -103
- package/dist/cjs/create-editor/create-plugins-list.js +30 -3
- package/dist/cjs/create-editor/preset-utils.js +27 -0
- package/dist/cjs/editor-next/editor-internal.js +2 -2
- package/dist/cjs/editor-next/editor-migration-component.js +18 -2
- package/dist/cjs/editor-next/hooks/useProviderFactory.js +4 -3
- package/dist/cjs/editor-next/index.js +13 -9
- package/dist/cjs/editor-next/utils/getProvidersFromEditorProps.js +41 -0
- package/dist/cjs/editor-next/utils/handleProviders.js +17 -22
- package/dist/cjs/editor.js +20 -13
- package/dist/cjs/keymaps/consts.js +1 -16
- package/dist/cjs/labs/next/presets/cxhtml.js +56 -55
- package/dist/cjs/labs/next/presets/default.js +15 -42
- package/dist/cjs/labs/next/presets/mobile.js +76 -89
- package/dist/cjs/labs/next/presets/universal.js +330 -257
- package/dist/cjs/labs/next/presets/useUniversalPreset.js +36 -0
- package/dist/cjs/plugins/analytics/plugin.js +6 -0
- package/dist/cjs/plugins/annotation/utils.js +2 -36
- package/dist/cjs/plugins/base/pm-plugins/react-nodeview.js +2 -7
- package/dist/cjs/plugins/block-type/pm-plugins/input-rule.js +0 -10
- package/dist/cjs/plugins/caption/index.js +0 -7
- package/dist/cjs/plugins/card/nodeviews/blockCard.js +9 -4
- package/dist/cjs/plugins/card/nodeviews/inlineCard.js +6 -2
- package/dist/cjs/plugins/card/pm-plugins/main.js +6 -3
- package/dist/cjs/plugins/card/pm-plugins/util/resolve.js +4 -0
- package/dist/cjs/plugins/code-block/pm-plugins/main-state.js +2 -14
- package/dist/cjs/plugins/collab-edit/provider/index.js +1 -8
- package/dist/cjs/plugins/collab-edit/provider/types.js +1 -12
- package/dist/cjs/plugins/context-panel/index.js +1 -6
- package/dist/cjs/plugins/data-consumer/index.js +0 -8
- package/dist/cjs/plugins/date/utils/internal.js +0 -4
- package/dist/cjs/plugins/extension/commands.js +1 -8
- package/dist/cjs/plugins/extension/ui/Extension/Extension/index.js +9 -2
- package/dist/cjs/plugins/extension/ui/Extension/Extension/styles.js +2 -2
- package/dist/cjs/plugins/extension/ui/Extension/Lozenge.js +1 -0
- package/dist/cjs/plugins/feedback-dialog/index.js +1 -4
- package/dist/cjs/plugins/floating-toolbar/ui/Button.js +7 -3
- package/dist/cjs/plugins/floating-toolbar/ui/Dropdown.js +10 -5
- package/dist/cjs/plugins/floating-toolbar/ui/EmojiPickerButton.js +2 -9
- package/dist/cjs/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +1 -0
- package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +24 -8
- package/dist/cjs/plugins/floating-toolbar/utils.js +0 -12
- package/dist/cjs/plugins/fragment/index.js +0 -8
- package/dist/cjs/plugins/help-dialog/commands.js +2 -6
- package/dist/cjs/plugins/image-upload/pm-plugins/main.js +50 -12
- package/dist/cjs/plugins/layout/styles.js +10 -1
- package/dist/cjs/plugins/list/utils/find.js +0 -28
- package/dist/cjs/plugins/list/utils/indentation.js +1 -25
- package/dist/cjs/plugins/list/utils/node.js +0 -5
- package/dist/cjs/plugins/list/utils/selection.js +2 -15
- package/dist/cjs/plugins/media/utils/media-common.js +1 -20
- package/dist/cjs/plugins/mentions/nodeviews/mention.js +100 -16
- package/dist/cjs/plugins/mentions/type-ahead/index.js +1 -18
- package/dist/cjs/plugins/mentions/ui/InviteItem/index.js +1 -3
- package/dist/cjs/plugins/mobile-dimensions/index.js +1 -4
- package/dist/cjs/plugins/paste/index.js +1 -2
- package/dist/cjs/plugins/paste/pm-plugins/analytics.js +123 -87
- package/dist/cjs/plugins/paste/util/index.js +0 -46
- package/dist/cjs/plugins/quick-insert/assets/index.js +1 -27
- package/dist/cjs/plugins/selection/gap-cursor/actions.js +49 -44
- package/dist/cjs/plugins/status/utils.js +1 -15
- package/dist/cjs/plugins/text-color/pm-plugins/main.js +0 -1
- package/dist/cjs/plugins/text-color/ui/ToolbarTextColor/index.js +7 -5
- package/dist/cjs/plugins/text-formatting/pm-plugins/smart-input-rule.js +8 -2
- package/dist/cjs/plugins/text-formatting/utils.js +1 -26
- package/dist/cjs/plugins/type-ahead/constants.js +1 -7
- package/dist/cjs/plugins/type-ahead/pm-plugins/decorations.js +2 -35
- package/dist/cjs/plugins/type-ahead/utils.js +3 -22
- package/dist/cjs/test-utils.js +4 -12
- package/dist/cjs/ui/Appearance/Comment/Toolbar.js +43 -8
- package/dist/cjs/ui/ColorPalette/index.js +18 -0
- package/dist/cjs/ui/ColorPickerButton/index.js +6 -2
- package/dist/cjs/ui/ConfigPanel/Fields/Expand.js +1 -0
- package/dist/cjs/ui/ConfigPanel/utils.js +4 -17
- package/dist/cjs/ui/ContentStyles/index.js +1 -1
- package/dist/cjs/ui/ElementBrowser/ModalElementBrowser.js +1 -1
- package/dist/cjs/ui/ElementBrowser/constants.js +1 -3
- package/dist/cjs/ui/Resizer/utils.js +1 -3
- package/dist/cjs/ui/styles.js +3 -7
- package/dist/cjs/utils/get-editor-plugins.js +1 -3
- package/dist/cjs/utils/index.js +9 -269
- package/dist/cjs/utils/input-rules.js +1 -15
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/actions/index.js +23 -9
- package/dist/es2019/analytics-api/attach-payload-into-transaction.js +1 -1
- package/dist/es2019/create-editor/ReactEditorView.js +0 -5
- package/dist/es2019/create-editor/ReactEditorViewInternal.js +67 -82
- package/dist/es2019/create-editor/create-plugins-list.js +25 -3
- package/dist/es2019/create-editor/preset-utils.js +15 -0
- package/dist/es2019/editor-next/editor-internal.js +2 -2
- package/dist/es2019/editor-next/editor-migration-component.js +19 -2
- package/dist/es2019/editor-next/hooks/useProviderFactory.js +4 -3
- package/dist/es2019/editor-next/index.js +13 -7
- package/dist/es2019/editor-next/utils/getProvidersFromEditorProps.js +36 -0
- package/dist/es2019/editor-next/utils/handleProviders.js +18 -24
- package/dist/es2019/editor.js +20 -11
- package/dist/es2019/keymaps/consts.js +7 -11
- package/dist/es2019/labs/next/presets/cxhtml.js +56 -53
- package/dist/es2019/labs/next/presets/default.js +18 -38
- package/dist/es2019/labs/next/presets/mobile.js +88 -88
- package/dist/es2019/labs/next/presets/universal.js +338 -265
- package/dist/es2019/labs/next/presets/useUniversalPreset.js +25 -0
- package/dist/es2019/plugins/analytics/plugin.js +7 -0
- package/dist/es2019/plugins/annotation/utils.js +2 -30
- package/dist/es2019/plugins/base/pm-plugins/react-nodeview.js +1 -3
- package/dist/es2019/plugins/block-type/pm-plugins/input-rule.js +3 -9
- package/dist/es2019/plugins/caption/index.js +0 -2
- package/dist/es2019/plugins/card/nodeviews/blockCard.js +8 -4
- package/dist/es2019/plugins/card/nodeviews/inlineCard.js +6 -2
- package/dist/es2019/plugins/card/pm-plugins/main.js +6 -3
- package/dist/es2019/plugins/card/pm-plugins/util/resolve.js +4 -0
- package/dist/es2019/plugins/code-block/pm-plugins/main-state.js +1 -9
- package/dist/es2019/plugins/collab-edit/provider/index.js +1 -1
- package/dist/es2019/plugins/collab-edit/provider/types.js +1 -10
- package/dist/es2019/plugins/context-panel/index.js +0 -3
- package/dist/es2019/plugins/data-consumer/index.js +0 -7
- package/dist/es2019/plugins/date/utils/internal.js +0 -3
- package/dist/es2019/plugins/extension/commands.js +0 -6
- package/dist/es2019/plugins/extension/ui/Extension/Extension/index.js +12 -2
- package/dist/es2019/plugins/extension/ui/Extension/Extension/styles.js +3 -0
- package/dist/es2019/plugins/extension/ui/Extension/Lozenge.js +1 -0
- package/dist/es2019/plugins/feedback-dialog/index.js +0 -2
- package/dist/es2019/plugins/floating-toolbar/ui/Button.js +7 -3
- package/dist/es2019/plugins/floating-toolbar/ui/Dropdown.js +10 -5
- package/dist/es2019/plugins/floating-toolbar/ui/EmojiPickerButton.js +1 -11
- package/dist/es2019/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +1 -0
- package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +21 -4
- package/dist/es2019/plugins/floating-toolbar/utils.js +0 -10
- package/dist/es2019/plugins/fragment/index.js +0 -7
- package/dist/es2019/plugins/help-dialog/commands.js +1 -2
- package/dist/es2019/plugins/image-upload/pm-plugins/main.js +47 -5
- package/dist/es2019/plugins/layout/styles.js +12 -4
- package/dist/es2019/plugins/list/utils/find.js +0 -27
- package/dist/es2019/plugins/list/utils/indentation.js +0 -23
- package/dist/es2019/plugins/list/utils/node.js +1 -4
- package/dist/es2019/plugins/list/utils/selection.js +2 -15
- package/dist/es2019/plugins/media/utils/media-common.js +1 -19
- package/dist/es2019/plugins/mentions/nodeviews/mention.js +64 -16
- package/dist/es2019/plugins/mentions/type-ahead/index.js +1 -14
- package/dist/es2019/plugins/mentions/ui/InviteItem/index.js +1 -2
- package/dist/es2019/plugins/mobile-dimensions/index.js +0 -3
- package/dist/es2019/plugins/paste/index.js +1 -2
- package/dist/es2019/plugins/paste/pm-plugins/analytics.js +126 -94
- package/dist/es2019/plugins/paste/util/index.js +5 -45
- package/dist/es2019/plugins/quick-insert/assets/index.js +0 -8
- package/dist/es2019/plugins/selection/gap-cursor/actions.js +56 -56
- package/dist/es2019/plugins/status/utils.js +1 -11
- package/dist/es2019/plugins/text-color/pm-plugins/main.js +1 -1
- package/dist/es2019/plugins/text-color/ui/ToolbarTextColor/index.js +7 -5
- package/dist/es2019/plugins/text-formatting/pm-plugins/smart-input-rule.js +8 -2
- package/dist/es2019/plugins/text-formatting/utils.js +0 -19
- package/dist/es2019/plugins/type-ahead/constants.js +0 -5
- package/dist/es2019/plugins/type-ahead/pm-plugins/decorations.js +0 -35
- package/dist/es2019/plugins/type-ahead/utils.js +0 -23
- package/dist/es2019/test-utils.js +4 -7
- package/dist/es2019/ui/Appearance/Comment/Toolbar.js +40 -6
- package/dist/es2019/ui/ColorPalette/index.js +2 -1
- package/dist/es2019/ui/ColorPickerButton/index.js +6 -2
- package/dist/es2019/ui/ConfigPanel/Fields/Expand.js +1 -0
- package/dist/es2019/ui/ConfigPanel/utils.js +0 -6
- package/dist/es2019/ui/ContentStyles/index.js +1 -1
- package/dist/es2019/ui/ElementBrowser/ModalElementBrowser.js +1 -1
- package/dist/es2019/ui/ElementBrowser/constants.js +0 -1
- package/dist/es2019/ui/Resizer/utils.js +0 -1
- package/dist/es2019/ui/styles.js +0 -6
- package/dist/es2019/utils/get-editor-plugins.js +1 -3
- package/dist/es2019/utils/index.js +13 -199
- package/dist/es2019/utils/input-rules.js +0 -14
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/actions/index.js +23 -9
- package/dist/esm/analytics-api/attach-payload-into-transaction.js +1 -1
- package/dist/esm/create-editor/ReactEditorView.js +0 -5
- package/dist/esm/create-editor/ReactEditorViewInternal.js +73 -102
- package/dist/esm/create-editor/create-plugins-list.js +29 -3
- package/dist/esm/create-editor/preset-utils.js +21 -0
- package/dist/esm/editor-next/editor-internal.js +2 -2
- package/dist/esm/editor-next/editor-migration-component.js +18 -2
- package/dist/esm/editor-next/hooks/useProviderFactory.js +4 -3
- package/dist/esm/editor-next/index.js +13 -9
- package/dist/esm/editor-next/utils/getProvidersFromEditorProps.js +35 -0
- package/dist/esm/editor-next/utils/handleProviders.js +17 -22
- package/dist/esm/editor.js +20 -13
- package/dist/esm/keymaps/consts.js +7 -11
- package/dist/esm/labs/next/presets/cxhtml.js +56 -55
- package/dist/esm/labs/next/presets/default.js +18 -41
- package/dist/esm/labs/next/presets/mobile.js +88 -90
- package/dist/esm/labs/next/presets/universal.js +330 -257
- package/dist/esm/labs/next/presets/useUniversalPreset.js +29 -0
- package/dist/esm/plugins/analytics/plugin.js +6 -0
- package/dist/esm/plugins/annotation/utils.js +2 -32
- package/dist/esm/plugins/base/pm-plugins/react-nodeview.js +1 -5
- package/dist/esm/plugins/block-type/pm-plugins/input-rule.js +3 -9
- package/dist/esm/plugins/caption/index.js +0 -2
- package/dist/esm/plugins/card/nodeviews/blockCard.js +9 -4
- package/dist/esm/plugins/card/nodeviews/inlineCard.js +6 -2
- package/dist/esm/plugins/card/pm-plugins/main.js +6 -3
- package/dist/esm/plugins/card/pm-plugins/util/resolve.js +4 -0
- package/dist/esm/plugins/code-block/pm-plugins/main-state.js +0 -10
- package/dist/esm/plugins/collab-edit/provider/index.js +1 -1
- package/dist/esm/plugins/collab-edit/provider/types.js +1 -10
- package/dist/esm/plugins/context-panel/index.js +0 -3
- package/dist/esm/plugins/data-consumer/index.js +0 -7
- package/dist/esm/plugins/date/utils/internal.js +0 -3
- package/dist/esm/plugins/extension/commands.js +0 -6
- package/dist/esm/plugins/extension/ui/Extension/Extension/index.js +9 -2
- package/dist/esm/plugins/extension/ui/Extension/Extension/styles.js +2 -2
- package/dist/esm/plugins/extension/ui/Extension/Lozenge.js +1 -0
- package/dist/esm/plugins/feedback-dialog/index.js +0 -2
- package/dist/esm/plugins/floating-toolbar/ui/Button.js +7 -3
- package/dist/esm/plugins/floating-toolbar/ui/Dropdown.js +10 -5
- package/dist/esm/plugins/floating-toolbar/ui/EmojiPickerButton.js +2 -9
- package/dist/esm/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +1 -0
- package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +24 -8
- package/dist/esm/plugins/floating-toolbar/utils.js +0 -10
- package/dist/esm/plugins/fragment/index.js +0 -7
- package/dist/esm/plugins/help-dialog/commands.js +0 -3
- package/dist/esm/plugins/image-upload/pm-plugins/main.js +51 -12
- package/dist/esm/plugins/layout/styles.js +11 -2
- package/dist/esm/plugins/list/utils/find.js +0 -27
- package/dist/esm/plugins/list/utils/indentation.js +0 -23
- package/dist/esm/plugins/list/utils/node.js +1 -4
- package/dist/esm/plugins/list/utils/selection.js +2 -12
- package/dist/esm/plugins/media/utils/media-common.js +1 -17
- package/dist/esm/plugins/mentions/nodeviews/mention.js +97 -16
- package/dist/esm/plugins/mentions/type-ahead/index.js +1 -18
- package/dist/esm/plugins/mentions/ui/InviteItem/index.js +1 -2
- package/dist/esm/plugins/mobile-dimensions/index.js +0 -3
- package/dist/esm/plugins/paste/index.js +1 -2
- package/dist/esm/plugins/paste/pm-plugins/analytics.js +122 -86
- package/dist/esm/plugins/paste/util/index.js +5 -45
- package/dist/esm/plugins/quick-insert/assets/index.js +0 -20
- package/dist/esm/plugins/selection/gap-cursor/actions.js +52 -45
- package/dist/esm/plugins/status/utils.js +1 -13
- package/dist/esm/plugins/text-color/pm-plugins/main.js +1 -1
- package/dist/esm/plugins/text-color/ui/ToolbarTextColor/index.js +7 -5
- package/dist/esm/plugins/text-formatting/pm-plugins/smart-input-rule.js +8 -2
- package/dist/esm/plugins/text-formatting/utils.js +0 -21
- package/dist/esm/plugins/type-ahead/constants.js +0 -5
- package/dist/esm/plugins/type-ahead/pm-plugins/decorations.js +0 -31
- package/dist/esm/plugins/type-ahead/utils.js +2 -20
- package/dist/esm/test-utils.js +4 -7
- package/dist/esm/ui/Appearance/Comment/Toolbar.js +41 -6
- package/dist/esm/ui/ColorPalette/index.js +2 -1
- package/dist/esm/ui/ColorPickerButton/index.js +6 -2
- package/dist/esm/ui/ConfigPanel/Fields/Expand.js +1 -0
- package/dist/esm/ui/ConfigPanel/utils.js +3 -14
- package/dist/esm/ui/ContentStyles/index.js +1 -1
- package/dist/esm/ui/ElementBrowser/ModalElementBrowser.js +1 -1
- package/dist/esm/ui/ElementBrowser/constants.js +0 -1
- package/dist/esm/ui/Resizer/utils.js +0 -1
- package/dist/esm/ui/styles.js +2 -5
- package/dist/esm/utils/get-editor-plugins.js +1 -3
- package/dist/esm/utils/index.js +13 -196
- package/dist/esm/utils/input-rules.js +0 -13
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/actions/index.d.ts +4 -4
- package/dist/types/create-editor/ReactEditorView.d.ts +0 -3
- package/dist/types/create-editor/ReactEditorViewInternal.d.ts +9 -7
- package/dist/types/create-editor/ReactEditorViewNext.d.ts +3 -4
- package/dist/types/create-editor/create-plugins-list.d.ts +3 -5
- package/dist/types/create-editor/preset-utils.d.ts +2 -0
- package/dist/types/editor-next/editor-internal.d.ts +9 -9
- package/dist/types/editor-next/hooks/useMeasureEditorMountTime.d.ts +2 -2
- package/dist/types/editor-next/hooks/useProviderFactory.d.ts +2 -2
- package/dist/types/editor-next/index.d.ts +6 -6
- package/dist/types/editor-next/utils/deprecationWarnings.d.ts +2 -2
- package/dist/types/editor-next/utils/editorPropTypes.d.ts +1 -1
- package/dist/types/editor-next/utils/getProvidersFromEditorProps.d.ts +9 -0
- package/dist/types/editor-next/utils/handleProviders.d.ts +2 -2
- package/dist/types/editor-next/utils/onEditorCreated.d.ts +2 -2
- package/dist/types/editor-next/utils/sendDurationAnalytics.d.ts +1 -1
- package/dist/types/editor.d.ts +7 -4
- package/dist/types/keymaps/consts.d.ts +0 -11
- package/dist/types/labs/next/presets/cxhtml.d.ts +33 -1
- package/dist/types/labs/next/presets/default.d.ts +67 -10
- package/dist/types/labs/next/presets/mobile.d.ts +33 -1
- package/dist/types/labs/next/presets/universal.d.ts +5 -13
- package/dist/types/labs/next/presets/useUniversalPreset.d.ts +7 -0
- package/dist/types/nodeviews/context-adapter.d.ts +0 -1
- package/dist/types/nodeviews/index.d.ts +0 -1
- package/dist/types/plugins/alignment/pm-plugins/types.d.ts +0 -11
- package/dist/types/plugins/annotation/utils.d.ts +0 -17
- package/dist/types/plugins/base/pm-plugins/react-nodeview.d.ts +2 -3
- package/dist/types/plugins/block-type/pm-plugins/input-rule.d.ts +2 -6
- package/dist/types/plugins/caption/index.d.ts +0 -2
- package/dist/types/plugins/card/nodeviews/blockCard.d.ts +2 -10
- package/dist/types/plugins/card/nodeviews/genericCard.d.ts +1 -0
- package/dist/types/plugins/card/nodeviews/inlineCard.d.ts +1 -1
- package/dist/types/plugins/code-block/actions.d.ts +0 -4
- package/dist/types/plugins/code-block/pm-plugins/main-state.d.ts +0 -3
- package/dist/types/plugins/collab-edit/provider/index.d.ts +1 -2
- package/dist/types/plugins/collab-edit/provider/types.d.ts +1 -36
- package/dist/types/plugins/context-panel/index.d.ts +2 -3
- package/dist/types/plugins/data-consumer/index.d.ts +0 -2
- package/dist/types/plugins/date/utils/internal.d.ts +0 -1
- package/dist/types/plugins/extension/commands.d.ts +0 -1
- package/dist/types/plugins/extension/nodeviews/extension.d.ts +0 -5
- package/dist/types/plugins/feedback-dialog/index.d.ts +0 -2
- package/dist/types/plugins/floating-toolbar/ui/Button.d.ts +3 -1
- package/dist/types/plugins/floating-toolbar/ui/Dropdown.d.ts +1 -0
- package/dist/types/plugins/floating-toolbar/utils.d.ts +0 -2
- package/dist/types/plugins/fragment/index.d.ts +0 -2
- package/dist/types/plugins/help-dialog/commands.d.ts +0 -1
- package/dist/types/plugins/history/actions.d.ts +1 -2
- package/dist/types/plugins/layout/styles.d.ts +2 -1
- package/dist/types/plugins/list/utils/find.d.ts +0 -1
- package/dist/types/plugins/list/utils/indentation.d.ts +0 -1
- package/dist/types/plugins/list/utils/node.d.ts +0 -2
- package/dist/types/plugins/list/utils/selection.d.ts +0 -3
- package/dist/types/plugins/media/utils/media-common.d.ts +0 -5
- package/dist/types/plugins/mentions/types.d.ts +1 -2
- package/dist/types/plugins/mentions/ui/InviteItem/index.d.ts +2 -3
- package/dist/types/plugins/mentions/ui/InviteItem/styles.d.ts +0 -6
- package/dist/types/plugins/mentions/ui/ToolbarMention/index.d.ts +1 -4
- package/dist/types/plugins/mobile-dimensions/index.d.ts +0 -1
- package/dist/types/plugins/paste/index.d.ts +0 -1
- package/dist/types/plugins/paste/pm-plugins/analytics.d.ts +6 -3
- package/dist/types/plugins/paste/util/index.d.ts +0 -6
- package/dist/types/plugins/quick-insert/assets/index.d.ts +0 -2
- package/dist/types/plugins/status/utils.d.ts +0 -3
- package/dist/types/plugins/tasks-and-decisions/pm-plugins/main.d.ts +0 -6
- package/dist/types/plugins/text-color/pm-plugins/main.d.ts +2 -12
- package/dist/types/plugins/text-formatting/pm-plugins/clear-formatting.d.ts +0 -1
- package/dist/types/plugins/text-formatting/utils.d.ts +0 -4
- package/dist/types/plugins/type-ahead/constants.d.ts +0 -4
- package/dist/types/plugins/type-ahead/pm-plugins/decorations.d.ts +0 -10
- package/dist/types/plugins/type-ahead/utils.d.ts +1 -2
- package/dist/types/test-utils.d.ts +4 -5
- package/dist/types/types/editor-appearance-component.d.ts +2 -2
- package/dist/types/types/editor-props.d.ts +55 -42
- package/dist/types/ui/Appearance/Chromeless.d.ts +0 -5
- package/dist/types/ui/Appearance/Comment/Comment.d.ts +0 -7
- package/dist/types/ui/Appearance/Comment/Toolbar.d.ts +3 -2
- package/dist/types/ui/Appearance/FullPage/MainToolbar.d.ts +0 -4
- package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +3 -3
- package/dist/types/ui/AppearanceComponents/Mobile.d.ts +2 -5
- package/dist/types/ui/ColorPalette/Palettes/index.d.ts +1 -1
- package/dist/types/ui/ColorPalette/Palettes/type.d.ts +1 -1
- package/dist/types/ui/ColorPalette/index.d.ts +2 -1
- package/dist/types/ui/ColorPickerButton/index.d.ts +4 -2
- package/dist/types/ui/ConfigPanel/types.d.ts +0 -3
- package/dist/types/ui/ConfigPanel/utils.d.ts +2 -3
- package/dist/types/ui/ContentStyles/index.d.ts +2 -2
- package/dist/types/ui/ElementBrowser/ModalElementBrowser.d.ts +0 -3
- package/dist/types/ui/ElementBrowser/constants.d.ts +0 -1
- package/dist/types/ui/ElementBrowser/types.d.ts +0 -5
- package/dist/types/ui/Resizer/utils.d.ts +0 -1
- package/dist/types/ui/styles.d.ts +0 -1
- package/dist/types/utils/index.d.ts +6 -65
- package/dist/types/utils/input-rules.d.ts +1 -2
- package/dist/types/utils/table.d.ts +0 -1
- package/package.json +23 -24
- package/report.api.md +155 -146
- package/dist/cjs/labs/next/presets/preset.js +0 -101
- package/dist/cjs/plugins/analytics/types/type-ahead.js +0 -5
- package/dist/cjs/plugins/collab-edit/provider/channel.js +0 -313
- package/dist/cjs/plugins/collab-edit/provider/logger.js +0 -17
- package/dist/cjs/plugins/collab-edit/provider/mock-users.js +0 -19
- package/dist/cjs/plugins/data-consumer/plugin-key.js +0 -9
- package/dist/cjs/plugins/media/toolbar/toolbar-messages.js +0 -15
- package/dist/cjs/profiler/render-count.js +0 -60
- package/dist/cjs/ui/ColorPalette/Color/index.js +0 -9
- package/dist/cjs/ui/ConfigPanel/FieldDescription.js +0 -19
- package/dist/cjs/ui/WithPluginState/types.js +0 -5
- package/dist/es2019/labs/next/presets/preset.js +0 -68
- package/dist/es2019/plugins/analytics/types/type-ahead.js +0 -1
- package/dist/es2019/plugins/collab-edit/provider/channel.js +0 -179
- package/dist/es2019/plugins/collab-edit/provider/logger.js +0 -8
- package/dist/es2019/plugins/collab-edit/provider/mock-users.js +0 -12
- package/dist/es2019/plugins/data-consumer/plugin-key.js +0 -2
- package/dist/es2019/plugins/media/toolbar/toolbar-messages.js +0 -8
- package/dist/es2019/profiler/render-count.js +0 -53
- package/dist/es2019/ui/ColorPalette/Color/index.js +0 -2
- package/dist/es2019/ui/ConfigPanel/FieldDescription.js +0 -12
- package/dist/es2019/ui/WithPluginState/types.js +0 -1
- package/dist/esm/labs/next/presets/preset.js +0 -93
- package/dist/esm/plugins/analytics/types/type-ahead.js +0 -1
- package/dist/esm/plugins/collab-edit/provider/channel.js +0 -305
- package/dist/esm/plugins/collab-edit/provider/logger.js +0 -10
- package/dist/esm/plugins/collab-edit/provider/mock-users.js +0 -12
- package/dist/esm/plugins/data-consumer/plugin-key.js +0 -2
- package/dist/esm/plugins/media/toolbar/toolbar-messages.js +0 -8
- package/dist/esm/profiler/render-count.js +0 -49
- package/dist/esm/ui/ColorPalette/Color/index.js +0 -2
- package/dist/esm/ui/ConfigPanel/FieldDescription.js +0 -11
- package/dist/esm/ui/WithPluginState/types.js +0 -1
- package/dist/types/labs/next/presets/preset.d.ts +0 -46
- package/dist/types/plugins/analytics/types/type-ahead.d.ts +0 -1
- package/dist/types/plugins/collab-edit/provider/channel.d.ts +0 -48
- package/dist/types/plugins/collab-edit/provider/logger.d.ts +0 -1
- package/dist/types/plugins/collab-edit/provider/mock-users.d.ts +0 -6
- package/dist/types/plugins/data-consumer/plugin-key.d.ts +0 -2
- package/dist/types/plugins/media/toolbar/toolbar-messages.d.ts +0 -7
- package/dist/types/profiler/render-count.d.ts +0 -14
- package/dist/types/ui/ColorPalette/Color/index.d.ts +0 -2
- package/dist/types/ui/ConfigPanel/FieldDescription.d.ts +0 -6
- package/dist/types/ui/WithPluginState/types.d.ts +0 -10
|
@@ -2,11 +2,6 @@ export var TYPE_AHEAD_DECORATION_KEY = 'typeahead_decoration_key';
|
|
|
2
2
|
export var TYPE_AHEAD_DECORATION_DATA_ATTRIBUTE = 'typeaheadDecoration';
|
|
3
3
|
export var TYPE_AHEAD_POPUP_CONTENT_CLASS = 'fabric-editor-typeahead';
|
|
4
4
|
export var TYPE_AHEAD_DECORATION_ELEMENT_ID = 'typeahaed_decoration_element_id';
|
|
5
|
-
export var NavigationDirection;
|
|
6
|
-
(function (NavigationDirection) {
|
|
7
|
-
NavigationDirection[NavigationDirection["LEFT"] = -1] = "LEFT";
|
|
8
|
-
NavigationDirection[NavigationDirection["RIGHT"] = 1] = "RIGHT";
|
|
9
|
-
})(NavigationDirection || (NavigationDirection = {}));
|
|
10
5
|
export var CloseSelectionOptions;
|
|
11
6
|
(function (CloseSelectionOptions) {
|
|
12
7
|
CloseSelectionOptions["BEFORE_TEXT_INSERTED"] = "BEFORE_TEXT_INSERTED";
|
|
@@ -138,35 +138,4 @@ export var factoryDecorations = function factoryDecorations(_ref) {
|
|
|
138
138
|
createDecorations: createDecorations,
|
|
139
139
|
removeDecorations: removeDecorations
|
|
140
140
|
};
|
|
141
|
-
};
|
|
142
|
-
export var isSelectionInsideTypeAhead = function isSelectionInsideTypeAhead(_ref4) {
|
|
143
|
-
var decorationSet = _ref4.decorationSet,
|
|
144
|
-
selection = _ref4.selection;
|
|
145
|
-
if (!decorationSet || decorationSet === DecorationSet.empty) {
|
|
146
|
-
return false;
|
|
147
|
-
}
|
|
148
|
-
var typeAheadDecorations = decorationSet.find(undefined, undefined, function (spec) {
|
|
149
|
-
return spec.isTypeAheadDecoration;
|
|
150
|
-
});
|
|
151
|
-
if (!typeAheadDecorations || typeAheadDecorations.length === 0) {
|
|
152
|
-
return false;
|
|
153
|
-
}
|
|
154
|
-
return typeAheadDecorations.some(function (dec) {
|
|
155
|
-
return dec.from === selection.from && dec.to === selection.to;
|
|
156
|
-
});
|
|
157
|
-
};
|
|
158
|
-
export var findDecorationElement = function findDecorationElement(_ref5) {
|
|
159
|
-
var selection = _ref5.selection,
|
|
160
|
-
decorationSet = _ref5.decorationSet;
|
|
161
|
-
if (!decorationSet || decorationSet === DecorationSet.empty || !(selection instanceof TextSelection) || !selection.$cursor) {
|
|
162
|
-
return null;
|
|
163
|
-
}
|
|
164
|
-
var pos = selection.$cursor.pos;
|
|
165
|
-
var decoration = decorationSet.find(pos, pos, function (spec) {
|
|
166
|
-
return spec === null || spec === void 0 ? void 0 : spec.isTypeAheadDecoration;
|
|
167
|
-
});
|
|
168
|
-
if (!decoration || decoration.length !== 1) {
|
|
169
|
-
return null;
|
|
170
|
-
}
|
|
171
|
-
return document.querySelector("#".concat(decoration[0].spec.key));
|
|
172
141
|
};
|
|
@@ -1,34 +1,16 @@
|
|
|
1
|
-
import { TextSelection } from 'prosemirror-state';
|
|
2
|
-
import { DecorationSet } from 'prosemirror-view';
|
|
3
1
|
import { TypeAheadAvailableNodes } from '@atlaskit/editor-common/type-ahead';
|
|
4
2
|
import { pluginKey as typeAheadPluginKey } from './pm-plugins/key';
|
|
5
3
|
import { updateSelectedIndex } from './commands/update-selected-index';
|
|
6
4
|
import { StatsModifier } from './stats-modifier';
|
|
7
5
|
import { typeAheadListMessages } from './messages';
|
|
8
|
-
export var findTypeAheadDecorations = function findTypeAheadDecorations(state) {
|
|
9
|
-
var selection = state.selection;
|
|
10
|
-
var _typeAheadPluginKey$g = typeAheadPluginKey.getState(state),
|
|
11
|
-
decorationSet = _typeAheadPluginKey$g.decorationSet;
|
|
12
|
-
if (!decorationSet || decorationSet === DecorationSet.empty || !(selection instanceof TextSelection) || !selection.$cursor) {
|
|
13
|
-
return null;
|
|
14
|
-
}
|
|
15
|
-
var pos = selection.$cursor.pos;
|
|
16
|
-
var decoration = decorationSet.find(pos, pos, function (spec) {
|
|
17
|
-
return spec === null || spec === void 0 ? void 0 : spec.isTypeAheadDecoration;
|
|
18
|
-
});
|
|
19
|
-
if (!decoration || decoration.length !== 1) {
|
|
20
|
-
return null;
|
|
21
|
-
}
|
|
22
|
-
return decoration[0];
|
|
23
|
-
};
|
|
24
6
|
export var isTypeAheadHandler = function isTypeAheadHandler(handler) {
|
|
25
7
|
return handler && Object.values(TypeAheadAvailableNodes).includes(handler.id) && typeof handler.trigger === 'string' && typeof handler.selectItem === 'function' && typeof handler.getItems === 'function';
|
|
26
8
|
};
|
|
27
9
|
|
|
28
10
|
/** Is a typeahead plugin open? */
|
|
29
11
|
export var isTypeAheadOpen = function isTypeAheadOpen(editorState) {
|
|
30
|
-
var _typeAheadPluginKey$
|
|
31
|
-
return (typeAheadPluginKey === null || typeAheadPluginKey === void 0 ? void 0 : (_typeAheadPluginKey$
|
|
12
|
+
var _typeAheadPluginKey$g, _typeAheadPluginKey$g2;
|
|
13
|
+
return (typeAheadPluginKey === null || typeAheadPluginKey === void 0 ? void 0 : (_typeAheadPluginKey$g = typeAheadPluginKey.getState(editorState)) === null || _typeAheadPluginKey$g === void 0 ? void 0 : (_typeAheadPluginKey$g2 = _typeAheadPluginKey$g.decorationSet) === null || _typeAheadPluginKey$g2 === void 0 ? void 0 : _typeAheadPluginKey$g2.find().length) > 0;
|
|
32
14
|
};
|
|
33
15
|
export var getPluginState = function getPluginState(editorState) {
|
|
34
16
|
return typeAheadPluginKey.getState(editorState);
|
package/dist/esm/test-utils.js
CHANGED
|
@@ -4,12 +4,11 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
4
4
|
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) { _defineProperty(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; }
|
|
5
5
|
import { TextSelection } from 'prosemirror-state';
|
|
6
6
|
import { sortByOrder } from './create-editor/sort-by-order';
|
|
7
|
-
import { Preset } from './labs/next/presets/preset';
|
|
8
7
|
import { createSchema } from './create-editor/create-schema';
|
|
9
8
|
import basePlugin from './plugins/base';
|
|
10
9
|
import { analyticsPluginKey } from './plugins/analytics/plugin-key';
|
|
11
10
|
export { createTypeAheadTools } from './plugins/type-ahead/api';
|
|
12
|
-
|
|
11
|
+
import { EditorPresetBuilder } from '@atlaskit/editor-common/preset';
|
|
13
12
|
export function getFireAnalytics(editorView) {
|
|
14
13
|
var _analyticsPluginKey$g;
|
|
15
14
|
return analyticsPluginKey === null || analyticsPluginKey === void 0 ? void 0 : (_analyticsPluginKey$g = analyticsPluginKey.getState(editorView.state)) === null || _analyticsPluginKey$g === void 0 ? void 0 : _analyticsPluginKey$g.fireAnalytics;
|
|
@@ -58,13 +57,11 @@ function lightProcessPluginsList(editorPlugins) {
|
|
|
58
57
|
});
|
|
59
58
|
}
|
|
60
59
|
export var createPMSchemaAndPlugins = function createPMSchemaAndPlugins() {
|
|
61
|
-
var
|
|
60
|
+
var inputPreset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new EditorPresetBuilder();
|
|
62
61
|
return function (pluginFactoryParams) {
|
|
63
62
|
var editorPlugins = [];
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
editorPlugins = preset.getEditorPlugins();
|
|
63
|
+
var preset = inputPreset.has(basePlugin) ? inputPreset : inputPreset.add(basePlugin);
|
|
64
|
+
editorPlugins = preset.build();
|
|
68
65
|
var editorConfig = lightProcessPluginsList(editorPlugins);
|
|
69
66
|
var schema = createSchema(editorConfig);
|
|
70
67
|
var plugins = editorConfig.plugins.sort(sortByOrder('plugins')).map(function (_ref) {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _typeof from "@babel/runtime/helpers/typeof";
|
|
1
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
3
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
3
4
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
@@ -15,10 +16,18 @@ var StickyToolbar = function StickyToolbar(props) {
|
|
|
15
16
|
_useState2 = _slicedToArray(_useState, 2),
|
|
16
17
|
top = _useState2[0],
|
|
17
18
|
setTop = _useState2[1];
|
|
19
|
+
|
|
20
|
+
// ED-15802: if externalToolbarRef is passed in, set top to externalToolbarRef?.current?.clientHeight
|
|
21
|
+
// else if offsetTop is a number set top to offsetTop
|
|
22
|
+
// otherwise top is 0 as initial state
|
|
18
23
|
useEffect(function () {
|
|
19
24
|
var _props$externalToolba, _props$externalToolba2;
|
|
20
|
-
|
|
21
|
-
|
|
25
|
+
if ((_props$externalToolba = props.externalToolbarRef) !== null && _props$externalToolba !== void 0 && (_props$externalToolba2 = _props$externalToolba.current) !== null && _props$externalToolba2 !== void 0 && _props$externalToolba2.clientHeight) {
|
|
26
|
+
setTop(props.externalToolbarRef.current.clientHeight);
|
|
27
|
+
} else {
|
|
28
|
+
setTop(props.offsetTop || 0);
|
|
29
|
+
}
|
|
30
|
+
}, [props.externalToolbarRef, props.offsetTop]);
|
|
22
31
|
return jsx("div", {
|
|
23
32
|
css: [mainToolbarWrapperStyle, stickyToolbarWrapperStyle, css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n top: ", "px;\n "])), top)],
|
|
24
33
|
"data-testid": "ak-editor-main-toolbar",
|
|
@@ -31,13 +40,39 @@ var FixedToolbar = function FixedToolbar(props) {
|
|
|
31
40
|
"data-testid": "ak-editor-main-toolbar"
|
|
32
41
|
}, props.children);
|
|
33
42
|
};
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* ED-15802: Scenarios when a sticky bar is used:
|
|
46
|
+
* 1. useStickyToolbar is true
|
|
47
|
+
* 2. useStickyToolbar is a DOM element
|
|
48
|
+
* 3. useStickyToolbar is an object and has offsetTop key;
|
|
49
|
+
*/
|
|
50
|
+
var getStickyParameters = function getStickyParameters(configuration) {
|
|
51
|
+
// const isUsingStickyOffset, isHTMLElement is used so TS can properly infer types.
|
|
52
|
+
var isHTMLElement = _typeof(configuration) === 'object' && !('offsetTop' in configuration);
|
|
53
|
+
var isUsingStickyOffset = _typeof(configuration) === 'object' && 'offsetTop' in configuration;
|
|
54
|
+
if (_typeof(configuration) !== 'object') {
|
|
55
|
+
return {
|
|
56
|
+
externalToolbarRef: undefined,
|
|
57
|
+
offsetTop: undefined
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
if (isUsingStickyOffset) {
|
|
61
|
+
return {
|
|
62
|
+
offsetTop: configuration.offsetTop
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
if (isHTMLElement) {
|
|
66
|
+
return {
|
|
67
|
+
externalToolbarRef: configuration
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
};
|
|
34
71
|
export var MainToolbar = function MainToolbar(_ref) {
|
|
35
72
|
var useStickyToolbar = _ref.useStickyToolbar,
|
|
36
73
|
children = _ref.children;
|
|
37
|
-
if (
|
|
38
|
-
return jsx(StickyToolbar,
|
|
39
|
-
externalToolbarRef: typeof useStickyToolbar === 'boolean' ? undefined : useStickyToolbar
|
|
40
|
-
}, children);
|
|
74
|
+
if (useStickyToolbar) {
|
|
75
|
+
return jsx(StickyToolbar, getStickyParameters(useStickyToolbar), children);
|
|
41
76
|
}
|
|
42
77
|
return jsx(FixedToolbar, null, children);
|
|
43
78
|
};
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import { ColorPalette } from '@atlaskit/editor-common/ui-color';
|
|
1
|
+
import { ColorPalette, backgroundPaletteTooltipMessages, textPaletteTooltipMessages } from '@atlaskit/editor-common/ui-color';
|
|
2
|
+
export { ColorPalette, backgroundPaletteTooltipMessages, textPaletteTooltipMessages };
|
|
2
3
|
export default ColorPalette;
|
|
@@ -137,13 +137,17 @@ var ColorPickerButton = function ColorPickerButton(props) {
|
|
|
137
137
|
isOpenedByKeyboard: isOpenedByKeyboard,
|
|
138
138
|
isPopupPositioned: isPopupPositioned
|
|
139
139
|
}, jsx(ColorPaletteWithListeners, {
|
|
140
|
-
palette: props.colorPalette,
|
|
141
140
|
cols: props.cols,
|
|
142
141
|
selectedColor: selectedColor,
|
|
143
142
|
onClick: onColorSelected,
|
|
144
143
|
handleClickOutside: togglePopup,
|
|
145
144
|
handleEscapeKeydown: handleEsc,
|
|
146
|
-
|
|
145
|
+
paletteOptions: {
|
|
146
|
+
palette: props.colorPalette,
|
|
147
|
+
hexToPaletteColor: props.hexToPaletteColor,
|
|
148
|
+
showSomewhatSemanticTooltips: props.showSomewhatSemanticTooltips,
|
|
149
|
+
paletteColorTooltipMessages: props.paletteColorTooltipMessages
|
|
150
|
+
}
|
|
147
151
|
}))));
|
|
148
152
|
};
|
|
149
153
|
var title = props.title || '';
|
|
@@ -1,27 +1,16 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
1
|
import { ValidationError } from './types';
|
|
4
2
|
export var validate = function validate(field, value) {
|
|
5
3
|
return validateRequired(field, value);
|
|
6
4
|
};
|
|
7
|
-
export var fromEntries = function fromEntries(iterable) {
|
|
8
|
-
return _toConsumableArray(iterable).reduce(function (obj, _ref) {
|
|
9
|
-
var _ref2 = _slicedToArray(_ref, 2),
|
|
10
|
-
key = _ref2[0],
|
|
11
|
-
val = _ref2[1];
|
|
12
|
-
obj[key] = val;
|
|
13
|
-
return obj;
|
|
14
|
-
}, {});
|
|
15
|
-
};
|
|
16
5
|
var isEmptyString = function isEmptyString(value) {
|
|
17
6
|
return typeof value === 'string' && value === '';
|
|
18
7
|
};
|
|
19
8
|
var isEmptyArray = function isEmptyArray(value) {
|
|
20
9
|
return Array.isArray(value) && value.length === 0;
|
|
21
10
|
};
|
|
22
|
-
export var validateRequired = function validateRequired(
|
|
23
|
-
var isRequired =
|
|
24
|
-
isMultiple =
|
|
11
|
+
export var validateRequired = function validateRequired(_ref, value) {
|
|
12
|
+
var isRequired = _ref.isRequired,
|
|
13
|
+
isMultiple = _ref.isMultiple;
|
|
25
14
|
if (isRequired) {
|
|
26
15
|
var isUndefined = typeof value === 'undefined';
|
|
27
16
|
var isEmpty = isEmptyString(value) || isMultiple && isEmptyArray(value) || false;
|
|
@@ -38,7 +38,7 @@ import { InlineNodeViewSharedStyles } from '../../nodeviews/getInlineNodeViewPro
|
|
|
38
38
|
var contentStyles = function contentStyles(props) {
|
|
39
39
|
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ProseMirror {\n outline: none;\n font-size: ", "px;\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n }\n\n .ProseMirror[contenteditable='false'] .taskItemView-content-wrap {\n pointer-events: none;\n opacity: 0.7;\n }\n\n .ProseMirror-hideselection *::selection {\n background: transparent;\n }\n\n .ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n }\n\n .ProseMirror-selectednode {\n outline: none;\n }\n\n .ProseMirror-selectednode:empty {\n outline: 2px solid ", ";\n }\n\n ", "\n ", "\n ", "\n\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", ";\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n\n .panelView-content-wrap {\n box-sizing: border-box;\n }\n\n .mediaGroupView-content-wrap ul {\n padding: 0;\n }\n\n /** Needed to override any cleared floats, e.g. image wrapping */\n\n div.fabric-editor-block-mark[class^='fabric-editor-align'] {\n clear: none !important;\n }\n\n .fabric-editor-align-end {\n text-align: right;\n }\n\n .fabric-editor-align-start {\n text-align: left;\n }\n\n .fabric-editor-align-center {\n text-align: center;\n }\n\n .pm-table-header-content-wrap :not(.fabric-editor-alignment),\n .pm-table-header-content-wrap\n :not(p, .fabric-editor-block-mark)\n + div.fabric-editor-block-mark,\n .pm-table-cell-content-wrap\n :not(p, .fabric-editor-block-mark)\n + div.fabric-editor-block-mark {\n p:first-of-type {\n margin-top: 0;\n }\n }\n\n .hyperlink-floating-toolbar,\n .", " {\n padding: 0;\n }\n\n /* Link icon in the Atlaskit package\n is bigger than the others\n */\n .hyperlink-open-link {\n svg {\n max-width: 18px;\n }\n &[href] {\n padding: 0 4px;\n }\n }\n"])), editorFontSize({
|
|
40
40
|
theme: props.theme
|
|
41
|
-
}), whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, shadowSharedStyle, InlineNodeViewSharedStyles, "var(--ds-border-focused, #8cf)", placeholderTextStyles, placeholderStyles, codeBlockStyles(props), blocktypeStyles(props), textFormattingStyles(props), textColorStyles, listsStyles, ruleStyles(props), mediaStyles, layoutStyles, telepointerStyle, gapCursorStyles, tableStyles(props), panelStyles(props), fakeCursorStyles, mentionsStyles, emojiStyles, tasksAndDecisionsStyles, gridStyles, linkStyles, blockMarksSharedStyles, dateSharedStyle, extensionStyles, expandStyles(props), findReplaceStyles, taskDecisionStyles, statusStyles, annotationSharedStyles(props), smartCardStyles, smartCardSharedStyles, dateStyles, embedCardStyles, unsupportedStyles, ClassNames.FLOATING_TOOLBAR_COMPONENT);
|
|
41
|
+
}), whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, shadowSharedStyle, InlineNodeViewSharedStyles, "var(--ds-border-focused, #8cf)", placeholderTextStyles, placeholderStyles, codeBlockStyles(props), blocktypeStyles(props), textFormattingStyles(props), textColorStyles, listsStyles, ruleStyles(props), mediaStyles, layoutStyles(props), telepointerStyle, gapCursorStyles, tableStyles(props), panelStyles(props), fakeCursorStyles, mentionsStyles, emojiStyles, tasksAndDecisionsStyles, gridStyles, linkStyles, blockMarksSharedStyles, dateSharedStyle, extensionStyles, expandStyles(props), findReplaceStyles, taskDecisionStyles, statusStyles, annotationSharedStyles(props), smartCardStyles, smartCardSharedStyles, dateStyles, embedCardStyles, unsupportedStyles, ClassNames.FLOATING_TOOLBAR_COMPONENT);
|
|
42
42
|
};
|
|
43
43
|
export var createEditorContentStyle = function createEditorContentStyle(styles) {
|
|
44
44
|
return /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
@@ -14,7 +14,6 @@ export var SIDEBAR_WIDTH = "".concat(GRID_SIZE * 25, "px");
|
|
|
14
14
|
export var SIDEBAR_HEADING_WRAPPER_HEIGHT = "".concat(GRID_SIZE * 6, "px");
|
|
15
15
|
export var SIDEBAR_HEADING_PADDING_LEFT = '12px';
|
|
16
16
|
export var INLINE_SIDEBAR_HEIGHT = '54px';
|
|
17
|
-
export var SEARCH_ITEM_MARGIN = '12px';
|
|
18
17
|
export var SEARCH_ITEM_HEIGHT_WIDTH = '20px';
|
|
19
18
|
export var SCROLLBAR_WIDTH = 15;
|
|
20
19
|
export var ELEMENT_LIST_PADDING = 2;
|
package/dist/esm/ui/styles.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9
|
|
2
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9;
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
4
|
import { N30 } from '@atlaskit/theme/colors';
|
|
5
5
|
export { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
|
|
@@ -12,7 +12,4 @@ export var expandIconWrapperStyle = css(_templateObject5 || (_templateObject5 =
|
|
|
12
12
|
export var triggerWrapperStyles = css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n display: flex;\n"])));
|
|
13
13
|
export var buttonContentStyle = css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n display: flex;\n min-width: 80px;\n align-items: center;\n overflow: hidden;\n justify-content: center;\n flex-direction: column;\n padding: 6px;\n"])));
|
|
14
14
|
export var buttonContentReducedSpacingStyle = css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n padding: 8px;\n"])));
|
|
15
|
-
|
|
16
|
-
// Taken from the style of inline dialog components
|
|
17
|
-
export var dropShadow = css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n box-shadow: ", ";\n"])), "var(--ds-shadow-overlay, ".concat("0 0 1px rgba(9, 30, 66, 0.31),\n 0 4px 8px -2px rgba(9, 30, 66, 0.25)", ")"));
|
|
18
|
-
export var clickSelectWrapperStyle = css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n user-select: all;\n"])));
|
|
15
|
+
export var clickSelectWrapperStyle = css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n user-select: all;\n"])));
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
-
import { createEditorSelectionAPI } from '../selection-api/api';
|
|
3
2
|
import createPluginsList from '../create-editor/create-plugins-list';
|
|
4
3
|
|
|
5
4
|
/**
|
|
@@ -17,9 +16,8 @@ var getEditorPlugins = function getEditorPlugins(_ref) {
|
|
|
17
16
|
insertNodeAPI = _ref.insertNodeAPI,
|
|
18
17
|
editorAnalyticsAPI = _ref.editorAnalyticsAPI;
|
|
19
18
|
var dangerouslyAppendedPlugins = (_props$dangerouslyApp = (_props$dangerouslyApp2 = props.dangerouslyAppendPlugins) === null || _props$dangerouslyApp2 === void 0 ? void 0 : _props$dangerouslyApp2.__plugins) !== null && _props$dangerouslyApp !== void 0 ? _props$dangerouslyApp : [];
|
|
20
|
-
var selectionAPI = createEditorSelectionAPI();
|
|
21
19
|
return [].concat(_toConsumableArray(createPluginsList(props, {
|
|
22
20
|
appearance: prevAppearance
|
|
23
|
-
}, createAnalyticsEvent
|
|
21
|
+
}, createAnalyticsEvent)), _toConsumableArray(dangerouslyAppendedPlugins));
|
|
24
22
|
};
|
|
25
23
|
export default getEditorPlugins;
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -1,23 +1,17 @@
|
|
|
1
1
|
import { toggleMark } from 'prosemirror-commands';
|
|
2
|
-
import { Fragment, Slice } from 'prosemirror-model';
|
|
3
2
|
import { NodeSelection, TextSelection } from 'prosemirror-state';
|
|
4
|
-
import { findWrapping, liftTarget } from 'prosemirror-transform';
|
|
5
3
|
import { JSONTransformer } from '@atlaskit/editor-json-transformer';
|
|
6
4
|
import { FakeTextCursorSelection } from '../plugins/fake-text-cursor/cursor';
|
|
7
5
|
import { hasParentNodeOfType } from 'prosemirror-utils';
|
|
8
6
|
import { isNodeEmpty } from './document';
|
|
9
7
|
import { atTheBeginningOfDoc, atTheEndOfDoc } from './prosemirror/position';
|
|
8
|
+
import { isMediaNode } from '@atlaskit/editor-common/utils';
|
|
10
9
|
export { insideTable } from '@atlaskit/editor-common/core-utils';
|
|
11
10
|
export { isEmptyParagraph, hasVisibleContent, isNodeEmpty, isEmptyDocument, processRawValue, getStepRange, findFarthestParentNode, isSelectionEndOfParagraph, nodesBetweenChanged, getNodesCount } from './document';
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
15
|
-
export { normaliseNestedLayout, setNodeSelection, setAllSelection, setGapCursorSelection, setCellSelection, setTextSelection, isValidPosition } from './selection';
|
|
16
|
-
export { containsClassName } from './dom';
|
|
11
|
+
export { sanitiseMarksInSelection } from './mark';
|
|
12
|
+
export { isParagraph, isText, isLinkMark } from './nodes';
|
|
13
|
+
export { normaliseNestedLayout, setNodeSelection, setGapCursorSelection, setTextSelection } from './selection';
|
|
17
14
|
export { default as measurements } from './performance/measure-enum';
|
|
18
|
-
function validateNode(_node) {
|
|
19
|
-
return false;
|
|
20
|
-
}
|
|
21
15
|
function isMarkTypeCompatibleWithMark(markType, mark) {
|
|
22
16
|
return !mark.type.excludes(markType) && !markType.excludes(mark.type);
|
|
23
17
|
}
|
|
@@ -25,23 +19,12 @@ function isMarkTypeAllowedInNode(markType, state) {
|
|
|
25
19
|
return toggleMark(markType)(state);
|
|
26
20
|
}
|
|
27
21
|
export function canMoveUp(state) {
|
|
28
|
-
var selection = state.selection
|
|
29
|
-
doc = state.doc;
|
|
30
|
-
|
|
22
|
+
var selection = state.selection;
|
|
31
23
|
/**
|
|
32
|
-
* If there's a media element on the selection
|
|
33
|
-
* add text blocks with arrow navigation.
|
|
34
|
-
* Also, the selection could be media | mediaGroup.
|
|
24
|
+
* If there's a media element on the selection it will use a gap cursor to move
|
|
35
25
|
*/
|
|
36
|
-
if (selection instanceof NodeSelection) {
|
|
37
|
-
|
|
38
|
-
/** Weird way of checking if the previous element is a paragraph */
|
|
39
|
-
var mediaAncestorNode = doc.nodeAt(selection.anchor - 3);
|
|
40
|
-
return !!(mediaAncestorNode && mediaAncestorNode.type.name === 'paragraph');
|
|
41
|
-
} else if (selection.node.type.name === 'mediaGroup') {
|
|
42
|
-
var mediaGroupAncestorNode = selection.$anchor.nodeBefore;
|
|
43
|
-
return !!(mediaGroupAncestorNode && mediaGroupAncestorNode.type.name === 'paragraph');
|
|
44
|
-
}
|
|
26
|
+
if (selection instanceof NodeSelection && isMediaNode(selection.node)) {
|
|
27
|
+
return true;
|
|
45
28
|
}
|
|
46
29
|
if (selection instanceof TextSelection) {
|
|
47
30
|
if (!selection.empty) {
|
|
@@ -51,21 +34,13 @@ export function canMoveUp(state) {
|
|
|
51
34
|
return !atTheBeginningOfDoc(state);
|
|
52
35
|
}
|
|
53
36
|
export function canMoveDown(state) {
|
|
54
|
-
var selection = state.selection
|
|
55
|
-
doc = state.doc;
|
|
37
|
+
var selection = state.selection;
|
|
56
38
|
|
|
57
39
|
/**
|
|
58
|
-
* If there's a media element on the selection
|
|
59
|
-
* add text blocks with arrow navigation.
|
|
60
|
-
* Also, the selection could be media | mediaGroup.
|
|
40
|
+
* If there's a media element on the selection it will use a gap cursor to move
|
|
61
41
|
*/
|
|
62
|
-
if (selection instanceof NodeSelection) {
|
|
63
|
-
|
|
64
|
-
var nodeAfter = doc.nodeAt(selection.$head.after());
|
|
65
|
-
return !!(nodeAfter && nodeAfter.type.name === 'paragraph');
|
|
66
|
-
} else if (selection.node.type.name === 'mediaGroup') {
|
|
67
|
-
return !(selection.$head.parentOffset === selection.$anchor.parent.content.size);
|
|
68
|
-
}
|
|
42
|
+
if (selection instanceof NodeSelection && isMediaNode(selection.node)) {
|
|
43
|
+
return true;
|
|
69
44
|
}
|
|
70
45
|
if (selection instanceof TextSelection) {
|
|
71
46
|
if (!selection.empty) {
|
|
@@ -126,19 +101,6 @@ export function isMarkTypeAllowedInCurrentSelection(markType, state) {
|
|
|
126
101
|
return allowedInActiveMarks;
|
|
127
102
|
});
|
|
128
103
|
}
|
|
129
|
-
export function createSliceWithContent(content, state) {
|
|
130
|
-
return new Slice(Fragment.from(state.schema.text(content)), 0, 0);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* Determines if content inside a selection can be joined with the next block.
|
|
135
|
-
* We need this check since the built-in method for "joinDown" will join a orderedList with bulletList.
|
|
136
|
-
*/
|
|
137
|
-
export function canJoinDown(selection, doc, nodeType) {
|
|
138
|
-
return checkNodeDown(selection, doc, function (node) {
|
|
139
|
-
return node.type === nodeType;
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
104
|
export function checkNodeDown(selection, doc, filter) {
|
|
143
105
|
var ancestorDepth = findAncestorPosition(doc, selection.$to).depth;
|
|
144
106
|
|
|
@@ -150,65 +112,10 @@ export function checkNodeDown(selection, doc, filter) {
|
|
|
150
112
|
return res.nodeAfter ? filter(res.nodeAfter) : false;
|
|
151
113
|
}
|
|
152
114
|
|
|
153
|
-
/**
|
|
154
|
-
* Determines if content inside a selection can be joined with the previous block.
|
|
155
|
-
* We need this check since the built-in method for "joinUp" will join a orderedList with bulletList.
|
|
156
|
-
*/
|
|
157
|
-
export function canJoinUp(selection, doc, nodeType) {
|
|
158
|
-
var res = doc.resolve(selection.$from.before(findAncestorPosition(doc, selection.$from).depth));
|
|
159
|
-
return res.nodeBefore && res.nodeBefore.type === nodeType;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* Finds all "selection-groups" within a range. A selection group is based on ancestors.
|
|
164
|
-
*
|
|
165
|
-
* Example:
|
|
166
|
-
* Given the following document and selection ({<} = start of selection and {>} = end)
|
|
167
|
-
* doc
|
|
168
|
-
* blockquote
|
|
169
|
-
* ul
|
|
170
|
-
* li
|
|
171
|
-
* li{<}
|
|
172
|
-
* li
|
|
173
|
-
* p
|
|
174
|
-
* p{>}
|
|
175
|
-
*
|
|
176
|
-
* The output will be two selection-groups. One within the ul and one with the two paragraphs.
|
|
177
|
-
*/
|
|
178
|
-
export function getGroupsInRange(doc, $from, $to) {
|
|
179
|
-
var isNodeValid = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : validateNode;
|
|
180
|
-
var groups = Array();
|
|
181
|
-
var commonAncestor = hasCommonAncestor(doc, $from, $to);
|
|
182
|
-
var fromAncestor = findAncestorPosition(doc, $from);
|
|
183
|
-
if (commonAncestor || fromAncestor.depth === 1 && isNodeValid($from.node(1))) {
|
|
184
|
-
groups.push({
|
|
185
|
-
$from: $from,
|
|
186
|
-
$to: $to
|
|
187
|
-
});
|
|
188
|
-
} else {
|
|
189
|
-
var current = $from;
|
|
190
|
-
while (current.pos < $to.pos) {
|
|
191
|
-
var ancestorPos = findAncestorPosition(doc, current);
|
|
192
|
-
while (ancestorPos.depth > 1) {
|
|
193
|
-
ancestorPos = findAncestorPosition(doc, ancestorPos);
|
|
194
|
-
}
|
|
195
|
-
var endPos = doc.resolve(Math.min(
|
|
196
|
-
// should not be smaller then start position in case of an empty paragraph for example.
|
|
197
|
-
Math.max(ancestorPos.start(ancestorPos.depth), ancestorPos.end(ancestorPos.depth) - 3), $to.pos));
|
|
198
|
-
groups.push({
|
|
199
|
-
$from: current,
|
|
200
|
-
$to: endPos
|
|
201
|
-
});
|
|
202
|
-
current = doc.resolve(Math.min(endPos.after(1) + 1, doc.nodeSize - 2));
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
return groups;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
115
|
/**
|
|
209
116
|
* Traverse the document until an "ancestor" is found. Any nestable block can be an ancestor.
|
|
210
117
|
*/
|
|
211
|
-
|
|
118
|
+
function findAncestorPosition(doc, pos) {
|
|
212
119
|
var nestableBlocks = ['blockquote', 'bulletList', 'orderedList'];
|
|
213
120
|
if (pos.depth === 1) {
|
|
214
121
|
return pos;
|
|
@@ -224,96 +131,6 @@ export function findAncestorPosition(doc, pos) {
|
|
|
224
131
|
}
|
|
225
132
|
return newPos;
|
|
226
133
|
}
|
|
227
|
-
|
|
228
|
-
/**
|
|
229
|
-
* Determine if two positions have a common ancestor.
|
|
230
|
-
*/
|
|
231
|
-
export function hasCommonAncestor(doc, $from, $to) {
|
|
232
|
-
var current;
|
|
233
|
-
var target;
|
|
234
|
-
if ($from.depth > $to.depth) {
|
|
235
|
-
current = findAncestorPosition(doc, $from);
|
|
236
|
-
target = findAncestorPosition(doc, $to);
|
|
237
|
-
} else {
|
|
238
|
-
current = findAncestorPosition(doc, $to);
|
|
239
|
-
target = findAncestorPosition(doc, $from);
|
|
240
|
-
}
|
|
241
|
-
while (current.depth > target.depth && current.depth > 1) {
|
|
242
|
-
current = findAncestorPosition(doc, current);
|
|
243
|
-
}
|
|
244
|
-
return current.node(current.depth) === target.node(target.depth);
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
/**
|
|
248
|
-
* Takes a selection $from and $to and lift all text nodes from their parents to document-level
|
|
249
|
-
*/
|
|
250
|
-
export function liftSelection(tr, doc, $from, $to) {
|
|
251
|
-
var startPos = $from.start($from.depth);
|
|
252
|
-
var endPos = $to.end($to.depth);
|
|
253
|
-
var target = Math.max(0, findAncestorPosition(doc, $from).depth - 1);
|
|
254
|
-
tr.doc.nodesBetween(startPos, endPos, function (node, pos) {
|
|
255
|
-
if (node.isText ||
|
|
256
|
-
// Text node
|
|
257
|
-
node.isTextblock && !node.textContent // Empty paragraph
|
|
258
|
-
) {
|
|
259
|
-
var res = tr.doc.resolve(tr.mapping.map(pos));
|
|
260
|
-
var sel = new NodeSelection(res);
|
|
261
|
-
var range = sel.$from.blockRange(sel.$to);
|
|
262
|
-
if (liftTarget(range) !== undefined) {
|
|
263
|
-
tr.lift(range, target);
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
});
|
|
267
|
-
startPos = tr.mapping.map(startPos);
|
|
268
|
-
endPos = tr.mapping.map(endPos);
|
|
269
|
-
endPos = tr.doc.resolve(endPos).end(tr.doc.resolve(endPos).depth); // We want to select the entire node
|
|
270
|
-
|
|
271
|
-
tr.setSelection(new TextSelection(tr.doc.resolve(startPos), tr.doc.resolve(endPos)));
|
|
272
|
-
return {
|
|
273
|
-
tr: tr,
|
|
274
|
-
$from: tr.doc.resolve(startPos),
|
|
275
|
-
$to: tr.doc.resolve(endPos)
|
|
276
|
-
};
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
/**
|
|
280
|
-
* Lift nodes in block to one level above.
|
|
281
|
-
*/
|
|
282
|
-
export function liftSiblingNodes(view) {
|
|
283
|
-
var tr = view.state.tr;
|
|
284
|
-
var _view$state$selection = view.state.selection,
|
|
285
|
-
$from = _view$state$selection.$from,
|
|
286
|
-
$to = _view$state$selection.$to;
|
|
287
|
-
var blockStart = tr.doc.resolve($from.start($from.depth - 1));
|
|
288
|
-
var blockEnd = tr.doc.resolve($to.end($to.depth - 1));
|
|
289
|
-
var range = blockStart.blockRange(blockEnd);
|
|
290
|
-
view.dispatch(tr.lift(range, blockStart.depth - 1));
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
/**
|
|
294
|
-
* Lift sibling nodes to document-level and select them.
|
|
295
|
-
*/
|
|
296
|
-
export function liftAndSelectSiblingNodes(view) {
|
|
297
|
-
var tr = view.state.tr;
|
|
298
|
-
var _view$state$selection2 = view.state.selection,
|
|
299
|
-
$from = _view$state$selection2.$from,
|
|
300
|
-
$to = _view$state$selection2.$to;
|
|
301
|
-
var blockStart = tr.doc.resolve($from.start($from.depth - 1));
|
|
302
|
-
var blockEnd = tr.doc.resolve($to.end($to.depth - 1));
|
|
303
|
-
// TODO: [ts30] handle void and null properly
|
|
304
|
-
var range = blockStart.blockRange(blockEnd);
|
|
305
|
-
tr.setSelection(new TextSelection(blockStart, blockEnd));
|
|
306
|
-
tr.lift(range, blockStart.depth - 1);
|
|
307
|
-
return tr;
|
|
308
|
-
}
|
|
309
|
-
export function wrapIn(nodeType, tr, $from, $to) {
|
|
310
|
-
var range = $from.blockRange($to);
|
|
311
|
-
var wrapping = range && findWrapping(range, nodeType);
|
|
312
|
-
if (wrapping) {
|
|
313
|
-
tr = tr.wrap(range, wrapping).scrollIntoView();
|
|
314
|
-
}
|
|
315
|
-
return tr;
|
|
316
|
-
}
|
|
317
134
|
var transformer = new JSONTransformer();
|
|
318
135
|
export function toJSON(node) {
|
|
319
136
|
return transformer.encode(node);
|
|
@@ -24,19 +24,6 @@ export var ruleWithAnalytics = function ruleWithAnalytics(getPayload) {
|
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
26
|
};
|
|
27
|
-
export var ruleWithTransform = function ruleWithTransform(transform) {
|
|
28
|
-
return function (originalRule) {
|
|
29
|
-
var onHandlerApply = function onHandlerApply(state, tr, matchResult) {
|
|
30
|
-
transform(state, tr);
|
|
31
|
-
if (originalRule.onHandlerApply) {
|
|
32
|
-
originalRule.onHandlerApply(state, tr, matchResult);
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
return _objectSpread(_objectSpread({}, originalRule), {}, {
|
|
36
|
-
onHandlerApply: onHandlerApply
|
|
37
|
-
});
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
27
|
export var createRule = function createRule(match, handler) {
|
|
41
28
|
return {
|
|
42
29
|
match: match,
|
package/dist/esm/version.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Node } from 'prosemirror-model';
|
|
2
|
-
import {
|
|
3
|
-
import { EditorView } from 'prosemirror-view';
|
|
4
|
-
import { EventDispatcher } from '../event-dispatcher';
|
|
2
|
+
import { ContextUpdateHandler, EditorActionsOptions, ReplaceRawValue } from '@atlaskit/editor-common/types';
|
|
5
3
|
import { AnalyticsEventPayload } from '@atlaskit/analytics-next/AnalyticsEvent';
|
|
6
|
-
import { Transformer } from '@atlaskit/editor-common/types';
|
|
7
4
|
import { ResolvedEditorState } from '@atlaskit/editor-common/collab';
|
|
5
|
+
import { Transformer } from '@atlaskit/editor-common/types';
|
|
6
|
+
import { EditorView } from 'prosemirror-view';
|
|
7
|
+
import { EventDispatcher } from '../event-dispatcher';
|
|
8
8
|
export default class EditorActions<T = any> implements EditorActionsOptions<T> {
|
|
9
9
|
private editorView?;
|
|
10
10
|
private contentTransformer?;
|