@atlaskit/editor-core 182.1.2 → 182.2.0
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 +17 -0
- package/dist/cjs/actions/index.js +90 -98
- package/dist/cjs/create-editor/ErrorBoundary.js +86 -93
- package/dist/cjs/create-editor/ReactEditorViewInternal.js +8 -6
- package/dist/cjs/editor-next/index.js +5 -6
- package/dist/cjs/editor-next/utils/sendDurationAnalytics.js +34 -37
- package/dist/cjs/editor-next/utils/trackEditorActions.js +48 -51
- package/dist/cjs/editor.js +29 -34
- package/dist/cjs/i18n/cs.js +34 -6
- package/dist/cjs/i18n/da.js +34 -6
- package/dist/cjs/i18n/de.js +34 -7
- package/dist/cjs/i18n/en.js +31 -4
- package/dist/cjs/i18n/en_GB.js +34 -7
- package/dist/cjs/i18n/en_ZZ.js +35 -8
- package/dist/cjs/i18n/es.js +33 -6
- package/dist/cjs/i18n/fi.js +33 -6
- package/dist/cjs/i18n/fr.js +34 -7
- package/dist/cjs/i18n/hu.js +33 -6
- package/dist/cjs/i18n/it.js +34 -7
- package/dist/cjs/i18n/ja.js +33 -6
- package/dist/cjs/i18n/ko.js +33 -6
- package/dist/cjs/i18n/nb.js +35 -8
- package/dist/cjs/i18n/nl.js +34 -7
- package/dist/cjs/i18n/pl.js +34 -7
- package/dist/cjs/i18n/pt_BR.js +34 -7
- package/dist/cjs/i18n/ru.js +34 -7
- package/dist/cjs/i18n/sv.js +33 -6
- package/dist/cjs/i18n/th.js +34 -7
- package/dist/cjs/i18n/tr.js +33 -6
- package/dist/cjs/i18n/uk.js +34 -7
- package/dist/cjs/i18n/vi.js +35 -8
- package/dist/cjs/i18n/zh.js +33 -4
- package/dist/cjs/i18n/zh_TW.js +33 -6
- package/dist/cjs/labs/CollapsedEditor/index.js +1 -1
- package/dist/cjs/plugins/analytics/plugin.js +1 -1
- package/dist/cjs/plugins/annotation/pm-plugins/inline-comment.js +39 -44
- package/dist/cjs/plugins/annotation/pm-plugins/types.js +4 -4
- package/dist/cjs/plugins/annotation/types.js +4 -4
- package/dist/cjs/plugins/base/pm-plugins/decoration.js +4 -4
- package/dist/cjs/plugins/block-type/commands/block-type.js +1 -1
- package/dist/cjs/plugins/card/nodeviews/embedCard.js +5 -6
- package/dist/cjs/plugins/card/ui/EditLinkToolbar.js +3 -4
- package/dist/cjs/plugins/card/ui/EditorSmartCardEventsNext.js +16 -1
- package/dist/cjs/plugins/collab-edit/index.js +29 -32
- package/dist/cjs/plugins/collab-edit/plugin-state.js +2 -4
- package/dist/cjs/plugins/custom-autoformat/doc.js +28 -31
- package/dist/cjs/plugins/custom-autoformat/index.js +20 -23
- package/dist/cjs/plugins/date/index.js +1 -1
- package/dist/cjs/plugins/date/ui/DatePicker/date-picker-input.js +7 -10
- package/dist/cjs/plugins/date/utils/internal.js +1 -1
- package/dist/cjs/plugins/emoji/pm-plugins/ascii-input-rules.js +27 -28
- package/dist/cjs/plugins/extension/actions.js +36 -39
- package/dist/cjs/plugins/extension/context-panel.js +123 -130
- package/dist/cjs/plugins/extension/pm-plugins/main.js +82 -89
- package/dist/cjs/plugins/extension/pm-plugins/utils.js +46 -51
- package/dist/cjs/plugins/extension/ui/Extension/ExtensionComponent.js +44 -48
- package/dist/cjs/plugins/feedback-dialog/index.js +52 -57
- package/dist/cjs/plugins/feedback-dialog/loadJiraCollectorDialogScript.js +44 -47
- package/dist/cjs/plugins/find-replace/actions.js +4 -4
- package/dist/cjs/plugins/find-replace/utils/batch-decorations.js +144 -153
- package/dist/cjs/plugins/find-replace/utils/index.js +2 -2
- package/dist/cjs/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +40 -46
- package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +2 -1
- package/dist/cjs/plugins/floating-toolbar/ui/ToolbarLoader.js +2 -1
- package/dist/cjs/plugins/fragment/pm-plugins/fragment-consistency.js +86 -86
- package/dist/cjs/plugins/help-dialog/ui/HelpDialogLoader.js +2 -1
- package/dist/cjs/plugins/history/actions.js +4 -4
- package/dist/cjs/plugins/hyperlink/HyperlinkToolbarAppearance.js +76 -82
- package/dist/cjs/plugins/hyperlink/pm-plugins/input-rule.js +3 -0
- package/dist/cjs/plugins/hyperlink/pm-plugins/main.js +16 -16
- package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +339 -352
- package/dist/cjs/plugins/hyperlink/utils.js +3 -0
- package/dist/cjs/plugins/image-upload/pm-plugins/main.js +24 -27
- package/dist/cjs/plugins/list/utils/node.js +4 -4
- package/dist/cjs/plugins/macro/actions.js +107 -112
- package/dist/cjs/plugins/media/nodeviews/mediaGroup.js +43 -46
- package/dist/cjs/plugins/media/nodeviews/mediaInline.js +62 -66
- package/dist/cjs/plugins/media/nodeviews/mediaNodeUpdater.js +544 -575
- package/dist/cjs/plugins/media/nodeviews/mediaNodeView/media.js +38 -42
- package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +108 -113
- package/dist/cjs/plugins/media/picker-facade.js +22 -25
- package/dist/cjs/plugins/media/pm-plugins/linking/actions.js +4 -4
- package/dist/cjs/plugins/media/pm-plugins/main.js +159 -172
- package/dist/cjs/plugins/media/pm-plugins/mediaTaskManager.js +36 -39
- package/dist/cjs/plugins/media/toolbar/utils.js +30 -33
- package/dist/cjs/plugins/media/ui/MediaPicker/PickerFacadeProvider.js +71 -74
- package/dist/cjs/plugins/media/ui/ResizableMediaSingle/index.js +52 -57
- package/dist/cjs/plugins/media/utils/check-media-type.js +37 -40
- package/dist/cjs/plugins/mentions/nodeviews/mention.js +29 -31
- package/dist/cjs/plugins/mentions/type-ahead/index.js +1 -1
- package/dist/cjs/plugins/mobile-dimensions/actions.js +4 -4
- package/dist/cjs/plugins/paste/actions.js +4 -4
- package/dist/cjs/plugins/paste/handlers.js +23 -26
- package/dist/cjs/plugins/paste/linkify-md-plugin.js +3 -0
- package/dist/cjs/plugins/paste/md.js +3 -0
- package/dist/cjs/plugins/paste/newline-md-plugin.js +3 -0
- package/dist/cjs/plugins/paste/paragraph-md-plugin.js +3 -0
- package/dist/cjs/plugins/paste/pm-plugins/main.js +25 -27
- package/dist/cjs/plugins/quick-insert/assets/index.js +63 -39
- package/dist/cjs/plugins/quick-insert/index.js +30 -33
- package/dist/cjs/plugins/selection/actions.js +4 -4
- package/dist/cjs/plugins/selection/gap-cursor/direction.js +4 -4
- package/dist/cjs/plugins/selection/types.js +4 -4
- package/dist/cjs/plugins/status/ui/statusPicker.js +7 -8
- package/dist/cjs/plugins/tasks-and-decisions/nodeviews/taskItem.js +9 -10
- package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/commands.js +16 -6
- package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/keymaps.js +12 -20
- package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/main.js +3 -3
- package/dist/cjs/plugins/tasks-and-decisions/ui/Task/task-item-with-providers.js +41 -42
- package/dist/cjs/plugins/tasks-and-decisions/utils.js +31 -2
- package/dist/cjs/plugins/text-color/pm-plugins/main.js +4 -4
- package/dist/cjs/plugins/text-formatting/pm-plugins/input-rule.js +3 -3
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/types.js +4 -4
- package/dist/cjs/plugins/type-ahead/constants.js +4 -4
- package/dist/cjs/plugins/type-ahead/pm-plugins/actions.js +4 -4
- package/dist/cjs/plugins/undo-redo/enums.js +4 -4
- package/dist/cjs/ui/Appearance/Comment/Comment.js +3 -3
- package/dist/cjs/ui/Appearance/FullPage/FullPage.js +1 -2
- package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +2 -1
- package/dist/cjs/ui/ColorPickerButton/index.js +3 -2
- package/dist/cjs/ui/ConfigPanel/ConfigPanel.js +68 -73
- package/dist/cjs/ui/ConfigPanel/ConfigPanelLoader.js +2 -1
- package/dist/cjs/ui/ConfigPanel/Fields/CustomSelect.js +54 -56
- package/dist/cjs/ui/ConfigPanel/Fields/UserSelect.js +51 -55
- package/dist/cjs/ui/ConfigPanel/FormErrorBoundary.js +24 -27
- package/dist/cjs/ui/ConfigPanel/transformers.js +344 -363
- package/dist/cjs/ui/ConfigPanel/types.js +8 -8
- package/dist/cjs/ui/Dropdown/index.js +2 -1
- package/dist/cjs/ui/DropdownMenu/index.js +2 -1
- package/dist/cjs/ui/ElementBrowser/components/ElementBrowserLoader.js +1 -1
- package/dist/cjs/ui/ElementBrowser/hooks/use-select-and-focus-on-arrow-navigation.js +4 -4
- package/dist/cjs/ui/ElementBrowser/types.js +4 -4
- package/dist/cjs/ui/LinkSearch/index.js +94 -101
- package/dist/cjs/ui/ToolbarArrowKeyNavigationProvider/index.js +19 -2
- package/dist/cjs/ui/ToolbarFeedback/index.js +27 -31
- package/dist/cjs/utils/action.js +31 -36
- package/dist/cjs/utils/clipboard.js +82 -86
- package/dist/cjs/utils/deprecation-warnings.js +1 -1
- package/dist/cjs/utils/extensions.js +62 -67
- package/dist/cjs/utils/insert.js +4 -4
- package/dist/cjs/utils/mark.js +2 -2
- package/dist/cjs/utils/performance/simple-measure-to-entries.js +1 -2
- package/dist/cjs/utils/performance/track-transactions.js +3 -2
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/actions/index.js +8 -9
- package/dist/es2019/create-editor/ReactEditorViewInternal.js +5 -3
- package/dist/es2019/editor-next/index.js +5 -6
- package/dist/es2019/editor.js +29 -36
- package/dist/es2019/i18n/cs.js +34 -6
- package/dist/es2019/i18n/da.js +34 -6
- package/dist/es2019/i18n/de.js +34 -7
- package/dist/es2019/i18n/en.js +31 -4
- package/dist/es2019/i18n/en_GB.js +34 -7
- package/dist/es2019/i18n/en_ZZ.js +35 -8
- package/dist/es2019/i18n/es.js +33 -6
- package/dist/es2019/i18n/fi.js +33 -6
- package/dist/es2019/i18n/fr.js +34 -7
- package/dist/es2019/i18n/hu.js +33 -6
- package/dist/es2019/i18n/it.js +34 -7
- package/dist/es2019/i18n/ja.js +33 -6
- package/dist/es2019/i18n/ko.js +33 -6
- package/dist/es2019/i18n/nb.js +35 -8
- package/dist/es2019/i18n/nl.js +34 -7
- package/dist/es2019/i18n/pl.js +34 -7
- package/dist/es2019/i18n/pt_BR.js +34 -7
- package/dist/es2019/i18n/ru.js +34 -7
- package/dist/es2019/i18n/sv.js +33 -6
- package/dist/es2019/i18n/th.js +34 -7
- package/dist/es2019/i18n/tr.js +33 -6
- package/dist/es2019/i18n/uk.js +34 -7
- package/dist/es2019/i18n/vi.js +35 -8
- package/dist/es2019/i18n/zh.js +33 -4
- package/dist/es2019/i18n/zh_TW.js +33 -6
- package/dist/es2019/plugins/annotation/pm-plugins/types.js +3 -3
- package/dist/es2019/plugins/annotation/types.js +3 -3
- package/dist/es2019/plugins/base/pm-plugins/decoration.js +3 -3
- package/dist/es2019/plugins/card/nodeviews/embedCard.js +5 -7
- package/dist/es2019/plugins/card/ui/EditLinkToolbar.js +3 -5
- package/dist/es2019/plugins/card/ui/EditorSmartCardEventsNext.js +17 -2
- package/dist/es2019/plugins/collab-edit/plugin-state.js +1 -2
- package/dist/es2019/plugins/date/ui/DatePicker/date-picker-input.js +7 -11
- package/dist/es2019/plugins/emoji/pm-plugins/ascii-input-rules.js +27 -28
- package/dist/es2019/plugins/extension/ui/Extension/ExtensionComponent.js +8 -12
- package/dist/es2019/plugins/find-replace/actions.js +3 -3
- package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +2 -1
- package/dist/es2019/plugins/fragment/pm-plugins/fragment-consistency.js +56 -71
- package/dist/es2019/plugins/history/actions.js +3 -3
- package/dist/es2019/plugins/hyperlink/pm-plugins/input-rule.js +3 -0
- package/dist/es2019/plugins/hyperlink/pm-plugins/main.js +6 -6
- package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +1 -2
- package/dist/es2019/plugins/hyperlink/utils.js +3 -0
- package/dist/es2019/plugins/list/utils/node.js +3 -3
- package/dist/es2019/plugins/media/nodeviews/mediaNodeUpdater.js +4 -8
- package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +2 -3
- package/dist/es2019/plugins/media/pm-plugins/linking/actions.js +3 -3
- package/dist/es2019/plugins/media/pm-plugins/main.js +22 -31
- package/dist/es2019/plugins/mobile-dimensions/actions.js +3 -3
- package/dist/es2019/plugins/paste/actions.js +3 -3
- package/dist/es2019/plugins/paste/linkify-md-plugin.js +3 -0
- package/dist/es2019/plugins/paste/md.js +3 -0
- package/dist/es2019/plugins/paste/newline-md-plugin.js +3 -0
- package/dist/es2019/plugins/paste/paragraph-md-plugin.js +3 -0
- package/dist/es2019/plugins/selection/actions.js +3 -3
- package/dist/es2019/plugins/selection/gap-cursor/direction.js +3 -3
- package/dist/es2019/plugins/selection/types.js +3 -3
- package/dist/es2019/plugins/status/ui/statusPicker.js +6 -7
- package/dist/es2019/plugins/tasks-and-decisions/nodeviews/taskItem.js +9 -11
- package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/commands.js +15 -3
- package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/keymaps.js +6 -16
- package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/main.js +3 -3
- package/dist/es2019/plugins/tasks-and-decisions/ui/Task/task-item-with-providers.js +6 -5
- package/dist/es2019/plugins/tasks-and-decisions/utils.js +30 -0
- package/dist/es2019/plugins/text-color/pm-plugins/main.js +3 -3
- package/dist/es2019/plugins/text-formatting/pm-plugins/input-rule.js +3 -3
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/types.js +3 -3
- package/dist/es2019/plugins/type-ahead/constants.js +3 -3
- package/dist/es2019/plugins/type-ahead/pm-plugins/actions.js +3 -3
- package/dist/es2019/plugins/undo-redo/enums.js +3 -3
- package/dist/es2019/ui/Appearance/Comment/Comment.js +3 -3
- package/dist/es2019/ui/Appearance/FullPage/FullPage.js +1 -2
- package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +2 -1
- package/dist/es2019/ui/ColorPickerButton/index.js +5 -3
- package/dist/es2019/ui/ConfigPanel/ConfigPanel.js +3 -4
- package/dist/es2019/ui/ConfigPanel/types.js +6 -6
- package/dist/es2019/ui/ElementBrowser/hooks/use-select-and-focus-on-arrow-navigation.js +3 -3
- package/dist/es2019/ui/ElementBrowser/types.js +3 -3
- package/dist/es2019/ui/ToolbarArrowKeyNavigationProvider/index.js +18 -2
- package/dist/es2019/ui/ToolbarFeedback/index.js +1 -3
- package/dist/es2019/utils/insert.js +3 -3
- package/dist/es2019/utils/performance/simple-measure-to-entries.js +1 -1
- package/dist/es2019/utils/performance/track-transactions.js +3 -2
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/actions/index.js +90 -98
- package/dist/esm/create-editor/ErrorBoundary.js +86 -93
- package/dist/esm/create-editor/ReactEditorViewInternal.js +6 -5
- package/dist/esm/editor-next/index.js +5 -6
- package/dist/esm/editor-next/utils/sendDurationAnalytics.js +34 -37
- package/dist/esm/editor-next/utils/trackEditorActions.js +48 -51
- package/dist/esm/editor.js +29 -34
- package/dist/esm/i18n/cs.js +34 -6
- package/dist/esm/i18n/da.js +34 -6
- package/dist/esm/i18n/de.js +34 -7
- package/dist/esm/i18n/en.js +31 -4
- package/dist/esm/i18n/en_GB.js +34 -7
- package/dist/esm/i18n/en_ZZ.js +35 -8
- package/dist/esm/i18n/es.js +33 -6
- package/dist/esm/i18n/fi.js +33 -6
- package/dist/esm/i18n/fr.js +34 -7
- package/dist/esm/i18n/hu.js +33 -6
- package/dist/esm/i18n/it.js +34 -7
- package/dist/esm/i18n/ja.js +33 -6
- package/dist/esm/i18n/ko.js +33 -6
- package/dist/esm/i18n/nb.js +35 -8
- package/dist/esm/i18n/nl.js +34 -7
- package/dist/esm/i18n/pl.js +34 -7
- package/dist/esm/i18n/pt_BR.js +34 -7
- package/dist/esm/i18n/ru.js +34 -7
- package/dist/esm/i18n/sv.js +33 -6
- package/dist/esm/i18n/th.js +34 -7
- package/dist/esm/i18n/tr.js +33 -6
- package/dist/esm/i18n/uk.js +34 -7
- package/dist/esm/i18n/vi.js +35 -8
- package/dist/esm/i18n/zh.js +33 -4
- package/dist/esm/i18n/zh_TW.js +33 -6
- package/dist/esm/plugins/analytics/plugin.js +1 -1
- package/dist/esm/plugins/annotation/pm-plugins/inline-comment.js +39 -44
- package/dist/esm/plugins/annotation/pm-plugins/types.js +3 -3
- package/dist/esm/plugins/annotation/types.js +3 -3
- package/dist/esm/plugins/base/pm-plugins/decoration.js +3 -3
- package/dist/esm/plugins/block-type/commands/block-type.js +1 -1
- package/dist/esm/plugins/card/nodeviews/embedCard.js +5 -6
- package/dist/esm/plugins/card/ui/EditLinkToolbar.js +3 -4
- package/dist/esm/plugins/card/ui/EditorSmartCardEventsNext.js +17 -2
- package/dist/esm/plugins/collab-edit/index.js +29 -32
- package/dist/esm/plugins/collab-edit/plugin-state.js +2 -4
- package/dist/esm/plugins/custom-autoformat/doc.js +28 -31
- package/dist/esm/plugins/custom-autoformat/index.js +20 -23
- package/dist/esm/plugins/date/ui/DatePicker/date-picker-input.js +7 -10
- package/dist/esm/plugins/date/utils/internal.js +1 -1
- package/dist/esm/plugins/emoji/pm-plugins/ascii-input-rules.js +27 -28
- package/dist/esm/plugins/extension/actions.js +36 -39
- package/dist/esm/plugins/extension/context-panel.js +123 -129
- package/dist/esm/plugins/extension/pm-plugins/main.js +82 -88
- package/dist/esm/plugins/extension/pm-plugins/utils.js +46 -51
- package/dist/esm/plugins/extension/ui/Extension/ExtensionComponent.js +44 -49
- package/dist/esm/plugins/feedback-dialog/index.js +52 -57
- package/dist/esm/plugins/feedback-dialog/loadJiraCollectorDialogScript.js +44 -47
- package/dist/esm/plugins/find-replace/actions.js +3 -3
- package/dist/esm/plugins/find-replace/utils/batch-decorations.js +144 -153
- package/dist/esm/plugins/find-replace/utils/index.js +2 -2
- package/dist/esm/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +40 -47
- package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +2 -1
- package/dist/esm/plugins/fragment/pm-plugins/fragment-consistency.js +78 -76
- package/dist/esm/plugins/history/actions.js +3 -3
- package/dist/esm/plugins/hyperlink/HyperlinkToolbarAppearance.js +76 -83
- package/dist/esm/plugins/hyperlink/pm-plugins/input-rule.js +3 -0
- package/dist/esm/plugins/hyperlink/pm-plugins/main.js +14 -14
- package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +339 -353
- package/dist/esm/plugins/hyperlink/utils.js +3 -0
- package/dist/esm/plugins/image-upload/pm-plugins/main.js +24 -27
- package/dist/esm/plugins/list/utils/node.js +3 -3
- package/dist/esm/plugins/macro/actions.js +107 -112
- package/dist/esm/plugins/media/nodeviews/mediaGroup.js +43 -46
- package/dist/esm/plugins/media/nodeviews/mediaInline.js +62 -67
- package/dist/esm/plugins/media/nodeviews/mediaNodeUpdater.js +544 -575
- package/dist/esm/plugins/media/nodeviews/mediaNodeView/media.js +38 -43
- package/dist/esm/plugins/media/nodeviews/mediaSingle.js +108 -114
- package/dist/esm/plugins/media/picker-facade.js +22 -25
- package/dist/esm/plugins/media/pm-plugins/linking/actions.js +3 -3
- package/dist/esm/plugins/media/pm-plugins/main.js +159 -173
- package/dist/esm/plugins/media/pm-plugins/mediaTaskManager.js +36 -39
- package/dist/esm/plugins/media/toolbar/utils.js +30 -33
- package/dist/esm/plugins/media/ui/MediaPicker/PickerFacadeProvider.js +71 -74
- package/dist/esm/plugins/media/ui/ResizableMediaSingle/index.js +52 -57
- package/dist/esm/plugins/media/utils/check-media-type.js +37 -40
- package/dist/esm/plugins/mentions/nodeviews/mention.js +29 -32
- package/dist/esm/plugins/mentions/type-ahead/index.js +1 -1
- package/dist/esm/plugins/mobile-dimensions/actions.js +3 -3
- package/dist/esm/plugins/paste/actions.js +3 -3
- package/dist/esm/plugins/paste/handlers.js +23 -26
- package/dist/esm/plugins/paste/linkify-md-plugin.js +3 -0
- package/dist/esm/plugins/paste/md.js +3 -0
- package/dist/esm/plugins/paste/newline-md-plugin.js +3 -0
- package/dist/esm/plugins/paste/paragraph-md-plugin.js +3 -0
- package/dist/esm/plugins/paste/pm-plugins/main.js +25 -28
- package/dist/esm/plugins/quick-insert/index.js +30 -33
- package/dist/esm/plugins/selection/actions.js +3 -3
- package/dist/esm/plugins/selection/gap-cursor/direction.js +3 -3
- package/dist/esm/plugins/selection/types.js +3 -3
- package/dist/esm/plugins/status/ui/statusPicker.js +6 -7
- package/dist/esm/plugins/tasks-and-decisions/nodeviews/taskItem.js +9 -10
- package/dist/esm/plugins/tasks-and-decisions/pm-plugins/commands.js +17 -7
- package/dist/esm/plugins/tasks-and-decisions/pm-plugins/keymaps.js +13 -21
- package/dist/esm/plugins/tasks-and-decisions/pm-plugins/main.js +3 -3
- package/dist/esm/plugins/tasks-and-decisions/ui/Task/task-item-with-providers.js +41 -43
- package/dist/esm/plugins/tasks-and-decisions/utils.js +28 -0
- package/dist/esm/plugins/text-color/pm-plugins/main.js +3 -3
- package/dist/esm/plugins/text-formatting/pm-plugins/input-rule.js +3 -3
- package/dist/esm/plugins/text-formatting/ui/Toolbar/types.js +3 -3
- package/dist/esm/plugins/type-ahead/constants.js +3 -3
- package/dist/esm/plugins/type-ahead/pm-plugins/actions.js +3 -3
- package/dist/esm/plugins/undo-redo/enums.js +3 -3
- package/dist/esm/ui/Appearance/Comment/Comment.js +3 -3
- package/dist/esm/ui/Appearance/FullPage/FullPage.js +1 -2
- package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +2 -1
- package/dist/esm/ui/ColorPickerButton/index.js +3 -2
- package/dist/esm/ui/ConfigPanel/ConfigPanel.js +68 -74
- package/dist/esm/ui/ConfigPanel/Fields/CustomSelect.js +54 -57
- package/dist/esm/ui/ConfigPanel/Fields/UserSelect.js +51 -56
- package/dist/esm/ui/ConfigPanel/FormErrorBoundary.js +24 -27
- package/dist/esm/ui/ConfigPanel/transformers.js +344 -362
- package/dist/esm/ui/ConfigPanel/types.js +6 -6
- package/dist/esm/ui/Dropdown/index.js +2 -1
- package/dist/esm/ui/DropdownMenu/index.js +2 -1
- package/dist/esm/ui/ElementBrowser/hooks/use-select-and-focus-on-arrow-navigation.js +3 -3
- package/dist/esm/ui/ElementBrowser/types.js +3 -3
- package/dist/esm/ui/LinkSearch/index.js +94 -101
- package/dist/esm/ui/ToolbarArrowKeyNavigationProvider/index.js +18 -2
- package/dist/esm/ui/ToolbarFeedback/index.js +27 -31
- package/dist/esm/utils/action.js +31 -36
- package/dist/esm/utils/clipboard.js +82 -87
- package/dist/esm/utils/deprecation-warnings.js +1 -1
- package/dist/esm/utils/extensions.js +62 -67
- package/dist/esm/utils/insert.js +3 -3
- package/dist/esm/utils/mark.js +2 -2
- package/dist/esm/utils/performance/simple-measure-to-entries.js +1 -2
- package/dist/esm/utils/performance/track-transactions.js +3 -2
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/create-editor/ReactEditorViewInternal.d.ts +1 -0
- package/dist/types/i18n/cs.d.ts +29 -2
- package/dist/types/i18n/da.d.ts +29 -2
- package/dist/types/i18n/de.d.ts +28 -2
- package/dist/types/i18n/en.d.ts +28 -2
- package/dist/types/i18n/en_GB.d.ts +31 -5
- package/dist/types/i18n/en_ZZ.d.ts +28 -2
- package/dist/types/i18n/es.d.ts +28 -2
- package/dist/types/i18n/fi.d.ts +28 -2
- package/dist/types/i18n/fr.d.ts +28 -2
- package/dist/types/i18n/hu.d.ts +28 -2
- package/dist/types/i18n/it.d.ts +28 -2
- package/dist/types/i18n/ja.d.ts +28 -2
- package/dist/types/i18n/ko.d.ts +28 -2
- package/dist/types/i18n/nb.d.ts +28 -2
- package/dist/types/i18n/nl.d.ts +28 -2
- package/dist/types/i18n/pl.d.ts +28 -2
- package/dist/types/i18n/pt_BR.d.ts +28 -2
- package/dist/types/i18n/ru.d.ts +28 -2
- package/dist/types/i18n/sv.d.ts +28 -2
- package/dist/types/i18n/th.d.ts +28 -2
- package/dist/types/i18n/tr.d.ts +28 -2
- package/dist/types/i18n/uk.d.ts +28 -2
- package/dist/types/i18n/vi.d.ts +28 -2
- package/dist/types/i18n/zh.d.ts +30 -2
- package/dist/types/i18n/zh_TW.d.ts +28 -2
- package/dist/types/plugins/tasks-and-decisions/utils.d.ts +2 -0
- package/dist/types/ui/ToolbarArrowKeyNavigationProvider/index.d.ts +3 -1
- package/dist/types/utils/document.d.ts +2 -2
- package/package.json +14 -14
- package/report.api.md +1 -1
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import _typeof from "@babel/runtime/helpers/typeof";
|
|
2
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
5
4
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
6
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
5
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
7
6
|
import uuidV4 from 'uuid/v4';
|
|
8
7
|
import { DEFAULT_IMAGE_HEIGHT, DEFAULT_IMAGE_WIDTH } from '@atlaskit/editor-common/ui';
|
|
9
8
|
import { getMediaClient, isMediaBlobUrl as _isMediaBlobUrl, getAttrsFromUrl, isImageRepresentationReady } from '@atlaskit/media-client';
|
|
@@ -13,62 +12,60 @@ export var MediaNodeUpdater = /*#__PURE__*/function () {
|
|
|
13
12
|
function MediaNodeUpdater(props) {
|
|
14
13
|
var _this = this;
|
|
15
14
|
_classCallCheck(this, MediaNodeUpdater);
|
|
16
|
-
|
|
15
|
+
// Updates the node with contextId if it doesn't have one already
|
|
16
|
+
// TODO [MS-2258]: remove updateContextId in order to only use updateMediaSingleFileAttrs
|
|
17
|
+
_defineProperty(this, "updateContextId", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
17
18
|
var attrs, id, objectId;
|
|
18
|
-
return _regeneratorRuntime
|
|
19
|
-
while (1) {
|
|
20
|
-
|
|
19
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
20
|
+
while (1) switch (_context.prev = _context.next) {
|
|
21
|
+
case 0:
|
|
22
|
+
attrs = _this.getAttrs();
|
|
23
|
+
if (!(!attrs || attrs.type !== 'file')) {
|
|
24
|
+
_context.next = 3;
|
|
25
|
+
break;
|
|
26
|
+
}
|
|
27
|
+
return _context.abrupt("return");
|
|
28
|
+
case 3:
|
|
29
|
+
id = attrs.id;
|
|
30
|
+
_context.next = 6;
|
|
31
|
+
return _this.getObjectId();
|
|
32
|
+
case 6:
|
|
33
|
+
objectId = _context.sent;
|
|
34
|
+
updateAllMediaSingleNodesAttrs(id, {
|
|
35
|
+
__contextId: objectId
|
|
36
|
+
})(_this.props.view.state, _this.props.view.dispatch);
|
|
37
|
+
case 8:
|
|
38
|
+
case "end":
|
|
39
|
+
return _context.stop();
|
|
40
|
+
}
|
|
41
|
+
}, _callee);
|
|
42
|
+
})));
|
|
43
|
+
_defineProperty(this, "updateNodeContextId", /*#__PURE__*/function () {
|
|
44
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(getPos) {
|
|
45
|
+
var attrs, objectId;
|
|
46
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
47
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
21
48
|
case 0:
|
|
22
49
|
attrs = _this.getAttrs();
|
|
23
|
-
if (!(
|
|
24
|
-
|
|
50
|
+
if (!((attrs === null || attrs === void 0 ? void 0 : attrs.type) !== 'file')) {
|
|
51
|
+
_context2.next = 3;
|
|
25
52
|
break;
|
|
26
53
|
}
|
|
27
|
-
return
|
|
54
|
+
return _context2.abrupt("return");
|
|
28
55
|
case 3:
|
|
29
|
-
|
|
30
|
-
_context.next = 6;
|
|
56
|
+
_context2.next = 5;
|
|
31
57
|
return _this.getObjectId();
|
|
32
|
-
case
|
|
33
|
-
objectId =
|
|
34
|
-
|
|
58
|
+
case 5:
|
|
59
|
+
objectId = _context2.sent;
|
|
60
|
+
updateCurrentMediaNodeAttrs({
|
|
35
61
|
__contextId: objectId
|
|
62
|
+
}, {
|
|
63
|
+
node: _this.props.node,
|
|
64
|
+
getPos: getPos
|
|
36
65
|
})(_this.props.view.state, _this.props.view.dispatch);
|
|
37
|
-
case
|
|
66
|
+
case 7:
|
|
38
67
|
case "end":
|
|
39
|
-
return
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}, _callee);
|
|
43
|
-
})));
|
|
44
|
-
_defineProperty(this, "updateNodeContextId", /*#__PURE__*/function () {
|
|
45
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(getPos) {
|
|
46
|
-
var attrs, objectId;
|
|
47
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
48
|
-
while (1) {
|
|
49
|
-
switch (_context2.prev = _context2.next) {
|
|
50
|
-
case 0:
|
|
51
|
-
attrs = _this.getAttrs();
|
|
52
|
-
if (!((attrs === null || attrs === void 0 ? void 0 : attrs.type) !== 'file')) {
|
|
53
|
-
_context2.next = 3;
|
|
54
|
-
break;
|
|
55
|
-
}
|
|
56
|
-
return _context2.abrupt("return");
|
|
57
|
-
case 3:
|
|
58
|
-
_context2.next = 5;
|
|
59
|
-
return _this.getObjectId();
|
|
60
|
-
case 5:
|
|
61
|
-
objectId = _context2.sent;
|
|
62
|
-
updateCurrentMediaNodeAttrs({
|
|
63
|
-
__contextId: objectId
|
|
64
|
-
}, {
|
|
65
|
-
node: _this.props.node,
|
|
66
|
-
getPos: getPos
|
|
67
|
-
})(_this.props.view.state, _this.props.view.dispatch);
|
|
68
|
-
case 7:
|
|
69
|
-
case "end":
|
|
70
|
-
return _context2.stop();
|
|
71
|
-
}
|
|
68
|
+
return _context2.stop();
|
|
72
69
|
}
|
|
73
70
|
}, _callee2);
|
|
74
71
|
}));
|
|
@@ -79,120 +76,114 @@ export var MediaNodeUpdater = /*#__PURE__*/function () {
|
|
|
79
76
|
_defineProperty(this, "hasFileAttributesDefined", function (attrs) {
|
|
80
77
|
return attrs && attrs.type === 'file' && attrs.__fileName && attrs.__fileMimeType && attrs.__fileSize && attrs.__contextId;
|
|
81
78
|
});
|
|
82
|
-
_defineProperty(this, "getNewFileAttrsForNode", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime
|
|
79
|
+
_defineProperty(this, "getNewFileAttrsForNode", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
83
80
|
var attrs, mediaProvider, mediaClientConfig, mediaClient, fileState, id, collectionName, contextId, _fileState, name, mimeType, size, newAttrs;
|
|
84
|
-
return _regeneratorRuntime
|
|
85
|
-
while (1) {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
_context3.next = 6;
|
|
95
|
-
break;
|
|
96
|
-
}
|
|
97
|
-
return _context3.abrupt("return");
|
|
98
|
-
case 6:
|
|
99
|
-
mediaClientConfig = mediaProvider.viewMediaClientConfig;
|
|
100
|
-
mediaClient = getMediaClient(mediaClientConfig);
|
|
101
|
-
id = attrs.id, collectionName = attrs.collection;
|
|
102
|
-
_context3.prev = 9;
|
|
103
|
-
_context3.next = 12;
|
|
104
|
-
return mediaClient.file.getCurrentState(id, {
|
|
105
|
-
collectionName: collectionName
|
|
106
|
-
});
|
|
107
|
-
case 12:
|
|
108
|
-
fileState = _context3.sent;
|
|
109
|
-
if (!(fileState.status === 'error')) {
|
|
110
|
-
_context3.next = 15;
|
|
111
|
-
break;
|
|
112
|
-
}
|
|
113
|
-
return _context3.abrupt("return");
|
|
114
|
-
case 15:
|
|
115
|
-
_context3.next = 20;
|
|
81
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
82
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
83
|
+
case 0:
|
|
84
|
+
attrs = _this.getAttrs();
|
|
85
|
+
_context3.next = 3;
|
|
86
|
+
return _this.props.mediaProvider;
|
|
87
|
+
case 3:
|
|
88
|
+
mediaProvider = _context3.sent;
|
|
89
|
+
if (!(!mediaProvider || !mediaProvider.uploadParams || !attrs || attrs.type !== 'file' || _this.hasFileAttributesDefined(attrs))) {
|
|
90
|
+
_context3.next = 6;
|
|
116
91
|
break;
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
92
|
+
}
|
|
93
|
+
return _context3.abrupt("return");
|
|
94
|
+
case 6:
|
|
95
|
+
mediaClientConfig = mediaProvider.viewMediaClientConfig;
|
|
96
|
+
mediaClient = getMediaClient(mediaClientConfig);
|
|
97
|
+
id = attrs.id, collectionName = attrs.collection;
|
|
98
|
+
_context3.prev = 9;
|
|
99
|
+
_context3.next = 12;
|
|
100
|
+
return mediaClient.file.getCurrentState(id, {
|
|
101
|
+
collectionName: collectionName
|
|
102
|
+
});
|
|
103
|
+
case 12:
|
|
104
|
+
fileState = _context3.sent;
|
|
105
|
+
if (!(fileState.status === 'error')) {
|
|
106
|
+
_context3.next = 15;
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
return _context3.abrupt("return");
|
|
110
|
+
case 15:
|
|
111
|
+
_context3.next = 20;
|
|
112
|
+
break;
|
|
113
|
+
case 17:
|
|
114
|
+
_context3.prev = 17;
|
|
115
|
+
_context3.t0 = _context3["catch"](9);
|
|
116
|
+
return _context3.abrupt("return");
|
|
117
|
+
case 20:
|
|
118
|
+
_context3.t1 = _this.getNodeContextId();
|
|
119
|
+
if (_context3.t1) {
|
|
120
|
+
_context3.next = 25;
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
123
|
+
_context3.next = 24;
|
|
124
|
+
return _this.getObjectId();
|
|
125
|
+
case 24:
|
|
126
|
+
_context3.t1 = _context3.sent;
|
|
127
|
+
case 25:
|
|
128
|
+
contextId = _context3.t1;
|
|
129
|
+
_fileState = fileState, name = _fileState.name, mimeType = _fileState.mimeType, size = _fileState.size;
|
|
130
|
+
newAttrs = {
|
|
131
|
+
__fileName: name,
|
|
132
|
+
__fileMimeType: mimeType,
|
|
133
|
+
__fileSize: size,
|
|
134
|
+
__contextId: contextId
|
|
135
|
+
};
|
|
136
|
+
if (hasPrivateAttrsChanged(attrs, newAttrs)) {
|
|
137
|
+
_context3.next = 30;
|
|
138
|
+
break;
|
|
139
|
+
}
|
|
140
|
+
return _context3.abrupt("return");
|
|
141
|
+
case 30:
|
|
142
|
+
return _context3.abrupt("return", newAttrs);
|
|
143
|
+
case 31:
|
|
144
|
+
case "end":
|
|
145
|
+
return _context3.stop();
|
|
151
146
|
}
|
|
152
147
|
}, _callee3, null, [[9, 17]]);
|
|
153
148
|
})));
|
|
154
|
-
_defineProperty(this, "updateMediaSingleFileAttrs", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime
|
|
149
|
+
_defineProperty(this, "updateMediaSingleFileAttrs", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
155
150
|
var newAttrs, _ref5, id;
|
|
156
|
-
return _regeneratorRuntime
|
|
157
|
-
while (1) {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
return _context4.stop();
|
|
171
|
-
}
|
|
151
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
152
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
153
|
+
case 0:
|
|
154
|
+
_context4.next = 2;
|
|
155
|
+
return _this.getNewFileAttrsForNode();
|
|
156
|
+
case 2:
|
|
157
|
+
newAttrs = _context4.sent;
|
|
158
|
+
_ref5 = _this.getAttrs(), id = _ref5.id;
|
|
159
|
+
if (id && newAttrs) {
|
|
160
|
+
updateAllMediaSingleNodesAttrs(id, newAttrs)(_this.props.view.state, _this.props.view.dispatch);
|
|
161
|
+
}
|
|
162
|
+
case 5:
|
|
163
|
+
case "end":
|
|
164
|
+
return _context4.stop();
|
|
172
165
|
}
|
|
173
166
|
}, _callee4);
|
|
174
167
|
})));
|
|
175
168
|
_defineProperty(this, "updateNodeAttrs", /*#__PURE__*/function () {
|
|
176
|
-
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime
|
|
169
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(getPos) {
|
|
177
170
|
var newAttrs;
|
|
178
|
-
return _regeneratorRuntime
|
|
179
|
-
while (1) {
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
return _context5.stop();
|
|
195
|
-
}
|
|
171
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
172
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
173
|
+
case 0:
|
|
174
|
+
_context5.next = 2;
|
|
175
|
+
return _this.getNewFileAttrsForNode();
|
|
176
|
+
case 2:
|
|
177
|
+
newAttrs = _context5.sent;
|
|
178
|
+
if (newAttrs) {
|
|
179
|
+
updateCurrentMediaNodeAttrs(newAttrs, {
|
|
180
|
+
node: _this.props.node,
|
|
181
|
+
getPos: getPos
|
|
182
|
+
})(_this.props.view.state, _this.props.view.dispatch);
|
|
183
|
+
}
|
|
184
|
+
case 4:
|
|
185
|
+
case "end":
|
|
186
|
+
return _context5.stop();
|
|
196
187
|
}
|
|
197
188
|
}, _callee5);
|
|
198
189
|
}));
|
|
@@ -207,79 +198,75 @@ export var MediaNodeUpdater = /*#__PURE__*/function () {
|
|
|
207
198
|
}
|
|
208
199
|
return undefined;
|
|
209
200
|
});
|
|
210
|
-
_defineProperty(this, "getObjectId", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime
|
|
201
|
+
_defineProperty(this, "getObjectId", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
|
|
211
202
|
var contextIdentifierProvider;
|
|
212
|
-
return _regeneratorRuntime
|
|
213
|
-
while (1) {
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
return _context6.stop();
|
|
224
|
-
}
|
|
203
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
204
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
205
|
+
case 0:
|
|
206
|
+
_context6.next = 2;
|
|
207
|
+
return _this.props.contextIdentifierProvider;
|
|
208
|
+
case 2:
|
|
209
|
+
contextIdentifierProvider = _context6.sent;
|
|
210
|
+
return _context6.abrupt("return", (contextIdentifierProvider === null || contextIdentifierProvider === void 0 ? void 0 : contextIdentifierProvider.objectId) || null);
|
|
211
|
+
case 4:
|
|
212
|
+
case "end":
|
|
213
|
+
return _context6.stop();
|
|
225
214
|
}
|
|
226
215
|
}, _callee6);
|
|
227
216
|
})));
|
|
228
217
|
_defineProperty(this, "uploadExternalMedia", /*#__PURE__*/function () {
|
|
229
|
-
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime
|
|
218
|
+
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(getPos) {
|
|
230
219
|
var node, mediaProvider, uploadMediaClientConfig, mediaClient, collection, uploader, uploadableFileUpfrontIds, dimensions;
|
|
231
|
-
return _regeneratorRuntime
|
|
232
|
-
while (1) {
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
if (!(node && mediaProvider)) {
|
|
241
|
-
_context7.next = 21;
|
|
242
|
-
break;
|
|
243
|
-
}
|
|
244
|
-
uploadMediaClientConfig = mediaProvider.uploadMediaClientConfig;
|
|
245
|
-
if (!(!uploadMediaClientConfig || !node.attrs.url)) {
|
|
246
|
-
_context7.next = 8;
|
|
247
|
-
break;
|
|
248
|
-
}
|
|
249
|
-
return _context7.abrupt("return");
|
|
250
|
-
case 8:
|
|
251
|
-
mediaClient = getMediaClient(uploadMediaClientConfig);
|
|
252
|
-
collection = mediaProvider.uploadParams && mediaProvider.uploadParams.collection;
|
|
253
|
-
_context7.prev = 10;
|
|
254
|
-
_context7.next = 13;
|
|
255
|
-
return mediaClient.file.uploadExternal(node.attrs.url, collection);
|
|
256
|
-
case 13:
|
|
257
|
-
uploader = _context7.sent;
|
|
258
|
-
uploadableFileUpfrontIds = uploader.uploadableFileUpfrontIds, dimensions = uploader.dimensions;
|
|
259
|
-
replaceExternalMedia(getPos() + 1, {
|
|
260
|
-
id: uploadableFileUpfrontIds.id,
|
|
261
|
-
collection: collection,
|
|
262
|
-
height: dimensions.height,
|
|
263
|
-
width: dimensions.width,
|
|
264
|
-
occurrenceKey: uploadableFileUpfrontIds.occurrenceKey
|
|
265
|
-
})(_this.props.view.state, _this.props.view.dispatch);
|
|
220
|
+
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
221
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
222
|
+
case 0:
|
|
223
|
+
node = _this.props.node;
|
|
224
|
+
_context7.next = 3;
|
|
225
|
+
return _this.props.mediaProvider;
|
|
226
|
+
case 3:
|
|
227
|
+
mediaProvider = _context7.sent;
|
|
228
|
+
if (!(node && mediaProvider)) {
|
|
266
229
|
_context7.next = 21;
|
|
267
230
|
break;
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
231
|
+
}
|
|
232
|
+
uploadMediaClientConfig = mediaProvider.uploadMediaClientConfig;
|
|
233
|
+
if (!(!uploadMediaClientConfig || !node.attrs.url)) {
|
|
234
|
+
_context7.next = 8;
|
|
235
|
+
break;
|
|
236
|
+
}
|
|
237
|
+
return _context7.abrupt("return");
|
|
238
|
+
case 8:
|
|
239
|
+
mediaClient = getMediaClient(uploadMediaClientConfig);
|
|
240
|
+
collection = mediaProvider.uploadParams && mediaProvider.uploadParams.collection;
|
|
241
|
+
_context7.prev = 10;
|
|
242
|
+
_context7.next = 13;
|
|
243
|
+
return mediaClient.file.uploadExternal(node.attrs.url, collection);
|
|
244
|
+
case 13:
|
|
245
|
+
uploader = _context7.sent;
|
|
246
|
+
uploadableFileUpfrontIds = uploader.uploadableFileUpfrontIds, dimensions = uploader.dimensions;
|
|
247
|
+
replaceExternalMedia(getPos() + 1, {
|
|
248
|
+
id: uploadableFileUpfrontIds.id,
|
|
249
|
+
collection: collection,
|
|
250
|
+
height: dimensions.height,
|
|
251
|
+
width: dimensions.width,
|
|
252
|
+
occurrenceKey: uploadableFileUpfrontIds.occurrenceKey
|
|
253
|
+
})(_this.props.view.state, _this.props.view.dispatch);
|
|
254
|
+
_context7.next = 21;
|
|
255
|
+
break;
|
|
256
|
+
case 18:
|
|
257
|
+
_context7.prev = 18;
|
|
258
|
+
_context7.t0 = _context7["catch"](10);
|
|
259
|
+
//keep it as external media
|
|
260
|
+
if (_this.props.dispatchAnalyticsEvent) {
|
|
261
|
+
_this.props.dispatchAnalyticsEvent({
|
|
262
|
+
action: ACTION.UPLOAD_EXTERNAL_FAIL,
|
|
263
|
+
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
264
|
+
eventType: EVENT_TYPE.OPERATIONAL
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
case 21:
|
|
268
|
+
case "end":
|
|
269
|
+
return _context7.stop();
|
|
283
270
|
}
|
|
284
271
|
}, _callee7, null, [[10, 18]]);
|
|
285
272
|
}));
|
|
@@ -300,156 +287,150 @@ export var MediaNodeUpdater = /*#__PURE__*/function () {
|
|
|
300
287
|
width: dimensions.width
|
|
301
288
|
})(_this.props.view.state, _this.props.view.dispatch);
|
|
302
289
|
});
|
|
303
|
-
_defineProperty(this, "hasDifferentContextId", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime
|
|
290
|
+
_defineProperty(this, "hasDifferentContextId", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
|
|
304
291
|
var nodeContextId, currentContextId;
|
|
305
|
-
return _regeneratorRuntime
|
|
306
|
-
while (1) {
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
return _context8.stop();
|
|
324
|
-
}
|
|
292
|
+
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
293
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
294
|
+
case 0:
|
|
295
|
+
nodeContextId = _this.getNodeContextId();
|
|
296
|
+
_context8.next = 3;
|
|
297
|
+
return _this.getObjectId();
|
|
298
|
+
case 3:
|
|
299
|
+
currentContextId = _context8.sent;
|
|
300
|
+
if (!(nodeContextId && currentContextId && nodeContextId !== currentContextId)) {
|
|
301
|
+
_context8.next = 6;
|
|
302
|
+
break;
|
|
303
|
+
}
|
|
304
|
+
return _context8.abrupt("return", true);
|
|
305
|
+
case 6:
|
|
306
|
+
return _context8.abrupt("return", false);
|
|
307
|
+
case 7:
|
|
308
|
+
case "end":
|
|
309
|
+
return _context8.stop();
|
|
325
310
|
}
|
|
326
311
|
}, _callee8);
|
|
327
312
|
})));
|
|
328
|
-
_defineProperty(this, "isNodeFromDifferentCollection", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime
|
|
313
|
+
_defineProperty(this, "isNodeFromDifferentCollection", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9() {
|
|
329
314
|
var mediaProvider, currentCollectionName, attrs, nodeCollection, __contextId, contextId;
|
|
330
|
-
return _regeneratorRuntime
|
|
331
|
-
while (1) {
|
|
332
|
-
|
|
315
|
+
return _regeneratorRuntime.wrap(function _callee9$(_context9) {
|
|
316
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
317
|
+
case 0:
|
|
318
|
+
_context9.next = 2;
|
|
319
|
+
return _this.props.mediaProvider;
|
|
320
|
+
case 2:
|
|
321
|
+
mediaProvider = _context9.sent;
|
|
322
|
+
if (!(!mediaProvider || !mediaProvider.uploadParams)) {
|
|
323
|
+
_context9.next = 5;
|
|
324
|
+
break;
|
|
325
|
+
}
|
|
326
|
+
return _context9.abrupt("return", false);
|
|
327
|
+
case 5:
|
|
328
|
+
currentCollectionName = mediaProvider.uploadParams.collection;
|
|
329
|
+
attrs = _this.getAttrs();
|
|
330
|
+
if (!(!attrs || attrs.type !== 'file')) {
|
|
331
|
+
_context9.next = 9;
|
|
332
|
+
break;
|
|
333
|
+
}
|
|
334
|
+
return _context9.abrupt("return", false);
|
|
335
|
+
case 9:
|
|
336
|
+
nodeCollection = attrs.collection, __contextId = attrs.__contextId;
|
|
337
|
+
_context9.t0 = __contextId;
|
|
338
|
+
if (_context9.t0) {
|
|
339
|
+
_context9.next = 15;
|
|
340
|
+
break;
|
|
341
|
+
}
|
|
342
|
+
_context9.next = 14;
|
|
343
|
+
return _this.getObjectId();
|
|
344
|
+
case 14:
|
|
345
|
+
_context9.t0 = _context9.sent;
|
|
346
|
+
case 15:
|
|
347
|
+
contextId = _context9.t0;
|
|
348
|
+
if (!(contextId && currentCollectionName !== nodeCollection)) {
|
|
349
|
+
_context9.next = 18;
|
|
350
|
+
break;
|
|
351
|
+
}
|
|
352
|
+
return _context9.abrupt("return", true);
|
|
353
|
+
case 18:
|
|
354
|
+
return _context9.abrupt("return", false);
|
|
355
|
+
case 19:
|
|
356
|
+
case "end":
|
|
357
|
+
return _context9.stop();
|
|
358
|
+
}
|
|
359
|
+
}, _callee9);
|
|
360
|
+
})));
|
|
361
|
+
_defineProperty(this, "copyNodeFromBlobUrl", /*#__PURE__*/function () {
|
|
362
|
+
var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(getPos) {
|
|
363
|
+
var attrs, url, mediaAttrs, mediaProvider, currentCollectionName, contextId, id, collection, height, width, mimeType, name, size, uploadMediaClientConfig, mediaClient, auth, source, destination, mediaFile;
|
|
364
|
+
return _regeneratorRuntime.wrap(function _callee10$(_context10) {
|
|
365
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
333
366
|
case 0:
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
mediaProvider = _context9.sent;
|
|
338
|
-
if (!(!mediaProvider || !mediaProvider.uploadParams)) {
|
|
339
|
-
_context9.next = 5;
|
|
367
|
+
attrs = _this.getAttrs();
|
|
368
|
+
if (!(!attrs || attrs.type !== 'external')) {
|
|
369
|
+
_context10.next = 3;
|
|
340
370
|
break;
|
|
341
371
|
}
|
|
342
|
-
return
|
|
343
|
-
case
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
if (
|
|
347
|
-
|
|
372
|
+
return _context10.abrupt("return");
|
|
373
|
+
case 3:
|
|
374
|
+
url = attrs.url;
|
|
375
|
+
mediaAttrs = getAttrsFromUrl(url);
|
|
376
|
+
if (mediaAttrs) {
|
|
377
|
+
_context10.next = 7;
|
|
348
378
|
break;
|
|
349
379
|
}
|
|
350
|
-
return
|
|
380
|
+
return _context10.abrupt("return");
|
|
381
|
+
case 7:
|
|
382
|
+
_context10.next = 9;
|
|
383
|
+
return _this.props.mediaProvider;
|
|
351
384
|
case 9:
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
_context9.next = 15;
|
|
385
|
+
mediaProvider = _context10.sent;
|
|
386
|
+
if (!(!mediaProvider || !mediaProvider.uploadParams)) {
|
|
387
|
+
_context10.next = 12;
|
|
356
388
|
break;
|
|
357
389
|
}
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
_context9.next = 18;
|
|
390
|
+
return _context10.abrupt("return");
|
|
391
|
+
case 12:
|
|
392
|
+
currentCollectionName = mediaProvider.uploadParams.collection;
|
|
393
|
+
contextId = mediaAttrs.contextId, id = mediaAttrs.id, collection = mediaAttrs.collection, height = mediaAttrs.height, width = mediaAttrs.width, mimeType = mediaAttrs.mimeType, name = mediaAttrs.name, size = mediaAttrs.size;
|
|
394
|
+
uploadMediaClientConfig = mediaProvider.uploadMediaClientConfig;
|
|
395
|
+
if (!(!uploadMediaClientConfig || !uploadMediaClientConfig.getAuthFromContext)) {
|
|
396
|
+
_context10.next = 17;
|
|
366
397
|
break;
|
|
367
398
|
}
|
|
368
|
-
return
|
|
369
|
-
case
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
var attrs, url, mediaAttrs, mediaProvider, currentCollectionName, contextId, id, collection, height, width, mimeType, name, size, uploadMediaClientConfig, mediaClient, auth, source, destination, mediaFile;
|
|
381
|
-
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
382
|
-
while (1) {
|
|
383
|
-
switch (_context10.prev = _context10.next) {
|
|
384
|
-
case 0:
|
|
385
|
-
attrs = _this.getAttrs();
|
|
386
|
-
if (!(!attrs || attrs.type !== 'external')) {
|
|
387
|
-
_context10.next = 3;
|
|
388
|
-
break;
|
|
389
|
-
}
|
|
390
|
-
return _context10.abrupt("return");
|
|
391
|
-
case 3:
|
|
392
|
-
url = attrs.url;
|
|
393
|
-
mediaAttrs = getAttrsFromUrl(url);
|
|
394
|
-
if (mediaAttrs) {
|
|
395
|
-
_context10.next = 7;
|
|
396
|
-
break;
|
|
397
|
-
}
|
|
398
|
-
return _context10.abrupt("return");
|
|
399
|
-
case 7:
|
|
400
|
-
_context10.next = 9;
|
|
401
|
-
return _this.props.mediaProvider;
|
|
402
|
-
case 9:
|
|
403
|
-
mediaProvider = _context10.sent;
|
|
404
|
-
if (!(!mediaProvider || !mediaProvider.uploadParams)) {
|
|
405
|
-
_context10.next = 12;
|
|
406
|
-
break;
|
|
407
|
-
}
|
|
408
|
-
return _context10.abrupt("return");
|
|
409
|
-
case 12:
|
|
410
|
-
currentCollectionName = mediaProvider.uploadParams.collection;
|
|
411
|
-
contextId = mediaAttrs.contextId, id = mediaAttrs.id, collection = mediaAttrs.collection, height = mediaAttrs.height, width = mediaAttrs.width, mimeType = mediaAttrs.mimeType, name = mediaAttrs.name, size = mediaAttrs.size;
|
|
412
|
-
uploadMediaClientConfig = mediaProvider.uploadMediaClientConfig;
|
|
413
|
-
if (!(!uploadMediaClientConfig || !uploadMediaClientConfig.getAuthFromContext)) {
|
|
414
|
-
_context10.next = 17;
|
|
415
|
-
break;
|
|
399
|
+
return _context10.abrupt("return");
|
|
400
|
+
case 17:
|
|
401
|
+
mediaClient = getMediaClient(uploadMediaClientConfig);
|
|
402
|
+
_context10.next = 20;
|
|
403
|
+
return uploadMediaClientConfig.getAuthFromContext(contextId);
|
|
404
|
+
case 20:
|
|
405
|
+
auth = _context10.sent;
|
|
406
|
+
source = {
|
|
407
|
+
id: id,
|
|
408
|
+
collection: collection,
|
|
409
|
+
authProvider: function authProvider() {
|
|
410
|
+
return Promise.resolve(auth);
|
|
416
411
|
}
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
mediaFile = _context10.sent;
|
|
440
|
-
replaceExternalMedia(getPos() + 1, {
|
|
441
|
-
id: mediaFile.id,
|
|
442
|
-
collection: currentCollectionName,
|
|
443
|
-
height: height,
|
|
444
|
-
width: width,
|
|
445
|
-
__fileName: name,
|
|
446
|
-
__fileMimeType: mimeType,
|
|
447
|
-
__fileSize: size
|
|
448
|
-
})(_this.props.view.state, _this.props.view.dispatch);
|
|
449
|
-
case 27:
|
|
450
|
-
case "end":
|
|
451
|
-
return _context10.stop();
|
|
452
|
-
}
|
|
412
|
+
};
|
|
413
|
+
destination = {
|
|
414
|
+
collection: currentCollectionName,
|
|
415
|
+
authProvider: uploadMediaClientConfig.authProvider,
|
|
416
|
+
occurrenceKey: uuidV4()
|
|
417
|
+
};
|
|
418
|
+
_context10.next = 25;
|
|
419
|
+
return mediaClient.file.copyFile(source, destination);
|
|
420
|
+
case 25:
|
|
421
|
+
mediaFile = _context10.sent;
|
|
422
|
+
replaceExternalMedia(getPos() + 1, {
|
|
423
|
+
id: mediaFile.id,
|
|
424
|
+
collection: currentCollectionName,
|
|
425
|
+
height: height,
|
|
426
|
+
width: width,
|
|
427
|
+
__fileName: name,
|
|
428
|
+
__fileMimeType: mimeType,
|
|
429
|
+
__fileSize: size
|
|
430
|
+
})(_this.props.view.state, _this.props.view.dispatch);
|
|
431
|
+
case 27:
|
|
432
|
+
case "end":
|
|
433
|
+
return _context10.stop();
|
|
453
434
|
}
|
|
454
435
|
}, _callee10);
|
|
455
436
|
}));
|
|
@@ -457,38 +438,37 @@ export var MediaNodeUpdater = /*#__PURE__*/function () {
|
|
|
457
438
|
return _ref11.apply(this, arguments);
|
|
458
439
|
};
|
|
459
440
|
}());
|
|
441
|
+
// Copies the pasted node into the current collection using a getPos handler
|
|
460
442
|
_defineProperty(this, "copyNodeFromPos", /*#__PURE__*/function () {
|
|
461
|
-
var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime
|
|
443
|
+
var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(getPos, traceContext) {
|
|
462
444
|
var attrs, copiedAttrs;
|
|
463
|
-
return _regeneratorRuntime
|
|
464
|
-
while (1) {
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
return _context11.stop();
|
|
491
|
-
}
|
|
445
|
+
return _regeneratorRuntime.wrap(function _callee11$(_context11) {
|
|
446
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
447
|
+
case 0:
|
|
448
|
+
attrs = _this.getAttrs();
|
|
449
|
+
if (!((attrs === null || attrs === void 0 ? void 0 : attrs.type) !== 'file')) {
|
|
450
|
+
_context11.next = 3;
|
|
451
|
+
break;
|
|
452
|
+
}
|
|
453
|
+
return _context11.abrupt("return");
|
|
454
|
+
case 3:
|
|
455
|
+
_context11.next = 5;
|
|
456
|
+
return _this.copyFile(attrs.id, attrs.collection, traceContext);
|
|
457
|
+
case 5:
|
|
458
|
+
copiedAttrs = _context11.sent;
|
|
459
|
+
if (copiedAttrs) {
|
|
460
|
+
_context11.next = 8;
|
|
461
|
+
break;
|
|
462
|
+
}
|
|
463
|
+
return _context11.abrupt("return");
|
|
464
|
+
case 8:
|
|
465
|
+
updateCurrentMediaNodeAttrs(copiedAttrs, {
|
|
466
|
+
node: _this.props.node,
|
|
467
|
+
getPos: getPos
|
|
468
|
+
})(_this.props.view.state, _this.props.view.dispatch);
|
|
469
|
+
case 9:
|
|
470
|
+
case "end":
|
|
471
|
+
return _context11.stop();
|
|
492
472
|
}
|
|
493
473
|
}, _callee11);
|
|
494
474
|
}));
|
|
@@ -496,36 +476,35 @@ export var MediaNodeUpdater = /*#__PURE__*/function () {
|
|
|
496
476
|
return _ref12.apply(this, arguments);
|
|
497
477
|
};
|
|
498
478
|
}());
|
|
479
|
+
// Copies the pasted node into the current collection
|
|
499
480
|
_defineProperty(this, "copyNode", /*#__PURE__*/function () {
|
|
500
|
-
var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime
|
|
481
|
+
var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12(traceContext) {
|
|
501
482
|
var attrs, view, copiedAttrs;
|
|
502
|
-
return _regeneratorRuntime
|
|
503
|
-
while (1) {
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
return _context12.stop();
|
|
528
|
-
}
|
|
483
|
+
return _regeneratorRuntime.wrap(function _callee12$(_context12) {
|
|
484
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
485
|
+
case 0:
|
|
486
|
+
attrs = _this.getAttrs();
|
|
487
|
+
view = _this.props.view;
|
|
488
|
+
if (!((attrs === null || attrs === void 0 ? void 0 : attrs.type) !== 'file')) {
|
|
489
|
+
_context12.next = 4;
|
|
490
|
+
break;
|
|
491
|
+
}
|
|
492
|
+
return _context12.abrupt("return");
|
|
493
|
+
case 4:
|
|
494
|
+
_context12.next = 6;
|
|
495
|
+
return _this.copyFile(attrs.id, attrs.collection, traceContext);
|
|
496
|
+
case 6:
|
|
497
|
+
copiedAttrs = _context12.sent;
|
|
498
|
+
if (copiedAttrs) {
|
|
499
|
+
_context12.next = 9;
|
|
500
|
+
break;
|
|
501
|
+
}
|
|
502
|
+
return _context12.abrupt("return");
|
|
503
|
+
case 9:
|
|
504
|
+
updateMediaSingleNodeAttrs(attrs.id, copiedAttrs)(view.state, view.dispatch);
|
|
505
|
+
case 10:
|
|
506
|
+
case "end":
|
|
507
|
+
return _context12.stop();
|
|
529
508
|
}
|
|
530
509
|
}, _callee12);
|
|
531
510
|
}));
|
|
@@ -534,65 +513,63 @@ export var MediaNodeUpdater = /*#__PURE__*/function () {
|
|
|
534
513
|
};
|
|
535
514
|
}());
|
|
536
515
|
_defineProperty(this, "copyFile", /*#__PURE__*/function () {
|
|
537
|
-
var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime
|
|
516
|
+
var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13(id, collection, traceContext) {
|
|
538
517
|
var mediaProvider, nodeContextId, uploadMediaClientConfig, mediaClient, auth, objectId, source, currentCollectionName, destination, mediaFile;
|
|
539
|
-
return _regeneratorRuntime
|
|
540
|
-
while (1) {
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
518
|
+
return _regeneratorRuntime.wrap(function _callee13$(_context13) {
|
|
519
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
520
|
+
case 0:
|
|
521
|
+
_context13.next = 2;
|
|
522
|
+
return _this.props.mediaProvider;
|
|
523
|
+
case 2:
|
|
524
|
+
mediaProvider = _context13.sent;
|
|
525
|
+
if (!(!id || !collection || !(mediaProvider !== null && mediaProvider !== void 0 && mediaProvider.uploadParams))) {
|
|
526
|
+
_context13.next = 5;
|
|
527
|
+
break;
|
|
528
|
+
}
|
|
529
|
+
return _context13.abrupt("return");
|
|
530
|
+
case 5:
|
|
531
|
+
nodeContextId = _this.getNodeContextId();
|
|
532
|
+
uploadMediaClientConfig = mediaProvider.uploadMediaClientConfig;
|
|
533
|
+
if (!(!(uploadMediaClientConfig !== null && uploadMediaClientConfig !== void 0 && uploadMediaClientConfig.getAuthFromContext) || !nodeContextId)) {
|
|
534
|
+
_context13.next = 9;
|
|
535
|
+
break;
|
|
536
|
+
}
|
|
537
|
+
return _context13.abrupt("return");
|
|
538
|
+
case 9:
|
|
539
|
+
mediaClient = getMediaClient(uploadMediaClientConfig);
|
|
540
|
+
_context13.next = 12;
|
|
541
|
+
return uploadMediaClientConfig.getAuthFromContext(nodeContextId);
|
|
542
|
+
case 12:
|
|
543
|
+
auth = _context13.sent;
|
|
544
|
+
_context13.next = 15;
|
|
545
|
+
return _this.getObjectId();
|
|
546
|
+
case 15:
|
|
547
|
+
objectId = _context13.sent;
|
|
548
|
+
source = {
|
|
549
|
+
id: id,
|
|
550
|
+
collection: collection,
|
|
551
|
+
authProvider: function authProvider() {
|
|
552
|
+
return Promise.resolve(auth);
|
|
558
553
|
}
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
destination = {
|
|
579
|
-
collection: currentCollectionName,
|
|
580
|
-
authProvider: uploadMediaClientConfig.authProvider,
|
|
581
|
-
occurrenceKey: uuidV4()
|
|
582
|
-
};
|
|
583
|
-
_context13.next = 21;
|
|
584
|
-
return mediaClient.file.copyFile(source, destination, undefined, traceContext);
|
|
585
|
-
case 21:
|
|
586
|
-
mediaFile = _context13.sent;
|
|
587
|
-
return _context13.abrupt("return", {
|
|
588
|
-
id: mediaFile.id,
|
|
589
|
-
collection: currentCollectionName,
|
|
590
|
-
__contextId: objectId
|
|
591
|
-
});
|
|
592
|
-
case 23:
|
|
593
|
-
case "end":
|
|
594
|
-
return _context13.stop();
|
|
595
|
-
}
|
|
554
|
+
};
|
|
555
|
+
currentCollectionName = mediaProvider.uploadParams.collection;
|
|
556
|
+
destination = {
|
|
557
|
+
collection: currentCollectionName,
|
|
558
|
+
authProvider: uploadMediaClientConfig.authProvider,
|
|
559
|
+
occurrenceKey: uuidV4()
|
|
560
|
+
};
|
|
561
|
+
_context13.next = 21;
|
|
562
|
+
return mediaClient.file.copyFile(source, destination, undefined, traceContext);
|
|
563
|
+
case 21:
|
|
564
|
+
mediaFile = _context13.sent;
|
|
565
|
+
return _context13.abrupt("return", {
|
|
566
|
+
id: mediaFile.id,
|
|
567
|
+
collection: currentCollectionName,
|
|
568
|
+
__contextId: objectId
|
|
569
|
+
});
|
|
570
|
+
case 23:
|
|
571
|
+
case "end":
|
|
572
|
+
return _context13.stop();
|
|
596
573
|
}
|
|
597
574
|
}, _callee13);
|
|
598
575
|
}));
|
|
@@ -608,89 +585,84 @@ export var MediaNodeUpdater = /*#__PURE__*/function () {
|
|
|
608
585
|
var attrs = this.getAttrs();
|
|
609
586
|
return !!(attrs && attrs.type === 'external' && _isMediaBlobUrl(attrs.url));
|
|
610
587
|
}
|
|
611
|
-
|
|
612
|
-
// Updates the node with contextId if it doesn't have one already
|
|
613
|
-
// TODO [MS-2258]: remove updateContextId in order to only use updateMediaSingleFileAttrs
|
|
614
588
|
}, {
|
|
615
589
|
key: "getRemoteDimensions",
|
|
616
590
|
value: function () {
|
|
617
|
-
var _getRemoteDimensions = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime
|
|
591
|
+
var _getRemoteDimensions = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14() {
|
|
618
592
|
var mediaProvider, mediaOptions, attrs, height, width, id, collection, viewMediaClientConfig, mediaClient, currentState, imageMetadata;
|
|
619
|
-
return _regeneratorRuntime
|
|
620
|
-
while (1) {
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
return _context14.stop();
|
|
693
|
-
}
|
|
593
|
+
return _regeneratorRuntime.wrap(function _callee14$(_context14) {
|
|
594
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
595
|
+
case 0:
|
|
596
|
+
_context14.next = 2;
|
|
597
|
+
return this.props.mediaProvider;
|
|
598
|
+
case 2:
|
|
599
|
+
mediaProvider = _context14.sent;
|
|
600
|
+
mediaOptions = this.props.mediaOptions;
|
|
601
|
+
attrs = this.getAttrs();
|
|
602
|
+
if (!(!mediaProvider || !attrs)) {
|
|
603
|
+
_context14.next = 7;
|
|
604
|
+
break;
|
|
605
|
+
}
|
|
606
|
+
return _context14.abrupt("return", false);
|
|
607
|
+
case 7:
|
|
608
|
+
height = attrs.height, width = attrs.width;
|
|
609
|
+
if (!(attrs.type === 'external' || !attrs.id)) {
|
|
610
|
+
_context14.next = 10;
|
|
611
|
+
break;
|
|
612
|
+
}
|
|
613
|
+
return _context14.abrupt("return", false);
|
|
614
|
+
case 10:
|
|
615
|
+
id = attrs.id, collection = attrs.collection;
|
|
616
|
+
if (!(height && width)) {
|
|
617
|
+
_context14.next = 13;
|
|
618
|
+
break;
|
|
619
|
+
}
|
|
620
|
+
return _context14.abrupt("return", false);
|
|
621
|
+
case 13:
|
|
622
|
+
if (!(mediaOptions && !mediaOptions.allowRemoteDimensionsFetch)) {
|
|
623
|
+
_context14.next = 15;
|
|
624
|
+
break;
|
|
625
|
+
}
|
|
626
|
+
return _context14.abrupt("return", {
|
|
627
|
+
id: id,
|
|
628
|
+
height: DEFAULT_IMAGE_HEIGHT,
|
|
629
|
+
width: DEFAULT_IMAGE_WIDTH
|
|
630
|
+
});
|
|
631
|
+
case 15:
|
|
632
|
+
viewMediaClientConfig = mediaProvider.viewMediaClientConfig;
|
|
633
|
+
mediaClient = getMediaClient(viewMediaClientConfig);
|
|
634
|
+
_context14.next = 19;
|
|
635
|
+
return mediaClient.file.getCurrentState(id, {
|
|
636
|
+
collectionName: collection
|
|
637
|
+
});
|
|
638
|
+
case 19:
|
|
639
|
+
currentState = _context14.sent;
|
|
640
|
+
if (isImageRepresentationReady(currentState)) {
|
|
641
|
+
_context14.next = 22;
|
|
642
|
+
break;
|
|
643
|
+
}
|
|
644
|
+
return _context14.abrupt("return", false);
|
|
645
|
+
case 22:
|
|
646
|
+
_context14.next = 24;
|
|
647
|
+
return mediaClient.getImageMetadata(id, {
|
|
648
|
+
collection: collection
|
|
649
|
+
});
|
|
650
|
+
case 24:
|
|
651
|
+
imageMetadata = _context14.sent;
|
|
652
|
+
if (!(!imageMetadata || !imageMetadata.original)) {
|
|
653
|
+
_context14.next = 27;
|
|
654
|
+
break;
|
|
655
|
+
}
|
|
656
|
+
return _context14.abrupt("return", false);
|
|
657
|
+
case 27:
|
|
658
|
+
return _context14.abrupt("return", {
|
|
659
|
+
id: id,
|
|
660
|
+
height: imageMetadata.original.height || DEFAULT_IMAGE_HEIGHT,
|
|
661
|
+
width: imageMetadata.original.width || DEFAULT_IMAGE_WIDTH
|
|
662
|
+
});
|
|
663
|
+
case 28:
|
|
664
|
+
case "end":
|
|
665
|
+
return _context14.stop();
|
|
694
666
|
}
|
|
695
667
|
}, _callee14, this);
|
|
696
668
|
}));
|
|
@@ -702,36 +674,34 @@ export var MediaNodeUpdater = /*#__PURE__*/function () {
|
|
|
702
674
|
}, {
|
|
703
675
|
key: "handleExternalMedia",
|
|
704
676
|
value: function () {
|
|
705
|
-
var _handleExternalMedia = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime
|
|
706
|
-
return _regeneratorRuntime
|
|
707
|
-
while (1) {
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
_context15.next = 12;
|
|
712
|
-
break;
|
|
713
|
-
}
|
|
714
|
-
_context15.prev = 1;
|
|
715
|
-
_context15.next = 4;
|
|
716
|
-
return this.copyNodeFromBlobUrl(getPos);
|
|
717
|
-
case 4:
|
|
718
|
-
_context15.next = 10;
|
|
719
|
-
break;
|
|
720
|
-
case 6:
|
|
721
|
-
_context15.prev = 6;
|
|
722
|
-
_context15.t0 = _context15["catch"](1);
|
|
723
|
-
_context15.next = 10;
|
|
724
|
-
return this.uploadExternalMedia(getPos);
|
|
725
|
-
case 10:
|
|
726
|
-
_context15.next = 14;
|
|
677
|
+
var _handleExternalMedia = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15(getPos) {
|
|
678
|
+
return _regeneratorRuntime.wrap(function _callee15$(_context15) {
|
|
679
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
680
|
+
case 0:
|
|
681
|
+
if (!this.isMediaBlobUrl()) {
|
|
682
|
+
_context15.next = 12;
|
|
727
683
|
break;
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
684
|
+
}
|
|
685
|
+
_context15.prev = 1;
|
|
686
|
+
_context15.next = 4;
|
|
687
|
+
return this.copyNodeFromBlobUrl(getPos);
|
|
688
|
+
case 4:
|
|
689
|
+
_context15.next = 10;
|
|
690
|
+
break;
|
|
691
|
+
case 6:
|
|
692
|
+
_context15.prev = 6;
|
|
693
|
+
_context15.t0 = _context15["catch"](1);
|
|
694
|
+
_context15.next = 10;
|
|
695
|
+
return this.uploadExternalMedia(getPos);
|
|
696
|
+
case 10:
|
|
697
|
+
_context15.next = 14;
|
|
698
|
+
break;
|
|
699
|
+
case 12:
|
|
700
|
+
_context15.next = 14;
|
|
701
|
+
return this.uploadExternalMedia(getPos);
|
|
702
|
+
case 14:
|
|
703
|
+
case "end":
|
|
704
|
+
return _context15.stop();
|
|
735
705
|
}
|
|
736
706
|
}, _callee15, this, [[1, 6]]);
|
|
737
707
|
}));
|
|
@@ -739,8 +709,7 @@ export var MediaNodeUpdater = /*#__PURE__*/function () {
|
|
|
739
709
|
return _handleExternalMedia.apply(this, arguments);
|
|
740
710
|
}
|
|
741
711
|
return handleExternalMedia;
|
|
742
|
-
}()
|
|
743
|
-
// Copies the pasted node into the current collection
|
|
712
|
+
}()
|
|
744
713
|
}]);
|
|
745
714
|
return MediaNodeUpdater;
|
|
746
715
|
}();
|