@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
|
@@ -0,0 +1,35 @@
|
|
|
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 = EditorEmojiAddIcon;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
function EditorEmojiAddIcon() {
|
|
13
|
+
return /*#__PURE__*/_react.default.createElement("svg", {
|
|
14
|
+
width: 24,
|
|
15
|
+
height: 24,
|
|
16
|
+
viewBox: "0 0 24 24",
|
|
17
|
+
fill: "none",
|
|
18
|
+
"aria-label": "editor-add-emoji"
|
|
19
|
+
}, /*#__PURE__*/_react.default.createElement("rect", {
|
|
20
|
+
width: 24,
|
|
21
|
+
height: 24,
|
|
22
|
+
fill: "white",
|
|
23
|
+
fillOpacity: "0.01"
|
|
24
|
+
}), /*#__PURE__*/_react.default.createElement("path", {
|
|
25
|
+
fillRule: "evenodd",
|
|
26
|
+
clipRule: "evenodd",
|
|
27
|
+
d: "M14.5715 6.20367C13.7531 5.88041 12.8807 5.71423 12 5.71423C10.1435 5.71423 8.36301 6.45173 7.05025 7.76449C5.7375 9.07724 5 10.8577 5 12.7142C5 14.5708 5.7375 16.3512 7.05025 17.664C8.36301 18.9767 10.1435 19.7142 12 19.7142C12.9193 19.7142 13.8295 19.5332 14.6788 19.1814C15.5281 18.8296 16.2997 18.314 16.9497 17.664C17.5998 17.014 18.1154 16.2423 18.4672 15.393C18.8189 14.5437 19 13.6335 19 12.7142C19 12.1349 18.9281 11.5591 18.7868 10.9999H17.2266C17.404 11.5396 17.5 12.1159 17.5 12.7142C17.5 15.7472 15.033 18.2142 12 18.2142C8.967 18.2142 6.5 15.7472 6.5 12.7142C6.50159 11.256 7.08156 9.85801 8.11267 8.8269C9.14377 7.79579 10.5418 7.21582 12 7.21423C12.9284 7.21423 13.8037 7.44537 14.5715 7.85312V6.20367ZM9.79289 11.9213C9.98043 12.1089 10.2348 12.2142 10.5 12.2142C10.7652 12.2142 11.0196 12.1089 11.2071 11.9213C11.3946 11.7338 11.5 11.4795 11.5 11.2142C11.5 10.949 11.3946 10.6947 11.2071 10.5071C11.0196 10.3196 10.7652 10.2142 10.5 10.2142C10.2348 10.2142 9.98043 10.3196 9.79289 10.5071C9.60536 10.6947 9.5 10.949 9.5 11.2142C9.5 11.4795 9.60536 11.7338 9.79289 11.9213ZM12.7929 11.9213C12.9804 12.1089 13.2348 12.2142 13.5 12.2142C13.7652 12.2142 14.0196 12.1089 14.2071 11.9213C14.3946 11.7338 14.5 11.4795 14.5 11.2142C14.5 10.949 14.3946 10.6947 14.2071 10.5071C14.0196 10.3196 13.7652 10.2142 13.5 10.2142C13.2348 10.2142 12.9804 10.3196 12.7929 10.5071C12.6054 10.6947 12.5 10.949 12.5 11.2142C12.5 11.4795 12.6054 11.7338 12.7929 11.9213ZM14.1965 13.61C14.0355 13.6153 13.8828 13.6823 13.77 13.7972C12.871 14.8032 11.133 14.8032 10.232 13.8002C10.1205 13.6799 9.96614 13.6082 9.80223 13.6006C9.63832 13.5931 9.47801 13.6503 9.35592 13.7599C9.23383 13.8695 9.15974 14.0227 9.14965 14.1865C9.13956 14.3503 9.19428 14.5115 9.302 14.6352C9.64217 15.0139 10.0582 15.3167 10.523 15.5241C10.9878 15.7316 11.491 15.8389 12 15.8392C12.51 15.839 13.0142 15.7313 13.4797 15.5231C13.9453 15.315 14.3617 15.0111 14.702 14.6312C14.8037 14.5064 14.8535 14.3472 14.8409 14.1866C14.8282 14.0261 14.7542 13.8766 14.6342 13.7692C14.5142 13.6618 14.3574 13.6048 14.1965 13.61Z",
|
|
28
|
+
fill: "currentColor"
|
|
29
|
+
}), /*#__PURE__*/_react.default.createElement("path", {
|
|
30
|
+
fillRule: "evenodd",
|
|
31
|
+
clipRule: "evenodd",
|
|
32
|
+
d: "M16.2856 8.31714H17.0228V9.05429C17.0228 9.28161 17.1131 9.49963 17.2738 9.66038C17.4345 9.82112 17.6526 9.91143 17.8799 9.91143C18.1072 9.91143 18.3252 9.82112 18.486 9.66038C18.6467 9.49963 18.737 9.28161 18.737 9.05429V8.31714H19.4828C19.7101 8.31714 19.9281 8.22684 20.0888 8.06609C20.2496 7.90535 20.3399 7.68733 20.3399 7.46C20.3399 7.23267 20.2496 7.01465 20.0888 6.85391C19.9281 6.69316 19.7101 6.60286 19.4828 6.60286H18.737V5.85714C18.737 5.62981 18.6467 5.4118 18.486 5.25105C18.3252 5.09031 18.1072 5 17.8799 5C17.6526 5 17.4345 5.09031 17.2738 5.25105C17.1131 5.4118 17.0228 5.62981 17.0228 5.85714V6.60286H16.2856C16.0583 6.60286 15.8403 6.69316 15.6795 6.85391C15.5188 7.01465 15.4285 7.23267 15.4285 7.46C15.4285 7.68733 15.5188 7.90535 15.6795 8.06609C15.8403 8.22684 16.0583 8.31714 16.2856 8.31714Z",
|
|
33
|
+
fill: "currentColor"
|
|
34
|
+
}));
|
|
35
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
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 = EditorHideEmojiIcon;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
function EditorHideEmojiIcon() {
|
|
13
|
+
return /*#__PURE__*/_react.default.createElement("svg", {
|
|
14
|
+
width: "24",
|
|
15
|
+
height: "24",
|
|
16
|
+
viewBox: "0 0 24 24",
|
|
17
|
+
fill: "none",
|
|
18
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
19
|
+
}, /*#__PURE__*/_react.default.createElement("rect", {
|
|
20
|
+
width: "24",
|
|
21
|
+
height: "24",
|
|
22
|
+
fill: "white",
|
|
23
|
+
fillOpacity: "0.01"
|
|
24
|
+
}), /*#__PURE__*/_react.default.createElement("path", {
|
|
25
|
+
fillRule: "evenodd",
|
|
26
|
+
clipRule: "evenodd",
|
|
27
|
+
d: "M5.84238 8.67075C5.29444 9.68427 5 10.827 5 12C5 13.8565 5.7375 15.637 7.05025 16.9497C8.36301 18.2625 10.1435 19 12 19C12.9193 19 13.8295 18.8189 14.6788 18.4672C14.9012 18.375 15.1183 18.2717 15.3292 18.1576L14.2087 17.037C13.5324 17.3347 12.7851 17.5 12 17.5C8.967 17.5 6.5 15.033 6.5 12C6.50084 11.2327 6.66182 10.4821 6.9644 9.79277L5.84238 8.67075ZM17.0371 14.2086C17.3347 13.5323 17.5 12.7851 17.5 12C17.5 8.967 15.033 6.5 12 6.5C11.2327 6.50084 10.4821 6.6618 9.79285 6.96437L8.67083 5.84234C9.68433 5.29442 10.827 5 12 5C12.9193 5 13.8295 5.18106 14.6788 5.53284C15.5281 5.88463 16.2997 6.40024 16.9497 7.05025C17.5998 7.70026 18.1154 8.47194 18.4672 9.32122C18.8189 10.1705 19 11.0807 19 12C19 12.9193 18.8189 13.8295 18.4672 14.6788C18.375 14.9012 18.2717 15.1182 18.1577 15.3292L17.0371 14.2086Z",
|
|
28
|
+
fill: "currentColor"
|
|
29
|
+
}), /*#__PURE__*/_react.default.createElement("rect", {
|
|
30
|
+
x: "4.31882",
|
|
31
|
+
y: "5.55618",
|
|
32
|
+
width: "1.75",
|
|
33
|
+
height: "19.9758",
|
|
34
|
+
rx: "0.875",
|
|
35
|
+
transform: "rotate(-45 4.31882 5.55618)",
|
|
36
|
+
fill: "currentColor"
|
|
37
|
+
}));
|
|
38
|
+
}
|
|
@@ -17,14 +17,14 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
17
17
|
|
|
18
18
|
var _button = _interopRequireDefault(require("@atlaskit/button"));
|
|
19
19
|
|
|
20
|
-
var _emoji = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/emoji"));
|
|
21
|
-
|
|
22
20
|
var _editorCommon = require("@atlaskit/editor-common");
|
|
23
21
|
|
|
24
|
-
var
|
|
22
|
+
var _emoji = require("@atlaskit/emoji");
|
|
25
23
|
|
|
26
24
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
27
25
|
|
|
26
|
+
var _EditorEmojiAddIcon = _interopRequireDefault(require("./EditorEmojiAddIcon"));
|
|
27
|
+
|
|
28
28
|
var _templateObject;
|
|
29
29
|
|
|
30
30
|
// helps adjusts position of popup
|
|
@@ -52,7 +52,7 @@ var EmojiPickerButton = function EmojiPickerButton(props) {
|
|
|
52
52
|
return null;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
55
|
+
return /*#__PURE__*/_react.default.createElement(_emoji.EmojiPicker, {
|
|
56
56
|
emojiProvider: providers.emojiProvider,
|
|
57
57
|
onSelection: updateEmoji,
|
|
58
58
|
onPickerRef: function onPickerRef() {}
|
|
@@ -94,9 +94,7 @@ var EmojiPickerButton = function EmojiPickerButton(props) {
|
|
|
94
94
|
onClick: togglePopup,
|
|
95
95
|
ref: buttonRef,
|
|
96
96
|
isSelected: props.isSelected,
|
|
97
|
-
iconBefore: /*#__PURE__*/_react.default.createElement(
|
|
98
|
-
label: "emoji"
|
|
99
|
-
})
|
|
97
|
+
iconBefore: /*#__PURE__*/_react.default.createElement(_EditorEmojiAddIcon.default, null)
|
|
100
98
|
})), renderPopup());
|
|
101
99
|
};
|
|
102
100
|
|
|
@@ -388,12 +388,13 @@ var getComponentFromKeymap = function getComponentFromKeymap(keymap) {
|
|
|
388
388
|
|
|
389
389
|
exports.getComponentFromKeymap = getComponentFromKeymap;
|
|
390
390
|
var ModalHeader = (0, _reactIntl.injectIntl)(function (_ref4) {
|
|
391
|
-
var
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
391
|
+
var formatMessage = _ref4.intl.formatMessage;
|
|
392
|
+
|
|
393
|
+
var _useModal = (0, _modalDialog.useModal)(),
|
|
394
|
+
onClose = _useModal.onClose;
|
|
395
|
+
|
|
396
|
+
return /*#__PURE__*/_react.default.createElement(_styles.Header, null, /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, messages.editorHelp), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_ToolbarButton.default // @ts-ignore
|
|
397
|
+
, {
|
|
397
398
|
onClick: onClose,
|
|
398
399
|
title: formatMessage(messages.closeHelpDialog),
|
|
399
400
|
spacing: "compact",
|
|
@@ -404,11 +405,8 @@ var ModalHeader = (0, _reactIntl.injectIntl)(function (_ref4) {
|
|
|
404
405
|
})));
|
|
405
406
|
});
|
|
406
407
|
|
|
407
|
-
var ModalFooter = function ModalFooter(
|
|
408
|
-
|
|
409
|
-
return /*#__PURE__*/_react.default.createElement(_styles.Footer, {
|
|
410
|
-
showKeyline: showKeyline
|
|
411
|
-
}, /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, (0, _extends2.default)({}, messages.helpDialogTips, {
|
|
408
|
+
var ModalFooter = function ModalFooter() {
|
|
409
|
+
return /*#__PURE__*/_react.default.createElement(_styles.Footer, null, /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, (0, _extends2.default)({}, messages.helpDialogTips, {
|
|
412
410
|
values: {
|
|
413
411
|
keyMap: getComponentFromKeymap(keymaps.openHelp)
|
|
414
412
|
}
|
|
@@ -468,12 +466,8 @@ var HelpDialog = /*#__PURE__*/function (_React$Component) {
|
|
|
468
466
|
this.formatting = getSupportedFormatting(editorView.state.schema, intl, imageEnabled, quickInsertEnabled);
|
|
469
467
|
return /*#__PURE__*/_react.default.createElement(_modalDialog.ModalTransition, null, this.props.isVisible ? /*#__PURE__*/_react.default.createElement(_modalDialog.default, {
|
|
470
468
|
width: "large",
|
|
471
|
-
onClose: this.closeDialog
|
|
472
|
-
|
|
473
|
-
Header: ModalHeader,
|
|
474
|
-
Footer: ModalFooter
|
|
475
|
-
}
|
|
476
|
-
}, /*#__PURE__*/_react.default.createElement(_styles.ContentWrapper, null, /*#__PURE__*/_react.default.createElement(_styles.Line, null), /*#__PURE__*/_react.default.createElement(_styles.Content, null, /*#__PURE__*/_react.default.createElement(_styles.ColumnLeft, null, /*#__PURE__*/_react.default.createElement(_styles.Title, null, /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, messages.keyboardShortcuts)), /*#__PURE__*/_react.default.createElement("div", null, this.formatting.filter(function (form) {
|
|
469
|
+
onClose: this.closeDialog
|
|
470
|
+
}, /*#__PURE__*/_react.default.createElement(ModalHeader, null), /*#__PURE__*/_react.default.createElement(_modalDialog.ModalBody, null, /*#__PURE__*/_react.default.createElement(_styles.ContentWrapper, null, /*#__PURE__*/_react.default.createElement(_styles.Line, null), /*#__PURE__*/_react.default.createElement(_styles.Content, null, /*#__PURE__*/_react.default.createElement(_styles.ColumnLeft, null, /*#__PURE__*/_react.default.createElement(_styles.Title, null, /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, messages.keyboardShortcuts)), /*#__PURE__*/_react.default.createElement("div", null, this.formatting.filter(function (form) {
|
|
477
471
|
var keymap = form.keymap && form.keymap(_this2.props);
|
|
478
472
|
return keymap && keymap[_editorCommon.browser.mac ? 'mac' : 'windows'];
|
|
479
473
|
}).map(function (form) {
|
|
@@ -494,7 +488,7 @@ var HelpDialog = /*#__PURE__*/function (_React$Component) {
|
|
|
494
488
|
return form.autoFormatting && /*#__PURE__*/_react.default.createElement(_styles.Row, {
|
|
495
489
|
key: "autoFormatting-".concat(form.name)
|
|
496
490
|
}, /*#__PURE__*/_react.default.createElement("span", null, form.name), form.autoFormatting());
|
|
497
|
-
})))))) : null);
|
|
491
|
+
})))))), /*#__PURE__*/_react.default.createElement(ModalFooter, null)) : null);
|
|
498
492
|
}
|
|
499
493
|
}]);
|
|
500
494
|
return HelpDialog;
|
|
@@ -25,15 +25,11 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
25
25
|
|
|
26
26
|
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; }
|
|
27
27
|
|
|
28
|
-
var Header = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n z-index: ", ";\n min-height: 24px;\n padding: 20px 40px;\n font-size: ", ";\n display: flex;\n justify-content: space-between;\n align-items: center;\n box-shadow:
|
|
29
|
-
return props.showKeyline ? "0 2px 0 ".concat(colors.N30) : 'none';
|
|
30
|
-
}, colors.N400, colors.N0, (0, _constants.borderRadius)());
|
|
28
|
+
var Header = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n z-index: ", ";\n min-height: 24px;\n padding: 20px 40px;\n font-size: ", ";\n display: flex;\n justify-content: space-between;\n align-items: center;\n box-shadow: 'none';\n color: ", ";\n background-color: ", ";\n border-radius: ", "px;\n"])), _editorSharedStyles.akEditorUnitZIndex, (0, _editorSharedStyles.relativeFontSizeToBase16)(24), colors.N400, colors.N0, (0, _constants.borderRadius)());
|
|
31
29
|
|
|
32
30
|
exports.Header = Header;
|
|
33
31
|
|
|
34
|
-
var Footer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n z-index: ", ";\n font-size: ", ";\n line-height: 20px;\n color: ", ";\n padding: 24px;\n text-align: right;\n box-shadow:
|
|
35
|
-
return props.showKeyline ? "0 -2px 0 ".concat(colors.N30) : 'none';
|
|
36
|
-
});
|
|
32
|
+
var Footer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n z-index: ", ";\n font-size: ", ";\n line-height: 20px;\n color: ", ";\n padding: 24px;\n text-align: right;\n box-shadow: 'none';\n"])), _editorSharedStyles.akEditorUnitZIndex, (0, _editorSharedStyles.relativeFontSizeToBase16)(14), colors.N300);
|
|
37
33
|
|
|
38
34
|
exports.Footer = Footer;
|
|
39
35
|
|
|
@@ -80,17 +80,11 @@ var hyperlinkPlugin = function hyperlinkPlugin(options) {
|
|
|
80
80
|
icon: function icon() {
|
|
81
81
|
return /*#__PURE__*/_react.default.createElement(_assets.IconLink, null);
|
|
82
82
|
},
|
|
83
|
-
action: function action(
|
|
84
|
-
var
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
if (!nodeBefore) {
|
|
88
|
-
return false;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
var tr = state.tr.setMeta(_main.stateKey, {
|
|
83
|
+
action: function action(insert, state) {
|
|
84
|
+
var tr = insert(undefined);
|
|
85
|
+
tr.setMeta(_main.stateKey, {
|
|
92
86
|
type: _main.LinkAction.SHOW_INSERT_TOOLBAR
|
|
93
|
-
})
|
|
87
|
+
});
|
|
94
88
|
return (0, _analytics.addAnalytics)(state, tr, {
|
|
95
89
|
action: _analytics.ACTION.INVOKED,
|
|
96
90
|
actionSubject: _analytics.ACTION_SUBJECT.TYPEAHEAD,
|
|
@@ -17,7 +17,9 @@ var _pluginKey = require("../media/pm-plugins/plugin-key");
|
|
|
17
17
|
|
|
18
18
|
var _main2 = require("../hyperlink/pm-plugins/main");
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _utils = require("../type-ahead/utils");
|
|
21
|
+
|
|
22
|
+
var _key = require("../mentions/pm-plugins/key");
|
|
21
23
|
|
|
22
24
|
var _layout = require("../layout");
|
|
23
25
|
|
|
@@ -29,12 +31,12 @@ var _WithPluginState = _interopRequireDefault(require("../../ui/WithPluginState"
|
|
|
29
31
|
|
|
30
32
|
var _ToolbarInsertBlock = _interopRequireDefault(require("./ui/ToolbarInsertBlock"));
|
|
31
33
|
|
|
34
|
+
var _key2 = require("../type-ahead/pm-plugins/key");
|
|
35
|
+
|
|
32
36
|
var _commands = require("../block-type/commands");
|
|
33
37
|
|
|
34
38
|
var _commands2 = require("../image-upload/pm-plugins/commands");
|
|
35
39
|
|
|
36
|
-
var _main3 = require("../type-ahead/pm-plugins/main");
|
|
37
|
-
|
|
38
40
|
var _analytics = require("../analytics");
|
|
39
41
|
|
|
40
42
|
var _pluginKey2 = require("../image-upload/pm-plugins/plugin-key");
|
|
@@ -92,10 +94,10 @@ var insertBlockPlugin = function insertBlockPlugin() {
|
|
|
92
94
|
var renderNode = function renderNode(providers) {
|
|
93
95
|
return /*#__PURE__*/_react.default.createElement(_WithPluginState.default, {
|
|
94
96
|
plugins: {
|
|
95
|
-
typeAheadState:
|
|
97
|
+
typeAheadState: _key2.pluginKey,
|
|
96
98
|
blockTypeState: _main.pluginKey,
|
|
97
99
|
mediaState: _pluginKey.stateKey,
|
|
98
|
-
mentionState:
|
|
100
|
+
mentionState: _key.mentionPluginKey,
|
|
99
101
|
macroState: _pluginKey5.pluginKey,
|
|
100
102
|
hyperlinkState: _main2.stateKey,
|
|
101
103
|
emojiState: _emoji.emojiPluginKey,
|
|
@@ -105,8 +107,7 @@ var insertBlockPlugin = function insertBlockPlugin() {
|
|
|
105
107
|
layoutState: _layout.pluginKey
|
|
106
108
|
},
|
|
107
109
|
render: function render(_ref2) {
|
|
108
|
-
var
|
|
109
|
-
mentionState = _ref2.mentionState,
|
|
110
|
+
var mentionState = _ref2.mentionState,
|
|
110
111
|
blockTypeState = _ref2.blockTypeState,
|
|
111
112
|
mediaState = _ref2.mediaState,
|
|
112
113
|
_ref2$macroState = _ref2.macroState,
|
|
@@ -121,7 +122,7 @@ var insertBlockPlugin = function insertBlockPlugin() {
|
|
|
121
122
|
buttons: buttons,
|
|
122
123
|
isReducedSpacing: isToolbarReducedSpacing,
|
|
123
124
|
isDisabled: disabled,
|
|
124
|
-
isTypeAheadAllowed:
|
|
125
|
+
isTypeAheadAllowed: (0, _utils.isTypeAheadAllowed)(editorView.state),
|
|
125
126
|
editorView: editorView,
|
|
126
127
|
tableSupported: options.allowTables,
|
|
127
128
|
actionSupported: !!editorView.state.schema.nodes.taskItem,
|
|
@@ -53,7 +53,7 @@ var _commands4 = require("../../../expand/commands");
|
|
|
53
53
|
|
|
54
54
|
var _commands5 = require("../../../hyperlink/commands");
|
|
55
55
|
|
|
56
|
-
var
|
|
56
|
+
var _api = require("../../../type-ahead/api");
|
|
57
57
|
|
|
58
58
|
var _actions4 = require("../../../status/actions");
|
|
59
59
|
|
|
@@ -221,7 +221,12 @@ var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
221
221
|
});
|
|
222
222
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "insertMention", function (inputMethod) {
|
|
223
223
|
var editorView = _this.props.editorView;
|
|
224
|
-
|
|
224
|
+
|
|
225
|
+
if (!editorView) {
|
|
226
|
+
return true;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
(0, _api.createTypeAheadTools)(editorView).openMention(inputMethod);
|
|
225
230
|
return true;
|
|
226
231
|
});
|
|
227
232
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "insertTable", function (inputMethod) {
|
|
@@ -239,7 +244,6 @@ var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
239
244
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "createDate", function (inputMethod) {
|
|
240
245
|
var editorView = _this.props.editorView;
|
|
241
246
|
(0, _actions.insertDate)(undefined, inputMethod)(editorView.state, editorView.dispatch);
|
|
242
|
-
(0, _actions.openDatePicker)()(editorView.state, editorView.dispatch);
|
|
243
247
|
return true;
|
|
244
248
|
});
|
|
245
249
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "createPlaceholderText", function () {
|
|
@@ -132,6 +132,11 @@ var listPlugin = function listPlugin() {
|
|
|
132
132
|
},
|
|
133
133
|
render: function render(_ref5) {
|
|
134
134
|
var listState = _ref5.listState;
|
|
135
|
+
|
|
136
|
+
if (!listState) {
|
|
137
|
+
return null;
|
|
138
|
+
}
|
|
139
|
+
|
|
135
140
|
return /*#__PURE__*/_react.default.createElement(_ToolbarLists.default, {
|
|
136
141
|
isSmall: isSmall,
|
|
137
142
|
isSeparator: true,
|
|
@@ -91,20 +91,20 @@ var insertMacroFromMacroBrowser = function insertMacroFromMacroBrowser(macroProv
|
|
|
91
91
|
tr.setSelection(_prosemirrorState.TextSelection.create(tr.doc, state.selection.anchor));
|
|
92
92
|
} // If any extension is currently selected
|
|
93
93
|
else if ((0, _prosemirrorUtils.findSelectedNodeOfType)([extension, bodiedExtension, inlineExtension])(selection)) {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
94
|
+
tr = (0, _prosemirrorUtils.replaceSelectedNode)(node)(tr); // Replacing selected node doesn't update the selection. `selection.node` still returns the old node
|
|
95
|
+
|
|
96
|
+
tr.setSelection(_prosemirrorState.NodeSelection.create(tr.doc, tr.mapping.map(state.selection.anchor)));
|
|
97
|
+
} // When we loose the selection. This usually happens when Synchrony resets or changes
|
|
98
|
+
// the selection when user is in the middle of updating an extension.
|
|
99
|
+
else if (extensionState.element) {
|
|
100
|
+
pos = view.posAtDOM(extensionState.element, -1);
|
|
101
|
+
|
|
102
|
+
if (pos > -1) {
|
|
103
|
+
tr = tr.replaceWith(pos, pos + macroNode.nodeSize, node);
|
|
104
|
+
tr.setSelection(_prosemirrorState.Selection.near(tr.doc.resolve(pos)));
|
|
105
|
+
targetSelectionSource = _extensionEvents.TARGET_SELECTION_SOURCE.HTML_ELEMENT;
|
|
106
|
+
}
|
|
107
|
+
} // Only scroll if we have anything to update, best to avoid surprise scroll
|
|
108
108
|
|
|
109
109
|
|
|
110
110
|
if (dispatch && tr.docChanged) {
|
|
@@ -258,6 +258,7 @@ var mediaPlugin = function mediaPlugin(options) {
|
|
|
258
258
|
floatingToolbar: function floatingToolbar(state, intl, providerFactory) {
|
|
259
259
|
return (0, _toolbar.floatingToolbar)(state, intl, {
|
|
260
260
|
providerFactory: providerFactory,
|
|
261
|
+
allowMediaInline: options && options.allowMediaInline,
|
|
261
262
|
allowResizing: options && options.allowResizing,
|
|
262
263
|
allowResizingInTables: options && options.allowResizingInTables,
|
|
263
264
|
allowAnnotation: options && options.allowAnnotation,
|
|
@@ -160,6 +160,7 @@ var MediaGroup = /*#__PURE__*/function (_React$Component) {
|
|
|
160
160
|
onClick: function onClick() {
|
|
161
161
|
(0, _utils.setNodeSelection)(_this.props.view, getNodePos());
|
|
162
162
|
},
|
|
163
|
+
shouldEnableDownloadButton: mediaOptions.enableDownloadButton,
|
|
163
164
|
actions: [{
|
|
164
165
|
handler: disabled ? function () {} : _this.mediaPluginState.handleMediaNodeRemoval.bind(null, undefined, getNodePos),
|
|
165
166
|
icon: /*#__PURE__*/_react.default.createElement(_close.default, {
|
|
@@ -203,7 +203,7 @@ var MediaPluginStateImplementation = /*#__PURE__*/function () {
|
|
|
203
203
|
_this.allowsUploads = !!_this.mediaProvider.uploadMediaClientConfig;
|
|
204
204
|
view = _this.view, allowsUploads = _this.allowsUploads; // make sure editable DOM node is mounted
|
|
205
205
|
|
|
206
|
-
if (!_this.destroyed && view.dom.parentNode) {
|
|
206
|
+
if (!_this.destroyed && view && view.dom.parentNode) {
|
|
207
207
|
// make PM plugin aware of the state change to update UI during 'apply' hook
|
|
208
208
|
view.dispatch(view.state.tr.setMeta(_pluginKey.stateKey, {
|
|
209
209
|
allowsUploads: allowsUploads
|
|
@@ -254,6 +254,20 @@ var MediaPluginStateImplementation = /*#__PURE__*/function () {
|
|
|
254
254
|
(0, _defineProperty2.default)(this, "getMediaOptions", function () {
|
|
255
255
|
return _this.options;
|
|
256
256
|
});
|
|
257
|
+
(0, _defineProperty2.default)(this, "isMediaSchemaNode", function (_ref3) {
|
|
258
|
+
var _this$mediaOptions;
|
|
259
|
+
|
|
260
|
+
var type = _ref3.type;
|
|
261
|
+
var _this$view$state$sche = _this.view.state.schema.nodes,
|
|
262
|
+
mediaSingle = _this$view$state$sche.mediaSingle,
|
|
263
|
+
media = _this$view$state$sche.media;
|
|
264
|
+
|
|
265
|
+
if ((_this$mediaOptions = _this.mediaOptions) !== null && _this$mediaOptions !== void 0 && _this$mediaOptions.allowMediaInline) {
|
|
266
|
+
return type === mediaSingle || type === media;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
return type === mediaSingle;
|
|
270
|
+
});
|
|
257
271
|
(0, _defineProperty2.default)(this, "hasUserAuthProvider", function () {
|
|
258
272
|
return !!_this.uploadMediaClientConfig && !!_this.uploadMediaClientConfig.userAuthProvider;
|
|
259
273
|
});
|
|
@@ -401,8 +415,8 @@ var MediaPluginStateImplementation = /*#__PURE__*/function () {
|
|
|
401
415
|
});
|
|
402
416
|
});
|
|
403
417
|
(0, _defineProperty2.default)(this, "handleMediaNodeUnmount", function (oldNode) {
|
|
404
|
-
_this.mediaNodes = _this.mediaNodes.filter(function (
|
|
405
|
-
var node =
|
|
418
|
+
_this.mediaNodes = _this.mediaNodes.filter(function (_ref4) {
|
|
419
|
+
var node = _ref4.node;
|
|
406
420
|
return oldNode !== node;
|
|
407
421
|
});
|
|
408
422
|
});
|
|
@@ -511,11 +525,9 @@ var MediaPluginStateImplementation = /*#__PURE__*/function () {
|
|
|
511
525
|
return true;
|
|
512
526
|
});
|
|
513
527
|
(0, _defineProperty2.default)(this, "selectedMediaContainerNode", function () {
|
|
514
|
-
var
|
|
515
|
-
selection = _this$view$state.selection,
|
|
516
|
-
schema = _this$view$state.schema;
|
|
528
|
+
var selection = _this.view.state.selection;
|
|
517
529
|
|
|
518
|
-
if (selection instanceof _prosemirrorState.NodeSelection && (selection.node
|
|
530
|
+
if (selection instanceof _prosemirrorState.NodeSelection && _this.isMediaSchemaNode(selection.node)) {
|
|
519
531
|
return selection.node;
|
|
520
532
|
}
|
|
521
533
|
|
|
@@ -554,9 +566,8 @@ var MediaPluginStateImplementation = /*#__PURE__*/function () {
|
|
|
554
566
|
value: function updateElement() {
|
|
555
567
|
var newElement;
|
|
556
568
|
var selectedContainer = this.selectedMediaContainerNode();
|
|
557
|
-
var mediaSingle = this.view.state.schema.nodes.mediaSingle;
|
|
558
569
|
|
|
559
|
-
if (selectedContainer && selectedContainer
|
|
570
|
+
if (selectedContainer && this.isMediaSchemaNode(selectedContainer)) {
|
|
560
571
|
newElement = this.getDomElement(this.view.domAtPos.bind(this.view));
|
|
561
572
|
}
|
|
562
573
|
|
|
@@ -567,19 +578,20 @@ var MediaPluginStateImplementation = /*#__PURE__*/function () {
|
|
|
567
578
|
}, {
|
|
568
579
|
key: "getDomElement",
|
|
569
580
|
value: function getDomElement(domAtPos) {
|
|
570
|
-
var _this$
|
|
571
|
-
|
|
572
|
-
|
|
581
|
+
var _this$mediaOptions2;
|
|
582
|
+
|
|
583
|
+
var selection = this.view.state.selection;
|
|
573
584
|
|
|
574
585
|
if (!(selection instanceof _prosemirrorState.NodeSelection)) {
|
|
575
586
|
return;
|
|
576
587
|
}
|
|
577
588
|
|
|
578
|
-
if (selection.node
|
|
589
|
+
if (!this.isMediaSchemaNode(selection.node)) {
|
|
579
590
|
return;
|
|
580
591
|
}
|
|
581
592
|
|
|
582
|
-
var
|
|
593
|
+
var position = (_this$mediaOptions2 = this.mediaOptions) !== null && _this$mediaOptions2 !== void 0 && _this$mediaOptions2.allowMediaInline ? selection.from + 1 : selection.from;
|
|
594
|
+
var node = (0, _prosemirrorUtils.findDomRefAtPos)(position, domAtPos);
|
|
583
595
|
|
|
584
596
|
if (node) {
|
|
585
597
|
if (!node.childNodes.length) {
|
|
@@ -21,7 +21,7 @@ var _mediaCard = require("@atlaskit/media-card");
|
|
|
21
21
|
|
|
22
22
|
var _templateObject;
|
|
23
23
|
|
|
24
|
-
var mediaStyles = (0, _styledComponents.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror {\n ", " & [layout='full-width'] .", ",\n & [layout='wide'] .", " {\n margin-left: 50%;\n transform: translateX(-50%);\n }\n\n & [layout^='wrap-'] + [layout^='wrap-'] {\n clear: none;\n & + p,\n & + div[class^='fabric-editor-align'],\n & + ul,\n & + ol,\n & + h1,\n & + h2,\n & + h3,\n & + h4,\n & + h5,\n & + h6 {\n clear: both !important;\n }\n & .", " {\n margin-left: 0;\n margin-right: 0;\n }\n }\n\n .mediaSingleView-content-wrap[layout^='wrap-'] {\n max-width: 100%;\n // overwrite default Prosemirror setting making it clear: both\n clear: inherit;\n }\n\n .mediaSingleView-content-wrap[layout='wrap-left'] {\n float: left;\n }\n\n .mediaSingleView-content-wrap[layout='wrap-right'] {\n float: right;\n }\n\n .mediaSingleView-content-wrap[layout='wrap-right']\n + .mediaSingleView-content-wrap[layout='wrap-left'] {\n clear: both;\n }\n\n /* Larger margins for resize handlers when at depth 0 of the document */\n & > .mediaSingleView-content-wrap {\n .richMedia-resize-handle-right {\n margin-right: -", "px;\n }\n .richMedia-resize-handle-left {\n margin-left: -", "px;\n }\n }\n }\n\n .richMedia-resize-handle-right,\n .richMedia-resize-handle-left {\n display: flex;\n flex-direction: column;\n\n /* vertical align */\n justify-content: center;\n }\n\n .richMedia-resize-handle-right {\n align-items: flex-end;\n padding-right: 12px;\n margin-right: -", "px;\n }\n\n .richMedia-resize-handle-left {\n align-items: flex-start;\n padding-left: 12px;\n margin-left: -", "px;\n }\n\n .richMedia-resize-handle-right::after,\n .richMedia-resize-handle-left::after {\n content: ' ';\n display: flex;\n width: 3px;\n height: 64px;\n\n border-radius: 6px;\n }\n\n .", ":hover .richMedia-resize-handle-left::after,\n .", ":hover .richMedia-resize-handle-right::after {\n background: ", ";\n }\n\n .", " .richMedia-resize-handle-right::after,\n .", " .richMedia-resize-handle-left::after,\n .", " .richMedia-resize-handle-right:hover::after,\n .", " .richMedia-resize-handle-left:hover::after,\n .", ".is-resizing .richMedia-resize-handle-right::after,\n .", ".is-resizing .richMedia-resize-handle-left::after {\n background: ", ";\n }\n\n .__resizable_base__ {\n left: unset !important;\n width: auto !important;\n height: auto !important;\n }\n\n /* Danger when top level node for smart cards / inline links */\n .danger > div > div > .media-card-frame,\n .danger > span > a {\n background-color: ", ";\n box-shadow: 0px 0px 0px ", "px\n ", ";\n transition: background-color 0s;\n transition: box-shadow 0s;\n }\n\n /* Danger when nested node or common */\n .danger {\n /* Media single */\n .", " .", "::after {\n border: 1px solid ", ";\n }\n /* Media single video player */\n .", " .", "::after {\n border: 1px solid ", ";\n }\n /* New file experience */\n .", " .", " {\n box-shadow: 0 0 0 1px ", " !important;\n }\n /* Media resize handlers */\n .richMedia-resize-handle-right::after,\n .richMedia-resize-handle-left::after {\n background: ", ";\n }\n\n /* Smart cards */\n div div .media-card-frame,\n .inlineCardView-content-wrap > span > a {\n background-color: rgb(255, 189, 173, 0.5); /* R75 with 50% opactiy */\n transition: background-color 0s;\n }\n\n div div .media-card-frame::after {\n box-shadow: none;\n }\n }\n"])), _editorCommon.mediaSingleSharedStyle, _editorCommon.richMediaClassName, _editorCommon.richMediaClassName, _editorCommon.richMediaClassName, _editorSharedStyles.akEditorMediaResizeHandlerPaddingWide, _editorSharedStyles.akEditorMediaResizeHandlerPaddingWide, _editorSharedStyles.akEditorMediaResizeHandlerPadding, _editorSharedStyles.akEditorMediaResizeHandlerPadding, _editorCommon.richMediaClassName, _editorCommon.richMediaClassName, _colors.N60, _editorSharedStyles.akEditorSelectedNodeClassName, _editorSharedStyles.akEditorSelectedNodeClassName, _editorCommon.richMediaClassName, _editorCommon.richMediaClassName, _editorCommon.richMediaClassName, _editorCommon.richMediaClassName, _colors.B200, _editorSharedStyles.akEditorDeleteBackground, _editorSharedStyles.akEditorSelectedBorderBoldSize, _editorSharedStyles.akEditorDeleteBorder, _editorCommon.richMediaClassName, _mediaCard.fileCardImageViewSelector, _editorSharedStyles.akEditorDeleteIconColor, _editorCommon.richMediaClassName, _mediaCard.inlinePlayerClassName, _editorSharedStyles.akEditorDeleteIconColor, _editorCommon.richMediaClassName, _mediaCard.newFileExperienceClassName, _editorSharedStyles.akEditorDeleteIconColor, _editorSharedStyles.akEditorDeleteIconColor);
|
|
24
|
+
var mediaStyles = (0, _styledComponents.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror {\n ", " & [layout='full-width'] .", ",\n & [layout='wide'] .", " {\n margin-left: 50%;\n transform: translateX(-50%);\n }\n\n & [layout^='wrap-'] + [layout^='wrap-'] {\n clear: none;\n & + p,\n & + div[class^='fabric-editor-align'],\n & + ul,\n & + ol,\n & + h1,\n & + h2,\n & + h3,\n & + h4,\n & + h5,\n & + h6 {\n clear: both !important;\n }\n & .", " {\n margin-left: 0;\n margin-right: 0;\n }\n }\n\n .mediaSingleView-content-wrap[layout^='wrap-'] {\n max-width: 100%;\n // overwrite default Prosemirror setting making it clear: both\n clear: inherit;\n }\n\n .mediaSingleView-content-wrap[layout='wrap-left'] {\n float: left;\n }\n\n .mediaSingleView-content-wrap[layout='wrap-right'] {\n float: right;\n }\n\n .mediaSingleView-content-wrap[layout='wrap-right']\n + .mediaSingleView-content-wrap[layout='wrap-left'] {\n clear: both;\n }\n\n /* Larger margins for resize handlers when at depth 0 of the document */\n & > .mediaSingleView-content-wrap {\n .richMedia-resize-handle-right {\n margin-right: -", "px;\n }\n .richMedia-resize-handle-left {\n margin-left: -", "px;\n }\n }\n }\n\n .richMedia-resize-handle-right,\n .richMedia-resize-handle-left {\n display: flex;\n flex-direction: column;\n\n /* vertical align */\n justify-content: center;\n }\n\n .richMedia-resize-handle-right {\n align-items: flex-end;\n padding-right: 12px;\n margin-right: -", "px;\n }\n\n .richMedia-resize-handle-left {\n align-items: flex-start;\n padding-left: 12px;\n margin-left: -", "px;\n }\n\n .richMedia-resize-handle-right::after,\n .richMedia-resize-handle-left::after {\n content: ' ';\n display: flex;\n width: 3px;\n height: 64px;\n\n border-radius: 6px;\n }\n\n .", ":hover .richMedia-resize-handle-left::after,\n .", ":hover .richMedia-resize-handle-right::after {\n background: ", ";\n }\n\n .", " .richMedia-resize-handle-right::after,\n .", " .richMedia-resize-handle-left::after,\n .", " .richMedia-resize-handle-right:hover::after,\n .", " .richMedia-resize-handle-left:hover::after,\n .", ".is-resizing .richMedia-resize-handle-right::after,\n .", ".is-resizing .richMedia-resize-handle-left::after {\n background: ", ";\n }\n\n .__resizable_base__ {\n left: unset !important;\n width: auto !important;\n height: auto !important;\n }\n\n /* Danger when top level node for smart cards / inline links */\n .danger > div > div > .media-card-frame,\n .danger > span > a {\n background-color: ", ";\n box-shadow: 0px 0px 0px ", "px\n ", ";\n transition: background-color 0s;\n transition: box-shadow 0s;\n }\n .mediaGroupView-content-wrap.danger {\n /* Media inline */\n .", "::after {\n border: 1px solid ", ";\n }\n }\n /* Danger when nested node or common */\n .danger {\n /* Media single */\n .", " .", "::after {\n border: 1px solid ", ";\n }\n /* Media single video player */\n .", " .", "::after {\n border: 1px solid ", ";\n }\n /* New file experience */\n .", " .", " {\n box-shadow: 0 0 0 1px ", " !important;\n }\n /* Media resize handlers */\n .richMedia-resize-handle-right::after,\n .richMedia-resize-handle-left::after {\n background: ", ";\n }\n\n /* Smart cards */\n div div .media-card-frame,\n .inlineCardView-content-wrap > span > a {\n background-color: rgb(255, 189, 173, 0.5); /* R75 with 50% opactiy */\n transition: background-color 0s;\n }\n\n div div .media-card-frame::after {\n box-shadow: none;\n }\n }\n"])), _editorCommon.mediaSingleSharedStyle, _editorCommon.richMediaClassName, _editorCommon.richMediaClassName, _editorCommon.richMediaClassName, _editorSharedStyles.akEditorMediaResizeHandlerPaddingWide, _editorSharedStyles.akEditorMediaResizeHandlerPaddingWide, _editorSharedStyles.akEditorMediaResizeHandlerPadding, _editorSharedStyles.akEditorMediaResizeHandlerPadding, _editorCommon.richMediaClassName, _editorCommon.richMediaClassName, _colors.N60, _editorSharedStyles.akEditorSelectedNodeClassName, _editorSharedStyles.akEditorSelectedNodeClassName, _editorCommon.richMediaClassName, _editorCommon.richMediaClassName, _editorCommon.richMediaClassName, _editorCommon.richMediaClassName, _colors.B200, _editorSharedStyles.akEditorDeleteBackground, _editorSharedStyles.akEditorSelectedBorderBoldSize, _editorSharedStyles.akEditorDeleteBorder, _mediaCard.fileCardImageViewSelectedSelector, _editorSharedStyles.akEditorDeleteIconColor, _editorCommon.richMediaClassName, _mediaCard.fileCardImageViewSelector, _editorSharedStyles.akEditorDeleteIconColor, _editorCommon.richMediaClassName, _mediaCard.inlinePlayerClassName, _editorSharedStyles.akEditorDeleteIconColor, _editorCommon.richMediaClassName, _mediaCard.newFileExperienceClassName, _editorSharedStyles.akEditorDeleteIconColor, _editorSharedStyles.akEditorDeleteIconColor);
|
|
25
25
|
/* `left: unset` above is to work around Chrome bug where rendering a div with
|
|
26
26
|
* that style applied inside a container that has a scroll, causes any svgs on
|
|
27
27
|
* the page, without a border, that are inside a flexbox, to no longer align to
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports.FilePreviewItem = void 0;
|
|
11
|
+
|
|
12
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
|
+
|
|
14
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
+
|
|
16
|
+
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
17
|
+
|
|
18
|
+
var _mediaViewer = require("@atlaskit/media-viewer");
|
|
19
|
+
|
|
20
|
+
var _filePreview = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/file-preview"));
|
|
21
|
+
|
|
22
|
+
var _Button = _interopRequireDefault(require("../../floating-toolbar/ui/Button"));
|
|
23
|
+
|
|
24
|
+
var _utils = require("./utils");
|
|
25
|
+
|
|
26
|
+
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); }
|
|
27
|
+
|
|
28
|
+
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; }
|
|
29
|
+
|
|
30
|
+
var FilePreviewItem = function FilePreviewItem(_ref) {
|
|
31
|
+
var mediaPluginState = _ref.mediaPluginState;
|
|
32
|
+
|
|
33
|
+
var _useState = (0, _react.useState)(false),
|
|
34
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
35
|
+
isMediaViewerVisible = _useState2[0],
|
|
36
|
+
setMediaViewerVisible = _useState2[1];
|
|
37
|
+
|
|
38
|
+
var openMediaViewer = function openMediaViewer() {
|
|
39
|
+
setMediaViewerVisible(true);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
var onMediaViewerClose = function onMediaViewerClose() {
|
|
43
|
+
setMediaViewerVisible(false);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
var renderMediaViewer = function renderMediaViewer() {
|
|
47
|
+
if (isMediaViewerVisible) {
|
|
48
|
+
var dataSource = {
|
|
49
|
+
list: []
|
|
50
|
+
};
|
|
51
|
+
var selectedNodeAttrs = (0, _utils.getSelectedMediaContainerNodeAttrs)(mediaPluginState);
|
|
52
|
+
|
|
53
|
+
if (selectedNodeAttrs && mediaPluginState.mediaClientConfig) {
|
|
54
|
+
var id = selectedNodeAttrs.id,
|
|
55
|
+
_selectedNodeAttrs$co = selectedNodeAttrs.collection,
|
|
56
|
+
collection = _selectedNodeAttrs$co === void 0 ? '' : _selectedNodeAttrs$co;
|
|
57
|
+
var identifier = {
|
|
58
|
+
id: id,
|
|
59
|
+
mediaItemType: 'file',
|
|
60
|
+
collectionName: collection
|
|
61
|
+
};
|
|
62
|
+
return /*#__PURE__*/_reactDom.default.createPortal( /*#__PURE__*/_react.default.createElement(_mediaViewer.MediaViewer, {
|
|
63
|
+
collectionName: collection,
|
|
64
|
+
dataSource: dataSource,
|
|
65
|
+
mediaClientConfig: mediaPluginState.mediaClientConfig,
|
|
66
|
+
selectedItem: identifier,
|
|
67
|
+
onClose: onMediaViewerClose
|
|
68
|
+
}), document.body);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return null;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
var mediaViewer = renderMediaViewer();
|
|
76
|
+
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
77
|
+
testId: "file-preview-toolbar-button",
|
|
78
|
+
key: "editor.media.card.preview",
|
|
79
|
+
onClick: openMediaViewer,
|
|
80
|
+
icon: /*#__PURE__*/_react.default.createElement(_filePreview.default, {
|
|
81
|
+
label: "file preview"
|
|
82
|
+
})
|
|
83
|
+
}), mediaViewer);
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
exports.FilePreviewItem = FilePreviewItem;
|