@atlaskit/editor-core 151.1.2 → 151.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/dist/cjs/create-editor/ReactEditorView.js +22 -8
- package/dist/cjs/create-editor/create-plugins-list.js +30 -11
- package/dist/cjs/labs/next/presets/cxhtml.js +1 -2
- package/dist/cjs/labs/next/presets/default.js +3 -1
- package/dist/cjs/nodeviews/ReactNodeView.js +2 -2
- package/dist/cjs/nodeviews/SelectionBasedNodeView.js +6 -0
- package/dist/cjs/plugins/analytics/types/enums.js +1 -0
- package/dist/cjs/plugins/annotation/utils.js +19 -8
- package/dist/cjs/plugins/avatar-group/index.js +2 -1
- package/dist/cjs/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +5 -2
- package/dist/cjs/plugins/before-primaryToolbar/index.js +26 -0
- package/dist/cjs/plugins/before-primaryToolbar/ui/BeforePrimaryToolbarWrapper.js +28 -0
- package/dist/cjs/plugins/code-bidi-warning/index.js +5 -2
- package/dist/cjs/plugins/code-bidi-warning/pm-plugins/main.js +12 -3
- package/dist/cjs/plugins/code-bidi-warning/pm-plugins/plugin-factory.js +15 -5
- package/dist/cjs/plugins/code-block/index.js +3 -3
- package/dist/cjs/plugins/code-block/nodeviews/highlighting-code-block.js +6 -3
- package/dist/cjs/plugins/code-block/pm-plugins/main.js +11 -3
- package/dist/cjs/plugins/extension/extension-api.js +10 -2
- package/dist/cjs/plugins/extension/ui/styles.js +1 -1
- package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +4 -2
- package/dist/cjs/plugins/find-replace/FindReplaceToolbarButtonWithState.js +172 -0
- package/dist/cjs/plugins/find-replace/index.js +14 -137
- package/dist/cjs/plugins/find-replace/ui/Find.js +16 -9
- package/dist/cjs/plugins/find-replace/ui/FindReplace.js +9 -2
- package/dist/cjs/plugins/find-replace/ui/Replace.js +11 -3
- package/dist/cjs/plugins/find-replace/ui/styles.js +44 -35
- package/dist/cjs/plugins/floating-toolbar/ui/EmojiPickerButton.js +10 -4
- package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +1 -1
- package/dist/cjs/plugins/fragment/index.js +34 -0
- package/dist/cjs/plugins/fragment/plugin-key.js +11 -0
- package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +1 -1
- package/dist/cjs/plugins/index.js +16 -0
- package/dist/cjs/plugins/list/actions/conversions.js +39 -71
- package/dist/cjs/plugins/list/transforms.js +7 -1
- package/dist/cjs/plugins/media/index.js +2 -3
- package/dist/cjs/plugins/media/nodeviews/mediaGroup.js +3 -1
- package/dist/cjs/plugins/media/nodeviews/mediaInline.js +12 -5
- package/dist/cjs/plugins/media/nodeviews/mediaNodeUpdater.js +3 -3
- package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +6 -4
- package/dist/cjs/plugins/media/nodeviews/styles.js +6 -1
- package/dist/cjs/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +5 -1
- package/dist/cjs/plugins/media/pm-plugins/main.js +49 -15
- package/dist/cjs/plugins/media/toolbar/commands.js +59 -0
- package/dist/cjs/plugins/media/toolbar/filePreviewItem.js +7 -2
- package/dist/cjs/plugins/media/toolbar/index.js +90 -3
- package/dist/cjs/plugins/media/ui/ResizableMediaSingle/index.js +9 -1
- package/dist/cjs/plugins/media/utils/media-common.js +1 -1
- package/dist/cjs/plugins/media/utils/media-files.js +5 -1
- package/dist/cjs/plugins/panel/actions.js +2 -2
- package/dist/cjs/plugins/panel/index.js +3 -3
- package/dist/cjs/plugins/panel/nodeviews/panel.js +2 -2
- package/dist/cjs/plugins/panel/toolbar.js +10 -5
- package/dist/cjs/plugins/panel/utils.js +15 -0
- package/dist/cjs/plugins/rank.js +3 -2
- package/dist/cjs/plugins/selection/pm-plugins/selection-main.js +49 -1
- package/dist/cjs/plugins/status/ui/statusPicker.js +4 -2
- package/dist/cjs/plugins/table/commands/insert.js +1 -0
- package/dist/cjs/plugins/table/index.js +3 -2
- package/dist/cjs/plugins/table/nodeviews/OverflowShadowsObserver.js +1 -3
- package/dist/cjs/plugins/table/pm-plugins/main.js +26 -3
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +2 -2
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +2 -0
- package/dist/cjs/plugins/table/transforms/column-width.js +14 -5
- package/dist/cjs/plugins/table/transforms/fix-tables.js +43 -6
- package/dist/cjs/plugins/table/ui/FloatingContextualButton/index.js +3 -2
- package/dist/cjs/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +1 -0
- package/dist/cjs/plugins/table/ui/common-styles.css.js +1 -1
- package/dist/cjs/plugins/table/ui/consts.js +1 -1
- package/dist/cjs/plugins/table/ui/messages.js +1 -1
- package/dist/cjs/plugins/tasks-and-decisions/nodeviews/decisionItem.js +1 -1
- package/dist/cjs/plugins/tasks-and-decisions/nodeviews/taskItem.js +1 -1
- package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/main.js +2 -2
- package/dist/cjs/plugins/text-color/ui/ToolbarTextColor/index.js +2 -1
- package/dist/cjs/plugins/text-formatting/index.js +2 -1
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadList.js +1 -0
- package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +77 -26
- package/dist/cjs/ui/Appearance/FullPage/MainToolbar.js +32 -9
- package/dist/cjs/ui/ColorPalette/Color/index.js +8 -18
- package/dist/cjs/ui/ColorPalette/index.js +7 -4
- package/dist/cjs/ui/ColorPickerButton/index.js +1 -1
- package/dist/cjs/ui/ConfigPanel/ConfigPanel.js +114 -61
- package/dist/cjs/ui/ConfigPanel/FormContent.js +39 -26
- package/dist/cjs/ui/ConfigPanel/transformers.js +490 -248
- package/dist/cjs/ui/ConfigPanel/utils.js +2 -10
- package/dist/cjs/ui/DropdownMenu/index.js +3 -1
- package/dist/cjs/ui/LinkSearch/LinkSearchListItem.js +1 -1
- package/dist/cjs/ui/Resizer/index.js +9 -1
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/create-editor/ReactEditorView.js +19 -8
- package/dist/es2019/create-editor/create-plugins-list.js +31 -12
- package/dist/es2019/labs/next/presets/cxhtml.js +1 -2
- package/dist/es2019/labs/next/presets/default.js +3 -1
- package/dist/es2019/nodeviews/ReactNodeView.js +1 -1
- package/dist/es2019/nodeviews/SelectionBasedNodeView.js +11 -0
- package/dist/es2019/plugins/analytics/types/enums.js +1 -0
- package/dist/es2019/plugins/annotation/utils.js +18 -7
- package/dist/es2019/plugins/avatar-group/index.js +2 -1
- package/dist/es2019/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +3 -2
- package/dist/es2019/plugins/before-primaryToolbar/index.js +15 -0
- package/dist/es2019/plugins/before-primaryToolbar/ui/BeforePrimaryToolbarWrapper.js +12 -0
- package/dist/es2019/plugins/code-bidi-warning/index.js +8 -2
- package/dist/es2019/plugins/code-bidi-warning/pm-plugins/main.js +12 -2
- package/dist/es2019/plugins/code-bidi-warning/pm-plugins/plugin-factory.js +16 -5
- package/dist/es2019/plugins/code-block/index.js +3 -2
- package/dist/es2019/plugins/code-block/nodeviews/highlighting-code-block.js +6 -3
- package/dist/es2019/plugins/code-block/pm-plugins/main.js +11 -3
- package/dist/es2019/plugins/extension/extension-api.js +9 -2
- package/dist/es2019/plugins/extension/ui/styles.js +6 -0
- package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +4 -2
- package/dist/es2019/plugins/find-replace/FindReplaceToolbarButtonWithState.js +152 -0
- package/dist/es2019/plugins/find-replace/index.js +15 -128
- package/dist/es2019/plugins/find-replace/ui/Find.js +18 -10
- package/dist/es2019/plugins/find-replace/ui/FindReplace.js +11 -3
- package/dist/es2019/plugins/find-replace/ui/Replace.js +12 -4
- package/dist/es2019/plugins/find-replace/ui/styles.js +37 -47
- package/dist/es2019/plugins/floating-toolbar/ui/DropdownMenu.js +2 -1
- package/dist/es2019/plugins/floating-toolbar/ui/EmojiPickerButton.js +10 -2
- package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +1 -1
- package/dist/es2019/plugins/fragment/index.js +22 -0
- package/dist/es2019/plugins/fragment/plugin-key.js +2 -0
- package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +2 -2
- package/dist/es2019/plugins/index.js +2 -0
- package/dist/es2019/plugins/list/actions/conversions.js +38 -69
- package/dist/es2019/plugins/list/transforms.js +5 -1
- package/dist/es2019/plugins/media/index.js +2 -2
- package/dist/es2019/plugins/media/nodeviews/mediaGroup.js +2 -1
- package/dist/es2019/plugins/media/nodeviews/mediaInline.js +8 -4
- package/dist/es2019/plugins/media/nodeviews/mediaNodeUpdater.js +3 -3
- package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +7 -5
- package/dist/es2019/plugins/media/nodeviews/styles.js +2 -0
- package/dist/es2019/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +5 -1
- package/dist/es2019/plugins/media/pm-plugins/main.js +32 -17
- package/dist/es2019/plugins/media/toolbar/commands.js +47 -0
- package/dist/es2019/plugins/media/toolbar/filePreviewItem.js +6 -2
- package/dist/es2019/plugins/media/toolbar/index.js +90 -3
- package/dist/es2019/plugins/media/ui/ResizableMediaSingle/index.js +7 -1
- package/dist/es2019/plugins/media/utils/media-common.js +1 -1
- package/dist/es2019/plugins/media/utils/media-files.js +6 -1
- package/dist/es2019/plugins/panel/actions.js +2 -2
- package/dist/es2019/plugins/panel/index.js +5 -5
- package/dist/es2019/plugins/panel/nodeviews/panel.js +2 -2
- package/dist/es2019/plugins/panel/toolbar.js +10 -5
- package/dist/es2019/plugins/panel/utils.js +8 -1
- package/dist/es2019/plugins/rank.js +3 -2
- package/dist/es2019/plugins/selection/pm-plugins/selection-main.js +48 -1
- package/dist/es2019/plugins/status/ui/statusPicker.js +4 -2
- package/dist/es2019/plugins/table/commands/insert.js +1 -2
- package/dist/es2019/plugins/table/index.js +2 -1
- package/dist/es2019/plugins/table/nodeviews/OverflowShadowsObserver.js +1 -2
- package/dist/es2019/plugins/table/pm-plugins/main.js +25 -4
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +2 -2
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +2 -0
- package/dist/es2019/plugins/table/transforms/column-width.js +13 -3
- package/dist/es2019/plugins/table/transforms/fix-tables.js +43 -5
- package/dist/es2019/plugins/table/ui/FloatingContextualButton/index.js +3 -2
- package/dist/es2019/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +1 -0
- package/dist/es2019/plugins/table/ui/common-styles.css.js +5 -1
- package/dist/es2019/plugins/table/ui/consts.js +2 -2
- package/dist/es2019/plugins/table/ui/messages.js +1 -1
- package/dist/es2019/plugins/tasks-and-decisions/nodeviews/decisionItem.js +1 -1
- package/dist/es2019/plugins/tasks-and-decisions/nodeviews/taskItem.js +1 -1
- package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/main.js +3 -3
- package/dist/es2019/plugins/text-color/ui/ToolbarTextColor/index.js +2 -1
- package/dist/es2019/plugins/text-formatting/index.js +3 -2
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadList.js +2 -1
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadListItem.js +2 -1
- package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +60 -27
- package/dist/es2019/ui/Appearance/FullPage/MainToolbar.js +51 -7
- package/dist/es2019/ui/ColorPalette/Color/index.js +9 -18
- package/dist/es2019/ui/ColorPalette/index.js +7 -4
- package/dist/es2019/ui/ColorPickerButton/index.js +1 -1
- package/dist/es2019/ui/ConfigPanel/ConfigPanel.js +101 -49
- package/dist/es2019/ui/ConfigPanel/FormContent.js +35 -26
- package/dist/es2019/ui/ConfigPanel/transformers.js +243 -72
- package/dist/es2019/ui/ConfigPanel/utils.js +1 -2
- package/dist/es2019/ui/Dropdown/index.js +2 -1
- package/dist/es2019/ui/DropdownMenu/index.js +7 -3
- package/dist/es2019/ui/ElementBrowser/InsertMenu.js +1 -0
- package/dist/es2019/ui/ElementBrowser/components/ElementList/ElementList.js +1 -0
- package/dist/es2019/ui/LinkSearch/LinkSearchListItem.js +2 -2
- package/dist/es2019/ui/Resizer/index.js +9 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/create-editor/ReactEditorView.js +22 -8
- package/dist/esm/create-editor/create-plugins-list.js +31 -12
- package/dist/esm/labs/next/presets/cxhtml.js +1 -2
- package/dist/esm/labs/next/presets/default.js +3 -1
- package/dist/esm/nodeviews/ReactNodeView.js +2 -2
- package/dist/esm/nodeviews/SelectionBasedNodeView.js +7 -0
- package/dist/esm/plugins/analytics/types/enums.js +1 -0
- package/dist/esm/plugins/annotation/utils.js +18 -7
- package/dist/esm/plugins/avatar-group/index.js +2 -1
- package/dist/esm/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +5 -2
- package/dist/esm/plugins/before-primaryToolbar/index.js +15 -0
- package/dist/esm/plugins/before-primaryToolbar/ui/BeforePrimaryToolbarWrapper.js +12 -0
- package/dist/esm/plugins/code-bidi-warning/index.js +5 -2
- package/dist/esm/plugins/code-bidi-warning/pm-plugins/main.js +12 -3
- package/dist/esm/plugins/code-bidi-warning/pm-plugins/plugin-factory.js +15 -5
- package/dist/esm/plugins/code-block/index.js +3 -3
- package/dist/esm/plugins/code-block/nodeviews/highlighting-code-block.js +6 -3
- package/dist/esm/plugins/code-block/pm-plugins/main.js +11 -3
- package/dist/esm/plugins/extension/extension-api.js +9 -2
- package/dist/esm/plugins/extension/ui/styles.js +1 -1
- package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +4 -2
- package/dist/esm/plugins/find-replace/FindReplaceToolbarButtonWithState.js +155 -0
- package/dist/esm/plugins/find-replace/index.js +14 -131
- package/dist/esm/plugins/find-replace/ui/Find.js +17 -10
- package/dist/esm/plugins/find-replace/ui/FindReplace.js +10 -3
- package/dist/esm/plugins/find-replace/ui/Replace.js +11 -4
- package/dist/esm/plugins/find-replace/ui/styles.js +39 -18
- package/dist/esm/plugins/floating-toolbar/ui/DropdownMenu.js +2 -1
- package/dist/esm/plugins/floating-toolbar/ui/EmojiPickerButton.js +9 -4
- package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +1 -1
- package/dist/esm/plugins/fragment/index.js +22 -0
- package/dist/esm/plugins/fragment/plugin-key.js +2 -0
- package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +2 -2
- package/dist/esm/plugins/index.js +2 -0
- package/dist/esm/plugins/list/actions/conversions.js +38 -71
- package/dist/esm/plugins/list/transforms.js +7 -1
- package/dist/esm/plugins/media/index.js +2 -3
- package/dist/esm/plugins/media/nodeviews/mediaGroup.js +2 -1
- package/dist/esm/plugins/media/nodeviews/mediaInline.js +11 -6
- package/dist/esm/plugins/media/nodeviews/mediaNodeUpdater.js +3 -3
- package/dist/esm/plugins/media/nodeviews/mediaSingle.js +7 -5
- package/dist/esm/plugins/media/nodeviews/styles.js +2 -0
- package/dist/esm/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +5 -1
- package/dist/esm/plugins/media/pm-plugins/main.js +47 -16
- package/dist/esm/plugins/media/toolbar/commands.js +45 -0
- package/dist/esm/plugins/media/toolbar/filePreviewItem.js +6 -2
- package/dist/esm/plugins/media/toolbar/index.js +88 -3
- package/dist/esm/plugins/media/ui/ResizableMediaSingle/index.js +9 -1
- package/dist/esm/plugins/media/utils/media-common.js +1 -1
- package/dist/esm/plugins/media/utils/media-files.js +6 -1
- package/dist/esm/plugins/panel/actions.js +2 -2
- package/dist/esm/plugins/panel/index.js +5 -5
- package/dist/esm/plugins/panel/nodeviews/panel.js +2 -2
- package/dist/esm/plugins/panel/toolbar.js +9 -4
- package/dist/esm/plugins/panel/utils.js +13 -0
- package/dist/esm/plugins/rank.js +3 -2
- package/dist/esm/plugins/selection/pm-plugins/selection-main.js +50 -1
- package/dist/esm/plugins/status/ui/statusPicker.js +4 -2
- package/dist/esm/plugins/table/commands/insert.js +1 -2
- package/dist/esm/plugins/table/index.js +3 -2
- package/dist/esm/plugins/table/nodeviews/OverflowShadowsObserver.js +1 -2
- package/dist/esm/plugins/table/pm-plugins/main.js +27 -4
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +2 -2
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +2 -0
- package/dist/esm/plugins/table/transforms/column-width.js +13 -3
- package/dist/esm/plugins/table/transforms/fix-tables.js +42 -4
- package/dist/esm/plugins/table/ui/FloatingContextualButton/index.js +3 -2
- package/dist/esm/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +1 -0
- package/dist/esm/plugins/table/ui/common-styles.css.js +1 -1
- package/dist/esm/plugins/table/ui/consts.js +2 -2
- package/dist/esm/plugins/table/ui/messages.js +1 -1
- package/dist/esm/plugins/tasks-and-decisions/nodeviews/decisionItem.js +1 -1
- package/dist/esm/plugins/tasks-and-decisions/nodeviews/taskItem.js +1 -1
- package/dist/esm/plugins/tasks-and-decisions/pm-plugins/main.js +3 -3
- package/dist/esm/plugins/text-color/ui/ToolbarTextColor/index.js +2 -1
- package/dist/esm/plugins/text-formatting/index.js +3 -2
- package/dist/esm/plugins/type-ahead/ui/TypeAheadList.js +2 -1
- package/dist/esm/plugins/type-ahead/ui/TypeAheadListItem.js +2 -1
- package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +67 -27
- package/dist/esm/ui/Appearance/FullPage/MainToolbar.js +20 -7
- package/dist/esm/ui/ColorPalette/Color/index.js +9 -16
- package/dist/esm/ui/ColorPalette/index.js +7 -4
- package/dist/esm/ui/ColorPickerButton/index.js +1 -1
- package/dist/esm/ui/ConfigPanel/ConfigPanel.js +113 -62
- package/dist/esm/ui/ConfigPanel/FormContent.js +39 -26
- package/dist/esm/ui/ConfigPanel/transformers.js +488 -248
- package/dist/esm/ui/ConfigPanel/utils.js +1 -6
- package/dist/esm/ui/Dropdown/index.js +2 -1
- package/dist/esm/ui/DropdownMenu/index.js +7 -3
- package/dist/esm/ui/ElementBrowser/InsertMenu.js +1 -0
- package/dist/esm/ui/ElementBrowser/components/ElementList/ElementList.js +1 -0
- package/dist/esm/ui/LinkSearch/LinkSearchListItem.js +2 -2
- package/dist/esm/ui/Resizer/index.js +9 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/labs/next/full-page.d.ts +1 -1
- package/dist/types/nodeviews/ReactNodeView.d.ts +1 -1
- package/dist/types/nodeviews/SelectionBasedNodeView.d.ts +1 -0
- package/dist/types/plugins/analytics/types/enums.d.ts +1 -0
- package/dist/types/plugins/analytics/types/events.d.ts +7 -1
- package/dist/types/plugins/annotation/utils.d.ts +1 -1
- package/dist/types/plugins/avatar-group/index.d.ts +1 -0
- package/dist/types/plugins/avatar-group/ui/AvatarGroupPluginWrapper.d.ts +1 -0
- package/dist/types/plugins/before-primaryToolbar/index.d.ts +5 -0
- package/dist/types/plugins/before-primaryToolbar/ui/BeforePrimaryToolbarWrapper.d.ts +5 -0
- package/dist/types/plugins/code-bidi-warning/index.d.ts +4 -2
- package/dist/types/plugins/code-bidi-warning/pm-plugins/main.d.ts +4 -2
- package/dist/types/plugins/code-bidi-warning/pm-plugins/plugin-factory.d.ts +2 -1
- package/dist/types/plugins/code-bidi-warning/pm-plugins/types.d.ts +1 -0
- package/dist/types/plugins/code-block/index.d.ts +1 -1
- package/dist/types/plugins/code-block/nodeviews/highlighting-code-block.d.ts +12 -1
- package/dist/types/plugins/code-block/pm-plugins/main.d.ts +3 -1
- package/dist/types/plugins/code-block/types.d.ts +2 -0
- package/dist/types/plugins/feature-flags-context/get-enabled-feature-flag-keys.d.ts +1 -1
- package/dist/types/plugins/find-replace/FindReplaceToolbarButtonWithState.d.ts +15 -0
- package/dist/types/plugins/find-replace/index.d.ts +1 -0
- package/dist/types/plugins/find-replace/ui/Find.d.ts +1 -0
- package/dist/types/plugins/find-replace/ui/FindReplace.d.ts +1 -0
- package/dist/types/plugins/find-replace/ui/Replace.d.ts +1 -0
- package/dist/types/plugins/find-replace/ui/styles.d.ts +5 -14
- package/dist/types/plugins/floating-toolbar/ui/EmojiPickerButton.d.ts +1 -1
- package/dist/types/plugins/fragment/index.d.ts +5 -0
- package/dist/types/plugins/fragment/plugin-key.d.ts +2 -0
- package/dist/types/plugins/index.d.ts +2 -0
- package/dist/types/plugins/media/nodeviews/mediaInline.d.ts +3 -2
- package/dist/types/plugins/media/nodeviews/mediaNodeUpdater.d.ts +2 -2
- package/dist/types/plugins/media/nodeviews/mediaSingle.d.ts +1 -1
- package/dist/types/plugins/media/nodeviews/styles.d.ts +2 -0
- package/dist/types/plugins/media/toolbar/commands.d.ts +3 -0
- package/dist/types/plugins/media/toolbar/filePreviewItem.d.ts +2 -0
- package/dist/types/plugins/media/types.d.ts +0 -1
- package/dist/types/plugins/panel/actions.d.ts +1 -1
- package/dist/types/plugins/panel/types.d.ts +8 -2
- package/dist/types/plugins/quick-insert/index.d.ts +2 -1
- package/dist/types/plugins/table/commands/insert.d.ts +3 -0
- package/dist/types/plugins/table/pm-plugins/main.d.ts +2 -1
- package/dist/types/plugins/table/pm-plugins/table-resizing/utils/types.d.ts +1 -0
- package/dist/types/plugins/table/transforms/column-width.d.ts +4 -1
- package/dist/types/plugins/table/transforms/fix-tables.d.ts +3 -2
- package/dist/types/plugins/table/types.d.ts +8 -0
- package/dist/types/plugins/table/ui/consts.d.ts +1 -1
- package/dist/types/types/editor-appearance-component.d.ts +2 -2
- package/dist/types/types/editor-props.d.ts +11 -1
- package/dist/types/types/feature-flags.d.ts +13 -0
- package/dist/types/types/index.d.ts +1 -1
- package/dist/types/ui/Appearance/FullPage/FullPageToolbar.d.ts +2 -2
- package/dist/types/ui/Appearance/FullPage/MainToolbar.d.ts +10 -1
- package/dist/types/ui/ColorPalette/Color/index.d.ts +8 -5
- package/dist/types/ui/ColorPalette/index.d.ts +1 -0
- package/dist/types/ui/ConfigPanel/transformers.d.ts +7 -1
- package/dist/types/ui/ConfigPanel/utils.d.ts +0 -1
- package/dist/types/ui/Resizer/index.d.ts +1 -0
- package/package.json +14 -10
- package/dist/cjs/plugins/floating-toolbar/ui/EditorRemoveEmojiIcon.js +0 -38
- package/dist/es2019/plugins/floating-toolbar/ui/EditorRemoveEmojiIcon.js +0 -28
- package/dist/esm/plugins/floating-toolbar/ui/EditorRemoveEmojiIcon.js +0 -28
- package/dist/types/plugins/floating-toolbar/ui/EditorRemoveEmojiIcon.d.ts +0 -1
|
@@ -6,7 +6,7 @@ import { browser } from '@atlaskit/editor-common';
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
export function createFeatureFlagsFromProps(props) {
|
|
9
|
-
var _props$allowTextColor, _props$performanceTra, _props$performanceTra2, _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$allowTables, _props$featureFlags4, _props$featureFlags5, _props$allowTables2, _props$featureFlags6, _props$featureFlags7, _props$allowTables3, _props$featureFlags8, _props$featureFlags9, _props$allowTables4, _props$featureFlags10, _props$featureFlags11, _props$allowTables5, _props$allowExtension, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23, _props$featureFlags24, _props$featureFlags25, _props$featureFlags26, _props$featureFlags27, _props$featureFlags28, _props$featureFlags29;
|
|
9
|
+
var _props$allowTextColor, _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$allowTables, _props$featureFlags4, _props$featureFlags5, _props$allowTables2, _props$featureFlags6, _props$featureFlags7, _props$allowTables3, _props$featureFlags8, _props$featureFlags9, _props$allowTables4, _props$featureFlags10, _props$featureFlags11, _props$allowTables5, _props$allowExtension, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23, _props$featureFlags24, _props$featureFlags25, _props$featureFlags26, _props$featureFlags27, _props$featureFlags28, _props$featureFlags29, _props$featureFlags30, _props$featureFlags31;
|
|
10
10
|
|
|
11
11
|
const normalizedFeatureFlags = normalizeFeatureFlags(props.featureFlags);
|
|
12
12
|
return { ...normalizedFeatureFlags,
|
|
@@ -19,6 +19,7 @@ export function createFeatureFlagsFromProps(props) {
|
|
|
19
19
|
findReplaceMatchCase: typeof props.allowFindReplace === 'object' && Boolean(props.allowFindReplace.allowMatchCase),
|
|
20
20
|
keyboardAccessibleDatepicker: typeof props.allowKeyboardAccessibleDatepicker === 'boolean' ? props.allowKeyboardAccessibleDatepicker : false,
|
|
21
21
|
addColumnWithCustomStep: !props.allowTables || typeof props.allowTables === 'boolean' ? false : Boolean(props.allowTables.allowAddColumnWithCustomStep),
|
|
22
|
+
singleLayout: typeof props.allowLayouts === 'object' && !!((_props$allowLayouts = props.allowLayouts) !== null && _props$allowLayouts !== void 0 && _props$allowLayouts.UNSAFE_allowSingleColumnLayout),
|
|
22
23
|
undoRedoButtons: props.UNSAFE_allowUndoRedoButtons,
|
|
23
24
|
catchAllTracking: (_props$performanceTra = props.performanceTracking) === null || _props$performanceTra === void 0 ? void 0 : (_props$performanceTra2 = _props$performanceTra.catchAllTracking) === null || _props$performanceTra2 === void 0 ? void 0 : _props$performanceTra2.enabled,
|
|
24
25
|
nextEmojiNodeView: ((_props$featureFlags = props.featureFlags) === null || _props$featureFlags === void 0 ? void 0 : _props$featureFlags.nextEmojiNodeView) === true,
|
|
@@ -37,6 +38,7 @@ export function createFeatureFlagsFromProps(props) {
|
|
|
37
38
|
collabAvatarScroll: Boolean(typeof ((_props$featureFlags24 = props.featureFlags) === null || _props$featureFlags24 === void 0 ? void 0 : _props$featureFlags24.collabAvatarScroll) === 'boolean' ? !!((_props$featureFlags25 = props.featureFlags) !== null && _props$featureFlags25 !== void 0 && _props$featureFlags25.collabAvatarScroll) : false),
|
|
38
39
|
ufo: Boolean(typeof ((_props$featureFlags26 = props.featureFlags) === null || _props$featureFlags26 === void 0 ? void 0 : _props$featureFlags26.ufo) === 'boolean' ? !!((_props$featureFlags27 = props.featureFlags) !== null && _props$featureFlags27 !== void 0 && _props$featureFlags27.ufo) : false),
|
|
39
40
|
codeBlockSyntaxHighlighting: Boolean(typeof normalizedFeatureFlags.codeBlockSyntaxHighlighting === 'boolean' ? !!normalizedFeatureFlags.codeBlockSyntaxHighlighting && !browser.safari : false),
|
|
40
|
-
|
|
41
|
+
twoLineEditorToolbar: Boolean(typeof ((_props$featureFlags28 = props.featureFlags) === null || _props$featureFlags28 === void 0 ? void 0 : _props$featureFlags28.twoLineEditorToolbar) === 'boolean' ? !!((_props$featureFlags29 = props.featureFlags) !== null && _props$featureFlags29 !== void 0 && _props$featureFlags29.twoLineEditorToolbar) : false),
|
|
42
|
+
codeBidiWarnings: Boolean(typeof ((_props$featureFlags30 = props.featureFlags) === null || _props$featureFlags30 === void 0 ? void 0 : _props$featureFlags30.codeBidiWarnings) === 'boolean' ? !!((_props$featureFlags31 = props.featureFlags) !== null && _props$featureFlags31 !== void 0 && _props$featureFlags31.codeBidiWarnings) : true)
|
|
41
43
|
};
|
|
42
44
|
}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { findReplacePluginKey } from './types';
|
|
3
|
+
import WithPluginState from '../../ui/WithPluginState';
|
|
4
|
+
import { cancelSearchWithAnalytics, replaceWithAnalytics, replaceAllWithAnalytics, findWithAnalytics, findNextWithAnalytics, findPrevWithAnalytics, activateWithAnalytics } from './commands-with-analytics';
|
|
5
|
+
import { blur, toggleMatchCase } from './commands';
|
|
6
|
+
import FindReplaceToolbarButton from './ui/FindReplaceToolbarButton';
|
|
7
|
+
import { TRIGGER_METHOD } from '../analytics';
|
|
8
|
+
import { getFeatureFlags } from '../feature-flags-context';
|
|
9
|
+
|
|
10
|
+
const FindReplaceToolbarButtonWithState = props => {
|
|
11
|
+
const {
|
|
12
|
+
popupsBoundariesElement,
|
|
13
|
+
popupsMountPoint,
|
|
14
|
+
popupsScrollableElement,
|
|
15
|
+
isToolbarReducedSpacing,
|
|
16
|
+
editorView,
|
|
17
|
+
containerElement,
|
|
18
|
+
dispatchAnalyticsEvent
|
|
19
|
+
} = props;
|
|
20
|
+
|
|
21
|
+
if (!editorView) {
|
|
22
|
+
return null;
|
|
23
|
+
} // we need the editor to be in focus for scrollIntoView() to work
|
|
24
|
+
// so we focus it while we run the command, then put focus back into
|
|
25
|
+
// whatever element was previously focused in find replace component
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
const runWithEditorFocused = fn => {
|
|
29
|
+
const activeElement = document.activeElement;
|
|
30
|
+
editorView.focus();
|
|
31
|
+
fn();
|
|
32
|
+
activeElement === null || activeElement === void 0 ? void 0 : activeElement.focus();
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const dispatchCommand = cmd => {
|
|
36
|
+
const {
|
|
37
|
+
state,
|
|
38
|
+
dispatch
|
|
39
|
+
} = editorView;
|
|
40
|
+
cmd(state, dispatch);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const handleActivate = () => {
|
|
44
|
+
runWithEditorFocused(() => dispatchCommand(activateWithAnalytics({
|
|
45
|
+
triggerMethod: TRIGGER_METHOD.TOOLBAR
|
|
46
|
+
})));
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const handleFind = keyword => {
|
|
50
|
+
runWithEditorFocused(() => dispatchCommand(findWithAnalytics({
|
|
51
|
+
editorView,
|
|
52
|
+
containerElement,
|
|
53
|
+
keyword
|
|
54
|
+
})));
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const handleFindNext = ({
|
|
58
|
+
triggerMethod
|
|
59
|
+
}) => {
|
|
60
|
+
runWithEditorFocused(() => dispatchCommand(findNextWithAnalytics({
|
|
61
|
+
triggerMethod
|
|
62
|
+
})));
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const handleFindPrev = ({
|
|
66
|
+
triggerMethod
|
|
67
|
+
}) => {
|
|
68
|
+
runWithEditorFocused(() => dispatchCommand(findPrevWithAnalytics({
|
|
69
|
+
triggerMethod
|
|
70
|
+
})));
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
const handleReplace = ({
|
|
74
|
+
triggerMethod,
|
|
75
|
+
replaceText
|
|
76
|
+
}) => {
|
|
77
|
+
runWithEditorFocused(() => dispatchCommand(replaceWithAnalytics({
|
|
78
|
+
triggerMethod,
|
|
79
|
+
replaceText
|
|
80
|
+
})));
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
const handleReplaceAll = ({
|
|
84
|
+
replaceText
|
|
85
|
+
}) => {
|
|
86
|
+
runWithEditorFocused(() => dispatchCommand(replaceAllWithAnalytics({
|
|
87
|
+
replaceText
|
|
88
|
+
})));
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
const handleFindBlur = () => {
|
|
92
|
+
dispatchCommand(blur());
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
const handleCancel = ({
|
|
96
|
+
triggerMethod
|
|
97
|
+
}) => {
|
|
98
|
+
dispatchCommand(cancelSearchWithAnalytics({
|
|
99
|
+
triggerMethod
|
|
100
|
+
}));
|
|
101
|
+
editorView.focus();
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const handleToggleMatchCase = () => {
|
|
105
|
+
dispatchCommand(toggleMatchCase());
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
const {
|
|
109
|
+
findReplaceMatchCase
|
|
110
|
+
} = getFeatureFlags(editorView.state);
|
|
111
|
+
return /*#__PURE__*/React.createElement(WithPluginState, {
|
|
112
|
+
debounce: false,
|
|
113
|
+
plugins: {
|
|
114
|
+
findReplaceState: findReplacePluginKey
|
|
115
|
+
},
|
|
116
|
+
render: ({
|
|
117
|
+
findReplaceState
|
|
118
|
+
}) => {
|
|
119
|
+
if (!findReplaceState) {
|
|
120
|
+
return null;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return /*#__PURE__*/React.createElement(FindReplaceToolbarButton, {
|
|
124
|
+
allowMatchCase: findReplaceMatchCase,
|
|
125
|
+
shouldMatchCase: findReplaceState.shouldMatchCase,
|
|
126
|
+
onToggleMatchCase: handleToggleMatchCase,
|
|
127
|
+
isActive: findReplaceState.isActive,
|
|
128
|
+
findText: findReplaceState.findText,
|
|
129
|
+
index: findReplaceState.index,
|
|
130
|
+
numMatches: findReplaceState.matches.length,
|
|
131
|
+
replaceText: findReplaceState.replaceText,
|
|
132
|
+
shouldFocus: findReplaceState.shouldFocus,
|
|
133
|
+
popupsBoundariesElement: popupsBoundariesElement,
|
|
134
|
+
popupsMountPoint: popupsMountPoint,
|
|
135
|
+
popupsScrollableElement: popupsScrollableElement,
|
|
136
|
+
isReducedSpacing: !!isToolbarReducedSpacing,
|
|
137
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
138
|
+
onFindBlur: handleFindBlur,
|
|
139
|
+
onCancel: handleCancel,
|
|
140
|
+
onActivate: handleActivate,
|
|
141
|
+
onFind: handleFind,
|
|
142
|
+
onFindNext: handleFindNext,
|
|
143
|
+
onFindPrev: handleFindPrev,
|
|
144
|
+
onReplace: handleReplace,
|
|
145
|
+
onReplaceAll: handleReplaceAll,
|
|
146
|
+
takeFullWidth: !!props.takeFullWidth
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
export default FindReplaceToolbarButtonWithState;
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { createPlugin } from './plugin';
|
|
3
|
-
import { findReplacePluginKey } from './types';
|
|
4
3
|
import keymapPlugin from './keymap';
|
|
5
|
-
import
|
|
6
|
-
import { cancelSearchWithAnalytics, replaceWithAnalytics, replaceAllWithAnalytics, findWithAnalytics, findNextWithAnalytics, findPrevWithAnalytics, activateWithAnalytics } from './commands-with-analytics';
|
|
7
|
-
import { blur, toggleMatchCase } from './commands';
|
|
8
|
-
import FindReplaceToolbarButton from './ui/FindReplaceToolbarButton';
|
|
9
|
-
import { TRIGGER_METHOD } from '../analytics';
|
|
10
|
-
import { getFeatureFlags } from '../feature-flags-context';
|
|
4
|
+
import FindReplaceToolbarButtonWithState from './FindReplaceToolbarButtonWithState';
|
|
11
5
|
export const findReplacePlugin = props => {
|
|
12
6
|
return {
|
|
13
7
|
name: 'findReplace',
|
|
@@ -33,127 +27,20 @@ export const findReplacePlugin = props => {
|
|
|
33
27
|
containerElement,
|
|
34
28
|
dispatchAnalyticsEvent
|
|
35
29
|
}) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
} = editorView;
|
|
51
|
-
cmd(state, dispatch);
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
const handleActivate = () => {
|
|
55
|
-
runWithEditorFocused(() => dispatchCommand(activateWithAnalytics({
|
|
56
|
-
triggerMethod: TRIGGER_METHOD.TOOLBAR
|
|
57
|
-
})));
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
const handleFind = keyword => {
|
|
61
|
-
runWithEditorFocused(() => dispatchCommand(findWithAnalytics({
|
|
62
|
-
editorView,
|
|
63
|
-
containerElement,
|
|
64
|
-
keyword
|
|
65
|
-
})));
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
const handleFindNext = ({
|
|
69
|
-
triggerMethod
|
|
70
|
-
}) => {
|
|
71
|
-
runWithEditorFocused(() => dispatchCommand(findNextWithAnalytics({
|
|
72
|
-
triggerMethod
|
|
73
|
-
})));
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
const handleFindPrev = ({
|
|
77
|
-
triggerMethod
|
|
78
|
-
}) => {
|
|
79
|
-
runWithEditorFocused(() => dispatchCommand(findPrevWithAnalytics({
|
|
80
|
-
triggerMethod
|
|
81
|
-
})));
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
const handleReplace = ({
|
|
85
|
-
triggerMethod,
|
|
86
|
-
replaceText
|
|
87
|
-
}) => {
|
|
88
|
-
runWithEditorFocused(() => dispatchCommand(replaceWithAnalytics({
|
|
89
|
-
triggerMethod,
|
|
90
|
-
replaceText
|
|
91
|
-
})));
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
const handleReplaceAll = ({
|
|
95
|
-
replaceText
|
|
96
|
-
}) => {
|
|
97
|
-
runWithEditorFocused(() => dispatchCommand(replaceAllWithAnalytics({
|
|
98
|
-
replaceText
|
|
99
|
-
})));
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
const handleFindBlur = () => {
|
|
103
|
-
dispatchCommand(blur());
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
const handleCancel = ({
|
|
107
|
-
triggerMethod
|
|
108
|
-
}) => {
|
|
109
|
-
dispatchCommand(cancelSearchWithAnalytics({
|
|
110
|
-
triggerMethod
|
|
111
|
-
}));
|
|
112
|
-
editorView.focus();
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
const handleToggleMatchCase = () => {
|
|
116
|
-
dispatchCommand(toggleMatchCase());
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
const {
|
|
120
|
-
findReplaceMatchCase
|
|
121
|
-
} = getFeatureFlags(editorView.state);
|
|
122
|
-
return /*#__PURE__*/React.createElement(WithPluginState, {
|
|
123
|
-
debounce: false,
|
|
124
|
-
plugins: {
|
|
125
|
-
findReplaceState: findReplacePluginKey
|
|
126
|
-
},
|
|
127
|
-
render: ({
|
|
128
|
-
findReplaceState
|
|
129
|
-
}) => {
|
|
130
|
-
return /*#__PURE__*/React.createElement(FindReplaceToolbarButton, {
|
|
131
|
-
allowMatchCase: findReplaceMatchCase,
|
|
132
|
-
shouldMatchCase: findReplaceState.shouldMatchCase,
|
|
133
|
-
onToggleMatchCase: handleToggleMatchCase,
|
|
134
|
-
isActive: findReplaceState.isActive,
|
|
135
|
-
findText: findReplaceState.findText,
|
|
136
|
-
index: findReplaceState.index,
|
|
137
|
-
numMatches: findReplaceState.matches.length,
|
|
138
|
-
replaceText: findReplaceState.replaceText,
|
|
139
|
-
shouldFocus: findReplaceState.shouldFocus,
|
|
140
|
-
popupsBoundariesElement: popupsBoundariesElement,
|
|
141
|
-
popupsMountPoint: popupsMountPoint,
|
|
142
|
-
popupsScrollableElement: popupsScrollableElement,
|
|
143
|
-
isReducedSpacing: isToolbarReducedSpacing,
|
|
144
|
-
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
145
|
-
onFindBlur: handleFindBlur,
|
|
146
|
-
onCancel: handleCancel,
|
|
147
|
-
onActivate: handleActivate,
|
|
148
|
-
onFind: handleFind,
|
|
149
|
-
onFindNext: handleFindNext,
|
|
150
|
-
onFindPrev: handleFindPrev,
|
|
151
|
-
onReplace: handleReplace,
|
|
152
|
-
onReplaceAll: handleReplaceAll,
|
|
153
|
-
takeFullWidth: props.takeFullWidth
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
});
|
|
30
|
+
if (props.twoLineEditorToolbar) {
|
|
31
|
+
return null;
|
|
32
|
+
} else {
|
|
33
|
+
return /*#__PURE__*/React.createElement(FindReplaceToolbarButtonWithState, {
|
|
34
|
+
popupsBoundariesElement: popupsBoundariesElement,
|
|
35
|
+
popupsMountPoint: popupsMountPoint,
|
|
36
|
+
popupsScrollableElement: popupsScrollableElement,
|
|
37
|
+
isToolbarReducedSpacing: isToolbarReducedSpacing,
|
|
38
|
+
editorView: editorView,
|
|
39
|
+
containerElement: containerElement,
|
|
40
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
41
|
+
takeFullWidth: props.takeFullWidth
|
|
42
|
+
});
|
|
43
|
+
}
|
|
157
44
|
}
|
|
158
45
|
|
|
159
46
|
};
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
|
|
3
|
+
/** @jsx jsx */
|
|
2
4
|
import React from 'react';
|
|
5
|
+
import { jsx } from '@emotion/core';
|
|
3
6
|
import { defineMessages, injectIntl } from 'react-intl';
|
|
4
7
|
import EditorCloseIcon from '@atlaskit/icon/glyph/editor/close';
|
|
5
8
|
import ChevronDownIcon from '@atlaskit/icon/glyph/hipchat/chevron-down';
|
|
6
9
|
import ChevronUpIcon from '@atlaskit/icon/glyph/hipchat/chevron-up';
|
|
7
10
|
import MatchCaseIcon from '@atlaskit/icon/glyph/emoji/keyboard';
|
|
8
11
|
import Textfield from '@atlaskit/textfield';
|
|
9
|
-
import {
|
|
12
|
+
import { countStyles, sectionWrapperStyles } from './styles';
|
|
10
13
|
import { TRIGGER_METHOD } from '../../analytics/types';
|
|
11
14
|
import { FindReplaceTooltipButton } from './FindReplaceTooltipButton';
|
|
12
15
|
const messages = defineMessages({
|
|
@@ -147,16 +150,16 @@ class Find extends React.Component {
|
|
|
147
150
|
this.findNext = formatMessage(messages.findNext);
|
|
148
151
|
this.findPrevious = formatMessage(messages.findPrevious);
|
|
149
152
|
this.matchCase = formatMessage(messages.matchCase);
|
|
150
|
-
this.matchCaseIcon =
|
|
153
|
+
this.matchCaseIcon = jsx(MatchCaseIcon, {
|
|
151
154
|
label: this.matchCase
|
|
152
155
|
});
|
|
153
|
-
this.findNextIcon =
|
|
156
|
+
this.findNextIcon = jsx(ChevronDownIcon, {
|
|
154
157
|
label: this.findNext
|
|
155
158
|
});
|
|
156
|
-
this.findPrevIcon =
|
|
159
|
+
this.findPrevIcon = jsx(ChevronUpIcon, {
|
|
157
160
|
label: this.findPrevious
|
|
158
161
|
});
|
|
159
|
-
this.closeIcon =
|
|
162
|
+
this.closeIcon = jsx(EditorCloseIcon, {
|
|
160
163
|
label: this.closeFindReplaceDialog
|
|
161
164
|
}); // We locally manage the value of the input inside this component in order to support compositions.
|
|
162
165
|
// This requires some additional work inside componentDidUpdate to ensure we support changes that
|
|
@@ -200,7 +203,9 @@ class Find extends React.Component {
|
|
|
200
203
|
selectedMatchPosition: count.index + 1,
|
|
201
204
|
totalResultsCount: count.total
|
|
202
205
|
});
|
|
203
|
-
return
|
|
206
|
+
return jsx("div", {
|
|
207
|
+
css: sectionWrapperStyles
|
|
208
|
+
}, jsx(Textfield, {
|
|
204
209
|
name: "find",
|
|
205
210
|
appearance: "none",
|
|
206
211
|
placeholder: this.find,
|
|
@@ -212,24 +217,27 @@ class Find extends React.Component {
|
|
|
212
217
|
onBlur: this.props.onFindBlur,
|
|
213
218
|
onCompositionStart: this.handleCompositionStart,
|
|
214
219
|
onCompositionEnd: this.handleCompositionEnd
|
|
215
|
-
}), findText &&
|
|
220
|
+
}), findText && jsx("span", {
|
|
221
|
+
"data-testid": "textfield-count",
|
|
222
|
+
css: countStyles
|
|
223
|
+
}, count.total === 0 ? this.noResultsFound : resultsCount), allowMatchCase && jsx(FindReplaceTooltipButton, {
|
|
216
224
|
title: this.matchCase,
|
|
217
225
|
icon: this.matchCaseIcon,
|
|
218
226
|
onClick: this.handleMatchCaseClick,
|
|
219
227
|
isPressed: shouldMatchCase
|
|
220
|
-
}),
|
|
228
|
+
}), jsx(FindReplaceTooltipButton, {
|
|
221
229
|
title: this.findNext,
|
|
222
230
|
icon: this.findNextIcon,
|
|
223
231
|
keymapDescription: 'Enter',
|
|
224
232
|
onClick: this.handleFindNextClick,
|
|
225
233
|
disabled: count.total <= 1
|
|
226
|
-
}),
|
|
234
|
+
}), jsx(FindReplaceTooltipButton, {
|
|
227
235
|
title: this.findPrevious,
|
|
228
236
|
icon: this.findPrevIcon,
|
|
229
237
|
keymapDescription: 'Shift Enter',
|
|
230
238
|
onClick: this.handleFindPrevClick,
|
|
231
239
|
disabled: count.total <= 1
|
|
232
|
-
}),
|
|
240
|
+
}), jsx(FindReplaceTooltipButton, {
|
|
233
241
|
title: this.closeFindReplaceDialog,
|
|
234
242
|
icon: this.closeIcon,
|
|
235
243
|
keymapDescription: 'Escape',
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
|
|
3
|
+
/** @jsx jsx */
|
|
2
4
|
import React from 'react';
|
|
5
|
+
import { jsx } from '@emotion/core';
|
|
3
6
|
import Find from './Find';
|
|
4
7
|
import Replace from './Replace';
|
|
5
|
-
import {
|
|
8
|
+
import { ruleStyles, wrapperStyles } from './styles';
|
|
6
9
|
|
|
7
10
|
class FindReplace extends React.PureComponent {
|
|
8
11
|
constructor(...args) {
|
|
@@ -51,7 +54,9 @@ class FindReplace extends React.PureComponent {
|
|
|
51
54
|
shouldMatchCase,
|
|
52
55
|
onToggleMatchCase
|
|
53
56
|
} = this.props;
|
|
54
|
-
return
|
|
57
|
+
return jsx("div", {
|
|
58
|
+
css: wrapperStyles
|
|
59
|
+
}, jsx(Find, {
|
|
55
60
|
allowMatchCase: allowMatchCase,
|
|
56
61
|
shouldMatchCase: shouldMatchCase,
|
|
57
62
|
onToggleMatchCase: onToggleMatchCase,
|
|
@@ -65,7 +70,10 @@ class FindReplace extends React.PureComponent {
|
|
|
65
70
|
onFindTextfieldRefSet: this.setFindTextfieldRef,
|
|
66
71
|
onCancel: onCancel,
|
|
67
72
|
onArrowDown: this.setFocusToReplace
|
|
68
|
-
}),
|
|
73
|
+
}), jsx("hr", {
|
|
74
|
+
css: ruleStyles,
|
|
75
|
+
id: "replace-hr-element"
|
|
76
|
+
}), jsx(Replace, {
|
|
69
77
|
canReplace: count.total > 0,
|
|
70
78
|
replaceText: replaceText,
|
|
71
79
|
onReplace: onReplace,
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
|
|
3
|
+
/** @jsx jsx */
|
|
2
4
|
import React from 'react';
|
|
5
|
+
import { jsx } from '@emotion/core';
|
|
6
|
+
import Button from '@atlaskit/button/standard-button';
|
|
3
7
|
import { defineMessages, injectIntl } from 'react-intl';
|
|
4
8
|
import Textfield from '@atlaskit/textfield';
|
|
5
|
-
import {
|
|
9
|
+
import { sectionWrapperStyles, replaceSectionButtonStyles } from './styles';
|
|
6
10
|
import { EVENT_TYPE, ACTION, ACTION_SUBJECT, TRIGGER_METHOD } from '../../analytics/types';
|
|
7
11
|
const messages = defineMessages({
|
|
8
12
|
replaceWith: {
|
|
@@ -138,7 +142,9 @@ class Replace extends React.PureComponent {
|
|
|
138
142
|
const {
|
|
139
143
|
canReplace
|
|
140
144
|
} = this.props;
|
|
141
|
-
return
|
|
145
|
+
return jsx("div", {
|
|
146
|
+
css: sectionWrapperStyles
|
|
147
|
+
}, jsx(Textfield, {
|
|
142
148
|
name: "replace",
|
|
143
149
|
appearance: "none",
|
|
144
150
|
placeholder: this.replaceWith,
|
|
@@ -149,11 +155,13 @@ class Replace extends React.PureComponent {
|
|
|
149
155
|
onKeyDown: this.handleReplaceKeyDown,
|
|
150
156
|
onCompositionStart: this.handleCompositionStart,
|
|
151
157
|
onCompositionEnd: this.handleCompositionEnd
|
|
152
|
-
}),
|
|
158
|
+
}), jsx(Button, {
|
|
159
|
+
css: replaceSectionButtonStyles,
|
|
153
160
|
testId: this.replace,
|
|
154
161
|
onClick: this.handleReplaceClick,
|
|
155
162
|
isDisabled: !canReplace
|
|
156
|
-
}, this.replace),
|
|
163
|
+
}, this.replace), jsx(Button, {
|
|
164
|
+
css: replaceSectionButtonStyles,
|
|
157
165
|
testId: this.replaceAll,
|
|
158
166
|
onClick: this.handleReplaceAllClick,
|
|
159
167
|
isDisabled: !canReplace
|
|
@@ -1,50 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { css } from '@emotion/core';
|
|
3
3
|
import { N60, N30A } from '@atlaskit/theme/colors';
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
4
|
+
import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
5
|
+
export const replaceSectionButtonStyles = css({
|
|
6
|
+
marginLeft: '4px'
|
|
7
|
+
});
|
|
8
|
+
export const ruleStyles = css({
|
|
9
|
+
width: '100%',
|
|
10
|
+
border: 'none',
|
|
11
|
+
backgroundColor: `${N30A}`,
|
|
12
|
+
margin: '4px 0px',
|
|
13
|
+
height: '1px',
|
|
14
|
+
borderRadius: '1px'
|
|
15
|
+
});
|
|
16
|
+
export const wrapperStyles = css({
|
|
17
|
+
display: 'flex',
|
|
18
|
+
flexDirection: 'column',
|
|
19
|
+
'> *:not(#replace-hr-element)': {
|
|
20
|
+
margin: '0px 4px'
|
|
15
21
|
}
|
|
16
|
-
|
|
17
|
-
export const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
`;
|
|
25
|
-
export const Wrapper = styled.div`
|
|
26
|
-
display: flex;
|
|
27
|
-
flex-direction: column;
|
|
28
|
-
> *:not(${Rule}) {
|
|
29
|
-
margin: 0px 4px;
|
|
22
|
+
});
|
|
23
|
+
export const sectionWrapperStyles = css({
|
|
24
|
+
display: 'flex',
|
|
25
|
+
alignItems: 'column',
|
|
26
|
+
'> *': {
|
|
27
|
+
display: 'inline-flex',
|
|
28
|
+
height: '32px',
|
|
29
|
+
flex: '0 0 auto'
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
export const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
`;
|
|
42
|
-
export const Count = styled.span`
|
|
43
|
-
color: ${N60};
|
|
44
|
-
font-size: ${relativeFontSizeToBase16(12)};
|
|
45
|
-
flex: 0 0 auto;
|
|
46
|
-
justify-content: center;
|
|
47
|
-
align-items: center;
|
|
48
|
-
margin-left: 4px;
|
|
49
|
-
margin-right: 8px;
|
|
50
|
-
`;
|
|
31
|
+
});
|
|
32
|
+
export const countStyles = css({
|
|
33
|
+
color: `${N60}`,
|
|
34
|
+
fontSize: `${relativeFontSizeToBase16(12)}`,
|
|
35
|
+
flex: '0 0 auto',
|
|
36
|
+
justifyContent: 'center',
|
|
37
|
+
alignItems: 'center',
|
|
38
|
+
marginLeft: '4px',
|
|
39
|
+
marginRight: '8px'
|
|
40
|
+
});
|
|
@@ -2,7 +2,8 @@ import React from 'react';
|
|
|
2
2
|
import { Component } from 'react';
|
|
3
3
|
import styled, { ThemeProvider } from 'styled-components';
|
|
4
4
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
5
|
-
import { B400 } from '@atlaskit/theme/colors';
|
|
5
|
+
import { B400 } from '@atlaskit/theme/colors'; // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
6
|
+
|
|
6
7
|
import Item, { itemThemeNamespace } from '@atlaskit/item';
|
|
7
8
|
import EditorDoneIcon from '@atlaskit/icon/glyph/editor/done';
|
|
8
9
|
import Tooltip from '@atlaskit/tooltip';
|
|
@@ -8,6 +8,13 @@ import EditorEmojiAddIcon from './EditorEmojiAddIcon'; // helps adjusts position
|
|
|
8
8
|
|
|
9
9
|
const EmojiPickerButtonWrapper = styled.div`
|
|
10
10
|
position: relative;
|
|
11
|
+
`; // helps to vertically align emoji picker
|
|
12
|
+
// both top and bottom margin should be 2px
|
|
13
|
+
// https://product-fabric.atlassian.net/browse/CETI-148
|
|
14
|
+
|
|
15
|
+
const EmojiPickerWrapper = styled.div`
|
|
16
|
+
margin-bottom: -12px;
|
|
17
|
+
margin-top: -4px;
|
|
11
18
|
`;
|
|
12
19
|
export const EmojiPickerButton = props => {
|
|
13
20
|
const buttonRef = React.useRef(null);
|
|
@@ -20,6 +27,7 @@ export const EmojiPickerButton = props => {
|
|
|
20
27
|
|
|
21
28
|
const updateEmoji = emoji => {
|
|
22
29
|
setIsPopupOpen(false);
|
|
30
|
+
props.editorView && props.editorView.focus();
|
|
23
31
|
props.onChange && props.onChange(emoji);
|
|
24
32
|
};
|
|
25
33
|
|
|
@@ -47,11 +55,11 @@ export const EmojiPickerButton = props => {
|
|
|
47
55
|
fitHeight: 350,
|
|
48
56
|
fitWidth: 350,
|
|
49
57
|
offset: [0, 10]
|
|
50
|
-
}, /*#__PURE__*/React.createElement(WithProviders, {
|
|
58
|
+
}, /*#__PURE__*/React.createElement(EmojiPickerWrapper, null, /*#__PURE__*/React.createElement(WithProviders, {
|
|
51
59
|
providers: ['emojiProvider'],
|
|
52
60
|
providerFactory: props.providerFactory,
|
|
53
61
|
renderNode: renderPicker
|
|
54
|
-
}));
|
|
62
|
+
})));
|
|
55
63
|
};
|
|
56
64
|
|
|
57
65
|
const title = props.title || '';
|
|
@@ -224,7 +224,7 @@ export default class Toolbar extends Component {
|
|
|
224
224
|
if (item.selectType === 'emoji') {
|
|
225
225
|
return /*#__PURE__*/React.createElement(EmojiPickerButton, {
|
|
226
226
|
key: idx,
|
|
227
|
-
|
|
227
|
+
editorView: editorView,
|
|
228
228
|
title: item.title,
|
|
229
229
|
providerFactory: providerFactory,
|
|
230
230
|
isSelected: item.selected,
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { fragment } from '@atlaskit/adf-schema';
|
|
2
|
+
import { Plugin } from 'prosemirror-state';
|
|
3
|
+
import { pluginKey } from './plugin-key';
|
|
4
|
+
export function createPlugin() {
|
|
5
|
+
return new Plugin({
|
|
6
|
+
key: pluginKey
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const fragmentMarkPlugin = () => ({
|
|
11
|
+
name: 'fragmentPlugin',
|
|
12
|
+
|
|
13
|
+
marks() {
|
|
14
|
+
return [{
|
|
15
|
+
name: 'fragment',
|
|
16
|
+
mark: fragment
|
|
17
|
+
}];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export default fragmentMarkPlugin;
|