@atlaskit/editor-core 151.3.0 → 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/dist/cjs/create-editor/ReactEditorView.js +22 -8
- package/dist/cjs/create-editor/create-plugins-list.js +25 -9
- package/dist/cjs/labs/next/presets/cxhtml.js +1 -2
- 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/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/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 +26 -10
- package/dist/es2019/labs/next/presets/cxhtml.js +1 -2
- 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/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/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 +26 -10
- package/dist/esm/labs/next/presets/cxhtml.js +1 -2
- 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/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/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/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/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 +10 -7
- 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
|
@@ -539,8 +539,30 @@ var ReactEditorView = /*#__PURE__*/function (_React$Component) {
|
|
|
539
539
|
transformer: _this.contentTransformer
|
|
540
540
|
});
|
|
541
541
|
|
|
542
|
+
if (_this.props.editorProps.shouldFocus && view.props.editable && view.props.editable(view.state)) {
|
|
543
|
+
_this.focusTimeoutId = handleEditorFocus(view);
|
|
544
|
+
}
|
|
545
|
+
|
|
542
546
|
if (_this.featureFlags.ufo) {
|
|
547
|
+
_this.experienceStore = _ufo.ExperienceStore.getInstance(view);
|
|
548
|
+
|
|
549
|
+
_this.experienceStore.start(_ufo.EditorExperience.editSession);
|
|
550
|
+
|
|
551
|
+
_this.experienceStore.addMetadata(_ufo.EditorExperience.editSession, {
|
|
552
|
+
reliabilityInterval: _ufo.RELIABILITY_INTERVAL
|
|
553
|
+
});
|
|
554
|
+
|
|
543
555
|
_this.reliabilityInterval = window.setInterval(function () {
|
|
556
|
+
var _this$experienceStore11, _this$experienceStore12;
|
|
557
|
+
|
|
558
|
+
(_this$experienceStore11 = _this.experienceStore) === null || _this$experienceStore11 === void 0 ? void 0 : (_this$experienceStore12 = _this$experienceStore11.success(_ufo.EditorExperience.editSession)) === null || _this$experienceStore12 === void 0 ? void 0 : _this$experienceStore12.finally(function () {
|
|
559
|
+
var _this$experienceStore13, _this$experienceStore14;
|
|
560
|
+
|
|
561
|
+
(_this$experienceStore13 = _this.experienceStore) === null || _this$experienceStore13 === void 0 ? void 0 : _this$experienceStore13.start(_ufo.EditorExperience.editSession);
|
|
562
|
+
(_this$experienceStore14 = _this.experienceStore) === null || _this$experienceStore14 === void 0 ? void 0 : _this$experienceStore14.addMetadata(_ufo.EditorExperience.editSession, {
|
|
563
|
+
reliabilityInterval: _ufo.RELIABILITY_INTERVAL
|
|
564
|
+
});
|
|
565
|
+
});
|
|
544
566
|
var reliabilityEvent = {
|
|
545
567
|
action: _analytics.ACTION.UFO_SESSION_COMPLETE,
|
|
546
568
|
actionSubject: _analytics.ACTION_SUBJECT.EDITOR,
|
|
@@ -552,14 +574,6 @@ var ReactEditorView = /*#__PURE__*/function (_React$Component) {
|
|
|
552
574
|
|
|
553
575
|
_this.dispatchAnalyticsEvent(reliabilityEvent);
|
|
554
576
|
}, _ufo.RELIABILITY_INTERVAL);
|
|
555
|
-
}
|
|
556
|
-
|
|
557
|
-
if (_this.props.editorProps.shouldFocus && view.props.editable && view.props.editable(view.state)) {
|
|
558
|
-
_this.focusTimeoutId = handleEditorFocus(view);
|
|
559
|
-
}
|
|
560
|
-
|
|
561
|
-
if (_this.featureFlags.ufo) {
|
|
562
|
-
_this.experienceStore = _ufo.ExperienceStore.getInstance(view);
|
|
563
577
|
} // Force React to re-render so consumers get a reference to the editor view
|
|
564
578
|
|
|
565
579
|
|
|
@@ -129,8 +129,6 @@ function getDefaultPresetOptionsFromEditorProps(props, createAnalyticsEvent) {
|
|
|
129
129
|
|
|
130
130
|
|
|
131
131
|
function createPluginsList(props, prevProps, createAnalyticsEvent) {
|
|
132
|
-
var _props$featureFlags;
|
|
133
|
-
|
|
134
132
|
var appearance = props.appearance;
|
|
135
133
|
var isMobile = appearance === 'mobile';
|
|
136
134
|
var isComment = appearance === 'comment';
|
|
@@ -298,8 +296,8 @@ function createPluginsList(props, prevProps, createAnalyticsEvent) {
|
|
|
298
296
|
if (props.allowPanel) {
|
|
299
297
|
preset.add([_plugins.panelPlugin, {
|
|
300
298
|
useLongPressSelection: false,
|
|
301
|
-
|
|
302
|
-
|
|
299
|
+
allowCustomPanel: props.allowPanel.allowCustomPanel,
|
|
300
|
+
allowCustomPanelEdit: props.allowPanel.allowCustomPanelEdit
|
|
303
301
|
}]);
|
|
304
302
|
}
|
|
305
303
|
|
|
@@ -396,20 +394,38 @@ function createPluginsList(props, prevProps, createAnalyticsEvent) {
|
|
|
396
394
|
replacePlusMenuWithElementBrowser: props.elementBrowser && props.elementBrowser.replacePlusMenu || false
|
|
397
395
|
}]);
|
|
398
396
|
|
|
399
|
-
|
|
397
|
+
var hasBeforePrimaryToolbar = function hasBeforePrimaryToolbar(components) {
|
|
398
|
+
if (components && 'before' in components) {
|
|
399
|
+
return !!components.before;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
return false;
|
|
403
|
+
};
|
|
404
|
+
|
|
405
|
+
if (hasBeforePrimaryToolbar(props.primaryToolbarComponents) && !featureFlags.twoLineEditorToolbar) {
|
|
406
|
+
preset.add([_plugins.beforePrimaryToolbarPlugin, {
|
|
407
|
+
beforePrimaryToolbarComponents: props.primaryToolbarComponents.before
|
|
408
|
+
}]);
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
if (featureFlags.showAvatarGroupAsPlugin === true && !featureFlags.twoLineEditorToolbar) {
|
|
400
412
|
preset.add([_plugins.avatarGroupPlugin, {
|
|
401
|
-
collabEdit: props.collabEdit
|
|
413
|
+
collabEdit: props.collabEdit,
|
|
414
|
+
takeFullWidth: !hasBeforePrimaryToolbar(props.primaryToolbarComponents)
|
|
402
415
|
}]);
|
|
403
416
|
}
|
|
404
417
|
|
|
405
418
|
if (props.allowFindReplace) {
|
|
406
|
-
var _props$featureFlags2;
|
|
407
|
-
|
|
408
419
|
preset.add([_plugins.findReplacePlugin, {
|
|
409
|
-
takeFullWidth: !!
|
|
420
|
+
takeFullWidth: !!featureFlags.showAvatarGroupAsPlugin === false && !hasBeforePrimaryToolbar(props.primaryToolbarComponents),
|
|
421
|
+
twoLineEditorToolbar: !!featureFlags.twoLineEditorToolbar
|
|
410
422
|
}]);
|
|
411
423
|
}
|
|
412
424
|
|
|
425
|
+
if (props.UNSAFE_allowFragmentMark) {
|
|
426
|
+
preset.add(_plugins.fragmentMarkPlugin);
|
|
427
|
+
}
|
|
428
|
+
|
|
413
429
|
if (featureFlags.enableViewUpdateSubscription) {
|
|
414
430
|
preset.add([_plugins.viewUpdateSubscriptionPlugin]);
|
|
415
431
|
}
|
|
@@ -46,8 +46,7 @@ function useCXHTMLPreset(_ref) {
|
|
|
46
46
|
}
|
|
47
47
|
}]);
|
|
48
48
|
preset.add([_plugins.panelPlugin, {
|
|
49
|
-
|
|
50
|
-
UNSAFE_allowCustomPanelEdit: true
|
|
49
|
+
allowCustomPanel: true
|
|
51
50
|
}]);
|
|
52
51
|
preset.add(_plugins.listPlugin);
|
|
53
52
|
preset.add(_plugins.textColorPlugin);
|
|
@@ -191,10 +191,10 @@ var ReactNodeView = /*#__PURE__*/function () {
|
|
|
191
191
|
}
|
|
192
192
|
}, {
|
|
193
193
|
key: "update",
|
|
194
|
-
value: function update(node, _decorations) {
|
|
194
|
+
value: function update(node, _decorations, _innerDecorations) {
|
|
195
195
|
var _this4 = this;
|
|
196
196
|
|
|
197
|
-
var validUpdate = arguments.length >
|
|
197
|
+
var validUpdate = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : function () {
|
|
198
198
|
return true;
|
|
199
199
|
};
|
|
200
200
|
// @see https://github.com/ProseMirror/prosemirror/issues/648
|
|
@@ -108,6 +108,12 @@ var SelectionBasedNodeView = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
108
108
|
to = _this$view$state$sele2.to;
|
|
109
109
|
return _this.isSelectedNode(_this.view.state.selection) || _this.isSelectionInsideNode(from, to);
|
|
110
110
|
});
|
|
111
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "nodeInsideSelection", function () {
|
|
112
|
+
var selection = _this.view.state.selection;
|
|
113
|
+
var from = selection.from,
|
|
114
|
+
to = selection.to;
|
|
115
|
+
return _this.isSelectedNode(selection) || _this.isNodeInsideSelection(from, to);
|
|
116
|
+
});
|
|
111
117
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onSelectionChange", function () {
|
|
112
118
|
_this.update(_this.node, []);
|
|
113
119
|
});
|
|
@@ -63,6 +63,7 @@ exports.ACTION = ACTION;
|
|
|
63
63
|
ACTION["INITIALISED"] = "initialised";
|
|
64
64
|
ACTION["INPUT_PERF_SAMPLING"] = "inputPerfSampling";
|
|
65
65
|
ACTION["INSERTED"] = "inserted";
|
|
66
|
+
ACTION["INVALID_DOCUMENT_ENCOUNTERED"] = "invalidDocumentEncountered";
|
|
66
67
|
ACTION["INVOKED"] = "invoked";
|
|
67
68
|
ACTION["LANGUAGE_SELECTED"] = "languageSelected";
|
|
68
69
|
ACTION["LIST_ITEM_JOINED"] = "listItemJoined";
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getSelectionPositions = getSelectionPositions;
|
|
7
|
-
exports.
|
|
7
|
+
exports.hasInvalidWhitespaceNode = hasInvalidWhitespaceNode;
|
|
8
8
|
exports.hasAnnotationMark = hasAnnotationMark;
|
|
9
9
|
exports.annotationExists = annotationExists;
|
|
10
10
|
exports.containsAnyAnnotations = containsAnyAnnotations;
|
|
@@ -316,7 +316,7 @@ var isSelectionValid = function isSelectionValid(state) {
|
|
|
316
316
|
return _types.AnnotationSelectionType.DISABLED;
|
|
317
317
|
}
|
|
318
318
|
|
|
319
|
-
if (disallowOnWhitespace &&
|
|
319
|
+
if (disallowOnWhitespace && hasInvalidWhitespaceNode(selection)) {
|
|
320
320
|
return _types.AnnotationSelectionType.INVALID;
|
|
321
321
|
}
|
|
322
322
|
|
|
@@ -372,16 +372,27 @@ function isEmptyTextSelection(selection, schema) {
|
|
|
372
372
|
*/
|
|
373
373
|
|
|
374
374
|
|
|
375
|
-
function
|
|
376
|
-
var
|
|
377
|
-
selection.content().content
|
|
375
|
+
function hasInvalidWhitespaceNode(selection) {
|
|
376
|
+
var foundInvalidWhitespace = false;
|
|
377
|
+
var content = selection.content().content;
|
|
378
|
+
content.descendants(function (node) {
|
|
378
379
|
if (node.textContent.trim() === '') {
|
|
379
|
-
|
|
380
|
+
// Trailing new lines do not result in the annotation spanning into
|
|
381
|
+
// the trailing new line so can be ignored when looking for invalid
|
|
382
|
+
// whitespace nodes.
|
|
383
|
+
var nodeIsTrailingNewLine = // it is the final node
|
|
384
|
+
node.eq(content.lastChild) && // and there are multiple nodes
|
|
385
|
+
!node.eq(content.firstChild) && // and it is a paragraph node
|
|
386
|
+
node.type.name === 'paragraph';
|
|
387
|
+
|
|
388
|
+
if (!nodeIsTrailingNewLine) {
|
|
389
|
+
foundInvalidWhitespace = true;
|
|
390
|
+
}
|
|
380
391
|
}
|
|
381
392
|
|
|
382
|
-
return !
|
|
393
|
+
return !foundInvalidWhitespace;
|
|
383
394
|
});
|
|
384
|
-
return
|
|
395
|
+
return foundInvalidWhitespace;
|
|
385
396
|
}
|
|
386
397
|
/*
|
|
387
398
|
* verifies if node contains annotation mark
|
|
@@ -27,7 +27,8 @@ var avatarGroup = function avatarGroup(props) {
|
|
|
27
27
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
28
28
|
editorView: editorView,
|
|
29
29
|
eventDispatcher: eventDispatcher,
|
|
30
|
-
collabEdit: props.collabEdit
|
|
30
|
+
collabEdit: props.collabEdit,
|
|
31
|
+
takeFullWidth: props.takeFullWidth
|
|
31
32
|
});
|
|
32
33
|
}
|
|
33
34
|
};
|
|
@@ -25,7 +25,9 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
25
25
|
|
|
26
26
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
27
27
|
|
|
28
|
-
var ToolbarButtonWrapper = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-grow:
|
|
28
|
+
var ToolbarButtonWrapper = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-grow: ", ";\n justify-content: flex-end;\n align-items: center;\n & > div {\n margin-right: 0;\n }\n"])), function (props) {
|
|
29
|
+
return props.takeFullWidth ? 1 : 0;
|
|
30
|
+
});
|
|
29
31
|
|
|
30
32
|
var AvatarGroupPluginWrapper = function AvatarGroupPluginWrapper(props) {
|
|
31
33
|
var dispatchAnalyticsEvent = props.dispatchAnalyticsEvent;
|
|
@@ -43,7 +45,8 @@ var AvatarGroupPluginWrapper = function AvatarGroupPluginWrapper(props) {
|
|
|
43
45
|
}, [dispatchAnalyticsEvent]);
|
|
44
46
|
return /*#__PURE__*/_react.default.createElement(ToolbarButtonWrapper, {
|
|
45
47
|
"aria-label": "Editors",
|
|
46
|
-
"data-testid": 'avatar-group-in-plugin'
|
|
48
|
+
"data-testid": 'avatar-group-in-plugin',
|
|
49
|
+
takeFullWidth: props.takeFullWidth
|
|
47
50
|
}, /*#__PURE__*/_react.default.createElement(_avatarsWithPluginState.default, {
|
|
48
51
|
editorView: props.editorView,
|
|
49
52
|
eventDispatcher: props.eventDispatcher,
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _BeforePrimaryToolbarWrapper = require("./ui/BeforePrimaryToolbarWrapper");
|
|
13
|
+
|
|
14
|
+
var beforePrimaryToolbar = function beforePrimaryToolbar(props) {
|
|
15
|
+
return {
|
|
16
|
+
name: 'beforePrimaryToolbar',
|
|
17
|
+
primaryToolbarComponent: function primaryToolbarComponent() {
|
|
18
|
+
return /*#__PURE__*/_react.default.createElement(_BeforePrimaryToolbarWrapper.BeforePrimaryToolbarWrapper, {
|
|
19
|
+
beforePrimaryToolbarComponents: props.beforePrimaryToolbarComponents
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
var _default = beforePrimaryToolbar;
|
|
26
|
+
exports.default = _default;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.BeforePrimaryToolbarWrapper = exports.BeforePrimaryToolbarPluginWrapper = void 0;
|
|
9
|
+
|
|
10
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
|
+
|
|
12
|
+
var _react = _interopRequireDefault(require("react"));
|
|
13
|
+
|
|
14
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
15
|
+
|
|
16
|
+
var _templateObject;
|
|
17
|
+
|
|
18
|
+
var BeforePrimaryToolbarPluginWrapper = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n margin-right: 8px;\n flex-grow: 1;\n justify-content: flex-end;\n align-items: center;\n"])));
|
|
19
|
+
|
|
20
|
+
exports.BeforePrimaryToolbarPluginWrapper = BeforePrimaryToolbarPluginWrapper;
|
|
21
|
+
|
|
22
|
+
var BeforePrimaryToolbarWrapper = function BeforePrimaryToolbarWrapper(props) {
|
|
23
|
+
return /*#__PURE__*/_react.default.createElement(BeforePrimaryToolbarPluginWrapper, {
|
|
24
|
+
"data-testid": 'before-primary-toolbar-components-plugin'
|
|
25
|
+
}, props.beforePrimaryToolbarComponents);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
exports.BeforePrimaryToolbarWrapper = BeforePrimaryToolbarWrapper;
|
|
@@ -11,6 +11,8 @@ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
|
11
11
|
|
|
12
12
|
var _prosemirrorModel = require("prosemirror-model");
|
|
13
13
|
|
|
14
|
+
var _prosemirrorState = require("prosemirror-state");
|
|
15
|
+
|
|
14
16
|
var _macro = require("../macro");
|
|
15
17
|
|
|
16
18
|
var _pluginKey = require("../macro/plugin-key");
|
|
@@ -61,7 +63,7 @@ var extensionAPICallPayload = function extensionAPICallPayload(functionName) {
|
|
|
61
63
|
|
|
62
64
|
var createExtensionAPI = function createExtensionAPI(options) {
|
|
63
65
|
var doc = {
|
|
64
|
-
insertAfter: function insertAfter(localId, adf) {
|
|
66
|
+
insertAfter: function insertAfter(localId, adf, opt) {
|
|
65
67
|
var editorView = options.editorView;
|
|
66
68
|
var dispatch = editorView.dispatch; // Be extra cautious since 3rd party devs can use regular JS without type safety
|
|
67
69
|
|
|
@@ -101,7 +103,8 @@ var createExtensionAPI = function createExtensionAPI(options) {
|
|
|
101
103
|
throw new Error('insertAfter(): Could not create a node for given ADFEntity.');
|
|
102
104
|
}
|
|
103
105
|
|
|
104
|
-
|
|
106
|
+
var insertPosition = nodePos.pos + nodePos.node.nodeSize;
|
|
107
|
+
tr.insert(insertPosition, newNode); // Validate if the document is valid at this point
|
|
105
108
|
|
|
106
109
|
try {
|
|
107
110
|
tr.doc.check();
|
|
@@ -145,6 +148,11 @@ var createExtensionAPI = function createExtensionAPI(options) {
|
|
|
145
148
|
};
|
|
146
149
|
(0, _analytics.addAnalytics)(state, tr, payload);
|
|
147
150
|
});
|
|
151
|
+
|
|
152
|
+
if (opt && opt.allowSelectionToNewNode) {
|
|
153
|
+
tr.setSelection(new _prosemirrorState.NodeSelection(tr.doc.resolve(insertPosition)));
|
|
154
|
+
}
|
|
155
|
+
|
|
148
156
|
dispatch(tr);
|
|
149
157
|
},
|
|
150
158
|
scrollTo: function scrollTo(localId) {
|
|
@@ -15,5 +15,5 @@ var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
|
15
15
|
|
|
16
16
|
var _templateObject;
|
|
17
17
|
|
|
18
|
-
var extensionStyles = (0, _styledComponents.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .extensionView-content-wrap,\n .bodiedExtensionView-content-wrap {\n margin: ", " 0;\n\n &:first-of-type {\n margin-top: 0;\n }\n\n &:last-of-type {\n margin-bottom: 0;\n }\n\n &:not(.danger).", " {\n & > span > .extension-container {\n ", "\n }\n }\n\n &.danger > span > .extension-container {\n box-shadow: 0 0 0 ", "px ", ";\n background-color: ", ";\n }\n\n &.inline {\n word-wrap: break-all;\n }\n }\n\n .extensionView-content-wrap .extension-container {\n overflow: hidden;\n }\n"])), _editorSharedStyles.blockNodesVerticalMargin, _editorSharedStyles.akEditorSelectedNodeClassName, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow]), _editorSharedStyles.akEditorSelectedBorderSize, _editorSharedStyles.akEditorDeleteBorder, _editorSharedStyles.akEditorDeleteBackground);
|
|
18
|
+
var extensionStyles = (0, _styledComponents.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .extensionView-content-wrap,\n .bodiedExtensionView-content-wrap {\n margin: ", " 0;\n\n &:first-of-type {\n margin-top: 0;\n }\n\n &:last-of-type {\n margin-bottom: 0;\n }\n\n &:not(.danger).", " {\n & > span > .extension-container {\n ", "\n }\n }\n\n &.danger > span > .extension-container {\n box-shadow: 0 0 0 ", "px ", ";\n background-color: ", ";\n }\n\n &.inline {\n word-wrap: break-all;\n }\n }\n\n .extensionView-content-wrap .extension-container {\n overflow: hidden;\n }\n\n .bodiedExtensionView-content-wrap\n .extensionView-content-wrap\n .extension-container {\n width: 100%;\n }\n"])), _editorSharedStyles.blockNodesVerticalMargin, _editorSharedStyles.akEditorSelectedNodeClassName, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow]), _editorSharedStyles.akEditorSelectedBorderSize, _editorSharedStyles.akEditorDeleteBorder, _editorSharedStyles.akEditorDeleteBackground);
|
|
19
19
|
exports.extensionStyles = extensionStyles;
|
|
@@ -24,7 +24,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
24
24
|
* which is used by both current and archv3 editors.
|
|
25
25
|
*/
|
|
26
26
|
function createFeatureFlagsFromProps(props) {
|
|
27
|
-
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;
|
|
27
|
+
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;
|
|
28
28
|
|
|
29
29
|
var normalizedFeatureFlags = (0, _normalizeFeatureFlags.normalizeFeatureFlags)(props.featureFlags);
|
|
30
30
|
return _objectSpread(_objectSpread({}, normalizedFeatureFlags), {}, {
|
|
@@ -37,6 +37,7 @@ function createFeatureFlagsFromProps(props) {
|
|
|
37
37
|
findReplaceMatchCase: (0, _typeof2.default)(props.allowFindReplace) === 'object' && Boolean(props.allowFindReplace.allowMatchCase),
|
|
38
38
|
keyboardAccessibleDatepicker: typeof props.allowKeyboardAccessibleDatepicker === 'boolean' ? props.allowKeyboardAccessibleDatepicker : false,
|
|
39
39
|
addColumnWithCustomStep: !props.allowTables || typeof props.allowTables === 'boolean' ? false : Boolean(props.allowTables.allowAddColumnWithCustomStep),
|
|
40
|
+
singleLayout: (0, _typeof2.default)(props.allowLayouts) === 'object' && !!((_props$allowLayouts = props.allowLayouts) !== null && _props$allowLayouts !== void 0 && _props$allowLayouts.UNSAFE_allowSingleColumnLayout),
|
|
40
41
|
undoRedoButtons: props.UNSAFE_allowUndoRedoButtons,
|
|
41
42
|
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,
|
|
42
43
|
nextEmojiNodeView: ((_props$featureFlags = props.featureFlags) === null || _props$featureFlags === void 0 ? void 0 : _props$featureFlags.nextEmojiNodeView) === true,
|
|
@@ -55,6 +56,7 @@ function createFeatureFlagsFromProps(props) {
|
|
|
55
56
|
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),
|
|
56
57
|
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),
|
|
57
58
|
codeBlockSyntaxHighlighting: Boolean(typeof normalizedFeatureFlags.codeBlockSyntaxHighlighting === 'boolean' ? !!normalizedFeatureFlags.codeBlockSyntaxHighlighting && !_editorCommon.browser.safari : false),
|
|
58
|
-
|
|
59
|
+
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),
|
|
60
|
+
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)
|
|
59
61
|
});
|
|
60
62
|
}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _types = require("./types");
|
|
13
|
+
|
|
14
|
+
var _WithPluginState = _interopRequireDefault(require("../../ui/WithPluginState"));
|
|
15
|
+
|
|
16
|
+
var _commandsWithAnalytics = require("./commands-with-analytics");
|
|
17
|
+
|
|
18
|
+
var _commands = require("./commands");
|
|
19
|
+
|
|
20
|
+
var _FindReplaceToolbarButton = _interopRequireDefault(require("./ui/FindReplaceToolbarButton"));
|
|
21
|
+
|
|
22
|
+
var _analytics = require("../analytics");
|
|
23
|
+
|
|
24
|
+
var _featureFlagsContext = require("../feature-flags-context");
|
|
25
|
+
|
|
26
|
+
var FindReplaceToolbarButtonWithState = function FindReplaceToolbarButtonWithState(props) {
|
|
27
|
+
var popupsBoundariesElement = props.popupsBoundariesElement,
|
|
28
|
+
popupsMountPoint = props.popupsMountPoint,
|
|
29
|
+
popupsScrollableElement = props.popupsScrollableElement,
|
|
30
|
+
isToolbarReducedSpacing = props.isToolbarReducedSpacing,
|
|
31
|
+
editorView = props.editorView,
|
|
32
|
+
containerElement = props.containerElement,
|
|
33
|
+
dispatchAnalyticsEvent = props.dispatchAnalyticsEvent;
|
|
34
|
+
|
|
35
|
+
if (!editorView) {
|
|
36
|
+
return null;
|
|
37
|
+
} // we need the editor to be in focus for scrollIntoView() to work
|
|
38
|
+
// so we focus it while we run the command, then put focus back into
|
|
39
|
+
// whatever element was previously focused in find replace component
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
var runWithEditorFocused = function runWithEditorFocused(fn) {
|
|
43
|
+
var activeElement = document.activeElement;
|
|
44
|
+
editorView.focus();
|
|
45
|
+
fn();
|
|
46
|
+
activeElement === null || activeElement === void 0 ? void 0 : activeElement.focus();
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
var dispatchCommand = function dispatchCommand(cmd) {
|
|
50
|
+
var state = editorView.state,
|
|
51
|
+
dispatch = editorView.dispatch;
|
|
52
|
+
cmd(state, dispatch);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
var handleActivate = function handleActivate() {
|
|
56
|
+
runWithEditorFocused(function () {
|
|
57
|
+
return dispatchCommand((0, _commandsWithAnalytics.activateWithAnalytics)({
|
|
58
|
+
triggerMethod: _analytics.TRIGGER_METHOD.TOOLBAR
|
|
59
|
+
}));
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
var handleFind = function handleFind(keyword) {
|
|
64
|
+
runWithEditorFocused(function () {
|
|
65
|
+
return dispatchCommand((0, _commandsWithAnalytics.findWithAnalytics)({
|
|
66
|
+
editorView: editorView,
|
|
67
|
+
containerElement: containerElement,
|
|
68
|
+
keyword: keyword
|
|
69
|
+
}));
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
var handleFindNext = function handleFindNext(_ref) {
|
|
74
|
+
var triggerMethod = _ref.triggerMethod;
|
|
75
|
+
runWithEditorFocused(function () {
|
|
76
|
+
return dispatchCommand((0, _commandsWithAnalytics.findNextWithAnalytics)({
|
|
77
|
+
triggerMethod: triggerMethod
|
|
78
|
+
}));
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
var handleFindPrev = function handleFindPrev(_ref2) {
|
|
83
|
+
var triggerMethod = _ref2.triggerMethod;
|
|
84
|
+
runWithEditorFocused(function () {
|
|
85
|
+
return dispatchCommand((0, _commandsWithAnalytics.findPrevWithAnalytics)({
|
|
86
|
+
triggerMethod: triggerMethod
|
|
87
|
+
}));
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
var handleReplace = function handleReplace(_ref3) {
|
|
92
|
+
var triggerMethod = _ref3.triggerMethod,
|
|
93
|
+
replaceText = _ref3.replaceText;
|
|
94
|
+
runWithEditorFocused(function () {
|
|
95
|
+
return dispatchCommand((0, _commandsWithAnalytics.replaceWithAnalytics)({
|
|
96
|
+
triggerMethod: triggerMethod,
|
|
97
|
+
replaceText: replaceText
|
|
98
|
+
}));
|
|
99
|
+
});
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
var handleReplaceAll = function handleReplaceAll(_ref4) {
|
|
103
|
+
var replaceText = _ref4.replaceText;
|
|
104
|
+
runWithEditorFocused(function () {
|
|
105
|
+
return dispatchCommand((0, _commandsWithAnalytics.replaceAllWithAnalytics)({
|
|
106
|
+
replaceText: replaceText
|
|
107
|
+
}));
|
|
108
|
+
});
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
var handleFindBlur = function handleFindBlur() {
|
|
112
|
+
dispatchCommand((0, _commands.blur)());
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
var handleCancel = function handleCancel(_ref5) {
|
|
116
|
+
var triggerMethod = _ref5.triggerMethod;
|
|
117
|
+
dispatchCommand((0, _commandsWithAnalytics.cancelSearchWithAnalytics)({
|
|
118
|
+
triggerMethod: triggerMethod
|
|
119
|
+
}));
|
|
120
|
+
editorView.focus();
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
var handleToggleMatchCase = function handleToggleMatchCase() {
|
|
124
|
+
dispatchCommand((0, _commands.toggleMatchCase)());
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
var _getFeatureFlags = (0, _featureFlagsContext.getFeatureFlags)(editorView.state),
|
|
128
|
+
findReplaceMatchCase = _getFeatureFlags.findReplaceMatchCase;
|
|
129
|
+
|
|
130
|
+
return /*#__PURE__*/_react.default.createElement(_WithPluginState.default, {
|
|
131
|
+
debounce: false,
|
|
132
|
+
plugins: {
|
|
133
|
+
findReplaceState: _types.findReplacePluginKey
|
|
134
|
+
},
|
|
135
|
+
render: function render(_ref6) {
|
|
136
|
+
var findReplaceState = _ref6.findReplaceState;
|
|
137
|
+
|
|
138
|
+
if (!findReplaceState) {
|
|
139
|
+
return null;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
return /*#__PURE__*/_react.default.createElement(_FindReplaceToolbarButton.default, {
|
|
143
|
+
allowMatchCase: findReplaceMatchCase,
|
|
144
|
+
shouldMatchCase: findReplaceState.shouldMatchCase,
|
|
145
|
+
onToggleMatchCase: handleToggleMatchCase,
|
|
146
|
+
isActive: findReplaceState.isActive,
|
|
147
|
+
findText: findReplaceState.findText,
|
|
148
|
+
index: findReplaceState.index,
|
|
149
|
+
numMatches: findReplaceState.matches.length,
|
|
150
|
+
replaceText: findReplaceState.replaceText,
|
|
151
|
+
shouldFocus: findReplaceState.shouldFocus,
|
|
152
|
+
popupsBoundariesElement: popupsBoundariesElement,
|
|
153
|
+
popupsMountPoint: popupsMountPoint,
|
|
154
|
+
popupsScrollableElement: popupsScrollableElement,
|
|
155
|
+
isReducedSpacing: !!isToolbarReducedSpacing,
|
|
156
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
157
|
+
onFindBlur: handleFindBlur,
|
|
158
|
+
onCancel: handleCancel,
|
|
159
|
+
onActivate: handleActivate,
|
|
160
|
+
onFind: handleFind,
|
|
161
|
+
onFindNext: handleFindNext,
|
|
162
|
+
onFindPrev: handleFindPrev,
|
|
163
|
+
onReplace: handleReplace,
|
|
164
|
+
onReplaceAll: handleReplaceAll,
|
|
165
|
+
takeFullWidth: !!props.takeFullWidth
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
var _default = FindReplaceToolbarButtonWithState;
|
|
172
|
+
exports.default = _default;
|