@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
|
@@ -4,7 +4,7 @@ import { isSafeUrl } from '@atlaskit/adf-schema';
|
|
|
4
4
|
import CrossCircleIcon from '@atlaskit/icon/glyph/cross-circle';
|
|
5
5
|
import EditorAlignLeftIcon from '@atlaskit/icon/glyph/editor/align-left';
|
|
6
6
|
import LinkIcon from '@atlaskit/icon/glyph/link';
|
|
7
|
-
import { N80, N30 } from '@atlaskit/theme/colors';
|
|
7
|
+
import { N90, N80, N30 } from '@atlaskit/theme/colors';
|
|
8
8
|
import Page16Icon from '@atlaskit/icon-object/glyph/page/16';
|
|
9
9
|
import Tooltip from '@atlaskit/tooltip';
|
|
10
10
|
import { PureComponent } from 'react';
|
|
@@ -27,7 +27,7 @@ export const RECENT_SEARCH_LIST_SIZE = 5;
|
|
|
27
27
|
const ClearText = styled.span`
|
|
28
28
|
cursor: pointer;
|
|
29
29
|
padding-right: 8px;
|
|
30
|
-
color: ${
|
|
30
|
+
color: ${N90};
|
|
31
31
|
`;
|
|
32
32
|
const TextInputWrapper = styled.div`
|
|
33
33
|
${InputWrapper};
|
|
@@ -42,6 +42,7 @@ export { default as breakoutPlugin } from './breakout';
|
|
|
42
42
|
export { default as alignmentPlugin } from './alignment';
|
|
43
43
|
export { default as dataConsumerMarkPlugin } from './data-consumer';
|
|
44
44
|
export { default as editorDisabledPlugin } from './editor-disabled';
|
|
45
|
+
export { default as fragmentMarkPlugin } from './fragment';
|
|
45
46
|
export { default as indentationPlugin } from './indentation';
|
|
46
47
|
export { default as annotationPlugin } from './annotation';
|
|
47
48
|
export { default as analyticsPlugin } from './analytics';
|
|
@@ -61,4 +62,5 @@ export { default as clipboardPlugin } from './clipboard';
|
|
|
61
62
|
export { default as undoRedoPlugin } from './undo-redo';
|
|
62
63
|
export { default as avatarGroupPlugin } from './avatar-group';
|
|
63
64
|
export { default as viewUpdateSubscriptionPlugin } from './view-update-subscription';
|
|
65
|
+
export { default as beforePrimaryToolbarPlugin } from './before-primaryToolbar';
|
|
64
66
|
export { default as codeBidiWarningPlugin } from './code-bidi-warning';
|
|
@@ -4,6 +4,7 @@ import { findWrapping } from 'prosemirror-transform';
|
|
|
4
4
|
import { findParentNodeClosestToPos } from 'prosemirror-utils';
|
|
5
5
|
import { isListNode, joinSiblingLists } from '../utils/node';
|
|
6
6
|
import { isEmptyParagraph } from '../../../utils';
|
|
7
|
+
import { findFirstParentListNode } from '../utils/find';
|
|
7
8
|
export function convertListType({
|
|
8
9
|
tr,
|
|
9
10
|
nextListNodeType
|
|
@@ -35,82 +36,50 @@ export function convertListType({
|
|
|
35
36
|
startIndex,
|
|
36
37
|
endIndex,
|
|
37
38
|
depth
|
|
38
|
-
} = nodeRangeAroundList;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
for (let i = startIndex; i < endIndex; i++) {
|
|
53
|
-
// @ts-ignore posAtIndex is a public API but has no type yet
|
|
54
|
-
const position = nodeRangeAroundList.$from.posAtIndex(i, depth);
|
|
55
|
-
const resolvedPosition = doc.resolve(position);
|
|
56
|
-
|
|
57
|
-
if (isEmptyParagraph(parentNode.child(i)) && !isListNodeFound) {
|
|
58
|
-
before.from = doc.resolve( // @ts-ignore posAtIndex is a public API but has no type yet
|
|
59
|
-
nodeRangeAroundList.$from.posAtIndex(i, depth) + 2);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
if (isEmptyParagraph(parentNode.child(i)) && isListNodeFound && !firstEmptyParagraphAfterListFound) {
|
|
63
|
-
after.to = resolvedPosition;
|
|
64
|
-
firstEmptyParagraphAfterListFound = true;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
if (!isListNode(parentNode.child(i)) && !isListNodeFound) {
|
|
68
|
-
before.to = doc.resolve(resolvedPosition.pos + 1);
|
|
69
|
-
} else if (!isListNodeFound) {
|
|
70
|
-
isListNodeFound = true;
|
|
71
|
-
const endNodePosition = doc.resolve(resolvedPosition.pos + 1).end() + 1;
|
|
72
|
-
|
|
73
|
-
if (doc.resolve(endNodePosition).nodeAfter) {
|
|
74
|
-
after.from = doc.resolve(endNodePosition + 1);
|
|
39
|
+
} = nodeRangeAroundList; // Checking for invalid nodes to prevent conversion
|
|
40
|
+
// eg. a panel cannot be wrapped in a list so return
|
|
41
|
+
// It will skip this check if the selection begins within a list
|
|
42
|
+
// This is to match the behaviour of the toolbar buttons being disabled
|
|
43
|
+
|
|
44
|
+
if (!findFirstParentListNode($from)) {
|
|
45
|
+
for (let i = startIndex; i < endIndex; i++) {
|
|
46
|
+
const position = nodeRangeAroundList.$from.posAtIndex(i, depth);
|
|
47
|
+
const resolvedPosition = doc.resolve(position);
|
|
48
|
+
const currentChild = parentNode.child(i);
|
|
49
|
+
const currentNodeRange = resolvedPosition.blockRange(tr.doc.resolve(position + currentChild.nodeSize));
|
|
50
|
+
|
|
51
|
+
if (currentNodeRange && !isListNode(currentChild) && !findWrapping(currentNodeRange, nextListNodeType)) {
|
|
52
|
+
return;
|
|
75
53
|
}
|
|
76
54
|
}
|
|
77
|
-
}
|
|
55
|
+
} // Checking for any non list nodes and wrapping them in a list
|
|
56
|
+
// so they can be converted
|
|
78
57
|
|
|
79
|
-
let beforeConversionArgs, beforeRange, afterConversionArgs, afterRange;
|
|
80
|
-
|
|
81
|
-
if (after.from && after.to) {
|
|
82
|
-
const mappedFrom = tr.mapping.map(after.from.pos);
|
|
83
|
-
const mappedTo = tr.mapping.map(after.to.pos);
|
|
84
|
-
afterRange = new NodeRange(tr.doc.resolve(mappedFrom), tr.doc.resolve(mappedTo), nodeRangeAroundList.depth);
|
|
85
|
-
afterConversionArgs = {
|
|
86
|
-
tr,
|
|
87
|
-
nextListNodeType,
|
|
88
|
-
nodeRange: afterRange
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
58
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
tr,
|
|
98
|
-
nextListNodeType,
|
|
99
|
-
nodeRange: beforeRange
|
|
100
|
-
};
|
|
101
|
-
}
|
|
59
|
+
tr.doc.nodesBetween(nodeRangeAroundList.start, nodeRangeAroundList.end, (node, pos) => {
|
|
60
|
+
// Skip over any nodes that are part of a list
|
|
61
|
+
if (findFirstParentListNode(tr.doc.resolve(tr.mapping.map(pos)))) {
|
|
62
|
+
return false;
|
|
63
|
+
} // The following applies to suitable nodes that are not within a list
|
|
102
64
|
|
|
103
|
-
if (!afterRange && !beforeRange || afterRange && !findWrapping(afterRange, nextListNodeType) || beforeRange && !findWrapping(beforeRange, nextListNodeType)) {
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
65
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}
|
|
66
|
+
const currentNodeNotWrappedInList = node;
|
|
67
|
+
const isNotAnEmptyParagraphAndIsParagraphOrLeafNode = !isEmptyParagraph(currentNodeNotWrappedInList) && (!node.type.isBlock || node.type.name === 'paragraph');
|
|
110
68
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
69
|
+
if (isNotAnEmptyParagraphAndIsParagraphOrLeafNode) {
|
|
70
|
+
const remainingNodeRange = new NodeRange(tr.doc.resolve(tr.mapping.map(pos)), tr.doc.resolve(tr.mapping.map(pos) + currentNodeNotWrappedInList.nodeSize), nodeRangeAroundList.depth);
|
|
71
|
+
convertAroundList({
|
|
72
|
+
tr,
|
|
73
|
+
nextListNodeType,
|
|
74
|
+
nodeRange: remainingNodeRange
|
|
75
|
+
});
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
convertSelectedList({
|
|
80
|
+
tr,
|
|
81
|
+
nextListNodeType
|
|
82
|
+
});
|
|
114
83
|
|
|
115
84
|
if (tr.docChanged) {
|
|
116
85
|
joinSiblingLists({
|
|
@@ -195,9 +195,13 @@ const extractListFromParagraph = (node, parent, schema) => {
|
|
|
195
195
|
} // Return false to prevent replaceWith from wrapping the text node in a paragraph
|
|
196
196
|
// paragraph since that will be done later. If it's done here, it will fail
|
|
197
197
|
// the paragraph.validContent check.
|
|
198
|
+
// Dont return false if there are lists, as they arent validContent for paragraphs
|
|
199
|
+
// and will result in hanging textNodes
|
|
198
200
|
|
|
199
201
|
|
|
200
|
-
|
|
202
|
+
const containsList = listified.some(node => node.type === bulletList || node.type === orderedList);
|
|
203
|
+
|
|
204
|
+
if (listified.some(node => node.isText) && !containsList) {
|
|
201
205
|
return false;
|
|
202
206
|
}
|
|
203
207
|
|
|
@@ -31,10 +31,10 @@ const mediaPlugin = options => ({
|
|
|
31
31
|
const {
|
|
32
32
|
allowMediaGroup = true,
|
|
33
33
|
allowMediaSingle = false,
|
|
34
|
-
allowMediaInline = false,
|
|
35
34
|
featureFlags
|
|
36
35
|
} = options || {};
|
|
37
36
|
const captions = getMediaFeatureFlag('captions', featureFlags);
|
|
37
|
+
const allowMediaInline = getMediaFeatureFlag('mediaInline', featureFlags);
|
|
38
38
|
const mediaSingleNode = captions ? mediaSingleWithCaption : mediaSingle;
|
|
39
39
|
return [{
|
|
40
40
|
name: 'mediaGroup',
|
|
@@ -221,7 +221,7 @@ const mediaPlugin = options => ({
|
|
|
221
221
|
}],
|
|
222
222
|
floatingToolbar: (state, intl, providerFactory) => floatingToolbar(state, intl, {
|
|
223
223
|
providerFactory,
|
|
224
|
-
allowMediaInline: options && options.
|
|
224
|
+
allowMediaInline: options && getMediaFeatureFlag('mediaInline', options.featureFlags),
|
|
225
225
|
allowResizing: options && options.allowResizing,
|
|
226
226
|
allowResizingInTables: options && options.allowResizingInTables,
|
|
227
227
|
allowAnnotation: options && options.allowAnnotation,
|
|
@@ -11,6 +11,7 @@ import { isNodeSelectedOrInRange, SelectedState } from '../../../utils/nodes';
|
|
|
11
11
|
import { pluginKey as editorDisabledPluginKey } from '../../editor-disabled';
|
|
12
12
|
import { stateKey as mediaStateKey } from '../pm-plugins/plugin-key';
|
|
13
13
|
import { MediaNodeUpdater } from './mediaNodeUpdater';
|
|
14
|
+
import { getMediaFeatureFlag } from '@atlaskit/media-common';
|
|
14
15
|
|
|
15
16
|
const isMediaGroupSelectedFromProps = props => {
|
|
16
17
|
return isNodeSelectedOrInRange(props.anchorPos, props.headPos, props.getPos(), props.node.nodeSize);
|
|
@@ -135,7 +136,7 @@ export default class MediaGroup extends React.Component {
|
|
|
135
136
|
onClick: () => {
|
|
136
137
|
setNodeSelection(this.props.view, getNodePos());
|
|
137
138
|
},
|
|
138
|
-
...mediaInlineOptions(mediaOptions.
|
|
139
|
+
...mediaInlineOptions(getMediaFeatureFlag('mediaInline', mediaOptions.featureFlags))
|
|
139
140
|
};
|
|
140
141
|
});
|
|
141
142
|
return /*#__PURE__*/React.createElement(Filmstrip, {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { SelectionBasedNodeView } from '../../../nodeviews/';
|
|
3
3
|
import { MediaInlineCard } from '@atlaskit/media-card';
|
|
4
4
|
import { WithProviders } from '@atlaskit/editor-common';
|
|
5
|
+
import { MediaInlineNodeSelector } from './styles';
|
|
5
6
|
export const MediaInline = props => {
|
|
6
7
|
const [viewMediaClientConfig, setViewMediaClientConfig] = useState({});
|
|
7
8
|
useEffect(() => {
|
|
@@ -27,14 +28,16 @@ export const MediaInline = props => {
|
|
|
27
28
|
collectionName: collection
|
|
28
29
|
};
|
|
29
30
|
return /*#__PURE__*/React.createElement(MediaInlineCard, {
|
|
31
|
+
isSelected: props.isSelected,
|
|
30
32
|
identifier: identifier,
|
|
31
33
|
mediaClientConfig: viewMediaClientConfig
|
|
32
34
|
});
|
|
33
35
|
};
|
|
34
|
-
export class MediaInlineNodeView extends
|
|
36
|
+
export class MediaInlineNodeView extends SelectionBasedNodeView {
|
|
35
37
|
createDomRef() {
|
|
36
38
|
const domRef = document.createElement('span');
|
|
37
39
|
domRef.contentEditable = 'false';
|
|
40
|
+
domRef.classList.add(MediaInlineNodeSelector);
|
|
38
41
|
return domRef;
|
|
39
42
|
}
|
|
40
43
|
|
|
@@ -54,7 +57,7 @@ export class MediaInlineNodeView extends ReactNodeView {
|
|
|
54
57
|
return true;
|
|
55
58
|
}
|
|
56
59
|
|
|
57
|
-
return
|
|
60
|
+
return super.viewShouldUpdate(nextNode);
|
|
58
61
|
}
|
|
59
62
|
|
|
60
63
|
render(props) {
|
|
@@ -74,7 +77,8 @@ export class MediaInlineNodeView extends ReactNodeView {
|
|
|
74
77
|
return /*#__PURE__*/React.createElement(MediaInline, {
|
|
75
78
|
identifier: this.node.attrs.id,
|
|
76
79
|
mediaProvider: mediaProvider,
|
|
77
|
-
node: this.node
|
|
80
|
+
node: this.node,
|
|
81
|
+
isSelected: this.nodeInsideSelection()
|
|
78
82
|
});
|
|
79
83
|
}
|
|
80
84
|
});
|
|
@@ -86,7 +86,7 @@ export class MediaNodeUpdater {
|
|
|
86
86
|
|
|
87
87
|
_defineProperty(this, "getObjectId", async () => {
|
|
88
88
|
const contextIdentifierProvider = await this.props.contextIdentifierProvider;
|
|
89
|
-
return contextIdentifierProvider
|
|
89
|
+
return (contextIdentifierProvider === null || contextIdentifierProvider === void 0 ? void 0 : contextIdentifierProvider.objectId) || null;
|
|
90
90
|
});
|
|
91
91
|
|
|
92
92
|
_defineProperty(this, "uploadExternalMedia", async getPos => {
|
|
@@ -135,10 +135,10 @@ export class MediaNodeUpdater {
|
|
|
135
135
|
const attrs = this.getAttrs();
|
|
136
136
|
|
|
137
137
|
if (!attrs || attrs.type !== 'file') {
|
|
138
|
-
return
|
|
138
|
+
return null;
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
-
return attrs.__contextId;
|
|
141
|
+
return attrs.__contextId || null;
|
|
142
142
|
});
|
|
143
143
|
|
|
144
144
|
_defineProperty(this, "updateDimensions", dimensions => {
|
|
@@ -13,7 +13,7 @@ import { stateKey as mediaPluginKey } from '../pm-plugins/main';
|
|
|
13
13
|
import { MediaNodeUpdater } from './mediaNodeUpdater';
|
|
14
14
|
import { findParentNodeOfTypeClosestToPos } from 'prosemirror-utils';
|
|
15
15
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
16
|
-
import { FigureWrapper } from './styles';
|
|
16
|
+
import { FigureWrapper, MediaSingleNodeSelector } from './styles';
|
|
17
17
|
import { floatingLayouts, isRichMediaInsideOfBlockNode } from '../../../utils/rich-media-utils';
|
|
18
18
|
import { getAttrsFromUrl } from '@atlaskit/media-client';
|
|
19
19
|
import { isMediaBlobUrlFromAttrs } from '../utils/media-common';
|
|
@@ -289,7 +289,9 @@ export default class MediaSingleNode extends Component {
|
|
|
289
289
|
const lineLength = this.getLineLength(view, getPos()) || this.props.lineLength;
|
|
290
290
|
const isSelected = selected();
|
|
291
291
|
const shouldShowPlaceholder = getMediaFeatureFlag('captions', mediaOptions.featureFlags) && node.childCount !== 2 && isSelected && state.selection instanceof NodeSelection;
|
|
292
|
-
const MediaChildren = /*#__PURE__*/React.createElement(FigureWrapper,
|
|
292
|
+
const MediaChildren = /*#__PURE__*/React.createElement(FigureWrapper, {
|
|
293
|
+
className: MediaSingleNodeSelector
|
|
294
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
293
295
|
ref: this.props.forwardRef
|
|
294
296
|
}), shouldShowPlaceholder && /*#__PURE__*/React.createElement(CaptionPlaceholder, {
|
|
295
297
|
onClick: this.clickPlaceholder
|
|
@@ -391,12 +393,12 @@ class MediaSingleNodeView extends ReactNodeView {
|
|
|
391
393
|
return undefined;
|
|
392
394
|
}
|
|
393
395
|
|
|
394
|
-
update(node, decorations, isValidUpdate) {
|
|
396
|
+
update(node, decorations, _innerDecorations, isValidUpdate) {
|
|
395
397
|
if (!isValidUpdate) {
|
|
396
398
|
isValidUpdate = (currentNode, newNode) => this.getNodeMediaId(currentNode) === this.getNodeMediaId(newNode);
|
|
397
399
|
}
|
|
398
400
|
|
|
399
|
-
return super.update(node, decorations, isValidUpdate);
|
|
401
|
+
return super.update(node, decorations, _innerDecorations, isValidUpdate);
|
|
400
402
|
}
|
|
401
403
|
|
|
402
404
|
render(props, forwardRef) {
|
|
@@ -456,7 +458,7 @@ class MediaSingleNodeView extends ReactNodeView {
|
|
|
456
458
|
if (offsetLeft !== this.lastOffsetLeft) {
|
|
457
459
|
this.lastOffsetLeft = offsetLeft;
|
|
458
460
|
this.forceViewUpdate = true;
|
|
459
|
-
this.update(this.node, [], () => true);
|
|
461
|
+
this.update(this.node, [], [], () => true);
|
|
460
462
|
}
|
|
461
463
|
}
|
|
462
464
|
|
|
@@ -186,6 +186,8 @@ export class AltTextEditComponent extends React.Component {
|
|
|
186
186
|
onClick: this.closeMediaAltTextMenu
|
|
187
187
|
})), /*#__PURE__*/React.createElement(PanelTextInput, {
|
|
188
188
|
testId: "alt-text-input",
|
|
189
|
+
ariaLabel: formatMessage(messages.placeholder),
|
|
190
|
+
describedById: "support-text",
|
|
189
191
|
placeholder: formatMessage(messages.placeholder),
|
|
190
192
|
defaultValue: this.state.lastValue,
|
|
191
193
|
onCancel: this.dispatchCancelEvent,
|
|
@@ -202,7 +204,9 @@ export class AltTextEditComponent extends React.Component {
|
|
|
202
204
|
})),
|
|
203
205
|
tooltipContent: formatMessage(messages.clear),
|
|
204
206
|
onClick: this.handleClearText
|
|
205
|
-
}))), !!errorsList.length && /*#__PURE__*/React.createElement(ValidationWrapper, null, errorsList), /*#__PURE__*/React.createElement(SupportText,
|
|
207
|
+
}))), !!errorsList.length && /*#__PURE__*/React.createElement(ValidationWrapper, null, errorsList), /*#__PURE__*/React.createElement(SupportText, {
|
|
208
|
+
id: "support-text"
|
|
209
|
+
}, formatMessage(messages.supportText)));
|
|
206
210
|
}
|
|
207
211
|
|
|
208
212
|
fireAnalytics(actionType) {
|
|
@@ -4,7 +4,7 @@ import ReactDOM from 'react-dom';
|
|
|
4
4
|
import { NodeSelection, Plugin } from 'prosemirror-state';
|
|
5
5
|
import { insertPoint } from 'prosemirror-transform';
|
|
6
6
|
import { Decoration, DecorationSet } from 'prosemirror-view';
|
|
7
|
-
import { ErrorReporter } from '@atlaskit/editor-common';
|
|
7
|
+
import { ErrorReporter, browser } from '@atlaskit/editor-common';
|
|
8
8
|
import assert from 'assert';
|
|
9
9
|
import { findDomRefAtPos, isNodeSelection } from 'prosemirror-utils';
|
|
10
10
|
import { insertMediaSingleNode, isMediaSingle } from '../utils/media-single';
|
|
@@ -18,6 +18,9 @@ import PickerFacade from '../picker-facade';
|
|
|
18
18
|
import { INPUT_METHOD } from '../../analytics/types';
|
|
19
19
|
import { isImage } from '../utils/is-image';
|
|
20
20
|
import { isInEmptyLine } from '../../../utils/document';
|
|
21
|
+
import { getMediaFeatureFlag } from '@atlaskit/media-common';
|
|
22
|
+
import { isInListItem } from '../../../utils';
|
|
23
|
+
import { CAPTION_PLACEHOLDER_ID } from '../ui/CaptionPlaceholder';
|
|
21
24
|
export { stateKey } from './plugin-key';
|
|
22
25
|
|
|
23
26
|
const createDropPlaceholder = allowDropLine => {
|
|
@@ -157,7 +160,7 @@ export class MediaPluginStateImplementation {
|
|
|
157
160
|
media
|
|
158
161
|
} = this.view.state.schema.nodes;
|
|
159
162
|
|
|
160
|
-
if ((_this$mediaOptions = this.mediaOptions)
|
|
163
|
+
if (getMediaFeatureFlag('mediaInline', (_this$mediaOptions = this.mediaOptions) === null || _this$mediaOptions === void 0 ? void 0 : _this$mediaOptions.featureFlags)) {
|
|
161
164
|
return type === mediaSingle || type === media || type === mediaInline;
|
|
162
165
|
}
|
|
163
166
|
|
|
@@ -194,7 +197,7 @@ export class MediaPluginStateImplementation {
|
|
|
194
197
|
|
|
195
198
|
if (isMediaSingle(state.schema, mediaStateWithContext.fileMimeType)) {
|
|
196
199
|
insertMediaSingleNode(this.view, mediaStateWithContext, this.getInputMethod(pickerType), collection, this.mediaOptions && this.mediaOptions.alignLeftOnInsert);
|
|
197
|
-
} else if ((_this$mediaOptions2 = this.mediaOptions)
|
|
200
|
+
} else if (getMediaFeatureFlag('mediaInline', (_this$mediaOptions2 = this.mediaOptions) === null || _this$mediaOptions2 === void 0 ? void 0 : _this$mediaOptions2.featureFlags) && !isInEmptyLine(state) && (!isInsidePotentialEmptyParagraph(state) || isInListItem(state)) && canInsertMediaInline(state)) {
|
|
198
201
|
insertMediaInlineNode(this.view, mediaStateWithContext, collection, this.getInputMethod(pickerType));
|
|
199
202
|
} else {
|
|
200
203
|
insertMediaGroupNode(this.view, [mediaStateWithContext], collection, this.getInputMethod(pickerType));
|
|
@@ -491,8 +494,6 @@ export class MediaPluginStateImplementation {
|
|
|
491
494
|
}
|
|
492
495
|
|
|
493
496
|
getDomElement(domAtPos) {
|
|
494
|
-
var _this$mediaOptions3;
|
|
495
|
-
|
|
496
497
|
const {
|
|
497
498
|
selection
|
|
498
499
|
} = this.view.state;
|
|
@@ -505,16 +506,14 @@ export class MediaPluginStateImplementation {
|
|
|
505
506
|
return;
|
|
506
507
|
}
|
|
507
508
|
|
|
508
|
-
const
|
|
509
|
-
const node = findDomRefAtPos(position, domAtPos);
|
|
509
|
+
const node = findDomRefAtPos(selection.from, domAtPos);
|
|
510
510
|
|
|
511
511
|
if (node) {
|
|
512
512
|
if (!node.childNodes.length) {
|
|
513
513
|
return node.parentNode;
|
|
514
514
|
}
|
|
515
515
|
|
|
516
|
-
|
|
517
|
-
return target;
|
|
516
|
+
return node;
|
|
518
517
|
}
|
|
519
518
|
|
|
520
519
|
return;
|
|
@@ -648,13 +647,21 @@ export const createPlugin = (_schema, options, reactContext, dispatch, mediaOpti
|
|
|
648
647
|
|
|
649
648
|
},
|
|
650
649
|
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
650
|
+
appendTransaction(transactions, _oldState, newState) {
|
|
651
|
+
for (const transaction of transactions) {
|
|
652
|
+
const isSelectionOnMediaInsideMediaSingle = transaction.selectionSet && isNodeSelection(transaction.selection) && transaction.selection.node.type === newState.schema.nodes.media && transaction.selection.$anchor.parent.type === newState.schema.nodes.mediaSingle; // Note: this causes an additional transaction when selecting a media node
|
|
653
|
+
// through clicking on it with the cursor.
|
|
654
|
+
|
|
655
|
+
if (isSelectionOnMediaInsideMediaSingle) {
|
|
656
|
+
// If a selection has been placed on a media inside a media single,
|
|
657
|
+
// we shift it to the media single parent as other code is opinionated about
|
|
658
|
+
// the selection landing there. In particular the caption insertion and selection
|
|
659
|
+
// action.
|
|
660
|
+
return newState.tr.setSelection(NodeSelection.create(newState.doc, transaction.selection.$from.pos - 1));
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
return;
|
|
658
665
|
},
|
|
659
666
|
|
|
660
667
|
key: stateKey,
|
|
@@ -716,8 +723,16 @@ export const createPlugin = (_schema, options, reactContext, dispatch, mediaOpti
|
|
|
716
723
|
handleTextInput(view) {
|
|
717
724
|
getMediaPluginState(view.state).splitMediaGroup();
|
|
718
725
|
return false;
|
|
719
|
-
}
|
|
726
|
+
},
|
|
720
727
|
|
|
728
|
+
handleClick: (_editorView, _pos, event) => {
|
|
729
|
+
var _parentElement;
|
|
730
|
+
|
|
731
|
+
// Workaround for Chrome given a regression introduced in prosemirror-view@1.18.6
|
|
732
|
+
// Returning true prevents that updateSelection() is getting called in the commit below:
|
|
733
|
+
// @see https://github.com/ProseMirror/prosemirror-view/compare/1.18.5...1.18.6
|
|
734
|
+
return Boolean((browser.chrome || browser.safari) && event.target && CAPTION_PLACEHOLDER_ID === ((_parentElement = event.target.parentElement) === null || _parentElement === void 0 ? void 0 : _parentElement.dataset.id));
|
|
735
|
+
}
|
|
721
736
|
}
|
|
722
737
|
});
|
|
723
738
|
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { NodeSelection } from 'prosemirror-state';
|
|
2
|
+
import { isNodeSelection, removeSelectedNode, safeInsert } from 'prosemirror-utils';
|
|
3
|
+
export const changeInlineToMediaCard = (state, dispatch) => {
|
|
4
|
+
const {
|
|
5
|
+
media,
|
|
6
|
+
mediaInline,
|
|
7
|
+
mediaGroup
|
|
8
|
+
} = state.schema.nodes;
|
|
9
|
+
const selectedNode = state.selection instanceof NodeSelection && state.selection.node.type === mediaInline && state.selection.node;
|
|
10
|
+
|
|
11
|
+
if (!selectedNode) {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const {
|
|
16
|
+
id,
|
|
17
|
+
type,
|
|
18
|
+
collection
|
|
19
|
+
} = selectedNode.attrs;
|
|
20
|
+
const mediaNode = media.createChecked({
|
|
21
|
+
id,
|
|
22
|
+
type,
|
|
23
|
+
collection
|
|
24
|
+
});
|
|
25
|
+
const group = mediaGroup.createChecked({}, mediaNode);
|
|
26
|
+
const nodePos = state.tr.doc.resolve(state.selection.from).end();
|
|
27
|
+
let tr = state.tr;
|
|
28
|
+
tr = removeSelectedNode(tr);
|
|
29
|
+
tr = safeInsert(group, nodePos, true)(tr);
|
|
30
|
+
|
|
31
|
+
if (dispatch) {
|
|
32
|
+
dispatch(tr);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return true;
|
|
36
|
+
};
|
|
37
|
+
export const removeInlineCard = (state, dispatch) => {
|
|
38
|
+
if (isNodeSelection(state.selection)) {
|
|
39
|
+
if (dispatch) {
|
|
40
|
+
dispatch(removeSelectedNode(state.tr));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return false;
|
|
47
|
+
};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
2
|
import ReactDOM from 'react-dom';
|
|
3
3
|
import { MediaViewer } from '@atlaskit/media-viewer';
|
|
4
|
+
import { messages } from '@atlaskit/media-ui';
|
|
4
5
|
import FilePreviewIcon from '@atlaskit/icon/glyph/editor/file-preview';
|
|
5
6
|
import ToolbarButton from '../../floating-toolbar/ui/Button';
|
|
6
7
|
import { getSelectedMediaContainerNodeAttrs } from './utils';
|
|
7
8
|
export const FilePreviewItem = ({
|
|
8
|
-
mediaPluginState
|
|
9
|
+
mediaPluginState,
|
|
10
|
+
intl
|
|
9
11
|
}) => {
|
|
10
12
|
const [isMediaViewerVisible, setMediaViewerVisible] = useState(false);
|
|
11
13
|
|
|
@@ -48,12 +50,14 @@ export const FilePreviewItem = ({
|
|
|
48
50
|
};
|
|
49
51
|
|
|
50
52
|
const mediaViewer = renderMediaViewer();
|
|
53
|
+
const tooltipContent = intl.formatMessage(messages.preview);
|
|
51
54
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(ToolbarButton, {
|
|
52
55
|
testId: "file-preview-toolbar-button",
|
|
53
56
|
key: "editor.media.card.preview",
|
|
54
57
|
onClick: openMediaViewer,
|
|
55
58
|
icon: /*#__PURE__*/React.createElement(FilePreviewIcon, {
|
|
56
59
|
label: "file preview"
|
|
57
|
-
})
|
|
60
|
+
}),
|
|
61
|
+
tooltipContent: tooltipContent
|
|
58
62
|
}), mediaViewer);
|
|
59
63
|
};
|