@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
|
@@ -186,7 +186,8 @@ function createPasteAnalyticsPayload(view, event, slice, pasteContext) {
|
|
|
186
186
|
pasteSize: text.length,
|
|
187
187
|
type: pasteContext.type,
|
|
188
188
|
content: _analytics.PasteContents.text,
|
|
189
|
-
source: source
|
|
189
|
+
source: source,
|
|
190
|
+
hyperlinkPasteOnText: false
|
|
190
191
|
});
|
|
191
192
|
}
|
|
192
193
|
|
|
@@ -214,7 +215,8 @@ function createPasteAnalyticsPayload(view, event, slice, pasteContext) {
|
|
|
214
215
|
type: pasteContext.type,
|
|
215
216
|
pasteSize: pasteSize,
|
|
216
217
|
content: content,
|
|
217
|
-
source: source
|
|
218
|
+
source: source,
|
|
219
|
+
hyperlinkPasteOnText: !!pasteContext.hyperlinkPasteOnText
|
|
218
220
|
}, linkDomains);
|
|
219
221
|
} // TODO: ED-6612 We should not dispatch only analytics, it's preferred to wrap each command with his own analytics.
|
|
220
222
|
// However, handlers like handleMacroAutoConvert dispatch multiple time,
|
|
@@ -307,7 +309,8 @@ exports.handleSelectedTableWithAnalytics = handleSelectedTableWithAnalytics;
|
|
|
307
309
|
|
|
308
310
|
var handlePasteLinkOnSelectedTextWithAnalytics = function handlePasteLinkOnSelectedTextWithAnalytics(view, event, slice, type) {
|
|
309
311
|
return (0, _utils.pipe)(_handlers.handlePasteLinkOnSelectedText, pasteCommandWithAnalytics(view, event, slice, {
|
|
310
|
-
type: type
|
|
312
|
+
type: type,
|
|
313
|
+
hyperlinkPasteOnText: true
|
|
311
314
|
}))(slice);
|
|
312
315
|
};
|
|
313
316
|
|
|
@@ -19,6 +19,8 @@ var _styles = require("./styles");
|
|
|
19
19
|
|
|
20
20
|
var _focusHandler = require("../base/pm-plugins/focus-handler");
|
|
21
21
|
|
|
22
|
+
var _utils = require("../type-ahead/utils");
|
|
23
|
+
|
|
22
24
|
var pluginKey = new _prosemirrorState.PluginKey('placeholderPlugin');
|
|
23
25
|
exports.pluginKey = pluginKey;
|
|
24
26
|
|
|
@@ -64,6 +66,10 @@ var emptyPlaceholder = {
|
|
|
64
66
|
function createPlaceHolderStateFrom(editorState, getPlaceholderHintMessage, defaultPlaceholderText, bracketPlaceholderText) {
|
|
65
67
|
var isEditorFocused = _focusHandler.focusStateKey.getState(editorState);
|
|
66
68
|
|
|
69
|
+
if ((0, _utils.isTypeAheadOpen)(editorState)) {
|
|
70
|
+
return emptyPlaceholder;
|
|
71
|
+
}
|
|
72
|
+
|
|
67
73
|
if (defaultPlaceholderText && (0, _document.isEmptyDocument)(editorState.doc)) {
|
|
68
74
|
return setPlaceHolderState(defaultPlaceholderText);
|
|
69
75
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createQuickInsertTools = void 0;
|
|
7
|
+
|
|
8
|
+
var _pluginKey = require("./plugin-key");
|
|
9
|
+
|
|
10
|
+
var _search = require("./search");
|
|
11
|
+
|
|
12
|
+
var getItems = function getItems(editorView) {
|
|
13
|
+
return function (query, options) {
|
|
14
|
+
var pluginState = _pluginKey.pluginKey.getState(editorView.state);
|
|
15
|
+
|
|
16
|
+
if (!pluginState) {
|
|
17
|
+
return [];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return (0, _search.searchQuickInsertItems)(pluginState, options)(query);
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
var createQuickInsertTools = function createQuickInsertTools(editorView) {
|
|
25
|
+
return {
|
|
26
|
+
getItems: getItems(editorView)
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
exports.createQuickInsertTools = createQuickInsertTools;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = IconCustomPanel;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
function IconCustomPanel() {
|
|
13
|
+
return /*#__PURE__*/_react.default.createElement("svg", {
|
|
14
|
+
width: "40",
|
|
15
|
+
height: "40",
|
|
16
|
+
viewBox: "0 0 40 40",
|
|
17
|
+
fill: "none",
|
|
18
|
+
focusable: "false",
|
|
19
|
+
"aria-hidden": true
|
|
20
|
+
}, /*#__PURE__*/_react.default.createElement("rect", {
|
|
21
|
+
width: "40",
|
|
22
|
+
height: "40",
|
|
23
|
+
fill: "white"
|
|
24
|
+
}), /*#__PURE__*/_react.default.createElement("path", {
|
|
25
|
+
d: "M8 13C8 12.4477 8.44772 12 9 12H40V28H9C8.44772 28 8 27.5523 8 27V13Z",
|
|
26
|
+
fill: "#E6FCFF"
|
|
27
|
+
}), /*#__PURE__*/_react.default.createElement("g", {
|
|
28
|
+
clipPath: "url(#clip0)"
|
|
29
|
+
}, /*#__PURE__*/_react.default.createElement("path", {
|
|
30
|
+
d: "M19.9999 16.2222C15.5817 16.2222 12.2222 19.5818 12.2222 24H16.0093C16.0093 21.7962 17.7964 20.0093 19.9999 20.0093V16.2222Z",
|
|
31
|
+
fill: "#8767AC"
|
|
32
|
+
}), /*#__PURE__*/_react.default.createElement("path", {
|
|
33
|
+
d: "M12 23.9998H12.676C12.676 19.9578 15.9502 16.6809 19.9909 16.676V16C15.5767 16.0051 12 19.5847 12 23.9998Z",
|
|
34
|
+
fill: "#EB2027"
|
|
35
|
+
}), /*#__PURE__*/_react.default.createElement("path", {
|
|
36
|
+
d: "M12.6851 24H13.3517C13.3517 20.3262 16.3273 17.3478 19.9999 17.3429V16.6762C15.9593 16.6811 12.6851 19.958 12.6851 24Z",
|
|
37
|
+
fill: "#F19020"
|
|
38
|
+
}), /*#__PURE__*/_react.default.createElement("path", {
|
|
39
|
+
d: "M13.3518 24H14.0185C14.0185 20.6945 16.6956 18.0145 20 18.0096V17.3429C16.3274 17.3478 13.3518 20.3262 13.3518 24Z",
|
|
40
|
+
fill: "#FFCB4C"
|
|
41
|
+
}), /*#__PURE__*/_react.default.createElement("path", {
|
|
42
|
+
d: "M14.0184 24H14.6851C14.6851 21.0629 17.064 18.6811 20 18.6762V18.0096C16.6955 18.0144 14.0184 20.6944 14.0184 24Z",
|
|
43
|
+
fill: "#5C903F"
|
|
44
|
+
}), /*#__PURE__*/_react.default.createElement("path", {
|
|
45
|
+
d: "M14.6851 24H15.3517C15.3517 21.4311 17.4322 19.348 19.9999 19.3431V18.6762C17.0639 18.6811 14.6851 21.0629 14.6851 24Z",
|
|
46
|
+
fill: "#226798"
|
|
47
|
+
})), /*#__PURE__*/_react.default.createElement("defs", null, /*#__PURE__*/_react.default.createElement("clipPath", {
|
|
48
|
+
id: "clip0"
|
|
49
|
+
}, /*#__PURE__*/_react.default.createElement("rect", {
|
|
50
|
+
width: "8",
|
|
51
|
+
height: "8",
|
|
52
|
+
fill: "white",
|
|
53
|
+
transform: "translate(12 16)"
|
|
54
|
+
}))));
|
|
55
|
+
}
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.IconExpand = exports.IconFeedback = exports.IconHeading = exports.IconFallback = exports.IconTable = exports.IconStatus = exports.IconQuote = exports.IconPanel = exports.IconPanelWarning = exports.IconPanelSuccess = exports.IconPanelNote = exports.IconPanelError = exports.IconMention = exports.IconList = exports.IconListNumber = exports.IconLink = exports.IconLayout = exports.IconImages = exports.IconEmoji = exports.IconDivider = exports.IconDecision = exports.IconDate = exports.IconCode = exports.IconAction = void 0;
|
|
8
|
+
exports.IconExpand = exports.IconFeedback = exports.IconHeading = exports.IconFallback = exports.IconTable = exports.IconStatus = exports.IconQuote = exports.IconCustomPanel = exports.IconPanel = exports.IconPanelWarning = exports.IconPanelSuccess = exports.IconPanelNote = exports.IconPanelError = exports.IconMention = exports.IconList = exports.IconListNumber = exports.IconLink = exports.IconLayout = exports.IconImages = exports.IconEmoji = exports.IconDivider = exports.IconDecision = exports.IconDate = exports.IconCode = exports.IconAction = void 0;
|
|
9
9
|
|
|
10
10
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
11
11
|
|
|
@@ -240,6 +240,19 @@ var IconPanel = (0, _reactLoadable.default)({
|
|
|
240
240
|
}
|
|
241
241
|
});
|
|
242
242
|
exports.IconPanel = IconPanel;
|
|
243
|
+
var IconCustomPanel = (0, _reactLoadable.default)({
|
|
244
|
+
loader: function loader() {
|
|
245
|
+
return Promise.resolve().then(function () {
|
|
246
|
+
return _interopRequireWildcard(require('./custom-panel'));
|
|
247
|
+
}).then(function (module) {
|
|
248
|
+
return module.default;
|
|
249
|
+
});
|
|
250
|
+
},
|
|
251
|
+
loading: function loading() {
|
|
252
|
+
return null;
|
|
253
|
+
}
|
|
254
|
+
});
|
|
255
|
+
exports.IconCustomPanel = IconCustomPanel;
|
|
243
256
|
var IconQuote = (0, _reactLoadable.default)({
|
|
244
257
|
loader: function loader() {
|
|
245
258
|
return Promise.resolve().then(function () {
|
|
@@ -25,9 +25,7 @@ var _prosemirrorState = require("prosemirror-state");
|
|
|
25
25
|
|
|
26
26
|
var _memoizeOne = _interopRequireDefault(require("memoize-one"));
|
|
27
27
|
|
|
28
|
-
var
|
|
29
|
-
|
|
30
|
-
var _consts = require("../analytics/consts");
|
|
28
|
+
var _typeAhead = require("@atlaskit/editor-common/type-ahead");
|
|
31
29
|
|
|
32
30
|
var _pluginKey = require("./plugin-key");
|
|
33
31
|
|
|
@@ -50,35 +48,22 @@ var quickInsertPlugin = function quickInsertPlugin(options) {
|
|
|
50
48
|
var providerFactory = _ref.providerFactory,
|
|
51
49
|
reactContext = _ref.reactContext,
|
|
52
50
|
dispatch = _ref.dispatch;
|
|
53
|
-
return quickInsertPluginFactory(quickInsert, providerFactory, reactContext().intl, dispatch);
|
|
51
|
+
return quickInsertPluginFactory(quickInsert, providerFactory, reactContext().intl, dispatch, options === null || options === void 0 ? void 0 : options.emptyStateHandler);
|
|
54
52
|
}
|
|
55
53
|
}];
|
|
56
54
|
},
|
|
57
55
|
pluginsOptions: {
|
|
58
56
|
typeAhead: {
|
|
57
|
+
id: _typeAhead.TypeAheadAvailableNodes.QUICK_INSERT,
|
|
59
58
|
trigger: '/',
|
|
60
59
|
headless: options ? options.headless : undefined,
|
|
61
|
-
getItems: function getItems(
|
|
62
|
-
var
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
if (!prevActive && queryChanged) {
|
|
66
|
-
dispatch(_consts.analyticsEventKey, {
|
|
67
|
-
payload: {
|
|
68
|
-
action: _analytics.ACTION.INVOKED,
|
|
69
|
-
actionSubject: _analytics.ACTION_SUBJECT.TYPEAHEAD,
|
|
70
|
-
actionSubjectId: _analytics.ACTION_SUBJECT_ID.TYPEAHEAD_QUICK_INSERT,
|
|
71
|
-
attributes: {
|
|
72
|
-
inputMethod: _analytics.INPUT_METHOD.KEYBOARD
|
|
73
|
-
},
|
|
74
|
-
eventType: _analytics.EVENT_TYPE.UI
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
}
|
|
60
|
+
getItems: function getItems(_ref2) {
|
|
61
|
+
var query = _ref2.query,
|
|
62
|
+
editorState = _ref2.editorState;
|
|
78
63
|
|
|
79
|
-
var quickInsertState = _pluginKey.pluginKey.getState(
|
|
64
|
+
var quickInsertState = _pluginKey.pluginKey.getState(editorState);
|
|
80
65
|
|
|
81
|
-
return (0, _search.searchQuickInsertItems)(quickInsertState, options)(query);
|
|
66
|
+
return Promise.resolve((0, _search.searchQuickInsertItems)(quickInsertState, options)(query));
|
|
82
67
|
},
|
|
83
68
|
selectItem: function selectItem(state, item, insert) {
|
|
84
69
|
return item.action(insert, state);
|
|
@@ -156,13 +141,14 @@ var setProviderState = function setProviderState(providerState) {
|
|
|
156
141
|
};
|
|
157
142
|
};
|
|
158
143
|
|
|
159
|
-
function quickInsertPluginFactory(quickInsertItems, providerFactory, intl, dispatch) {
|
|
144
|
+
function quickInsertPluginFactory(quickInsertItems, providerFactory, intl, dispatch, emptyStateHandler) {
|
|
160
145
|
return new _prosemirrorState.Plugin({
|
|
161
146
|
key: _pluginKey.pluginKey,
|
|
162
147
|
state: {
|
|
163
148
|
init: function init() {
|
|
164
149
|
return {
|
|
165
150
|
isElementBrowserModalOpen: false,
|
|
151
|
+
emptyStateHandler: emptyStateHandler,
|
|
166
152
|
// lazy so it doesn't run on editor initialization
|
|
167
153
|
// memo here to avoid using a singleton cache, avoids editor
|
|
168
154
|
// getting confused when two editors exist within the same page.
|
|
@@ -51,6 +51,7 @@ var Modal = function Modal(_ref) {
|
|
|
51
51
|
onInsertItem: onInsertItem,
|
|
52
52
|
helpUrl: helpUrl,
|
|
53
53
|
isOpen: quickInsertState && quickInsertState.isElementBrowserModalOpen || false,
|
|
54
|
+
emptyStateHandler: quickInsertState && quickInsertState.emptyStateHandler,
|
|
54
55
|
onClose: onClose
|
|
55
56
|
});
|
|
56
57
|
};
|
package/dist/cjs/plugins/rank.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _default = {
|
|
8
|
-
plugins: ['featureFlagsContextPlugin', 'compositionPlugin', 'inlineCursorTargetPlugin', 'focusHandlerPlugin', 'frozenEditor', 'submitEditor', 'saveOnEnter', 'customAutoformatting', 'newlinePreserveMarksPlugin', 'imageUpload', 'imageUploadInputRule', 'clipboard', 'paste', 'pasteKeymap', 'mention', 'mentionInputRule', 'mentionKeymap', 'emoji', 'placeholderText', 'emojiInputRule', 'emojiKeymap', 'emojiAsciiInputRule', 'blockType', 'quickInsert', 'tasksAndDecisions', 'blockTypeInputRule', 'tasksAndDecisionsInputRule', 'list', 'typeAhead', 'typeAheadKeymap', 'typeAheadInputRule', 'date', // Needs to be before indentation to handle tab into input field
|
|
8
|
+
plugins: ['featureFlagsContextPlugin', 'compositionPlugin', 'inlineCursorTargetPlugin', 'typeAhead', 'typeAheadInsertItem', 'focusHandlerPlugin', 'frozenEditor', 'submitEditor', 'saveOnEnter', 'customAutoformatting', 'newlinePreserveMarksPlugin', 'imageUpload', 'imageUploadInputRule', 'clipboard', 'paste', 'pasteKeymap', 'mention', 'mentionInputRule', 'mentionKeymap', 'emoji', 'placeholderText', 'emojiInputRule', 'emojiKeymap', 'emojiAsciiInputRule', 'blockType', 'quickInsert', 'tasksAndDecisions', 'blockTypeInputRule', 'tasksAndDecisionsInputRule', 'list', 'typeAhead', 'typeAheadKeymap', 'typeAheadInputRule', 'date', // Needs to be before indentation to handle tab into input field
|
|
9
9
|
'dateKeymap', // This should be always after `typeAheadKeymap` & `emojiKeymap`
|
|
10
10
|
'indentationKeymap', 'textColor', 'alignmentPlugin', 'listInputRule', 'listKeymap', 'codeBlock', 'codeBlockIDEKeyBindings', 'codeBlockKeyMap', 'textFormatting', 'textFormattingCursor', 'textFormattingInputRule', 'textFormattingSmartRule', 'textFormattingClear', 'textFormattingKeymap', // task/decisions keymap needs to be above table keymap so can indent actions in a table
|
|
11
11
|
'tasksAndDecisionsKeyMap', // expand and table keymaps need to be above selection keymap to add their custom selection behaviour:
|
|
@@ -9,16 +9,10 @@ exports.default = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
11
|
|
|
12
|
-
var _prosemirrorModel = require("prosemirror-model");
|
|
13
|
-
|
|
14
12
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
15
13
|
|
|
16
|
-
var _insert = require("../../utils/insert");
|
|
17
|
-
|
|
18
14
|
var _analytics = require("../analytics");
|
|
19
15
|
|
|
20
|
-
var _featureFlagsContext = require("../feature-flags-context");
|
|
21
|
-
|
|
22
16
|
var _messages = require("../insert-block/ui/ToolbarInsertBlock/messages");
|
|
23
17
|
|
|
24
18
|
var _assets = require("../quick-insert/assets");
|
|
@@ -65,25 +59,7 @@ var rulePlugin = function rulePlugin() {
|
|
|
65
59
|
return /*#__PURE__*/_react.default.createElement(_assets.IconDivider, null);
|
|
66
60
|
},
|
|
67
61
|
action: function action(insert, state) {
|
|
68
|
-
var tr =
|
|
69
|
-
|
|
70
|
-
var _getFeatureFlags = (0, _featureFlagsContext.getFeatureFlags)(state),
|
|
71
|
-
newInsertionBehaviour = _getFeatureFlags.newInsertionBehaviour;
|
|
72
|
-
|
|
73
|
-
if (newInsertionBehaviour) {
|
|
74
|
-
/**
|
|
75
|
-
* This is a workaround to get rid of the typeahead text when using quick insert
|
|
76
|
-
* Once we insert *nothing*, we get a new transaction, so we can use the new selection
|
|
77
|
-
* without considering the extra text after the `/` command.
|
|
78
|
-
**/
|
|
79
|
-
tr = insert(_prosemirrorModel.Fragment.empty);
|
|
80
|
-
tr = (0, _insert.safeInsert)(state.schema.nodes.rule.createChecked(), tr.selection.from)(tr);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
if (!tr) {
|
|
84
|
-
tr = insert(state.schema.nodes.rule.createChecked());
|
|
85
|
-
}
|
|
86
|
-
|
|
62
|
+
var tr = insert(state.schema.nodes.rule.createChecked());
|
|
87
63
|
return (0, _analytics.addAnalytics)(state, tr, {
|
|
88
64
|
action: _analytics.ACTION.INSERTED,
|
|
89
65
|
actionSubject: _analytics.ACTION_SUBJECT.DOCUMENT,
|
|
@@ -7,8 +7,6 @@ exports.default = exports.scrollIntoViewPluginKey = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _prosemirrorState = require("prosemirror-state");
|
|
9
9
|
|
|
10
|
-
var _inputRules = require("../type-ahead/pm-plugins/input-rules");
|
|
11
|
-
|
|
12
10
|
var _prosemirrorInputRules = require("@atlaskit/prosemirror-input-rules");
|
|
13
11
|
|
|
14
12
|
/**
|
|
@@ -36,8 +34,7 @@ var createPlugin = function createPlugin() {
|
|
|
36
34
|
if ((tr.docChanged || tr.storedMarksSet) && !tr.scrolledIntoView && tr.getMeta('scrollIntoView') !== false && // ignore anything we would not want to undo
|
|
37
35
|
// this covers things like autofixing layouts, hovering table rows/cols
|
|
38
36
|
tr.getMeta('addToHistory') !== false && // ignore collab changes from another user
|
|
39
|
-
!tr.getMeta('isRemote') && // ignore
|
|
40
|
-
!tr.getMeta(_inputRules.typeAheadInputRulesPluginKey) && // ignore any transaction coming from the input text rule plugin
|
|
37
|
+
!tr.getMeta('isRemote') && // ignore any transaction coming from the input text rule plugin
|
|
41
38
|
!tr.getMeta(_prosemirrorInputRules.TEXT_INPUT_RULE_TRANSACTION_KEY)) {
|
|
42
39
|
return newState.tr.scrollIntoView();
|
|
43
40
|
}
|
|
@@ -116,8 +116,7 @@ var arrow = function arrow(dir, endOfTextblock) {
|
|
|
116
116
|
|
|
117
117
|
|
|
118
118
|
if (selection instanceof _selection.GapCursorSelection && // next node allow gap cursor position
|
|
119
|
-
(0, _isValidTargetNode.isValidTargetNode)((0, _direction.isBackward)(dir) ? $pos.nodeBefore : $pos.nodeAfter) && (
|
|
120
|
-
(0, _direction.isBackward)(dir) && selection.side === _selection.Side.LEFT || (0, _direction.isForward)(dir) && selection.side === _selection.Side.RIGHT)) {
|
|
119
|
+
(0, _isValidTargetNode.isValidTargetNode)((0, _direction.isBackward)(dir) ? $pos.nodeBefore : $pos.nodeAfter) && ((0, _direction.isBackward)(dir) && selection.side === _selection.Side.LEFT || (0, _direction.isForward)(dir) && selection.side === _selection.Side.RIGHT)) {
|
|
121
120
|
// reverse cursor position
|
|
122
121
|
if (dispatch) {
|
|
123
122
|
dispatch(tr.setSelection(new _selection.GapCursorSelection($pos, selection.side === _selection.Side.RIGHT ? _selection.Side.LEFT : _selection.Side.RIGHT)).scrollIntoView());
|
|
@@ -291,12 +290,12 @@ var setSelectionTopLevelBlocks = function setSelectionTopLevelBlocks(tr, event,
|
|
|
291
290
|
} // try to set text selection if the editor isnt focused
|
|
292
291
|
// if the editor is focused, we are most likely dragging a selection outside.
|
|
293
292
|
else if (editorFocused === false) {
|
|
294
|
-
|
|
293
|
+
var selectionTemp = _prosemirrorState.Selection.findFrom($pos, cursorCoords.side === _selection.Side.LEFT ? 1 : -1, true);
|
|
295
294
|
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
}
|
|
295
|
+
if (selectionTemp) {
|
|
296
|
+
tr.setSelection(selectionTemp);
|
|
299
297
|
}
|
|
298
|
+
}
|
|
300
299
|
};
|
|
301
300
|
|
|
302
301
|
exports.setSelectionTopLevelBlocks = setSelectionTopLevelBlocks;
|
|
@@ -43,9 +43,7 @@ var createPlugin = function createPlugin(dispatch, dispatchAnalyticsEvent) {
|
|
|
43
43
|
return;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
var analyticsPayload = (0, _utils.getNodeSelectionAnalyticsPayload)(state.selection) || (0, _utils.getAllSelectionAnalyticsPayload)(state.selection) || // We
|
|
47
|
-
// handled in mouseup handler below
|
|
48
|
-
!editorView.mouseDown && ((0, _utils.getRangeSelectionAnalyticsPayload)(state.selection, state.doc) || (0, _utils.getCellSelectionAnalyticsPayload)(state)); // We have to use dispatchAnalyticsEvent over any of the analytics plugin helpers
|
|
46
|
+
var analyticsPayload = (0, _utils.getNodeSelectionAnalyticsPayload)(state.selection) || (0, _utils.getAllSelectionAnalyticsPayload)(state.selection) || !editorView.mouseDown && ((0, _utils.getRangeSelectionAnalyticsPayload)(state.selection, state.doc) || (0, _utils.getCellSelectionAnalyticsPayload)(state)); // We have to use dispatchAnalyticsEvent over any of the analytics plugin helpers
|
|
49
47
|
// as there were several issues caused by the fact that adding analytics through
|
|
50
48
|
// the plugin adds a new step to the transaction
|
|
51
49
|
// This causes prosemirror to run through some different code paths, eg. attempting
|
|
@@ -32,12 +32,15 @@ var DEFAULT_STATUS = {
|
|
|
32
32
|
exports.DEFAULT_STATUS = DEFAULT_STATUS;
|
|
33
33
|
|
|
34
34
|
var createStatus = function createStatus() {
|
|
35
|
-
var showStatusPickerAtOffset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] :
|
|
35
|
+
var showStatusPickerAtOffset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
36
36
|
return function (insert, state) {
|
|
37
37
|
var statusNode = state.schema.nodes.status.createChecked(_objectSpread(_objectSpread({}, DEFAULT_STATUS), {}, {
|
|
38
38
|
localId: _adfSchema.uuid.generate()
|
|
39
39
|
}));
|
|
40
|
-
var
|
|
40
|
+
var space = state.schema.text(' ');
|
|
41
|
+
var tr = insert(_prosemirrorModel.Fragment.from([statusNode, space]), {
|
|
42
|
+
selectInlineNode: true
|
|
43
|
+
});
|
|
41
44
|
var showStatusPickerAt = tr.selection.from + showStatusPickerAtOffset;
|
|
42
45
|
return tr.setSelection(_prosemirrorState.NodeSelection.create(tr.doc, showStatusPickerAt)).setMeta(_pluginKey.pluginKey, {
|
|
43
46
|
showStatusPickerAt: showStatusPickerAt,
|
|
@@ -73,7 +73,7 @@ var createPlugin = function createPlugin(dispatch, portalProviderAPI, eventDispa
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
if (
|
|
76
|
+
if (tr.selectionSet) {
|
|
77
77
|
// Change in selection, while status picker was open, update state, if required.
|
|
78
78
|
var selectionFrom = tr.selection.from;
|
|
79
79
|
var nodeAtSelection = tr.doc.nodeAt(selectionFrom);
|
|
@@ -187,23 +187,23 @@ var arrowLeftFromText = function arrowLeftFromText(selection) {
|
|
|
187
187
|
|
|
188
188
|
if (isSelectionAtStartOfTable($from, selection) && $from.parent.type.name === 'paragraph' && $from.depth === table.depth + 3 // + 3 for: row, cell & paragraph nodes
|
|
189
189
|
) {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
}
|
|
190
|
+
var _getSelectionPluginSt4 = (0, _pluginFactory.getPluginState)(state),
|
|
191
|
+
selectionRelativeToNode = _getSelectionPluginSt4.selectionRelativeToNode;
|
|
192
|
+
|
|
193
|
+
if (selectionRelativeToNode === _types.RelativeSelectionPos.Before) {
|
|
194
|
+
// we have a text selection at start of first table cell, directly inside a top level paragraph,
|
|
195
|
+
// and want to set gap cursor selection before table
|
|
196
|
+
return setGapCursorBeforeTable()(state, dispatch);
|
|
197
|
+
} else {
|
|
198
|
+
// we have a text selection at start of first table cell, directly inside a top level paragraph,
|
|
199
|
+
// and want to set a full table cell selection
|
|
200
|
+
return selectFullTable({
|
|
201
|
+
node: table.node,
|
|
202
|
+
startPos: table.start,
|
|
203
|
+
dir: TableSelectionDirection.BottomToTop
|
|
204
|
+
})(state, dispatch);
|
|
206
205
|
}
|
|
206
|
+
}
|
|
207
207
|
}
|
|
208
208
|
|
|
209
209
|
return false;
|
|
@@ -219,14 +219,14 @@ var arrowRightFromText = function arrowRightFromText(selection) {
|
|
|
219
219
|
|
|
220
220
|
if (isSelectionAtEndOfTable($to, selection) && $to.parent.type.name === 'paragraph' && $to.depth === table.depth + 3 // + 3 for: row, cell & paragraph nodes
|
|
221
221
|
) {
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
222
|
+
// we have a text selection at end of last table cell, directly inside a top level paragraph,
|
|
223
|
+
// and want to set a full table cell selection
|
|
224
|
+
return selectFullTable({
|
|
225
|
+
node: table.node,
|
|
226
|
+
startPos: table.start,
|
|
227
|
+
dir: TableSelectionDirection.TopToBottom
|
|
228
|
+
})(state, dispatch);
|
|
229
|
+
}
|
|
230
230
|
}
|
|
231
231
|
|
|
232
232
|
return false;
|
|
@@ -109,6 +109,7 @@ var TableRowNodeView = /*#__PURE__*/function () {
|
|
|
109
109
|
});
|
|
110
110
|
(0, _defineProperty2.default)(this, "onTablePluginState", function (state) {
|
|
111
111
|
var tableRef = state.tableRef;
|
|
112
|
+
var focusChanged = false;
|
|
112
113
|
var tree = _this.tree;
|
|
113
114
|
|
|
114
115
|
if (!tree) {
|
|
@@ -125,6 +126,11 @@ var TableRowNodeView = /*#__PURE__*/function () {
|
|
|
125
126
|
}
|
|
126
127
|
|
|
127
128
|
var isCurrentTableSelected = tableRef === tree.table;
|
|
129
|
+
|
|
130
|
+
if (isCurrentTableSelected !== _this.focused) {
|
|
131
|
+
focusChanged = true;
|
|
132
|
+
}
|
|
133
|
+
|
|
128
134
|
_this.focused = isCurrentTableSelected;
|
|
129
135
|
var wrapper = tree.wrapper;
|
|
130
136
|
var tableContainer = wrapper.parentElement;
|
|
@@ -149,7 +155,8 @@ var TableRowNodeView = /*#__PURE__*/function () {
|
|
|
149
155
|
|
|
150
156
|
|
|
151
157
|
setTimeout(function () {
|
|
152
|
-
if
|
|
158
|
+
// if focus changed while header is sticky - still repaint the positions will shift
|
|
159
|
+
if (!_this.stickyHeadersOptimization || focusChanged && _this.isSticky) {
|
|
153
160
|
_this.paint(tree);
|
|
154
161
|
}
|
|
155
162
|
|
|
@@ -218,8 +218,7 @@ var bulkColumnsResize = function bulkColumnsResize(resizeState, columnsIndexes,
|
|
|
218
218
|
|
|
219
219
|
var newState = _objectSpread(_objectSpread({}, resizeState), {}, {
|
|
220
220
|
cols: cols.map(function (col) {
|
|
221
|
-
if (columnsIndexes.indexOf(col.index) > -1 ||
|
|
222
|
-
columnsIndexes.indexOf(sourceColumnIndex) > -1 && col.index < colIndex) {
|
|
221
|
+
if (columnsIndexes.indexOf(col.index) > -1 || columnsIndexes.indexOf(sourceColumnIndex) > -1 && col.index < colIndex) {
|
|
223
222
|
return col;
|
|
224
223
|
}
|
|
225
224
|
|
|
@@ -257,19 +256,19 @@ var bulkColumnsResize = function bulkColumnsResize(resizeState, columnsIndexes,
|
|
|
257
256
|
} // table is in overflow: keep the dragged column at its widths and evenly distribute columns
|
|
258
257
|
// to recover from overflow state
|
|
259
258
|
else {
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
259
|
+
var columnWidth = Math.floor((minTableWidth - sourceCol.width) / (newState.cols.length - 1));
|
|
260
|
+
newState = _objectSpread(_objectSpread({}, resizeState), {}, {
|
|
261
|
+
cols: newState.cols.map(function (col) {
|
|
262
|
+
if (col.index === sourceCol.index) {
|
|
263
|
+
return col;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
return _objectSpread(_objectSpread({}, col), {}, {
|
|
267
|
+
width: columnWidth
|
|
268
|
+
});
|
|
269
|
+
})
|
|
270
|
+
});
|
|
271
|
+
}
|
|
273
272
|
} // fix total table widths by adding missing pixels to columns widths here and there
|
|
274
273
|
|
|
275
274
|
|
|
@@ -25,6 +25,8 @@ var _nodeviews = require("../../../nodeviews");
|
|
|
25
25
|
|
|
26
26
|
var _Decision = _interopRequireDefault(require("../ui/Decision"));
|
|
27
27
|
|
|
28
|
+
var _utils = require("../../type-ahead/utils");
|
|
29
|
+
|
|
28
30
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
29
31
|
|
|
30
32
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
@@ -67,7 +69,7 @@ var Decision = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
67
69
|
value: function render(_props, forwardRef) {
|
|
68
70
|
return /*#__PURE__*/_react.default.createElement(_Decision.default, {
|
|
69
71
|
contentRef: forwardRef,
|
|
70
|
-
showPlaceholder: this.isContentEmpty(this.node)
|
|
72
|
+
showPlaceholder: this.isContentEmpty(this.node) && !(0, _utils.isTypeAheadOpen)(this.view.state)
|
|
71
73
|
});
|
|
72
74
|
}
|
|
73
75
|
}, {
|
|
@@ -35,6 +35,8 @@ var _pluginKey = require("../pm-plugins/plugin-key");
|
|
|
35
35
|
|
|
36
36
|
var _Task = _interopRequireDefault(require("../ui/Task"));
|
|
37
37
|
|
|
38
|
+
var _utils = require("../../type-ahead/utils");
|
|
39
|
+
|
|
38
40
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
39
41
|
|
|
40
42
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
@@ -147,7 +149,7 @@ var Task = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
147
149
|
contentRef: forwardRef,
|
|
148
150
|
isDone: state === 'DONE',
|
|
149
151
|
onChange: _this2.handleOnChange,
|
|
150
|
-
showPlaceholder: _this2.isContentEmpty(_this2.node),
|
|
152
|
+
showPlaceholder: _this2.isContentEmpty(_this2.node) && !(0, _utils.isTypeAheadOpen)(_this2.view.state),
|
|
151
153
|
providers: props.providerFactory
|
|
152
154
|
});
|
|
153
155
|
}
|
|
@@ -204,8 +204,7 @@ var deleteHandler = (0, _commands.filter)([_helpers.isInsideTaskOrDecisionItem,
|
|
|
204
204
|
} // if nested, just unindent
|
|
205
205
|
|
|
206
206
|
|
|
207
|
-
if ($next.node($next.depth - 2).type === taskList ||
|
|
208
|
-
$next.node($next.depth - 1).type === taskList && $next.parent.type === taskList) {
|
|
207
|
+
if ($next.node($next.depth - 2).type === taskList || $next.node($next.depth - 1).type === taskList && $next.parent.type === taskList) {
|
|
209
208
|
var tr = (0, _helpers.liftBlock)(state.tr, $next, $next);
|
|
210
209
|
|
|
211
210
|
if (dispatch && tr) {
|
|
@@ -32,10 +32,7 @@ var _default = new _prosemirrorState.Plugin({
|
|
|
32
32
|
var clickWasAtTextNode = !!(clickNode && clickNode.isText);
|
|
33
33
|
var clickWasAtEndOfAParagraphNode = $click.parent.type === paragraph && $click.textOffset === 0 && $click.nodeAfter === null;
|
|
34
34
|
|
|
35
|
-
if (clickWasAtEdgeOfATextNode && clickWasNearACodeMark && clickedDOMElementPosition && (
|
|
36
|
-
// it was at a directly adjacent non-text node, so we skip this manual
|
|
37
|
-
// text selection logic to preserve that non-text node's selection
|
|
38
|
-
clickWasAtTextNode || clickWasAtEndOfAParagraphNode)) {
|
|
35
|
+
if (clickWasAtEdgeOfATextNode && clickWasNearACodeMark && clickedDOMElementPosition && (clickWasAtTextNode || clickWasAtEndOfAParagraphNode)) {
|
|
39
36
|
var clickWasInsideNodeDOM = event.target.parentNode === view.domAtPos(clickedDOMElementPosition).node && code.isInSet(view.state.doc.resolve(clickedDOMElementPosition).nodeAfter.marks);
|
|
40
37
|
var nodeNextToClick = $click.nodeBefore && code.isInSet($click.nodeBefore.marks) ? $click.nodeAfter : $click.nodeBefore; // Need to set the selection here to allow clicking between [code('text'),{<>},emoji()]
|
|
41
38
|
|