@atlaskit/editor-core 151.1.2 → 151.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/dist/cjs/create-editor/ReactEditorView.js +22 -8
- package/dist/cjs/create-editor/create-plugins-list.js +30 -11
- package/dist/cjs/labs/next/presets/cxhtml.js +1 -2
- package/dist/cjs/labs/next/presets/default.js +3 -1
- package/dist/cjs/nodeviews/ReactNodeView.js +2 -2
- package/dist/cjs/nodeviews/SelectionBasedNodeView.js +6 -0
- package/dist/cjs/plugins/analytics/types/enums.js +1 -0
- package/dist/cjs/plugins/annotation/utils.js +19 -8
- package/dist/cjs/plugins/avatar-group/index.js +2 -1
- package/dist/cjs/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +5 -2
- package/dist/cjs/plugins/before-primaryToolbar/index.js +26 -0
- package/dist/cjs/plugins/before-primaryToolbar/ui/BeforePrimaryToolbarWrapper.js +28 -0
- package/dist/cjs/plugins/code-bidi-warning/index.js +5 -2
- package/dist/cjs/plugins/code-bidi-warning/pm-plugins/main.js +12 -3
- package/dist/cjs/plugins/code-bidi-warning/pm-plugins/plugin-factory.js +15 -5
- package/dist/cjs/plugins/code-block/index.js +3 -3
- package/dist/cjs/plugins/code-block/nodeviews/highlighting-code-block.js +6 -3
- package/dist/cjs/plugins/code-block/pm-plugins/main.js +11 -3
- package/dist/cjs/plugins/extension/extension-api.js +10 -2
- package/dist/cjs/plugins/extension/ui/styles.js +1 -1
- package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +4 -2
- package/dist/cjs/plugins/find-replace/FindReplaceToolbarButtonWithState.js +172 -0
- package/dist/cjs/plugins/find-replace/index.js +14 -137
- package/dist/cjs/plugins/find-replace/ui/Find.js +16 -9
- package/dist/cjs/plugins/find-replace/ui/FindReplace.js +9 -2
- package/dist/cjs/plugins/find-replace/ui/Replace.js +11 -3
- package/dist/cjs/plugins/find-replace/ui/styles.js +44 -35
- package/dist/cjs/plugins/floating-toolbar/ui/EmojiPickerButton.js +10 -4
- package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +1 -1
- package/dist/cjs/plugins/fragment/index.js +34 -0
- package/dist/cjs/plugins/fragment/plugin-key.js +11 -0
- package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +1 -1
- package/dist/cjs/plugins/index.js +16 -0
- package/dist/cjs/plugins/list/actions/conversions.js +39 -71
- package/dist/cjs/plugins/list/transforms.js +7 -1
- package/dist/cjs/plugins/media/index.js +2 -3
- package/dist/cjs/plugins/media/nodeviews/mediaGroup.js +3 -1
- package/dist/cjs/plugins/media/nodeviews/mediaInline.js +12 -5
- package/dist/cjs/plugins/media/nodeviews/mediaNodeUpdater.js +3 -3
- package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +6 -4
- package/dist/cjs/plugins/media/nodeviews/styles.js +6 -1
- package/dist/cjs/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +5 -1
- package/dist/cjs/plugins/media/pm-plugins/main.js +49 -15
- package/dist/cjs/plugins/media/toolbar/commands.js +59 -0
- package/dist/cjs/plugins/media/toolbar/filePreviewItem.js +7 -2
- package/dist/cjs/plugins/media/toolbar/index.js +90 -3
- package/dist/cjs/plugins/media/ui/ResizableMediaSingle/index.js +9 -1
- package/dist/cjs/plugins/media/utils/media-common.js +1 -1
- package/dist/cjs/plugins/media/utils/media-files.js +5 -1
- package/dist/cjs/plugins/panel/actions.js +2 -2
- package/dist/cjs/plugins/panel/index.js +3 -3
- package/dist/cjs/plugins/panel/nodeviews/panel.js +2 -2
- package/dist/cjs/plugins/panel/toolbar.js +10 -5
- package/dist/cjs/plugins/panel/utils.js +15 -0
- package/dist/cjs/plugins/rank.js +3 -2
- package/dist/cjs/plugins/selection/pm-plugins/selection-main.js +49 -1
- package/dist/cjs/plugins/status/ui/statusPicker.js +4 -2
- package/dist/cjs/plugins/table/commands/insert.js +1 -0
- package/dist/cjs/plugins/table/index.js +3 -2
- package/dist/cjs/plugins/table/nodeviews/OverflowShadowsObserver.js +1 -3
- package/dist/cjs/plugins/table/pm-plugins/main.js +26 -3
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +2 -2
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +2 -0
- package/dist/cjs/plugins/table/transforms/column-width.js +14 -5
- package/dist/cjs/plugins/table/transforms/fix-tables.js +43 -6
- package/dist/cjs/plugins/table/ui/FloatingContextualButton/index.js +3 -2
- package/dist/cjs/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +1 -0
- package/dist/cjs/plugins/table/ui/common-styles.css.js +1 -1
- package/dist/cjs/plugins/table/ui/consts.js +1 -1
- package/dist/cjs/plugins/table/ui/messages.js +1 -1
- package/dist/cjs/plugins/tasks-and-decisions/nodeviews/decisionItem.js +1 -1
- package/dist/cjs/plugins/tasks-and-decisions/nodeviews/taskItem.js +1 -1
- package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/main.js +2 -2
- package/dist/cjs/plugins/text-color/ui/ToolbarTextColor/index.js +2 -1
- package/dist/cjs/plugins/text-formatting/index.js +2 -1
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadList.js +1 -0
- package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +77 -26
- package/dist/cjs/ui/Appearance/FullPage/MainToolbar.js +32 -9
- package/dist/cjs/ui/ColorPalette/Color/index.js +8 -18
- package/dist/cjs/ui/ColorPalette/index.js +7 -4
- package/dist/cjs/ui/ColorPickerButton/index.js +1 -1
- package/dist/cjs/ui/ConfigPanel/ConfigPanel.js +114 -61
- package/dist/cjs/ui/ConfigPanel/FormContent.js +39 -26
- package/dist/cjs/ui/ConfigPanel/transformers.js +490 -248
- package/dist/cjs/ui/ConfigPanel/utils.js +2 -10
- package/dist/cjs/ui/DropdownMenu/index.js +3 -1
- package/dist/cjs/ui/LinkSearch/LinkSearchListItem.js +1 -1
- package/dist/cjs/ui/Resizer/index.js +9 -1
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/create-editor/ReactEditorView.js +19 -8
- package/dist/es2019/create-editor/create-plugins-list.js +31 -12
- package/dist/es2019/labs/next/presets/cxhtml.js +1 -2
- package/dist/es2019/labs/next/presets/default.js +3 -1
- package/dist/es2019/nodeviews/ReactNodeView.js +1 -1
- package/dist/es2019/nodeviews/SelectionBasedNodeView.js +11 -0
- package/dist/es2019/plugins/analytics/types/enums.js +1 -0
- package/dist/es2019/plugins/annotation/utils.js +18 -7
- package/dist/es2019/plugins/avatar-group/index.js +2 -1
- package/dist/es2019/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +3 -2
- package/dist/es2019/plugins/before-primaryToolbar/index.js +15 -0
- package/dist/es2019/plugins/before-primaryToolbar/ui/BeforePrimaryToolbarWrapper.js +12 -0
- package/dist/es2019/plugins/code-bidi-warning/index.js +8 -2
- package/dist/es2019/plugins/code-bidi-warning/pm-plugins/main.js +12 -2
- package/dist/es2019/plugins/code-bidi-warning/pm-plugins/plugin-factory.js +16 -5
- package/dist/es2019/plugins/code-block/index.js +3 -2
- package/dist/es2019/plugins/code-block/nodeviews/highlighting-code-block.js +6 -3
- package/dist/es2019/plugins/code-block/pm-plugins/main.js +11 -3
- package/dist/es2019/plugins/extension/extension-api.js +9 -2
- package/dist/es2019/plugins/extension/ui/styles.js +6 -0
- package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +4 -2
- package/dist/es2019/plugins/find-replace/FindReplaceToolbarButtonWithState.js +152 -0
- package/dist/es2019/plugins/find-replace/index.js +15 -128
- package/dist/es2019/plugins/find-replace/ui/Find.js +18 -10
- package/dist/es2019/plugins/find-replace/ui/FindReplace.js +11 -3
- package/dist/es2019/plugins/find-replace/ui/Replace.js +12 -4
- package/dist/es2019/plugins/find-replace/ui/styles.js +37 -47
- package/dist/es2019/plugins/floating-toolbar/ui/DropdownMenu.js +2 -1
- package/dist/es2019/plugins/floating-toolbar/ui/EmojiPickerButton.js +10 -2
- package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +1 -1
- package/dist/es2019/plugins/fragment/index.js +22 -0
- package/dist/es2019/plugins/fragment/plugin-key.js +2 -0
- package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +2 -2
- package/dist/es2019/plugins/index.js +2 -0
- package/dist/es2019/plugins/list/actions/conversions.js +38 -69
- package/dist/es2019/plugins/list/transforms.js +5 -1
- package/dist/es2019/plugins/media/index.js +2 -2
- package/dist/es2019/plugins/media/nodeviews/mediaGroup.js +2 -1
- package/dist/es2019/plugins/media/nodeviews/mediaInline.js +8 -4
- package/dist/es2019/plugins/media/nodeviews/mediaNodeUpdater.js +3 -3
- package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +7 -5
- package/dist/es2019/plugins/media/nodeviews/styles.js +2 -0
- package/dist/es2019/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +5 -1
- package/dist/es2019/plugins/media/pm-plugins/main.js +32 -17
- package/dist/es2019/plugins/media/toolbar/commands.js +47 -0
- package/dist/es2019/plugins/media/toolbar/filePreviewItem.js +6 -2
- package/dist/es2019/plugins/media/toolbar/index.js +90 -3
- package/dist/es2019/plugins/media/ui/ResizableMediaSingle/index.js +7 -1
- package/dist/es2019/plugins/media/utils/media-common.js +1 -1
- package/dist/es2019/plugins/media/utils/media-files.js +6 -1
- package/dist/es2019/plugins/panel/actions.js +2 -2
- package/dist/es2019/plugins/panel/index.js +5 -5
- package/dist/es2019/plugins/panel/nodeviews/panel.js +2 -2
- package/dist/es2019/plugins/panel/toolbar.js +10 -5
- package/dist/es2019/plugins/panel/utils.js +8 -1
- package/dist/es2019/plugins/rank.js +3 -2
- package/dist/es2019/plugins/selection/pm-plugins/selection-main.js +48 -1
- package/dist/es2019/plugins/status/ui/statusPicker.js +4 -2
- package/dist/es2019/plugins/table/commands/insert.js +1 -2
- package/dist/es2019/plugins/table/index.js +2 -1
- package/dist/es2019/plugins/table/nodeviews/OverflowShadowsObserver.js +1 -2
- package/dist/es2019/plugins/table/pm-plugins/main.js +25 -4
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +2 -2
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +2 -0
- package/dist/es2019/plugins/table/transforms/column-width.js +13 -3
- package/dist/es2019/plugins/table/transforms/fix-tables.js +43 -5
- package/dist/es2019/plugins/table/ui/FloatingContextualButton/index.js +3 -2
- package/dist/es2019/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +1 -0
- package/dist/es2019/plugins/table/ui/common-styles.css.js +5 -1
- package/dist/es2019/plugins/table/ui/consts.js +2 -2
- package/dist/es2019/plugins/table/ui/messages.js +1 -1
- package/dist/es2019/plugins/tasks-and-decisions/nodeviews/decisionItem.js +1 -1
- package/dist/es2019/plugins/tasks-and-decisions/nodeviews/taskItem.js +1 -1
- package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/main.js +3 -3
- package/dist/es2019/plugins/text-color/ui/ToolbarTextColor/index.js +2 -1
- package/dist/es2019/plugins/text-formatting/index.js +3 -2
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadList.js +2 -1
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadListItem.js +2 -1
- package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +60 -27
- package/dist/es2019/ui/Appearance/FullPage/MainToolbar.js +51 -7
- package/dist/es2019/ui/ColorPalette/Color/index.js +9 -18
- package/dist/es2019/ui/ColorPalette/index.js +7 -4
- package/dist/es2019/ui/ColorPickerButton/index.js +1 -1
- package/dist/es2019/ui/ConfigPanel/ConfigPanel.js +101 -49
- package/dist/es2019/ui/ConfigPanel/FormContent.js +35 -26
- package/dist/es2019/ui/ConfigPanel/transformers.js +243 -72
- package/dist/es2019/ui/ConfigPanel/utils.js +1 -2
- package/dist/es2019/ui/Dropdown/index.js +2 -1
- package/dist/es2019/ui/DropdownMenu/index.js +7 -3
- package/dist/es2019/ui/ElementBrowser/InsertMenu.js +1 -0
- package/dist/es2019/ui/ElementBrowser/components/ElementList/ElementList.js +1 -0
- package/dist/es2019/ui/LinkSearch/LinkSearchListItem.js +2 -2
- package/dist/es2019/ui/Resizer/index.js +9 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/create-editor/ReactEditorView.js +22 -8
- package/dist/esm/create-editor/create-plugins-list.js +31 -12
- package/dist/esm/labs/next/presets/cxhtml.js +1 -2
- package/dist/esm/labs/next/presets/default.js +3 -1
- package/dist/esm/nodeviews/ReactNodeView.js +2 -2
- package/dist/esm/nodeviews/SelectionBasedNodeView.js +7 -0
- package/dist/esm/plugins/analytics/types/enums.js +1 -0
- package/dist/esm/plugins/annotation/utils.js +18 -7
- package/dist/esm/plugins/avatar-group/index.js +2 -1
- package/dist/esm/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +5 -2
- package/dist/esm/plugins/before-primaryToolbar/index.js +15 -0
- package/dist/esm/plugins/before-primaryToolbar/ui/BeforePrimaryToolbarWrapper.js +12 -0
- package/dist/esm/plugins/code-bidi-warning/index.js +5 -2
- package/dist/esm/plugins/code-bidi-warning/pm-plugins/main.js +12 -3
- package/dist/esm/plugins/code-bidi-warning/pm-plugins/plugin-factory.js +15 -5
- package/dist/esm/plugins/code-block/index.js +3 -3
- package/dist/esm/plugins/code-block/nodeviews/highlighting-code-block.js +6 -3
- package/dist/esm/plugins/code-block/pm-plugins/main.js +11 -3
- package/dist/esm/plugins/extension/extension-api.js +9 -2
- package/dist/esm/plugins/extension/ui/styles.js +1 -1
- package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +4 -2
- package/dist/esm/plugins/find-replace/FindReplaceToolbarButtonWithState.js +155 -0
- package/dist/esm/plugins/find-replace/index.js +14 -131
- package/dist/esm/plugins/find-replace/ui/Find.js +17 -10
- package/dist/esm/plugins/find-replace/ui/FindReplace.js +10 -3
- package/dist/esm/plugins/find-replace/ui/Replace.js +11 -4
- package/dist/esm/plugins/find-replace/ui/styles.js +39 -18
- package/dist/esm/plugins/floating-toolbar/ui/DropdownMenu.js +2 -1
- package/dist/esm/plugins/floating-toolbar/ui/EmojiPickerButton.js +9 -4
- package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +1 -1
- package/dist/esm/plugins/fragment/index.js +22 -0
- package/dist/esm/plugins/fragment/plugin-key.js +2 -0
- package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +2 -2
- package/dist/esm/plugins/index.js +2 -0
- package/dist/esm/plugins/list/actions/conversions.js +38 -71
- package/dist/esm/plugins/list/transforms.js +7 -1
- package/dist/esm/plugins/media/index.js +2 -3
- package/dist/esm/plugins/media/nodeviews/mediaGroup.js +2 -1
- package/dist/esm/plugins/media/nodeviews/mediaInline.js +11 -6
- package/dist/esm/plugins/media/nodeviews/mediaNodeUpdater.js +3 -3
- package/dist/esm/plugins/media/nodeviews/mediaSingle.js +7 -5
- package/dist/esm/plugins/media/nodeviews/styles.js +2 -0
- package/dist/esm/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +5 -1
- package/dist/esm/plugins/media/pm-plugins/main.js +47 -16
- package/dist/esm/plugins/media/toolbar/commands.js +45 -0
- package/dist/esm/plugins/media/toolbar/filePreviewItem.js +6 -2
- package/dist/esm/plugins/media/toolbar/index.js +88 -3
- package/dist/esm/plugins/media/ui/ResizableMediaSingle/index.js +9 -1
- package/dist/esm/plugins/media/utils/media-common.js +1 -1
- package/dist/esm/plugins/media/utils/media-files.js +6 -1
- package/dist/esm/plugins/panel/actions.js +2 -2
- package/dist/esm/plugins/panel/index.js +5 -5
- package/dist/esm/plugins/panel/nodeviews/panel.js +2 -2
- package/dist/esm/plugins/panel/toolbar.js +9 -4
- package/dist/esm/plugins/panel/utils.js +13 -0
- package/dist/esm/plugins/rank.js +3 -2
- package/dist/esm/plugins/selection/pm-plugins/selection-main.js +50 -1
- package/dist/esm/plugins/status/ui/statusPicker.js +4 -2
- package/dist/esm/plugins/table/commands/insert.js +1 -2
- package/dist/esm/plugins/table/index.js +3 -2
- package/dist/esm/plugins/table/nodeviews/OverflowShadowsObserver.js +1 -2
- package/dist/esm/plugins/table/pm-plugins/main.js +27 -4
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +2 -2
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +2 -0
- package/dist/esm/plugins/table/transforms/column-width.js +13 -3
- package/dist/esm/plugins/table/transforms/fix-tables.js +42 -4
- package/dist/esm/plugins/table/ui/FloatingContextualButton/index.js +3 -2
- package/dist/esm/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +1 -0
- package/dist/esm/plugins/table/ui/common-styles.css.js +1 -1
- package/dist/esm/plugins/table/ui/consts.js +2 -2
- package/dist/esm/plugins/table/ui/messages.js +1 -1
- package/dist/esm/plugins/tasks-and-decisions/nodeviews/decisionItem.js +1 -1
- package/dist/esm/plugins/tasks-and-decisions/nodeviews/taskItem.js +1 -1
- package/dist/esm/plugins/tasks-and-decisions/pm-plugins/main.js +3 -3
- package/dist/esm/plugins/text-color/ui/ToolbarTextColor/index.js +2 -1
- package/dist/esm/plugins/text-formatting/index.js +3 -2
- package/dist/esm/plugins/type-ahead/ui/TypeAheadList.js +2 -1
- package/dist/esm/plugins/type-ahead/ui/TypeAheadListItem.js +2 -1
- package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +67 -27
- package/dist/esm/ui/Appearance/FullPage/MainToolbar.js +20 -7
- package/dist/esm/ui/ColorPalette/Color/index.js +9 -16
- package/dist/esm/ui/ColorPalette/index.js +7 -4
- package/dist/esm/ui/ColorPickerButton/index.js +1 -1
- package/dist/esm/ui/ConfigPanel/ConfigPanel.js +113 -62
- package/dist/esm/ui/ConfigPanel/FormContent.js +39 -26
- package/dist/esm/ui/ConfigPanel/transformers.js +488 -248
- package/dist/esm/ui/ConfigPanel/utils.js +1 -6
- package/dist/esm/ui/Dropdown/index.js +2 -1
- package/dist/esm/ui/DropdownMenu/index.js +7 -3
- package/dist/esm/ui/ElementBrowser/InsertMenu.js +1 -0
- package/dist/esm/ui/ElementBrowser/components/ElementList/ElementList.js +1 -0
- package/dist/esm/ui/LinkSearch/LinkSearchListItem.js +2 -2
- package/dist/esm/ui/Resizer/index.js +9 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/labs/next/full-page.d.ts +1 -1
- package/dist/types/nodeviews/ReactNodeView.d.ts +1 -1
- package/dist/types/nodeviews/SelectionBasedNodeView.d.ts +1 -0
- package/dist/types/plugins/analytics/types/enums.d.ts +1 -0
- package/dist/types/plugins/analytics/types/events.d.ts +7 -1
- package/dist/types/plugins/annotation/utils.d.ts +1 -1
- package/dist/types/plugins/avatar-group/index.d.ts +1 -0
- package/dist/types/plugins/avatar-group/ui/AvatarGroupPluginWrapper.d.ts +1 -0
- package/dist/types/plugins/before-primaryToolbar/index.d.ts +5 -0
- package/dist/types/plugins/before-primaryToolbar/ui/BeforePrimaryToolbarWrapper.d.ts +5 -0
- package/dist/types/plugins/code-bidi-warning/index.d.ts +4 -2
- package/dist/types/plugins/code-bidi-warning/pm-plugins/main.d.ts +4 -2
- package/dist/types/plugins/code-bidi-warning/pm-plugins/plugin-factory.d.ts +2 -1
- package/dist/types/plugins/code-bidi-warning/pm-plugins/types.d.ts +1 -0
- package/dist/types/plugins/code-block/index.d.ts +1 -1
- package/dist/types/plugins/code-block/nodeviews/highlighting-code-block.d.ts +12 -1
- package/dist/types/plugins/code-block/pm-plugins/main.d.ts +3 -1
- package/dist/types/plugins/code-block/types.d.ts +2 -0
- package/dist/types/plugins/feature-flags-context/get-enabled-feature-flag-keys.d.ts +1 -1
- package/dist/types/plugins/find-replace/FindReplaceToolbarButtonWithState.d.ts +15 -0
- package/dist/types/plugins/find-replace/index.d.ts +1 -0
- package/dist/types/plugins/find-replace/ui/Find.d.ts +1 -0
- package/dist/types/plugins/find-replace/ui/FindReplace.d.ts +1 -0
- package/dist/types/plugins/find-replace/ui/Replace.d.ts +1 -0
- package/dist/types/plugins/find-replace/ui/styles.d.ts +5 -14
- package/dist/types/plugins/floating-toolbar/ui/EmojiPickerButton.d.ts +1 -1
- package/dist/types/plugins/fragment/index.d.ts +5 -0
- package/dist/types/plugins/fragment/plugin-key.d.ts +2 -0
- package/dist/types/plugins/index.d.ts +2 -0
- package/dist/types/plugins/media/nodeviews/mediaInline.d.ts +3 -2
- package/dist/types/plugins/media/nodeviews/mediaNodeUpdater.d.ts +2 -2
- package/dist/types/plugins/media/nodeviews/mediaSingle.d.ts +1 -1
- package/dist/types/plugins/media/nodeviews/styles.d.ts +2 -0
- package/dist/types/plugins/media/toolbar/commands.d.ts +3 -0
- package/dist/types/plugins/media/toolbar/filePreviewItem.d.ts +2 -0
- package/dist/types/plugins/media/types.d.ts +0 -1
- package/dist/types/plugins/panel/actions.d.ts +1 -1
- package/dist/types/plugins/panel/types.d.ts +8 -2
- package/dist/types/plugins/quick-insert/index.d.ts +2 -1
- package/dist/types/plugins/table/commands/insert.d.ts +3 -0
- package/dist/types/plugins/table/pm-plugins/main.d.ts +2 -1
- package/dist/types/plugins/table/pm-plugins/table-resizing/utils/types.d.ts +1 -0
- package/dist/types/plugins/table/transforms/column-width.d.ts +4 -1
- package/dist/types/plugins/table/transforms/fix-tables.d.ts +3 -2
- package/dist/types/plugins/table/types.d.ts +8 -0
- package/dist/types/plugins/table/ui/consts.d.ts +1 -1
- package/dist/types/types/editor-appearance-component.d.ts +2 -2
- package/dist/types/types/editor-props.d.ts +11 -1
- package/dist/types/types/feature-flags.d.ts +13 -0
- package/dist/types/types/index.d.ts +1 -1
- package/dist/types/ui/Appearance/FullPage/FullPageToolbar.d.ts +2 -2
- package/dist/types/ui/Appearance/FullPage/MainToolbar.d.ts +10 -1
- package/dist/types/ui/ColorPalette/Color/index.d.ts +8 -5
- package/dist/types/ui/ColorPalette/index.d.ts +1 -0
- package/dist/types/ui/ConfigPanel/transformers.d.ts +7 -1
- package/dist/types/ui/ConfigPanel/utils.d.ts +0 -1
- package/dist/types/ui/Resizer/index.d.ts +1 -0
- package/package.json +14 -10
- package/dist/cjs/plugins/floating-toolbar/ui/EditorRemoveEmojiIcon.js +0 -38
- package/dist/es2019/plugins/floating-toolbar/ui/EditorRemoveEmojiIcon.js +0 -28
- package/dist/esm/plugins/floating-toolbar/ui/EditorRemoveEmojiIcon.js +0 -28
- package/dist/types/plugins/floating-toolbar/ui/EditorRemoveEmojiIcon.d.ts +0 -1
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.isValidHex = exports.getNameFromDuplicateField = exports.isDuplicateField = exports.getSafeParentedName = exports.getOptionFromValue = exports.validateRequired = exports.
|
|
8
|
+
exports.isValidHex = exports.getNameFromDuplicateField = exports.isDuplicateField = exports.getSafeParentedName = exports.getOptionFromValue = exports.validateRequired = exports.fromEntries = exports.validate = void 0;
|
|
9
9
|
|
|
10
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
11
|
|
|
@@ -32,14 +32,6 @@ var fromEntries = function fromEntries(iterable) {
|
|
|
32
32
|
|
|
33
33
|
exports.fromEntries = fromEntries;
|
|
34
34
|
|
|
35
|
-
var toEntries = function toEntries(parameters) {
|
|
36
|
-
return Array.isArray(parameters) ? parameters.reduce(function (prev, curr) {
|
|
37
|
-
return [].concat((0, _toConsumableArray2.default)(prev), (0, _toConsumableArray2.default)(Object.entries(curr)));
|
|
38
|
-
}, []) : Object.entries(parameters);
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
exports.toEntries = toEntries;
|
|
42
|
-
|
|
43
35
|
var isEmptyString = function isEmptyString(value) {
|
|
44
36
|
return typeof value === 'string' && value === '';
|
|
45
37
|
};
|
|
@@ -104,7 +96,7 @@ exports.isDuplicateField = isDuplicateField;
|
|
|
104
96
|
var getNameFromDuplicateField = function getNameFromDuplicateField(key) {
|
|
105
97
|
return key.replace(duplicateFieldRegex, '');
|
|
106
98
|
};
|
|
107
|
-
/*
|
|
99
|
+
/*
|
|
108
100
|
ColorPickerButton only accepts 8 digit hex alpha values, for example:
|
|
109
101
|
#123fffaa (8 digits, hex alpha)
|
|
110
102
|
*/
|
|
@@ -134,6 +134,7 @@ var DropdownMenuWrapper = /*#__PURE__*/function (_PureComponent) {
|
|
|
134
134
|
key: item.key || item.content,
|
|
135
135
|
isSelected: item.isActive
|
|
136
136
|
}, /*#__PURE__*/_react.default.createElement(_item.default, {
|
|
137
|
+
role: "menuitem",
|
|
137
138
|
elemBefore: item.elemBefore,
|
|
138
139
|
elemAfter: item.elemAfter,
|
|
139
140
|
isDisabled: item.isDisabled,
|
|
@@ -212,7 +213,8 @@ var DropdownMenuWrapper = /*#__PURE__*/function (_PureComponent) {
|
|
|
212
213
|
}
|
|
213
214
|
}), items.map(function (group, index) {
|
|
214
215
|
return /*#__PURE__*/_react.default.createElement(_item.ItemGroup, {
|
|
215
|
-
key: index
|
|
216
|
+
key: index,
|
|
217
|
+
role: "menu"
|
|
216
218
|
}, group.items.map(function (item) {
|
|
217
219
|
return _this2.renderItem(item);
|
|
218
220
|
}));
|
|
@@ -63,7 +63,7 @@ var Name = _styledComponents.default.div(_templateObject3 || (_templateObject3 =
|
|
|
63
63
|
|
|
64
64
|
exports.Name = Name;
|
|
65
65
|
|
|
66
|
-
var ContainerName = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n line-height: 14px;\n font-size: ", ";\n"])), _colors.
|
|
66
|
+
var ContainerName = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n line-height: 14px;\n font-size: ", ";\n"])), _colors.N300, (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _theme.fontSizeSmall)()));
|
|
67
67
|
|
|
68
68
|
exports.ContainerName = ContainerName;
|
|
69
69
|
|
|
@@ -185,6 +185,7 @@ var Resizer = /*#__PURE__*/function (_React$Component) {
|
|
|
185
185
|
value: function render() {
|
|
186
186
|
var handleStyles = {};
|
|
187
187
|
var handles = {};
|
|
188
|
+
var handleComponent = {};
|
|
188
189
|
var _this$props4 = this.props,
|
|
189
190
|
_this$props4$innerPad = _this$props4.innerPadding,
|
|
190
191
|
innerPadding = _this$props4$innerPad === void 0 ? 0 : _this$props4$innerPad,
|
|
@@ -194,7 +195,8 @@ var Resizer = /*#__PURE__*/function (_React$Component) {
|
|
|
194
195
|
layout = _this$props4.layout,
|
|
195
196
|
enable = _this$props4.enable,
|
|
196
197
|
children = _this$props4.children,
|
|
197
|
-
ratio = _this$props4.ratio
|
|
198
|
+
ratio = _this$props4.ratio,
|
|
199
|
+
handleComponentFunc = _this$props4.handleComponentFunc;
|
|
198
200
|
var isResizing = this.state.isResizing;
|
|
199
201
|
|
|
200
202
|
_utils.handleSides.forEach(function (side) {
|
|
@@ -204,6 +206,11 @@ var Resizer = /*#__PURE__*/function (_React$Component) {
|
|
|
204
206
|
handleStyles[side] = (_handleStyles$side = {
|
|
205
207
|
width: '24px'
|
|
206
208
|
}, (0, _defineProperty2.default)(_handleStyles$side, side, "".concat(-13 - innerPadding, "px")), (0, _defineProperty2.default)(_handleStyles$side, "zIndex", _editorSharedStyles.akRichMediaResizeZIndex), (0, _defineProperty2.default)(_handleStyles$side, "pointerEvents", 'auto'), _handleStyles$side);
|
|
209
|
+
var sideHandleComponent = handleComponentFunc && handleComponentFunc(side);
|
|
210
|
+
|
|
211
|
+
if (sideHandleComponent) {
|
|
212
|
+
handleComponent[side] = sideHandleComponent;
|
|
213
|
+
}
|
|
207
214
|
});
|
|
208
215
|
|
|
209
216
|
var className = (0, _classnames.default)(_editorCommon.richMediaClassName, "image-".concat(layout), this.props.className, {
|
|
@@ -237,6 +244,7 @@ var Resizer = /*#__PURE__*/function (_React$Component) {
|
|
|
237
244
|
handleClasses: handles,
|
|
238
245
|
handleStyles: handleStyles,
|
|
239
246
|
handleWrapperStyle: handleWrapperStyle,
|
|
247
|
+
handleComponent: handleComponent,
|
|
240
248
|
enable: enable,
|
|
241
249
|
onResize: this.handleResize,
|
|
242
250
|
onResizeStop: this.handleResizeStop,
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.nextMajorVersion = exports.version = exports.name = void 0;
|
|
7
7
|
var name = "@atlaskit/editor-core";
|
|
8
8
|
exports.name = name;
|
|
9
|
-
var version = "151.1
|
|
9
|
+
var version = "151.3.1";
|
|
10
10
|
exports.version = version;
|
|
11
11
|
|
|
12
12
|
var nextMajorVersion = function nextMajorVersion() {
|
package/dist/cjs/version.json
CHANGED
|
@@ -471,8 +471,27 @@ export default class ReactEditorView extends React.Component {
|
|
|
471
471
|
transformer: this.contentTransformer
|
|
472
472
|
});
|
|
473
473
|
|
|
474
|
+
if (this.props.editorProps.shouldFocus && view.props.editable && view.props.editable(view.state)) {
|
|
475
|
+
this.focusTimeoutId = handleEditorFocus(view);
|
|
476
|
+
}
|
|
477
|
+
|
|
474
478
|
if (this.featureFlags.ufo) {
|
|
479
|
+
this.experienceStore = ExperienceStore.getInstance(view);
|
|
480
|
+
this.experienceStore.start(EditorExperience.editSession);
|
|
481
|
+
this.experienceStore.addMetadata(EditorExperience.editSession, {
|
|
482
|
+
reliabilityInterval: RELIABILITY_INTERVAL
|
|
483
|
+
});
|
|
475
484
|
this.reliabilityInterval = window.setInterval(() => {
|
|
485
|
+
var _this$experienceStore11, _this$experienceStore12;
|
|
486
|
+
|
|
487
|
+
(_this$experienceStore11 = this.experienceStore) === null || _this$experienceStore11 === void 0 ? void 0 : (_this$experienceStore12 = _this$experienceStore11.success(EditorExperience.editSession)) === null || _this$experienceStore12 === void 0 ? void 0 : _this$experienceStore12.finally(() => {
|
|
488
|
+
var _this$experienceStore13, _this$experienceStore14;
|
|
489
|
+
|
|
490
|
+
(_this$experienceStore13 = this.experienceStore) === null || _this$experienceStore13 === void 0 ? void 0 : _this$experienceStore13.start(EditorExperience.editSession);
|
|
491
|
+
(_this$experienceStore14 = this.experienceStore) === null || _this$experienceStore14 === void 0 ? void 0 : _this$experienceStore14.addMetadata(EditorExperience.editSession, {
|
|
492
|
+
reliabilityInterval: RELIABILITY_INTERVAL
|
|
493
|
+
});
|
|
494
|
+
});
|
|
476
495
|
const reliabilityEvent = {
|
|
477
496
|
action: ACTION.UFO_SESSION_COMPLETE,
|
|
478
497
|
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
@@ -483,14 +502,6 @@ export default class ReactEditorView extends React.Component {
|
|
|
483
502
|
};
|
|
484
503
|
this.dispatchAnalyticsEvent(reliabilityEvent);
|
|
485
504
|
}, RELIABILITY_INTERVAL);
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
if (this.props.editorProps.shouldFocus && view.props.editable && view.props.editable(view.state)) {
|
|
489
|
-
this.focusTimeoutId = handleEditorFocus(view);
|
|
490
|
-
}
|
|
491
|
-
|
|
492
|
-
if (this.featureFlags.ufo) {
|
|
493
|
-
this.experienceStore = ExperienceStore.getInstance(view);
|
|
494
505
|
} // Force React to re-render so consumers get a reference to the editor view
|
|
495
506
|
|
|
496
507
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { breakoutPlugin, collabEditPlugin, dataConsumerMarkPlugin, datePlugin, emojiPlugin, extensionPlugin, helpDialogPlugin, imageUploadPlugin, insertBlockPlugin, jiraIssuePlugin, layoutPlugin, listPlugin, macroPlugin, maxContentSizePlugin, mediaPlugin, mentionsPlugin, panelPlugin, placeholderTextPlugin, rulePlugin, saveOnEnterPlugin, tablesPlugin, tasksAndDecisionsPlugin, textColorPlugin, cardPlugin, gridPlugin, statusPlugin, alignmentPlugin, indentationPlugin, analyticsPlugin, customAutoformatPlugin, feedbackDialogPlugin, historyPlugin, expandPlugin, isExpandInsertionEnabled, scrollIntoViewPlugin, mobileDimensionsPlugin, findReplacePlugin, contextPanelPlugin, mobileSelectionPlugin, annotationPlugin, captionPlugin, avatarGroupPlugin, viewUpdateSubscriptionPlugin, codeBidiWarningPlugin } from '../plugins';
|
|
1
|
+
import { breakoutPlugin, collabEditPlugin, dataConsumerMarkPlugin, datePlugin, emojiPlugin, extensionPlugin, fragmentMarkPlugin, helpDialogPlugin, imageUploadPlugin, insertBlockPlugin, jiraIssuePlugin, layoutPlugin, listPlugin, macroPlugin, maxContentSizePlugin, mediaPlugin, mentionsPlugin, panelPlugin, placeholderTextPlugin, rulePlugin, saveOnEnterPlugin, tablesPlugin, tasksAndDecisionsPlugin, textColorPlugin, cardPlugin, gridPlugin, statusPlugin, alignmentPlugin, indentationPlugin, analyticsPlugin, customAutoformatPlugin, feedbackDialogPlugin, historyPlugin, expandPlugin, isExpandInsertionEnabled, scrollIntoViewPlugin, mobileDimensionsPlugin, findReplacePlugin, contextPanelPlugin, mobileSelectionPlugin, annotationPlugin, captionPlugin, avatarGroupPlugin, viewUpdateSubscriptionPlugin, beforePrimaryToolbarPlugin, codeBidiWarningPlugin } from '../plugins';
|
|
2
2
|
import { isFullPage as fullPageCheck } from '../utils/is-full-page';
|
|
3
3
|
import { GUTTER_SIZE_MOBILE_IN_PX } from '../plugins/base/pm-plugins/scroll-gutter';
|
|
4
4
|
import { createFeatureFlagsFromProps } from '../plugins/feature-flags-context/feature-flags-from-props';
|
|
@@ -87,7 +87,8 @@ export function getDefaultPresetOptionsFromEditorProps(props, createAnalyticsEve
|
|
|
87
87
|
},
|
|
88
88
|
cardOptions: props.smartLinks || props.UNSAFE_cards,
|
|
89
89
|
codeBlock: { ...props.codeBlock,
|
|
90
|
-
useLongPressSelection: false
|
|
90
|
+
useLongPressSelection: false,
|
|
91
|
+
appearance: props.appearance
|
|
91
92
|
}
|
|
92
93
|
};
|
|
93
94
|
}
|
|
@@ -99,8 +100,6 @@ export function getDefaultPresetOptionsFromEditorProps(props, createAnalyticsEve
|
|
|
99
100
|
*/
|
|
100
101
|
|
|
101
102
|
export default function createPluginsList(props, prevProps, createAnalyticsEvent) {
|
|
102
|
-
var _props$featureFlags;
|
|
103
|
-
|
|
104
103
|
const appearance = props.appearance;
|
|
105
104
|
const isMobile = appearance === 'mobile';
|
|
106
105
|
const isComment = appearance === 'comment';
|
|
@@ -272,8 +271,8 @@ export default function createPluginsList(props, prevProps, createAnalyticsEvent
|
|
|
272
271
|
if (props.allowPanel) {
|
|
273
272
|
preset.add([panelPlugin, {
|
|
274
273
|
useLongPressSelection: false,
|
|
275
|
-
|
|
276
|
-
|
|
274
|
+
allowCustomPanel: props.allowPanel.allowCustomPanel,
|
|
275
|
+
allowCustomPanelEdit: props.allowPanel.allowCustomPanelEdit
|
|
277
276
|
}]);
|
|
278
277
|
}
|
|
279
278
|
|
|
@@ -371,26 +370,46 @@ export default function createPluginsList(props, prevProps, createAnalyticsEvent
|
|
|
371
370
|
replacePlusMenuWithElementBrowser: props.elementBrowser && props.elementBrowser.replacePlusMenu || false
|
|
372
371
|
}]);
|
|
373
372
|
|
|
374
|
-
|
|
373
|
+
const hasBeforePrimaryToolbar = components => {
|
|
374
|
+
if (components && 'before' in components) {
|
|
375
|
+
return !!components.before;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
return false;
|
|
379
|
+
};
|
|
380
|
+
|
|
381
|
+
if (hasBeforePrimaryToolbar(props.primaryToolbarComponents) && !featureFlags.twoLineEditorToolbar) {
|
|
382
|
+
preset.add([beforePrimaryToolbarPlugin, {
|
|
383
|
+
beforePrimaryToolbarComponents: props.primaryToolbarComponents.before
|
|
384
|
+
}]);
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
if (featureFlags.showAvatarGroupAsPlugin === true && !featureFlags.twoLineEditorToolbar) {
|
|
375
388
|
preset.add([avatarGroupPlugin, {
|
|
376
|
-
collabEdit: props.collabEdit
|
|
389
|
+
collabEdit: props.collabEdit,
|
|
390
|
+
takeFullWidth: !hasBeforePrimaryToolbar(props.primaryToolbarComponents)
|
|
377
391
|
}]);
|
|
378
392
|
}
|
|
379
393
|
|
|
380
394
|
if (props.allowFindReplace) {
|
|
381
|
-
var _props$featureFlags2;
|
|
382
|
-
|
|
383
395
|
preset.add([findReplacePlugin, {
|
|
384
|
-
takeFullWidth: !!
|
|
396
|
+
takeFullWidth: !!featureFlags.showAvatarGroupAsPlugin === false && !hasBeforePrimaryToolbar(props.primaryToolbarComponents),
|
|
397
|
+
twoLineEditorToolbar: !!featureFlags.twoLineEditorToolbar
|
|
385
398
|
}]);
|
|
386
399
|
}
|
|
387
400
|
|
|
401
|
+
if (props.UNSAFE_allowFragmentMark) {
|
|
402
|
+
preset.add(fragmentMarkPlugin);
|
|
403
|
+
}
|
|
404
|
+
|
|
388
405
|
if (featureFlags.enableViewUpdateSubscription) {
|
|
389
406
|
preset.add([viewUpdateSubscriptionPlugin]);
|
|
390
407
|
}
|
|
391
408
|
|
|
392
409
|
if (featureFlags.codeBidiWarnings) {
|
|
393
|
-
preset.add(codeBidiWarningPlugin
|
|
410
|
+
preset.add([codeBidiWarningPlugin, {
|
|
411
|
+
appearance: props.appearance
|
|
412
|
+
}]);
|
|
394
413
|
}
|
|
395
414
|
|
|
396
415
|
const excludes = new Set();
|
|
@@ -62,7 +62,9 @@ export function createDefaultPreset(options) {
|
|
|
62
62
|
preset.add(floatingToolbarPlugin);
|
|
63
63
|
preset.add([featureFlagsContextPlugin, options.featureFlags || {}]);
|
|
64
64
|
preset.add([selectionPlugin, options.selection]);
|
|
65
|
-
preset.add([codeBlockPlugin, options.codeBlock
|
|
65
|
+
preset.add([codeBlockPlugin, options.codeBlock || {
|
|
66
|
+
appearance: 'full-page'
|
|
67
|
+
}]);
|
|
66
68
|
return preset;
|
|
67
69
|
}
|
|
68
70
|
export function useDefaultPreset(props) {
|
|
@@ -148,7 +148,7 @@ export default class ReactNodeView {
|
|
|
148
148
|
}, props)) : null;
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
-
update(node, _decorations, validUpdate = () => true) {
|
|
151
|
+
update(node, _decorations, _innerDecorations, validUpdate = () => true) {
|
|
152
152
|
// @see https://github.com/ProseMirror/prosemirror/issues/648
|
|
153
153
|
const isValidUpdate = this.node.type === node.type && validUpdate(this.node, node);
|
|
154
154
|
|
|
@@ -80,6 +80,17 @@ export class SelectionBasedNodeView extends ReactNodeView {
|
|
|
80
80
|
return this.isSelectedNode(this.view.state.selection) || this.isSelectionInsideNode(from, to);
|
|
81
81
|
});
|
|
82
82
|
|
|
83
|
+
_defineProperty(this, "nodeInsideSelection", () => {
|
|
84
|
+
const {
|
|
85
|
+
selection
|
|
86
|
+
} = this.view.state;
|
|
87
|
+
const {
|
|
88
|
+
from,
|
|
89
|
+
to
|
|
90
|
+
} = selection;
|
|
91
|
+
return this.isSelectedNode(selection) || this.isNodeInsideSelection(from, to);
|
|
92
|
+
});
|
|
93
|
+
|
|
83
94
|
_defineProperty(this, "onSelectionChange", () => {
|
|
84
95
|
this.update(this.node, []);
|
|
85
96
|
});
|
|
@@ -55,6 +55,7 @@ export let ACTION;
|
|
|
55
55
|
ACTION["INITIALISED"] = "initialised";
|
|
56
56
|
ACTION["INPUT_PERF_SAMPLING"] = "inputPerfSampling";
|
|
57
57
|
ACTION["INSERTED"] = "inserted";
|
|
58
|
+
ACTION["INVALID_DOCUMENT_ENCOUNTERED"] = "invalidDocumentEncountered";
|
|
58
59
|
ACTION["INVOKED"] = "invoked";
|
|
59
60
|
ACTION["LANGUAGE_SELECTED"] = "languageSelected";
|
|
60
61
|
ACTION["LIST_ITEM_JOINED"] = "listItemJoined";
|
|
@@ -254,7 +254,7 @@ export const isSelectionValid = state => {
|
|
|
254
254
|
return AnnotationSelectionType.DISABLED;
|
|
255
255
|
}
|
|
256
256
|
|
|
257
|
-
if (disallowOnWhitespace &&
|
|
257
|
+
if (disallowOnWhitespace && hasInvalidWhitespaceNode(selection)) {
|
|
258
258
|
return AnnotationSelectionType.INVALID;
|
|
259
259
|
}
|
|
260
260
|
|
|
@@ -307,16 +307,27 @@ function isEmptyTextSelection(selection, schema) {
|
|
|
307
307
|
*/
|
|
308
308
|
|
|
309
309
|
|
|
310
|
-
export function
|
|
311
|
-
let
|
|
312
|
-
selection.content().content
|
|
310
|
+
export function hasInvalidWhitespaceNode(selection) {
|
|
311
|
+
let foundInvalidWhitespace = false;
|
|
312
|
+
const content = selection.content().content;
|
|
313
|
+
content.descendants(node => {
|
|
313
314
|
if (node.textContent.trim() === '') {
|
|
314
|
-
|
|
315
|
+
// Trailing new lines do not result in the annotation spanning into
|
|
316
|
+
// the trailing new line so can be ignored when looking for invalid
|
|
317
|
+
// whitespace nodes.
|
|
318
|
+
const nodeIsTrailingNewLine = // it is the final node
|
|
319
|
+
node.eq(content.lastChild) && // and there are multiple nodes
|
|
320
|
+
!node.eq(content.firstChild) && // and it is a paragraph node
|
|
321
|
+
node.type.name === 'paragraph';
|
|
322
|
+
|
|
323
|
+
if (!nodeIsTrailingNewLine) {
|
|
324
|
+
foundInvalidWhitespace = true;
|
|
325
|
+
}
|
|
315
326
|
}
|
|
316
327
|
|
|
317
|
-
return !
|
|
328
|
+
return !foundInvalidWhitespace;
|
|
318
329
|
});
|
|
319
|
-
return
|
|
330
|
+
return foundInvalidWhitespace;
|
|
320
331
|
}
|
|
321
332
|
/*
|
|
322
333
|
* verifies if node contains annotation mark
|
|
@@ -18,7 +18,8 @@ const avatarGroup = props => ({
|
|
|
18
18
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
19
19
|
editorView: editorView,
|
|
20
20
|
eventDispatcher: eventDispatcher,
|
|
21
|
-
collabEdit: props.collabEdit
|
|
21
|
+
collabEdit: props.collabEdit,
|
|
22
|
+
takeFullWidth: props.takeFullWidth
|
|
22
23
|
});
|
|
23
24
|
}
|
|
24
25
|
|
|
@@ -4,7 +4,7 @@ import styled from 'styled-components';
|
|
|
4
4
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID } from '../../analytics';
|
|
5
5
|
const ToolbarButtonWrapper = styled.div`
|
|
6
6
|
display: flex;
|
|
7
|
-
flex-grow: 1;
|
|
7
|
+
flex-grow: ${props => props.takeFullWidth ? 1 : 0};
|
|
8
8
|
justify-content: flex-end;
|
|
9
9
|
align-items: center;
|
|
10
10
|
& > div {
|
|
@@ -29,7 +29,8 @@ export const AvatarGroupPluginWrapper = props => {
|
|
|
29
29
|
}, [dispatchAnalyticsEvent]);
|
|
30
30
|
return /*#__PURE__*/React.createElement(ToolbarButtonWrapper, {
|
|
31
31
|
"aria-label": "Editors",
|
|
32
|
-
"data-testid": 'avatar-group-in-plugin'
|
|
32
|
+
"data-testid": 'avatar-group-in-plugin',
|
|
33
|
+
takeFullWidth: props.takeFullWidth
|
|
33
34
|
}, /*#__PURE__*/React.createElement(AvatarsWithPluginState, {
|
|
34
35
|
editorView: props.editorView,
|
|
35
36
|
eventDispatcher: props.eventDispatcher,
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BeforePrimaryToolbarWrapper } from './ui/BeforePrimaryToolbarWrapper';
|
|
3
|
+
|
|
4
|
+
const beforePrimaryToolbar = props => ({
|
|
5
|
+
name: 'beforePrimaryToolbar',
|
|
6
|
+
|
|
7
|
+
primaryToolbarComponent() {
|
|
8
|
+
return /*#__PURE__*/React.createElement(BeforePrimaryToolbarWrapper, {
|
|
9
|
+
beforePrimaryToolbarComponents: props.beforePrimaryToolbarComponents
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export default beforePrimaryToolbar;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
export const BeforePrimaryToolbarPluginWrapper = styled.div`
|
|
4
|
+
display: flex;
|
|
5
|
+
margin-right: 8px;
|
|
6
|
+
flex-grow: 1;
|
|
7
|
+
justify-content: flex-end;
|
|
8
|
+
align-items: center;
|
|
9
|
+
`;
|
|
10
|
+
export const BeforePrimaryToolbarWrapper = props => /*#__PURE__*/React.createElement(BeforePrimaryToolbarPluginWrapper, {
|
|
11
|
+
"data-testid": 'before-primary-toolbar-components-plugin'
|
|
12
|
+
}, props.beforePrimaryToolbarComponents);
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import { createPlugin } from './pm-plugins/main';
|
|
2
2
|
|
|
3
|
-
const codeBidiWarning = (
|
|
3
|
+
const codeBidiWarning = ({
|
|
4
|
+
appearance
|
|
5
|
+
}) => ({
|
|
4
6
|
name: 'codeBidiWarning',
|
|
5
7
|
|
|
6
8
|
pmPlugins() {
|
|
7
9
|
return [{
|
|
8
10
|
name: 'codeBidiWarning',
|
|
9
|
-
plugin: options =>
|
|
11
|
+
plugin: options => {
|
|
12
|
+
return createPlugin(options, {
|
|
13
|
+
appearance
|
|
14
|
+
});
|
|
15
|
+
}
|
|
10
16
|
}];
|
|
11
17
|
}
|
|
12
18
|
|
|
@@ -5,18 +5,28 @@ import { createBidiWarningsDecorationSetFromDoc, createPluginState, getPluginSta
|
|
|
5
5
|
export const createPlugin = ({
|
|
6
6
|
dispatch,
|
|
7
7
|
reactContext
|
|
8
|
+
}, {
|
|
9
|
+
appearance
|
|
8
10
|
}) => {
|
|
9
11
|
const intl = reactContext().intl;
|
|
10
12
|
const codeBidiWarningLabel = intl.formatMessage(codeBidiWarningMessages.label);
|
|
11
13
|
return new Plugin({
|
|
12
14
|
key: codeBidiWarningPluginKey,
|
|
13
15
|
state: createPluginState(dispatch, state => {
|
|
16
|
+
// The appearance being mobile indicates we are in an editor being
|
|
17
|
+
// rendered by mobile bridge in a web view.
|
|
18
|
+
// The tooltip is likely to have unexpected behaviour there, with being cut
|
|
19
|
+
// off, so we disable it. This is also to keep the behaviour consistent with
|
|
20
|
+
// the rendering in the mobile Native Renderer.
|
|
21
|
+
const tooltipEnabled = appearance !== 'mobile';
|
|
14
22
|
return {
|
|
15
23
|
decorationSet: createBidiWarningsDecorationSetFromDoc({
|
|
16
24
|
doc: state.doc,
|
|
17
|
-
codeBidiWarningLabel
|
|
25
|
+
codeBidiWarningLabel,
|
|
26
|
+
tooltipEnabled
|
|
18
27
|
}),
|
|
19
|
-
codeBidiWarningLabel
|
|
28
|
+
codeBidiWarningLabel,
|
|
29
|
+
tooltipEnabled
|
|
20
30
|
};
|
|
21
31
|
}),
|
|
22
32
|
props: {
|
|
@@ -18,7 +18,8 @@ export const {
|
|
|
18
18
|
|
|
19
19
|
const newBidiWarningsDecorationSet = createBidiWarningsDecorationSetFromDoc({
|
|
20
20
|
doc: tr.doc,
|
|
21
|
-
codeBidiWarningLabel: pluginState.codeBidiWarningLabel
|
|
21
|
+
codeBidiWarningLabel: pluginState.codeBidiWarningLabel,
|
|
22
|
+
tooltipEnabled: pluginState.tooltipEnabled
|
|
22
23
|
});
|
|
23
24
|
return { ...pluginState,
|
|
24
25
|
decorationSet: newBidiWarningsDecorationSet
|
|
@@ -27,7 +28,8 @@ export const {
|
|
|
27
28
|
});
|
|
28
29
|
export function createBidiWarningsDecorationSetFromDoc({
|
|
29
30
|
doc,
|
|
30
|
-
codeBidiWarningLabel
|
|
31
|
+
codeBidiWarningLabel,
|
|
32
|
+
tooltipEnabled
|
|
31
33
|
}) {
|
|
32
34
|
const bidiCharactersAndTheirPositions = [];
|
|
33
35
|
doc.descendants((node, pos) => {
|
|
@@ -70,19 +72,28 @@ export function createBidiWarningsDecorationSetFromDoc({
|
|
|
70
72
|
position,
|
|
71
73
|
bidiCharacter
|
|
72
74
|
}) => {
|
|
73
|
-
return Decoration.widget(position, () => renderDOM(
|
|
75
|
+
return Decoration.widget(position, () => renderDOM({
|
|
76
|
+
bidiCharacter,
|
|
77
|
+
codeBidiWarningLabel,
|
|
78
|
+
tooltipEnabled
|
|
79
|
+
}));
|
|
74
80
|
}));
|
|
75
81
|
return newBidiWarningsDecorationSet;
|
|
76
82
|
}
|
|
77
83
|
|
|
78
|
-
function renderDOM(
|
|
84
|
+
function renderDOM({
|
|
85
|
+
bidiCharacter,
|
|
86
|
+
codeBidiWarningLabel,
|
|
87
|
+
tooltipEnabled
|
|
88
|
+
}) {
|
|
79
89
|
const element = document.createElement('span'); // Note: we use this pattern elsewhere (see highlighting code block, and drop cursor widget decoration)
|
|
80
90
|
// we should investigate if there is a memory leak with such usage.
|
|
81
91
|
|
|
82
92
|
ReactDOM.render( /*#__PURE__*/React.createElement(CodeBidiWarning, {
|
|
83
93
|
bidiCharacter: bidiCharacter,
|
|
84
94
|
skipChildren: true,
|
|
85
|
-
label: codeBidiWarningLabel
|
|
95
|
+
label: codeBidiWarningLabel,
|
|
96
|
+
tooltipEnabled: tooltipEnabled
|
|
86
97
|
}), element);
|
|
87
98
|
return element;
|
|
88
99
|
}
|
|
@@ -9,7 +9,7 @@ import { IconCode } from '../quick-insert/assets';
|
|
|
9
9
|
import { messages } from '../block-type/messages';
|
|
10
10
|
import refreshBrowserSelectionOnChange from './refresh-browser-selection';
|
|
11
11
|
|
|
12
|
-
const codeBlockPlugin =
|
|
12
|
+
const codeBlockPlugin = options => ({
|
|
13
13
|
name: 'codeBlock',
|
|
14
14
|
|
|
15
15
|
nodes() {
|
|
@@ -26,7 +26,8 @@ const codeBlockPlugin = (options = {}) => ({
|
|
|
26
26
|
reactContext
|
|
27
27
|
}) => createPlugin({
|
|
28
28
|
useLongPressSelection: options.useLongPressSelection,
|
|
29
|
-
reactContext
|
|
29
|
+
reactContext,
|
|
30
|
+
appearance: options.appearance
|
|
30
31
|
})
|
|
31
32
|
}, {
|
|
32
33
|
name: 'codeBlockIDEKeyBindings',
|
|
@@ -102,7 +102,8 @@ export class CodeBlockView {
|
|
|
102
102
|
language: node.attrs.language,
|
|
103
103
|
showLineNumbers: false,
|
|
104
104
|
codeBidiWarnings: this.codeBidiWarningOptions.enabled,
|
|
105
|
-
codeBidiWarningLabel: this.codeBidiWarningOptions.label
|
|
105
|
+
codeBidiWarningLabel: this.codeBidiWarningOptions.label,
|
|
106
|
+
codeBidiWarningTooltipEnabled: this.codeBidiWarningOptions.tooltipEnabled
|
|
106
107
|
}), highlighting);
|
|
107
108
|
this.measure(performance.now() - start);
|
|
108
109
|
content === null || content === void 0 ? void 0 : content.setAttribute('data-debounce', 'false');
|
|
@@ -142,8 +143,10 @@ export class CodeBlockView {
|
|
|
142
143
|
}
|
|
143
144
|
export const highlightingCodeBlockNodeView = ({
|
|
144
145
|
codeBidiWarnings,
|
|
145
|
-
codeBidiWarningLabel
|
|
146
|
+
codeBidiWarningLabel,
|
|
147
|
+
codeBidiWarningTooltipEnabled
|
|
146
148
|
}) => (node, view, getPos) => new CodeBlockView(node, view, getPos, {
|
|
149
|
+
label: codeBidiWarningLabel,
|
|
147
150
|
enabled: codeBidiWarnings,
|
|
148
|
-
|
|
151
|
+
tooltipEnabled: codeBidiWarningTooltipEnabled
|
|
149
152
|
});
|
|
@@ -10,7 +10,8 @@ import { codeBlockClassNames } from '../ui/class-names';
|
|
|
10
10
|
import { getFeatureFlags } from '../../feature-flags-context';
|
|
11
11
|
export const createPlugin = ({
|
|
12
12
|
useLongPressSelection = false,
|
|
13
|
-
reactContext
|
|
13
|
+
reactContext,
|
|
14
|
+
appearance
|
|
14
15
|
}) => {
|
|
15
16
|
const intl = reactContext().intl;
|
|
16
17
|
const codeBidiWarningLabel = intl.formatMessage(codeBidiWarningMessages.label);
|
|
@@ -51,10 +52,17 @@ export const createPlugin = ({
|
|
|
51
52
|
props: {
|
|
52
53
|
nodeViews: {
|
|
53
54
|
codeBlock(node, view, getPos) {
|
|
54
|
-
const featureFlags = getFeatureFlags(view.state);
|
|
55
|
+
const featureFlags = getFeatureFlags(view.state); // The appearance being mobile indicates we are in an editor being
|
|
56
|
+
// rendered by mobile bridge in a web view.
|
|
57
|
+
// The tooltip is likely to have unexpected behaviour there, with being cut
|
|
58
|
+
// off, so we disable it. This is also to keep the behaviour consistent with
|
|
59
|
+
// the rendering in the mobile Native Renderer.
|
|
60
|
+
|
|
61
|
+
const codeBidiWarningTooltipEnabled = appearance !== 'mobile';
|
|
55
62
|
const createCodeBlockNodeView = featureFlags !== null && featureFlags !== void 0 && featureFlags.codeBlockSyntaxHighlighting ? highlightingCodeBlockNodeView({
|
|
56
63
|
codeBidiWarnings: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.codeBidiWarnings,
|
|
57
|
-
codeBidiWarningLabel
|
|
64
|
+
codeBidiWarningLabel,
|
|
65
|
+
codeBidiWarningTooltipEnabled: codeBidiWarningTooltipEnabled
|
|
58
66
|
}) : codeBlockNodeView();
|
|
59
67
|
return createCodeBlockNodeView(node, view, getPos);
|
|
60
68
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Fragment, Mark } from 'prosemirror-model';
|
|
2
|
+
import { NodeSelection } from 'prosemirror-state';
|
|
2
3
|
import { insertMacroFromMacroBrowser } from '../macro';
|
|
3
4
|
import { pluginKey as macroPluginKey } from '../macro/plugin-key';
|
|
4
5
|
import { setEditingContextToContextPanel } from './commands';
|
|
@@ -41,7 +42,7 @@ const extensionAPICallPayload = functionName => ({
|
|
|
41
42
|
|
|
42
43
|
export const createExtensionAPI = options => {
|
|
43
44
|
const doc = {
|
|
44
|
-
insertAfter: (localId, adf) => {
|
|
45
|
+
insertAfter: (localId, adf, opt) => {
|
|
45
46
|
const {
|
|
46
47
|
editorView
|
|
47
48
|
} = options;
|
|
@@ -86,7 +87,8 @@ export const createExtensionAPI = options => {
|
|
|
86
87
|
throw new Error('insertAfter(): Could not create a node for given ADFEntity.');
|
|
87
88
|
}
|
|
88
89
|
|
|
89
|
-
|
|
90
|
+
const insertPosition = nodePos.pos + nodePos.node.nodeSize;
|
|
91
|
+
tr.insert(insertPosition, newNode); // Validate if the document is valid at this point
|
|
90
92
|
|
|
91
93
|
try {
|
|
92
94
|
tr.doc.check();
|
|
@@ -129,6 +131,11 @@ export const createExtensionAPI = options => {
|
|
|
129
131
|
};
|
|
130
132
|
addAnalytics(state, tr, payload);
|
|
131
133
|
});
|
|
134
|
+
|
|
135
|
+
if (opt && opt.allowSelectionToNewNode) {
|
|
136
|
+
tr.setSelection(new NodeSelection(tr.doc.resolve(insertPosition)));
|
|
137
|
+
}
|
|
138
|
+
|
|
132
139
|
dispatch(tr);
|
|
133
140
|
},
|
|
134
141
|
scrollTo: localId => {
|