@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,4 +1,4 @@
|
|
|
1
|
-
import { isFieldset, isDateRange, isTabGroup, isExpand, getFieldSerializer, getFieldDeserializer } from '@atlaskit/editor-common/extensions';
|
|
1
|
+
import { isFieldset, isDateRange, isTabGroup, isTabField, isExpand, getFieldSerializer, getFieldDeserializer } from '@atlaskit/editor-common/extensions';
|
|
2
2
|
import { getNameFromDuplicateField, isDuplicateField } from './utils';
|
|
3
3
|
|
|
4
4
|
const isOption = option => {
|
|
@@ -8,10 +8,9 @@ const isOption = option => {
|
|
|
8
8
|
const isOptions = options => {
|
|
9
9
|
return Array.isArray(options) && options.every(isOption);
|
|
10
10
|
};
|
|
11
|
-
/** maps the typed-values from the Form values object */
|
|
12
|
-
|
|
13
11
|
|
|
14
|
-
|
|
12
|
+
/** maps the typed-values from the Form values object */
|
|
13
|
+
function extract(value, field, options) {
|
|
15
14
|
if (isOptions(value)) {
|
|
16
15
|
return value.map(item => item.value);
|
|
17
16
|
} else if (isOption(value)) {
|
|
@@ -24,79 +23,235 @@ function extract(value, field) {
|
|
|
24
23
|
}
|
|
25
24
|
|
|
26
25
|
return Number(value);
|
|
26
|
+
} // Workaround for https://product-fabric.atlassian.net/browse/DST-2701
|
|
27
|
+
else if (options !== null && options !== void 0 && options.useDefaultValue && value === undefined && 'defaultValue' in field) {
|
|
28
|
+
return field.defaultValue;
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
return value;
|
|
30
32
|
}
|
|
31
33
|
|
|
32
|
-
export const
|
|
34
|
+
export const findDuplicateFields = fields => findDuplicateFieldsInternal(flattenFields(fields));
|
|
35
|
+
|
|
36
|
+
const findDuplicateFieldsInternal = fields => {
|
|
37
|
+
const allowDuplicatesMap = {};
|
|
38
|
+
return fields.find(field => {
|
|
39
|
+
if (isExpand(field)) {
|
|
40
|
+
return findDuplicateFieldsInternal(field.fields);
|
|
41
|
+
} else if (isTabGroup(field)) {
|
|
42
|
+
return field.fields.find(tabField => findDuplicateFieldsInternal(tabField.fields));
|
|
43
|
+
} else if (allowDuplicatesMap[field.name] === undefined) {
|
|
44
|
+
allowDuplicatesMap[field.name] = !!field.allowDuplicates;
|
|
45
|
+
return;
|
|
46
|
+
} else if (!field.allowDuplicates || !allowDuplicatesMap[field.name]) {
|
|
47
|
+
return field;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return;
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export const serialize = async (manifest, data, fields, options = {}) => {
|
|
33
55
|
const result = [];
|
|
56
|
+
const {
|
|
57
|
+
depth = 0,
|
|
58
|
+
parentType
|
|
59
|
+
} = options;
|
|
60
|
+
const flattenedFields = flattenFields(fields);
|
|
61
|
+
const fillResults = flattenedFields.map(async field => {
|
|
62
|
+
if (isTabGroup(field)) {
|
|
63
|
+
const tabGroupData = await serializeTabGroupField(manifest, field, data);
|
|
64
|
+
result.push(...tabGroupData);
|
|
65
|
+
} else if (isTabField(field)) {
|
|
66
|
+
const tabData = await serializeTabField(manifest, field, data);
|
|
67
|
+
result.push(...tabData);
|
|
68
|
+
} else if (isExpand(field)) {
|
|
69
|
+
const expandData = await serializeExpandField(manifest, field, data);
|
|
70
|
+
result.push(...expandData);
|
|
71
|
+
} // WARNING: don't recursively serialize, limit to depth < 1
|
|
72
|
+
// serializable?
|
|
73
|
+
else if (isFieldset(field) && depth === 0) {
|
|
74
|
+
const fieldsetData = await serializeFieldset(manifest, field, data, depth);
|
|
34
75
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
76
|
+
if (fieldsetData) {
|
|
77
|
+
result.push(fieldsetData);
|
|
78
|
+
}
|
|
79
|
+
} else {
|
|
80
|
+
const value = extract(data[field.name], field, {
|
|
81
|
+
useDefaultValue: true
|
|
82
|
+
}); // ignore undefined values
|
|
83
|
+
|
|
84
|
+
if (value !== undefined) {
|
|
85
|
+
result.push({
|
|
86
|
+
[field.name]: value
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
await Promise.all(fillResults); // Crunch fields down to parameters
|
|
38
92
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
93
|
+
const parameters = result.reduce((obj, current) => {
|
|
94
|
+
for (const key in current) {
|
|
95
|
+
obj[key] = current[key];
|
|
96
|
+
}
|
|
42
97
|
|
|
98
|
+
return obj;
|
|
99
|
+
}, {}); // Fix up duplicate values (currently only for fieldsets)
|
|
43
100
|
|
|
44
|
-
|
|
101
|
+
const hasDuplicateFields = parentType === 'fieldset' && !!flattenedFields.find(field => field.allowDuplicates);
|
|
45
102
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
103
|
+
if (hasDuplicateFields) {
|
|
104
|
+
return serializeMergeDuplicateFieldData(parameters, data, flattenedFields);
|
|
105
|
+
}
|
|
49
106
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
fields: tabs
|
|
53
|
-
} = field;
|
|
54
|
-
value = {};
|
|
107
|
+
return parameters;
|
|
108
|
+
};
|
|
55
109
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
};
|
|
110
|
+
const serializeFieldset = async (manifest, field, data, depth) => {
|
|
111
|
+
let fieldSerializer;
|
|
59
112
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
113
|
+
try {
|
|
114
|
+
fieldSerializer = await getFieldSerializer(manifest, field.options.transformer);
|
|
115
|
+
} catch (ex) {
|
|
116
|
+
// We only throw if there is data that may be lost
|
|
117
|
+
if (data[field.name] !== undefined) {
|
|
118
|
+
throw ex;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if (!fieldSerializer) {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const {
|
|
127
|
+
fields: fieldsetFields
|
|
128
|
+
} = field;
|
|
129
|
+
const fieldParams = extract(data[field.name], field, {
|
|
130
|
+
useDefaultValue: true
|
|
131
|
+
}) || {};
|
|
132
|
+
const extracted = await serialize(manifest, fieldParams, fieldsetFields, {
|
|
133
|
+
depth: depth + 1,
|
|
134
|
+
parentType: 'fieldset'
|
|
135
|
+
});
|
|
136
|
+
return {
|
|
137
|
+
[field.name]: fieldSerializer(extracted)
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
const serializeExpandField = async (manifest, field, data) => {
|
|
142
|
+
const expandData = field.hasGroupedValues ? data[field.name] || {} : data;
|
|
143
|
+
const value = await serialize(manifest, expandData, field.fields, {
|
|
144
|
+
parentType: 'expand'
|
|
145
|
+
});
|
|
146
|
+
const results = [];
|
|
147
|
+
|
|
148
|
+
if (!field.hasGroupedValues) {
|
|
149
|
+
for (const fieldName in value) {
|
|
150
|
+
results.push({
|
|
151
|
+
[fieldName]: value[fieldName]
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
} else {
|
|
155
|
+
results.push({
|
|
156
|
+
[field.name]: value
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
return results;
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
const resolveTabValues = async (manifest, tabField, groupData) => {
|
|
164
|
+
const tabFieldParams = tabField.hasGroupedValues ? groupData[tabField.name] || {} : groupData;
|
|
165
|
+
return await serialize(manifest, tabFieldParams, tabField.fields, {
|
|
166
|
+
parentType: 'tab'
|
|
167
|
+
});
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
const serializeTabGroupField = async (manifest, field, data) => {
|
|
171
|
+
const {
|
|
172
|
+
fields: tabs
|
|
173
|
+
} = field;
|
|
174
|
+
const results = [];
|
|
175
|
+
const value = {};
|
|
176
|
+
|
|
177
|
+
for (let i = 0; i < tabs.length; i++) {
|
|
178
|
+
const tabField = tabs[i];
|
|
179
|
+
const tabFieldParameters = await resolveTabValues(manifest, tabField, field.hasGroupedValues ? data[field.name] || {} : data);
|
|
180
|
+
|
|
181
|
+
if (tabField.hasGroupedValues) {
|
|
182
|
+
// Keep namespaced by tab
|
|
183
|
+
value[tabField.name] = tabFieldParameters;
|
|
184
|
+
} else {
|
|
185
|
+
// Copy into tabGroup value
|
|
186
|
+
for (const fieldName in tabFieldParameters) {
|
|
187
|
+
value[fieldName] = tabFieldParameters[fieldName];
|
|
78
188
|
}
|
|
189
|
+
}
|
|
190
|
+
} // Now for tabGroup...
|
|
191
|
+
|
|
79
192
|
|
|
80
|
-
|
|
81
|
-
|
|
193
|
+
if (field.hasGroupedValues) {
|
|
194
|
+
results.push({
|
|
195
|
+
[field.name]: value
|
|
196
|
+
});
|
|
197
|
+
} else {
|
|
198
|
+
for (const fieldName in value) {
|
|
199
|
+
results.push({
|
|
200
|
+
[fieldName]: value
|
|
82
201
|
});
|
|
83
202
|
}
|
|
84
|
-
}
|
|
85
|
-
// when there aren't we return an object eg. { title: 'one' }
|
|
203
|
+
}
|
|
86
204
|
|
|
205
|
+
return results;
|
|
206
|
+
};
|
|
87
207
|
|
|
88
|
-
|
|
208
|
+
const serializeTabField = async (manifest, field, data) => {
|
|
209
|
+
const results = [];
|
|
210
|
+
const tabField = field;
|
|
211
|
+
const tabFieldParameters = await resolveTabValues(manifest, tabField, data);
|
|
89
212
|
|
|
90
|
-
if (
|
|
91
|
-
|
|
213
|
+
if (tabField.hasGroupedValues) {
|
|
214
|
+
// Keep namespaced by tab
|
|
215
|
+
results.push({
|
|
216
|
+
[tabField.name]: tabFieldParameters
|
|
217
|
+
});
|
|
218
|
+
} else {
|
|
219
|
+
// Copy into tabGroup value
|
|
220
|
+
for (const fieldName in tabFieldParameters) {
|
|
221
|
+
results.push({
|
|
222
|
+
[fieldName]: tabFieldParameters[fieldName]
|
|
223
|
+
});
|
|
224
|
+
}
|
|
92
225
|
}
|
|
93
226
|
|
|
94
|
-
return
|
|
95
|
-
|
|
96
|
-
|
|
227
|
+
return results;
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
const serializeMergeDuplicateFieldData = (parameters, formData, flattenedFields) => {
|
|
231
|
+
// Weed out all the non-duplicate field names
|
|
232
|
+
const allDuplicateFieldNames = Object.keys(formData).filter(key => isDuplicateField(key));
|
|
233
|
+
return flattenedFields.reduce((newParams, field) => {
|
|
234
|
+
const paramValue = parameters[field.name];
|
|
235
|
+
|
|
236
|
+
if (!field.allowDuplicates && paramValue !== undefined) {
|
|
237
|
+
newParams[field.name] = paramValue;
|
|
238
|
+
} else {
|
|
239
|
+
// extract the given duplicate values through the field
|
|
240
|
+
const duplicateValues = allDuplicateFieldNames.filter(name => getNameFromDuplicateField(name) === field.name).map(duplicateFieldName => extract(formData[duplicateFieldName], field, {
|
|
241
|
+
useDefaultValue: true
|
|
242
|
+
})); // Merge and ensure that all values are worth serializing
|
|
243
|
+
|
|
244
|
+
const mergedValues = [paramValue, // first value
|
|
245
|
+
...duplicateValues].filter(value => value !== undefined);
|
|
246
|
+
|
|
247
|
+
if (mergedValues.length > 0) {
|
|
248
|
+
// Replace so the duplicate field values are saved under the
|
|
249
|
+
// fieldName as an array
|
|
250
|
+
newParams[field.name] = mergedValues;
|
|
251
|
+
}
|
|
97
252
|
}
|
|
98
253
|
|
|
99
|
-
return
|
|
254
|
+
return newParams;
|
|
100
255
|
}, {});
|
|
101
256
|
};
|
|
102
257
|
|
|
@@ -137,21 +292,51 @@ function injectDefaultValues(data, fields) {
|
|
|
137
292
|
}
|
|
138
293
|
}
|
|
139
294
|
|
|
140
|
-
if (doParametersContainDuplicateFields(copy)) {
|
|
141
|
-
return copy;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
295
|
return convertToParametersObject(copy);
|
|
145
296
|
}
|
|
297
|
+
/**
|
|
298
|
+
* Flattens the given FieldDefinition[] so it resembles the expected data
|
|
299
|
+
* structure in result Parameters.
|
|
300
|
+
*/
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
const flattenFields = fields => {
|
|
304
|
+
const flattenAccumulator = (accumulator, field) => {
|
|
305
|
+
if (isTabGroup(field)) {
|
|
306
|
+
if (field.hasGroupedValues) {
|
|
307
|
+
accumulator.push(field);
|
|
308
|
+
} else {
|
|
309
|
+
const flattenedTabs = field.fields.reduce((tabAccumulator, tab) => {
|
|
310
|
+
return tabAccumulator.concat(tab.hasGroupedValues ? tab : tab.fields.reduce(flattenAccumulator, []));
|
|
311
|
+
}, []);
|
|
312
|
+
accumulator.push(...flattenedTabs);
|
|
313
|
+
}
|
|
314
|
+
} else if (isExpand(field)) {
|
|
315
|
+
if (field.hasGroupedValues) {
|
|
316
|
+
accumulator.push(field);
|
|
317
|
+
} else {
|
|
318
|
+
const flattenedExpand = field.fields.reduce(flattenAccumulator, []);
|
|
319
|
+
accumulator.push(...flattenedExpand);
|
|
320
|
+
}
|
|
321
|
+
} else {
|
|
322
|
+
accumulator.push(field);
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
return accumulator;
|
|
326
|
+
};
|
|
327
|
+
|
|
328
|
+
return fields.reduce(flattenAccumulator, []);
|
|
329
|
+
};
|
|
146
330
|
|
|
147
331
|
export const deserialize = async (manifest, data, fields, depth = 0) => {
|
|
148
332
|
const dataArray = convertToParametersArray(data);
|
|
149
333
|
let result = [];
|
|
150
334
|
const errors = [];
|
|
335
|
+
const flattenedFields = flattenFields(fields);
|
|
151
336
|
|
|
152
337
|
for (const item of dataArray) {
|
|
153
338
|
const [name, originalValue] = Object.entries(item)[0];
|
|
154
|
-
const field =
|
|
339
|
+
const field = flattenedFields.find(field => field.name === getNameFromDuplicateField(name));
|
|
155
340
|
|
|
156
341
|
if (field === undefined) {
|
|
157
342
|
continue;
|
|
@@ -193,21 +378,7 @@ export const deserialize = async (manifest, data, fields, depth = 0) => {
|
|
|
193
378
|
result.errors = convertToParametersObject(errors);
|
|
194
379
|
}
|
|
195
380
|
|
|
196
|
-
return injectDefaultValues(result,
|
|
197
|
-
};
|
|
198
|
-
|
|
199
|
-
const doParametersContainDuplicateFields = parameters => {
|
|
200
|
-
const keyMap = new Set();
|
|
201
|
-
|
|
202
|
-
for (const param of parameters) {
|
|
203
|
-
const key = Object.keys(param)[0];
|
|
204
|
-
|
|
205
|
-
if (keyMap.has(key)) {
|
|
206
|
-
return true;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
keyMap.add(key);
|
|
210
|
-
}
|
|
381
|
+
return injectDefaultValues(result, flattenedFields);
|
|
211
382
|
};
|
|
212
383
|
|
|
213
384
|
const convertToParametersObject = (parameters = []) => {
|
|
@@ -8,7 +8,6 @@ export const fromEntries = iterable => {
|
|
|
8
8
|
return obj;
|
|
9
9
|
}, {});
|
|
10
10
|
};
|
|
11
|
-
export const toEntries = parameters => Array.isArray(parameters) ? parameters.reduce((prev, curr) => [...prev, ...Object.entries(curr)], []) : Object.entries(parameters);
|
|
12
11
|
|
|
13
12
|
const isEmptyString = value => typeof value === 'string' && value === '';
|
|
14
13
|
|
|
@@ -50,7 +49,7 @@ export const getSafeParentedName = (name, parentName) => {
|
|
|
50
49
|
const duplicateFieldRegex = /:[0-9]+$/;
|
|
51
50
|
export const isDuplicateField = key => duplicateFieldRegex.test(key);
|
|
52
51
|
export const getNameFromDuplicateField = key => key.replace(duplicateFieldRegex, '');
|
|
53
|
-
/*
|
|
52
|
+
/*
|
|
54
53
|
ColorPickerButton only accepts 8 digit hex alpha values, for example:
|
|
55
54
|
#123fffaa (8 digits, hex alpha)
|
|
56
55
|
*/
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { PureComponent } from 'react';
|
|
3
|
+
import { PureComponent } from 'react'; // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
4
|
+
|
|
4
5
|
import DropdownList from '@atlaskit/droplist';
|
|
5
6
|
import { Popup } from '@atlaskit/editor-common';
|
|
6
7
|
import withOuterListeners from '../with-outer-listeners';
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import React, { PureComponent } from 'react';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
|
-
|
|
3
|
+
import styled from 'styled-components'; // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
4
|
+
|
|
5
|
+
import DropList from '@atlaskit/droplist'; // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
6
|
+
|
|
5
7
|
import Item, { ItemGroup } from '@atlaskit/item';
|
|
6
8
|
import Tooltip from '@atlaskit/tooltip';
|
|
7
9
|
import { Popup } from '@atlaskit/editor-common';
|
|
@@ -84,6 +86,7 @@ export default class DropdownMenuWrapper extends PureComponent {
|
|
|
84
86
|
key: item.key || item.content,
|
|
85
87
|
isSelected: item.isActive
|
|
86
88
|
}, /*#__PURE__*/React.createElement(Item, {
|
|
89
|
+
role: "menuitem",
|
|
87
90
|
elemBefore: item.elemBefore,
|
|
88
91
|
elemAfter: item.elemAfter,
|
|
89
92
|
isDisabled: item.isDisabled,
|
|
@@ -154,7 +157,8 @@ export default class DropdownMenuWrapper extends PureComponent {
|
|
|
154
157
|
minWidth: fitWidth || 0
|
|
155
158
|
}
|
|
156
159
|
}), items.map((group, index) => /*#__PURE__*/React.createElement(ItemGroup, {
|
|
157
|
-
key: index
|
|
160
|
+
key: index,
|
|
161
|
+
role: "menu"
|
|
158
162
|
}, group.items.map(item => this.renderItem(item))))));
|
|
159
163
|
}
|
|
160
164
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useState, useCallback } from 'react';
|
|
2
2
|
import styled, { ThemeProvider } from 'styled-components';
|
|
3
|
+
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
3
4
|
import Item, { itemThemeNamespace } from '@atlaskit/item'; // AFP-2532 TODO: Fix automatic suppressions below
|
|
4
5
|
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
5
6
|
|
|
@@ -4,6 +4,7 @@ import memoizeOne from 'memoize-one';
|
|
|
4
4
|
import styled, { ThemeProvider, css } from 'styled-components';
|
|
5
5
|
import { AutoSizer } from 'react-virtualized/dist/commonjs/AutoSizer';
|
|
6
6
|
import { Collection } from 'react-virtualized/dist/commonjs/Collection';
|
|
7
|
+
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
7
8
|
import Item from '@atlaskit/item';
|
|
8
9
|
import { B100, N20, N200 } from '@atlaskit/theme/colors';
|
|
9
10
|
import Tooltip from '@atlaskit/tooltip';
|
|
@@ -4,7 +4,7 @@ import styled from 'styled-components'; // AFP-2532 TODO: Fix automatic suppress
|
|
|
4
4
|
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
5
5
|
|
|
6
6
|
import { fontSizeSmall } from '@atlaskit/theme';
|
|
7
|
-
import { N20,
|
|
7
|
+
import { N20, N300, N800 } from '@atlaskit/theme/colors';
|
|
8
8
|
import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
9
9
|
import formatDistance from 'date-fns/formatDistance';
|
|
10
10
|
import differenceInCalendarDays from 'date-fns/differenceInCalendarDays';
|
|
@@ -30,7 +30,7 @@ export const Name = styled.div`
|
|
|
30
30
|
line-height: 20px;
|
|
31
31
|
`;
|
|
32
32
|
export const ContainerName = styled.div`
|
|
33
|
-
color: ${
|
|
33
|
+
color: ${N300};
|
|
34
34
|
line-height: 14px;
|
|
35
35
|
font-size: ${relativeFontSizeToBase16(fontSizeSmall())};
|
|
36
36
|
`;
|
|
@@ -146,6 +146,7 @@ export default class Resizer extends React.Component {
|
|
|
146
146
|
render() {
|
|
147
147
|
const handleStyles = {};
|
|
148
148
|
const handles = {};
|
|
149
|
+
const handleComponent = {};
|
|
149
150
|
const {
|
|
150
151
|
innerPadding = 0,
|
|
151
152
|
width,
|
|
@@ -154,7 +155,8 @@ export default class Resizer extends React.Component {
|
|
|
154
155
|
layout,
|
|
155
156
|
enable,
|
|
156
157
|
children,
|
|
157
|
-
ratio
|
|
158
|
+
ratio,
|
|
159
|
+
handleComponentFunc
|
|
158
160
|
} = this.props;
|
|
159
161
|
const {
|
|
160
162
|
isResizing
|
|
@@ -167,6 +169,11 @@ export default class Resizer extends React.Component {
|
|
|
167
169
|
zIndex: akRichMediaResizeZIndex,
|
|
168
170
|
pointerEvents: 'auto'
|
|
169
171
|
};
|
|
172
|
+
const sideHandleComponent = handleComponentFunc && handleComponentFunc(side);
|
|
173
|
+
|
|
174
|
+
if (sideHandleComponent) {
|
|
175
|
+
handleComponent[side] = sideHandleComponent;
|
|
176
|
+
}
|
|
170
177
|
});
|
|
171
178
|
const className = classnames(richMediaClassName, `image-${layout}`, this.props.className, {
|
|
172
179
|
'is-resizing': isResizing,
|
|
@@ -199,6 +206,7 @@ export default class Resizer extends React.Component {
|
|
|
199
206
|
handleClasses: handles,
|
|
200
207
|
handleStyles: handleStyles,
|
|
201
208
|
handleWrapperStyle: handleWrapperStyle,
|
|
209
|
+
handleComponent: handleComponent,
|
|
202
210
|
enable: enable,
|
|
203
211
|
onResize: this.handleResize,
|
|
204
212
|
onResizeStop: this.handleResizeStop,
|
package/dist/es2019/version.json
CHANGED
|
@@ -510,8 +510,30 @@ var ReactEditorView = /*#__PURE__*/function (_React$Component) {
|
|
|
510
510
|
transformer: _this.contentTransformer
|
|
511
511
|
});
|
|
512
512
|
|
|
513
|
+
if (_this.props.editorProps.shouldFocus && view.props.editable && view.props.editable(view.state)) {
|
|
514
|
+
_this.focusTimeoutId = handleEditorFocus(view);
|
|
515
|
+
}
|
|
516
|
+
|
|
513
517
|
if (_this.featureFlags.ufo) {
|
|
518
|
+
_this.experienceStore = ExperienceStore.getInstance(view);
|
|
519
|
+
|
|
520
|
+
_this.experienceStore.start(EditorExperience.editSession);
|
|
521
|
+
|
|
522
|
+
_this.experienceStore.addMetadata(EditorExperience.editSession, {
|
|
523
|
+
reliabilityInterval: RELIABILITY_INTERVAL
|
|
524
|
+
});
|
|
525
|
+
|
|
514
526
|
_this.reliabilityInterval = window.setInterval(function () {
|
|
527
|
+
var _this$experienceStore11, _this$experienceStore12;
|
|
528
|
+
|
|
529
|
+
(_this$experienceStore11 = _this.experienceStore) === null || _this$experienceStore11 === void 0 ? void 0 : (_this$experienceStore12 = _this$experienceStore11.success(EditorExperience.editSession)) === null || _this$experienceStore12 === void 0 ? void 0 : _this$experienceStore12.finally(function () {
|
|
530
|
+
var _this$experienceStore13, _this$experienceStore14;
|
|
531
|
+
|
|
532
|
+
(_this$experienceStore13 = _this.experienceStore) === null || _this$experienceStore13 === void 0 ? void 0 : _this$experienceStore13.start(EditorExperience.editSession);
|
|
533
|
+
(_this$experienceStore14 = _this.experienceStore) === null || _this$experienceStore14 === void 0 ? void 0 : _this$experienceStore14.addMetadata(EditorExperience.editSession, {
|
|
534
|
+
reliabilityInterval: RELIABILITY_INTERVAL
|
|
535
|
+
});
|
|
536
|
+
});
|
|
515
537
|
var reliabilityEvent = {
|
|
516
538
|
action: ACTION.UFO_SESSION_COMPLETE,
|
|
517
539
|
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
@@ -523,14 +545,6 @@ var ReactEditorView = /*#__PURE__*/function (_React$Component) {
|
|
|
523
545
|
|
|
524
546
|
_this.dispatchAnalyticsEvent(reliabilityEvent);
|
|
525
547
|
}, RELIABILITY_INTERVAL);
|
|
526
|
-
}
|
|
527
|
-
|
|
528
|
-
if (_this.props.editorProps.shouldFocus && view.props.editable && view.props.editable(view.state)) {
|
|
529
|
-
_this.focusTimeoutId = handleEditorFocus(view);
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
if (_this.featureFlags.ufo) {
|
|
533
|
-
_this.experienceStore = ExperienceStore.getInstance(view);
|
|
534
548
|
} // Force React to re-render so consumers get a reference to the editor view
|
|
535
549
|
|
|
536
550
|
|
|
@@ -5,7 +5,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
5
5
|
|
|
6
6
|
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; }
|
|
7
7
|
|
|
8
|
-
import { breakoutPlugin, collabEditPlugin, dataConsumerMarkPlugin, datePlugin, emojiPlugin, extensionPlugin, helpDialogPlugin, imageUploadPlugin, insertBlockPlugin, jiraIssuePlugin, layoutPlugin, listPlugin, macroPlugin, maxContentSizePlugin, mediaPlugin, mentionsPlugin, panelPlugin, placeholderTextPlugin, rulePlugin, saveOnEnterPlugin, tablesPlugin, tasksAndDecisionsPlugin, textColorPlugin, cardPlugin, gridPlugin, statusPlugin, alignmentPlugin, indentationPlugin, analyticsPlugin, customAutoformatPlugin, feedbackDialogPlugin, historyPlugin, expandPlugin, isExpandInsertionEnabled, scrollIntoViewPlugin, mobileDimensionsPlugin, findReplacePlugin, contextPanelPlugin, mobileSelectionPlugin, annotationPlugin, captionPlugin, avatarGroupPlugin, viewUpdateSubscriptionPlugin, codeBidiWarningPlugin } from '../plugins';
|
|
8
|
+
import { breakoutPlugin, collabEditPlugin, dataConsumerMarkPlugin, datePlugin, emojiPlugin, extensionPlugin, fragmentMarkPlugin, helpDialogPlugin, imageUploadPlugin, insertBlockPlugin, jiraIssuePlugin, layoutPlugin, listPlugin, macroPlugin, maxContentSizePlugin, mediaPlugin, mentionsPlugin, panelPlugin, placeholderTextPlugin, rulePlugin, saveOnEnterPlugin, tablesPlugin, tasksAndDecisionsPlugin, textColorPlugin, cardPlugin, gridPlugin, statusPlugin, alignmentPlugin, indentationPlugin, analyticsPlugin, customAutoformatPlugin, feedbackDialogPlugin, historyPlugin, expandPlugin, isExpandInsertionEnabled, scrollIntoViewPlugin, mobileDimensionsPlugin, findReplacePlugin, contextPanelPlugin, mobileSelectionPlugin, annotationPlugin, captionPlugin, avatarGroupPlugin, viewUpdateSubscriptionPlugin, beforePrimaryToolbarPlugin, codeBidiWarningPlugin } from '../plugins';
|
|
9
9
|
import { isFullPage as fullPageCheck } from '../utils/is-full-page';
|
|
10
10
|
import { GUTTER_SIZE_MOBILE_IN_PX } from '../plugins/base/pm-plugins/scroll-gutter';
|
|
11
11
|
import { createFeatureFlagsFromProps } from '../plugins/feature-flags-context/feature-flags-from-props';
|
|
@@ -96,7 +96,8 @@ export function getDefaultPresetOptionsFromEditorProps(props, createAnalyticsEve
|
|
|
96
96
|
},
|
|
97
97
|
cardOptions: props.smartLinks || props.UNSAFE_cards,
|
|
98
98
|
codeBlock: _objectSpread(_objectSpread({}, props.codeBlock), {}, {
|
|
99
|
-
useLongPressSelection: false
|
|
99
|
+
useLongPressSelection: false,
|
|
100
|
+
appearance: props.appearance
|
|
100
101
|
})
|
|
101
102
|
};
|
|
102
103
|
}
|
|
@@ -108,8 +109,6 @@ export function getDefaultPresetOptionsFromEditorProps(props, createAnalyticsEve
|
|
|
108
109
|
*/
|
|
109
110
|
|
|
110
111
|
export default function createPluginsList(props, prevProps, createAnalyticsEvent) {
|
|
111
|
-
var _props$featureFlags;
|
|
112
|
-
|
|
113
112
|
var appearance = props.appearance;
|
|
114
113
|
var isMobile = appearance === 'mobile';
|
|
115
114
|
var isComment = appearance === 'comment';
|
|
@@ -277,8 +276,8 @@ export default function createPluginsList(props, prevProps, createAnalyticsEvent
|
|
|
277
276
|
if (props.allowPanel) {
|
|
278
277
|
preset.add([panelPlugin, {
|
|
279
278
|
useLongPressSelection: false,
|
|
280
|
-
|
|
281
|
-
|
|
279
|
+
allowCustomPanel: props.allowPanel.allowCustomPanel,
|
|
280
|
+
allowCustomPanelEdit: props.allowPanel.allowCustomPanelEdit
|
|
282
281
|
}]);
|
|
283
282
|
}
|
|
284
283
|
|
|
@@ -375,26 +374,46 @@ export default function createPluginsList(props, prevProps, createAnalyticsEvent
|
|
|
375
374
|
replacePlusMenuWithElementBrowser: props.elementBrowser && props.elementBrowser.replacePlusMenu || false
|
|
376
375
|
}]);
|
|
377
376
|
|
|
378
|
-
|
|
377
|
+
var hasBeforePrimaryToolbar = function hasBeforePrimaryToolbar(components) {
|
|
378
|
+
if (components && 'before' in components) {
|
|
379
|
+
return !!components.before;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
return false;
|
|
383
|
+
};
|
|
384
|
+
|
|
385
|
+
if (hasBeforePrimaryToolbar(props.primaryToolbarComponents) && !featureFlags.twoLineEditorToolbar) {
|
|
386
|
+
preset.add([beforePrimaryToolbarPlugin, {
|
|
387
|
+
beforePrimaryToolbarComponents: props.primaryToolbarComponents.before
|
|
388
|
+
}]);
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
if (featureFlags.showAvatarGroupAsPlugin === true && !featureFlags.twoLineEditorToolbar) {
|
|
379
392
|
preset.add([avatarGroupPlugin, {
|
|
380
|
-
collabEdit: props.collabEdit
|
|
393
|
+
collabEdit: props.collabEdit,
|
|
394
|
+
takeFullWidth: !hasBeforePrimaryToolbar(props.primaryToolbarComponents)
|
|
381
395
|
}]);
|
|
382
396
|
}
|
|
383
397
|
|
|
384
398
|
if (props.allowFindReplace) {
|
|
385
|
-
var _props$featureFlags2;
|
|
386
|
-
|
|
387
399
|
preset.add([findReplacePlugin, {
|
|
388
|
-
takeFullWidth: !!
|
|
400
|
+
takeFullWidth: !!featureFlags.showAvatarGroupAsPlugin === false && !hasBeforePrimaryToolbar(props.primaryToolbarComponents),
|
|
401
|
+
twoLineEditorToolbar: !!featureFlags.twoLineEditorToolbar
|
|
389
402
|
}]);
|
|
390
403
|
}
|
|
391
404
|
|
|
405
|
+
if (props.UNSAFE_allowFragmentMark) {
|
|
406
|
+
preset.add(fragmentMarkPlugin);
|
|
407
|
+
}
|
|
408
|
+
|
|
392
409
|
if (featureFlags.enableViewUpdateSubscription) {
|
|
393
410
|
preset.add([viewUpdateSubscriptionPlugin]);
|
|
394
411
|
}
|
|
395
412
|
|
|
396
413
|
if (featureFlags.codeBidiWarnings) {
|
|
397
|
-
preset.add(codeBidiWarningPlugin
|
|
414
|
+
preset.add([codeBidiWarningPlugin, {
|
|
415
|
+
appearance: props.appearance
|
|
416
|
+
}]);
|
|
398
417
|
}
|
|
399
418
|
|
|
400
419
|
var excludes = new Set();
|