@atlaskit/editor-core 148.0.0 → 149.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +110 -0
- package/dist/cjs/create-editor/create-plugins-list.js +6 -1
- package/dist/cjs/editor.js +1 -4
- package/dist/cjs/index.js +24 -40
- package/dist/cjs/labs/next/presets/default.js +1 -1
- package/dist/cjs/messages.js +5 -0
- package/dist/cjs/nodeviews/SelectionBasedNodeView.js +1 -2
- package/dist/cjs/plugins/analytics/plugin.js +9 -7
- package/dist/cjs/plugins/analytics/types/enums.js +5 -0
- package/dist/cjs/plugins/analytics/types/type-ahead.js +5 -0
- package/dist/cjs/plugins/block-type/messages.js +10 -0
- package/dist/cjs/plugins/card/nodeviews/embedCard.js +1 -3
- package/dist/cjs/plugins/collab-edit/participants.js +15 -0
- package/dist/cjs/plugins/collab-edit/plugin-state.js +14 -0
- package/dist/cjs/plugins/collab-edit/ui/avatars-with-plugin-state.js +6 -4
- package/dist/cjs/plugins/collab-edit/ui/avatars.js +19 -2
- package/dist/cjs/plugins/collab-edit/utils.js +42 -2
- package/dist/cjs/plugins/date/actions.js +4 -2
- package/dist/cjs/plugins/date/index.js +1 -1
- package/dist/cjs/plugins/date/pm-plugins/utils.js +6 -1
- package/dist/cjs/plugins/emoji/index.js +143 -120
- package/dist/cjs/plugins/emoji/pm-plugins/ascii-input-rules.js +0 -14
- package/dist/cjs/plugins/expand/pm-plugins/keymap.js +3 -7
- package/dist/cjs/plugins/extension/actions.js +16 -16
- package/dist/cjs/plugins/extension/pm-plugins/main.js +4 -4
- package/dist/cjs/plugins/extension/ui/Extension/ExtensionComponent.js +5 -4
- package/dist/cjs/plugins/extension/ui/Extension/index.js +2 -2
- package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +3 -2
- package/dist/cjs/plugins/floating-toolbar/ui/ConfirmationModal.js +12 -14
- package/dist/cjs/plugins/floating-toolbar/ui/EditorEmojiAddIcon.js +35 -0
- package/dist/cjs/plugins/floating-toolbar/ui/EditorHideEmojiIcon.js +38 -0
- package/dist/cjs/plugins/floating-toolbar/ui/EmojiPickerButton.js +5 -7
- package/dist/cjs/plugins/help-dialog/ui/index.js +12 -18
- package/dist/cjs/plugins/help-dialog/ui/styles.js +2 -6
- package/dist/cjs/plugins/hyperlink/index.js +4 -10
- package/dist/cjs/plugins/insert-block/index.js +9 -8
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +7 -3
- package/dist/cjs/plugins/list/index.js +5 -0
- package/dist/cjs/plugins/macro/actions.js +14 -14
- package/dist/cjs/plugins/media/index.js +1 -0
- package/dist/cjs/plugins/media/nodeviews/mediaGroup.js +1 -0
- package/dist/cjs/plugins/media/pm-plugins/main.js +26 -14
- package/dist/cjs/plugins/media/styles.js +1 -1
- package/dist/cjs/plugins/media/toolbar/filePreviewItem.js +86 -0
- package/dist/cjs/plugins/media/toolbar/index.js +161 -44
- package/dist/cjs/plugins/media/toolbar/utils.js +77 -0
- package/dist/cjs/plugins/mentions/index.js +57 -602
- package/dist/cjs/plugins/mentions/pm-plugins/key.js +11 -0
- package/dist/cjs/plugins/mentions/pm-plugins/main.js +162 -0
- package/dist/cjs/plugins/mentions/pm-plugins/utils.js +12 -0
- package/dist/cjs/plugins/mentions/type-ahead/index.js +449 -0
- package/dist/cjs/plugins/mentions/ui/InviteItem/index.js +3 -1
- package/dist/cjs/plugins/mentions/ui/InviteItem/styles.js +8 -3
- package/dist/cjs/plugins/mentions/ui/ToolbarMention/index.js +3 -3
- package/dist/cjs/plugins/mentions/utils.js +24 -2
- package/dist/cjs/plugins/panel/index.js +46 -13
- package/dist/cjs/plugins/panel/nodeviews/panel.js +39 -25
- package/dist/cjs/plugins/panel/toolbar.js +94 -6
- package/dist/cjs/plugins/panel/toolbar.test.js +149 -16
- package/dist/cjs/plugins/paste/handlers.js +2 -2
- package/dist/cjs/plugins/paste/pm-plugins/analytics.js +6 -3
- package/dist/cjs/plugins/placeholder/index.js +6 -0
- package/dist/cjs/plugins/quick-insert/api.js +30 -0
- package/dist/cjs/plugins/quick-insert/assets/custom-panel.js +55 -0
- package/dist/cjs/plugins/quick-insert/assets/index.js +14 -1
- package/dist/cjs/plugins/quick-insert/index.js +10 -24
- package/dist/cjs/plugins/quick-insert/ui/ModalElementBrowser/index.js +1 -0
- package/dist/cjs/plugins/rank.js +1 -1
- package/dist/cjs/plugins/rule/index.js +1 -25
- package/dist/cjs/plugins/scroll-into-view/index.js +1 -4
- package/dist/cjs/plugins/selection/gap-cursor/actions.js +5 -6
- package/dist/cjs/plugins/selection/pm-plugins/selection-main.js +1 -3
- package/dist/cjs/plugins/status/actions.js +5 -2
- package/dist/cjs/plugins/status/plugin.js +1 -1
- package/dist/cjs/plugins/table/commands/selection.js +24 -24
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +8 -1
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +14 -15
- package/dist/cjs/plugins/tasks-and-decisions/nodeviews/decisionItem.js +3 -1
- package/dist/cjs/plugins/tasks-and-decisions/nodeviews/taskItem.js +3 -1
- package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/keymaps.js +1 -2
- package/dist/cjs/plugins/text-formatting/pm-plugins/cursor.js +1 -4
- package/dist/cjs/plugins/type-ahead/api.js +243 -0
- package/dist/cjs/plugins/type-ahead/commands/insert-type-ahead-item.js +238 -0
- package/dist/cjs/plugins/type-ahead/commands/update-list-items.js +30 -0
- package/dist/cjs/plugins/type-ahead/commands/update-query.js +16 -18
- package/dist/cjs/plugins/type-ahead/commands/update-selected-index.js +36 -0
- package/dist/cjs/plugins/type-ahead/constants.js +25 -0
- package/dist/cjs/plugins/type-ahead/index.js +183 -52
- package/dist/cjs/plugins/type-ahead/insert-utils.js +132 -0
- package/dist/cjs/plugins/type-ahead/pm-plugins/actions.js +12 -9
- package/dist/cjs/plugins/type-ahead/pm-plugins/decorations.js +238 -0
- package/dist/cjs/plugins/type-ahead/pm-plugins/input-rules.js +20 -40
- package/dist/cjs/plugins/type-ahead/pm-plugins/insert-item-plugin.js +28 -0
- package/dist/cjs/plugins/type-ahead/pm-plugins/{plugin-key.js → key.js} +0 -0
- package/dist/cjs/plugins/type-ahead/pm-plugins/main.js +79 -424
- package/dist/cjs/plugins/type-ahead/pm-plugins/reducer.js +188 -0
- package/dist/cjs/plugins/type-ahead/pm-plugins/utils.js +26 -0
- package/dist/cjs/plugins/type-ahead/stats-modifier.js +49 -0
- package/dist/cjs/plugins/type-ahead/transforms/close-type-ahead.js +18 -0
- package/dist/cjs/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +51 -0
- package/dist/cjs/plugins/type-ahead/transforms/set-selection-before-query.js +24 -0
- package/dist/cjs/plugins/type-ahead/ui/DynamicHeightListItem.js +77 -0
- package/dist/cjs/plugins/type-ahead/ui/InputQuery.js +325 -0
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadList.js +195 -0
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadListItem.js +141 -0
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadPopup.js +141 -0
- package/dist/cjs/plugins/type-ahead/ui/WrapperTypeAhead.js +151 -0
- package/dist/cjs/plugins/type-ahead/ui/hooks/use-dynamic-list-height-calculation.js +118 -0
- package/dist/cjs/plugins/type-ahead/ui/hooks/use-item-insert.js +132 -0
- package/dist/cjs/plugins/type-ahead/ui/hooks/use-load-items.js +61 -0
- package/dist/cjs/plugins/type-ahead/ui/hooks/use-on-force-select.js +50 -0
- package/dist/cjs/plugins/type-ahead/ui/hooks/use-resize-observer.js +70 -0
- package/dist/cjs/plugins/type-ahead/utils.js +127 -0
- package/dist/cjs/plugins/undo-redo/ui/ToolbarUndoRedo/index.js +33 -2
- package/dist/cjs/plugins/view-update-subscription/index.js +19 -14
- package/dist/cjs/plugins/view-update-subscription/subscribe/toolbarAndPickerUpdates.js +10 -3
- package/dist/cjs/plugins/view-update-subscription/subscribe/type-ahead-updates.js +46 -0
- package/dist/cjs/test-utils.js +17 -0
- package/dist/cjs/types/empty-state-handler.js +5 -0
- package/dist/cjs/ui/ConfigPanel/Fields/ColorPicker.js +4 -21
- package/dist/cjs/ui/ElementBrowser/ElementBrowser.js +4 -2
- package/dist/cjs/ui/ElementBrowser/InsertMenu.js +1 -0
- package/dist/cjs/ui/ElementBrowser/ModalElementBrowser.js +16 -23
- package/dist/cjs/ui/ElementBrowser/components/ElementList/ElementList.js +11 -4
- package/dist/cjs/ui/ElementBrowser/components/StatelessElementBrowser.js +12 -4
- package/dist/cjs/ui/PanelTextInput/index.js +1 -3
- package/dist/cjs/utils/compare.js +7 -7
- package/dist/cjs/utils/index.js +7 -8
- package/dist/cjs/utils/rich-media-utils.js +2 -2
- package/dist/cjs/utils/selection.js +6 -3
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/create-editor/create-plugins-list.js +6 -1
- package/dist/es2019/editor.js +1 -4
- package/dist/es2019/index.js +4 -6
- package/dist/es2019/labs/next/presets/default.js +2 -2
- package/dist/es2019/messages.js +5 -0
- package/dist/es2019/nodeviews/SelectionBasedNodeView.js +1 -2
- package/dist/es2019/plugins/analytics/plugin.js +5 -1
- package/dist/es2019/plugins/analytics/types/enums.js +5 -0
- package/dist/es2019/plugins/analytics/types/type-ahead.js +1 -0
- package/dist/es2019/plugins/block-type/messages.js +10 -0
- package/dist/es2019/plugins/card/nodeviews/embedCard.js +1 -3
- package/dist/es2019/plugins/collab-edit/participants.js +14 -0
- package/dist/es2019/plugins/collab-edit/plugin-state.js +17 -1
- package/dist/es2019/plugins/collab-edit/ui/avatars-with-plugin-state.js +6 -4
- package/dist/es2019/plugins/collab-edit/ui/avatars.js +17 -2
- package/dist/es2019/plugins/collab-edit/utils.js +34 -0
- package/dist/es2019/plugins/date/actions.js +4 -2
- package/dist/es2019/plugins/date/index.js +1 -1
- package/dist/es2019/plugins/date/pm-plugins/utils.js +6 -1
- package/dist/es2019/plugins/emoji/index.js +169 -146
- package/dist/es2019/plugins/emoji/pm-plugins/ascii-input-rules.js +0 -11
- package/dist/es2019/plugins/expand/pm-plugins/keymap.js +3 -6
- package/dist/es2019/plugins/extension/actions.js +16 -16
- package/dist/es2019/plugins/extension/pm-plugins/main.js +4 -4
- package/dist/es2019/plugins/extension/ui/Extension/ExtensionComponent.js +5 -4
- package/dist/es2019/plugins/extension/ui/Extension/index.js +2 -2
- package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +3 -2
- package/dist/es2019/plugins/floating-toolbar/ui/ConfirmationModal.js +12 -15
- package/dist/es2019/plugins/floating-toolbar/ui/EditorEmojiAddIcon.js +25 -0
- package/dist/es2019/plugins/floating-toolbar/ui/EditorHideEmojiIcon.js +28 -0
- package/dist/es2019/plugins/floating-toolbar/ui/EmojiPickerButton.js +3 -5
- package/dist/es2019/plugins/help-dialog/ui/index.js +20 -26
- package/dist/es2019/plugins/help-dialog/ui/styles.js +2 -2
- package/dist/es2019/plugins/hyperlink/index.js +4 -12
- package/dist/es2019/plugins/insert-block/index.js +4 -4
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +8 -4
- package/dist/es2019/plugins/list/index.js +20 -14
- package/dist/es2019/plugins/macro/actions.js +14 -14
- package/dist/es2019/plugins/media/index.js +1 -0
- package/dist/es2019/plugins/media/nodeviews/mediaGroup.js +1 -0
- package/dist/es2019/plugins/media/pm-plugins/main.js +27 -12
- package/dist/es2019/plugins/media/styles.js +7 -2
- package/dist/es2019/plugins/media/toolbar/filePreviewItem.js +59 -0
- package/dist/es2019/plugins/media/toolbar/index.js +158 -42
- package/dist/es2019/plugins/media/toolbar/utils.js +32 -0
- package/dist/es2019/plugins/mentions/index.js +34 -536
- package/dist/es2019/plugins/mentions/pm-plugins/key.js +2 -0
- package/dist/es2019/plugins/mentions/pm-plugins/main.js +138 -0
- package/dist/es2019/plugins/mentions/pm-plugins/utils.js +4 -0
- package/dist/es2019/plugins/mentions/type-ahead/index.js +394 -0
- package/dist/es2019/plugins/mentions/ui/InviteItem/index.js +2 -1
- package/dist/es2019/plugins/mentions/ui/InviteItem/styles.js +4 -2
- package/dist/es2019/plugins/mentions/ui/ToolbarMention/index.js +2 -2
- package/dist/es2019/plugins/mentions/utils.js +20 -1
- package/dist/es2019/plugins/panel/index.js +95 -62
- package/dist/es2019/plugins/panel/nodeviews/panel.js +7 -1
- package/dist/es2019/plugins/panel/toolbar.js +90 -6
- package/dist/es2019/plugins/panel/toolbar.test.js +131 -14
- package/dist/es2019/plugins/paste/handlers.js +2 -2
- package/dist/es2019/plugins/paste/pm-plugins/analytics.js +6 -3
- package/dist/es2019/plugins/placeholder/index.js +5 -0
- package/dist/es2019/plugins/quick-insert/api.js +18 -0
- package/dist/es2019/plugins/quick-insert/assets/custom-panel.js +45 -0
- package/dist/es2019/plugins/quick-insert/assets/index.js +6 -0
- package/dist/es2019/plugins/quick-insert/index.js +12 -23
- package/dist/es2019/plugins/quick-insert/search.js +1 -3
- package/dist/es2019/plugins/quick-insert/ui/ModalElementBrowser/index.js +1 -0
- package/dist/es2019/plugins/rank.js +1 -1
- package/dist/es2019/plugins/rule/index.js +1 -22
- package/dist/es2019/plugins/scroll-into-view/index.js +1 -3
- package/dist/es2019/plugins/selection/gap-cursor/actions.js +5 -6
- package/dist/es2019/plugins/selection/pm-plugins/selection-main.js +1 -3
- package/dist/es2019/plugins/status/actions.js +5 -2
- package/dist/es2019/plugins/status/plugin.js +1 -1
- package/dist/es2019/plugins/table/commands/selection.js +25 -25
- package/dist/es2019/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +8 -1
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +14 -15
- package/dist/es2019/plugins/tasks-and-decisions/nodeviews/decisionItem.js +2 -1
- package/dist/es2019/plugins/tasks-and-decisions/nodeviews/taskItem.js +2 -1
- package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/keymaps.js +1 -2
- package/dist/es2019/plugins/text-formatting/pm-plugins/cursor.js +1 -4
- package/dist/es2019/plugins/type-ahead/api.js +224 -0
- package/dist/es2019/plugins/type-ahead/commands/insert-type-ahead-item.js +222 -0
- package/dist/es2019/plugins/type-ahead/commands/update-list-items.js +19 -0
- package/dist/es2019/plugins/type-ahead/commands/update-query.js +17 -15
- package/dist/es2019/plugins/type-ahead/commands/update-selected-index.js +25 -0
- package/dist/es2019/plugins/type-ahead/constants.js +15 -0
- package/dist/es2019/plugins/type-ahead/index.js +203 -78
- package/dist/es2019/plugins/type-ahead/insert-utils.js +119 -0
- package/dist/es2019/plugins/type-ahead/pm-plugins/actions.js +11 -8
- package/dist/es2019/plugins/type-ahead/pm-plugins/decorations.js +211 -0
- package/dist/es2019/plugins/type-ahead/pm-plugins/input-rules.js +18 -32
- package/dist/es2019/plugins/type-ahead/pm-plugins/insert-item-plugin.js +19 -0
- package/dist/es2019/plugins/type-ahead/pm-plugins/{plugin-key.js → key.js} +0 -0
- package/dist/es2019/plugins/type-ahead/pm-plugins/main.js +81 -401
- package/dist/es2019/plugins/type-ahead/pm-plugins/reducer.js +165 -0
- package/dist/es2019/plugins/type-ahead/pm-plugins/utils.js +16 -0
- package/dist/es2019/plugins/type-ahead/stats-modifier.js +41 -0
- package/dist/es2019/plugins/type-ahead/transforms/close-type-ahead.js +7 -0
- package/dist/es2019/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +40 -0
- package/dist/es2019/plugins/type-ahead/transforms/set-selection-before-query.js +11 -0
- package/dist/es2019/plugins/type-ahead/ui/DynamicHeightListItem.js +51 -0
- package/dist/es2019/plugins/type-ahead/ui/InputQuery.js +307 -0
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadList.js +163 -0
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadListItem.js +136 -0
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadPopup.js +120 -0
- package/dist/es2019/plugins/type-ahead/ui/WrapperTypeAhead.js +110 -0
- package/dist/es2019/plugins/type-ahead/ui/hooks/use-dynamic-list-height-calculation.js +97 -0
- package/dist/es2019/plugins/type-ahead/ui/hooks/use-item-insert.js +126 -0
- package/dist/es2019/plugins/type-ahead/ui/hooks/use-load-items.js +43 -0
- package/dist/es2019/plugins/type-ahead/ui/hooks/use-on-force-select.js +41 -0
- package/dist/es2019/plugins/type-ahead/ui/hooks/use-resize-observer.js +53 -0
- package/dist/es2019/plugins/type-ahead/utils.js +93 -0
- package/dist/es2019/plugins/undo-redo/ui/ToolbarUndoRedo/index.js +29 -2
- package/dist/es2019/plugins/view-update-subscription/index.js +19 -14
- package/dist/es2019/plugins/view-update-subscription/subscribe/toolbarAndPickerUpdates.js +9 -3
- package/dist/es2019/plugins/view-update-subscription/subscribe/type-ahead-updates.js +34 -0
- package/dist/es2019/test-utils.js +7 -0
- package/dist/es2019/types/empty-state-handler.js +1 -0
- package/dist/es2019/ui/ConfigPanel/Fields/ColorPicker.js +4 -8
- package/dist/es2019/ui/ConfigPanel/transformers.js +9 -9
- package/dist/es2019/ui/ElementBrowser/ElementBrowser.js +4 -2
- package/dist/es2019/ui/ElementBrowser/InsertMenu.js +1 -0
- package/dist/es2019/ui/ElementBrowser/ModalElementBrowser.js +20 -21
- package/dist/es2019/ui/ElementBrowser/components/ElementList/ElementList.js +9 -2
- package/dist/es2019/ui/ElementBrowser/components/StatelessElementBrowser.js +12 -4
- package/dist/es2019/ui/PanelTextInput/index.js +1 -3
- package/dist/es2019/utils/compare.js +7 -7
- package/dist/es2019/utils/index.js +7 -8
- package/dist/es2019/utils/rich-media-utils.js +2 -2
- package/dist/es2019/utils/selection.js +6 -3
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/create-editor/create-plugins-list.js +6 -1
- package/dist/esm/editor.js +1 -4
- package/dist/esm/index.js +4 -6
- package/dist/esm/labs/next/presets/default.js +2 -2
- package/dist/esm/messages.js +5 -0
- package/dist/esm/nodeviews/SelectionBasedNodeView.js +1 -2
- package/dist/esm/plugins/analytics/plugin.js +8 -6
- package/dist/esm/plugins/analytics/types/enums.js +5 -0
- package/dist/esm/plugins/analytics/types/type-ahead.js +1 -0
- package/dist/esm/plugins/block-type/messages.js +10 -0
- package/dist/esm/plugins/card/nodeviews/embedCard.js +1 -3
- package/dist/esm/plugins/collab-edit/participants.js +15 -0
- package/dist/esm/plugins/collab-edit/plugin-state.js +15 -1
- package/dist/esm/plugins/collab-edit/ui/avatars-with-plugin-state.js +6 -4
- package/dist/esm/plugins/collab-edit/ui/avatars.js +17 -2
- package/dist/esm/plugins/collab-edit/utils.js +32 -0
- package/dist/esm/plugins/date/actions.js +4 -2
- package/dist/esm/plugins/date/index.js +1 -1
- package/dist/esm/plugins/date/pm-plugins/utils.js +6 -1
- package/dist/esm/plugins/emoji/index.js +136 -112
- package/dist/esm/plugins/emoji/pm-plugins/ascii-input-rules.js +0 -13
- package/dist/esm/plugins/expand/pm-plugins/keymap.js +3 -6
- package/dist/esm/plugins/extension/actions.js +16 -16
- package/dist/esm/plugins/extension/pm-plugins/main.js +4 -4
- package/dist/esm/plugins/extension/ui/Extension/ExtensionComponent.js +5 -4
- package/dist/esm/plugins/extension/ui/Extension/index.js +2 -2
- package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +3 -2
- package/dist/esm/plugins/floating-toolbar/ui/ConfirmationModal.js +12 -15
- package/dist/esm/plugins/floating-toolbar/ui/EditorEmojiAddIcon.js +25 -0
- package/dist/esm/plugins/floating-toolbar/ui/EditorHideEmojiIcon.js +28 -0
- package/dist/esm/plugins/floating-toolbar/ui/EmojiPickerButton.js +3 -5
- package/dist/esm/plugins/help-dialog/ui/index.js +13 -19
- package/dist/esm/plugins/help-dialog/ui/styles.js +2 -6
- package/dist/esm/plugins/hyperlink/index.js +4 -10
- package/dist/esm/plugins/insert-block/index.js +5 -5
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +8 -4
- package/dist/esm/plugins/list/index.js +5 -0
- package/dist/esm/plugins/macro/actions.js +14 -14
- package/dist/esm/plugins/media/index.js +1 -0
- package/dist/esm/plugins/media/nodeviews/mediaGroup.js +1 -0
- package/dist/esm/plugins/media/pm-plugins/main.js +27 -14
- package/dist/esm/plugins/media/styles.js +2 -2
- package/dist/esm/plugins/media/toolbar/filePreviewItem.js +62 -0
- package/dist/esm/plugins/media/toolbar/index.js +154 -43
- package/dist/esm/plugins/media/toolbar/utils.js +60 -0
- package/dist/esm/plugins/mentions/index.js +45 -557
- package/dist/esm/plugins/mentions/pm-plugins/key.js +2 -0
- package/dist/esm/plugins/mentions/pm-plugins/main.js +145 -0
- package/dist/esm/plugins/mentions/pm-plugins/utils.js +4 -0
- package/dist/esm/plugins/mentions/type-ahead/index.js +415 -0
- package/dist/esm/plugins/mentions/ui/InviteItem/index.js +2 -1
- package/dist/esm/plugins/mentions/ui/InviteItem/styles.js +4 -2
- package/dist/esm/plugins/mentions/ui/ToolbarMention/index.js +2 -2
- package/dist/esm/plugins/mentions/utils.js +19 -0
- package/dist/esm/plugins/panel/index.js +44 -13
- package/dist/esm/plugins/panel/nodeviews/panel.js +36 -22
- package/dist/esm/plugins/panel/toolbar.js +92 -6
- package/dist/esm/plugins/panel/toolbar.test.js +148 -16
- package/dist/esm/plugins/paste/handlers.js +2 -2
- package/dist/esm/plugins/paste/pm-plugins/analytics.js +6 -3
- package/dist/esm/plugins/placeholder/index.js +5 -0
- package/dist/esm/plugins/quick-insert/api.js +20 -0
- package/dist/esm/plugins/quick-insert/assets/custom-panel.js +45 -0
- package/dist/esm/plugins/quick-insert/assets/index.js +12 -0
- package/dist/esm/plugins/quick-insert/index.js +10 -24
- package/dist/esm/plugins/quick-insert/search.js +1 -3
- package/dist/esm/plugins/quick-insert/ui/ModalElementBrowser/index.js +1 -0
- package/dist/esm/plugins/rank.js +1 -1
- package/dist/esm/plugins/rule/index.js +1 -22
- package/dist/esm/plugins/scroll-into-view/index.js +1 -3
- package/dist/esm/plugins/selection/gap-cursor/actions.js +5 -6
- package/dist/esm/plugins/selection/pm-plugins/selection-main.js +1 -3
- package/dist/esm/plugins/status/actions.js +5 -2
- package/dist/esm/plugins/status/plugin.js +1 -1
- package/dist/esm/plugins/table/commands/selection.js +24 -24
- package/dist/esm/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +8 -1
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +14 -15
- package/dist/esm/plugins/tasks-and-decisions/nodeviews/decisionItem.js +2 -1
- package/dist/esm/plugins/tasks-and-decisions/nodeviews/taskItem.js +2 -1
- package/dist/esm/plugins/tasks-and-decisions/pm-plugins/keymaps.js +1 -2
- package/dist/esm/plugins/text-formatting/pm-plugins/cursor.js +1 -4
- package/dist/esm/plugins/type-ahead/api.js +228 -0
- package/dist/esm/plugins/type-ahead/commands/insert-type-ahead-item.js +217 -0
- package/dist/esm/plugins/type-ahead/commands/update-list-items.js +19 -0
- package/dist/esm/plugins/type-ahead/commands/update-query.js +13 -13
- package/dist/esm/plugins/type-ahead/commands/update-selected-index.js +25 -0
- package/dist/esm/plugins/type-ahead/constants.js +15 -0
- package/dist/esm/plugins/type-ahead/index.js +173 -53
- package/dist/esm/plugins/type-ahead/insert-utils.js +116 -0
- package/dist/esm/plugins/type-ahead/pm-plugins/actions.js +11 -8
- package/dist/esm/plugins/type-ahead/pm-plugins/decorations.js +204 -0
- package/dist/esm/plugins/type-ahead/pm-plugins/input-rules.js +18 -33
- package/dist/esm/plugins/type-ahead/pm-plugins/insert-item-plugin.js +18 -0
- package/dist/esm/plugins/type-ahead/pm-plugins/{plugin-key.js → key.js} +0 -0
- package/dist/esm/plugins/type-ahead/pm-plugins/main.js +80 -393
- package/dist/esm/plugins/type-ahead/pm-plugins/reducer.js +168 -0
- package/dist/esm/plugins/type-ahead/pm-plugins/utils.js +16 -0
- package/dist/esm/plugins/type-ahead/stats-modifier.js +43 -0
- package/dist/esm/plugins/type-ahead/transforms/close-type-ahead.js +7 -0
- package/dist/esm/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +39 -0
- package/dist/esm/plugins/type-ahead/transforms/set-selection-before-query.js +13 -0
- package/dist/esm/plugins/type-ahead/ui/DynamicHeightListItem.js +51 -0
- package/dist/esm/plugins/type-ahead/ui/InputQuery.js +302 -0
- package/dist/esm/plugins/type-ahead/ui/TypeAheadList.js +168 -0
- package/dist/esm/plugins/type-ahead/ui/TypeAheadListItem.js +105 -0
- package/dist/esm/plugins/type-ahead/ui/TypeAheadPopup.js +114 -0
- package/dist/esm/plugins/type-ahead/ui/WrapperTypeAhead.js +125 -0
- package/dist/esm/plugins/type-ahead/ui/hooks/use-dynamic-list-height-calculation.js +101 -0
- package/dist/esm/plugins/type-ahead/ui/hooks/use-item-insert.js +118 -0
- package/dist/esm/plugins/type-ahead/ui/hooks/use-load-items.js +46 -0
- package/dist/esm/plugins/type-ahead/ui/hooks/use-on-force-select.js +38 -0
- package/dist/esm/plugins/type-ahead/ui/hooks/use-resize-observer.js +48 -0
- package/dist/esm/plugins/type-ahead/utils.js +88 -0
- package/dist/esm/plugins/undo-redo/ui/ToolbarUndoRedo/index.js +33 -2
- package/dist/esm/plugins/view-update-subscription/index.js +19 -14
- package/dist/esm/plugins/view-update-subscription/subscribe/toolbarAndPickerUpdates.js +10 -3
- package/dist/esm/plugins/view-update-subscription/subscribe/type-ahead-updates.js +33 -0
- package/dist/esm/test-utils.js +7 -0
- package/dist/esm/types/empty-state-handler.js +1 -0
- package/dist/esm/ui/ConfigPanel/Fields/ColorPicker.js +4 -14
- package/dist/esm/ui/ElementBrowser/ElementBrowser.js +4 -2
- package/dist/esm/ui/ElementBrowser/InsertMenu.js +1 -0
- package/dist/esm/ui/ElementBrowser/ModalElementBrowser.js +16 -23
- package/dist/esm/ui/ElementBrowser/components/ElementList/ElementList.js +10 -3
- package/dist/esm/ui/ElementBrowser/components/StatelessElementBrowser.js +12 -4
- package/dist/esm/ui/PanelTextInput/index.js +1 -3
- package/dist/esm/utils/compare.js +7 -7
- package/dist/esm/utils/index.js +7 -8
- package/dist/esm/utils/rich-media-utils.js +2 -2
- package/dist/esm/utils/selection.js +6 -3
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/commands/index.d.ts +1 -1
- package/dist/types/create-editor/ErrorBoundary.d.ts +1 -1
- package/dist/types/index.d.ts +3 -5
- package/dist/types/labs/next/full-page.d.ts +1 -1
- package/dist/types/labs/next/mobile.d.ts +1 -1
- package/dist/types/labs/next/presets/default.d.ts +2 -0
- package/dist/types/messages.d.ts +5 -0
- package/dist/types/plugins/alignment/commands/index.d.ts +2 -2
- package/dist/types/plugins/analytics/types/enums.d.ts +6 -1
- package/dist/types/plugins/analytics/types/events.d.ts +12 -2
- package/dist/types/plugins/analytics/types/general-events.d.ts +2 -23
- package/dist/types/plugins/analytics/types/type-ahead.d.ts +27 -0
- package/dist/types/plugins/block-type/messages.d.ts +10 -0
- package/dist/types/plugins/card/ui/ResizableEmbedCard.d.ts +1 -1
- package/dist/types/plugins/collab-edit/participants.d.ts +1 -0
- package/dist/types/plugins/collab-edit/ui/avatars.d.ts +3 -1
- package/dist/types/plugins/collab-edit/ui/invite-to-edit.d.ts +1 -1
- package/dist/types/plugins/collab-edit/utils.d.ts +4 -2
- package/dist/types/plugins/date/actions.d.ts +1 -1
- package/dist/types/plugins/date/pm-plugins/types.d.ts +1 -0
- package/dist/types/plugins/emoji/index.d.ts +2 -4
- package/dist/types/plugins/emoji/types.d.ts +2 -2
- package/dist/types/plugins/extension/ui/Extension/Extension/index.d.ts +2 -3
- package/dist/types/plugins/extension/ui/Extension/Extension/styles.d.ts +1 -1
- package/dist/types/plugins/extension/ui/Extension/ExtensionComponent.d.ts +2 -3
- package/dist/types/plugins/extension/ui/Extension/index.d.ts +2 -3
- package/dist/types/plugins/feature-flags-context/get-enabled-feature-flag-keys.d.ts +1 -1
- package/dist/types/plugins/find-replace/ui/styles.d.ts +3 -3
- package/dist/types/plugins/floating-toolbar/ui/EditorEmojiAddIcon.d.ts +1 -0
- package/dist/types/plugins/floating-toolbar/ui/EditorHideEmojiIcon.d.ts +1 -0
- package/dist/types/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.d.ts +1 -1
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/types.d.ts +0 -1
- package/dist/types/plugins/media/pm-plugins/main.d.ts +1 -0
- package/dist/types/plugins/media/toolbar/filePreviewItem.d.ts +7 -0
- package/dist/types/plugins/media/toolbar/utils.d.ts +4 -0
- package/dist/types/plugins/media/types.d.ts +3 -0
- package/dist/types/plugins/media/ui/ResizableMediaSingle/index.d.ts +1 -1
- package/dist/types/plugins/media/utils/media-single.d.ts +1 -1
- package/dist/types/plugins/mentions/analytics.d.ts +1 -1
- package/dist/types/plugins/mentions/index.d.ts +4 -30
- package/dist/types/plugins/mentions/pm-plugins/key.d.ts +3 -0
- package/dist/types/plugins/mentions/pm-plugins/main.d.ts +8 -0
- package/dist/types/plugins/mentions/pm-plugins/utils.d.ts +3 -0
- package/dist/types/plugins/mentions/type-ahead/index.d.ts +17 -0
- package/dist/types/plugins/mentions/types.d.ts +2 -0
- package/dist/types/plugins/mentions/ui/InviteItem/index.d.ts +1 -0
- package/dist/types/plugins/mentions/ui/InviteItem/styles.d.ts +2 -0
- package/dist/types/plugins/mentions/utils.d.ts +4 -0
- package/dist/types/plugins/panel/nodeviews/panel.d.ts +19 -3
- package/dist/types/plugins/paste/pm-plugins/analytics.d.ts +2 -0
- package/dist/types/plugins/quick-insert/api.d.ts +6 -0
- package/dist/types/plugins/quick-insert/assets/custom-panel.d.ts +1 -0
- package/dist/types/plugins/quick-insert/assets/index.d.ts +1 -0
- package/dist/types/plugins/quick-insert/search.d.ts +1 -1
- package/dist/types/plugins/quick-insert/types.d.ts +3 -0
- package/dist/types/plugins/status/actions.d.ts +3 -1
- package/dist/types/plugins/status/ui/statusPicker.d.ts +1 -1
- package/dist/types/plugins/type-ahead/api.d.ts +53 -0
- package/dist/types/plugins/type-ahead/commands/insert-type-ahead-item.d.ts +12 -0
- package/dist/types/plugins/type-ahead/commands/update-list-items.d.ts +3 -0
- package/dist/types/plugins/type-ahead/commands/update-query.d.ts +2 -2
- package/dist/types/plugins/type-ahead/commands/update-selected-index.d.ts +2 -0
- package/dist/types/plugins/type-ahead/constants.d.ts +10 -0
- package/dist/types/plugins/type-ahead/index.d.ts +5 -4
- package/dist/types/plugins/type-ahead/insert-utils.d.ts +18 -0
- package/dist/types/plugins/type-ahead/pm-plugins/actions.d.ts +9 -8
- package/dist/types/plugins/type-ahead/pm-plugins/decorations.d.ts +24 -0
- package/dist/types/plugins/type-ahead/pm-plugins/input-rules.d.ts +0 -1
- package/dist/types/plugins/type-ahead/pm-plugins/insert-item-plugin.d.ts +2 -0
- package/dist/types/plugins/type-ahead/pm-plugins/{plugin-key.d.ts → key.d.ts} +0 -0
- package/dist/types/plugins/type-ahead/pm-plugins/main.d.ts +12 -39
- package/dist/types/plugins/type-ahead/pm-plugins/reducer.d.ts +10 -0
- package/dist/types/plugins/type-ahead/pm-plugins/utils.d.ts +4 -0
- package/dist/types/plugins/type-ahead/stats-modifier.d.ts +20 -0
- package/dist/types/plugins/type-ahead/transforms/close-type-ahead.d.ts +2 -0
- package/dist/types/plugins/type-ahead/transforms/open-typeahead-at-cursor.d.ts +9 -0
- package/dist/types/plugins/type-ahead/transforms/set-selection-before-query.d.ts +2 -0
- package/dist/types/plugins/type-ahead/types.d.ts +95 -30
- package/dist/types/plugins/type-ahead/ui/DynamicHeightListItem.d.ts +21 -0
- package/dist/types/plugins/type-ahead/ui/InputQuery.d.ts +22 -0
- package/dist/types/plugins/type-ahead/ui/TypeAheadList.d.ts +11 -0
- package/dist/types/plugins/type-ahead/ui/TypeAheadListItem.d.ts +15 -0
- package/dist/types/plugins/type-ahead/ui/TypeAheadPopup.d.ts +22 -0
- package/dist/types/plugins/type-ahead/ui/WrapperTypeAhead.d.ts +20 -0
- package/dist/types/plugins/type-ahead/ui/hooks/use-dynamic-list-height-calculation.d.ts +25 -0
- package/dist/types/plugins/type-ahead/ui/hooks/use-item-insert.d.ts +3 -0
- package/dist/types/plugins/type-ahead/ui/hooks/use-load-items.d.ts +3 -0
- package/dist/types/plugins/type-ahead/ui/hooks/use-on-force-select.d.ts +11 -0
- package/dist/types/plugins/type-ahead/ui/hooks/use-resize-observer.d.ts +9 -0
- package/dist/types/plugins/type-ahead/utils.d.ts +18 -0
- package/dist/types/plugins/view-update-subscription/subscribe/type-ahead-updates.d.ts +9 -0
- package/dist/types/test-utils.d.ts +2 -0
- package/dist/types/types/editor-props.d.ts +2 -0
- package/dist/types/types/empty-state-handler.d.ts +7 -0
- package/dist/types/types/feature-flags.d.ts +8 -0
- package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +1 -1
- package/dist/types/ui/ColorPickerButton/index.d.ts +1 -1
- package/dist/types/ui/ConfigPanel/ConfigPanel.d.ts +1 -1
- package/dist/types/ui/ConfigPanel/FormErrorBoundary.d.ts +1 -1
- package/dist/types/ui/ElementBrowser/ElementBrowser.d.ts +2 -0
- package/dist/types/ui/ElementBrowser/ModalElementBrowser.d.ts +2 -0
- package/dist/types/ui/ElementBrowser/components/CategoryList.d.ts +1 -1
- package/dist/types/ui/ElementBrowser/components/ElementList/ElementList.d.ts +5 -1
- package/dist/types/ui/ElementBrowser/components/StatelessElementBrowser.d.ts +3 -1
- package/dist/types/ui/LinkSearch/index.d.ts +20 -20
- package/dist/types/ui/PortalProvider/index.d.ts +1 -1
- package/dist/types/ui/ToolbarButton/index.d.ts +4 -4
- package/dist/types/ui/ToolbarButton/styles.d.ts +2 -2
- package/dist/types/utils/selection.d.ts +2 -2
- package/package.json +32 -29
- package/dist/cjs/plugins/emoji/commands/insert-emoji-query.js +0 -22
- package/dist/cjs/plugins/mentions/commands/insert-mention-query.js +0 -22
- package/dist/cjs/plugins/type-ahead/commands/dismiss.js +0 -44
- package/dist/cjs/plugins/type-ahead/commands/insert-query.js +0 -38
- package/dist/cjs/plugins/type-ahead/commands/items-list-updated.js +0 -25
- package/dist/cjs/plugins/type-ahead/commands/select-item.js +0 -163
- package/dist/cjs/plugins/type-ahead/commands/set-current-index.js +0 -25
- package/dist/cjs/plugins/type-ahead/pm-plugins/keymap.js +0 -115
- package/dist/cjs/plugins/type-ahead/ui/TypeAhead.js +0 -221
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadItemsList.js +0 -239
- package/dist/cjs/plugins/type-ahead/utils/find-query-mark.js +0 -33
- package/dist/cjs/plugins/type-ahead/utils/is-query-active.js +0 -16
- package/dist/es2019/plugins/emoji/commands/insert-emoji-query.js +0 -13
- package/dist/es2019/plugins/mentions/commands/insert-mention-query.js +0 -13
- package/dist/es2019/plugins/type-ahead/commands/dismiss.js +0 -36
- package/dist/es2019/plugins/type-ahead/commands/insert-query.js +0 -26
- package/dist/es2019/plugins/type-ahead/commands/items-list-updated.js +0 -12
- package/dist/es2019/plugins/type-ahead/commands/select-item.js +0 -119
- package/dist/es2019/plugins/type-ahead/commands/set-current-index.js +0 -13
- package/dist/es2019/plugins/type-ahead/pm-plugins/keymap.js +0 -94
- package/dist/es2019/plugins/type-ahead/ui/TypeAhead.js +0 -175
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadItemsList.js +0 -196
- package/dist/es2019/plugins/type-ahead/utils/find-query-mark.js +0 -29
- package/dist/es2019/plugins/type-ahead/utils/is-query-active.js +0 -9
- package/dist/esm/plugins/emoji/commands/insert-emoji-query.js +0 -13
- package/dist/esm/plugins/mentions/commands/insert-mention-query.js +0 -13
- package/dist/esm/plugins/type-ahead/commands/dismiss.js +0 -33
- package/dist/esm/plugins/type-ahead/commands/insert-query.js +0 -26
- package/dist/esm/plugins/type-ahead/commands/items-list-updated.js +0 -14
- package/dist/esm/plugins/type-ahead/commands/select-item.js +0 -132
- package/dist/esm/plugins/type-ahead/commands/set-current-index.js +0 -15
- package/dist/esm/plugins/type-ahead/pm-plugins/keymap.js +0 -94
- package/dist/esm/plugins/type-ahead/ui/TypeAhead.js +0 -202
- package/dist/esm/plugins/type-ahead/ui/TypeAheadItemsList.js +0 -204
- package/dist/esm/plugins/type-ahead/utils/find-query-mark.js +0 -24
- package/dist/esm/plugins/type-ahead/utils/is-query-active.js +0 -9
- package/dist/types/plugins/emoji/commands/insert-emoji-query.d.ts +0 -2
- package/dist/types/plugins/mentions/commands/insert-mention-query.d.ts +0 -2
- package/dist/types/plugins/type-ahead/commands/dismiss.d.ts +0 -2
- package/dist/types/plugins/type-ahead/commands/insert-query.d.ts +0 -2
- package/dist/types/plugins/type-ahead/commands/items-list-updated.d.ts +0 -3
- package/dist/types/plugins/type-ahead/commands/select-item.d.ts +0 -9
- package/dist/types/plugins/type-ahead/commands/set-current-index.d.ts +0 -2
- package/dist/types/plugins/type-ahead/pm-plugins/keymap.d.ts +0 -3
- package/dist/types/plugins/type-ahead/ui/TypeAhead.d.ts +0 -37
- package/dist/types/plugins/type-ahead/ui/TypeAheadItemsList.d.ts +0 -32
- package/dist/types/plugins/type-ahead/utils/find-query-mark.d.ts +0 -10
- package/dist/types/plugins/type-ahead/utils/is-query-active.d.ts +0 -2
|
@@ -7,6 +7,8 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { Plugin, PluginKey } from 'prosemirror-state';
|
|
9
9
|
import { emoji } from '@atlaskit/adf-schema';
|
|
10
|
+
import { Fragment } from 'prosemirror-model';
|
|
11
|
+
import { TypeAheadAvailableNodes } from '@atlaskit/editor-common/type-ahead';
|
|
10
12
|
import { EmojiTypeAheadItem, SearchSort, recordSelectionSucceededSli, recordSelectionFailedSli } from '@atlaskit/emoji';
|
|
11
13
|
import { inputRulePlugin as asciiInputRulePlugin } from './pm-plugins/ascii-input-rules';
|
|
12
14
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, addAnalytics, EVENT_TYPE, INPUT_METHOD } from '../analytics';
|
|
@@ -16,6 +18,7 @@ import emojiNodeViewNext from './nodeviews/emoji-next';
|
|
|
16
18
|
import { EmojiContextProvider } from './ui/EmojiContextProvider';
|
|
17
19
|
import { messages } from '../insert-block/ui/ToolbarInsertBlock/messages';
|
|
18
20
|
import { getFeatureFlags } from '../feature-flags-context';
|
|
21
|
+
import { openTypeAheadAtCursor } from '../type-ahead/transforms/open-typeahead-at-cursor';
|
|
19
22
|
export var emojiToTypeaheadItem = function emojiToTypeaheadItem(emoji, emojiProvider) {
|
|
20
23
|
return {
|
|
21
24
|
title: emoji.shortName || '',
|
|
@@ -70,7 +73,105 @@ var isFullShortName = function isFullShortName(query) {
|
|
|
70
73
|
return query && query.length > 1 && query.charAt(0) === ':' && query.charAt(query.length - 1) === ':';
|
|
71
74
|
};
|
|
72
75
|
|
|
76
|
+
var TRIGGER = ':';
|
|
77
|
+
|
|
73
78
|
var emojiPlugin = function emojiPlugin(options) {
|
|
79
|
+
var typeAhead = {
|
|
80
|
+
id: TypeAheadAvailableNodes.EMOJI,
|
|
81
|
+
trigger: TRIGGER,
|
|
82
|
+
// Custom regex must have a capture group around trigger
|
|
83
|
+
// so it's possible to use it without needing to scan through all triggers again
|
|
84
|
+
customRegex: '\\(?(:)',
|
|
85
|
+
headless: options ? options.headless : undefined,
|
|
86
|
+
getItems: function getItems(_ref2) {
|
|
87
|
+
var query = _ref2.query,
|
|
88
|
+
editorState = _ref2.editorState;
|
|
89
|
+
var pluginState = getEmojiPluginState(editorState);
|
|
90
|
+
var emojiProvider = pluginState.emojiProvider;
|
|
91
|
+
|
|
92
|
+
if (!emojiProvider) {
|
|
93
|
+
return Promise.resolve([]);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
return new Promise(function (resolve) {
|
|
97
|
+
var emojiProviderChangeHandler = {
|
|
98
|
+
result: function result(emojiResult) {
|
|
99
|
+
if (!emojiResult || !emojiResult.emojis) {
|
|
100
|
+
resolve([]);
|
|
101
|
+
} else {
|
|
102
|
+
var emojiItems = emojiResult.emojis.map(function (emoji) {
|
|
103
|
+
return memoizedToItem.call(emoji, emojiProvider);
|
|
104
|
+
});
|
|
105
|
+
resolve(emojiItems);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
emojiProvider.unsubscribe(emojiProviderChangeHandler);
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
emojiProvider.subscribe(emojiProviderChangeHandler);
|
|
112
|
+
emojiProvider.filter(TRIGGER.concat(query), {
|
|
113
|
+
limit: defaultListLimit,
|
|
114
|
+
skinTone: emojiProvider.getSelectedTone(),
|
|
115
|
+
sort: !query.length ? SearchSort.UsageFrequency : SearchSort.Default
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
},
|
|
119
|
+
forceSelect: function forceSelect(_ref3) {
|
|
120
|
+
var query = _ref3.query,
|
|
121
|
+
items = _ref3.items,
|
|
122
|
+
editorState = _ref3.editorState;
|
|
123
|
+
|
|
124
|
+
var _emojiPluginKey$getSt = emojiPluginKey.getState(editorState),
|
|
125
|
+
asciiMap = _emojiPluginKey$getSt.asciiMap;
|
|
126
|
+
|
|
127
|
+
var normalizedQuery = TRIGGER.concat(query); // if the query has space at the end
|
|
128
|
+
// check the ascii map for emojis
|
|
129
|
+
|
|
130
|
+
if (asciiMap && normalizedQuery.length >= 3 && normalizedQuery.endsWith(' ') && asciiMap.has(normalizedQuery.trim())) {
|
|
131
|
+
var _emoji = asciiMap.get(normalizedQuery.trim());
|
|
132
|
+
|
|
133
|
+
return {
|
|
134
|
+
title: _emoji.name,
|
|
135
|
+
emoji: _emoji
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
var matchedItem = isFullShortName(normalizedQuery) ? items.find(function (item) {
|
|
140
|
+
return item.title.toLowerCase() === normalizedQuery;
|
|
141
|
+
}) : undefined;
|
|
142
|
+
return matchedItem;
|
|
143
|
+
},
|
|
144
|
+
selectItem: function selectItem(state, item, insert, _ref4) {
|
|
145
|
+
var mode = _ref4.mode;
|
|
146
|
+
var _item$emoji = item.emoji,
|
|
147
|
+
_item$emoji$id = _item$emoji.id,
|
|
148
|
+
id = _item$emoji$id === void 0 ? '' : _item$emoji$id,
|
|
149
|
+
fallback = _item$emoji.fallback,
|
|
150
|
+
shortName = _item$emoji.shortName;
|
|
151
|
+
var text = fallback || shortName;
|
|
152
|
+
var emojiPluginState = emojiPluginKey.getState(state);
|
|
153
|
+
|
|
154
|
+
if (emojiPluginState.emojiProvider && emojiPluginState.emojiProvider.recordSelection && item.emoji) {
|
|
155
|
+
emojiPluginState.emojiProvider.recordSelection(item.emoji).then(recordSelectionSucceededSli(options)).catch(recordSelectionFailedSli(options));
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
var emojiNode = state.schema.nodes.emoji.createChecked({
|
|
159
|
+
shortName: shortName,
|
|
160
|
+
id: id,
|
|
161
|
+
text: text
|
|
162
|
+
});
|
|
163
|
+
var space = state.schema.text(' ');
|
|
164
|
+
return addAnalytics(state, insert(Fragment.from([emojiNode, space])), {
|
|
165
|
+
action: ACTION.INSERTED,
|
|
166
|
+
actionSubject: ACTION_SUBJECT.DOCUMENT,
|
|
167
|
+
actionSubjectId: ACTION_SUBJECT_ID.EMOJI,
|
|
168
|
+
attributes: {
|
|
169
|
+
inputMethod: INPUT_METHOD.TYPEAHEAD
|
|
170
|
+
},
|
|
171
|
+
eventType: EVENT_TYPE.TRACK
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
};
|
|
74
175
|
return {
|
|
75
176
|
name: 'emoji',
|
|
76
177
|
nodes: function nodes() {
|
|
@@ -82,26 +183,26 @@ var emojiPlugin = function emojiPlugin(options) {
|
|
|
82
183
|
pmPlugins: function pmPlugins() {
|
|
83
184
|
return [{
|
|
84
185
|
name: 'emoji',
|
|
85
|
-
plugin: function plugin(
|
|
86
|
-
var providerFactory =
|
|
87
|
-
dispatch =
|
|
88
|
-
portalProviderAPI =
|
|
89
|
-
eventDispatcher =
|
|
186
|
+
plugin: function plugin(_ref5) {
|
|
187
|
+
var providerFactory = _ref5.providerFactory,
|
|
188
|
+
dispatch = _ref5.dispatch,
|
|
189
|
+
portalProviderAPI = _ref5.portalProviderAPI,
|
|
190
|
+
eventDispatcher = _ref5.eventDispatcher;
|
|
90
191
|
return emojiPluginFactory(dispatch, providerFactory, portalProviderAPI, eventDispatcher, options);
|
|
91
192
|
}
|
|
92
193
|
}, {
|
|
93
194
|
name: 'emojiAsciiInputRule',
|
|
94
|
-
plugin: function plugin(
|
|
95
|
-
var schema =
|
|
96
|
-
providerFactory =
|
|
97
|
-
featureFlags =
|
|
195
|
+
plugin: function plugin(_ref6) {
|
|
196
|
+
var schema = _ref6.schema,
|
|
197
|
+
providerFactory = _ref6.providerFactory,
|
|
198
|
+
featureFlags = _ref6.featureFlags;
|
|
98
199
|
return asciiInputRulePlugin(schema, providerFactory, featureFlags);
|
|
99
200
|
}
|
|
100
201
|
}];
|
|
101
202
|
},
|
|
102
203
|
pluginsOptions: {
|
|
103
|
-
quickInsert: function quickInsert(
|
|
104
|
-
var formatMessage =
|
|
204
|
+
quickInsert: function quickInsert(_ref7) {
|
|
205
|
+
var formatMessage = _ref7.formatMessage;
|
|
105
206
|
return [{
|
|
106
207
|
id: 'emoji',
|
|
107
208
|
title: formatMessage(messages.emoji),
|
|
@@ -112,11 +213,11 @@ var emojiPlugin = function emojiPlugin(options) {
|
|
|
112
213
|
return /*#__PURE__*/React.createElement(IconEmoji, null);
|
|
113
214
|
},
|
|
114
215
|
action: function action(insert, state) {
|
|
115
|
-
var
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
216
|
+
var tr = insert(undefined);
|
|
217
|
+
openTypeAheadAtCursor({
|
|
218
|
+
triggerHandler: typeAhead,
|
|
219
|
+
inputMethod: INPUT_METHOD.QUICK_INSERT
|
|
220
|
+
})(tr);
|
|
120
221
|
return addAnalytics(state, tr, {
|
|
121
222
|
action: ACTION.INVOKED,
|
|
122
223
|
actionSubject: ACTION_SUBJECT.TYPEAHEAD,
|
|
@@ -129,69 +230,7 @@ var emojiPlugin = function emojiPlugin(options) {
|
|
|
129
230
|
}
|
|
130
231
|
}];
|
|
131
232
|
},
|
|
132
|
-
typeAhead:
|
|
133
|
-
trigger: ':',
|
|
134
|
-
// Custom regex must have a capture group around trigger
|
|
135
|
-
// so it's possible to use it without needing to scan through all triggers again
|
|
136
|
-
customRegex: '\\(?(:)',
|
|
137
|
-
headless: options ? options.headless : undefined,
|
|
138
|
-
getItems: function getItems(query, state, _intl, _ref5) {
|
|
139
|
-
var prevActive = _ref5.prevActive,
|
|
140
|
-
queryChanged = _ref5.queryChanged;
|
|
141
|
-
var pluginState = getEmojiPluginState(state);
|
|
142
|
-
var emojiProvider = pluginState.emojiProvider,
|
|
143
|
-
pluginEmojis = pluginState.emojis;
|
|
144
|
-
var emojis = !prevActive && queryChanged ? [] : pluginEmojis || [];
|
|
145
|
-
|
|
146
|
-
if (queryChanged && emojiProvider) {
|
|
147
|
-
memoizedToItem.clear();
|
|
148
|
-
emojiProvider.filter(query ? ":".concat(query) : '', {
|
|
149
|
-
limit: defaultListLimit,
|
|
150
|
-
skinTone: emojiProvider.getSelectedTone(),
|
|
151
|
-
sort: !query.length ? SearchSort.UsageFrequency : SearchSort.Default
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
return emojis.map(function (emoji) {
|
|
156
|
-
return memoizedToItem.call(emoji, emojiProvider);
|
|
157
|
-
});
|
|
158
|
-
},
|
|
159
|
-
forceSelect: function forceSelect(query, items) {
|
|
160
|
-
var normalizedQuery = ':' + query;
|
|
161
|
-
var matchedItem = isFullShortName(normalizedQuery) ? items.find(function (item) {
|
|
162
|
-
return item.title.toLowerCase() === normalizedQuery;
|
|
163
|
-
}) : undefined;
|
|
164
|
-
return matchedItem;
|
|
165
|
-
},
|
|
166
|
-
selectItem: function selectItem(state, item, insert, _ref6) {
|
|
167
|
-
var mode = _ref6.mode;
|
|
168
|
-
var _item$emoji = item.emoji,
|
|
169
|
-
_item$emoji$id = _item$emoji.id,
|
|
170
|
-
id = _item$emoji$id === void 0 ? '' : _item$emoji$id,
|
|
171
|
-
fallback = _item$emoji.fallback,
|
|
172
|
-
shortName = _item$emoji.shortName;
|
|
173
|
-
var text = fallback || shortName;
|
|
174
|
-
var emojiPluginState = emojiPluginKey.getState(state);
|
|
175
|
-
|
|
176
|
-
if (emojiPluginState.emojiProvider && emojiPluginState.emojiProvider.recordSelection && item.emoji) {
|
|
177
|
-
emojiPluginState.emojiProvider.recordSelection(item.emoji).then(recordSelectionSucceededSli(options)).catch(recordSelectionFailedSli(options));
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
return addAnalytics(state, insert(state.schema.nodes.emoji.createChecked({
|
|
181
|
-
shortName: shortName,
|
|
182
|
-
id: id,
|
|
183
|
-
text: text
|
|
184
|
-
})), {
|
|
185
|
-
action: ACTION.INSERTED,
|
|
186
|
-
actionSubject: ACTION_SUBJECT.DOCUMENT,
|
|
187
|
-
actionSubjectId: ACTION_SUBJECT_ID.EMOJI,
|
|
188
|
-
attributes: {
|
|
189
|
-
inputMethod: INPUT_METHOD.TYPEAHEAD
|
|
190
|
-
},
|
|
191
|
-
eventType: EVENT_TYPE.TRACK
|
|
192
|
-
});
|
|
193
|
-
}
|
|
194
|
-
}
|
|
233
|
+
typeAhead: typeAhead
|
|
195
234
|
}
|
|
196
235
|
};
|
|
197
236
|
};
|
|
@@ -203,15 +242,17 @@ export default emojiPlugin;
|
|
|
203
242
|
|
|
204
243
|
export var ACTIONS = {
|
|
205
244
|
SET_PROVIDER: 'SET_PROVIDER',
|
|
206
|
-
SET_RESULTS: 'SET_RESULTS'
|
|
245
|
+
SET_RESULTS: 'SET_RESULTS',
|
|
246
|
+
SET_ASCII_MAP: 'SET_ASCII_MAP'
|
|
207
247
|
};
|
|
208
|
-
|
|
248
|
+
|
|
249
|
+
var setAsciiMap = function setAsciiMap(asciiMap) {
|
|
209
250
|
return function (state, dispatch) {
|
|
210
251
|
if (dispatch) {
|
|
211
252
|
dispatch(state.tr.setMeta(emojiPluginKey, {
|
|
212
|
-
action: ACTIONS.
|
|
253
|
+
action: ACTIONS.SET_ASCII_MAP,
|
|
213
254
|
params: {
|
|
214
|
-
|
|
255
|
+
asciiMap: asciiMap
|
|
215
256
|
}
|
|
216
257
|
}));
|
|
217
258
|
}
|
|
@@ -219,13 +260,14 @@ export var setProvider = function setProvider(provider) {
|
|
|
219
260
|
return true;
|
|
220
261
|
};
|
|
221
262
|
};
|
|
222
|
-
|
|
263
|
+
|
|
264
|
+
export var setProvider = function setProvider(provider) {
|
|
223
265
|
return function (state, dispatch) {
|
|
224
266
|
if (dispatch) {
|
|
225
267
|
dispatch(state.tr.setMeta(emojiPluginKey, {
|
|
226
|
-
action: ACTIONS.
|
|
268
|
+
action: ACTIONS.SET_PROVIDER,
|
|
227
269
|
params: {
|
|
228
|
-
|
|
270
|
+
provider: provider
|
|
229
271
|
}
|
|
230
272
|
}));
|
|
231
273
|
}
|
|
@@ -238,8 +280,6 @@ export function getEmojiPluginState(state) {
|
|
|
238
280
|
return emojiPluginKey.getState(state) || {};
|
|
239
281
|
}
|
|
240
282
|
export function emojiPluginFactory(dispatch, providerFactory, portalProviderAPI, eventDispatcher, options) {
|
|
241
|
-
var emojiProvider;
|
|
242
|
-
var emojiProviderChangeHandler;
|
|
243
283
|
return new Plugin({
|
|
244
284
|
key: emojiPluginKey,
|
|
245
285
|
state: {
|
|
@@ -247,12 +287,12 @@ export function emojiPluginFactory(dispatch, providerFactory, portalProviderAPI,
|
|
|
247
287
|
return {};
|
|
248
288
|
},
|
|
249
289
|
apply: function apply(tr, pluginState) {
|
|
250
|
-
var
|
|
290
|
+
var _ref8 = tr.getMeta(emojiPluginKey) || {
|
|
251
291
|
action: null,
|
|
252
292
|
params: null
|
|
253
293
|
},
|
|
254
|
-
action =
|
|
255
|
-
params =
|
|
294
|
+
action = _ref8.action,
|
|
295
|
+
params = _ref8.params;
|
|
256
296
|
|
|
257
297
|
var newPluginState = pluginState;
|
|
258
298
|
|
|
@@ -264,9 +304,9 @@ export function emojiPluginFactory(dispatch, providerFactory, portalProviderAPI,
|
|
|
264
304
|
dispatch(emojiPluginKey, newPluginState);
|
|
265
305
|
return newPluginState;
|
|
266
306
|
|
|
267
|
-
case ACTIONS.
|
|
307
|
+
case ACTIONS.SET_ASCII_MAP:
|
|
268
308
|
newPluginState = _objectSpread(_objectSpread({}, pluginState), {}, {
|
|
269
|
-
|
|
309
|
+
asciiMap: params.asciiMap
|
|
270
310
|
});
|
|
271
311
|
dispatch(emojiPluginKey, newPluginState);
|
|
272
312
|
return newPluginState;
|
|
@@ -293,22 +333,10 @@ export function emojiPluginFactory(dispatch, providerFactory, portalProviderAPI,
|
|
|
293
333
|
}
|
|
294
334
|
|
|
295
335
|
providerPromise.then(function (provider) {
|
|
296
|
-
if (emojiProvider && emojiProviderChangeHandler) {
|
|
297
|
-
emojiProvider.unsubscribe(emojiProviderChangeHandler);
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
emojiProvider = provider;
|
|
301
336
|
setProvider(provider)(editorView.state, editorView.dispatch);
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
// we need to make it async here to make PM happy
|
|
306
|
-
Promise.resolve().then(function () {
|
|
307
|
-
setResults(emojis)(editorView.state, editorView.dispatch);
|
|
308
|
-
});
|
|
309
|
-
}
|
|
310
|
-
};
|
|
311
|
-
provider.subscribe(emojiProviderChangeHandler);
|
|
337
|
+
provider.getAsciiMap().then(function (asciiMap) {
|
|
338
|
+
setAsciiMap(asciiMap)(editorView.state, editorView.dispatch);
|
|
339
|
+
});
|
|
312
340
|
}).catch(function () {
|
|
313
341
|
return setProvider(undefined)(editorView.state, editorView.dispatch);
|
|
314
342
|
});
|
|
@@ -324,10 +352,6 @@ export function emojiPluginFactory(dispatch, providerFactory, portalProviderAPI,
|
|
|
324
352
|
if (providerFactory) {
|
|
325
353
|
providerFactory.unsubscribe('emojiProvider', providerHandler);
|
|
326
354
|
}
|
|
327
|
-
|
|
328
|
-
if (emojiProvider && emojiProviderChangeHandler) {
|
|
329
|
-
emojiProvider.unsubscribe(emojiProviderChangeHandler);
|
|
330
|
-
}
|
|
331
355
|
}
|
|
332
356
|
};
|
|
333
357
|
}
|
|
@@ -13,7 +13,6 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
13
13
|
import { PluginKey } from 'prosemirror-state';
|
|
14
14
|
import { createRule, createPlugin } from '../../../utils/input-rules';
|
|
15
15
|
import { leafNodeReplacementCharacter } from '@atlaskit/prosemirror-input-rules';
|
|
16
|
-
import { isMarkTypeAllowedInCurrentSelection } from '../../../utils';
|
|
17
16
|
import { addAnalytics, ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, INPUT_METHOD, EVENT_TYPE } from '../../analytics';
|
|
18
17
|
var matcher;
|
|
19
18
|
export function inputRulePlugin(schema, providerFactory, featureFlags) {
|
|
@@ -49,10 +48,6 @@ function inputRuleHandler(state, matchParts, start, end) {
|
|
|
49
48
|
return null;
|
|
50
49
|
}
|
|
51
50
|
|
|
52
|
-
if (!isEnabled(state)) {
|
|
53
|
-
return null;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
51
|
var match = matcher.match(matchParts);
|
|
57
52
|
|
|
58
53
|
if (match) {
|
|
@@ -63,14 +58,6 @@ function inputRuleHandler(state, matchParts, start, end) {
|
|
|
63
58
|
return null;
|
|
64
59
|
}
|
|
65
60
|
|
|
66
|
-
function isEnabled(state) {
|
|
67
|
-
var typeAheadQuery = state.schema.marks.typeAheadQuery;
|
|
68
|
-
var isTypeAheadQueryActive = state.selection.$from.marks().some(function (mark) {
|
|
69
|
-
return mark.type === typeAheadQuery;
|
|
70
|
-
});
|
|
71
|
-
return isTypeAheadQueryActive || isMarkTypeAllowedInCurrentSelection(typeAheadQuery, state);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
61
|
var REGEX_LEADING_CAPTURE_INDEX = 1;
|
|
75
62
|
var REGEX_EMOJI_LEADING_PARENTHESES = 2;
|
|
76
63
|
var REGEX_EMOJI_ASCII_CAPTURE_INDEX = 3;
|
|
@@ -3,7 +3,6 @@ import { Selection, TextSelection, NodeSelection } from 'prosemirror-state';
|
|
|
3
3
|
import * as keymaps from '../../../keymaps';
|
|
4
4
|
import { GapCursorSelection, Side } from '../../selection/gap-cursor-selection';
|
|
5
5
|
import { findExpand } from '../utils';
|
|
6
|
-
import { findTypeAheadQuery } from '../../type-ahead/utils/find-query-mark';
|
|
7
6
|
import { isEmptyNode } from '../../../utils';
|
|
8
7
|
import { expandClassNames } from '../ui/class-names';
|
|
9
8
|
import { deleteExpand, focusTitle } from '../commands';
|
|
@@ -78,9 +77,7 @@ export function expandKeymap() {
|
|
|
78
77
|
return false;
|
|
79
78
|
}, list);
|
|
80
79
|
keymaps.bindKeymapWithCommand(keymaps.moveUp.common, function (state, dispatch, editorView) {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
if (queryMark.start !== -1 && queryMark.end !== -1 || !editorView) {
|
|
80
|
+
if (!editorView) {
|
|
84
81
|
return false;
|
|
85
82
|
}
|
|
86
83
|
|
|
@@ -112,8 +109,8 @@ export function expandKeymap() {
|
|
|
112
109
|
return focusTitle(expandBefore.start)(state, dispatch, editorView);
|
|
113
110
|
} // moving cursor from outside of an expand to the content when it is expanded
|
|
114
111
|
else if (dispatch) {
|
|
115
|
-
|
|
116
|
-
|
|
112
|
+
dispatch(state.tr.setSelection(sel));
|
|
113
|
+
}
|
|
117
114
|
|
|
118
115
|
return true;
|
|
119
116
|
}
|
|
@@ -63,22 +63,22 @@ export var performNodeUpdate = function performNodeUpdate(type, newAttrs, conten
|
|
|
63
63
|
tr.setSelection(TextSelection.create(tr.doc, state.selection.anchor));
|
|
64
64
|
} // If any extension is currently selected
|
|
65
65
|
else if (findSelectedNodeOfType([extension, bodiedExtension, inlineExtension])(selection)) {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
66
|
+
tr = replaceSelectedNode(newNode)(tr); // Replacing selected node doesn't update the selection. `selection.node` still returns the old node
|
|
67
|
+
|
|
68
|
+
tr.setSelection(NodeSelection.create(tr.doc, tr.mapping.map(state.selection.anchor)));
|
|
69
|
+
} // When we loose the selection. This usually happens when Synchrony resets or changes
|
|
70
|
+
// the selection when user is in the middle of updating an extension.
|
|
71
|
+
else if (extensionState.element) {
|
|
72
|
+
var pos = view.posAtDOM(extensionState.element, -1);
|
|
73
|
+
|
|
74
|
+
if (pos > -1) {
|
|
75
|
+
tr = tr.replaceWith(pos, pos + (content.size || 0) + 1, newNode);
|
|
76
|
+
tr.setSelection(Selection.near(tr.doc.resolve(pos)));
|
|
77
|
+
targetSelectionSource = TARGET_SELECTION_SOURCE.HTML_ELEMENT;
|
|
78
|
+
} else {
|
|
79
|
+
action = ACTION.ERRORED;
|
|
80
|
+
}
|
|
81
|
+
} // Only scroll if we have anything to update, best to avoid surprise scroll
|
|
82
82
|
|
|
83
83
|
|
|
84
84
|
if (dispatch && tr.docChanged) {
|
|
@@ -315,10 +315,10 @@ var createPlugin = function createPlugin(dispatch, providerFactory, extensionHan
|
|
|
315
315
|
})(state, dispatch);
|
|
316
316
|
} // New DOM element doesn't necessarily mean it's a new Node
|
|
317
317
|
else if (element !== newElement) {
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
318
|
+
updateState({
|
|
319
|
+
element: newElement
|
|
320
|
+
})(state, dispatch);
|
|
321
|
+
}
|
|
322
322
|
|
|
323
323
|
return true;
|
|
324
324
|
},
|
|
@@ -128,7 +128,8 @@ var ExtensionComponent = /*#__PURE__*/function (_Component) {
|
|
|
128
128
|
extensionType: extensionType,
|
|
129
129
|
extensionKey: extensionKey,
|
|
130
130
|
parameters: parameters,
|
|
131
|
-
content: text
|
|
131
|
+
content: text,
|
|
132
|
+
localId: pmNode.attrs.localId
|
|
132
133
|
};
|
|
133
134
|
var result;
|
|
134
135
|
|
|
@@ -144,7 +145,7 @@ var ExtensionComponent = /*#__PURE__*/function (_Component) {
|
|
|
144
145
|
var NodeRenderer = extensionHandlerFromProvider;
|
|
145
146
|
return /*#__PURE__*/React.createElement(NodeRenderer, {
|
|
146
147
|
node: node,
|
|
147
|
-
|
|
148
|
+
references: _this.props.references
|
|
148
149
|
});
|
|
149
150
|
}
|
|
150
151
|
}
|
|
@@ -198,7 +199,7 @@ var ExtensionComponent = /*#__PURE__*/function (_Component) {
|
|
|
198
199
|
node = _this$props2.node,
|
|
199
200
|
handleContentDOMRef = _this$props2.handleContentDOMRef,
|
|
200
201
|
editorView = _this$props2.editorView,
|
|
201
|
-
|
|
202
|
+
references = _this$props2.references,
|
|
202
203
|
editorAppearance = _this$props2.editorAppearance;
|
|
203
204
|
var extensionHandlerResult = this.tryExtensionHandler();
|
|
204
205
|
|
|
@@ -207,7 +208,7 @@ var ExtensionComponent = /*#__PURE__*/function (_Component) {
|
|
|
207
208
|
case 'bodiedExtension':
|
|
208
209
|
return /*#__PURE__*/React.createElement(Extension, {
|
|
209
210
|
node: node,
|
|
210
|
-
|
|
211
|
+
references: references,
|
|
211
212
|
extensionProvider: this.state.extensionProvider,
|
|
212
213
|
handleContentDOMRef: handleContentDOMRef,
|
|
213
214
|
view: editorView,
|
|
@@ -34,12 +34,12 @@ var Extension = /*#__PURE__*/function (_Component) {
|
|
|
34
34
|
editorView = _this$props.editorView,
|
|
35
35
|
handleContentDOMRef = _this$props.handleContentDOMRef,
|
|
36
36
|
extensionHandlers = _this$props.extensionHandlers,
|
|
37
|
-
|
|
37
|
+
references = _this$props.references,
|
|
38
38
|
editorAppearance = _this$props.editorAppearance;
|
|
39
39
|
return /*#__PURE__*/React.createElement(ExtensionComponent, {
|
|
40
40
|
editorView: editorView,
|
|
41
41
|
node: node,
|
|
42
|
-
|
|
42
|
+
references: references,
|
|
43
43
|
extensionProvider: extensionProvider,
|
|
44
44
|
handleContentDOMRef: handleContentDOMRef,
|
|
45
45
|
extensionHandlers: extensionHandlers,
|
|
@@ -12,7 +12,7 @@ import { normalizeFeatureFlags } from '@atlaskit/editor-common/normalize-feature
|
|
|
12
12
|
* which is used by both current and archv3 editors.
|
|
13
13
|
*/
|
|
14
14
|
export function createFeatureFlagsFromProps(props) {
|
|
15
|
-
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;
|
|
15
|
+
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;
|
|
16
16
|
|
|
17
17
|
return _objectSpread(_objectSpread({}, normalizeFeatureFlags(props.featureFlags)), {}, {
|
|
18
18
|
newInsertionBehaviour: props.allowNewInsertionBehaviour,
|
|
@@ -38,6 +38,7 @@ export function createFeatureFlagsFromProps(props) {
|
|
|
38
38
|
showAvatarGroupAsPlugin: Boolean(typeof ((_props$featureFlags16 = props.featureFlags) === null || _props$featureFlags16 === void 0 ? void 0 : _props$featureFlags16.showAvatarGroupAsPlugin) === 'boolean' ? !!((_props$featureFlags17 = props.featureFlags) !== null && _props$featureFlags17 !== void 0 && _props$featureFlags17.showAvatarGroupAsPlugin) : false),
|
|
39
39
|
errorBoundaryDocStructure: Boolean(typeof ((_props$featureFlags18 = props.featureFlags) === null || _props$featureFlags18 === void 0 ? void 0 : _props$featureFlags18.useErrorBoundaryDocStructure) === 'boolean' ? !!((_props$featureFlags19 = props.featureFlags) !== null && _props$featureFlags19 !== void 0 && _props$featureFlags19.useErrorBoundaryDocStructure) : false),
|
|
40
40
|
synchronyErrorDocStructure: Boolean(typeof ((_props$featureFlags20 = props.featureFlags) === null || _props$featureFlags20 === void 0 ? void 0 : _props$featureFlags20.synchronyErrorDocStructure) === 'boolean' ? !!((_props$featureFlags21 = props.featureFlags) !== null && _props$featureFlags21 !== void 0 && _props$featureFlags21.synchronyErrorDocStructure) : false),
|
|
41
|
-
enableViewUpdateSubscription: Boolean(typeof ((_props$featureFlags22 = props.featureFlags) === null || _props$featureFlags22 === void 0 ? void 0 : _props$featureFlags22.enableViewUpdateSubscription) === 'boolean' ? !!((_props$featureFlags23 = props.featureFlags) !== null && _props$featureFlags23 !== void 0 && _props$featureFlags23.enableViewUpdateSubscription) : false)
|
|
41
|
+
enableViewUpdateSubscription: Boolean(typeof ((_props$featureFlags22 = props.featureFlags) === null || _props$featureFlags22 === void 0 ? void 0 : _props$featureFlags22.enableViewUpdateSubscription) === 'boolean' ? !!((_props$featureFlags23 = props.featureFlags) !== null && _props$featureFlags23 !== void 0 && _props$featureFlags23.enableViewUpdateSubscription) : false),
|
|
42
|
+
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)
|
|
42
43
|
});
|
|
43
44
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { injectIntl } from 'react-intl';
|
|
3
|
-
import
|
|
3
|
+
import Button from '@atlaskit/button/standard-button';
|
|
4
|
+
import Modal, { ModalTransition, ModalBody, ModalTitle, ModalHeader, ModalFooter } from '@atlaskit/modal-dialog';
|
|
4
5
|
import messages from './messages';
|
|
5
6
|
|
|
6
7
|
var ConfirmationModalImpl = function ConfirmationModalImpl(props) {
|
|
@@ -12,24 +13,20 @@ var ConfirmationModalImpl = function ConfirmationModalImpl(props) {
|
|
|
12
13
|
var heading = (options === null || options === void 0 ? void 0 : options.title) || formatMessage(messages.confirmModalDefaultHeading);
|
|
13
14
|
var okButtonLabel = (options === null || options === void 0 ? void 0 : options.okButtonLabel) || formatMessage(messages.confirmModalOK);
|
|
14
15
|
var cancelButtonLabel = (options === null || options === void 0 ? void 0 : options.cancelButtonLabel) || formatMessage(messages.confirmModalCancel);
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
return /*#__PURE__*/React.createElement(ModalTransition, null, options && /*#__PURE__*/React.createElement(Modal, {
|
|
17
|
+
onClose: onClose,
|
|
18
|
+
testId: testId
|
|
19
|
+
}, /*#__PURE__*/React.createElement(ModalHeader, null, /*#__PURE__*/React.createElement(ModalTitle, {
|
|
20
|
+
appearance: "warning"
|
|
21
|
+
}, heading)), /*#__PURE__*/React.createElement(ModalBody, null, /*#__PURE__*/React.createElement("p", null, options.message)), /*#__PURE__*/React.createElement(ModalFooter, null, /*#__PURE__*/React.createElement(Button, {
|
|
22
|
+
appearance: "default",
|
|
18
23
|
onClick: onClose,
|
|
19
24
|
testId: testId ? "".concat(testId, "-cancel-button") : undefined
|
|
20
|
-
}, {
|
|
21
|
-
|
|
22
|
-
appearance: 'warning',
|
|
25
|
+
}, cancelButtonLabel), /*#__PURE__*/React.createElement(Button, {
|
|
26
|
+
appearance: "warning",
|
|
23
27
|
onClick: onConfirm,
|
|
24
28
|
testId: testId ? "".concat(testId, "-confirm-button") : undefined
|
|
25
|
-
}
|
|
26
|
-
return /*#__PURE__*/React.createElement(ModalTransition, null, options && /*#__PURE__*/React.createElement(Modal, {
|
|
27
|
-
actions: actionButtons,
|
|
28
|
-
onClose: onClose,
|
|
29
|
-
heading: heading,
|
|
30
|
-
appearance: "warning",
|
|
31
|
-
testId: testId
|
|
32
|
-
}, /*#__PURE__*/React.createElement("p", null, options.message)));
|
|
29
|
+
}, okButtonLabel))));
|
|
33
30
|
};
|
|
34
31
|
|
|
35
32
|
export var ConfirmationModal = injectIntl(ConfirmationModalImpl);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export default function EditorEmojiAddIcon() {
|
|
3
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
4
|
+
width: 24,
|
|
5
|
+
height: 24,
|
|
6
|
+
viewBox: "0 0 24 24",
|
|
7
|
+
fill: "none",
|
|
8
|
+
"aria-label": "editor-add-emoji"
|
|
9
|
+
}, /*#__PURE__*/React.createElement("rect", {
|
|
10
|
+
width: 24,
|
|
11
|
+
height: 24,
|
|
12
|
+
fill: "white",
|
|
13
|
+
fillOpacity: "0.01"
|
|
14
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
15
|
+
fillRule: "evenodd",
|
|
16
|
+
clipRule: "evenodd",
|
|
17
|
+
d: "M14.5715 6.20367C13.7531 5.88041 12.8807 5.71423 12 5.71423C10.1435 5.71423 8.36301 6.45173 7.05025 7.76449C5.7375 9.07724 5 10.8577 5 12.7142C5 14.5708 5.7375 16.3512 7.05025 17.664C8.36301 18.9767 10.1435 19.7142 12 19.7142C12.9193 19.7142 13.8295 19.5332 14.6788 19.1814C15.5281 18.8296 16.2997 18.314 16.9497 17.664C17.5998 17.014 18.1154 16.2423 18.4672 15.393C18.8189 14.5437 19 13.6335 19 12.7142C19 12.1349 18.9281 11.5591 18.7868 10.9999H17.2266C17.404 11.5396 17.5 12.1159 17.5 12.7142C17.5 15.7472 15.033 18.2142 12 18.2142C8.967 18.2142 6.5 15.7472 6.5 12.7142C6.50159 11.256 7.08156 9.85801 8.11267 8.8269C9.14377 7.79579 10.5418 7.21582 12 7.21423C12.9284 7.21423 13.8037 7.44537 14.5715 7.85312V6.20367ZM9.79289 11.9213C9.98043 12.1089 10.2348 12.2142 10.5 12.2142C10.7652 12.2142 11.0196 12.1089 11.2071 11.9213C11.3946 11.7338 11.5 11.4795 11.5 11.2142C11.5 10.949 11.3946 10.6947 11.2071 10.5071C11.0196 10.3196 10.7652 10.2142 10.5 10.2142C10.2348 10.2142 9.98043 10.3196 9.79289 10.5071C9.60536 10.6947 9.5 10.949 9.5 11.2142C9.5 11.4795 9.60536 11.7338 9.79289 11.9213ZM12.7929 11.9213C12.9804 12.1089 13.2348 12.2142 13.5 12.2142C13.7652 12.2142 14.0196 12.1089 14.2071 11.9213C14.3946 11.7338 14.5 11.4795 14.5 11.2142C14.5 10.949 14.3946 10.6947 14.2071 10.5071C14.0196 10.3196 13.7652 10.2142 13.5 10.2142C13.2348 10.2142 12.9804 10.3196 12.7929 10.5071C12.6054 10.6947 12.5 10.949 12.5 11.2142C12.5 11.4795 12.6054 11.7338 12.7929 11.9213ZM14.1965 13.61C14.0355 13.6153 13.8828 13.6823 13.77 13.7972C12.871 14.8032 11.133 14.8032 10.232 13.8002C10.1205 13.6799 9.96614 13.6082 9.80223 13.6006C9.63832 13.5931 9.47801 13.6503 9.35592 13.7599C9.23383 13.8695 9.15974 14.0227 9.14965 14.1865C9.13956 14.3503 9.19428 14.5115 9.302 14.6352C9.64217 15.0139 10.0582 15.3167 10.523 15.5241C10.9878 15.7316 11.491 15.8389 12 15.8392C12.51 15.839 13.0142 15.7313 13.4797 15.5231C13.9453 15.315 14.3617 15.0111 14.702 14.6312C14.8037 14.5064 14.8535 14.3472 14.8409 14.1866C14.8282 14.0261 14.7542 13.8766 14.6342 13.7692C14.5142 13.6618 14.3574 13.6048 14.1965 13.61Z",
|
|
18
|
+
fill: "currentColor"
|
|
19
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
20
|
+
fillRule: "evenodd",
|
|
21
|
+
clipRule: "evenodd",
|
|
22
|
+
d: "M16.2856 8.31714H17.0228V9.05429C17.0228 9.28161 17.1131 9.49963 17.2738 9.66038C17.4345 9.82112 17.6526 9.91143 17.8799 9.91143C18.1072 9.91143 18.3252 9.82112 18.486 9.66038C18.6467 9.49963 18.737 9.28161 18.737 9.05429V8.31714H19.4828C19.7101 8.31714 19.9281 8.22684 20.0888 8.06609C20.2496 7.90535 20.3399 7.68733 20.3399 7.46C20.3399 7.23267 20.2496 7.01465 20.0888 6.85391C19.9281 6.69316 19.7101 6.60286 19.4828 6.60286H18.737V5.85714C18.737 5.62981 18.6467 5.4118 18.486 5.25105C18.3252 5.09031 18.1072 5 17.8799 5C17.6526 5 17.4345 5.09031 17.2738 5.25105C17.1131 5.4118 17.0228 5.62981 17.0228 5.85714V6.60286H16.2856C16.0583 6.60286 15.8403 6.69316 15.6795 6.85391C15.5188 7.01465 15.4285 7.23267 15.4285 7.46C15.4285 7.68733 15.5188 7.90535 15.6795 8.06609C15.8403 8.22684 16.0583 8.31714 16.2856 8.31714Z",
|
|
23
|
+
fill: "currentColor"
|
|
24
|
+
}));
|
|
25
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export default function EditorHideEmojiIcon() {
|
|
3
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
4
|
+
width: "24",
|
|
5
|
+
height: "24",
|
|
6
|
+
viewBox: "0 0 24 24",
|
|
7
|
+
fill: "none",
|
|
8
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
9
|
+
}, /*#__PURE__*/React.createElement("rect", {
|
|
10
|
+
width: "24",
|
|
11
|
+
height: "24",
|
|
12
|
+
fill: "white",
|
|
13
|
+
fillOpacity: "0.01"
|
|
14
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
15
|
+
fillRule: "evenodd",
|
|
16
|
+
clipRule: "evenodd",
|
|
17
|
+
d: "M5.84238 8.67075C5.29444 9.68427 5 10.827 5 12C5 13.8565 5.7375 15.637 7.05025 16.9497C8.36301 18.2625 10.1435 19 12 19C12.9193 19 13.8295 18.8189 14.6788 18.4672C14.9012 18.375 15.1183 18.2717 15.3292 18.1576L14.2087 17.037C13.5324 17.3347 12.7851 17.5 12 17.5C8.967 17.5 6.5 15.033 6.5 12C6.50084 11.2327 6.66182 10.4821 6.9644 9.79277L5.84238 8.67075ZM17.0371 14.2086C17.3347 13.5323 17.5 12.7851 17.5 12C17.5 8.967 15.033 6.5 12 6.5C11.2327 6.50084 10.4821 6.6618 9.79285 6.96437L8.67083 5.84234C9.68433 5.29442 10.827 5 12 5C12.9193 5 13.8295 5.18106 14.6788 5.53284C15.5281 5.88463 16.2997 6.40024 16.9497 7.05025C17.5998 7.70026 18.1154 8.47194 18.4672 9.32122C18.8189 10.1705 19 11.0807 19 12C19 12.9193 18.8189 13.8295 18.4672 14.6788C18.375 14.9012 18.2717 15.1182 18.1577 15.3292L17.0371 14.2086Z",
|
|
18
|
+
fill: "currentColor"
|
|
19
|
+
}), /*#__PURE__*/React.createElement("rect", {
|
|
20
|
+
x: "4.31882",
|
|
21
|
+
y: "5.55618",
|
|
22
|
+
width: "1.75",
|
|
23
|
+
height: "19.9758",
|
|
24
|
+
rx: "0.875",
|
|
25
|
+
transform: "rotate(-45 4.31882 5.55618)",
|
|
26
|
+
fill: "currentColor"
|
|
27
|
+
}));
|
|
28
|
+
}
|