@atlaskit/editor-core 176.0.2 → 177.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +2 -2
- package/CHANGELOG.md +114 -0
- package/codemods/{173.0.0-rename-unsafe-allowUndoRedoButton-prop.ts → 175.0.0-rename-unsafe-allowUndoRedoButton-prop.ts} +0 -0
- package/dist/cjs/create-editor/ReactEditorView.js +3 -1
- package/dist/cjs/create-editor/create-plugins-list.js +9 -6
- package/dist/cjs/create-editor/messages.js +17 -0
- package/dist/cjs/i18n/en.js +2 -2
- package/dist/cjs/i18n/en_GB.js +2 -2
- package/dist/cjs/i18n/en_ZZ.js +2 -2
- package/dist/cjs/i18n/index.js +4 -4
- package/dist/cjs/i18n/languages.js +9 -4
- package/dist/cjs/labs/next/presets/mobile.js +2 -2
- package/dist/cjs/labs/next/presets/preset.js +38 -6
- package/dist/cjs/plugins/annotation/nodeviews/index.js +1 -0
- package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/index.js +6 -1
- package/dist/cjs/plugins/breakout/ui/LayoutButton.js +5 -1
- package/dist/cjs/plugins/card/pm-plugins/doc.js +18 -29
- package/dist/cjs/plugins/card/pm-plugins/main.js +7 -21
- package/dist/cjs/plugins/card/toolbar.js +24 -8
- package/dist/cjs/plugins/card/ui/EditLinkToolbar.js +9 -5
- package/dist/cjs/plugins/card/ui/LinkToolbarAppearance.js +19 -53
- package/dist/cjs/plugins/card/utils.js +17 -3
- package/dist/cjs/plugins/collab-edit/actions.js +3 -3
- package/dist/cjs/plugins/copy-button/toolbar.js +5 -3
- package/dist/cjs/plugins/date/index.js +1 -7
- package/dist/cjs/plugins/date/ui/DatePicker/index.js +1 -2
- package/dist/cjs/plugins/emoji/index.js +7 -14
- package/dist/cjs/plugins/expand/pm-plugins/main.js +4 -1
- package/dist/cjs/plugins/expand/toolbar.js +1 -0
- package/dist/cjs/plugins/extension/commands.js +17 -2
- package/dist/cjs/plugins/extension/pm-plugins/main.js +10 -0
- package/dist/cjs/plugins/extension/toolbar.js +49 -7
- package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +11 -11
- package/dist/cjs/plugins/find-replace/ui/FindReplaceToolbarButton.js +7 -2
- package/dist/cjs/plugins/floating-toolbar/index.js +16 -4
- package/dist/cjs/plugins/floating-toolbar/ui/CheckboxModal.js +99 -0
- package/dist/cjs/plugins/floating-toolbar/ui/ConfirmationModal.js +10 -30
- package/dist/cjs/plugins/floating-toolbar/ui/Dropdown.js +16 -4
- package/dist/cjs/plugins/floating-toolbar/ui/DropdownMenu.js +108 -55
- package/dist/cjs/plugins/floating-toolbar/ui/EmojiPickerButton.js +1 -2
- package/dist/cjs/plugins/floating-toolbar/ui/ScrollButtons.js +29 -108
- package/dist/cjs/plugins/floating-toolbar/ui/SimpleModal.js +51 -0
- package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +27 -47
- package/dist/cjs/plugins/floating-toolbar/ui/messages.js +13 -3
- package/dist/cjs/plugins/floating-toolbar/utils.js +4 -19
- package/dist/cjs/plugins/help-dialog/index.js +3 -2
- package/dist/cjs/plugins/hyperlink/Toolbar.js +20 -1
- package/dist/cjs/plugins/hyperlink/ui/EditorLinkPicker/index.js +6 -3
- package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +5 -10
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +2 -1
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +2 -1
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.js +2 -1
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +2 -1
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +2 -0
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/item.js +26 -12
- package/dist/cjs/plugins/layout/toolbar.js +1 -0
- package/dist/cjs/plugins/list/actions/outdent-list-items-selected.js +34 -4
- package/dist/cjs/plugins/list/commands/outdent-list.js +1 -1
- package/dist/cjs/plugins/list/index.js +6 -2
- package/dist/cjs/plugins/list/pm-plugins/input-rules/create-list-input-rule.js +13 -2
- package/dist/cjs/plugins/list/pm-plugins/input-rules/index.js +5 -2
- package/dist/cjs/plugins/list/pm-plugins/main.js +32 -10
- package/dist/cjs/plugins/media/index.js +35 -0
- package/dist/cjs/plugins/media/nodeviews/mediaGroup.js +7 -6
- package/dist/cjs/plugins/media/nodeviews/mediaInline.js +3 -1
- package/dist/cjs/plugins/media/nodeviews/mediaNodeUpdater.js +70 -64
- package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +3 -1
- package/dist/cjs/plugins/media/pm-plugins/main.js +6 -0
- package/dist/cjs/plugins/media/toolbar/index.js +3 -0
- package/dist/cjs/plugins/media/utils/media-single.js +19 -3
- package/dist/cjs/plugins/panel/toolbar.js +1 -0
- package/dist/cjs/plugins/panel/utils.js +1 -1
- package/dist/cjs/plugins/paste/index.js +2 -1
- package/dist/cjs/plugins/paste/pm-plugins/analytics.js +19 -3
- package/dist/cjs/plugins/paste/pm-plugins/main.js +1 -1
- package/dist/cjs/plugins/paste/util/index.js +2 -2
- package/dist/cjs/plugins/placeholder/index.js +24 -47
- package/dist/cjs/plugins/placeholder/styles.js +2 -4
- package/dist/cjs/plugins/tasks-and-decisions/nodeviews/taskItem.js +7 -3
- package/dist/cjs/plugins/tasks-and-decisions/ui/ToolbarDecision/index.js +1 -0
- package/dist/cjs/plugins/text-color/ui/ToolbarTextColor/index.js +10 -5
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/hooks/formatting-icons.js +5 -1
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/single-toolbar-buttons.js +5 -1
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/Toolbar.js +16 -6
- package/dist/cjs/plugins/type-ahead/index.js +2 -8
- package/dist/cjs/plugins/type-ahead/messages.js +44 -4
- package/dist/cjs/plugins/type-ahead/pm-plugins/decorations.js +0 -1
- package/dist/cjs/plugins/type-ahead/ui/InputQuery.js +17 -1
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadList.js +9 -4
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadListItem.js +8 -5
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadPopup.js +2 -1
- package/dist/cjs/plugins/type-ahead/utils.js +44 -2
- package/dist/cjs/plugins/undo-redo/ui/ToolbarUndoRedo/index.js +6 -2
- package/dist/cjs/ui/Alignment/AlignmentButton/index.js +4 -1
- package/dist/cjs/ui/Appearance/Comment/Toolbar.js +1 -1
- package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +2 -1
- package/dist/cjs/ui/CollapsedEditor/index.js +4 -2
- package/dist/cjs/ui/ColorPickerButton/index.js +2 -1
- package/dist/cjs/ui/ConfigPanel/Fields/Fieldset.js +3 -4
- package/dist/cjs/ui/ConfigPanel/FormContent.js +2 -1
- package/dist/cjs/ui/ContentStyles/index.js +1 -1
- package/dist/cjs/ui/LinkSearch/ToolbarComponents.js +3 -1
- package/dist/cjs/ui/ToolbarArrowKeyNavigationProvider/index.js +55 -33
- package/dist/cjs/utils/commands.js +25 -13
- package/dist/cjs/utils/input-rules.js +26 -2
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/create-editor/ReactEditorView.js +2 -1
- package/dist/es2019/create-editor/create-plugins-list.js +9 -6
- package/dist/es2019/create-editor/messages.js +8 -0
- package/dist/es2019/i18n/en.js +2 -2
- package/dist/es2019/i18n/en_GB.js +2 -2
- package/dist/es2019/i18n/en_ZZ.js +2 -2
- package/dist/es2019/i18n/index.js +4 -4
- package/dist/es2019/i18n/languages.js +9 -4
- package/dist/es2019/labs/next/presets/mobile.js +2 -2
- package/dist/es2019/labs/next/presets/preset.js +28 -7
- package/dist/es2019/plugins/annotation/nodeviews/index.js +1 -0
- package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/index.js +5 -1
- package/dist/es2019/plugins/breakout/ui/LayoutButton.js +4 -1
- package/dist/es2019/plugins/card/pm-plugins/doc.js +10 -19
- package/dist/es2019/plugins/card/pm-plugins/main.js +4 -19
- package/dist/es2019/plugins/card/toolbar.js +19 -2
- package/dist/es2019/plugins/card/ui/EditLinkToolbar.js +8 -6
- package/dist/es2019/plugins/card/ui/LinkToolbarAppearance.js +7 -36
- package/dist/es2019/plugins/card/utils.js +15 -2
- package/dist/es2019/plugins/collab-edit/actions.js +3 -3
- package/dist/es2019/plugins/copy-button/toolbar.js +5 -3
- package/dist/es2019/plugins/date/index.js +0 -7
- package/dist/es2019/plugins/date/ui/DatePicker/index.js +1 -2
- package/dist/es2019/plugins/emoji/index.js +7 -13
- package/dist/es2019/plugins/expand/pm-plugins/main.js +3 -3
- package/dist/es2019/plugins/expand/toolbar.js +1 -0
- package/dist/es2019/plugins/extension/commands.js +10 -1
- package/dist/es2019/plugins/extension/pm-plugins/main.js +10 -0
- package/dist/es2019/plugins/extension/toolbar.js +43 -8
- package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +11 -11
- package/dist/es2019/plugins/find-replace/ui/FindReplaceToolbarButton.js +7 -3
- package/dist/es2019/plugins/floating-toolbar/index.js +15 -5
- package/dist/es2019/plugins/floating-toolbar/ui/CheckboxModal.js +70 -0
- package/dist/es2019/plugins/floating-toolbar/ui/ConfirmationModal.js +8 -27
- package/dist/es2019/plugins/floating-toolbar/ui/Dropdown.js +17 -4
- package/dist/es2019/plugins/floating-toolbar/ui/DropdownMenu.js +96 -50
- package/dist/es2019/plugins/floating-toolbar/ui/EmojiPickerButton.js +1 -1
- package/dist/es2019/plugins/floating-toolbar/ui/ScrollButtons.js +29 -76
- package/dist/es2019/plugins/floating-toolbar/ui/SimpleModal.js +32 -0
- package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +26 -46
- package/dist/es2019/plugins/floating-toolbar/ui/messages.js +14 -4
- package/dist/es2019/plugins/floating-toolbar/utils.js +4 -17
- package/dist/es2019/plugins/help-dialog/index.js +2 -2
- package/dist/es2019/plugins/hyperlink/Toolbar.js +18 -2
- package/dist/es2019/plugins/hyperlink/ui/EditorLinkPicker/index.js +9 -2
- package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +5 -9
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +2 -1
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +2 -1
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.js +2 -1
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +2 -1
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +2 -0
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/item.js +25 -12
- package/dist/es2019/plugins/layout/toolbar.js +1 -0
- package/dist/es2019/plugins/list/actions/outdent-list-items-selected.js +24 -4
- package/dist/es2019/plugins/list/commands/outdent-list.js +1 -1
- package/dist/es2019/plugins/list/index.js +7 -3
- package/dist/es2019/plugins/list/pm-plugins/input-rules/create-list-input-rule.js +13 -2
- package/dist/es2019/plugins/list/pm-plugins/input-rules/index.js +5 -2
- package/dist/es2019/plugins/list/pm-plugins/main.js +31 -11
- package/dist/es2019/plugins/media/index.js +38 -0
- package/dist/es2019/plugins/media/nodeviews/mediaGroup.js +6 -5
- package/dist/es2019/plugins/media/nodeviews/mediaInline.js +3 -1
- package/dist/es2019/plugins/media/nodeviews/mediaNodeUpdater.js +2 -2
- package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +3 -1
- package/dist/es2019/plugins/media/pm-plugins/main.js +7 -0
- package/dist/es2019/plugins/media/toolbar/index.js +3 -0
- package/dist/es2019/plugins/media/utils/media-single.js +20 -3
- package/dist/es2019/plugins/panel/toolbar.js +1 -0
- package/dist/es2019/plugins/panel/utils.js +1 -1
- package/dist/es2019/plugins/paste/index.js +2 -1
- package/dist/es2019/plugins/paste/pm-plugins/analytics.js +15 -2
- package/dist/es2019/plugins/paste/pm-plugins/main.js +1 -1
- package/dist/es2019/plugins/paste/util/index.js +2 -2
- package/dist/es2019/plugins/placeholder/index.js +21 -47
- package/dist/es2019/plugins/placeholder/styles.js +1 -19
- package/dist/es2019/plugins/tasks-and-decisions/nodeviews/taskItem.js +6 -3
- package/dist/es2019/plugins/tasks-and-decisions/ui/ToolbarDecision/index.js +1 -0
- package/dist/es2019/plugins/text-color/ui/ToolbarTextColor/index.js +8 -7
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/hooks/formatting-icons.js +4 -1
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/single-toolbar-buttons.js +18 -12
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/Toolbar.js +16 -7
- package/dist/es2019/plugins/type-ahead/index.js +2 -2
- package/dist/es2019/plugins/type-ahead/messages.js +44 -4
- package/dist/es2019/plugins/type-ahead/pm-plugins/decorations.js +0 -1
- package/dist/es2019/plugins/type-ahead/ui/InputQuery.js +17 -1
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadList.js +10 -5
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadListItem.js +8 -5
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadPopup.js +2 -1
- package/dist/es2019/plugins/type-ahead/utils.js +38 -0
- package/dist/es2019/plugins/undo-redo/ui/ToolbarUndoRedo/index.js +6 -3
- package/dist/es2019/ui/Alignment/AlignmentButton/index.js +4 -2
- package/dist/es2019/ui/Appearance/Comment/Toolbar.js +2 -2
- package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +2 -1
- package/dist/es2019/ui/CollapsedEditor/index.js +3 -2
- package/dist/es2019/ui/ColorPickerButton/index.js +2 -1
- package/dist/es2019/ui/ConfigPanel/Fields/Fieldset.js +4 -5
- package/dist/es2019/ui/ConfigPanel/FormContent.js +3 -3
- package/dist/es2019/ui/ContentStyles/index.js +7 -2
- package/dist/es2019/ui/LinkSearch/ToolbarComponents.js +1 -0
- package/dist/es2019/ui/ToolbarArrowKeyNavigationProvider/index.js +56 -34
- package/dist/es2019/utils/commands.js +26 -14
- package/dist/es2019/utils/input-rules.js +22 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/create-editor/ReactEditorView.js +2 -1
- package/dist/esm/create-editor/create-plugins-list.js +9 -6
- package/dist/esm/create-editor/messages.js +8 -0
- package/dist/esm/i18n/en.js +2 -2
- package/dist/esm/i18n/en_GB.js +2 -2
- package/dist/esm/i18n/en_ZZ.js +2 -2
- package/dist/esm/i18n/index.js +4 -4
- package/dist/esm/i18n/languages.js +9 -4
- package/dist/esm/labs/next/presets/mobile.js +2 -2
- package/dist/esm/labs/next/presets/preset.js +36 -6
- package/dist/esm/plugins/annotation/nodeviews/index.js +1 -0
- package/dist/esm/plugins/block-type/ui/ToolbarBlockType/index.js +5 -1
- package/dist/esm/plugins/breakout/ui/LayoutButton.js +4 -1
- package/dist/esm/plugins/card/pm-plugins/doc.js +10 -20
- package/dist/esm/plugins/card/pm-plugins/main.js +4 -17
- package/dist/esm/plugins/card/toolbar.js +24 -8
- package/dist/esm/plugins/card/ui/EditLinkToolbar.js +8 -6
- package/dist/esm/plugins/card/ui/LinkToolbarAppearance.js +9 -39
- package/dist/esm/plugins/card/utils.js +15 -2
- package/dist/esm/plugins/collab-edit/actions.js +3 -3
- package/dist/esm/plugins/copy-button/toolbar.js +5 -3
- package/dist/esm/plugins/date/index.js +1 -6
- package/dist/esm/plugins/date/ui/DatePicker/index.js +1 -2
- package/dist/esm/plugins/emoji/index.js +7 -13
- package/dist/esm/plugins/expand/pm-plugins/main.js +3 -3
- package/dist/esm/plugins/expand/toolbar.js +1 -0
- package/dist/esm/plugins/extension/commands.js +12 -1
- package/dist/esm/plugins/extension/pm-plugins/main.js +10 -0
- package/dist/esm/plugins/extension/toolbar.js +50 -8
- package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +11 -11
- package/dist/esm/plugins/find-replace/ui/FindReplaceToolbarButton.js +7 -3
- package/dist/esm/plugins/floating-toolbar/index.js +16 -4
- package/dist/esm/plugins/floating-toolbar/ui/CheckboxModal.js +75 -0
- package/dist/esm/plugins/floating-toolbar/ui/ConfirmationModal.js +11 -25
- package/dist/esm/plugins/floating-toolbar/ui/Dropdown.js +17 -4
- package/dist/esm/plugins/floating-toolbar/ui/DropdownMenu.js +100 -47
- package/dist/esm/plugins/floating-toolbar/ui/EmojiPickerButton.js +1 -1
- package/dist/esm/plugins/floating-toolbar/ui/ScrollButtons.js +29 -108
- package/dist/esm/plugins/floating-toolbar/ui/SimpleModal.js +30 -0
- package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +27 -47
- package/dist/esm/plugins/floating-toolbar/ui/messages.js +13 -3
- package/dist/esm/plugins/floating-toolbar/utils.js +4 -17
- package/dist/esm/plugins/help-dialog/index.js +3 -2
- package/dist/esm/plugins/hyperlink/Toolbar.js +20 -2
- package/dist/esm/plugins/hyperlink/ui/EditorLinkPicker/index.js +10 -3
- package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +5 -10
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +2 -1
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +2 -1
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.js +2 -1
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +2 -1
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +2 -0
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/item.js +25 -12
- package/dist/esm/plugins/layout/toolbar.js +1 -0
- package/dist/esm/plugins/list/actions/outdent-list-items-selected.js +30 -4
- package/dist/esm/plugins/list/commands/outdent-list.js +1 -1
- package/dist/esm/plugins/list/index.js +7 -3
- package/dist/esm/plugins/list/pm-plugins/input-rules/create-list-input-rule.js +13 -2
- package/dist/esm/plugins/list/pm-plugins/input-rules/index.js +5 -2
- package/dist/esm/plugins/list/pm-plugins/main.js +31 -11
- package/dist/esm/plugins/media/index.js +33 -0
- package/dist/esm/plugins/media/nodeviews/mediaGroup.js +7 -6
- package/dist/esm/plugins/media/nodeviews/mediaInline.js +3 -1
- package/dist/esm/plugins/media/nodeviews/mediaNodeUpdater.js +70 -64
- package/dist/esm/plugins/media/nodeviews/mediaSingle.js +3 -1
- package/dist/esm/plugins/media/pm-plugins/main.js +7 -0
- package/dist/esm/plugins/media/toolbar/index.js +3 -0
- package/dist/esm/plugins/media/utils/media-single.js +18 -3
- package/dist/esm/plugins/panel/toolbar.js +1 -0
- package/dist/esm/plugins/panel/utils.js +1 -1
- package/dist/esm/plugins/paste/index.js +2 -1
- package/dist/esm/plugins/paste/pm-plugins/analytics.js +15 -2
- package/dist/esm/plugins/paste/pm-plugins/main.js +1 -1
- package/dist/esm/plugins/paste/util/index.js +2 -2
- package/dist/esm/plugins/placeholder/index.js +23 -45
- package/dist/esm/plugins/placeholder/styles.js +1 -2
- package/dist/esm/plugins/tasks-and-decisions/nodeviews/taskItem.js +6 -3
- package/dist/esm/plugins/tasks-and-decisions/ui/ToolbarDecision/index.js +1 -0
- package/dist/esm/plugins/text-color/ui/ToolbarTextColor/index.js +9 -5
- package/dist/esm/plugins/text-formatting/ui/Toolbar/hooks/formatting-icons.js +4 -1
- package/dist/esm/plugins/text-formatting/ui/Toolbar/single-toolbar-buttons.js +5 -1
- package/dist/esm/plugins/toolbar-lists-indentation/ui/Toolbar.js +16 -7
- package/dist/esm/plugins/type-ahead/index.js +2 -2
- package/dist/esm/plugins/type-ahead/messages.js +44 -4
- package/dist/esm/plugins/type-ahead/pm-plugins/decorations.js +0 -1
- package/dist/esm/plugins/type-ahead/ui/InputQuery.js +17 -1
- package/dist/esm/plugins/type-ahead/ui/TypeAheadList.js +10 -5
- package/dist/esm/plugins/type-ahead/ui/TypeAheadListItem.js +8 -5
- package/dist/esm/plugins/type-ahead/ui/TypeAheadPopup.js +2 -1
- package/dist/esm/plugins/type-ahead/utils.js +38 -0
- package/dist/esm/plugins/undo-redo/ui/ToolbarUndoRedo/index.js +6 -3
- package/dist/esm/ui/Alignment/AlignmentButton/index.js +4 -2
- package/dist/esm/ui/Appearance/Comment/Toolbar.js +2 -2
- package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +2 -1
- package/dist/esm/ui/CollapsedEditor/index.js +3 -2
- package/dist/esm/ui/ColorPickerButton/index.js +2 -1
- package/dist/esm/ui/ConfigPanel/Fields/Fieldset.js +4 -5
- package/dist/esm/ui/ConfigPanel/FormContent.js +3 -3
- package/dist/esm/ui/ContentStyles/index.js +1 -1
- package/dist/esm/ui/LinkSearch/ToolbarComponents.js +1 -0
- package/dist/esm/ui/ToolbarArrowKeyNavigationProvider/index.js +56 -34
- package/dist/esm/utils/commands.js +25 -13
- package/dist/esm/utils/input-rules.js +23 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/create-editor/messages.d.ts +7 -0
- package/dist/types/i18n/index.d.ts +4 -4
- package/dist/types/i18n/languages.d.ts +8 -3
- package/dist/types/labs/next/presets/cxhtml.d.ts +1 -1
- package/dist/types/labs/next/presets/default.d.ts +2 -2
- package/dist/types/labs/next/presets/mobile.d.ts +1 -1
- package/dist/types/labs/next/presets/preset.d.ts +10 -6
- package/dist/types/plugins/alignment/index.d.ts +2 -2
- package/dist/types/plugins/analytics/plugin.d.ts +2 -2
- package/dist/types/plugins/annotation/index.d.ts +2 -2
- package/dist/types/plugins/avatar-group/index.d.ts +4 -3
- package/dist/types/plugins/base/index.d.ts +2 -2
- package/dist/types/plugins/before-primaryToolbar/index.d.ts +4 -3
- package/dist/types/plugins/block-type/index.d.ts +2 -2
- package/dist/types/plugins/block-type/ui/ToolbarBlockType/index.d.ts +1 -1
- package/dist/types/plugins/breakout/index.d.ts +2 -2
- package/dist/types/plugins/caption/index.d.ts +2 -2
- package/dist/types/plugins/card/index.d.ts +2 -2
- package/dist/types/plugins/card/pm-plugins/doc.d.ts +4 -4
- package/dist/types/plugins/card/pm-plugins/main.d.ts +1 -1
- package/dist/types/plugins/card/ui/EditLinkToolbar.d.ts +1 -1
- package/dist/types/plugins/card/ui/LinkToolbarAppearance.d.ts +5 -5
- package/dist/types/plugins/card/utils.d.ts +2 -1
- package/dist/types/plugins/clear-marks-on-change-to-empty-document/index.d.ts +2 -2
- package/dist/types/plugins/clipboard/index.d.ts +2 -2
- package/dist/types/plugins/code-bidi-warning/index.d.ts +4 -3
- package/dist/types/plugins/code-block/index.d.ts +2 -2
- package/dist/types/plugins/collab-edit/actions.d.ts +1 -1
- package/dist/types/plugins/collab-edit/index.d.ts +2 -2
- package/dist/types/plugins/context-panel/index.d.ts +2 -2
- package/dist/types/plugins/copy-button/index.d.ts +2 -2
- package/dist/types/plugins/custom-autoformat/index.d.ts +2 -2
- package/dist/types/plugins/data-consumer/index.d.ts +2 -2
- package/dist/types/plugins/date/index.d.ts +2 -2
- package/dist/types/plugins/date/ui/DatePicker/index.d.ts +0 -1
- package/dist/types/plugins/editor-disabled/index.d.ts +2 -2
- package/dist/types/plugins/emoji/index.d.ts +2 -2
- package/dist/types/plugins/emoji/types.d.ts +2 -1
- package/dist/types/plugins/expand/index.d.ts +2 -2
- package/dist/types/plugins/expand/pm-plugins/main.d.ts +1 -0
- package/dist/types/plugins/extension/commands.d.ts +2 -0
- package/dist/types/plugins/extension/index.d.ts +2 -2
- package/dist/types/plugins/extension/toolbar.d.ts +10 -0
- package/dist/types/plugins/fake-text-cursor/index.d.ts +2 -2
- package/dist/types/plugins/feature-flags-context/index.d.ts +2 -2
- package/dist/types/plugins/feedback-dialog/index.d.ts +3 -2
- package/dist/types/plugins/find-replace/index.d.ts +4 -3
- package/dist/types/plugins/floating-toolbar/index.d.ts +2 -2
- package/dist/types/plugins/floating-toolbar/ui/CheckboxModal.d.ts +4 -0
- package/dist/types/plugins/floating-toolbar/ui/ConfirmationModal.d.ts +1 -8
- package/dist/types/plugins/floating-toolbar/ui/Dropdown.d.ts +3 -0
- package/dist/types/plugins/floating-toolbar/ui/DropdownMenu.d.ts +4 -0
- package/dist/types/plugins/floating-toolbar/ui/SimpleModal.d.ts +4 -0
- package/dist/types/plugins/floating-toolbar/ui/messages.d.ts +10 -0
- package/dist/types/plugins/floating-toolbar/ui/types.d.ts +1 -1
- package/dist/types/plugins/floating-toolbar/utils.d.ts +2 -3
- package/dist/types/plugins/fragment/index.d.ts +2 -2
- package/dist/types/plugins/grid/index.d.ts +2 -2
- package/dist/types/plugins/help-dialog/index.d.ts +2 -3
- package/dist/types/plugins/history/index.d.ts +2 -2
- package/dist/types/plugins/hyperlink/index.d.ts +2 -2
- package/dist/types/plugins/hyperlink/ui/EditorLinkPicker/index.d.ts +7 -2
- package/dist/types/plugins/hyperlink/ui/HyperlinkAddToolbar/index.d.ts +2 -1
- package/dist/types/plugins/image-upload/index.d.ts +2 -2
- package/dist/types/plugins/indentation/index.d.ts +2 -2
- package/dist/types/plugins/insert-block/index.d.ts +2 -2
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.d.ts +1 -0
- package/dist/types/plugins/jira-issue/index.d.ts +2 -2
- package/dist/types/plugins/layout/index.d.ts +2 -2
- package/dist/types/plugins/list/actions/outdent-list-items-selected.d.ts +2 -2
- package/dist/types/plugins/list/index.d.ts +3 -2
- package/dist/types/plugins/list/pm-plugins/input-rules/create-list-input-rule.d.ts +3 -1
- package/dist/types/plugins/list/pm-plugins/main.d.ts +2 -2
- package/dist/types/plugins/list/types.d.ts +2 -0
- package/dist/types/plugins/macro/index.d.ts +2 -2
- package/dist/types/plugins/max-content-size/index.d.ts +2 -2
- package/dist/types/plugins/media/index.d.ts +2 -2
- package/dist/types/plugins/media/nodeviews/mediaNodeUpdater.d.ts +2 -1
- package/dist/types/plugins/media/pm-plugins/main.d.ts +1 -0
- package/dist/types/plugins/media/pm-plugins/types.d.ts +1 -0
- package/dist/types/plugins/mentions/index.d.ts +2 -2
- package/dist/types/plugins/mobile-dimensions/index.d.ts +2 -2
- package/dist/types/plugins/mobile-selection/mobile-selection-plugin.d.ts +2 -2
- package/dist/types/plugins/panel/index.d.ts +2 -2
- package/dist/types/plugins/paste/index.d.ts +3 -2
- package/dist/types/plugins/paste/pm-plugins/analytics.d.ts +1 -0
- package/dist/types/plugins/placeholder/index.d.ts +4 -4
- package/dist/types/plugins/placeholder/styles.d.ts +0 -1
- package/dist/types/plugins/placeholder-text/index.d.ts +2 -2
- package/dist/types/plugins/quick-insert/index.d.ts +2 -2
- package/dist/types/plugins/rule/index.d.ts +2 -2
- package/dist/types/plugins/save-on-enter/index.d.ts +3 -2
- package/dist/types/plugins/scroll-into-view/index.d.ts +2 -2
- package/dist/types/plugins/selection/index.d.ts +2 -2
- package/dist/types/plugins/status/index.d.ts +2 -2
- package/dist/types/plugins/submit-editor/index.d.ts +4 -2
- package/dist/types/plugins/tasks-and-decisions/index.d.ts +2 -2
- package/dist/types/plugins/text-color/index.d.ts +3 -2
- package/dist/types/plugins/text-formatting/index.d.ts +2 -2
- package/dist/types/plugins/toolbar-lists-indentation/index.d.ts +4 -3
- package/dist/types/plugins/type-ahead/index.d.ts +2 -2
- package/dist/types/plugins/type-ahead/messages.d.ts +41 -1
- package/dist/types/plugins/type-ahead/ui/TypeAheadList.d.ts +3 -1
- package/dist/types/plugins/type-ahead/ui/TypeAheadListItem.d.ts +1 -0
- package/dist/types/plugins/type-ahead/utils.d.ts +7 -1
- package/dist/types/plugins/undo-redo/index.d.ts +2 -2
- package/dist/types/plugins/unsupported-content/index.d.ts +2 -2
- package/dist/types/plugins/view-update-subscription/index.d.ts +2 -2
- package/dist/types/plugins/width/index.d.ts +2 -2
- package/dist/types/test-utils.d.ts +2 -1
- package/dist/types/types/editor-plugin.d.ts +1 -1
- package/dist/types/types/editor-props.d.ts +0 -2
- package/dist/types/types/index.d.ts +1 -1
- package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +3 -3
- package/dist/types/ui/ConfigPanel/ConfigPanel.d.ts +1 -1
- package/dist/types/ui/ConfigPanel/Fields/Fieldset.d.ts +2 -1
- package/dist/types/ui/ConfigPanel/FormContent.d.ts +2 -23
- package/dist/types/ui/ConfigPanel/types.d.ts +22 -0
- package/dist/types/ui/ContentStyles/index.d.ts +2 -2
- package/dist/types/ui/LinkSearch/ToolbarComponents.d.ts +1 -0
- package/dist/types/ui/ToolbarArrowKeyNavigationProvider/index.d.ts +4 -1
- package/package.json +24 -24
- package/report.api.md +25 -16
- package/dist/cjs/plugins/card/ui/LinkToolbarIconDropdown.js +0 -181
- package/dist/cjs/plugins/card/ui/link-toolbar-icon-dropdown-options.js +0 -66
- package/dist/cjs/plugins/emoji/ui/EmojiContextProvider/index.js +0 -61
- package/dist/es2019/plugins/card/ui/LinkToolbarIconDropdown.js +0 -151
- package/dist/es2019/plugins/card/ui/link-toolbar-icon-dropdown-options.js +0 -51
- package/dist/es2019/plugins/emoji/ui/EmojiContextProvider/index.js +0 -21
- package/dist/esm/plugins/card/ui/LinkToolbarIconDropdown.js +0 -161
- package/dist/esm/plugins/card/ui/link-toolbar-icon-dropdown-options.js +0 -51
- package/dist/esm/plugins/emoji/ui/EmojiContextProvider/index.js +0 -46
- package/dist/types/plugins/card/ui/LinkToolbarIconDropdown.d.ts +0 -25
- package/dist/types/plugins/card/ui/link-toolbar-icon-dropdown-options.d.ts +0 -5
- package/dist/types/plugins/emoji/ui/EmojiContextProvider/index.d.ts +0 -13
|
@@ -249,7 +249,7 @@ export class MediaNodeUpdater {
|
|
|
249
249
|
})(this.props.view.state, this.props.view.dispatch);
|
|
250
250
|
});
|
|
251
251
|
|
|
252
|
-
_defineProperty(this, "copyNode", async
|
|
252
|
+
_defineProperty(this, "copyNode", async traceContext => {
|
|
253
253
|
const mediaProvider = await this.props.mediaProvider;
|
|
254
254
|
const {
|
|
255
255
|
isMediaSingle,
|
|
@@ -283,7 +283,7 @@ export class MediaNodeUpdater {
|
|
|
283
283
|
authProvider: uploadMediaClientConfig.authProvider,
|
|
284
284
|
occurrenceKey: uuidV4()
|
|
285
285
|
};
|
|
286
|
-
const mediaFile = await mediaClient.file.copyFile(source, destination);
|
|
286
|
+
const mediaFile = await mediaClient.file.copyFile(source, destination, undefined, traceContext);
|
|
287
287
|
updateMediaNodeAttrs(source.id, {
|
|
288
288
|
id: mediaFile.id,
|
|
289
289
|
collection: currentCollectionName,
|
|
@@ -100,7 +100,9 @@ export default class MediaSingleNode extends Component {
|
|
|
100
100
|
});
|
|
101
101
|
|
|
102
102
|
try {
|
|
103
|
-
const copyNode = mediaNodeUpdater.copyNode(
|
|
103
|
+
const copyNode = mediaNodeUpdater.copyNode({
|
|
104
|
+
traceId: node.attrs.__mediaTraceId
|
|
105
|
+
});
|
|
104
106
|
addPendingTask(copyNode);
|
|
105
107
|
await copyNode;
|
|
106
108
|
} catch (e) {
|
|
@@ -407,6 +407,13 @@ export class MediaPluginStateImplementation {
|
|
|
407
407
|
}
|
|
408
408
|
});
|
|
409
409
|
|
|
410
|
+
_defineProperty(this, "setMediaGroupNode", (node, getPos) => {
|
|
411
|
+
this.mediaGroupNodes[node.attrs.id] = {
|
|
412
|
+
node,
|
|
413
|
+
getPos
|
|
414
|
+
};
|
|
415
|
+
});
|
|
416
|
+
|
|
410
417
|
_defineProperty(this, "removeNodeById", state => {
|
|
411
418
|
const {
|
|
412
419
|
id
|
|
@@ -103,6 +103,7 @@ const generateMediaCardFloatingToolbar = (state, intl, mediaPluginState) => {
|
|
|
103
103
|
id: 'editor.media.delete',
|
|
104
104
|
type: 'button',
|
|
105
105
|
appearance: 'danger',
|
|
106
|
+
focusEditoronEnter: true,
|
|
106
107
|
icon: RemoveIcon,
|
|
107
108
|
onMouseEnter: hoverDecoration(mediaGroup, true),
|
|
108
109
|
onMouseLeave: hoverDecoration(mediaGroup, false),
|
|
@@ -178,6 +179,7 @@ const generateMediaInlineFloatingToolbar = (state, intl, mediaPluginState) => {
|
|
|
178
179
|
id: 'editor.media.delete',
|
|
179
180
|
type: 'button',
|
|
180
181
|
appearance: 'danger',
|
|
182
|
+
focusEditoronEnter: true,
|
|
181
183
|
icon: RemoveIcon,
|
|
182
184
|
onMouseEnter: hoverDecoration(mediaInline, true),
|
|
183
185
|
onMouseLeave: hoverDecoration(mediaInline, false),
|
|
@@ -271,6 +273,7 @@ const generateMediaSingleFloatingToolbar = (state, intl, options, pluginState, m
|
|
|
271
273
|
id: 'editor.media.delete',
|
|
272
274
|
type: 'button',
|
|
273
275
|
appearance: 'danger',
|
|
276
|
+
focusEditoronEnter: true,
|
|
274
277
|
icon: RemoveIcon,
|
|
275
278
|
onMouseEnter: hoverDecoration(mediaSingle, true),
|
|
276
279
|
onMouseLeave: hoverDecoration(mediaSingle, false),
|
|
@@ -10,6 +10,7 @@ import { safeInsert, shouldSplitSelectedNodeOnNodeInsertion } from '../../../uti
|
|
|
10
10
|
import { getFeatureFlags } from '../../feature-flags-context';
|
|
11
11
|
import { isImage } from './is-image';
|
|
12
12
|
import { atTheBeginningOfBlock } from '../../../utils/prosemirror/position';
|
|
13
|
+
import { getRandomHex } from '@atlaskit/media-common';
|
|
13
14
|
|
|
14
15
|
const getInsertMediaAnalytics = (inputMethod, fileExtension) => ({
|
|
15
16
|
action: ACTION.INSERTED,
|
|
@@ -185,6 +186,7 @@ export function transformSliceForMedia(slice, schema) {
|
|
|
185
186
|
bulletList,
|
|
186
187
|
orderedList,
|
|
187
188
|
media,
|
|
189
|
+
mediaInline,
|
|
188
190
|
expand
|
|
189
191
|
} = schema.nodes;
|
|
190
192
|
return selection => {
|
|
@@ -199,9 +201,24 @@ export function transformSliceForMedia(slice, schema) {
|
|
|
199
201
|
});
|
|
200
202
|
}
|
|
201
203
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
204
|
+
const __mediaTraceId = getRandomHex(8);
|
|
205
|
+
|
|
206
|
+
newSlice = mapSlice(newSlice, node => {
|
|
207
|
+
if (node.type.name === 'media') {
|
|
208
|
+
return media.createChecked({ ...node.attrs,
|
|
209
|
+
__external: node.attrs.type === 'external',
|
|
210
|
+
__mediaTraceId: node.attrs.type === 'external' ? null : __mediaTraceId
|
|
211
|
+
}, node.content, node.marks);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
if (node.type.name === 'mediaInline') {
|
|
215
|
+
return mediaInline.createChecked({ ...node.attrs,
|
|
216
|
+
__mediaTraceId
|
|
217
|
+
}, node.content, node.marks);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
return node;
|
|
221
|
+
});
|
|
205
222
|
return newSlice;
|
|
206
223
|
};
|
|
207
224
|
}
|
|
@@ -250,6 +250,7 @@ export const getToolbarItems = (formatMessage, panelNodeType, isCustomPanelEnabl
|
|
|
250
250
|
id: 'editor.panel.delete',
|
|
251
251
|
type: 'button',
|
|
252
252
|
appearance: 'danger',
|
|
253
|
+
focusEditoronEnter: true,
|
|
253
254
|
icon: RemoveIcon,
|
|
254
255
|
onClick: removePanel(),
|
|
255
256
|
onMouseEnter: hoverDecoration(panelNodeType, true),
|
|
@@ -17,7 +17,7 @@ export const panelAttrsToDom = (attrs, allowCustomPanel) => {
|
|
|
17
17
|
} = attrs;
|
|
18
18
|
const isCustomPanel = panelType === PanelType.CUSTOM && allowCustomPanel;
|
|
19
19
|
const hasIcon = !isCustomPanel || !!panelIcon || !!panelIconId;
|
|
20
|
-
const style = [`${panelColor && isCustomPanel ? `background-color: ${panelColor};` : ''}`, `${hasIcon ? '' : 'padding: 12px;'}`].join('');
|
|
20
|
+
const style = [`${panelColor && isCustomPanel ? `background-color: ${panelColor};` : ''}`, `${hasIcon ? '' : 'padding-left: 12px;'}`].join('');
|
|
21
21
|
let panelAttrs = {
|
|
22
22
|
class: PanelSharedCssClassName.prefix,
|
|
23
23
|
'data-panel-type': panelType || PanelType.INFO,
|
|
@@ -94,6 +94,17 @@ export function getContent(state, slice) {
|
|
|
94
94
|
const pasteContent = contentToPasteContent[type];
|
|
95
95
|
return pasteContent ? pasteContent : PasteContents.uncategorized;
|
|
96
96
|
}
|
|
97
|
+
export function getMediaTraceId(slice) {
|
|
98
|
+
let traceId;
|
|
99
|
+
mapSlice(slice, node => {
|
|
100
|
+
if (node.type.name === 'media' || node.type.name === 'mediaInline') {
|
|
101
|
+
traceId = node.attrs.__mediaTraceId;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return node;
|
|
105
|
+
});
|
|
106
|
+
return traceId;
|
|
107
|
+
}
|
|
97
108
|
|
|
98
109
|
function getActionSubjectId(view) {
|
|
99
110
|
const {
|
|
@@ -163,7 +174,8 @@ export function createPasteAnalyticsPayload(view, event, slice, pasteContext) {
|
|
|
163
174
|
const actionSubjectId = getActionSubjectId(view);
|
|
164
175
|
const pasteSize = slice.size;
|
|
165
176
|
const content = getContent(view.state, slice);
|
|
166
|
-
const linkUrls = [];
|
|
177
|
+
const linkUrls = [];
|
|
178
|
+
const mediaTraceId = getMediaTraceId(slice); // If we have a link among the pasted content, grab the
|
|
167
179
|
// domain and send it up with the analytics event
|
|
168
180
|
|
|
169
181
|
if (content === PasteContents.url || content === PasteContents.mixed) {
|
|
@@ -202,7 +214,8 @@ export function createPasteAnalyticsPayload(view, event, slice, pasteContext) {
|
|
|
202
214
|
content,
|
|
203
215
|
source,
|
|
204
216
|
hyperlinkPasteOnText: !!pasteContext.hyperlinkPasteOnText,
|
|
205
|
-
linksInPasteCount: linkUrls.length
|
|
217
|
+
linksInPasteCount: linkUrls.length,
|
|
218
|
+
mediaTraceId
|
|
206
219
|
}, linkDomains);
|
|
207
220
|
} // TODO: ED-6612 We should not dispatch only analytics, it's preferred to wrap each command with his own analytics.
|
|
208
221
|
// However, handlers like handleMacroAutoConvert dispatch multiple time,
|
|
@@ -238,7 +238,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, cardOptio
|
|
|
238
238
|
}
|
|
239
239
|
}
|
|
240
240
|
|
|
241
|
-
slice = transformUnsupportedBlockCardToInline(slice, state); // Handles edge case so that when copying text from the top level of the document
|
|
241
|
+
slice = transformUnsupportedBlockCardToInline(slice, state, cardOptions); // Handles edge case so that when copying text from the top level of the document
|
|
242
242
|
// it can be pasted into nodes like panels/actions/decisions without removing them.
|
|
243
243
|
// Overriding openStart to be 1 when only pasting a paragraph makes the preferred
|
|
244
244
|
// depth favour the text, rather than the paragraph node.
|
|
@@ -103,8 +103,8 @@ export function isCode(str) {
|
|
|
103
103
|
// @see https://github.com/markdown-it/markdown-it/issues/38
|
|
104
104
|
|
|
105
105
|
export function escapeLinks(text) {
|
|
106
|
-
return text.replace(/(\[([^\]]+)\]\()?((https?|ftp):\/\/[^\s]+)/g, str => {
|
|
107
|
-
return str.match(/^(https?|ftp):\/\/[^\s]+$/) ? `<${str}>` : str;
|
|
106
|
+
return text.replace(/(\[([^\]]+)\]\()?((https?|ftp|jamfselfservice):\/\/[^\s]+)/g, str => {
|
|
107
|
+
return str.match(/^(https?|ftp|jamfselfservice):\/\/[^\s]+$/) ? `<${str}>` : str;
|
|
108
108
|
});
|
|
109
109
|
}
|
|
110
110
|
export function hasOnlyNodesOfType(...nodeTypes) {
|
|
@@ -2,9 +2,7 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
|
2
2
|
import { browser } from '@atlaskit/editor-common/utils';
|
|
3
3
|
import { PluginKey } from 'prosemirror-state';
|
|
4
4
|
import { DecorationSet, Decoration } from 'prosemirror-view';
|
|
5
|
-
import {
|
|
6
|
-
import { pluginKey as alignmentPluginKey } from '../alignment/pm-plugins/main';
|
|
7
|
-
import { placeHolderClassName } from './styles';
|
|
5
|
+
import { isEmptyDocument, bracketTyped } from '../../utils/document';
|
|
8
6
|
export const pluginKey = new PluginKey('placeholderPlugin');
|
|
9
7
|
import { focusStateKey } from '../base/pm-plugins/focus-handler';
|
|
10
8
|
import { isTypeAheadOpen } from '../type-ahead/utils';
|
|
@@ -14,21 +12,23 @@ function getPlaceholderState(editorState) {
|
|
|
14
12
|
return pluginKey.getState(editorState);
|
|
15
13
|
}
|
|
16
14
|
|
|
15
|
+
export const placeholderTestId = 'placeholder-test-id';
|
|
17
16
|
export function createPlaceholderDecoration(editorState, placeholderText, pos = 1) {
|
|
18
17
|
const placeholderDecoration = document.createElement('span');
|
|
19
|
-
let
|
|
20
|
-
|
|
18
|
+
let placeholderNodeWithText = placeholderDecoration;
|
|
19
|
+
placeholderDecoration.setAttribute('data-testid', placeholderTestId);
|
|
20
|
+
placeholderDecoration.className = 'placeholder-decoration'; // PM sets contenteditable to false on Decorations so Firefox doesn't display the flashing cursor
|
|
21
|
+
// So adding an extra span which will contain the placeholder text
|
|
21
22
|
|
|
22
|
-
if (
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
if (browser.gecko) {
|
|
24
|
+
const placeholderNode = document.createElement('span');
|
|
25
|
+
placeholderNode.setAttribute('contenteditable', 'true'); // explicitly overriding the default Decoration behaviour
|
|
26
|
+
|
|
27
|
+
placeholderDecoration.appendChild(placeholderNode);
|
|
28
|
+
placeholderNodeWithText = placeholderNode;
|
|
26
29
|
}
|
|
27
30
|
|
|
28
|
-
|
|
29
|
-
const placeholderNode = document.createElement('span');
|
|
30
|
-
placeholderNode.textContent = placeholderText;
|
|
31
|
-
placeholderDecoration.appendChild(placeholderNode); // ME-2289 Tapping on backspace in empty editor hides and displays the keyboard
|
|
31
|
+
placeholderNodeWithText.textContent = placeholderText || ' '; // ME-2289 Tapping on backspace in empty editor hides and displays the keyboard
|
|
32
32
|
// Add a editable buff node as the cursor moving forward is inevitable
|
|
33
33
|
// when backspace in GBoard composition
|
|
34
34
|
|
|
@@ -40,7 +40,7 @@ export function createPlaceholderDecoration(editorState, placeholderText, pos =
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
return DecorationSet.create(editorState.doc, [Decoration.widget(pos, placeholderDecoration, {
|
|
43
|
-
side:
|
|
43
|
+
side: 0,
|
|
44
44
|
key: 'placeholder'
|
|
45
45
|
})]);
|
|
46
46
|
}
|
|
@@ -57,7 +57,7 @@ const emptyPlaceholder = {
|
|
|
57
57
|
hasPlaceholder: false
|
|
58
58
|
};
|
|
59
59
|
|
|
60
|
-
function createPlaceHolderStateFrom(editorState,
|
|
60
|
+
function createPlaceHolderStateFrom(editorState, defaultPlaceholderText, bracketPlaceholderText) {
|
|
61
61
|
const isEditorFocused = focusStateKey.getState(editorState);
|
|
62
62
|
|
|
63
63
|
if (isTypeAheadOpen(editorState)) {
|
|
@@ -68,15 +68,6 @@ function createPlaceHolderStateFrom(editorState, getPlaceholderHintMessage, defa
|
|
|
68
68
|
return setPlaceHolderState(defaultPlaceholderText);
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
const placeholderHint = getPlaceholderHintMessage();
|
|
72
|
-
|
|
73
|
-
if (placeholderHint && isInEmptyLine(editorState) && isEditorFocused) {
|
|
74
|
-
const {
|
|
75
|
-
$from
|
|
76
|
-
} = editorState.selection;
|
|
77
|
-
return setPlaceHolderState(placeholderHint, $from.pos);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
71
|
if (bracketPlaceholderText && bracketTyped(editorState) && isEditorFocused) {
|
|
81
72
|
const {
|
|
82
73
|
$from
|
|
@@ -89,32 +80,15 @@ function createPlaceHolderStateFrom(editorState, getPlaceholderHintMessage, defa
|
|
|
89
80
|
return emptyPlaceholder;
|
|
90
81
|
}
|
|
91
82
|
|
|
92
|
-
function
|
|
93
|
-
|
|
94
|
-
return () => {
|
|
95
|
-
if (!placeholderHints || placeholderHints.length === 0) {
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
const {
|
|
100
|
-
length
|
|
101
|
-
} = placeholderHints;
|
|
102
|
-
const placeholder = placeholderHints[index++];
|
|
103
|
-
index = index % length;
|
|
104
|
-
return placeholder;
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export function createPlugin(defaultPlaceholderText, placeholderHints, bracketPlaceholderText) {
|
|
109
|
-
if (!defaultPlaceholderText && !placeholderHints && !bracketPlaceholderText) {
|
|
83
|
+
export function createPlugin(defaultPlaceholderText, bracketPlaceholderText) {
|
|
84
|
+
if (!defaultPlaceholderText && !bracketPlaceholderText) {
|
|
110
85
|
return;
|
|
111
86
|
}
|
|
112
87
|
|
|
113
|
-
const getPlaceholderHintMessage = createGetPlaceholderHintMessage(placeholderHints);
|
|
114
88
|
return new SafePlugin({
|
|
115
89
|
key: pluginKey,
|
|
116
90
|
state: {
|
|
117
|
-
init: (_, state) => createPlaceHolderStateFrom(state,
|
|
91
|
+
init: (_, state) => createPlaceHolderStateFrom(state, defaultPlaceholderText, bracketPlaceholderText),
|
|
118
92
|
apply: (tr, _oldPluginState, _oldEditorState, newEditorState) => {
|
|
119
93
|
const meta = tr.getMeta(pluginKey);
|
|
120
94
|
|
|
@@ -124,11 +98,11 @@ export function createPlugin(defaultPlaceholderText, placeholderHints, bracketPl
|
|
|
124
98
|
}
|
|
125
99
|
|
|
126
100
|
if (meta.applyPlaceholderIfEmpty) {
|
|
127
|
-
return createPlaceHolderStateFrom(newEditorState,
|
|
101
|
+
return createPlaceHolderStateFrom(newEditorState, defaultPlaceholderText, bracketPlaceholderText);
|
|
128
102
|
}
|
|
129
103
|
}
|
|
130
104
|
|
|
131
|
-
return createPlaceHolderStateFrom(newEditorState,
|
|
105
|
+
return createPlaceHolderStateFrom(newEditorState, defaultPlaceholderText, bracketPlaceholderText);
|
|
132
106
|
}
|
|
133
107
|
},
|
|
134
108
|
props: {
|
|
@@ -156,7 +130,7 @@ const placeholderPlugin = options => ({
|
|
|
156
130
|
pmPlugins() {
|
|
157
131
|
return [{
|
|
158
132
|
name: 'placeholder',
|
|
159
|
-
plugin: () => createPlugin(options && options.placeholder, options && options.
|
|
133
|
+
plugin: () => createPlugin(options && options.placeholder, options && options.placeholderBracketHint)
|
|
160
134
|
}];
|
|
161
135
|
}
|
|
162
136
|
|
|
@@ -1,29 +1,11 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
2
|
import { N200 } from '@atlaskit/theme/colors';
|
|
3
3
|
import { token } from '@atlaskit/tokens';
|
|
4
|
-
export const placeHolderClassName = 'placeholder-decoration';
|
|
5
4
|
export const placeholderStyles = css`
|
|
6
|
-
.ProseMirror
|
|
7
|
-
position: relative;
|
|
5
|
+
.ProseMirror .placeholder-decoration {
|
|
8
6
|
color: ${token('color.text.subtlest', N200)};
|
|
9
7
|
width: 100%;
|
|
10
|
-
|
|
11
8
|
pointer-events: none;
|
|
12
|
-
display: block;
|
|
13
9
|
user-select: none;
|
|
14
|
-
|
|
15
|
-
> span {
|
|
16
|
-
position: absolute;
|
|
17
|
-
pointer-events: none;
|
|
18
|
-
outline: none;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
&.align-end > span {
|
|
22
|
-
right: 0;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
&.align-center > span {
|
|
26
|
-
left: 0;
|
|
27
|
-
}
|
|
28
10
|
}
|
|
29
11
|
`;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { AnalyticsListener } from '@atlaskit/analytics-next';
|
|
4
|
+
import { SetAttrsStep } from '@atlaskit/adf-schema/steps';
|
|
4
5
|
import { ReactNodeView } from '../../../nodeviews';
|
|
5
6
|
import WithPluginState from '../../../ui/WithPluginState';
|
|
6
7
|
import { stateKey as taskPluginKey } from '../pm-plugins/plugin-key';
|
|
@@ -15,11 +16,13 @@ class Task extends ReactNodeView {
|
|
|
15
16
|
const {
|
|
16
17
|
tr
|
|
17
18
|
} = this.view.state;
|
|
18
|
-
const nodePos = this.getPos();
|
|
19
|
-
|
|
19
|
+
const nodePos = this.getPos(); // SetAttrsStep should be used to prevent task updates from being dropped when mapping task ticks
|
|
20
|
+
// from a previous version of the document, such as a published page.
|
|
21
|
+
|
|
22
|
+
tr.step(new SetAttrsStep(nodePos, {
|
|
20
23
|
state: isChecked ? 'DONE' : 'TODO',
|
|
21
24
|
localId: taskId
|
|
22
|
-
});
|
|
25
|
+
}));
|
|
23
26
|
tr.setMeta('scrollIntoView', false);
|
|
24
27
|
this.view.dispatch(tr);
|
|
25
28
|
});
|
|
@@ -45,6 +45,7 @@ export class ToolbarDecision extends PureComponent {
|
|
|
45
45
|
disabled: disabled || isDisabled,
|
|
46
46
|
spacing: isReducedSpacing ? 'none' : 'default',
|
|
47
47
|
title: `${label} <>`,
|
|
48
|
+
"aria-keyshortcuts": "Shift+, Shift+. space",
|
|
48
49
|
iconBefore: /*#__PURE__*/React.createElement(DecisionIcon, {
|
|
49
50
|
label: label
|
|
50
51
|
})
|
|
@@ -15,6 +15,7 @@ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '../../../
|
|
|
15
15
|
import * as commands from '../../commands/change-color';
|
|
16
16
|
import { EditorTextColorIcon } from './icon';
|
|
17
17
|
import { backgroundDisabled, textColorIconBar, textColorIconWrapper } from './styles';
|
|
18
|
+
import { getFeatureFlags } from '../../../feature-flags-context/get-feature-flags';
|
|
18
19
|
const EXPERIMENT_NAME = 'editor.toolbarTextColor.moreColors';
|
|
19
20
|
const EXPERIMENT_GROUP_CONTROL = 'control';
|
|
20
21
|
export const messages = defineMessages({
|
|
@@ -51,12 +52,11 @@ export class ToolbarTextColor extends React.Component {
|
|
|
51
52
|
const {
|
|
52
53
|
pluginState: {
|
|
53
54
|
palette,
|
|
54
|
-
paletteExpanded,
|
|
55
55
|
defaultColor
|
|
56
56
|
}
|
|
57
57
|
} = this.props; // we store color names in analytics
|
|
58
58
|
|
|
59
|
-
const swatch =
|
|
59
|
+
const swatch = palette.find(sw => sw.value === color);
|
|
60
60
|
const isNewColor = color !== defaultColor && !originalTextColors.some(col => col.value === color);
|
|
61
61
|
this.dispatchAnalyticsEvent(this.buildAnalyticsSelectColor({
|
|
62
62
|
color: (swatch ? swatch.label : color).toLowerCase(),
|
|
@@ -142,16 +142,16 @@ export class ToolbarTextColor extends React.Component {
|
|
|
142
142
|
popupsScrollableElement,
|
|
143
143
|
isReducedSpacing,
|
|
144
144
|
pluginState,
|
|
145
|
-
pluginState: {
|
|
146
|
-
paletteExpanded
|
|
147
|
-
},
|
|
148
145
|
intl: {
|
|
149
146
|
formatMessage
|
|
150
147
|
},
|
|
151
148
|
disabled
|
|
152
149
|
} = this.props;
|
|
153
150
|
const labelTextColor = formatMessage(messages.textColor);
|
|
154
|
-
const palette =
|
|
151
|
+
const palette = pluginState.palette;
|
|
152
|
+
const {
|
|
153
|
+
useSomewhatSemanticTextColorNames
|
|
154
|
+
} = getFeatureFlags(this.props.editorView.state);
|
|
155
155
|
let fitWidth;
|
|
156
156
|
|
|
157
157
|
if (document.body.clientWidth <= 740) {
|
|
@@ -205,7 +205,8 @@ export class ToolbarTextColor extends React.Component {
|
|
|
205
205
|
palette: palette,
|
|
206
206
|
onClick: color => this.changeTextColor(color, pluginState.disabled),
|
|
207
207
|
selectedColor: pluginState.color,
|
|
208
|
-
textPalette: true
|
|
208
|
+
textPalette: true,
|
|
209
|
+
useSomewhatSemanticTextColorNames: useSomewhatSemanticTextColorNames
|
|
209
210
|
}))), jsx("span", {
|
|
210
211
|
css: separatorStyles
|
|
211
212
|
}));
|
|
@@ -11,6 +11,7 @@ import { pluginKey as textFormattingPluginKey } from '../../../pm-plugins/plugin
|
|
|
11
11
|
import { toggleCode, toggleStrikethrough, toggleUnderline, tooltip, toggleBold, toggleItalic, toggleSubscript, toggleSuperscript, ToolTipContent } from '../../../../../keymaps';
|
|
12
12
|
import { INPUT_METHOD } from '../../../../analytics/types/enums';
|
|
13
13
|
import { IconTypes } from '../types';
|
|
14
|
+
import { getAriaKeyshortcuts } from '@atlaskit/editor-common/keymaps';
|
|
14
15
|
|
|
15
16
|
const withToolbarInputMethod = func => func({
|
|
16
17
|
inputMethod: INPUT_METHOD.TOOLBAR
|
|
@@ -91,7 +92,9 @@ const getIcon = ({
|
|
|
91
92
|
name: iconType
|
|
92
93
|
},
|
|
93
94
|
isActive,
|
|
94
|
-
isDisabled
|
|
95
|
+
isDisabled,
|
|
96
|
+
'aria-label': tooltipKeymap ? tooltip(tooltipKeymap, String(content)) : String(content),
|
|
97
|
+
'aria-keyshortcuts': getAriaKeyshortcuts(tooltipKeymap)
|
|
95
98
|
};
|
|
96
99
|
};
|
|
97
100
|
|
|
@@ -16,16 +16,22 @@ export const SingleToolbarButtons = /*#__PURE__*/React.memo(({
|
|
|
16
16
|
}, [editorView.state, editorView.dispatch]);
|
|
17
17
|
return jsx("span", {
|
|
18
18
|
css: buttonGroupStyle
|
|
19
|
-
}, items.map(item =>
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
19
|
+
}, items.map(item => {
|
|
20
|
+
var _item$ariaLabel;
|
|
21
|
+
|
|
22
|
+
return jsx(ToolbarButton, {
|
|
23
|
+
key: item.key,
|
|
24
|
+
testId: `editor-toolbar__${String(item.content)}`,
|
|
25
|
+
buttonId: item.buttonId,
|
|
26
|
+
spacing: isReducedSpacing ? 'none' : 'default',
|
|
27
|
+
onClick: onClick(item.command),
|
|
28
|
+
selected: item.isActive,
|
|
29
|
+
disabled: item.isDisabled,
|
|
30
|
+
title: item.tooltipElement,
|
|
31
|
+
iconBefore: item.iconElement,
|
|
32
|
+
"aria-pressed": item.isActive,
|
|
33
|
+
"aria-label": (_item$ariaLabel = item['aria-label']) !== null && _item$ariaLabel !== void 0 ? _item$ariaLabel : String(item.content),
|
|
34
|
+
"aria-keyshortcuts": item['aria-keyshortcuts']
|
|
35
|
+
});
|
|
36
|
+
}));
|
|
31
37
|
});
|
|
@@ -5,11 +5,12 @@ import BulletListIcon from '@atlaskit/icon/glyph/editor/bullet-list';
|
|
|
5
5
|
import NumberListIcon from '@atlaskit/icon/glyph/editor/number-list';
|
|
6
6
|
import IndentIcon from '@atlaskit/icon/glyph/editor/indent';
|
|
7
7
|
import OutdentIcon from '@atlaskit/icon/glyph/editor/outdent';
|
|
8
|
-
import { toggleBulletList as toggleBulletListKeymap, toggleOrderedList as toggleOrderedListKeymap, indent as toggleIndentKeymap, outdent as toggleOutdentKeymap, ToolTipContent } from '../../../keymaps';
|
|
8
|
+
import { toggleBulletList as toggleBulletListKeymap, toggleOrderedList as toggleOrderedListKeymap, indent as toggleIndentKeymap, outdent as toggleOutdentKeymap, ToolTipContent, tooltip } from '../../../keymaps';
|
|
9
9
|
import ToolbarButton, { TOOLBAR_BUTTON } from '../../../ui/ToolbarButton';
|
|
10
10
|
import { messages } from '../../list/messages';
|
|
11
11
|
import { messages as indentationMessages } from '../../indentation/messages';
|
|
12
12
|
import { buttonGroupStyle, separatorStyles } from '../../../ui/styles';
|
|
13
|
+
import { getAriaKeyshortcuts } from '@atlaskit/editor-common/keymaps';
|
|
13
14
|
export function Toolbar(props) {
|
|
14
15
|
const {
|
|
15
16
|
formatMessage
|
|
@@ -28,6 +29,8 @@ export function Toolbar(props) {
|
|
|
28
29
|
} = props;
|
|
29
30
|
const labelUnorderedList = formatMessage(messages.unorderedList);
|
|
30
31
|
const labelOrderedList = formatMessage(messages.orderedList);
|
|
32
|
+
const indentMessage = formatMessage(indentationMessages.indent);
|
|
33
|
+
const outdentMessage = formatMessage(indentationMessages.outdent);
|
|
31
34
|
|
|
32
35
|
const handleOnItemActivated = buttonName => event => onItemActivated({
|
|
33
36
|
editorView: props.editorView,
|
|
@@ -38,11 +41,13 @@ export function Toolbar(props) {
|
|
|
38
41
|
css: buttonGroupStyle
|
|
39
42
|
}, jsx(ToolbarButton, {
|
|
40
43
|
buttonId: TOOLBAR_BUTTON.BULLET_LIST,
|
|
44
|
+
testId: labelUnorderedList,
|
|
41
45
|
spacing: isReducedSpacing ? 'none' : 'default',
|
|
42
46
|
onClick: handleOnItemActivated('bullet_list'),
|
|
43
47
|
selected: bulletListActive,
|
|
44
48
|
"aria-pressed": bulletListActive,
|
|
45
|
-
"aria-label": labelUnorderedList,
|
|
49
|
+
"aria-label": tooltip(toggleBulletListKeymap, labelUnorderedList),
|
|
50
|
+
"aria-keyshortcuts": getAriaKeyshortcuts(toggleBulletListKeymap),
|
|
46
51
|
disabled: bulletListDisabled || disabled,
|
|
47
52
|
title: jsx(ToolTipContent, {
|
|
48
53
|
description: labelUnorderedList,
|
|
@@ -53,11 +58,13 @@ export function Toolbar(props) {
|
|
|
53
58
|
})
|
|
54
59
|
}), jsx(ToolbarButton, {
|
|
55
60
|
buttonId: TOOLBAR_BUTTON.ORDERED_LIST,
|
|
61
|
+
testId: labelOrderedList,
|
|
56
62
|
spacing: isReducedSpacing ? 'none' : 'default',
|
|
57
63
|
onClick: handleOnItemActivated('ordered_list'),
|
|
58
64
|
selected: orderedListActive,
|
|
59
65
|
"aria-pressed": orderedListActive,
|
|
60
|
-
"aria-label": labelOrderedList,
|
|
66
|
+
"aria-label": tooltip(toggleOrderedListKeymap, labelOrderedList),
|
|
67
|
+
"aria-keyshortcuts": getAriaKeyshortcuts(toggleOrderedListKeymap),
|
|
61
68
|
disabled: orderedListDisabled || disabled,
|
|
62
69
|
title: jsx(ToolTipContent, {
|
|
63
70
|
description: labelOrderedList,
|
|
@@ -75,9 +82,10 @@ export function Toolbar(props) {
|
|
|
75
82
|
label: ""
|
|
76
83
|
}),
|
|
77
84
|
disabled: outdentDisabled || disabled,
|
|
78
|
-
"aria-label":
|
|
85
|
+
"aria-label": tooltip(toggleOutdentKeymap, outdentMessage),
|
|
86
|
+
"aria-keyshortcuts": getAriaKeyshortcuts(toggleOutdentKeymap),
|
|
79
87
|
title: jsx(ToolTipContent, {
|
|
80
|
-
description:
|
|
88
|
+
description: outdentMessage,
|
|
81
89
|
keymap: toggleOutdentKeymap
|
|
82
90
|
})
|
|
83
91
|
}), showIndentationButtons && jsx(ToolbarButton, {
|
|
@@ -89,9 +97,10 @@ export function Toolbar(props) {
|
|
|
89
97
|
label: ""
|
|
90
98
|
}),
|
|
91
99
|
disabled: indentDisabled || disabled,
|
|
92
|
-
"aria-label":
|
|
100
|
+
"aria-label": tooltip(toggleIndentKeymap, indentMessage),
|
|
101
|
+
"aria-keyshortcuts": getAriaKeyshortcuts(toggleIndentKeymap),
|
|
93
102
|
title: jsx(ToolTipContent, {
|
|
94
|
-
description:
|
|
103
|
+
description: indentMessage,
|
|
95
104
|
keymap: toggleIndentKeymap
|
|
96
105
|
})
|
|
97
106
|
}), jsx("span", {
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
*
|
|
8
8
|
*/
|
|
9
|
-
import React
|
|
9
|
+
import React from 'react';
|
|
10
10
|
import { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
|
|
11
11
|
import { createPlugin } from './pm-plugins/main';
|
|
12
12
|
import { createPlugin as createInsertItemPlugin } from './pm-plugins/insert-item-plugin';
|
|
@@ -54,7 +54,7 @@ const TypeAheadMenu = /*#__PURE__*/React.memo(({
|
|
|
54
54
|
});
|
|
55
55
|
});
|
|
56
56
|
}, [onItemInsert, query]);
|
|
57
|
-
const cancel = useCallback(({
|
|
57
|
+
const cancel = React.useCallback(({
|
|
58
58
|
setSelectionAt,
|
|
59
59
|
addPrefixTrigger,
|
|
60
60
|
forceFocusOnEditor
|