@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
|
@@ -28,6 +28,8 @@ import { messages as cardMessages } from '../../card/messages';
|
|
|
28
28
|
import { FilePreviewItem } from './filePreviewItem';
|
|
29
29
|
import { downloadMedia, removeMediaGroupNode } from './utils';
|
|
30
30
|
import { Fragment } from 'prosemirror-model';
|
|
31
|
+
import { changeInlineToMediaCard, removeInlineCard } from './commands';
|
|
32
|
+
import { MediaInlineNodeSelector, MediaSingleNodeSelector } from '../nodeviews/styles';
|
|
31
33
|
|
|
32
34
|
var remove = function remove(state, dispatch) {
|
|
33
35
|
if (dispatch) {
|
|
@@ -79,6 +81,7 @@ var changeMediaCardToInline = function changeMediaCardToInline(state, dispatch)
|
|
|
79
81
|
var generateMediaCardFloatingToolbar = function generateMediaCardFloatingToolbar(state, intl, mediaPluginState) {
|
|
80
82
|
var mediaGroup = state.schema.nodes.mediaGroup;
|
|
81
83
|
var items = [{
|
|
84
|
+
id: 'editor.media.view.switcher',
|
|
82
85
|
type: 'dropdown',
|
|
83
86
|
title: intl.formatMessage(messages.displayThumbnail),
|
|
84
87
|
options: [{
|
|
@@ -102,7 +105,8 @@ var generateMediaCardFloatingToolbar = function generateMediaCardFloatingToolbar
|
|
|
102
105
|
render: function render() {
|
|
103
106
|
return /*#__PURE__*/React.createElement(FilePreviewItem, {
|
|
104
107
|
key: "editor.media.card.preview",
|
|
105
|
-
mediaPluginState: mediaPluginState
|
|
108
|
+
mediaPluginState: mediaPluginState,
|
|
109
|
+
intl: intl
|
|
106
110
|
});
|
|
107
111
|
}
|
|
108
112
|
}, {
|
|
@@ -134,6 +138,66 @@ var generateMediaCardFloatingToolbar = function generateMediaCardFloatingToolbar
|
|
|
134
138
|
return items;
|
|
135
139
|
};
|
|
136
140
|
|
|
141
|
+
var generateMediaInlineFloatingToolbar = function generateMediaInlineFloatingToolbar(state, intl, mediaPluginState) {
|
|
142
|
+
var mediaInline = state.schema.nodes.mediaInline;
|
|
143
|
+
var items = [{
|
|
144
|
+
id: 'editor.media.view.switcher',
|
|
145
|
+
type: 'dropdown',
|
|
146
|
+
title: intl.formatMessage(cardMessages.inline),
|
|
147
|
+
options: [{
|
|
148
|
+
title: intl.formatMessage(cardMessages.inline),
|
|
149
|
+
selected: true,
|
|
150
|
+
onClick: function onClick() {
|
|
151
|
+
return true;
|
|
152
|
+
},
|
|
153
|
+
testId: 'inline-appearance'
|
|
154
|
+
}, {
|
|
155
|
+
title: intl.formatMessage(messages.displayThumbnail),
|
|
156
|
+
selected: false,
|
|
157
|
+
onClick: changeInlineToMediaCard,
|
|
158
|
+
testId: 'thumbnail-appearance'
|
|
159
|
+
}]
|
|
160
|
+
}, {
|
|
161
|
+
type: 'separator'
|
|
162
|
+
}, {
|
|
163
|
+
type: 'custom',
|
|
164
|
+
fallback: [],
|
|
165
|
+
render: function render() {
|
|
166
|
+
return /*#__PURE__*/React.createElement(FilePreviewItem, {
|
|
167
|
+
key: "editor.media.card.preview",
|
|
168
|
+
mediaPluginState: mediaPluginState,
|
|
169
|
+
intl: intl
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
}, {
|
|
173
|
+
type: 'separator'
|
|
174
|
+
}, {
|
|
175
|
+
id: 'editor.media.card.download',
|
|
176
|
+
type: 'button',
|
|
177
|
+
icon: DownloadIcon,
|
|
178
|
+
onClick: function onClick() {
|
|
179
|
+
downloadMedia(mediaPluginState);
|
|
180
|
+
return true;
|
|
181
|
+
},
|
|
182
|
+
title: intl.formatMessage(messages.download)
|
|
183
|
+
}, {
|
|
184
|
+
type: 'separator'
|
|
185
|
+
}, {
|
|
186
|
+
id: 'editor.media.delete',
|
|
187
|
+
type: 'button',
|
|
188
|
+
appearance: 'danger',
|
|
189
|
+
icon: RemoveIcon,
|
|
190
|
+
onMouseEnter: hoverDecoration(mediaInline, true),
|
|
191
|
+
onMouseLeave: hoverDecoration(mediaInline, false),
|
|
192
|
+
onFocus: hoverDecoration(mediaInline, true),
|
|
193
|
+
onBlur: hoverDecoration(mediaInline, false),
|
|
194
|
+
title: intl.formatMessage(commonMessages.remove),
|
|
195
|
+
onClick: removeInlineCard,
|
|
196
|
+
testId: 'media-toolbar-remove-button'
|
|
197
|
+
}];
|
|
198
|
+
return items;
|
|
199
|
+
};
|
|
200
|
+
|
|
137
201
|
var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToolbar(state, intl, options, pluginState, mediaLinkingState) {
|
|
138
202
|
var mediaSingle = state.schema.nodes.mediaSingle;
|
|
139
203
|
var allowResizing = options.allowResizing,
|
|
@@ -278,9 +342,14 @@ export var floatingToolbar = function floatingToolbar(state, intl) {
|
|
|
278
342
|
}
|
|
279
343
|
|
|
280
344
|
var items = [];
|
|
281
|
-
var
|
|
345
|
+
var parentMediaGroupNode = findParentNodeOfType(mediaGroup)(state.selection);
|
|
346
|
+
var selectedNodeType;
|
|
282
347
|
|
|
283
|
-
if (
|
|
348
|
+
if (state.selection instanceof NodeSelection) {
|
|
349
|
+
selectedNodeType = state.selection.node.type;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
if (allowMediaInline && (parentMediaGroupNode === null || parentMediaGroupNode === void 0 ? void 0 : parentMediaGroupNode.node.type) === mediaGroup) {
|
|
284
353
|
var mediaOffset = state.selection.$from.parentOffset + 1;
|
|
285
354
|
|
|
286
355
|
baseToolbar.getDomRef = function () {
|
|
@@ -291,7 +360,23 @@ export var floatingToolbar = function floatingToolbar(state, intl) {
|
|
|
291
360
|
};
|
|
292
361
|
|
|
293
362
|
items = generateMediaCardFloatingToolbar(state, intl, mediaPluginState);
|
|
363
|
+
} else if (allowMediaInline && selectedNodeType && selectedNodeType === mediaInline) {
|
|
364
|
+
baseToolbar.getDomRef = function () {
|
|
365
|
+
var _mediaPluginState$ele2;
|
|
366
|
+
|
|
367
|
+
var element = (_mediaPluginState$ele2 = mediaPluginState.element) === null || _mediaPluginState$ele2 === void 0 ? void 0 : _mediaPluginState$ele2.querySelector(".".concat(MediaInlineNodeSelector));
|
|
368
|
+
return element || mediaPluginState.element;
|
|
369
|
+
};
|
|
370
|
+
|
|
371
|
+
items = generateMediaInlineFloatingToolbar(state, intl, mediaPluginState);
|
|
294
372
|
} else {
|
|
373
|
+
baseToolbar.getDomRef = function () {
|
|
374
|
+
var _mediaPluginState$ele3;
|
|
375
|
+
|
|
376
|
+
var element = (_mediaPluginState$ele3 = mediaPluginState.element) === null || _mediaPluginState$ele3 === void 0 ? void 0 : _mediaPluginState$ele3.querySelector(".".concat(MediaSingleNodeSelector));
|
|
377
|
+
return element || mediaPluginState.element;
|
|
378
|
+
};
|
|
379
|
+
|
|
295
380
|
items = generateMediaSingleFloatingToolbar(state, intl, options, mediaPluginState, mediaLinkingState);
|
|
296
381
|
}
|
|
297
382
|
|
|
@@ -427,7 +427,15 @@ var ResizableMediaSingle = /*#__PURE__*/function (_React$Component) {
|
|
|
427
427
|
return columResizingPluginState ? !columResizingPluginState.dragging : true;
|
|
428
428
|
},
|
|
429
429
|
nodeType: "media",
|
|
430
|
-
dispatchAnalyticsEvent: this.props.dispatchAnalyticsEvent
|
|
430
|
+
dispatchAnalyticsEvent: this.props.dispatchAnalyticsEvent // when cursor is located below a media with caption,
|
|
431
|
+
// press “Up“ key will result cursor focus on an invalid position, (on the resize handler)
|
|
432
|
+
// This workaround adds an empty div inside the resize handler to prevent the issue.
|
|
433
|
+
,
|
|
434
|
+
handleComponentFunc: function handleComponentFunc() {
|
|
435
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
436
|
+
contentEditable: false
|
|
437
|
+
});
|
|
438
|
+
}
|
|
431
439
|
}), children));
|
|
432
440
|
}
|
|
433
441
|
}]);
|
|
@@ -279,7 +279,7 @@ export var unwrapNestedMediaElements = function unwrapNestedMediaElements(html)
|
|
|
279
279
|
// ProseMirror should handle this case properly.
|
|
280
280
|
|
|
281
281
|
|
|
282
|
-
if (mediaParent instanceof HTMLDivElement) {
|
|
282
|
+
if (mediaParent instanceof HTMLDivElement || mediaParent instanceof HTMLSpanElement && mediaParent.closest('[class*="emoji-common"]')) {
|
|
283
283
|
return;
|
|
284
284
|
} // Find the top most element that the parent has a valid container for the image.
|
|
285
285
|
// Stop just before found the wrapper
|
|
@@ -95,7 +95,12 @@ export var insertMediaInlineNode = function insertMediaInlineNode(view, mediaSta
|
|
|
95
95
|
collection: collection
|
|
96
96
|
});
|
|
97
97
|
var space = state.schema.text(' ');
|
|
98
|
-
var pos = state.selection.$to.pos;
|
|
98
|
+
var pos = state.selection.$to.pos; // If the selection is inside an empty list item set pos inside paragraph
|
|
99
|
+
|
|
100
|
+
if (isInListItem(state) && isInsidePotentialEmptyParagraph(state)) {
|
|
101
|
+
pos = pos + 1;
|
|
102
|
+
}
|
|
103
|
+
|
|
99
104
|
var content = Fragment.from([mediaInlineNode, space]); // Delete the selection if a selection is made
|
|
100
105
|
|
|
101
106
|
var deleteRange = findDeleteRange(state);
|
|
@@ -42,7 +42,7 @@ export var removePanel = function removePanel() {
|
|
|
42
42
|
};
|
|
43
43
|
export var changePanelType = function changePanelType(panelType) {
|
|
44
44
|
var panelOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
45
|
-
var
|
|
45
|
+
var allowCustomPanel = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
46
46
|
return function (state, dispatch) {
|
|
47
47
|
var nodes = state.schema.nodes,
|
|
48
48
|
tr = state.tr;
|
|
@@ -56,7 +56,7 @@ export var changePanelType = function changePanelType(panelType) {
|
|
|
56
56
|
var previousType = panelNode.node.attrs.panelType;
|
|
57
57
|
var newTr;
|
|
58
58
|
|
|
59
|
-
if (
|
|
59
|
+
if (allowCustomPanel) {
|
|
60
60
|
var previousColor = panelNode.node.attrs.panelColor || getPanelTypeBackground(previousType);
|
|
61
61
|
var previousIcon = panelNode.node.attrs.panelIcon;
|
|
62
62
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { panel, PanelType } from '@atlaskit/adf-schema';
|
|
3
3
|
import { createPlugin } from './pm-plugins/main';
|
|
4
4
|
import { getToolbarConfig } from './toolbar';
|
|
5
5
|
import keymap from './pm-plugins/keymaps';
|
|
@@ -7,7 +7,7 @@ import { addAnalytics, ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, INPUT_METHOD,
|
|
|
7
7
|
import { IconPanel, IconPanelNote, IconPanelSuccess, IconPanelWarning, IconPanelError } from '../quick-insert/assets';
|
|
8
8
|
import { messages } from '../block-type/messages';
|
|
9
9
|
import IconCustomPanel from '../quick-insert/assets/custom-panel';
|
|
10
|
-
import {
|
|
10
|
+
import { T50 } from '@atlaskit/theme/colors';
|
|
11
11
|
|
|
12
12
|
var insertPanelTypeWithAnalytics = function insertPanelTypeWithAnalytics(panelAttributes, state, insert) {
|
|
13
13
|
var tr = insert(insertPanelType(panelAttributes, state));
|
|
@@ -37,7 +37,7 @@ var panelPlugin = function panelPlugin() {
|
|
|
37
37
|
return {
|
|
38
38
|
name: 'panel',
|
|
39
39
|
nodes: function nodes() {
|
|
40
|
-
var panelNode =
|
|
40
|
+
var panelNode = panel(!!options.allowCustomPanel);
|
|
41
41
|
return [{
|
|
42
42
|
name: 'panel',
|
|
43
43
|
node: panelNode
|
|
@@ -130,7 +130,7 @@ var panelPlugin = function panelPlugin() {
|
|
|
130
130
|
}
|
|
131
131
|
}];
|
|
132
132
|
|
|
133
|
-
if (options.
|
|
133
|
+
if (options.allowCustomPanel && options.allowCustomPanelEdit) {
|
|
134
134
|
quickInsertOptions.push({
|
|
135
135
|
id: 'custompanel',
|
|
136
136
|
title: formatMessage(messages.customPanel),
|
|
@@ -143,7 +143,7 @@ var panelPlugin = function panelPlugin() {
|
|
|
143
143
|
return insertPanelTypeWithAnalytics({
|
|
144
144
|
panelType: PanelType.CUSTOM,
|
|
145
145
|
panelIcon: ':rainbow:',
|
|
146
|
-
panelColor:
|
|
146
|
+
panelColor: T50
|
|
147
147
|
}, state, insert);
|
|
148
148
|
}
|
|
149
149
|
});
|
|
@@ -55,7 +55,7 @@ var PanelNodeView = /*#__PURE__*/function () {
|
|
|
55
55
|
this.view = view;
|
|
56
56
|
this.node = node;
|
|
57
57
|
|
|
58
|
-
var _DOMSerializer$render = DOMSerializer.renderSpec(document, panelAttrsToDom(node.attrs, pluginOptions.
|
|
58
|
+
var _DOMSerializer$render = DOMSerializer.renderSpec(document, panelAttrsToDom(node.attrs, pluginOptions.allowCustomPanel || false)),
|
|
59
59
|
dom = _DOMSerializer$render.dom,
|
|
60
60
|
contentDOM = _DOMSerializer$render.contentDOM;
|
|
61
61
|
|
|
@@ -71,7 +71,7 @@ var PanelNodeView = /*#__PURE__*/function () {
|
|
|
71
71
|
|
|
72
72
|
this.icon.contentEditable = 'false';
|
|
73
73
|
ReactDOM.render( /*#__PURE__*/React.createElement(PanelIcon, {
|
|
74
|
-
allowCustomPanel: pluginOptions.
|
|
74
|
+
allowCustomPanel: pluginOptions.allowCustomPanel,
|
|
75
75
|
panelAttributes: node.attrs,
|
|
76
76
|
providerFactory: this.providerFactory
|
|
77
77
|
}), this.icon);
|
|
@@ -12,7 +12,7 @@ import NoteIcon from '@atlaskit/icon/glyph/editor/note';
|
|
|
12
12
|
import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
|
|
13
13
|
import WarningIcon from '@atlaskit/icon/glyph/editor/warning';
|
|
14
14
|
import ErrorIcon from '@atlaskit/icon/glyph/editor/error';
|
|
15
|
-
import RemoveEmojiIcon from '
|
|
15
|
+
import RemoveEmojiIcon from '@atlaskit/icon/glyph/editor/remove-emoji';
|
|
16
16
|
import commonMessages from '../../messages';
|
|
17
17
|
import { removePanel, changePanelType } from './actions';
|
|
18
18
|
import { hoverDecoration } from '../base/pm-plugins/decoration';
|
|
@@ -24,7 +24,7 @@ import { DEFAULT_BORDER_COLOR } from '../../ui/ColorPalette/Palettes';
|
|
|
24
24
|
import { PanelType } from '@atlaskit/adf-schema';
|
|
25
25
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID, withAnalytics } from '../analytics';
|
|
26
26
|
import { messages } from './message';
|
|
27
|
-
export var panelIconMap = (_panelIconMap = {}, _defineProperty(_panelIconMap, PanelType.INFO, ':info:'), _defineProperty(_panelIconMap, PanelType.NOTE, ':note:'), _defineProperty(_panelIconMap, PanelType.WARNING, ':warning:'), _defineProperty(_panelIconMap, PanelType.ERROR, ':
|
|
27
|
+
export var panelIconMap = (_panelIconMap = {}, _defineProperty(_panelIconMap, PanelType.INFO, ':info:'), _defineProperty(_panelIconMap, PanelType.NOTE, ':note:'), _defineProperty(_panelIconMap, PanelType.WARNING, ':warning:'), _defineProperty(_panelIconMap, PanelType.ERROR, ':cross_mark:'), _defineProperty(_panelIconMap, PanelType.SUCCESS, ':check_mark:'), _defineProperty(_panelIconMap, PanelType.TIP, ':tip:'), _panelIconMap);
|
|
28
28
|
export var getToolbarItems = function getToolbarItems(formatMessage, panelNodeType, isCustomPanelEnabled, isCustomPanelEditable, providerFactory, activePanelType, activePanelColor, activePanelIcon) {
|
|
29
29
|
var items = [{
|
|
30
30
|
id: 'editor.panel.info',
|
|
@@ -238,9 +238,14 @@ export var getToolbarConfig = function getToolbarConfig(state, intl) {
|
|
|
238
238
|
var _panelObject$node$att = panelObject.node.attrs,
|
|
239
239
|
panelType = _panelObject$node$att.panelType,
|
|
240
240
|
panelColor = _panelObject$node$att.panelColor,
|
|
241
|
-
panelIcon = _panelObject$node$att.panelIcon;
|
|
241
|
+
panelIcon = _panelObject$node$att.panelIcon;
|
|
242
242
|
|
|
243
|
-
var
|
|
243
|
+
var isStandardPanel = function isStandardPanel(panelType) {
|
|
244
|
+
return panelType !== PanelType.CUSTOM ? panelType : undefined;
|
|
245
|
+
}; // force toolbar to be turned on
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
var items = getToolbarItems(formatMessage, nodeType, options.allowCustomPanel || false, options.allowCustomPanel && options.allowCustomPanelEdit || false, providerFactory, panelType, options.allowCustomPanel ? panelColor : undefined, options.allowCustomPanel ? panelIcon || isStandardPanel(panelType) : undefined);
|
|
244
249
|
|
|
245
250
|
var getDomRef = function getDomRef(editorView) {
|
|
246
251
|
var domAtPos = editorView.domAtPos.bind(editorView);
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
|
|
5
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
6
|
+
|
|
1
7
|
import { findSelectedNodeOfType, findParentNodeOfType } from 'prosemirror-utils';
|
|
2
8
|
import { PanelType } from '@atlaskit/adf-schema';
|
|
3
9
|
import { PanelSharedCssClassName } from '@atlaskit/editor-common';
|
|
@@ -17,6 +23,13 @@ export var panelAttrsToDom = function panelAttrsToDom(attrs, allowCustomPanel) {
|
|
|
17
23
|
'data-panel-type': panelType || PanelType.INFO,
|
|
18
24
|
style: style
|
|
19
25
|
};
|
|
26
|
+
|
|
27
|
+
if (panelColor && isCustomPanel) {
|
|
28
|
+
panelAttrs = _objectSpread(_objectSpread({}, panelAttrs), {}, {
|
|
29
|
+
'data-panel-color': panelColor
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
|
|
20
33
|
var iconDiv = ['div', {
|
|
21
34
|
class: PanelSharedCssClassName.icon
|
|
22
35
|
}];
|
package/dist/esm/plugins/rank.js
CHANGED
|
@@ -6,9 +6,10 @@ export default {
|
|
|
6
6
|
// https://product-fabric.atlassian.net/wiki/spaces/E/pages/1113098008/Selection+Guide#Special-Cases
|
|
7
7
|
'expandKeymap', 'tableSelectionKeymap', 'tableKeymap', 'captionKeymap', // selection keymap needs to be above gap cursor keymap so it can set node selections from
|
|
8
8
|
// left/right arrows
|
|
9
|
-
'selectionKeymap', 'gapCursorKeymap', 'gapCursor', 'syncUrlText', 'fakeCursorToolbarPlugin', 'hyperLink', 'table', 'tableDecorations', 'hyperlinkInputRule', 'tablePMColResizing', 'hyperlinkKeymap', 'tableColResizing', 'undoRedoKeyMap', 'blockTypeKeyMap', 'tableEditing', 'filterStepsPlugin', 'pmCollab', 'collab', 'ruleInputRule', 'ruleKeymap', 'panel', 'media', 'mediaKeymap', 'mediaSingleKeymap', 'mediaEditor', 'unsupportedContent', 'jiraIssue', 'fakeTextCursor', 'helpDialog', 'helpDialogKeymap', 'macro', 'expand', 'extension', 'layout', 'contextPanel', 'floatingToolbar', 'clearMarksOnChange', 'reactNodeView', 'history', 'undoRedoPlugin', 'codeBlockIndent', 'placeholder', 'width', 'maxContentSize', 'multilineContent', 'grid', 'mobileDimensions', 'scrollGutterPlugin', 'analytics', 'findReplace', 'selection', 'avatarGroup', 'viewUpdateSubscription', 'inlineCode'],
|
|
9
|
+
'selectionKeymap', 'gapCursorKeymap', 'gapCursor', 'syncUrlText', 'fakeCursorToolbarPlugin', 'hyperLink', 'table', 'tableDecorations', 'hyperlinkInputRule', 'tablePMColResizing', 'hyperlinkKeymap', 'tableColResizing', 'undoRedoKeyMap', 'blockTypeKeyMap', 'tableEditing', 'filterStepsPlugin', 'pmCollab', 'collab', 'ruleInputRule', 'ruleKeymap', 'panel', 'media', 'mediaKeymap', 'mediaSingleKeymap', 'mediaEditor', 'unsupportedContent', 'jiraIssue', 'fakeTextCursor', 'helpDialog', 'helpDialogKeymap', 'macro', 'expand', 'extension', 'layout', 'contextPanel', 'floatingToolbar', 'clearMarksOnChange', 'reactNodeView', 'history', 'undoRedoPlugin', 'codeBlockIndent', 'placeholder', 'width', 'maxContentSize', 'multilineContent', 'grid', 'mobileDimensions', 'scrollGutterPlugin', 'analytics', 'findReplace', 'selection', 'avatarGroup', 'viewUpdateSubscription', 'beforePrimaryToolbar', 'inlineCode'],
|
|
10
10
|
nodes: ['doc', 'paragraph', 'text', 'bulletList', 'orderedList', 'listItem', 'heading', 'blockquote', 'codeBlock', 'rule', 'panel', 'mention', 'confluenceUnsupportedBlock', 'confluenceUnsupportedInline', 'unsupportedBlock', 'unsupportedInline', 'confluenceJiraIssue', 'hardBreak', 'emoji', 'placeholder', 'mediaSingle', 'mediaGroup', 'table', 'expand', 'nestedExpand', 'media', 'tableHeader', 'decisionList', 'tableRow', 'decisionItem', 'tableCell', 'taskList', 'taskItem', 'extension', 'bodiedExtension', 'inlineExtension', 'layoutSection', 'layoutColumn', 'inlineCard', 'blockCard', 'embedCard'],
|
|
11
|
-
marks: [//
|
|
11
|
+
marks: [// Fragment mark is both for inline and block elements
|
|
12
|
+
'fragment', // Inline marks
|
|
12
13
|
'link', 'em', 'strong', 'textColor', 'strike', 'subsup', 'underline', 'code', 'typeAheadQuery', // Block marks
|
|
13
14
|
'alignment', 'breakout', 'indentation', 'annotation', //Unsupported mark
|
|
14
15
|
'unsupportedMark', 'unsupportedNodeAttribute']
|
|
@@ -10,6 +10,29 @@ export var getInitialState = function getInitialState(state) {
|
|
|
10
10
|
selection: state.selection
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
|
+
|
|
14
|
+
var toggleContentEditable = function toggleContentEditable(node) {
|
|
15
|
+
var root = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
16
|
+
|
|
17
|
+
if (root || node.getAttribute('contenteditable') === 'true') {
|
|
18
|
+
var wasTrue = node.getAttribute('contenteditable') === 'true';
|
|
19
|
+
node.setAttribute('contenteditable', 'false');
|
|
20
|
+
requestAnimationFrame(function () {
|
|
21
|
+
if (wasTrue) {
|
|
22
|
+
node.setAttribute('contenteditable', 'true');
|
|
23
|
+
} else {
|
|
24
|
+
node.removeAttribute('contenteditable');
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
} // any children with contenteditable = true block selection from proceeding
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
var children = Array.from(node.children);
|
|
31
|
+
children.forEach(function (child) {
|
|
32
|
+
return toggleContentEditable(child);
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
|
|
13
36
|
export var createPlugin = function createPlugin(dispatch, dispatchAnalyticsEvent) {
|
|
14
37
|
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
15
38
|
return new Plugin({
|
|
@@ -92,10 +115,11 @@ export var createPlugin = function createPlugin(dispatch, dispatchAnalyticsEvent
|
|
|
92
115
|
return false;
|
|
93
116
|
},
|
|
94
117
|
keydown: function keydown(editorView, event) {
|
|
95
|
-
// Firefox bugfix to bypass issue with editing text adjacent to a DOM node with
|
|
118
|
+
var state = editorView.state; // Firefox bugfix to bypass issue with editing text adjacent to a DOM node with
|
|
96
119
|
// contenteditable="false". (See https://product-fabric.atlassian.net/browse/ED-9452)
|
|
97
120
|
// On keypress, if the head of cursor selection touches a node with contenteditable="false",
|
|
98
121
|
// we temporarily remove the attribute, wait one tick, then restore it with its original value.
|
|
122
|
+
|
|
99
123
|
if (browser.gecko) {
|
|
100
124
|
var node = editorView.nodeDOM(editorView.state.selection.head);
|
|
101
125
|
|
|
@@ -105,6 +129,31 @@ export var createPlugin = function createPlugin(dispatch, dispatchAnalyticsEvent
|
|
|
105
129
|
node.setAttribute('contenteditable', 'false');
|
|
106
130
|
});
|
|
107
131
|
}
|
|
132
|
+
} // Bugfix for block ReactNodeViews like table and extension
|
|
133
|
+
// They could not be selected with Shift + ArrowDown/ArrowUp
|
|
134
|
+
// Fixed when contenteditable = false, but then you couldn't edit their contents
|
|
135
|
+
// Therefore, briefly set contenteditable=false to allow the selection through, then set it back to true
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
if (event instanceof KeyboardEvent && event.shiftKey && (event.key === 'ArrowDown' || event.key === 'ArrowUp')) {
|
|
139
|
+
var pos;
|
|
140
|
+
|
|
141
|
+
if (event.key === 'ArrowDown') {
|
|
142
|
+
pos = state.selection.$head.after();
|
|
143
|
+
} else {
|
|
144
|
+
pos = state.selection.$head.before() - 1; // block extensions only take up one position, dont need to get before()
|
|
145
|
+
|
|
146
|
+
if (!editorView.nodeDOM(pos)) {
|
|
147
|
+
pos = state.doc.resolve(pos).before();
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
var _node = editorView.nodeDOM(pos);
|
|
152
|
+
|
|
153
|
+
if (_node instanceof HTMLDivElement && _node.className.includes('View-content-wrap') // class added by ReactNodeView
|
|
154
|
+
) {
|
|
155
|
+
toggleContentEditable(_node, true);
|
|
156
|
+
}
|
|
108
157
|
}
|
|
109
158
|
|
|
110
159
|
return false;
|
|
@@ -227,7 +227,8 @@ export var StatusPickerWithoutAnalytcs = /*#__PURE__*/function (_React$Component
|
|
|
227
227
|
target = _this$props.target;
|
|
228
228
|
var _this$state3 = this.state,
|
|
229
229
|
color = _this$state3.color,
|
|
230
|
-
text = _this$state3.text
|
|
230
|
+
text = _this$state3.text,
|
|
231
|
+
localId = _this$state3.localId;
|
|
231
232
|
return target && /*#__PURE__*/React.createElement(PopupWithListeners, {
|
|
232
233
|
target: target,
|
|
233
234
|
offset: [0, 8],
|
|
@@ -244,7 +245,8 @@ export var StatusPickerWithoutAnalytcs = /*#__PURE__*/function (_React$Component
|
|
|
244
245
|
onColorClick: this.onColorClick,
|
|
245
246
|
onColorHover: this.onColorHover,
|
|
246
247
|
onTextChanged: this.onTextChanged,
|
|
247
|
-
onEnter: this.onEnter
|
|
248
|
+
onEnter: this.onEnter,
|
|
249
|
+
localId: localId
|
|
248
250
|
})));
|
|
249
251
|
}
|
|
250
252
|
}]);
|
|
@@ -22,7 +22,7 @@ function addColumnAtCustomStep(column) {
|
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
function addColumnAt(column) {
|
|
25
|
+
export function addColumnAt(column) {
|
|
26
26
|
var allowAddColumnCustomStep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
27
27
|
var view = arguments.length > 2 ? arguments[2] : undefined;
|
|
28
28
|
return function (tr) {
|
|
@@ -46,7 +46,6 @@ function addColumnAt(column) {
|
|
|
46
46
|
} // :: (EditorState, dispatch: ?(tr: Transaction)) → bool
|
|
47
47
|
// Command to add a column before the column with the selection.
|
|
48
48
|
|
|
49
|
-
|
|
50
49
|
export var addColumnBefore = function addColumnBefore(state, dispatch, view) {
|
|
51
50
|
var table = findTable(state.selection);
|
|
52
51
|
|
|
@@ -48,7 +48,8 @@ var tablesPlugin = function tablesPlugin(options) {
|
|
|
48
48
|
return [{
|
|
49
49
|
name: 'table',
|
|
50
50
|
plugin: function plugin(_ref) {
|
|
51
|
-
var
|
|
51
|
+
var dispatchAnalyticsEvent = _ref.dispatchAnalyticsEvent,
|
|
52
|
+
dispatch = _ref.dispatch,
|
|
52
53
|
portalProviderAPI = _ref.portalProviderAPI,
|
|
53
54
|
eventDispatcher = _ref.eventDispatcher;
|
|
54
55
|
|
|
@@ -59,7 +60,7 @@ var tablesPlugin = function tablesPlugin(options) {
|
|
|
59
60
|
breakoutEnabled = _ref2.breakoutEnabled,
|
|
60
61
|
tableOptions = _ref2.tableOptions;
|
|
61
62
|
|
|
62
|
-
return createPlugin(dispatch, portalProviderAPI, eventDispatcher, pluginConfig(tableOptions), breakoutEnabled && dynamicSizingEnabled, breakoutEnabled, fullWidthEnabled, wasFullWidthEnabled);
|
|
63
|
+
return createPlugin(dispatchAnalyticsEvent, dispatch, portalProviderAPI, eventDispatcher, pluginConfig(tableOptions), breakoutEnabled && dynamicSizingEnabled, breakoutEnabled, fullWidthEnabled, wasFullWidthEnabled);
|
|
63
64
|
}
|
|
64
65
|
}, {
|
|
65
66
|
name: 'tablePMColResizing',
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
|
-
import { tableCellBorderWidth } from '@atlaskit/editor-common';
|
|
5
4
|
import { ShadowEvent, TableCssClassName as ClassName } from '../types';
|
|
6
5
|
import { tableInsertColumnButtonSize } from '../ui/consts';
|
|
7
6
|
import { updateShadowListForStickyStyles } from './update-overflow-shadows';
|
|
@@ -63,7 +62,7 @@ export var OverflowShadowsObserver = /*#__PURE__*/function () {
|
|
|
63
62
|
}, {
|
|
64
63
|
threshold: [0, 1],
|
|
65
64
|
root: _this.wrapper,
|
|
66
|
-
rootMargin: "0px ".concat(tableInsertColumnButtonSize / 2
|
|
65
|
+
rootMargin: "0px ".concat(tableInsertColumnButtonSize / 2, "px 0px 0px")
|
|
67
66
|
});
|
|
68
67
|
return;
|
|
69
68
|
}
|
|
@@ -16,7 +16,7 @@ import { pluginKey as decorationsPluginKey } from '../pm-plugins/decorations/plu
|
|
|
16
16
|
import { fixTables, replaceSelectedTable } from '../transforms';
|
|
17
17
|
import { TableCssClassName as ClassName } from '../types';
|
|
18
18
|
import { findControlsHoverDecoration, updateResizeHandles } from '../utils';
|
|
19
|
-
import { INPUT_METHOD } from '../../analytics';
|
|
19
|
+
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, INPUT_METHOD } from '../../analytics';
|
|
20
20
|
import { defaultTableSelection } from './default-table-selection';
|
|
21
21
|
import { createPluginState, getPluginState, pluginKey } from './plugin-factory';
|
|
22
22
|
import TableCellNodeView from '../nodeviews/tableCell';
|
|
@@ -24,7 +24,7 @@ var isBreakoutEnabled;
|
|
|
24
24
|
var isDynamicTextSizingEnabled;
|
|
25
25
|
var isFullWidthModeEnabled;
|
|
26
26
|
var wasFullWidthModeEnabled;
|
|
27
|
-
export var createPlugin = function createPlugin(dispatch, portalProviderAPI, eventDispatcher, pluginConfig, dynamicTextSizing, breakoutEnabled, fullWidthModeEnabled, previousFullWidthModeEnabled) {
|
|
27
|
+
export var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, portalProviderAPI, eventDispatcher, pluginConfig, dynamicTextSizing, breakoutEnabled, fullWidthModeEnabled, previousFullWidthModeEnabled) {
|
|
28
28
|
var _window;
|
|
29
29
|
|
|
30
30
|
isBreakoutEnabled = breakoutEnabled;
|
|
@@ -56,7 +56,9 @@ export var createPlugin = function createPlugin(dispatch, portalProviderAPI, eve
|
|
|
56
56
|
tableHeader: function tableHeader(node, view, getPos) {
|
|
57
57
|
return new TableCellNodeView(node, view, getPos, observer);
|
|
58
58
|
}
|
|
59
|
-
} : {};
|
|
59
|
+
} : {}; // Used to prevent invalid table cell spans being reported more than once per editor/document
|
|
60
|
+
|
|
61
|
+
var invalidTableIds = [];
|
|
60
62
|
return new Plugin({
|
|
61
63
|
state: state,
|
|
62
64
|
key: pluginKey,
|
|
@@ -65,6 +67,27 @@ export var createPlugin = function createPlugin(dispatch, portalProviderAPI, eve
|
|
|
65
67
|
return tr.getMeta('uiEvent') === 'cut';
|
|
66
68
|
});
|
|
67
69
|
|
|
70
|
+
function reportInvalidTableCellSpanAttrs(invalidNodeAttr) {
|
|
71
|
+
if (invalidTableIds.find(function (id) {
|
|
72
|
+
return id === invalidNodeAttr.tableLocalId;
|
|
73
|
+
})) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
invalidTableIds.push(invalidNodeAttr.tableLocalId);
|
|
78
|
+
dispatchAnalyticsEvent({
|
|
79
|
+
action: ACTION.INVALID_DOCUMENT_ENCOUNTERED,
|
|
80
|
+
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
81
|
+
eventType: EVENT_TYPE.OPERATIONAL,
|
|
82
|
+
attributes: {
|
|
83
|
+
nodeType: invalidNodeAttr.nodeType,
|
|
84
|
+
reason: "".concat(invalidNodeAttr.attribute, ": ").concat(invalidNodeAttr.reason),
|
|
85
|
+
tableLocalId: invalidNodeAttr.tableLocalId,
|
|
86
|
+
spanValue: invalidNodeAttr.spanValue
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
|
|
68
91
|
if (tr) {
|
|
69
92
|
// "fixTables" removes empty rows as we don't allow that in schema
|
|
70
93
|
var updatedTr = handleCut(tr, oldState, newState);
|
|
@@ -74,7 +97,7 @@ export var createPlugin = function createPlugin(dispatch, portalProviderAPI, eve
|
|
|
74
97
|
if (transactions.find(function (tr) {
|
|
75
98
|
return tr.docChanged;
|
|
76
99
|
})) {
|
|
77
|
-
return fixTables(newState.tr);
|
|
100
|
+
return fixTables(newState.tr, reportInvalidTableCellSpanAttrs);
|
|
78
101
|
}
|
|
79
102
|
},
|
|
80
103
|
view: function view(editorView) {
|
|
@@ -10,9 +10,9 @@ export var generateColgroup = function generateColgroup(table) {
|
|
|
10
10
|
// We slice here to guard against our colwidth array having more entries
|
|
11
11
|
// Than the we actually span. We'll patch the document at a later point.
|
|
12
12
|
cell.attrs.colwidth.slice(0, colspan).forEach(function (width) {
|
|
13
|
-
cols.push(['col', {
|
|
13
|
+
cols.push(['col', width ? {
|
|
14
14
|
style: "width: ".concat(width, "px;")
|
|
15
|
-
}]);
|
|
15
|
+
} : {}]);
|
|
16
16
|
});
|
|
17
17
|
} else {
|
|
18
18
|
// When we have merged cells on the first row (firstChild),
|
|
@@ -41,6 +41,7 @@ export var getResizeState = function getResizeState(_ref) {
|
|
|
41
41
|
cols: _cols,
|
|
42
42
|
widths: _widths,
|
|
43
43
|
maxSize: maxSize,
|
|
44
|
+
tableWidth: _tableWidth,
|
|
44
45
|
overflow: _overflow
|
|
45
46
|
};
|
|
46
47
|
} // Getting the resize state from DOM
|
|
@@ -62,6 +63,7 @@ export var getResizeState = function getResizeState(_ref) {
|
|
|
62
63
|
cols: cols,
|
|
63
64
|
widths: widths,
|
|
64
65
|
maxSize: maxSize,
|
|
66
|
+
tableWidth: tableWidth,
|
|
65
67
|
overflow: overflow
|
|
66
68
|
};
|
|
67
69
|
}; // updates Colgroup DOM node with new widths
|
|
@@ -5,6 +5,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
5
5
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
6
6
|
|
|
7
7
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
8
|
+
import { tableNewColumnMinWidth } from '@atlaskit/editor-common';
|
|
8
9
|
import { hasTableBeenResized } from '../pm-plugins/table-resizing/utils';
|
|
9
10
|
import { setMeta } from './metadata';
|
|
10
11
|
import { getResizeState, normaliseTableLayout } from '../pm-plugins/table-resizing/utils/resize-state';
|
|
@@ -115,7 +116,10 @@ export var updateColumnWidths = function updateColumnWidths(resizeState, table,
|
|
|
115
116
|
};
|
|
116
117
|
};
|
|
117
118
|
/**
|
|
118
|
-
* This function is called when user inserts/deletes a column in a table to
|
|
119
|
+
* This function is called when user inserts/deletes a column in a table to;
|
|
120
|
+
* - rescale all columns (if the table did not overflow before the insertion)
|
|
121
|
+
* - and update column widths.
|
|
122
|
+
*
|
|
119
123
|
* This is done manually to avoid a multi-dispatch in TableComponent. See [ED-8288].
|
|
120
124
|
* @param table
|
|
121
125
|
* @param view
|
|
@@ -124,6 +128,8 @@ export var updateColumnWidths = function updateColumnWidths(resizeState, table,
|
|
|
124
128
|
|
|
125
129
|
export var rescaleColumns = function rescaleColumns(table, view) {
|
|
126
130
|
return function (tr) {
|
|
131
|
+
// If the table has been not been resized we skip updating the size
|
|
132
|
+
// of columns here.
|
|
127
133
|
if (!view || !hasTableBeenResized(table.node)) {
|
|
128
134
|
return tr;
|
|
129
135
|
}
|
|
@@ -137,7 +143,8 @@ export var rescaleColumns = function rescaleColumns(table, view) {
|
|
|
137
143
|
return tr;
|
|
138
144
|
}
|
|
139
145
|
|
|
140
|
-
var layout = normaliseTableLayout(tableRef === null || tableRef === void 0 ? void 0 : tableRef.dataset.layout);
|
|
146
|
+
var layout = normaliseTableLayout(tableRef === null || tableRef === void 0 ? void 0 : tableRef.dataset.layout); // The is the width the table can reach before overflowing
|
|
147
|
+
|
|
141
148
|
var maxSize = getTableMaxWidth({
|
|
142
149
|
table: table.node,
|
|
143
150
|
tableStart: table.start,
|
|
@@ -153,8 +160,11 @@ export var rescaleColumns = function rescaleColumns(table, view) {
|
|
|
153
160
|
domAtPos: domAtPos,
|
|
154
161
|
maxSize: maxSize
|
|
155
162
|
});
|
|
163
|
+
var previousTableWidth = resizeState.tableWidth - tableNewColumnMinWidth;
|
|
164
|
+
var tableDidntPreviouslyOverflow = previousTableWidth <= maxSize; // If the new table width will result in the table going into an overflow state
|
|
165
|
+
// we resize the cells to avoid the overflow occuring
|
|
156
166
|
|
|
157
|
-
if (resizeState.overflow) {
|
|
167
|
+
if (tableDidntPreviouslyOverflow && resizeState.overflow) {
|
|
158
168
|
resizeState = scaleTableTo(resizeState, maxSize);
|
|
159
169
|
}
|
|
160
170
|
|