@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
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,115 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 149.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`226979a2a40`](https://bitbucket.org/atlassian/atlassian-frontend/commits/226979a2a40) - [ED-13713] Move TypeAhead keydown events to run by VanillaJS to avoid bubbling hijacking by product code
|
|
8
|
+
|
|
9
|
+
## 149.0.0
|
|
10
|
+
|
|
11
|
+
### Major Changes
|
|
12
|
+
|
|
13
|
+
- [`71bb1bb3cd0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/71bb1bb3cd0) - [ED-12933] Replace TypeAhead node mark to ProseMirror Decoration
|
|
14
|
+
|
|
15
|
+
# Minor change
|
|
16
|
+
|
|
17
|
+
Type Ahead isn't a part of the document anymore. This version is introducing
|
|
18
|
+
the Decoration system for this internal API.
|
|
19
|
+
|
|
20
|
+
# Breaking Change
|
|
21
|
+
|
|
22
|
+
We are replacing those public API:
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
export { selectItem } from './plugins/type-ahead/commands/select-item';
|
|
26
|
+
export { insertTypeAheadQuery } from './plugins/type-ahead/commands/insert-query';
|
|
27
|
+
export { dismissCommand } from './plugins/type-ahead/commands/dismiss';
|
|
28
|
+
export { insertMentionQuery } from './plugins/mentions/commands/insert-mention-query';
|
|
29
|
+
export { insertEmojiQuery } from './plugins/emoji/commands/insert-emoji-query';
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
If you need those behavior, please use this new one:
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
export { createTypeAheadTools } from './plugins/type-ahead/api';
|
|
36
|
+
export { createQuickInsertTools } from './plugins/quick-insert/api';
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Before:
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
import {
|
|
43
|
+
insertTypeAheadQuery,
|
|
44
|
+
insertMentionQuery,
|
|
45
|
+
dismissCommand,
|
|
46
|
+
} from '@atlaskit/editor-core';
|
|
47
|
+
|
|
48
|
+
// open the typeahead menu for mention
|
|
49
|
+
insertMentionQuery(editorView.state, editorView.dispatch);
|
|
50
|
+
|
|
51
|
+
// insert item
|
|
52
|
+
insertTypeAheadQuery(editorView.state, editorView.dispatch);
|
|
53
|
+
|
|
54
|
+
// close type ahead menu
|
|
55
|
+
insertTypeAheadQuery(editorView.state, editorView.dispatch);
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Now:
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
import {
|
|
63
|
+
createTypeAheadTools,
|
|
64
|
+
} from '@atlaskit/editor-core';
|
|
65
|
+
|
|
66
|
+
const tools = createTypeAheadTools(editorView);
|
|
67
|
+
|
|
68
|
+
tools.openMention();
|
|
69
|
+
tools.insertMention();
|
|
70
|
+
tools.close();
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Minor Changes
|
|
74
|
+
|
|
75
|
+
- [`ad67f6684f1`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ad67f6684f1) - Add MediaInline to ADF Stage0 schema
|
|
76
|
+
- [`2a6a10f9c5f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2a6a10f9c5f) - CETI-29 Updated emoji picker toolbar icon for custom panels
|
|
77
|
+
- [`5bafe5d2ccf`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5bafe5d2ccf) - Add a new attribute to existing prop elementBrowser to pass a function to render Marketplace component for app discovery
|
|
78
|
+
- [`53d81fa08ee`](https://bitbucket.org/atlassian/atlassian-frontend/commits/53d81fa08ee) - CETI-14 added functionality to hide emoji from custom panel
|
|
79
|
+
- [`bd510f46bff`](https://bitbucket.org/atlassian/atlassian-frontend/commits/bd510f46bff) - CETI-30 added functionality to add custom panel via the slash command
|
|
80
|
+
- [`6f9352d04b5`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6f9352d04b5) - analytics for beautiful emoji panels
|
|
81
|
+
- [`511f07f7f7b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/511f07f7f7b) - allow enabling download for media card via enableDownloadButton feature prop
|
|
82
|
+
- [`d1a58a7a520`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d1a58a7a520) - [ux] ED-12460 Implement collab scroll-to-telepointer: a user can now click on a collab avatar and be scrolled to another user's position in the document
|
|
83
|
+
- [`ab905c0e924`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ab905c0e924) - [ux] EDM-1641: add floating toolbar to media card and view switcher for inline view
|
|
84
|
+
- [`b95863772be`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b95863772be) - Support external observers.
|
|
85
|
+
Use better naming for refNode (refNode => reference).
|
|
86
|
+
In favor of further work (supporting multiple references) pass array of references to Extension component.
|
|
87
|
+
Expand node with localId for extentions.
|
|
88
|
+
- [`68c3a924b0c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/68c3a924b0c) - [ux] ED-13288: fixed ColorPickerField to work with fix color picker transformBefore()
|
|
89
|
+
|
|
90
|
+
### Patch Changes
|
|
91
|
+
|
|
92
|
+
- [`7d4bf49be6d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7d4bf49be6d) - CETI-2 Gracefully exiting the beautiful panel analytics when previousColor=== color | previousIcon=== icon. Such that we are not sending redundant analytics
|
|
93
|
+
- [`33a3f8baf8a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/33a3f8baf8a) - ED-12787 fixed issue with misaligned sticky header shadows with stickyHeadersOptimization on
|
|
94
|
+
- [`387c68f623c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/387c68f623c) - [ED-13558] Add the TypeAhead VIEWED and RENDERED events to the popup component
|
|
95
|
+
- [`099e8495f3d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/099e8495f3d) - CETI-37 - Fixed custom panel icon sizing and alignment
|
|
96
|
+
- [`5e1c18076db`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5e1c18076db) - [ED-13550] Fix Mention and Emoji toolbar menu disable when the TypeAhead menu is open
|
|
97
|
+
- [`b5072618005`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b5072618005) - ED-13347 Prevent list toolbar from crashing when the list state does not exist
|
|
98
|
+
- [`146ca2d6009`](https://bitbucket.org/atlassian/atlassian-frontend/commits/146ca2d6009) - CETI-24 Copy and paste custom panels makes page unresponsive
|
|
99
|
+
- [`56129bdfc79`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56129bdfc79) - Upgrade to the latest version of @atlaskit/modal-dialog.
|
|
100
|
+
- [`47f2d84b5ac`](https://bitbucket.org/atlassian/atlassian-frontend/commits/47f2d84b5ac) - [ED-13567] Fix mobile typeahead API when its open
|
|
101
|
+
- [`b90c0237824`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b90c0237824) - Update package.jsons to remove unused dependencies.
|
|
102
|
+
- [`363971afa29`](https://bitbucket.org/atlassian/atlassian-frontend/commits/363971afa29) - [ux][ed-13574] Resolving a regression in the quick insert in mobile. A hotfix was merged to master a week ago to fix mobile feature flags, which seems to have clashed with changes in develop resulting in quick insert no longer working on mobile and a bunch of mobile integration tests failing.
|
|
103
|
+
|
|
104
|
+
This change includes making quick insert work on mobile again by making sure the tracker isn’t reset every time CC @Sean Chamberlain
|
|
105
|
+
|
|
106
|
+
All tests with configureEditor now have a way to refocus the editor after the config is set and before any document changes are made.
|
|
107
|
+
|
|
108
|
+
New mobile integration tests have been added for feature flags to ensure we don't have any further regressions with mobile feature flags.
|
|
109
|
+
|
|
110
|
+
- [`6c2c8a1b3a5`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6c2c8a1b3a5) - EDM-2288 Implement analytics attribute for paste link on text
|
|
111
|
+
- Updated dependencies
|
|
112
|
+
|
|
3
113
|
## 148.0.0
|
|
4
114
|
|
|
5
115
|
### Major Changes
|
|
@@ -72,6 +72,10 @@ function getDefaultPresetOptionsFromEditorProps(props, createAnalyticsEvent) {
|
|
|
72
72
|
var inputTracking = (_props$performanceTra = props.performanceTracking) === null || _props$performanceTra === void 0 ? void 0 : _props$performanceTra.inputTracking;
|
|
73
73
|
return {
|
|
74
74
|
createAnalyticsEvent: createAnalyticsEvent,
|
|
75
|
+
typeAhead: {
|
|
76
|
+
createAnalyticsEvent: createAnalyticsEvent,
|
|
77
|
+
isMobile: isMobile
|
|
78
|
+
},
|
|
75
79
|
featureFlags: (0, _featureFlagsFromProps.createFeatureFlagsFromProps)(props),
|
|
76
80
|
paste: {
|
|
77
81
|
cardOptions: props.smartLinks || props.UNSAFE_cards,
|
|
@@ -102,7 +106,8 @@ function getDefaultPresetOptionsFromEditorProps(props, createAnalyticsEvent) {
|
|
|
102
106
|
enableElementBrowser: props.elementBrowser && props.elementBrowser.showModal,
|
|
103
107
|
elementBrowserHelpUrl: props.elementBrowser && props.elementBrowser.helpUrl,
|
|
104
108
|
disableDefaultItems: isMobile,
|
|
105
|
-
headless: isMobile
|
|
109
|
+
headless: isMobile,
|
|
110
|
+
emptyStateHandler: props.elementBrowser && props.elementBrowser.emptyStateHandler
|
|
106
111
|
},
|
|
107
112
|
selection: {
|
|
108
113
|
useLongPressSelection: false
|
package/dist/cjs/editor.js
CHANGED
|
@@ -194,10 +194,7 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
194
194
|
extensionProviders = _this$props.extensionProviders,
|
|
195
195
|
quickInsert = _this$props.quickInsert;
|
|
196
196
|
|
|
197
|
-
if (extensionProviders && extensionProviders !== prevProps.extensionProviders ||
|
|
198
|
-
// loading but we can remove it soon when Forge will move to new API.
|
|
199
|
-
// quickInsert={Promise.resolve(consumerQuickInsert)} is one of the main reason behind this performance issue.
|
|
200
|
-
quickInsert && quickInsert !== prevProps.quickInsert) {
|
|
197
|
+
if (extensionProviders && extensionProviders !== prevProps.extensionProviders || quickInsert && quickInsert !== prevProps.quickInsert) {
|
|
201
198
|
var extensionProvider = this.prepareExtensionProvider(extensionProviders);
|
|
202
199
|
var quickInsertProvider = this.prepareQuickInsertProvider(extensionProvider, quickInsert);
|
|
203
200
|
this.setState({
|
package/dist/cjs/index.js
CHANGED
|
@@ -271,6 +271,12 @@ Object.defineProperty(exports, "subscribeToToolbarAndPickerUpdates", {
|
|
|
271
271
|
return _toolbarAndPickerUpdates.subscribeToToolbarAndPickerUpdates;
|
|
272
272
|
}
|
|
273
273
|
});
|
|
274
|
+
Object.defineProperty(exports, "subscribeTypeAheadUpdates", {
|
|
275
|
+
enumerable: true,
|
|
276
|
+
get: function get() {
|
|
277
|
+
return _typeAheadUpdates.subscribeTypeAheadUpdates;
|
|
278
|
+
}
|
|
279
|
+
});
|
|
274
280
|
Object.defineProperty(exports, "insertBlockType", {
|
|
275
281
|
enumerable: true,
|
|
276
282
|
get: function get() {
|
|
@@ -397,24 +403,6 @@ Object.defineProperty(exports, "processQuickInsertItems", {
|
|
|
397
403
|
return _quickInsert.memoProcessItems;
|
|
398
404
|
}
|
|
399
405
|
});
|
|
400
|
-
Object.defineProperty(exports, "selectItem", {
|
|
401
|
-
enumerable: true,
|
|
402
|
-
get: function get() {
|
|
403
|
-
return _selectItem.selectItem;
|
|
404
|
-
}
|
|
405
|
-
});
|
|
406
|
-
Object.defineProperty(exports, "insertTypeAheadQuery", {
|
|
407
|
-
enumerable: true,
|
|
408
|
-
get: function get() {
|
|
409
|
-
return _insertQuery.insertTypeAheadQuery;
|
|
410
|
-
}
|
|
411
|
-
});
|
|
412
|
-
Object.defineProperty(exports, "dismissCommand", {
|
|
413
|
-
enumerable: true,
|
|
414
|
-
get: function get() {
|
|
415
|
-
return _dismiss.dismissCommand;
|
|
416
|
-
}
|
|
417
|
-
});
|
|
418
406
|
Object.defineProperty(exports, "insertLink", {
|
|
419
407
|
enumerable: true,
|
|
420
408
|
get: function get() {
|
|
@@ -583,18 +571,6 @@ Object.defineProperty(exports, "GapCursorSide", {
|
|
|
583
571
|
return _gapCursorSelection.Side;
|
|
584
572
|
}
|
|
585
573
|
});
|
|
586
|
-
Object.defineProperty(exports, "insertMentionQuery", {
|
|
587
|
-
enumerable: true,
|
|
588
|
-
get: function get() {
|
|
589
|
-
return _insertMentionQuery.insertMentionQuery;
|
|
590
|
-
}
|
|
591
|
-
});
|
|
592
|
-
Object.defineProperty(exports, "insertEmojiQuery", {
|
|
593
|
-
enumerable: true,
|
|
594
|
-
get: function get() {
|
|
595
|
-
return _insertEmojiQuery.insertEmojiQuery;
|
|
596
|
-
}
|
|
597
|
-
});
|
|
598
574
|
Object.defineProperty(exports, "selectionPluginKey", {
|
|
599
575
|
enumerable: true,
|
|
600
576
|
get: function get() {
|
|
@@ -655,6 +631,18 @@ Object.defineProperty(exports, "dateMessages", {
|
|
|
655
631
|
return _messages.dateMessages;
|
|
656
632
|
}
|
|
657
633
|
});
|
|
634
|
+
Object.defineProperty(exports, "createTypeAheadTools", {
|
|
635
|
+
enumerable: true,
|
|
636
|
+
get: function get() {
|
|
637
|
+
return _api.createTypeAheadTools;
|
|
638
|
+
}
|
|
639
|
+
});
|
|
640
|
+
Object.defineProperty(exports, "createQuickInsertTools", {
|
|
641
|
+
enumerable: true,
|
|
642
|
+
get: function get() {
|
|
643
|
+
return _api2.createQuickInsertTools;
|
|
644
|
+
}
|
|
645
|
+
});
|
|
658
646
|
|
|
659
647
|
var _versionWrapper = require("./version-wrapper");
|
|
660
648
|
|
|
@@ -708,6 +696,8 @@ var _textFormatting = require("./plugins/text-formatting/commands/text-formattin
|
|
|
708
696
|
|
|
709
697
|
var _toolbarAndPickerUpdates = require("./plugins/view-update-subscription/subscribe/toolbarAndPickerUpdates");
|
|
710
698
|
|
|
699
|
+
var _typeAheadUpdates = require("./plugins/view-update-subscription/subscribe/type-ahead-updates");
|
|
700
|
+
|
|
711
701
|
var _commands3 = require("./plugins/block-type/commands");
|
|
712
702
|
|
|
713
703
|
var _commands4 = require("./plugins/table/commands");
|
|
@@ -730,12 +720,6 @@ var _typeAhead = require("./plugins/type-ahead");
|
|
|
730
720
|
|
|
731
721
|
var _quickInsert = require("./plugins/quick-insert");
|
|
732
722
|
|
|
733
|
-
var _selectItem = require("./plugins/type-ahead/commands/select-item");
|
|
734
|
-
|
|
735
|
-
var _insertQuery = require("./plugins/type-ahead/commands/insert-query");
|
|
736
|
-
|
|
737
|
-
var _dismiss = require("./plugins/type-ahead/commands/dismiss");
|
|
738
|
-
|
|
739
723
|
var _commands6 = require("./plugins/hyperlink/commands");
|
|
740
724
|
|
|
741
725
|
var _history = require("./plugins/history");
|
|
@@ -756,10 +740,6 @@ var _PortalProvider = require("./ui/PortalProvider");
|
|
|
756
740
|
|
|
757
741
|
var _gapCursorSelection = require("./plugins/selection/gap-cursor-selection");
|
|
758
742
|
|
|
759
|
-
var _insertMentionQuery = require("./plugins/mentions/commands/insert-mention-query");
|
|
760
|
-
|
|
761
|
-
var _insertEmojiQuery = require("./plugins/emoji/commands/insert-emoji-query");
|
|
762
|
-
|
|
763
743
|
var _mobileSelection = require("./plugins/mobile-selection");
|
|
764
744
|
|
|
765
745
|
var _commands8 = require("./plugins/expand/commands");
|
|
@@ -774,6 +754,10 @@ var _common = require("./ui/ColorPalette/Palettes/common");
|
|
|
774
754
|
|
|
775
755
|
var _messages = _interopRequireWildcard(require("./messages"));
|
|
776
756
|
|
|
757
|
+
var _api = require("./plugins/type-ahead/api");
|
|
758
|
+
|
|
759
|
+
var _api2 = require("./plugins/quick-insert/api");
|
|
760
|
+
|
|
777
761
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
778
762
|
|
|
779
763
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -89,7 +89,7 @@ function createDefaultPreset(options) {
|
|
|
89
89
|
preset.add([_textFormatting.default, options.textFormatting]);
|
|
90
90
|
preset.add(_width.default);
|
|
91
91
|
preset.add([_quickInsert.default, options.quickInsert]);
|
|
92
|
-
preset.add([_typeAhead.default, {
|
|
92
|
+
preset.add([_typeAhead.default, options.typeAhead || {
|
|
93
93
|
createAnalyticsEvent: options.createAnalyticsEvent
|
|
94
94
|
}]);
|
|
95
95
|
preset.add(_unsupportedContent.default);
|
package/dist/cjs/messages.js
CHANGED
|
@@ -117,6 +117,11 @@ var _default = (0, _reactIntl.defineMessages)({
|
|
|
117
117
|
defaultMessage: 'Remove',
|
|
118
118
|
description: 'Delete the element (image, panel, table, etc.) from your document'
|
|
119
119
|
},
|
|
120
|
+
hideEmoji: {
|
|
121
|
+
id: 'fabric.editor.hideEmoji',
|
|
122
|
+
defaultMessage: 'Hide emoji',
|
|
123
|
+
description: 'Hide the emoji panel icon from custom panel'
|
|
124
|
+
},
|
|
120
125
|
visit: {
|
|
121
126
|
id: 'fabric.editor.visit',
|
|
122
127
|
defaultMessage: 'Open link in a new window',
|
|
@@ -97,8 +97,7 @@ var SelectionBasedNodeView = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
97
97
|
var _this$view$state$sele = _this.view.state.selection,
|
|
98
98
|
from = _this$view$state$sele.from,
|
|
99
99
|
to = _this$view$state$sele.to;
|
|
100
|
-
return selection.node === _this.node ||
|
|
101
|
-
_this.pos === from && _this.posEnd === to && selection.node.eq(_this.node);
|
|
100
|
+
return selection.node === _this.node || _this.pos === from && _this.posEnd === to && selection.node.eq(_this.node);
|
|
102
101
|
}
|
|
103
102
|
|
|
104
103
|
return false;
|
|
@@ -8,10 +8,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.extendPayload = extendPayload;
|
|
9
9
|
exports.default = void 0;
|
|
10
10
|
|
|
11
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
12
|
-
|
|
13
11
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
14
12
|
|
|
13
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
|
+
|
|
15
15
|
var _prosemirrorState = require("prosemirror-state");
|
|
16
16
|
|
|
17
17
|
var _editorCommon = require("@atlaskit/editor-common");
|
|
@@ -30,16 +30,16 @@ var _steps = require("@atlaskit/adf-schema/steps");
|
|
|
30
30
|
|
|
31
31
|
var _undoRedoInputSource = require("../undo-redo/undo-redo-input-source");
|
|
32
32
|
|
|
33
|
-
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; }
|
|
34
|
-
|
|
35
|
-
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; }
|
|
36
|
-
|
|
37
33
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
38
34
|
|
|
39
35
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
40
36
|
|
|
41
37
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
42
38
|
|
|
39
|
+
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; }
|
|
40
|
+
|
|
41
|
+
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; }
|
|
42
|
+
|
|
43
43
|
function createPlugin(options) {
|
|
44
44
|
if (!options || !options.createAnalyticsEvent) {
|
|
45
45
|
return;
|
|
@@ -50,7 +50,9 @@ function createPlugin(options) {
|
|
|
50
50
|
key: _pluginKey.analyticsPluginKey,
|
|
51
51
|
state: {
|
|
52
52
|
init: function init() {
|
|
53
|
-
return options
|
|
53
|
+
return _objectSpread(_objectSpread({}, options), {}, {
|
|
54
|
+
fireAnalytics: (0, _fireAnalyticsEvent.fireAnalyticsEvent)(options.createAnalyticsEvent)
|
|
55
|
+
});
|
|
54
56
|
},
|
|
55
57
|
apply: function apply(tr, pluginState, _, state) {
|
|
56
58
|
var _getFeatureFlags;
|
|
@@ -21,6 +21,8 @@ exports.ACTION = ACTION;
|
|
|
21
21
|
ACTION["ACTIVATED"] = "activated";
|
|
22
22
|
ACTION["ADDED"] = "added";
|
|
23
23
|
ACTION["BROWSER_FREEZE"] = "browserFreeze";
|
|
24
|
+
ACTION["CHANGED_BACKGROUND_COLOR"] = "changedBackgroundColor";
|
|
25
|
+
ACTION["CHANGED_ICON"] = "changedIcon";
|
|
24
26
|
ACTION["CHANGED_FULL_WIDTH_MODE"] = "changedFullWidthMode";
|
|
25
27
|
ACTION["CHANGED_LAYOUT"] = "changedLayout";
|
|
26
28
|
ACTION["CHANGED_REPLACEMENT_TEXT"] = "changedReplacementText";
|
|
@@ -64,6 +66,7 @@ exports.ACTION = ACTION;
|
|
|
64
66
|
ACTION["INVOKED"] = "invoked";
|
|
65
67
|
ACTION["LANGUAGE_SELECTED"] = "languageSelected";
|
|
66
68
|
ACTION["LIST_ITEM_JOINED"] = "listItemJoined";
|
|
69
|
+
ACTION["MATCHED"] = "matched";
|
|
67
70
|
ACTION["NODE_CONTENT_SANITIZED"] = "nodeContentSanitized";
|
|
68
71
|
ACTION["OPENED"] = "opened";
|
|
69
72
|
ACTION["OUTDENTED"] = "outdented";
|
|
@@ -99,6 +102,7 @@ exports.ACTION = ACTION;
|
|
|
99
102
|
ACTION["RENDERED"] = "rendered";
|
|
100
103
|
ACTION["ON_EDITOR_READY_CALLBACK"] = "onEditorReadyCallback";
|
|
101
104
|
ACTION["ON_CHANGE_CALLBACK"] = "onChangeCalled";
|
|
105
|
+
ACTION["REMOVE_ICON"] = "removedIcon";
|
|
102
106
|
})(ACTION || (exports.ACTION = ACTION = {}));
|
|
103
107
|
|
|
104
108
|
var INPUT_METHOD;
|
|
@@ -173,6 +177,7 @@ exports.ACTION_SUBJECT = ACTION_SUBJECT;
|
|
|
173
177
|
ACTION_SUBJECT["PLUS_MENU"] = "plusMenu";
|
|
174
178
|
ACTION_SUBJECT["PLUGIN_SLOT"] = "pluginSlot";
|
|
175
179
|
ACTION_SUBJECT["REACT_NODE_VIEW"] = "reactNodeView";
|
|
180
|
+
ACTION_SUBJECT["SELECTION"] = "selection";
|
|
176
181
|
ACTION_SUBJECT["SMART_LINK"] = "smartLink";
|
|
177
182
|
ACTION_SUBJECT["HYPERLINK"] = "hyperlink";
|
|
178
183
|
ACTION_SUBJECT["TABLE"] = "table";
|
|
@@ -143,6 +143,16 @@ var messages = (0, _reactIntl.defineMessages)({
|
|
|
143
143
|
defaultMessage: 'Call out errors in a colored panel',
|
|
144
144
|
description: 'Visually distinguishes your text by adding a error panel'
|
|
145
145
|
},
|
|
146
|
+
customPanel: {
|
|
147
|
+
id: 'fabric.editor.customPanel',
|
|
148
|
+
defaultMessage: 'Custom panel',
|
|
149
|
+
description: 'Visually distinguishes your panel by adding a emoji icon and background color'
|
|
150
|
+
},
|
|
151
|
+
customPanelDescription: {
|
|
152
|
+
id: 'fabric.editor.customPanel.description',
|
|
153
|
+
defaultMessage: 'Add a note with an emoji and colored background',
|
|
154
|
+
description: 'Visually distinguishes your panel by adding a emoji icon and background color '
|
|
155
|
+
},
|
|
146
156
|
other: {
|
|
147
157
|
id: 'fabric.editor.other',
|
|
148
158
|
defaultMessage: 'Others...',
|
|
@@ -252,9 +252,7 @@ var EmbedCardComponent = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
252
252
|
// since `heightAlone` is defined only when just height is available.
|
|
253
253
|
|
|
254
254
|
var heightAlone = liveHeight !== null && liveHeight !== void 0 ? liveHeight : !originalWidth && originalHeight || undefined;
|
|
255
|
-
var aspectRatio = !heightAlone && ( //
|
|
256
|
-
initialAspectRatio || // If we have initialAspectRatio (coming from iframely) we should go with that
|
|
257
|
-
originalHeight && originalWidth && originalWidth / originalHeight) || // If ADF contains both width and height we get ratio from that
|
|
255
|
+
var aspectRatio = !heightAlone && (initialAspectRatio || originalHeight && originalWidth && originalWidth / originalHeight) || // If ADF contains both width and height we get ratio from that
|
|
258
256
|
undefined;
|
|
259
257
|
var cardProps = {
|
|
260
258
|
layout: layout,
|
|
@@ -57,6 +57,21 @@ var Participants = /*#__PURE__*/function () {
|
|
|
57
57
|
}));
|
|
58
58
|
return new Participants(newSet);
|
|
59
59
|
}
|
|
60
|
+
}, {
|
|
61
|
+
key: "updateCursorPos",
|
|
62
|
+
value: function updateCursorPos(sessionId, cursorPos) {
|
|
63
|
+
var newSet = new Map(this.participants);
|
|
64
|
+
var data = newSet.get(sessionId);
|
|
65
|
+
|
|
66
|
+
if (!data) {
|
|
67
|
+
return this;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
newSet.set(sessionId, _objectSpread(_objectSpread({}, data), {}, {
|
|
71
|
+
cursorPos: cursorPos
|
|
72
|
+
}));
|
|
73
|
+
return new Participants(newSet);
|
|
74
|
+
}
|
|
60
75
|
}, {
|
|
61
76
|
key: "toArray",
|
|
62
77
|
value: function toArray() {
|
|
@@ -223,6 +223,20 @@ var PluginState = /*#__PURE__*/function () {
|
|
|
223
223
|
|
|
224
224
|
if (add.length) {
|
|
225
225
|
this.decorationSet = this.decorationSet.add(tr.doc, add);
|
|
226
|
+
} // This piece needs to be after the decorationSet adjustments,
|
|
227
|
+
// otherwise it's always one step behind where the cursor is
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
if (telepointerData) {
|
|
231
|
+
var _sessionId2 = telepointerData.sessionId;
|
|
232
|
+
|
|
233
|
+
if (participants.get(_sessionId2)) {
|
|
234
|
+
var positionForScroll = (0, _utils.getPositionOfTelepointer)(_sessionId2, this.decorationSet);
|
|
235
|
+
|
|
236
|
+
if (positionForScroll) {
|
|
237
|
+
participants = participants.updateCursorPos(_sessionId2, positionForScroll);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
226
240
|
}
|
|
227
241
|
|
|
228
242
|
var nextState = new PluginState(this.decorationSet, participants, sid, collabInitialised);
|
|
@@ -25,7 +25,8 @@ var AvatarsWithPluginState = function AvatarsWithPluginState(props) {
|
|
|
25
25
|
var title = props.intl.formatMessage(_messages.default.inviteToEditButtonTitle);
|
|
26
26
|
var selected = props.isInviteToEditButtonSelected,
|
|
27
27
|
onClick = props.inviteToEditHandler,
|
|
28
|
-
Component = props.inviteToEditComponent
|
|
28
|
+
Component = props.inviteToEditComponent,
|
|
29
|
+
editorView = props.editorView;
|
|
29
30
|
|
|
30
31
|
var render = _react.default.useCallback(function (_ref) {
|
|
31
32
|
var data = _ref.data;
|
|
@@ -36,21 +37,22 @@ var AvatarsWithPluginState = function AvatarsWithPluginState(props) {
|
|
|
36
37
|
|
|
37
38
|
return /*#__PURE__*/_react.default.createElement(_avatars.Avatars, {
|
|
38
39
|
sessionId: data.sessionId,
|
|
39
|
-
participants: data.activeParticipants
|
|
40
|
+
participants: data.activeParticipants,
|
|
41
|
+
editorView: editorView
|
|
40
42
|
}, /*#__PURE__*/_react.default.createElement(_inviteToEdit.InviteToEditButton, {
|
|
41
43
|
title: title,
|
|
42
44
|
selected: selected,
|
|
43
45
|
onClick: onClick,
|
|
44
46
|
Component: Component
|
|
45
47
|
}));
|
|
46
|
-
}, [selected, onClick, Component, title]);
|
|
48
|
+
}, [selected, onClick, Component, title, editorView]);
|
|
47
49
|
|
|
48
50
|
return /*#__PURE__*/_react.default.createElement(_WithPluginState.default, {
|
|
49
51
|
plugins: {
|
|
50
52
|
data: _plugin.pluginKey
|
|
51
53
|
},
|
|
52
54
|
render: render,
|
|
53
|
-
editorView:
|
|
55
|
+
editorView: editorView
|
|
54
56
|
});
|
|
55
57
|
};
|
|
56
58
|
|
|
@@ -15,8 +15,13 @@ var _styles = require("./styles");
|
|
|
15
15
|
|
|
16
16
|
var _toAvatar = _interopRequireDefault(require("./to-avatar"));
|
|
17
17
|
|
|
18
|
+
var _utils = require("../utils");
|
|
19
|
+
|
|
20
|
+
var _featureFlagsContext = require("../../feature-flags-context");
|
|
21
|
+
|
|
18
22
|
var Avatars = /*#__PURE__*/_react.default.memo(function (props) {
|
|
19
|
-
var sessionId = props.sessionId
|
|
23
|
+
var sessionId = props.sessionId,
|
|
24
|
+
editorView = props.editorView;
|
|
20
25
|
var participants = props.participants.toArray();
|
|
21
26
|
var avatars = participants.sort(function (p) {
|
|
22
27
|
return p.sessionId === sessionId ? -1 : 1;
|
|
@@ -30,7 +35,19 @@ var Avatars = /*#__PURE__*/_react.default.memo(function (props) {
|
|
|
30
35
|
appearance: "stack",
|
|
31
36
|
size: "medium",
|
|
32
37
|
data: avatars,
|
|
33
|
-
maxCount: 3
|
|
38
|
+
maxCount: 3,
|
|
39
|
+
onAvatarClick: function onAvatarClick(_event, _analytics, index) {
|
|
40
|
+
if (!editorView) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
var featureFlags = (0, _featureFlagsContext.getFeatureFlags)(editorView.state);
|
|
45
|
+
var allowCollabAvatarScroll = featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.collabAvatarScroll; // user does not need to scroll to their own position (index 0)
|
|
46
|
+
|
|
47
|
+
if (allowCollabAvatarScroll && index > 0) {
|
|
48
|
+
(0, _utils.scrollToCollabCursor)(editorView, participants, props.sessionId, index);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
34
51
|
}), props.children);
|
|
35
52
|
});
|
|
36
53
|
|
|
@@ -7,7 +7,7 @@ var _typeof3 = require("@babel/runtime/helpers/typeof");
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
|
-
exports.replaceDocument = exports.createTelepointers = exports.findPointers = exports.getAvatarColor = exports.colors = void 0;
|
|
10
|
+
exports.getPositionOfTelepointer = exports.scrollToCollabCursor = exports.replaceDocument = exports.createTelepointers = exports.findPointers = exports.getAvatarColor = exports.colors = void 0;
|
|
11
11
|
|
|
12
12
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
13
13
|
|
|
@@ -21,6 +21,10 @@ var _adfSchema = require("@atlaskit/adf-schema");
|
|
|
21
21
|
|
|
22
22
|
var _editorCommon = require("@atlaskit/editor-common");
|
|
23
23
|
|
|
24
|
+
var _utils = require("../analytics/utils");
|
|
25
|
+
|
|
26
|
+
var _types = require("../analytics/types");
|
|
27
|
+
|
|
24
28
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
25
29
|
|
|
26
30
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -139,4 +143,40 @@ var replaceDocument = function replaceDocument(doc, state, version, options, res
|
|
|
139
143
|
return tr;
|
|
140
144
|
};
|
|
141
145
|
|
|
142
|
-
exports.replaceDocument = replaceDocument;
|
|
146
|
+
exports.replaceDocument = replaceDocument;
|
|
147
|
+
|
|
148
|
+
var scrollToCollabCursor = function scrollToCollabCursor(editorView, participants, sessionId, index) {
|
|
149
|
+
var selectedUser = participants[index];
|
|
150
|
+
|
|
151
|
+
if (selectedUser && selectedUser.cursorPos !== undefined && selectedUser.sessionId !== sessionId) {
|
|
152
|
+
var state = editorView.state;
|
|
153
|
+
var tr = state.tr;
|
|
154
|
+
var analyticsPayload = {
|
|
155
|
+
action: _types.ACTION.MATCHED,
|
|
156
|
+
actionSubject: _types.ACTION_SUBJECT.SELECTION,
|
|
157
|
+
eventType: _types.EVENT_TYPE.TRACK
|
|
158
|
+
};
|
|
159
|
+
tr.setSelection(_prosemirrorState.Selection.near(tr.doc.resolve(selectedUser.cursorPos)));
|
|
160
|
+
tr = (0, _utils.addAnalytics)(state, tr, analyticsPayload);
|
|
161
|
+
tr.scrollIntoView();
|
|
162
|
+
editorView.dispatch(tr);
|
|
163
|
+
|
|
164
|
+
if (!editorView.hasFocus()) {
|
|
165
|
+
editorView.focus();
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
exports.scrollToCollabCursor = scrollToCollabCursor;
|
|
171
|
+
|
|
172
|
+
var getPositionOfTelepointer = function getPositionOfTelepointer(sessionId, decorationSet) {
|
|
173
|
+
var scrollPosition;
|
|
174
|
+
decorationSet.find().forEach(function (deco) {
|
|
175
|
+
if (deco.type.spec.pointer.sessionId === sessionId) {
|
|
176
|
+
scrollPosition = deco.from;
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
return scrollPosition;
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
exports.getPositionOfTelepointer = getPositionOfTelepointer;
|
|
@@ -19,15 +19,17 @@ var _internal = require("./utils/internal");
|
|
|
19
19
|
|
|
20
20
|
var _prosemirrorUtils = require("prosemirror-utils");
|
|
21
21
|
|
|
22
|
-
var createDate = function createDate() {
|
|
22
|
+
var createDate = function createDate(isQuickInsertAction) {
|
|
23
23
|
return function (insert, state) {
|
|
24
24
|
var dateNode = state.schema.nodes.date.createChecked({
|
|
25
25
|
timestamp: (0, _editorCommon.todayTimestampInUTC)()
|
|
26
26
|
});
|
|
27
|
-
var
|
|
27
|
+
var space = state.schema.text(' ');
|
|
28
|
+
var tr = insert(_prosemirrorModel.Fragment.from([dateNode, space]), {
|
|
28
29
|
selectInlineNode: true
|
|
29
30
|
});
|
|
30
31
|
var newPluginState = {
|
|
32
|
+
isQuickInsertAction: isQuickInsertAction,
|
|
31
33
|
showDatePickerAt: tr.selection.from,
|
|
32
34
|
isNew: true,
|
|
33
35
|
isDateEmpty: false,
|
|
@@ -162,7 +162,7 @@ var datePlugin = function datePlugin() {
|
|
|
162
162
|
return /*#__PURE__*/_react.default.createElement(_assets.IconDate, null);
|
|
163
163
|
},
|
|
164
164
|
action: function action(insert, state) {
|
|
165
|
-
var tr = (0, _actions.createDate)()(insert, state);
|
|
165
|
+
var tr = (0, _actions.createDate)(true)(insert, state);
|
|
166
166
|
(0, _analytics.addAnalytics)(state, tr, {
|
|
167
167
|
action: _analytics.ACTION.INSERTED,
|
|
168
168
|
actionSubject: _analytics.ACTION_SUBJECT.DOCUMENT,
|
|
@@ -55,7 +55,12 @@ function mapping(tr, pluginState) {
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
function onSelectionChanged(tr, pluginState) {
|
|
58
|
-
if (
|
|
58
|
+
if (tr.docChanged && isDateNodeSelection(tr.selection)) {
|
|
59
|
+
return _objectSpread(_objectSpread({}, pluginState), {}, {
|
|
60
|
+
isQuickInsertAction: false,
|
|
61
|
+
showDatePickerAt: tr.selection.from
|
|
62
|
+
});
|
|
63
|
+
} else if (!isDateNodeSelection(tr.selection) && !pluginState.isQuickInsertAction) {
|
|
59
64
|
if (pluginState.showDatePickerAt) {
|
|
60
65
|
return {
|
|
61
66
|
showDatePickerAt: null,
|