@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
|
@@ -1,32 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import { TypeAheadItem } from '../type-ahead/types';
|
|
6
|
-
import { MentionPluginOptions, MentionPluginState } from './types';
|
|
7
|
-
export declare const mentionToTypeaheadItem: (mention: MentionDescription) => TypeAheadItem;
|
|
8
|
-
export declare function memoize<ResultFn extends (mention: MentionDescription) => TypeAheadItem>(fn: ResultFn): {
|
|
9
|
-
call: ResultFn;
|
|
10
|
-
clear(): void;
|
|
11
|
-
};
|
|
1
|
+
import { EditorPlugin } from '../../types';
|
|
2
|
+
import { MentionPluginOptions } from './types';
|
|
3
|
+
import { mentionPluginKey } from './pm-plugins/key';
|
|
4
|
+
export { mentionPluginKey };
|
|
12
5
|
declare const mentionsPlugin: (options?: MentionPluginOptions | undefined) => EditorPlugin;
|
|
13
6
|
export default mentionsPlugin;
|
|
14
|
-
/**
|
|
15
|
-
* Actions
|
|
16
|
-
*/
|
|
17
|
-
export declare const ACTIONS: {
|
|
18
|
-
SET_PROVIDER: string;
|
|
19
|
-
SET_RESULTS: string;
|
|
20
|
-
SET_CONTEXT: string;
|
|
21
|
-
};
|
|
22
|
-
export declare const setProvider: (provider: MentionProvider | undefined) => Command;
|
|
23
|
-
export declare const setResults: (results: MentionDescription[]) => Command;
|
|
24
|
-
export declare const setContext: (context: ContextIdentifierProvider | undefined) => Command;
|
|
25
|
-
/**
|
|
26
|
-
*
|
|
27
|
-
* ProseMirror Plugin
|
|
28
|
-
*
|
|
29
|
-
*/
|
|
30
|
-
export declare const mentionPluginKey: PluginKey<MentionPluginState, any>;
|
|
31
|
-
export declare function getMentionPluginState(state: EditorState): MentionPluginState;
|
|
32
|
-
export declare const shouldKeepInviteItem: (query: string, firstQueryWithoutResults: string) => boolean;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Plugin } from 'prosemirror-state';
|
|
2
|
+
import { ContextIdentifierProvider, ProviderFactory } from '@atlaskit/editor-common';
|
|
3
|
+
import { Dispatch, EventDispatcher } from '../../../event-dispatcher';
|
|
4
|
+
import { PortalProviderAPI } from '../../../ui/PortalProvider';
|
|
5
|
+
import type { Command } from '../../../types';
|
|
6
|
+
import type { MentionPluginOptions, MentionPluginState } from '../types';
|
|
7
|
+
export declare const setContext: (context: ContextIdentifierProvider | undefined) => Command;
|
|
8
|
+
export declare function createMentionPlugin(dispatch: Dispatch, providerFactory: ProviderFactory, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, fireEvent: (payload: any) => void, options?: MentionPluginOptions): Plugin<MentionPluginState, import("prosemirror-model").Schema<any, any>>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MentionDescription } from '@atlaskit/mention/resource';
|
|
3
|
+
import type { TypeAheadHandler, TypeAheadItem } from '../../type-ahead/types';
|
|
4
|
+
import type { FireElementsChannelEvent } from '../types';
|
|
5
|
+
export declare const mentionToTypeaheadItem: (mention: MentionDescription) => TypeAheadItem;
|
|
6
|
+
export declare function memoize<ResultFn extends (mention: MentionDescription) => TypeAheadItem>(fn: ResultFn): {
|
|
7
|
+
call: ResultFn;
|
|
8
|
+
clear(): void;
|
|
9
|
+
};
|
|
10
|
+
declare type Props = {
|
|
11
|
+
sanitizePrivateContent?: boolean;
|
|
12
|
+
mentionInsertDisplayName?: boolean;
|
|
13
|
+
HighlightComponent?: React.ComponentType;
|
|
14
|
+
fireEvent: FireElementsChannelEvent;
|
|
15
|
+
};
|
|
16
|
+
export declare const createTypeAheadConfig: ({ sanitizePrivateContent, mentionInsertDisplayName, fireEvent, HighlightComponent, }: Props) => TypeAheadHandler;
|
|
17
|
+
export {};
|
|
@@ -3,6 +3,7 @@ import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
|
3
3
|
import { MentionDescription, MentionProvider } from '@atlaskit/mention';
|
|
4
4
|
import { TeamMentionProvider } from '@atlaskit/mention/resource';
|
|
5
5
|
import { ContextIdentifierProvider } from '@atlaskit/editor-common';
|
|
6
|
+
import { AnalyticsEventPayload } from '@atlaskit/analytics-next';
|
|
6
7
|
export interface TeamInfoAttrAnalytics {
|
|
7
8
|
teamId: String;
|
|
8
9
|
includesYou: boolean;
|
|
@@ -23,3 +24,4 @@ export declare type MentionPluginState = {
|
|
|
23
24
|
contextIdentifierProvider?: ContextIdentifierProvider;
|
|
24
25
|
mentions?: Array<MentionDescription>;
|
|
25
26
|
};
|
|
27
|
+
export declare type FireElementsChannelEvent = <T extends AnalyticsEventPayload>(payload: T) => void;
|
|
@@ -4,6 +4,7 @@ import { SyntheticEvent } from 'react';
|
|
|
4
4
|
export interface OnMentionEvent {
|
|
5
5
|
(mention: MentionDescription, event?: SyntheticEvent<any>): void;
|
|
6
6
|
}
|
|
7
|
+
export declare const INVITE_ITEM_MIN_HEIGHT: number;
|
|
7
8
|
export declare const INVITE_ITEM_DESCRIPTION: {
|
|
8
9
|
id: string;
|
|
9
10
|
};
|
|
@@ -5,7 +5,9 @@ export interface MentionItemStyleProps {
|
|
|
5
5
|
export interface NameSectionStyleProps {
|
|
6
6
|
restricted?: boolean;
|
|
7
7
|
}
|
|
8
|
+
export declare const ROW_SIDE_PADDING = 14;
|
|
8
9
|
export declare const RowStyle: ComponentClass<HTMLAttributes<{}>>;
|
|
10
|
+
export declare const AVATAR_HEIGHT = 36;
|
|
9
11
|
export declare const AvatarStyle: ComponentClass<HTMLAttributes<{}>>;
|
|
10
12
|
export declare const NameSectionStyle: ComponentClass<HTMLAttributes<{}> & NameSectionStyleProps>;
|
|
11
13
|
export declare const MentionItemStyle: ComponentClass<HTMLAttributes<{}> & MentionItemStyleProps>;
|
|
@@ -2,3 +2,7 @@ import { MentionDescription } from '@atlaskit/mention';
|
|
|
2
2
|
export declare const isTeamType: (userType: any) => Boolean;
|
|
3
3
|
export declare const isTeamStats: (stat: any) => Boolean;
|
|
4
4
|
export declare const isInviteItem: (mention: MentionDescription) => Boolean;
|
|
5
|
+
/**
|
|
6
|
+
* Actions
|
|
7
|
+
*/
|
|
8
|
+
export declare const shouldKeepInviteItem: (query: string, firstQueryWithoutResults: string) => boolean;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Node } from 'prosemirror-model';
|
|
3
|
+
import { EditorView } from 'prosemirror-view';
|
|
3
4
|
import { PanelType, PanelAttributes } from '@atlaskit/adf-schema';
|
|
4
|
-
import { getPosHandler } from '../../../nodeviews/';
|
|
5
|
+
import { getPosHandlerNode, getPosHandler } from '../../../nodeviews/';
|
|
5
6
|
import { ProviderFactory } from '@atlaskit/editor-common';
|
|
6
7
|
import { PanelPluginOptions } from '../types';
|
|
7
8
|
export declare const panelIcons: {
|
|
@@ -15,5 +16,20 @@ interface PanelIconAttributes {
|
|
|
15
16
|
allowCustomPanel?: boolean;
|
|
16
17
|
}
|
|
17
18
|
export declare const PanelIcon: React.FC<PanelIconAttributes>;
|
|
18
|
-
|
|
19
|
+
declare class PanelNodeView {
|
|
20
|
+
node: Node;
|
|
21
|
+
dom: HTMLElement;
|
|
22
|
+
contentDOM: HTMLElement;
|
|
23
|
+
icon: HTMLElement;
|
|
24
|
+
getPos: getPosHandlerNode;
|
|
25
|
+
view: EditorView;
|
|
26
|
+
providerFactory?: ProviderFactory;
|
|
27
|
+
pluginOptions: PanelPluginOptions;
|
|
28
|
+
constructor(node: Node, view: EditorView, getPos: getPosHandlerNode, pluginOptions: PanelPluginOptions, providerFactory?: ProviderFactory);
|
|
29
|
+
ignoreMutation(mutation: MutationRecord | {
|
|
30
|
+
type: 'selection';
|
|
31
|
+
target: Element;
|
|
32
|
+
}): boolean;
|
|
33
|
+
}
|
|
34
|
+
export declare const getPanelNodeView: (pluginOptions: PanelPluginOptions, providerFactory?: ProviderFactory | undefined) => (node: any, view: EditorView, getPos: getPosHandler) => PanelNodeView;
|
|
19
35
|
export {};
|
|
@@ -6,6 +6,8 @@ import { EditorState } from 'prosemirror-state';
|
|
|
6
6
|
declare type PasteContext = {
|
|
7
7
|
type: PasteType;
|
|
8
8
|
asPlain?: boolean;
|
|
9
|
+
/** Has the hyperlink been pasted while text is selected, making the text into a link? */
|
|
10
|
+
hyperlinkPasteOnText?: boolean;
|
|
9
11
|
};
|
|
10
12
|
export declare function getContent(state: EditorState, slice: Slice): PasteContent;
|
|
11
13
|
export declare function createPasteAnalyticsPayload(view: EditorView, event: ClipboardEvent, slice: Slice, pasteContext: PasteContext): AnalyticsEventPayload;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { EditorView } from 'prosemirror-view';
|
|
2
|
+
import { QuickInsertItem } from '@atlaskit/editor-common/provider-factory';
|
|
3
|
+
import type { QuickInsertPluginOptions } from './types';
|
|
4
|
+
export declare const createQuickInsertTools: (editorView: EditorView) => {
|
|
5
|
+
getItems: (query: string, options?: QuickInsertPluginOptions | undefined) => QuickInsertItem[];
|
|
6
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function IconCustomPanel(): JSX.Element;
|
|
@@ -19,6 +19,7 @@ export declare const IconPanelNote: (React.ComponentClass<IconProps, any> & Load
|
|
|
19
19
|
export declare const IconPanelSuccess: (React.ComponentClass<IconProps, any> & Loadable.LoadableComponent) | (React.FunctionComponent<IconProps> & Loadable.LoadableComponent);
|
|
20
20
|
export declare const IconPanelWarning: (React.ComponentClass<IconProps, any> & Loadable.LoadableComponent) | (React.FunctionComponent<IconProps> & Loadable.LoadableComponent);
|
|
21
21
|
export declare const IconPanel: (React.ComponentClass<IconProps, any> & Loadable.LoadableComponent) | (React.FunctionComponent<IconProps> & Loadable.LoadableComponent);
|
|
22
|
+
export declare const IconCustomPanel: (React.ComponentClass<IconProps, any> & Loadable.LoadableComponent) | (React.FunctionComponent<IconProps> & Loadable.LoadableComponent);
|
|
22
23
|
export declare const IconQuote: (React.ComponentClass<IconProps, any> & Loadable.LoadableComponent) | (React.FunctionComponent<IconProps> & Loadable.LoadableComponent);
|
|
23
24
|
export declare const IconStatus: (React.ComponentClass<IconProps, any> & Loadable.LoadableComponent) | (React.FunctionComponent<IconProps> & Loadable.LoadableComponent);
|
|
24
25
|
export declare const IconTable: (React.ComponentClass<IconProps, any> & Loadable.LoadableComponent) | (React.FunctionComponent<IconProps> & Loadable.LoadableComponent);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { QuickInsertItem } from '@atlaskit/editor-common/
|
|
1
|
+
import { QuickInsertItem } from '@atlaskit/editor-common/provider-factory';
|
|
2
2
|
import { QuickInsertPluginState, QuickInsertPluginOptions } from './types';
|
|
3
3
|
export declare function find(query: string, items: QuickInsertItem[]): QuickInsertItem[];
|
|
4
4
|
export declare const searchQuickInsertItems: (quickInsertState: QuickInsertPluginState, options?: QuickInsertPluginOptions | undefined) => (query?: string | undefined, category?: string | undefined) => QuickInsertItem[];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { InjectedIntl } from 'react-intl';
|
|
2
2
|
import { QuickInsertItem, QuickInsertProvider } from '@atlaskit/editor-common/provider-factory';
|
|
3
|
+
import { EmptyStateHandler } from '../../types/empty-state-handler';
|
|
3
4
|
export type { QuickInsertActionInsert, QuickInsertItem, QuickInsertProvider, } from '@atlaskit/editor-common/provider-factory';
|
|
4
5
|
export declare type QuickInsertOptions = boolean | {
|
|
5
6
|
provider: Promise<QuickInsertProvider>;
|
|
@@ -13,6 +14,7 @@ export declare type QuickInsertPluginState = {
|
|
|
13
14
|
lazyDefaultItems: () => QuickInsertItem[];
|
|
14
15
|
providedItems?: QuickInsertItem[];
|
|
15
16
|
provider?: QuickInsertProvider;
|
|
17
|
+
emptyStateHandler?: EmptyStateHandler;
|
|
16
18
|
};
|
|
17
19
|
export declare type QuickInsertPluginStateKeys = keyof QuickInsertPluginState;
|
|
18
20
|
export interface QuickInsertPluginOptions {
|
|
@@ -20,4 +22,5 @@ export interface QuickInsertPluginOptions {
|
|
|
20
22
|
disableDefaultItems?: boolean;
|
|
21
23
|
enableElementBrowser?: boolean;
|
|
22
24
|
elementBrowserHelpUrl?: string;
|
|
25
|
+
emptyStateHandler?: EmptyStateHandler;
|
|
23
26
|
}
|
|
@@ -4,7 +4,9 @@ import { Command } from '../../types';
|
|
|
4
4
|
import { TOOLBAR_MENU_TYPE } from '../insert-block/ui/ToolbarInsertBlock/types';
|
|
5
5
|
import { StatusType } from './types';
|
|
6
6
|
export declare const DEFAULT_STATUS: StatusType;
|
|
7
|
-
export declare const createStatus: (showStatusPickerAtOffset?: number) => (insert: (node: Node | Object | string
|
|
7
|
+
export declare const createStatus: (showStatusPickerAtOffset?: number) => (insert: (node: Node | Object | string, opts: {
|
|
8
|
+
selectInlineNode: boolean;
|
|
9
|
+
}) => Transaction, state: EditorState) => Transaction;
|
|
8
10
|
export declare const updateStatus: (status?: StatusType | undefined) => Command;
|
|
9
11
|
export declare const updateStatusWithAnalytics: (inputMethod: TOOLBAR_MENU_TYPE, status?: StatusType | undefined) => Command;
|
|
10
12
|
export declare const setStatusPickerAt: (showStatusPickerAt: number | null) => (state: EditorState, dispatch: (tr: Transaction) => void) => boolean;
|
|
@@ -46,5 +46,5 @@ export declare class StatusPickerWithoutAnalytcs extends React.Component<Props,
|
|
|
46
46
|
private onEnter;
|
|
47
47
|
private handlePopupClick;
|
|
48
48
|
}
|
|
49
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<Props, "
|
|
49
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<Props, "onSelect" | "target" | "isNew" | "onTextChanged" | "defaultColor" | "closeStatusPicker" | "onEnter" | "defaultText" | "defaultLocalId"> & React.RefAttributes<any>>;
|
|
50
50
|
export default _default;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { EditorView } from 'prosemirror-view';
|
|
2
|
+
import type { TypeAheadItem } from '@atlaskit/editor-common/provider-factory';
|
|
3
|
+
import { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
|
|
4
|
+
import type { TypeAheadHandler, TypeAheadInputMethod } from './types';
|
|
5
|
+
import { Command } from '../../types/command';
|
|
6
|
+
declare type CloseOptions = {
|
|
7
|
+
insertCurrentQueryAsRawText: boolean;
|
|
8
|
+
attachCommand?: Command;
|
|
9
|
+
};
|
|
10
|
+
declare type InsertItemProps = {
|
|
11
|
+
contentItem: TypeAheadItem;
|
|
12
|
+
query: string;
|
|
13
|
+
sourceListItem: TypeAheadItem[];
|
|
14
|
+
};
|
|
15
|
+
export declare const createTypeAheadTools: (editorView: EditorView) => {
|
|
16
|
+
isOpen: () => TypeAheadHandler | false;
|
|
17
|
+
currentQuery: () => string;
|
|
18
|
+
close: (options?: CloseOptions) => boolean;
|
|
19
|
+
openMention: (inputMethod: TypeAheadInputMethod) => boolean;
|
|
20
|
+
searchMention: (query?: string) => {
|
|
21
|
+
type: (appendValue: string) => Promise<TypeAheadItem[]> | undefined;
|
|
22
|
+
result: () => Promise<TypeAheadItem[] | undefined>;
|
|
23
|
+
close: (options?: CloseOptions) => boolean;
|
|
24
|
+
insert: ({ index, mode }: {
|
|
25
|
+
index: number;
|
|
26
|
+
mode?: SelectItemMode | undefined;
|
|
27
|
+
}) => Promise<void>;
|
|
28
|
+
};
|
|
29
|
+
openQuickInsert: (inputMethod: TypeAheadInputMethod) => boolean;
|
|
30
|
+
searchQuickInsert: (query?: string) => {
|
|
31
|
+
type: (appendValue: string) => Promise<TypeAheadItem[]> | undefined;
|
|
32
|
+
result: () => Promise<TypeAheadItem[] | undefined>;
|
|
33
|
+
close: (options?: CloseOptions) => boolean;
|
|
34
|
+
insert: ({ index, mode }: {
|
|
35
|
+
index: number;
|
|
36
|
+
mode?: SelectItemMode | undefined;
|
|
37
|
+
}) => Promise<void>;
|
|
38
|
+
};
|
|
39
|
+
openEmoji: (inputMethod: TypeAheadInputMethod) => boolean;
|
|
40
|
+
searchEmoji: (query?: string) => {
|
|
41
|
+
type: (appendValue: string) => Promise<TypeAheadItem[]> | undefined;
|
|
42
|
+
result: () => Promise<TypeAheadItem[] | undefined>;
|
|
43
|
+
close: (options?: CloseOptions) => boolean;
|
|
44
|
+
insert: ({ index, mode }: {
|
|
45
|
+
index: number;
|
|
46
|
+
mode?: SelectItemMode | undefined;
|
|
47
|
+
}) => Promise<void>;
|
|
48
|
+
};
|
|
49
|
+
insertItemMention: ({ contentItem, query, sourceListItem }: InsertItemProps) => boolean;
|
|
50
|
+
insertItemEmoji: ({ contentItem, query, sourceListItem }: InsertItemProps) => boolean;
|
|
51
|
+
insertItemQuickInsert: ({ contentItem, query, sourceListItem }: InsertItemProps) => boolean;
|
|
52
|
+
};
|
|
53
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { EditorView } from 'prosemirror-view';
|
|
2
|
+
import { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
|
|
3
|
+
import type { TypeAheadHandler, TypeAheadItem } from '../types';
|
|
4
|
+
declare type Props = {
|
|
5
|
+
item: TypeAheadItem;
|
|
6
|
+
handler: TypeAheadHandler;
|
|
7
|
+
mode: SelectItemMode;
|
|
8
|
+
sourceListItem: Array<TypeAheadItem>;
|
|
9
|
+
query: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const insertTypeAheadItem: (view: EditorView) => ({ item, handler, mode, query, sourceListItem, }: Props) => void;
|
|
12
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Command } from '../../../types';
|
|
2
|
-
export declare const
|
|
1
|
+
import { Command } from '../../../types/command';
|
|
2
|
+
export declare const updateQuery: (query: string) => Command;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const TYPE_AHEAD_DECORATION_KEY = "typeahead_decoration_key";
|
|
2
|
+
export declare const TYPE_AHEAD_DECORATION_DATA_ATTRIBUTE = "typeaheadDecoration";
|
|
3
|
+
export declare enum NavigationDirection {
|
|
4
|
+
LEFT = -1,
|
|
5
|
+
RIGHT = 1
|
|
6
|
+
}
|
|
7
|
+
export declare enum CloseSelectionOptions {
|
|
8
|
+
BEFORE_TEXT_INSERTED = "BEFORE_TEXT_INSERTED",
|
|
9
|
+
AFTER_TEXT_INSERTED = "AFTER_TEXT_INSERTED"
|
|
10
|
+
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { EditorPlugin } from '../../types/editor-plugin';
|
|
1
2
|
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
2
|
-
import {
|
|
3
|
-
import { pluginKey as typeAheadPluginKey, TypeAheadPluginState } from './pm-plugins/main';
|
|
3
|
+
import { pluginKey as typeAheadPluginKey } from './pm-plugins/key';
|
|
4
4
|
export declare type TypeAheadPluginOptions = {
|
|
5
|
+
isMobile?: boolean;
|
|
5
6
|
createAnalyticsEvent?: CreateUIAnalyticsEvent;
|
|
6
7
|
};
|
|
7
8
|
declare const typeAheadPlugin: (options?: TypeAheadPluginOptions | undefined) => EditorPlugin;
|
|
8
|
-
export { typeAheadPluginKey };
|
|
9
|
-
export type { TypeAheadPluginState };
|
|
10
9
|
export default typeAheadPlugin;
|
|
10
|
+
export { typeAheadPluginKey };
|
|
11
|
+
export type { TypeAheadHandler, TypeAheadPluginState } from './types';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Transaction } from 'prosemirror-state';
|
|
2
|
+
import { Node as PMNode, Fragment } from 'prosemirror-model';
|
|
3
|
+
declare type Position = {
|
|
4
|
+
start: number;
|
|
5
|
+
end: number;
|
|
6
|
+
};
|
|
7
|
+
export declare const insertBlockNode: ({ node, tr, position, }: {
|
|
8
|
+
node: PMNode;
|
|
9
|
+
tr: Transaction;
|
|
10
|
+
position: Position;
|
|
11
|
+
}) => Transaction;
|
|
12
|
+
export declare const insertInlineNodeOrFragment: ({ maybeFragment, tr, position, selectInlineNode, }: {
|
|
13
|
+
maybeFragment: Fragment | PMNode;
|
|
14
|
+
tr: Transaction;
|
|
15
|
+
position: Position;
|
|
16
|
+
selectInlineNode: boolean;
|
|
17
|
+
}) => Transaction;
|
|
18
|
+
export {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export declare
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
export declare enum ACTIONS {
|
|
2
|
+
OPEN_TYPEAHEAD_AT_CURSOR = "OPEN_TYPEAHEAD_AT_CURSOR",
|
|
3
|
+
CLOSE_TYPE_AHEAD = "CLOSE_TYPE_AHEAD",
|
|
4
|
+
CHANGE_QUERY = "CHANGE_QUERY",
|
|
5
|
+
INSERT_ITEM = "INSERT_ITEM",
|
|
6
|
+
INSERT_RAW_QUERY = "INSERT_RAW_QUERY",
|
|
7
|
+
UPDATE_LIST_ITEMS = "UPDATE_LIST_ITEMS",
|
|
8
|
+
UPDATE_SELECTED_INDEX = "UPDATE_SELECTED_INDEX"
|
|
9
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Selection } from 'prosemirror-state';
|
|
2
|
+
import { DecorationSet } from 'prosemirror-view';
|
|
3
|
+
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
4
|
+
import { InjectedIntl } from 'react-intl';
|
|
5
|
+
import type { CreateTypeAheadDecorations, RemoveTypeAheadDecorations, PopupMountPointReference } from '../types';
|
|
6
|
+
declare type FactoryProps = {
|
|
7
|
+
intl: InjectedIntl;
|
|
8
|
+
popupMountRef: PopupMountPointReference;
|
|
9
|
+
createAnalyticsEvent?: CreateUIAnalyticsEvent;
|
|
10
|
+
};
|
|
11
|
+
declare type FactoryReturn = {
|
|
12
|
+
createDecorations: CreateTypeAheadDecorations;
|
|
13
|
+
removeDecorations: RemoveTypeAheadDecorations;
|
|
14
|
+
};
|
|
15
|
+
export declare const factoryDecorations: ({ intl, popupMountRef, createAnalyticsEvent, }: FactoryProps) => FactoryReturn;
|
|
16
|
+
export declare const isSelectionInsideTypeAhead: ({ decorationSet, selection, }: {
|
|
17
|
+
decorationSet?: DecorationSet<any> | undefined;
|
|
18
|
+
selection: Selection;
|
|
19
|
+
}) => boolean;
|
|
20
|
+
export declare const findDecorationElement: ({ selection, decorationSet, }: {
|
|
21
|
+
selection: Selection;
|
|
22
|
+
decorationSet?: DecorationSet<any> | undefined;
|
|
23
|
+
}) => HTMLElement | null;
|
|
24
|
+
export {};
|
|
@@ -2,6 +2,5 @@ import { Schema } from 'prosemirror-model';
|
|
|
2
2
|
import { Plugin } from 'prosemirror-state';
|
|
3
3
|
import { TypeAheadHandler } from '../types';
|
|
4
4
|
import type { FeatureFlags } from '../../../types/feature-flags';
|
|
5
|
-
export declare let typeAheadInputRulesPluginKey: string;
|
|
6
5
|
export declare function inputRulePlugin(schema: Schema, typeAheads: TypeAheadHandler[], featureFlags: FeatureFlags): Plugin | undefined;
|
|
7
6
|
export default inputRulePlugin;
|
|
File without changes
|
|
@@ -1,41 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Plugin } from 'prosemirror-state';
|
|
2
|
+
import { EditorReactContext } from '../../../types/editor-react-context';
|
|
3
|
+
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
2
4
|
import { Dispatch } from '../../../event-dispatcher';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}, typeAhead: Array<TypeAheadHandler>): Plugin;
|
|
11
|
-
/**
|
|
12
|
-
*
|
|
13
|
-
* Action Handlers
|
|
14
|
-
*
|
|
15
|
-
*/
|
|
16
|
-
export declare type ActionHandlerParams = {
|
|
17
|
-
dispatch: Dispatch;
|
|
18
|
-
pluginState: TypeAheadPluginState;
|
|
19
|
-
tr: Transaction;
|
|
20
|
-
params?: {
|
|
21
|
-
currentIndex?: number;
|
|
22
|
-
query?: string;
|
|
23
|
-
};
|
|
5
|
+
import type { PopupMountPointReference, TypeAheadHandler } from '../types';
|
|
6
|
+
declare type Props = {
|
|
7
|
+
reactDispatch: Dispatch;
|
|
8
|
+
popupMountRef: PopupMountPointReference;
|
|
9
|
+
typeAheadHandlers: Array<TypeAheadHandler>;
|
|
10
|
+
reactContext: () => EditorReactContext;
|
|
11
|
+
createAnalyticsEvent?: CreateUIAnalyticsEvent;
|
|
24
12
|
};
|
|
25
|
-
export declare function
|
|
26
|
-
export
|
|
27
|
-
dispatch: Dispatch;
|
|
28
|
-
reactContext: () => {
|
|
29
|
-
[key: string]: any;
|
|
30
|
-
};
|
|
31
|
-
typeAhead: Array<TypeAheadHandler>;
|
|
32
|
-
pluginState: TypeAheadPluginState;
|
|
33
|
-
state: EditorState;
|
|
34
|
-
tr: Transaction;
|
|
35
|
-
}): TypeAheadPluginState;
|
|
36
|
-
export declare function setCurrentItemIndex({ dispatch, pluginState, params, }: ActionHandlerParams): TypeAheadPluginState;
|
|
37
|
-
export declare function updateQueryHandler({ dispatch, pluginState, params, }: ActionHandlerParams): TypeAheadPluginState;
|
|
38
|
-
export declare function selectPrevActionHandler({ dispatch, pluginState, }: ActionHandlerParams): TypeAheadPluginState;
|
|
39
|
-
export declare function selectNextActionHandler({ dispatch, pluginState, }: ActionHandlerParams): TypeAheadPluginState;
|
|
40
|
-
export declare function itemsListUpdatedActionHandler({ dispatch, pluginState, tr, }: ActionHandlerParams): TypeAheadPluginState;
|
|
41
|
-
export declare function selectCurrentActionHandler({ dispatch, }: ActionHandlerParams): TypeAheadPluginState;
|
|
13
|
+
export declare function createPlugin({ reactDispatch, reactContext, popupMountRef, createAnalyticsEvent, typeAheadHandlers, }: Props): Plugin;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Transaction } from 'prosemirror-state';
|
|
2
|
+
import { InsertTypeAheadStep } from '@atlaskit/adf-schema/steps';
|
|
3
|
+
import { CreateTypeAheadDecorations, PopupMountPointReference, RemoveTypeAheadDecorations, TypeAheadHandler, TypeAheadPluginState } from '../types';
|
|
4
|
+
export declare type ReducerOptions = {
|
|
5
|
+
popupMountRef: PopupMountPointReference;
|
|
6
|
+
createDecorations: CreateTypeAheadDecorations;
|
|
7
|
+
removeDecorations: RemoveTypeAheadDecorations;
|
|
8
|
+
typeAheadHandlers: Array<TypeAheadHandler>;
|
|
9
|
+
};
|
|
10
|
+
export declare const createReducer: ({ typeAheadHandlers, removeDecorations, createDecorations, }: ReducerOptions) => (tr: Transaction, currentPluginState: TypeAheadPluginState, typeAheadStepOverride: InsertTypeAheadStep | null) => TypeAheadPluginState;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Transaction } from 'prosemirror-state';
|
|
2
|
+
import type { InsertionTransactionMeta } from '../types';
|
|
3
|
+
import { ACTIONS } from './actions';
|
|
4
|
+
export declare const isInsertionTransaction: (transactions: Transaction[], action: ACTIONS) => InsertionTransactionMeta | null;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { TypeAheadStatsModifier } from './types';
|
|
2
|
+
export declare class StatsModifier implements TypeAheadStatsModifier {
|
|
3
|
+
startedAt: number;
|
|
4
|
+
endedAt: number;
|
|
5
|
+
keyCount: {
|
|
6
|
+
arrowUp: number;
|
|
7
|
+
arrowDown: number;
|
|
8
|
+
};
|
|
9
|
+
constructor();
|
|
10
|
+
increaseArrowUp: () => void;
|
|
11
|
+
increaseArrowDown: () => void;
|
|
12
|
+
serialize: () => {
|
|
13
|
+
startedAt: number;
|
|
14
|
+
endedAt: number;
|
|
15
|
+
keyCount: {
|
|
16
|
+
arrowUp: number;
|
|
17
|
+
arrowDown: number;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Transaction } from 'prosemirror-state';
|
|
2
|
+
import type { TypeAheadHandler, TypeAheadInputMethod } from '../types';
|
|
3
|
+
declare type Props = {
|
|
4
|
+
triggerHandler: TypeAheadHandler;
|
|
5
|
+
inputMethod: TypeAheadInputMethod;
|
|
6
|
+
query?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const openTypeAheadAtCursor: ({ triggerHandler, inputMethod, query, }: Props) => (tr: Transaction) => Transaction | null;
|
|
9
|
+
export {};
|