@atlaskit/editor-core 151.1.2 → 152.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +112 -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/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/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/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/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 +35 -31
- 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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NodeSelection, Plugin } from 'prosemirror-state';
|
|
2
2
|
import { uuid } from '@atlaskit/adf-schema';
|
|
3
|
-
import { nodesBetweenChanged } from '../../../utils';
|
|
3
|
+
import { nodesBetweenChanged, SetAttrsStep } from '../../../utils';
|
|
4
4
|
import { createSelectionClickHandler } from '../../selection/utils';
|
|
5
5
|
import { decisionItemNodeView } from '../nodeviews/decisionItem';
|
|
6
6
|
import { taskItemNodeViewFactory } from '../nodeviews/taskItem';
|
|
@@ -145,10 +145,10 @@ export function createPlugin(portalProviderAPI, eventDispatcher, providerFactory
|
|
|
145
145
|
} = node.attrs;
|
|
146
146
|
|
|
147
147
|
if (localId === undefined || localId === null || localId === '') {
|
|
148
|
-
tr.
|
|
148
|
+
tr.step(new SetAttrsStep(pos, {
|
|
149
149
|
localId: uuid.generate(),
|
|
150
150
|
...rest
|
|
151
|
-
});
|
|
151
|
+
}));
|
|
152
152
|
modified = true;
|
|
153
153
|
}
|
|
154
154
|
}
|
|
@@ -206,7 +206,8 @@ class ToolbarTextColor extends React.Component {
|
|
|
206
206
|
}, /*#__PURE__*/React.createElement(ColorPalette, {
|
|
207
207
|
palette: palette,
|
|
208
208
|
onClick: color => this.changeTextColor(color, pluginState.disabled),
|
|
209
|
-
selectedColor: pluginState.color
|
|
209
|
+
selectedColor: pluginState.color,
|
|
210
|
+
isShowingMoreColors: isShowingMoreColors
|
|
210
211
|
})), showMoreColorsToggle && /*#__PURE__*/React.createElement(ShowMoreWrapper, null, /*#__PURE__*/React.createElement(Button, {
|
|
211
212
|
appearance: "subtle",
|
|
212
213
|
onClick: this.handleShowMoreToggle,
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { code, em, strike, strong, subsup, underline } from '@atlaskit/adf-schema';
|
|
3
3
|
import WithPluginState from '../../ui/WithPluginState';
|
|
4
4
|
import { plugin as textFormattingPlugin, pluginKey as textFormattingPluginKey } from './pm-plugins/main';
|
|
5
|
-
import { plugin as clearFormattingPlugin } from './pm-plugins/clear-formatting';
|
|
5
|
+
import { plugin as clearFormattingPlugin, pluginKey as clearFormattingPluginKey } from './pm-plugins/clear-formatting';
|
|
6
6
|
import clearFormattingKeymapPlugin from './pm-plugins/clear-formatting-keymap';
|
|
7
7
|
import textFormattingCursorPlugin from './pm-plugins/cursor';
|
|
8
8
|
import textFormattingInputRulePlugin from './pm-plugins/input-rule';
|
|
@@ -81,7 +81,8 @@ const textFormatting = (options = {}) => ({
|
|
|
81
81
|
}) {
|
|
82
82
|
return /*#__PURE__*/React.createElement(WithPluginState, {
|
|
83
83
|
plugins: {
|
|
84
|
-
textFormattingState: textFormattingPluginKey
|
|
84
|
+
textFormattingState: textFormattingPluginKey,
|
|
85
|
+
clearFormattingPluginState: clearFormattingPluginKey
|
|
85
86
|
},
|
|
86
87
|
render: () => {
|
|
87
88
|
return /*#__PURE__*/React.createElement(Toolbar, {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useMemo, useEffect, useRef, useCallback, useLayoutEffect } from 'react';
|
|
2
|
-
import { text as colorsText, N200, N20, DN70, N800, DN600, DN300 } from '@atlaskit/theme/colors';
|
|
2
|
+
import { text as colorsText, N200, N20, DN70, N800, DN600, DN300 } from '@atlaskit/theme/colors'; // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
3
|
+
|
|
3
4
|
import { ItemGroup, itemThemeNamespace } from '@atlaskit/item';
|
|
4
5
|
import { themed } from '@atlaskit/theme/components';
|
|
5
6
|
import { ThemeProvider } from 'styled-components';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useCallback, useMemo, useRef, useLayoutEffect } from 'react';
|
|
2
2
|
import { N200 } from '@atlaskit/theme/colors';
|
|
3
|
-
import { borderRadius } from '@atlaskit/theme/constants';
|
|
3
|
+
import { borderRadius } from '@atlaskit/theme/constants'; // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
4
|
+
|
|
4
5
|
import Item from '@atlaskit/item';
|
|
5
6
|
import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
6
7
|
import styled from 'styled-components';
|
|
@@ -1,39 +1,72 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useState, useEffect } from 'react';
|
|
2
2
|
import AvatarsWithPluginState from '../../../plugins/collab-edit/ui';
|
|
3
|
+
import FindReplaceToolbarButtonWithState from '../../../plugins/find-replace/FindReplaceToolbarButtonWithState';
|
|
4
|
+
import { BeforePrimaryToolbarWrapper } from '../../../plugins/before-primaryToolbar/ui/BeforePrimaryToolbarWrapper';
|
|
3
5
|
import Toolbar from '../../Toolbar';
|
|
4
|
-
import { MainToolbar, MainToolbarIconBefore,
|
|
6
|
+
import { MainToolbar, MainToolbarIconBefore, MainToolbarFirstChild, MainToolbarSecondChild, NonCustomToolbarWrapper, CustomToolbarWrapper, MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT } from './MainToolbar';
|
|
5
7
|
import { ContextPanelConsumer } from '../../ContextPanel/context';
|
|
6
8
|
export const FullPageToolbar = /*#__PURE__*/React.memo(props => {
|
|
9
|
+
var _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$collabEdit, _props$collabEdit2, _props$collabEdit3, _props$featureFlags4, _props$featureFlags5;
|
|
10
|
+
|
|
11
|
+
const [shouldSplitToolbar, setShouldSplitToolbar] = useState(false);
|
|
12
|
+
const nonCustomToolbar = /*#__PURE__*/React.createElement(NonCustomToolbarWrapper, null, props.beforeIcon && /*#__PURE__*/React.createElement(MainToolbarIconBefore, null, props.beforeIcon), /*#__PURE__*/React.createElement(Toolbar, {
|
|
13
|
+
editorView: props.editorView,
|
|
14
|
+
editorActions: props.editorActions,
|
|
15
|
+
eventDispatcher: props.eventDispatcher,
|
|
16
|
+
providerFactory: props.providerFactory,
|
|
17
|
+
appearance: props.appearance,
|
|
18
|
+
items: props.primaryToolbarComponents,
|
|
19
|
+
popupsMountPoint: props.popupsMountPoint,
|
|
20
|
+
popupsBoundariesElement: props.popupsBoundariesElement,
|
|
21
|
+
popupsScrollableElement: props.popupsScrollableElement,
|
|
22
|
+
disabled: props.disabled,
|
|
23
|
+
dispatchAnalyticsEvent: props.dispatchAnalyticsEvent,
|
|
24
|
+
containerElement: props.containerElement,
|
|
25
|
+
hasMinWidth: props.hasMinWidth
|
|
26
|
+
}));
|
|
27
|
+
const customToolbar = /*#__PURE__*/React.createElement(CustomToolbarWrapper, null, (_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.twoLineEditorToolbar && !!props.customPrimaryToolbarComponents && 'before' in props.customPrimaryToolbarComponents ? /*#__PURE__*/React.createElement(BeforePrimaryToolbarWrapper, {
|
|
28
|
+
beforePrimaryToolbarComponents: props.customPrimaryToolbarComponents.before
|
|
29
|
+
}) : null, (props === null || props === void 0 ? void 0 : (_props$featureFlags2 = props.featureFlags) === null || _props$featureFlags2 === void 0 ? void 0 : _props$featureFlags2.showAvatarGroupAsPlugin) === true && !((_props$featureFlags3 = props.featureFlags) !== null && _props$featureFlags3 !== void 0 && _props$featureFlags3.twoLineEditorToolbar) ? null : /*#__PURE__*/React.createElement(AvatarsWithPluginState, {
|
|
30
|
+
editorView: props.editorView,
|
|
31
|
+
eventDispatcher: props.eventDispatcher,
|
|
32
|
+
inviteToEditComponent: (_props$collabEdit = props.collabEdit) === null || _props$collabEdit === void 0 ? void 0 : _props$collabEdit.inviteToEditComponent,
|
|
33
|
+
inviteToEditHandler: (_props$collabEdit2 = props.collabEdit) === null || _props$collabEdit2 === void 0 ? void 0 : _props$collabEdit2.inviteToEditHandler,
|
|
34
|
+
isInviteToEditButtonSelected: (_props$collabEdit3 = props.collabEdit) === null || _props$collabEdit3 === void 0 ? void 0 : _props$collabEdit3.isInviteToEditButtonSelected
|
|
35
|
+
}), (_props$featureFlags4 = props.featureFlags) !== null && _props$featureFlags4 !== void 0 && _props$featureFlags4.findReplace && (_props$featureFlags5 = props.featureFlags) !== null && _props$featureFlags5 !== void 0 && _props$featureFlags5.twoLineEditorToolbar ? /*#__PURE__*/React.createElement(FindReplaceToolbarButtonWithState, {
|
|
36
|
+
popupsBoundariesElement: props.popupsBoundariesElement,
|
|
37
|
+
popupsMountPoint: props.popupsMountPoint,
|
|
38
|
+
popupsScrollableElement: props.popupsScrollableElement,
|
|
39
|
+
editorView: props.editorView,
|
|
40
|
+
containerElement: props.containerElement,
|
|
41
|
+
dispatchAnalyticsEvent: props.dispatchAnalyticsEvent
|
|
42
|
+
}) : null, !!props.customPrimaryToolbarComponents && 'after' in props.customPrimaryToolbarComponents ? props.customPrimaryToolbarComponents.after : props.customPrimaryToolbarComponents);
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
var _props$featureFlags6;
|
|
45
|
+
|
|
46
|
+
if ((_props$featureFlags6 = props.featureFlags) !== null && _props$featureFlags6 !== void 0 && _props$featureFlags6.twoLineEditorToolbar) {
|
|
47
|
+
const updateOnResize = () => {
|
|
48
|
+
setShouldSplitToolbar(window.innerWidth <= MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
window.addEventListener('resize', updateOnResize);
|
|
52
|
+
updateOnResize();
|
|
53
|
+
return () => window.removeEventListener('resize', updateOnResize);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
7
56
|
return /*#__PURE__*/React.createElement(ContextPanelConsumer, null, ({
|
|
8
57
|
width: contextPanelWidth
|
|
9
58
|
}) => {
|
|
10
|
-
var _props$
|
|
59
|
+
var _props$featureFlags7, _props$featureFlags8, _props$featureFlags9;
|
|
11
60
|
|
|
12
61
|
return /*#__PURE__*/React.createElement(MainToolbar, {
|
|
13
62
|
"data-testid": "ak-editor-main-toolbar",
|
|
14
|
-
showKeyline: props.showKeyline || contextPanelWidth > 0
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
popupsMountPoint: props.popupsMountPoint,
|
|
23
|
-
popupsBoundariesElement: props.popupsBoundariesElement,
|
|
24
|
-
popupsScrollableElement: props.popupsScrollableElement,
|
|
25
|
-
disabled: props.disabled,
|
|
26
|
-
dispatchAnalyticsEvent: props.dispatchAnalyticsEvent,
|
|
27
|
-
containerElement: props.containerElement,
|
|
28
|
-
hasMinWidth: props.hasMinWidth
|
|
29
|
-
}), /*#__PURE__*/React.createElement(MainToolbarCustomComponentsSlot, {
|
|
30
|
-
"data-testid": 'avatar-group-outside-plugin'
|
|
31
|
-
}, (props === null || props === void 0 ? void 0 : (_props$featureFlags = props.featureFlags) === null || _props$featureFlags === void 0 ? void 0 : _props$featureFlags.showAvatarGroupAsPlugin) === true ? null : /*#__PURE__*/React.createElement(AvatarsWithPluginState, {
|
|
32
|
-
editorView: props.editorView,
|
|
33
|
-
eventDispatcher: props.eventDispatcher,
|
|
34
|
-
inviteToEditComponent: props.collabEdit && props.collabEdit.inviteToEditComponent,
|
|
35
|
-
inviteToEditHandler: props.collabEdit && props.collabEdit.inviteToEditHandler,
|
|
36
|
-
isInviteToEditButtonSelected: props.collabEdit && props.collabEdit.isInviteToEditButtonSelected
|
|
37
|
-
}), props.customPrimaryToolbarComponents));
|
|
63
|
+
showKeyline: props.showKeyline || contextPanelWidth > 0,
|
|
64
|
+
twoLineEditorToolbar: !!((_props$featureFlags7 = props.featureFlags) !== null && _props$featureFlags7 !== void 0 && _props$featureFlags7.twoLineEditorToolbar)
|
|
65
|
+
}, /*#__PURE__*/React.createElement(MainToolbarFirstChild, {
|
|
66
|
+
twoLineEditorToolbar: !!((_props$featureFlags8 = props.featureFlags) !== null && _props$featureFlags8 !== void 0 && _props$featureFlags8.twoLineEditorToolbar)
|
|
67
|
+
}, shouldSplitToolbar ? customToolbar : nonCustomToolbar), /*#__PURE__*/React.createElement(MainToolbarSecondChild, {
|
|
68
|
+
"data-testid": 'avatar-group-outside-plugin',
|
|
69
|
+
twoLineEditorToolbar: !!((_props$featureFlags9 = props.featureFlags) !== null && _props$featureFlags9 !== void 0 && _props$featureFlags9.twoLineEditorToolbar)
|
|
70
|
+
}, shouldSplitToolbar ? nonCustomToolbar : customToolbar));
|
|
38
71
|
});
|
|
39
72
|
});
|
|
@@ -2,6 +2,7 @@ import styled from 'styled-components';
|
|
|
2
2
|
import { N30 } from '@atlaskit/theme/colors';
|
|
3
3
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
4
4
|
import { akEditorMenuZIndex, akEditorSwoopCubicBezier, akEditorToolbarKeylineHeight, akEditorMobileMaxWidth } from '@atlaskit/editor-shared-styles';
|
|
5
|
+
export const MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT = 868;
|
|
5
6
|
const toolbarLineHeight = 56;
|
|
6
7
|
export const MainToolbar = styled.div`
|
|
7
8
|
position: relative;
|
|
@@ -18,6 +19,13 @@ export const MainToolbar = styled.div`
|
|
|
18
19
|
height: 0 !important;
|
|
19
20
|
}
|
|
20
21
|
|
|
22
|
+
@media (max-width: ${MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT}px) {
|
|
23
|
+
${props => props.twoLineEditorToolbar && `
|
|
24
|
+
flex-wrap: wrap;
|
|
25
|
+
height: calc(${toolbarLineHeight}px * 2);
|
|
26
|
+
`}
|
|
27
|
+
}
|
|
28
|
+
|
|
21
29
|
@media (max-width: ${akEditorMobileMaxWidth}px) {
|
|
22
30
|
display: grid;
|
|
23
31
|
height: calc(${toolbarLineHeight}px * 2);
|
|
@@ -34,21 +42,46 @@ export const MainToolbarIconBefore = styled.div`
|
|
|
34
42
|
}
|
|
35
43
|
`;
|
|
36
44
|
MainToolbarIconBefore.displayName = 'MainToolbarIconBefore';
|
|
37
|
-
export const
|
|
45
|
+
export const MainToolbarFirstChild = styled.div`
|
|
38
46
|
display: flex;
|
|
39
|
-
justify-content: flex-end;
|
|
40
47
|
flex-grow: 1;
|
|
48
|
+
|
|
49
|
+
@media (max-width: ${MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT}px) {
|
|
50
|
+
${props => props.twoLineEditorToolbar && `
|
|
51
|
+
flex: 1 1 100%;
|
|
52
|
+
height: ${toolbarLineHeight}px;
|
|
53
|
+
justify-content: flex-end;
|
|
54
|
+
// ED-10241: We add fit-content to ensure that MainToolbar does not
|
|
55
|
+
// shrink more than the size of its contents. This will prevent the
|
|
56
|
+
// find/replace icon from being overlapped during a confluence
|
|
57
|
+
// publish operation
|
|
58
|
+
min-width: fit-content;
|
|
59
|
+
`}
|
|
60
|
+
}
|
|
61
|
+
@media (max-width: ${akEditorMobileMaxWidth}px) {
|
|
62
|
+
grid-column: 1;
|
|
63
|
+
grid-row: 1;
|
|
64
|
+
}
|
|
65
|
+
`;
|
|
66
|
+
MainToolbarFirstChild.displayName = 'MainToolbarFirstChild';
|
|
67
|
+
export const MainToolbarSecondChild = styled.div`
|
|
41
68
|
// ED-10241: We add fit-content to ensure that MainToolbar does not
|
|
42
69
|
// shrink more than the size of its contents. This will prevent the
|
|
43
70
|
// find/replace icon from being overlapped during a confluence
|
|
44
71
|
// publish operation
|
|
45
72
|
min-width: fit-content;
|
|
46
|
-
@media (max-width: ${
|
|
47
|
-
|
|
48
|
-
|
|
73
|
+
@media (max-width: ${MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT}px) {
|
|
74
|
+
${props => props.twoLineEditorToolbar && `
|
|
75
|
+
display: flex;
|
|
76
|
+
flex-grow: 1;
|
|
77
|
+
flex: 1 1 100%;
|
|
78
|
+
margin: auto;
|
|
79
|
+
height: ${toolbarLineHeight}px;
|
|
80
|
+
min-width: 0;
|
|
81
|
+
`}
|
|
49
82
|
}
|
|
50
83
|
`;
|
|
51
|
-
|
|
84
|
+
MainToolbarSecondChild.displayName = 'MainToolbarSecondChild';
|
|
52
85
|
export const SecondaryToolbar = styled.div`
|
|
53
86
|
box-sizing: border-box;
|
|
54
87
|
justify-content: flex-end;
|
|
@@ -57,4 +90,15 @@ export const SecondaryToolbar = styled.div`
|
|
|
57
90
|
display: flex;
|
|
58
91
|
padding: 24px 0;
|
|
59
92
|
`;
|
|
60
|
-
SecondaryToolbar.displayName = 'SecondaryToolbar';
|
|
93
|
+
SecondaryToolbar.displayName = 'SecondaryToolbar';
|
|
94
|
+
export const NonCustomToolbarWrapper = styled.div`
|
|
95
|
+
align-items: center;
|
|
96
|
+
display: flex;
|
|
97
|
+
flex-grow: 1;
|
|
98
|
+
`;
|
|
99
|
+
NonCustomToolbarWrapper.displayName = 'NonCustomToolbar';
|
|
100
|
+
export const CustomToolbarWrapper = styled.div`
|
|
101
|
+
align-items: center;
|
|
102
|
+
display: flex;
|
|
103
|
+
`;
|
|
104
|
+
CustomToolbarWrapper.displayName = 'CustomToolbar';
|
|
@@ -1,19 +1,10 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { PureComponent } from 'react';
|
|
4
|
-
import { defineMessages, injectIntl } from 'react-intl';
|
|
5
4
|
import EditorDoneIcon from '@atlaskit/icon/glyph/editor/done';
|
|
6
5
|
import { N0 } from '@atlaskit/theme/colors';
|
|
7
6
|
import { Button, ButtonWrapper } from './styles';
|
|
8
|
-
import Tooltip from '@atlaskit/tooltip';
|
|
9
|
-
|
|
10
|
-
const messages = defineMessages({
|
|
11
|
-
selected: {
|
|
12
|
-
id: 'fabric.editor.selected',
|
|
13
|
-
defaultMessage: 'Selected',
|
|
14
|
-
description: 'If the item is selected or not.'
|
|
15
|
-
}
|
|
16
|
-
});
|
|
7
|
+
import Tooltip from '@atlaskit/tooltip';
|
|
17
8
|
|
|
18
9
|
class Color extends PureComponent {
|
|
19
10
|
constructor(...args) {
|
|
@@ -36,21 +27,20 @@ class Color extends PureComponent {
|
|
|
36
27
|
|
|
37
28
|
render() {
|
|
38
29
|
const {
|
|
30
|
+
autoFocus,
|
|
39
31
|
tabIndex,
|
|
40
32
|
value,
|
|
41
33
|
label,
|
|
42
34
|
isSelected,
|
|
43
35
|
borderColor,
|
|
44
|
-
checkMarkColor = N0
|
|
45
|
-
intl: {
|
|
46
|
-
formatMessage
|
|
47
|
-
}
|
|
36
|
+
checkMarkColor = N0
|
|
48
37
|
} = this.props;
|
|
49
|
-
const ariaLabelText = isSelected ? `${label} ${formatMessage(messages.selected)}` : label;
|
|
50
38
|
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
51
39
|
content: label
|
|
52
40
|
}, /*#__PURE__*/React.createElement(ButtonWrapper, null, /*#__PURE__*/React.createElement(Button, {
|
|
53
|
-
"aria-label":
|
|
41
|
+
"aria-label": label,
|
|
42
|
+
role: "radio",
|
|
43
|
+
"aria-checked": isSelected,
|
|
54
44
|
onClick: this.onClick,
|
|
55
45
|
onMouseDown: this.onMouseDown,
|
|
56
46
|
tabIndex: tabIndex,
|
|
@@ -58,7 +48,8 @@ class Color extends PureComponent {
|
|
|
58
48
|
style: {
|
|
59
49
|
backgroundColor: value || 'transparent',
|
|
60
50
|
border: `1px solid ${borderColor}`
|
|
61
|
-
}
|
|
51
|
+
},
|
|
52
|
+
autoFocus: autoFocus
|
|
62
53
|
}, isSelected && /*#__PURE__*/React.createElement(EditorDoneIcon, {
|
|
63
54
|
primaryColor: checkMarkColor,
|
|
64
55
|
label: ""
|
|
@@ -67,4 +58,4 @@ class Color extends PureComponent {
|
|
|
67
58
|
|
|
68
59
|
}
|
|
69
60
|
|
|
70
|
-
export default
|
|
61
|
+
export default Color;
|
|
@@ -23,6 +23,7 @@ const ColorPalette = props => {
|
|
|
23
23
|
onClick,
|
|
24
24
|
selectedColor,
|
|
25
25
|
className,
|
|
26
|
+
isShowingMoreColors,
|
|
26
27
|
intl: {
|
|
27
28
|
formatMessage
|
|
28
29
|
}
|
|
@@ -36,22 +37,24 @@ const ColorPalette = props => {
|
|
|
36
37
|
return resultArray;
|
|
37
38
|
}, []);
|
|
38
39
|
}, [palette, cols]);
|
|
39
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, colorsPerRow.map(row => /*#__PURE__*/React.createElement(ColorPaletteWrapper, {
|
|
40
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, colorsPerRow.map((row, rowIdx) => /*#__PURE__*/React.createElement(ColorPaletteWrapper, {
|
|
40
41
|
className: className,
|
|
41
|
-
key: `row-first-color-${row[0].value}
|
|
42
|
+
key: `row-first-color-${row[0].value}`,
|
|
43
|
+
role: "radiogroup"
|
|
42
44
|
}, row.map(({
|
|
43
45
|
value,
|
|
44
46
|
label,
|
|
45
47
|
border,
|
|
46
48
|
message
|
|
47
|
-
}) => /*#__PURE__*/React.createElement(Color, {
|
|
49
|
+
}, colorIdx) => /*#__PURE__*/React.createElement(Color, {
|
|
48
50
|
key: value,
|
|
49
51
|
value: value,
|
|
50
52
|
borderColor: border,
|
|
51
53
|
label: message ? formatMessage(message) : label,
|
|
52
54
|
onClick: onClick,
|
|
53
55
|
isSelected: value === selectedColor,
|
|
54
|
-
checkMarkColor: getContrastColor(value, [N0, N500])
|
|
56
|
+
checkMarkColor: getContrastColor(value, [N0, N500]),
|
|
57
|
+
autoFocus: isShowingMoreColors && rowIdx === 1 && colorIdx === 0
|
|
55
58
|
})))));
|
|
56
59
|
};
|
|
57
60
|
|
|
@@ -6,11 +6,12 @@ import { withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-n
|
|
|
6
6
|
import Form from '@atlaskit/form';
|
|
7
7
|
import { isTabGroup } from '@atlaskit/editor-common/extensions';
|
|
8
8
|
import _isEqual from 'lodash/isEqual';
|
|
9
|
+
import _mergeRecursive from 'lodash/merge';
|
|
9
10
|
import { fireAnalyticsEvent, EVENT_TYPE, ACTION_SUBJECT, ACTION } from '../../plugins/analytics';
|
|
10
11
|
import LoadingState from './LoadingState';
|
|
11
12
|
import Header from './Header';
|
|
12
13
|
import ErrorMessage from './ErrorMessage';
|
|
13
|
-
import { serialize, deserialize } from './transformers';
|
|
14
|
+
import { serialize, deserialize, findDuplicateFields } from './transformers';
|
|
14
15
|
import { injectIntl } from 'react-intl';
|
|
15
16
|
import ButtonGroup from '@atlaskit/button/button-group';
|
|
16
17
|
import Button from '@atlaskit/button/custom-theme-button';
|
|
@@ -19,6 +20,7 @@ import { pluginKey as extensionPluginKey } from '../../plugins/extension/plugin-
|
|
|
19
20
|
import WithPluginState from '../WithPluginState';
|
|
20
21
|
import FormContent from './FormContent';
|
|
21
22
|
import { messages } from './messages';
|
|
23
|
+
import { FormErrorBoundary } from './FormErrorBoundary';
|
|
22
24
|
|
|
23
25
|
function ConfigForm({
|
|
24
26
|
canSave,
|
|
@@ -32,8 +34,19 @@ function ConfigForm({
|
|
|
32
34
|
onCancel,
|
|
33
35
|
onFieldChange,
|
|
34
36
|
parameters,
|
|
35
|
-
submitting
|
|
37
|
+
submitting,
|
|
38
|
+
contextIdentifierProvider
|
|
36
39
|
}) {
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
if (fields) {
|
|
42
|
+
const firstDuplicateField = findDuplicateFields(fields);
|
|
43
|
+
|
|
44
|
+
if (firstDuplicateField) {
|
|
45
|
+
throw new Error(`Possible duplicate field name: \`${firstDuplicateField.name}\`.`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}, [fields]);
|
|
49
|
+
|
|
37
50
|
if (isLoading || !hasParsedParameters && errorMessage === null) {
|
|
38
51
|
return /*#__PURE__*/React.createElement(LoadingState, null);
|
|
39
52
|
}
|
|
@@ -44,34 +57,27 @@ function ConfigForm({
|
|
|
44
57
|
});
|
|
45
58
|
}
|
|
46
59
|
|
|
47
|
-
return /*#__PURE__*/React.createElement(
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
appearance: "primary"
|
|
69
|
-
}, intl.formatMessage(messages.submit)), /*#__PURE__*/React.createElement(Button, {
|
|
70
|
-
appearance: "default",
|
|
71
|
-
isDisabled: submitting,
|
|
72
|
-
onClick: onCancel
|
|
73
|
-
}, intl.formatMessage(messages.cancel))))))
|
|
74
|
-
});
|
|
60
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormContent, {
|
|
61
|
+
fields: fields,
|
|
62
|
+
parameters: parameters,
|
|
63
|
+
extensionManifest: extensionManifest,
|
|
64
|
+
onFieldChange: onFieldChange,
|
|
65
|
+
firstVisibleFieldName: firstVisibleFieldName,
|
|
66
|
+
contextIdentifierProvider: contextIdentifierProvider
|
|
67
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
68
|
+
style: canSave ? {} : {
|
|
69
|
+
display: 'none'
|
|
70
|
+
}
|
|
71
|
+
}, /*#__PURE__*/React.createElement(FormFooter, {
|
|
72
|
+
align: "start"
|
|
73
|
+
}, /*#__PURE__*/React.createElement(ButtonGroup, null, /*#__PURE__*/React.createElement(Button, {
|
|
74
|
+
type: "submit",
|
|
75
|
+
appearance: "primary"
|
|
76
|
+
}, intl.formatMessage(messages.submit)), /*#__PURE__*/React.createElement(Button, {
|
|
77
|
+
appearance: "default",
|
|
78
|
+
isDisabled: submitting,
|
|
79
|
+
onClick: onCancel
|
|
80
|
+
}, intl.formatMessage(messages.cancel))))));
|
|
75
81
|
}
|
|
76
82
|
|
|
77
83
|
const ConfigFormIntl = injectIntl(ConfigForm);
|
|
@@ -126,14 +132,48 @@ class ConfigPanel extends React.Component {
|
|
|
126
132
|
});
|
|
127
133
|
|
|
128
134
|
_defineProperty(this, "backfillTabFormData", (fields, formData, currentParameters) => {
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
|
|
135
|
+
const getRelevantData = (field, formParams, currentParams, backfill) => {
|
|
136
|
+
if (field.hasGroupedValues && !(field.name in backfill)) {
|
|
137
|
+
backfill[field.name] = {};
|
|
132
138
|
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
139
|
+
|
|
140
|
+
const actualFormParams = field.hasGroupedValues ? formParams[field.name] || {} : formParams;
|
|
141
|
+
const actualCurrentParams = field.hasGroupedValues ? currentParams[field.name] || {} : currentParams;
|
|
142
|
+
const actualBackfillParams = field.hasGroupedValues ? backfill[field.name] : backfill;
|
|
143
|
+
return {
|
|
144
|
+
formParams: actualFormParams,
|
|
145
|
+
currentParams: actualCurrentParams,
|
|
146
|
+
backfillParams: actualBackfillParams
|
|
147
|
+
};
|
|
148
|
+
}; // Traverse any tab structures and backfill field values on tabs
|
|
149
|
+
// which aren't shown. This filter should be ok because tabs are
|
|
150
|
+
// currently only allowed on top level
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
const mergedTabGroups = fields.filter(isTabGroup).reduce((missingBackfill, tabGroup) => {
|
|
154
|
+
const {
|
|
155
|
+
formParams: tabGroupFormData,
|
|
156
|
+
currentParams: tabGroupCurrentData,
|
|
157
|
+
backfillParams: tabGroupParams
|
|
158
|
+
} = getRelevantData(tabGroup, formData, currentParameters, missingBackfill); // Loop through tabs and see what fields are missing from current data
|
|
159
|
+
|
|
160
|
+
tabGroup.fields.forEach(tabField => {
|
|
161
|
+
const {
|
|
162
|
+
formParams: tabFormData,
|
|
163
|
+
currentParams: tabCurrentData,
|
|
164
|
+
backfillParams: tabParams
|
|
165
|
+
} = getRelevantData(tabField, tabGroupFormData, tabGroupCurrentData, tabGroupParams);
|
|
166
|
+
tabField.fields.forEach(field => {
|
|
167
|
+
if (field.name in tabFormData || !(field.name in tabCurrentData)) {
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
tabParams[field.name] = tabCurrentData[field.name];
|
|
172
|
+
});
|
|
173
|
+
});
|
|
174
|
+
return missingBackfill;
|
|
175
|
+
}, {});
|
|
176
|
+
return _mergeRecursive({}, mergedTabGroups, formData);
|
|
137
177
|
});
|
|
138
178
|
|
|
139
179
|
_defineProperty(this, "handleSubmit", async formData => {
|
|
@@ -352,18 +392,30 @@ class ConfigPanel extends React.Component {
|
|
|
352
392
|
noValidate: true,
|
|
353
393
|
onKeyDown: handleKeyDown,
|
|
354
394
|
"data-testid": "extension-config-panel"
|
|
355
|
-
}), this.renderHeader(extensionManifest), /*#__PURE__*/React.createElement(
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
395
|
+
}), this.renderHeader(extensionManifest), /*#__PURE__*/React.createElement(WithPluginState, {
|
|
396
|
+
plugins: {
|
|
397
|
+
extension: extensionPluginKey
|
|
398
|
+
},
|
|
399
|
+
render: ({
|
|
400
|
+
extension
|
|
401
|
+
}) => /*#__PURE__*/React.createElement(FormErrorBoundary, {
|
|
402
|
+
contextIdentifierProvider: extension === null || extension === void 0 ? void 0 : extension.contextIdentifierProvider,
|
|
403
|
+
extensionKey: extensionManifest.key,
|
|
404
|
+
fields: fields || []
|
|
405
|
+
}, /*#__PURE__*/React.createElement(ConfigFormIntl, {
|
|
406
|
+
canSave: !autoSave,
|
|
407
|
+
errorMessage: errorMessage,
|
|
408
|
+
extensionManifest: extensionManifest,
|
|
409
|
+
fields: fields,
|
|
410
|
+
firstVisibleFieldName: firstVisibleFieldName,
|
|
411
|
+
hasParsedParameters: hasParsedParameters,
|
|
412
|
+
isLoading: isLoading || false,
|
|
413
|
+
onCancel: onCancel,
|
|
414
|
+
onFieldChange: onFieldChange,
|
|
415
|
+
parameters: currentParameters,
|
|
416
|
+
submitting: submitting,
|
|
417
|
+
contextIdentifierProvider: extension === null || extension === void 0 ? void 0 : extension.contextIdentifierProvider
|
|
418
|
+
}))
|
|
367
419
|
}));
|
|
368
420
|
});
|
|
369
421
|
});
|
|
@@ -134,35 +134,44 @@ export function FieldComponent({
|
|
|
134
134
|
});
|
|
135
135
|
|
|
136
136
|
case 'expand':
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
field: field
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
}));
|
|
149
|
-
|
|
150
|
-
case 'tab-group':
|
|
151
|
-
const renderPanel = tabField => {
|
|
152
|
-
const tabParameters = parameters[field.name] || {};
|
|
153
|
-
return /*#__PURE__*/React.createElement(FormContent, {
|
|
154
|
-
parentName: `${field.name}.${tabField.name}`,
|
|
155
|
-
fields: tabField.fields,
|
|
156
|
-
parameters: tabParameters[tabField.name] || {},
|
|
137
|
+
{
|
|
138
|
+
// if expand is under a tab with hasGroupedValues=true
|
|
139
|
+
const resolvedParentName = [parentName, field.hasGroupedValues ? field.name : undefined].filter(val => !!val).join('.') || undefined;
|
|
140
|
+
const resolvedParameters = !field.hasGroupedValues ? parameters : parameters[field.name] || {};
|
|
141
|
+
return /*#__PURE__*/React.createElement(Expand, {
|
|
142
|
+
field: field,
|
|
143
|
+
isExpanded: field.isExpanded
|
|
144
|
+
}, /*#__PURE__*/React.createElement(FormContent, {
|
|
145
|
+
parentName: resolvedParentName,
|
|
146
|
+
fields: field.fields,
|
|
147
|
+
parameters: resolvedParameters,
|
|
157
148
|
onFieldChange: onFieldChange,
|
|
158
149
|
extensionManifest: extensionManifest
|
|
159
|
-
});
|
|
160
|
-
}
|
|
150
|
+
}));
|
|
151
|
+
}
|
|
161
152
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
153
|
+
case 'tab-group':
|
|
154
|
+
{
|
|
155
|
+
const tabGroupField = field;
|
|
156
|
+
const tabGroupParams = tabGroupField.hasGroupedValues ? parameters[tabGroupField.name] || {} : parameters;
|
|
157
|
+
|
|
158
|
+
const renderPanel = tabField => {
|
|
159
|
+
const parentName = [tabGroupField.hasGroupedValues ? tabGroupField.name : undefined, tabField.hasGroupedValues ? tabField.name : undefined].filter(val => !!val).join('.') || undefined;
|
|
160
|
+
const tabParameters = tabField.hasGroupedValues ? tabGroupParams[tabField.name] || {} : tabGroupParams;
|
|
161
|
+
return /*#__PURE__*/React.createElement(FormContent, {
|
|
162
|
+
parentName: parentName,
|
|
163
|
+
fields: tabField.fields,
|
|
164
|
+
parameters: tabParameters,
|
|
165
|
+
onFieldChange: onFieldChange,
|
|
166
|
+
extensionManifest: extensionManifest
|
|
167
|
+
});
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
return /*#__PURE__*/React.createElement(TabGroup, {
|
|
171
|
+
field: tabGroupField,
|
|
172
|
+
renderPanel: renderPanel
|
|
173
|
+
});
|
|
174
|
+
}
|
|
166
175
|
|
|
167
176
|
default:
|
|
168
177
|
return /*#__PURE__*/React.createElement(UnhandledType, {
|