@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,8 +1,7 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
3
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
3
|
|
|
5
|
-
var _templateObject, _templateObject2, _templateObject3;
|
|
4
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
6
5
|
|
|
7
6
|
import React, { useState, useCallback } from 'react';
|
|
8
7
|
import styled from 'styled-components';
|
|
@@ -11,7 +10,7 @@ import { DN50, N0 } from '@atlaskit/theme/colors';
|
|
|
11
10
|
import { themed } from '@atlaskit/theme/components';
|
|
12
11
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
13
12
|
import Button from '@atlaskit/button/custom-theme-button';
|
|
14
|
-
import Modal, {
|
|
13
|
+
import Modal, { ModalTransition, useModal } from '@atlaskit/modal-dialog';
|
|
15
14
|
import QuestionCircleIcon from '@atlaskit/icon/glyph/question-circle';
|
|
16
15
|
import ElementBrowser from './components/ElementBrowserLoader';
|
|
17
16
|
import { getCategories } from './categories';
|
|
@@ -32,13 +31,13 @@ var ModalElementBrowser = function ModalElementBrowser(props) {
|
|
|
32
31
|
var onInsertItem = useCallback(function (item) {
|
|
33
32
|
props.onInsertItem(item);
|
|
34
33
|
}, [props]);
|
|
35
|
-
var RenderFooter = useCallback(function (
|
|
36
|
-
return /*#__PURE__*/React.createElement(Footer,
|
|
34
|
+
var RenderFooter = useCallback(function () {
|
|
35
|
+
return /*#__PURE__*/React.createElement(Footer, {
|
|
37
36
|
onInsert: function onInsert() {
|
|
38
37
|
return onInsertItem(selectedItem);
|
|
39
38
|
},
|
|
40
39
|
beforeElement: helpUrl ? HelpLink(helpUrl, intl.formatMessage(messages.help)) : undefined
|
|
41
|
-
})
|
|
40
|
+
});
|
|
42
41
|
}, [onInsertItem, selectedItem, helpUrl, intl]); // Since Modal uses stackIndex it's shouldCloseOnEscapePress prop doesn't work.
|
|
43
42
|
|
|
44
43
|
var onKeyDown = useCallback(function (e) {
|
|
@@ -54,13 +53,10 @@ var ModalElementBrowser = function ModalElementBrowser(props) {
|
|
|
54
53
|
showCategories: true,
|
|
55
54
|
mode: "full",
|
|
56
55
|
onSelectItem: onSelectItem,
|
|
57
|
-
onInsertItem: onInsertItem
|
|
56
|
+
onInsertItem: onInsertItem,
|
|
57
|
+
emptyStateHandler: props.emptyStateHandler
|
|
58
58
|
}));
|
|
59
|
-
}, [props.intl, props.getItems, onSelectItem, onInsertItem]);
|
|
60
|
-
var components = {
|
|
61
|
-
Body: RenderBody,
|
|
62
|
-
Footer: RenderFooter
|
|
63
|
-
};
|
|
59
|
+
}, [props.intl, props.getItems, onSelectItem, onInsertItem, props.emptyStateHandler]);
|
|
64
60
|
return /*#__PURE__*/React.createElement("div", {
|
|
65
61
|
"data-editor-popup": true,
|
|
66
62
|
onClick: onModalClick,
|
|
@@ -73,12 +69,11 @@ var ModalElementBrowser = function ModalElementBrowser(props) {
|
|
|
73
69
|
onClose: props.onClose,
|
|
74
70
|
height: "664px",
|
|
75
71
|
width: "x-large",
|
|
76
|
-
autoFocus: false
|
|
77
|
-
components: components // defaults to true and doesn't work along with stackIndex=1.
|
|
72
|
+
autoFocus: false // defaults to true and doesn't work along with stackIndex=1.
|
|
78
73
|
// packages/design-system/modal-dialog/src/components/Content.tsx Line 287
|
|
79
74
|
,
|
|
80
75
|
shouldCloseOnEscapePress: false
|
|
81
|
-
})));
|
|
76
|
+
}, /*#__PURE__*/React.createElement(RenderBody, null), /*#__PURE__*/React.createElement(RenderFooter, null))));
|
|
82
77
|
};
|
|
83
78
|
|
|
84
79
|
ModalElementBrowser.displayName = 'ModalElementBrowser'; // Prevent ModalElementBrowser click propagation through to the editor.
|
|
@@ -89,15 +84,12 @@ var onModalClick = function onModalClick(e) {
|
|
|
89
84
|
|
|
90
85
|
var Footer = function Footer(_ref) {
|
|
91
86
|
var onInsert = _ref.onInsert,
|
|
92
|
-
onClose = _ref.onClose,
|
|
93
|
-
showKeyline = _ref.showKeyline,
|
|
94
87
|
beforeElement = _ref.beforeElement;
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
}, beforeElement ? beforeElement : /*#__PURE__*/React.createElement("span", null), /*#__PURE__*/React.createElement(Actions, null, /*#__PURE__*/React.createElement(ActionItem, null, /*#__PURE__*/React.createElement(Button, {
|
|
88
|
+
|
|
89
|
+
var _useModal = useModal(),
|
|
90
|
+
onClose = _useModal.onClose;
|
|
91
|
+
|
|
92
|
+
return /*#__PURE__*/React.createElement(ModalFooter, null, beforeElement ? beforeElement : /*#__PURE__*/React.createElement("span", null), /*#__PURE__*/React.createElement(Actions, null, /*#__PURE__*/React.createElement(ActionItem, null, /*#__PURE__*/React.createElement(Button, {
|
|
101
93
|
appearance: "primary",
|
|
102
94
|
onClick: onInsert,
|
|
103
95
|
testId: "ModalElementBrowser__insert-button"
|
|
@@ -127,4 +119,5 @@ var Wrapper = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplate
|
|
|
127
119
|
light: N0,
|
|
128
120
|
dark: DN50
|
|
129
121
|
})(), borderRadius());
|
|
122
|
+
var ModalFooter = styled.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n padding: ", "px;\n\n position: relative;\n align-items: center;\n justify-content: space-between;\n"])), MODAL_WRAPPER_PADDING);
|
|
130
123
|
export default injectIntl(ModalElementBrowser);
|
|
@@ -21,7 +21,7 @@ import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
|
21
21
|
import { withAnalyticsContext } from '@atlaskit/analytics-next';
|
|
22
22
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, fireAnalyticsEvent } from '../../../../plugins/analytics';
|
|
23
23
|
import IconFallback from '../../../../plugins/quick-insert/assets/fallback';
|
|
24
|
-
import { ItemIcon } from '../../../../plugins/type-ahead/ui/
|
|
24
|
+
import { ItemIcon } from '../../../../plugins/type-ahead/ui/TypeAheadListItem';
|
|
25
25
|
import { Shortcut } from '../../../styles';
|
|
26
26
|
import { ELEMENT_ITEM_HEIGHT, ELEMENT_LIST_PADDING, GRID_SIZE, SCROLLBAR_THUMB_COLOR, SCROLLBAR_TRACK_COLOR, SCROLLBAR_WIDTH } from '../../constants';
|
|
27
27
|
import useContainerWidth from '../../hooks/use-container-width';
|
|
@@ -38,7 +38,10 @@ function ElementList(_ref) {
|
|
|
38
38
|
focusedItemIndex = _ref.focusedItemIndex,
|
|
39
39
|
setColumnCount = _ref.setColumnCount,
|
|
40
40
|
createAnalyticsEvent = _ref.createAnalyticsEvent,
|
|
41
|
-
|
|
41
|
+
emptyStateHandler = _ref.emptyStateHandler,
|
|
42
|
+
selectedCategory = _ref.selectedCategory,
|
|
43
|
+
searchTerm = _ref.searchTerm,
|
|
44
|
+
props = _objectWithoutProperties(_ref, ["items", "mode", "selectedItemIndex", "focusedItemIndex", "setColumnCount", "createAnalyticsEvent", "emptyStateHandler", "selectedCategory", "searchTerm"]);
|
|
42
45
|
|
|
43
46
|
var _useContainerWidth = useContainerWidth(),
|
|
44
47
|
containerWidth = _useContainerWidth.containerWidth,
|
|
@@ -91,7 +94,11 @@ function ElementList(_ref) {
|
|
|
91
94
|
}, props)));
|
|
92
95
|
};
|
|
93
96
|
}, [items, fullMode, selectedItemIndex, focusedItemIndex, props]);
|
|
94
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ContainerWidthMonitor, null), !items.length ?
|
|
97
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ContainerWidthMonitor, null), !items.length ? emptyStateHandler ? emptyStateHandler({
|
|
98
|
+
mode: mode,
|
|
99
|
+
selectedCategory: selectedCategory,
|
|
100
|
+
searchTerm: searchTerm
|
|
101
|
+
}) : /*#__PURE__*/React.createElement(EmptyState, {
|
|
95
102
|
onExternalLinkClick: onExternalLinkClick
|
|
96
103
|
}) : /*#__PURE__*/React.createElement(ElementItemsWrapper, {
|
|
97
104
|
"data-testid": "element-items"
|
|
@@ -128,7 +128,8 @@ function MobileBrowser(_ref) {
|
|
|
128
128
|
onKeyPress = _ref.onKeyPress,
|
|
129
129
|
onKeyDown = _ref.onKeyDown,
|
|
130
130
|
searchTerm = _ref.searchTerm,
|
|
131
|
-
createAnalyticsEvent = _ref.createAnalyticsEvent
|
|
131
|
+
createAnalyticsEvent = _ref.createAnalyticsEvent,
|
|
132
|
+
emptyStateHandler = _ref.emptyStateHandler;
|
|
132
133
|
return /*#__PURE__*/React.createElement(MobileElementBrowserContainer, {
|
|
133
134
|
onKeyPress: onKeyPress,
|
|
134
135
|
onKeyDown: onKeyDown,
|
|
@@ -155,7 +156,10 @@ function MobileBrowser(_ref) {
|
|
|
155
156
|
focusedItemIndex: focusedItemIndex,
|
|
156
157
|
setFocusedItemIndex: setFocusedItemIndex,
|
|
157
158
|
setColumnCount: setColumnCount,
|
|
158
|
-
createAnalyticsEvent: createAnalyticsEvent
|
|
159
|
+
createAnalyticsEvent: createAnalyticsEvent,
|
|
160
|
+
emptyStateHandler: emptyStateHandler,
|
|
161
|
+
selectedCategory: selectedCategory,
|
|
162
|
+
searchTerm: searchTerm
|
|
159
163
|
})));
|
|
160
164
|
}
|
|
161
165
|
|
|
@@ -178,7 +182,8 @@ function DesktopBrowser(_ref2) {
|
|
|
178
182
|
onKeyPress = _ref2.onKeyPress,
|
|
179
183
|
onKeyDown = _ref2.onKeyDown,
|
|
180
184
|
searchTerm = _ref2.searchTerm,
|
|
181
|
-
createAnalyticsEvent = _ref2.createAnalyticsEvent
|
|
185
|
+
createAnalyticsEvent = _ref2.createAnalyticsEvent,
|
|
186
|
+
emptyStateHandler = _ref2.emptyStateHandler;
|
|
182
187
|
return /*#__PURE__*/React.createElement(ElementBrowserContainer, {
|
|
183
188
|
"data-testid": "desktop__element-browser"
|
|
184
189
|
}, showCategories && /*#__PURE__*/React.createElement(SideBar, {
|
|
@@ -209,7 +214,10 @@ function DesktopBrowser(_ref2) {
|
|
|
209
214
|
focusedItemIndex: focusedItemIndex,
|
|
210
215
|
setFocusedItemIndex: setFocusedItemIndex,
|
|
211
216
|
setColumnCount: setColumnCount,
|
|
212
|
-
createAnalyticsEvent: createAnalyticsEvent
|
|
217
|
+
createAnalyticsEvent: createAnalyticsEvent,
|
|
218
|
+
emptyStateHandler: emptyStateHandler,
|
|
219
|
+
selectedCategory: selectedCategory,
|
|
220
|
+
searchTerm: searchTerm
|
|
213
221
|
})));
|
|
214
222
|
}
|
|
215
223
|
|
|
@@ -161,9 +161,7 @@ var PanelTextInput = /*#__PURE__*/function (_PureComponent) {
|
|
|
161
161
|
}, {
|
|
162
162
|
key: "isUndoEvent",
|
|
163
163
|
value: function isUndoEvent(event) {
|
|
164
|
-
return event.keyCode === KeyZCode && (
|
|
165
|
-
browser.mac && event.metaKey && !event.shiftKey || // ctrl + z for non-mac
|
|
166
|
-
!browser.mac && event.ctrlKey);
|
|
164
|
+
return event.keyCode === KeyZCode && (browser.mac && event.metaKey && !event.shiftKey || !browser.mac && event.ctrlKey);
|
|
167
165
|
}
|
|
168
166
|
}, {
|
|
169
167
|
key: "isRedoEvent",
|
|
@@ -33,13 +33,13 @@ export var serializeValue = function serializeValue(value) {
|
|
|
33
33
|
} // Calling toString of function returns whole function text with body.
|
|
34
34
|
// So, just return function with name.
|
|
35
35
|
else if (valueType === 'function') {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
36
|
+
return "function:".concat(value.name);
|
|
37
|
+
} else if (valueType === 'object') {
|
|
38
|
+
return {
|
|
39
|
+
type: 'object',
|
|
40
|
+
keys: Object.keys(value)
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
43
|
};
|
|
44
44
|
export var getPropsDifference = function getPropsDifference(object1, object2) {
|
|
45
45
|
var curDepth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -277,17 +277,16 @@ export function liftSelection(tr, doc, $from, $to) {
|
|
|
277
277
|
var endPos = $to.end($to.depth);
|
|
278
278
|
var target = Math.max(0, findAncestorPosition(doc, $from).depth - 1);
|
|
279
279
|
tr.doc.nodesBetween(startPos, endPos, function (node, pos) {
|
|
280
|
-
if (node.isText || //
|
|
281
|
-
node.isTextblock && !node.textContent // Empty paragraph
|
|
280
|
+
if (node.isText || node.isTextblock && !node.textContent // Empty paragraph
|
|
282
281
|
) {
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
282
|
+
var res = tr.doc.resolve(tr.mapping.map(pos));
|
|
283
|
+
var sel = new NodeSelection(res);
|
|
284
|
+
var range = sel.$from.blockRange(sel.$to);
|
|
286
285
|
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
}
|
|
286
|
+
if (liftTarget(range) !== undefined) {
|
|
287
|
+
tr.lift(range, target);
|
|
290
288
|
}
|
|
289
|
+
}
|
|
291
290
|
});
|
|
292
291
|
startPos = tr.mapping.map(startPos);
|
|
293
292
|
endPos = tr.mapping.map(endPos);
|
|
@@ -36,8 +36,8 @@ export var alignAttributes = function alignAttributes(layout, oldAttrs) {
|
|
|
36
36
|
// 'full-width' or 'wide' or 'center' -> 'wrap-left' or 'wrap-right' or 'align-end' or 'align-start'
|
|
37
37
|
if (!width || width >= 100 || oldLayout !== 'center' // == 'full-width' or 'wide'
|
|
38
38
|
) {
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
width = 50;
|
|
40
|
+
}
|
|
41
41
|
} else if (layout !== oldLayout && ['full-width', 'wide'].indexOf(oldLayout) > -1) {
|
|
42
42
|
// 'full-width' -> 'center' or 'wide'
|
|
43
43
|
// 'wide' -> 'center' or 'full-width'
|
|
@@ -40,8 +40,11 @@ export function setCellSelection(view, anchor, head) {
|
|
|
40
40
|
dispatch = view.dispatch;
|
|
41
41
|
dispatch(state.tr.setSelection(CellSelection.create(state.doc, anchor, head)));
|
|
42
42
|
}
|
|
43
|
-
export var normaliseNestedLayout = function normaliseNestedLayout(
|
|
44
|
-
|
|
43
|
+
export var normaliseNestedLayout = function normaliseNestedLayout(_ref, node) {
|
|
44
|
+
var selection = _ref.selection,
|
|
45
|
+
doc = _ref.doc;
|
|
46
|
+
|
|
47
|
+
if (selection.$from.depth > 1) {
|
|
45
48
|
if (node.attrs.layout && node.attrs.layout !== 'default') {
|
|
46
49
|
return node.type.createChecked(_objectSpread(_objectSpread({}, node.attrs), {}, {
|
|
47
50
|
layout: 'default'
|
|
@@ -50,7 +53,7 @@ export var normaliseNestedLayout = function normaliseNestedLayout(state, node) {
|
|
|
50
53
|
// Since default isn't a valid breakout mode.
|
|
51
54
|
|
|
52
55
|
|
|
53
|
-
var breakoutMark =
|
|
56
|
+
var breakoutMark = doc.type.schema.marks.breakout;
|
|
54
57
|
|
|
55
58
|
if (breakoutMark && breakoutMark.isInSet(node.marks)) {
|
|
56
59
|
var newMarks = breakoutMark.removeFromSet(node.marks);
|
package/dist/esm/version.json
CHANGED
|
@@ -9,7 +9,7 @@ export declare const createNewParagraphBelow: Command;
|
|
|
9
9
|
export declare function createParagraphNear(append?: boolean): Command;
|
|
10
10
|
export declare function addParagraphAtEnd(tr: Transaction): void;
|
|
11
11
|
export declare function createParagraphAtEnd(): Command;
|
|
12
|
-
export declare const changeImageAlignment: (align?: "
|
|
12
|
+
export declare const changeImageAlignment: (align?: "center" | "start" | "end" | undefined) => Command;
|
|
13
13
|
export declare const createToggleBlockMarkOnRange: <T = object>(markType: MarkType, getAttrs: (prevAttrs?: T | undefined, node?: PMNode<any> | undefined) => false | T | undefined, allowedBlocks?: NodeType<any>[] | ((schema: Schema, node: PMNode, parent: PMNode) => boolean) | undefined) => (from: number, to: number, tr: Transaction, state: EditorState) => boolean;
|
|
14
14
|
/**
|
|
15
15
|
* Toggles block mark based on the return type of `getAttrs`.
|
|
@@ -37,5 +37,5 @@ export declare class ErrorBoundaryWithEditorView extends React.Component<ErrorBo
|
|
|
37
37
|
componentDidMount(): Promise<void>;
|
|
38
38
|
render(): React.ReactNode;
|
|
39
39
|
}
|
|
40
|
-
declare const _default: React.ComponentType<Pick<ErrorBoundaryProps, "
|
|
40
|
+
declare const _default: React.ComponentType<Pick<ErrorBoundaryProps, "contextIdentifierProvider" | "children" | "createAnalyticsEvent" | "rethrow">>;
|
|
41
41
|
export default _default;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -37,6 +37,7 @@ export type { ListState } from './plugins/list/types';
|
|
|
37
37
|
export type { InputMethod as ListInputMethod } from './plugins/list/commands';
|
|
38
38
|
export { toggleSuperscript, toggleSuperscriptWithAnalytics, toggleSubscript, toggleSubscriptWithAnalytics, toggleStrike, toggleStrikeWithAnalytics, toggleCode, toggleCodeWithAnalytics, toggleUnderline, toggleUnderlineWithAnalytics, toggleEm, toggleEmWithAnalytics, toggleStrong, toggleStrongWithAnalytics, } from './plugins/text-formatting/commands/text-formatting';
|
|
39
39
|
export { subscribeToToolbarAndPickerUpdates } from './plugins/view-update-subscription/subscribe/toolbarAndPickerUpdates';
|
|
40
|
+
export { subscribeTypeAheadUpdates } from './plugins/view-update-subscription/subscribe/type-ahead-updates';
|
|
40
41
|
export type { InputMethodToolbar as TextFormattingInputMethodToolbar, InputMethodBasic as TextFormattingInputMethodBasic, } from './plugins/text-formatting/commands/text-formatting';
|
|
41
42
|
export { insertBlockType, insertBlockTypesWithAnalytics, setBlockType, setBlockTypeWithAnalytics, } from './plugins/block-type/commands';
|
|
42
43
|
export type { InputMethod as BlockTypeInputMethod } from './plugins/block-type/commands';
|
|
@@ -56,9 +57,6 @@ export type { TypeAheadPluginState } from './plugins/type-ahead';
|
|
|
56
57
|
export { pluginKey as quickInsertPluginKey, memoProcessItems as processQuickInsertItems, } from './plugins/quick-insert';
|
|
57
58
|
export type { QuickInsertPluginState } from './plugins/quick-insert';
|
|
58
59
|
export type { TypeAheadItem } from './plugins/type-ahead/types';
|
|
59
|
-
export { selectItem } from './plugins/type-ahead/commands/select-item';
|
|
60
|
-
export { insertTypeAheadQuery } from './plugins/type-ahead/commands/insert-query';
|
|
61
|
-
export { dismissCommand } from './plugins/type-ahead/commands/dismiss';
|
|
62
60
|
export { insertLink, insertLinkWithAnalyticsMobileNative, insertLinkWithAnalytics, isTextAtPos, isLinkAtPos, updateLink, } from './plugins/hyperlink/commands';
|
|
63
61
|
export type { LinkInputType as LinkInputMethod } from './plugins/hyperlink/types';
|
|
64
62
|
export { historyPluginKey } from './plugins/history';
|
|
@@ -77,8 +75,6 @@ export { GapCursorSelection, Side as GapCursorSide, } from './plugins/selection/
|
|
|
77
75
|
export type { HistoryPluginState } from './plugins/history/types';
|
|
78
76
|
export type { MentionPluginState } from './plugins/mentions/types';
|
|
79
77
|
export type { TOOLBAR_MENU_TYPE as InsertBlockInputMethodToolbar } from './plugins/insert-block/ui/ToolbarInsertBlock/types';
|
|
80
|
-
export { insertMentionQuery } from './plugins/mentions/commands/insert-mention-query';
|
|
81
|
-
export { insertEmojiQuery } from './plugins/emoji/commands/insert-emoji-query';
|
|
82
78
|
export { selectionPluginKey } from './plugins/mobile-selection';
|
|
83
79
|
export type { SelectionData, SelectionDataState, } from './plugins/mobile-selection';
|
|
84
80
|
export { insertExpand } from './plugins/expand/commands';
|
|
@@ -92,3 +88,5 @@ export { lightModeStatusColorPalette, darkModeStatusColorPalette, } from './ui/C
|
|
|
92
88
|
export type { PaletteColor } from './ui/ColorPalette/Palettes/type';
|
|
93
89
|
export { DEFAULT_BORDER_COLOR } from './ui/ColorPalette/Palettes/common';
|
|
94
90
|
export { default as messages, statusMessages, dateMessages } from './messages';
|
|
91
|
+
export { createTypeAheadTools } from './plugins/type-ahead/api';
|
|
92
|
+
export { createQuickInsertTools } from './plugins/quick-insert/api';
|
|
@@ -5,5 +5,5 @@ import EditorActions from '../../actions';
|
|
|
5
5
|
export declare type FullPageProps = EditorProps & {
|
|
6
6
|
onMount?: (actions: EditorActions) => void;
|
|
7
7
|
} & WithAnalyticsEventsProps;
|
|
8
|
-
declare const FullPageWithAnalytics: React.ForwardRefExoticComponent<Pick<FullPageProps, "
|
|
8
|
+
declare const FullPageWithAnalytics: React.ForwardRefExoticComponent<Pick<FullPageProps, "mentionProvider" | "emojiProvider" | "autoformattingProvider" | "taskDecisionProvider" | "contextIdentifierProvider" | "collabEditProvider" | "macroProvider" | "searchProvider" | "activityProvider" | "presenceProvider" | "placeholderBracketHint" | "placeholderHints" | "codeBlock" | "media" | "allowBlockType" | "defaultValue" | "placeholder" | "onChange" | "contextPanel" | "appearance" | "quickInsert" | "disabled" | "waitForMediaUpload" | "maxHeight" | "popupsMountPoint" | "popupsBoundariesElement" | "popupsScrollableElement" | "editorActions" | "mention" | "insertMenuItems" | "primaryToolbarComponents" | "contentComponents" | "onDestroy" | "onMount" | "saveOnEnter" | "textFormatting" | "maxContentSize" | "performanceTracking" | "featureFlags" | "onSave" | "onCancel" | "extensionHandlers" | "collabEdit" | "allowBreakout" | "uploadErrorHandler" | "sanitizePrivateContent" | "mentionInsertDisplayName" | "allowNestedTasks" | "allowExpand" | "shouldFocus" | "persistScrollGutter" | "primaryToolbarIconBefore" | "secondaryToolbarComponents" | "allowAnalyticsGASV3" | "allowTasksAndDecisions" | "allowRule" | "allowTextColor" | "allowTables" | "allowHelpDialog" | "feedbackInfo" | "allowJiraIssue" | "allowPanel" | "allowExtension" | "allowConfluenceInlineComment" | "allowTemplatePlaceholders" | "allowDate" | "allowLayouts" | "allowStatus" | "allowDynamicTextSizing" | "allowTextAlignment" | "allowIndentation" | "allowNewInsertionBehaviour" | "autoScrollIntoView" | "allowFindReplace" | "UNSAFE_cards" | "smartLinks" | "errorReporterHandler" | "annotationProviders" | "legacyImageUploadProvider" | "contentTransformerProvider" | "allowKeyboardAccessibleDatepicker" | "onEditorReady" | "inputSamplingLimit" | "extensionProviders" | "UNSAFE_useAnalyticsContext" | "elementBrowser" | "UNSAFE_allowUndoRedoButtons" | "trackValidTransactions" | "useStickyToolbar" | "dangerouslyAppendPlugins"> & React.RefAttributes<any>>;
|
|
9
9
|
export { FullPageWithAnalytics as FullPage };
|
|
@@ -9,4 +9,4 @@ export declare function MobileEditor(props: MobileEditorProps & WithAnalyticsEve
|
|
|
9
9
|
export declare namespace MobileEditor {
|
|
10
10
|
var displayName: string;
|
|
11
11
|
}
|
|
12
|
-
export declare const Mobile: React.ForwardRefExoticComponent<Pick<MobileEditorProps & WithAnalyticsEventsProps, "
|
|
12
|
+
export declare const Mobile: React.ForwardRefExoticComponent<Pick<MobileEditorProps & WithAnalyticsEventsProps, "onAnalyticsEvent" | "children" | "defaultValue" | "placeholder" | "onChange" | "plugins" | "disabled" | "maxHeight" | "popupsMountPoint" | "popupsBoundariesElement" | "popupsScrollableElement" | "onDestroy" | "onMount" | "transformer" | "onSave" | "onCancel" | "isMaxContentSizeReached"> & React.RefAttributes<any>>;
|
|
@@ -14,6 +14,7 @@ import { QuickInsertPluginOptions } from '../../../plugins/quick-insert';
|
|
|
14
14
|
import { CodeBlockOptions } from '../../../plugins/code-block/types';
|
|
15
15
|
import { SelectionPluginOptions } from '../../../plugins/selection/types';
|
|
16
16
|
import { CardOptions } from '@atlaskit/editor-common';
|
|
17
|
+
import { TypeAheadPluginOptions } from '../../../plugins/type-ahead';
|
|
17
18
|
interface EditorPresetDefaultProps {
|
|
18
19
|
children?: React.ReactNode;
|
|
19
20
|
}
|
|
@@ -30,6 +31,7 @@ export declare type DefaultPresetPluginOptions = {
|
|
|
30
31
|
selection?: SelectionPluginOptions;
|
|
31
32
|
cardOptions?: CardOptions;
|
|
32
33
|
createAnalyticsEvent?: CreateUIAnalyticsEvent;
|
|
34
|
+
typeAhead?: TypeAheadPluginOptions;
|
|
33
35
|
};
|
|
34
36
|
/**
|
|
35
37
|
* Note: The order that presets are added determines
|
package/dist/types/messages.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Command } from '../../../types/command';
|
|
2
|
-
export declare const isAlignable: (align?: "
|
|
3
|
-
export declare const changeAlignment: (align?: "
|
|
2
|
+
export declare const isAlignable: (align?: "center" | "start" | "end" | undefined) => Command;
|
|
3
|
+
export declare const changeAlignment: (align?: "center" | "start" | "end" | undefined) => Command;
|
|
@@ -8,6 +8,8 @@ export declare enum ACTION {
|
|
|
8
8
|
ACTIVATED = "activated",
|
|
9
9
|
ADDED = "added",
|
|
10
10
|
BROWSER_FREEZE = "browserFreeze",
|
|
11
|
+
CHANGED_BACKGROUND_COLOR = "changedBackgroundColor",
|
|
12
|
+
CHANGED_ICON = "changedIcon",
|
|
11
13
|
CHANGED_FULL_WIDTH_MODE = "changedFullWidthMode",
|
|
12
14
|
CHANGED_LAYOUT = "changedLayout",
|
|
13
15
|
CHANGED_REPLACEMENT_TEXT = "changedReplacementText",
|
|
@@ -51,6 +53,7 @@ export declare enum ACTION {
|
|
|
51
53
|
INVOKED = "invoked",
|
|
52
54
|
LANGUAGE_SELECTED = "languageSelected",
|
|
53
55
|
LIST_ITEM_JOINED = "listItemJoined",
|
|
56
|
+
MATCHED = "matched",
|
|
54
57
|
NODE_CONTENT_SANITIZED = "nodeContentSanitized",
|
|
55
58
|
OPENED = "opened",
|
|
56
59
|
OUTDENTED = "outdented",
|
|
@@ -85,7 +88,8 @@ export declare enum ACTION {
|
|
|
85
88
|
FIXED = "fixed",
|
|
86
89
|
RENDERED = "rendered",
|
|
87
90
|
ON_EDITOR_READY_CALLBACK = "onEditorReadyCallback",
|
|
88
|
-
ON_CHANGE_CALLBACK = "onChangeCalled"
|
|
91
|
+
ON_CHANGE_CALLBACK = "onChangeCalled",
|
|
92
|
+
REMOVE_ICON = "removedIcon"
|
|
89
93
|
}
|
|
90
94
|
export declare enum INPUT_METHOD {
|
|
91
95
|
ASCII = "ascii",
|
|
@@ -148,6 +152,7 @@ export declare enum ACTION_SUBJECT {
|
|
|
148
152
|
PLUS_MENU = "plusMenu",
|
|
149
153
|
PLUGIN_SLOT = "pluginSlot",
|
|
150
154
|
REACT_NODE_VIEW = "reactNodeView",
|
|
155
|
+
SELECTION = "selection",
|
|
151
156
|
SMART_LINK = "smartLink",
|
|
152
157
|
HYPERLINK = "hyperlink",
|
|
153
158
|
TABLE = "table",
|
|
@@ -14,7 +14,8 @@ import { ExperimentalEventPayload } from './experimental-events';
|
|
|
14
14
|
import { FindReplaceEventPayload } from './find-replace-events';
|
|
15
15
|
import { ConfigPanelEventPayload } from './config-panel-events';
|
|
16
16
|
import { ElementBrowserEventPayload } from './element-browser-events';
|
|
17
|
-
import {
|
|
17
|
+
import { TypeAheadPayload } from './type-ahead';
|
|
18
|
+
import { OperationalAEP, TrackAEP } from './utils';
|
|
18
19
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, CONTENT_COMPONENT, FLOATING_CONTROLS_TITLE } from './enums';
|
|
19
20
|
import { SimplifiedNode } from '../../../utils/document-logger';
|
|
20
21
|
import { DateEventPayload } from './date-events';
|
|
@@ -23,7 +24,16 @@ import { CreateLinkInlineDialogEventPayload, UnlinkToolbarAEP, EditLinkToolbarAE
|
|
|
23
24
|
import { ExtensionEventPayload } from './extension-events';
|
|
24
25
|
import { UnsupportedContentPayload, UserBrowserExtensionResults } from '@atlaskit/editor-common';
|
|
25
26
|
import { AvatarEventPayload } from './avatar';
|
|
26
|
-
export declare type AnalyticsEventPayload<T = void> = AvatarEventPayload | GeneralEventPayload<T> | FormatEventPayload | SubstituteEventPayload | InsertEventPayload | NodeEventPayload | MediaEventPayload | TableEventPayload | PasteEventPayload | CutCopyEventPayload | ErrorEventPayload | ExperimentalEventPayload | FindReplaceEventPayload | DateEventPayload | SelectionEventPayload | ListEventPayload | ConfigPanelEventPayload | ElementBrowserEventPayload | CreateLinkInlineDialogEventPayload | UnsupportedContentPayload | ExtensionEventPayload | TransactionEventPayload | UnlinkToolbarAEP | EditLinkToolbarAEP;
|
|
27
|
+
export declare type AnalyticsEventPayload<T = void> = AvatarEventPayload | GeneralEventPayload<T> | FormatEventPayload | SubstituteEventPayload | InsertEventPayload | NodeEventPayload | MediaEventPayload | TableEventPayload | PasteEventPayload | CutCopyEventPayload | ErrorEventPayload | ExperimentalEventPayload | FindReplaceEventPayload | DateEventPayload | SelectionEventPayload | ListEventPayload | ConfigPanelEventPayload | ElementBrowserEventPayload | CreateLinkInlineDialogEventPayload | UnsupportedContentPayload | ExtensionEventPayload | TransactionEventPayload | TypeAheadPayload | UnlinkToolbarAEP | EditLinkToolbarAEP | CustomPanelEventPayload;
|
|
28
|
+
declare type CustomPanelEventPayload = TrackAEP<ACTION.CHANGED_BACKGROUND_COLOR | ACTION.CHANGED_ICON | ACTION.REMOVE_ICON, ACTION_SUBJECT.PANEL, ACTION_SUBJECT_ID.PANEL, {
|
|
29
|
+
previousColor: string;
|
|
30
|
+
newColor: string;
|
|
31
|
+
} | {
|
|
32
|
+
previousIcon: string;
|
|
33
|
+
newIcon: string;
|
|
34
|
+
} | {
|
|
35
|
+
icon: string;
|
|
36
|
+
}, undefined>;
|
|
27
37
|
export declare type AnalyticsEventPayloadWithChannel = {
|
|
28
38
|
channel: string;
|
|
29
39
|
payload: AnalyticsEventPayload;
|
|
@@ -30,7 +30,6 @@ declare type PickerAEP<ActionSubjectID, Attributes> = UIAEP<ACTION.OPENED, ACTIO
|
|
|
30
30
|
declare type FeedbackAEP = UIAEP<ACTION.OPENED, ACTION_SUBJECT.FEEDBACK_DIALOG, undefined, {
|
|
31
31
|
inputMethod: INPUT_METHOD.QUICK_INSERT;
|
|
32
32
|
}, undefined>;
|
|
33
|
-
declare type TypeAheadAEP<ActionSubjectID, Attributes> = UIAEP<ACTION.INVOKED, ACTION_SUBJECT.TYPEAHEAD, ActionSubjectID, Attributes, undefined>;
|
|
34
33
|
declare type EditorStartAEP = UIAEP<ACTION.STARTED, ACTION_SUBJECT.EDITOR, undefined, {
|
|
35
34
|
platform: PLATFORMS.NATIVE | PLATFORMS.HYBRID | PLATFORMS.WEB;
|
|
36
35
|
featureFlags: FeatureFlagKey[];
|
|
@@ -66,6 +65,7 @@ declare type BrowserFreezePayload = OperationalAEPWithObjectId<ACTION.BROWSER_FR
|
|
|
66
65
|
interactionType?: BROWSER_FREEZE_INTERACTION_TYPE;
|
|
67
66
|
severity?: SEVERITY;
|
|
68
67
|
}, undefined>;
|
|
68
|
+
declare type SelectionAEP = TrackAEP<ACTION.MATCHED, ACTION_SUBJECT.SELECTION, undefined, undefined, undefined>;
|
|
69
69
|
declare type SlowInputAEP = OperationalAEPWithObjectId<ACTION.SLOW_INPUT, ACTION_SUBJECT.EDITOR, undefined, {
|
|
70
70
|
time: number;
|
|
71
71
|
nodeSize: number;
|
|
@@ -121,30 +121,9 @@ declare type PickerEmojiAEP = PickerAEP<ACTION_SUBJECT_ID.PICKER_EMOJI, {
|
|
|
121
121
|
declare type PickerImageAEP = PickerAEP<ACTION_SUBJECT_ID.PICKER_CLOUD, {
|
|
122
122
|
inputMethod: INPUT_METHOD.TOOLBAR | INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.INSERT_MENU;
|
|
123
123
|
}>;
|
|
124
|
-
declare type TypeAheadQuickInsertAEP = TypeAheadAEP<ACTION_SUBJECT_ID.TYPEAHEAD_QUICK_INSERT, {
|
|
125
|
-
inputMethod: INPUT_METHOD.KEYBOARD;
|
|
126
|
-
}>;
|
|
127
124
|
declare type HelpQuickInsertAEP = UIAEP<ACTION.HELP_OPENED, ACTION_SUBJECT.HELP, ACTION_SUBJECT_ID.HELP_QUICK_INSERT, {
|
|
128
125
|
inputMethod: INPUT_METHOD.QUICK_INSERT;
|
|
129
126
|
}, undefined>;
|
|
130
|
-
declare type TypeAheadEmojiAEP = TypeAheadAEP<ACTION_SUBJECT_ID.TYPEAHEAD_EMOJI, {
|
|
131
|
-
inputMethod: INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.KEYBOARD;
|
|
132
|
-
}>;
|
|
133
|
-
declare type TypeAheadLinkAEP = TypeAheadAEP<ACTION_SUBJECT_ID.TYPEAHEAD_LINK, {
|
|
134
|
-
inputMethod: INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.SHORTCUT;
|
|
135
|
-
}>;
|
|
136
|
-
declare type TypeAheadMentionAEP = TypeAheadAEP<ACTION_SUBJECT_ID.TYPEAHEAD_MENTION, {
|
|
137
|
-
inputMethod: INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.KEYBOARD;
|
|
138
|
-
}>;
|
|
139
|
-
export declare type TypeAheadRenderedAEP = OperationalAEP<ACTION.RENDERED, ACTION_SUBJECT.TYPEAHEAD, undefined, {
|
|
140
|
-
time?: number;
|
|
141
|
-
items?: number;
|
|
142
|
-
initial?: boolean;
|
|
143
|
-
}, undefined>;
|
|
144
|
-
export declare type TypeAheadItemViewedAEP = OperationalAEP<ACTION.VIEWED, ACTION_SUBJECT.TYPEAHEAD_ITEM, undefined, {
|
|
145
|
-
index?: number;
|
|
146
|
-
items?: number;
|
|
147
|
-
}, undefined>;
|
|
148
127
|
declare type FullWidthModeAEP = TrackAEP<ACTION.CHANGED_FULL_WIDTH_MODE, ACTION_SUBJECT.EDITOR, undefined, {
|
|
149
128
|
previousMode: FULL_WIDTH_MODE;
|
|
150
129
|
newMode: FULL_WIDTH_MODE;
|
|
@@ -166,5 +145,5 @@ declare type RichMediaLayoutAEP = TrackAEP<ACTION.SELECTED, ACTION_SUBJECT.MEDIA
|
|
|
166
145
|
declare type CodeBlockLanguageSelectedAEP = TrackAEP<ACTION.LANGUAGE_SELECTED, ACTION_SUBJECT.CODE_BLOCK, undefined, {
|
|
167
146
|
language: string;
|
|
168
147
|
}, undefined>;
|
|
169
|
-
export declare type GeneralEventPayload<T = void> = AnnotateButtonAEP | AnnotationAEP | BrowserFreezePayload | ButtonFeedbackAEP | ButtonHelpAEP | ColorPickerAEP | DispatchedTransactionAEP | EditorPerfAEP | EditorRenderedAEP<T> | EditorStartAEP | EditorStopAEP | EditorTTIAEP | ExpandToggleAEP | FeedbackAEP | FullWidthModeAEP | HelpQuickInsertAEP | InputPerfSamlingAEP | PickerEmojiAEP | PickerImageAEP | ReactNodeViewRenderedAEP | RichMediaLayoutAEP |
|
|
148
|
+
export declare type GeneralEventPayload<T = void> = AnnotateButtonAEP | AnnotationAEP | BrowserFreezePayload | ButtonFeedbackAEP | ButtonHelpAEP | ColorPickerAEP | DispatchedTransactionAEP | EditorPerfAEP | EditorRenderedAEP<T> | EditorStartAEP | EditorStopAEP | EditorTTIAEP | ExpandToggleAEP | FeedbackAEP | FullWidthModeAEP | HelpQuickInsertAEP | InputPerfSamlingAEP | PickerEmojiAEP | PickerImageAEP | ReactNodeViewRenderedAEP | RichMediaLayoutAEP | SelectionAEP | SlowInputAEP | UploadExternalFailedAEP | WithPluginStateCalledAEP | CodeBlockLanguageSelectedAEP | EditorContentRetrievalPerformedAEP;
|
|
170
149
|
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { TypeAheadAvailableNodes } from '@atlaskit/editor-common/type-ahead';
|
|
2
|
+
import { UIAEP, OperationalAEP } from './utils';
|
|
3
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, INPUT_METHOD } from './enums';
|
|
4
|
+
declare type TypeAheadRenderedAEP = OperationalAEP<ACTION.RENDERED, ACTION_SUBJECT.TYPEAHEAD, undefined, {
|
|
5
|
+
time?: number;
|
|
6
|
+
items?: number;
|
|
7
|
+
initial?: boolean;
|
|
8
|
+
}, undefined>;
|
|
9
|
+
declare type TypeAheadItemViewedAEP = OperationalAEP<ACTION.VIEWED, ACTION_SUBJECT.TYPEAHEAD_ITEM, undefined, {
|
|
10
|
+
index?: number;
|
|
11
|
+
items?: number;
|
|
12
|
+
}, undefined>;
|
|
13
|
+
declare type TypeAheadAEP<ActionSubjectID, Attributes> = UIAEP<ACTION.INVOKED, ACTION_SUBJECT.TYPEAHEAD, ActionSubjectID, Attributes, undefined>;
|
|
14
|
+
declare type TypeAheadEmojiAEP = TypeAheadAEP<ACTION_SUBJECT_ID.TYPEAHEAD_EMOJI | TypeAheadAvailableNodes.EMOJI, {
|
|
15
|
+
inputMethod: INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.KEYBOARD;
|
|
16
|
+
}>;
|
|
17
|
+
declare type TypeAheadLinkAEP = TypeAheadAEP<ACTION_SUBJECT_ID.TYPEAHEAD_LINK, {
|
|
18
|
+
inputMethod: INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.SHORTCUT;
|
|
19
|
+
}>;
|
|
20
|
+
declare type TypeAheadMentionAEP = TypeAheadAEP<ACTION_SUBJECT_ID.TYPEAHEAD_MENTION | TypeAheadAvailableNodes.MENTION, {
|
|
21
|
+
inputMethod: INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.KEYBOARD;
|
|
22
|
+
}>;
|
|
23
|
+
declare type TypeAheadQuickInsertAEP = TypeAheadAEP<ACTION_SUBJECT_ID.TYPEAHEAD_QUICK_INSERT | TypeAheadAvailableNodes.QUICK_INSERT, {
|
|
24
|
+
inputMethod: INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.KEYBOARD;
|
|
25
|
+
}>;
|
|
26
|
+
export declare type TypeAheadPayload = TypeAheadEmojiAEP | TypeAheadLinkAEP | TypeAheadMentionAEP | TypeAheadQuickInsertAEP | TypeAheadRenderedAEP | TypeAheadItemViewedAEP;
|
|
27
|
+
export {};
|
|
@@ -134,6 +134,16 @@ export declare const messages: {
|
|
|
134
134
|
defaultMessage: string;
|
|
135
135
|
description: string;
|
|
136
136
|
};
|
|
137
|
+
customPanel: {
|
|
138
|
+
id: string;
|
|
139
|
+
defaultMessage: string;
|
|
140
|
+
description: string;
|
|
141
|
+
};
|
|
142
|
+
customPanelDescription: {
|
|
143
|
+
id: string;
|
|
144
|
+
defaultMessage: string;
|
|
145
|
+
description: string;
|
|
146
|
+
};
|
|
137
147
|
other: {
|
|
138
148
|
id: string;
|
|
139
149
|
defaultMessage: string;
|
|
@@ -38,7 +38,7 @@ export default class ResizableEmbedCard extends React.Component<Props, State> {
|
|
|
38
38
|
wrapper?: HTMLElement;
|
|
39
39
|
get wideLayoutWidth(): number;
|
|
40
40
|
calcSnapPoints(): number[];
|
|
41
|
-
calcPxWidth: (useLayout?: "
|
|
41
|
+
calcPxWidth: (useLayout?: "wrap-right" | "center" | "wrap-left" | "wide" | "full-width" | "align-end" | "align-start" | undefined) => number;
|
|
42
42
|
get insideInlineLike(): boolean;
|
|
43
43
|
highlights: (newWidth: number, snapPoints: number[]) => number[] | string[];
|
|
44
44
|
/**
|
|
@@ -10,6 +10,7 @@ export declare class Participants implements ReadOnlyParticipants {
|
|
|
10
10
|
add(data: CollabParticipant[]): Participants;
|
|
11
11
|
remove(sessionIds: string[]): Participants;
|
|
12
12
|
update(sessionId: string, lastActive: number): Participants;
|
|
13
|
+
updateCursorPos(sessionId: string, cursorPos: number): Participants;
|
|
13
14
|
toArray(): CollabParticipant[];
|
|
14
15
|
get(sessionId: string): CollabParticipant | undefined;
|
|
15
16
|
size(): number;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { EditorView } from 'prosemirror-view';
|
|
2
3
|
import { ReadOnlyParticipants } from '../participants';
|
|
3
4
|
export interface AvatarsProps {
|
|
4
5
|
sessionId?: string;
|
|
5
6
|
participants: ReadOnlyParticipants;
|
|
7
|
+
editorView?: EditorView;
|
|
6
8
|
}
|
|
7
|
-
export declare const Avatars: React.
|
|
9
|
+
export declare const Avatars: React.FC<AvatarsProps>;
|
|
@@ -6,4 +6,4 @@ export interface InviteToEditButtonProps {
|
|
|
6
6
|
Component?: React.ComponentType<InviteToEditComponentProps>;
|
|
7
7
|
title: string;
|
|
8
8
|
}
|
|
9
|
-
export declare const InviteToEditButton: React.
|
|
9
|
+
export declare const InviteToEditButton: React.FC<InviteToEditButtonProps>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EditorState } from 'prosemirror-state';
|
|
2
|
-
import { Decoration, DecorationSet } from 'prosemirror-view';
|
|
3
|
-
import { CollabEditOptions } from './types';
|
|
2
|
+
import { EditorView, Decoration, DecorationSet } from 'prosemirror-view';
|
|
3
|
+
import { CollabEditOptions, CollabParticipant } from './types';
|
|
4
4
|
export interface Color {
|
|
5
5
|
solid: string;
|
|
6
6
|
selection: string;
|
|
@@ -15,3 +15,5 @@ export declare const createTelepointers: (from: number, to: number, sessionId: s
|
|
|
15
15
|
[key: string]: any;
|
|
16
16
|
}>[];
|
|
17
17
|
export declare const replaceDocument: (doc: any, state: EditorState, version?: number | undefined, options?: CollabEditOptions | undefined, reserveCursor?: boolean | undefined) => import("prosemirror-state").Transaction<any>;
|
|
18
|
+
export declare const scrollToCollabCursor: (editorView: EditorView, participants: CollabParticipant[], sessionId: string | undefined, index: number) => void;
|
|
19
|
+
export declare const getPositionOfTelepointer: (sessionId: string, decorationSet: DecorationSet) => undefined | number;
|