@atlaskit/editor-core 183.0.12 → 183.1.1
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 +35 -0
- package/dist/cjs/actions/index.js +1 -16
- package/dist/cjs/create-editor/ErrorBoundary.js +19 -8
- package/dist/cjs/create-editor/ReactEditorViewInternal.js +40 -21
- package/dist/cjs/editor-next/editor-internal.js +6 -1
- package/dist/cjs/labs/next/presets/create-stub-internal-apis.js +1 -41
- package/dist/cjs/labs/next/presets/default.js +23 -1
- package/dist/cjs/labs/next/presets/universal.js +9 -18
- package/dist/cjs/plugins/analytics/index.js +0 -24
- package/dist/cjs/plugins/analytics/plugin-key.js +7 -1
- package/dist/cjs/plugins/analytics/plugin.js +17 -45
- package/dist/cjs/plugins/analytics/utils.js +24 -34
- package/dist/cjs/plugins/base/index.js +7 -1
- package/dist/cjs/plugins/base/pm-plugins/decoration.js +8 -0
- package/dist/cjs/plugins/block-type/commands/block-type.js +1 -1
- package/dist/cjs/plugins/caption/index.js +3 -2
- package/dist/cjs/plugins/caption/pm-plugins/main.js +8 -7
- package/dist/cjs/plugins/card/index.js +2 -2
- package/dist/cjs/plugins/card/nodeviews/embedCard.js +103 -70
- package/dist/cjs/plugins/card/nodeviews/genericCard.js +3 -2
- package/dist/cjs/plugins/card/pm-plugins/analytics/events-from-tr.js +36 -20
- package/dist/cjs/plugins/card/pm-plugins/analytics/utils.js +48 -9
- package/dist/cjs/plugins/card/pm-plugins/doc.js +19 -19
- package/dist/cjs/plugins/card/pm-plugins/main.js +5 -3
- package/dist/cjs/plugins/card/pm-plugins/shouldReplaceLink.js +4 -4
- package/dist/cjs/plugins/card/pm-plugins/util/resolve.js +6 -6
- package/dist/cjs/plugins/card/toolbar.js +86 -68
- package/dist/cjs/plugins/card/ui/EditLinkToolbar.js +19 -13
- package/dist/cjs/plugins/card/ui/EditorSmartCardEventsNext.js +9 -3
- package/dist/cjs/plugins/card/ui/LinkToolbarAppearance.js +6 -5
- package/dist/cjs/plugins/card/ui/LinkToolbarButtonGroup.js +2 -2
- package/dist/cjs/plugins/card/ui/ResizableEmbedCard.js +1 -2
- package/dist/cjs/plugins/collab-edit/ui/styles.js +2 -3
- package/dist/cjs/plugins/date/index.js +4 -3
- package/dist/cjs/plugins/expand/ui/styles.js +4 -5
- package/dist/cjs/plugins/floating-toolbar/ui/Dropdown.js +3 -3
- package/dist/cjs/plugins/floating-toolbar/ui/DropdownMenu.js +5 -1
- package/dist/cjs/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +2 -2
- package/dist/cjs/plugins/floating-toolbar/ui/ScrollButtons.js +4 -6
- package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +5 -5
- package/dist/cjs/plugins/grid/index.js +73 -39
- package/dist/cjs/plugins/history/pm-history-types.js +1 -5
- package/dist/cjs/plugins/history/utils.js +2 -2
- package/dist/cjs/plugins/hyperlink/HyperlinkToolbarAppearance.js +4 -2
- package/dist/cjs/plugins/hyperlink/Toolbar.js +4 -3
- package/dist/cjs/plugins/hyperlink/commands.js +14 -14
- package/dist/cjs/plugins/hyperlink/index.js +7 -5
- package/dist/cjs/plugins/hyperlink/pm-plugins/input-rule.js +5 -5
- package/dist/cjs/plugins/hyperlink/pm-plugins/keymap.js +2 -3
- package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +2 -3
- package/dist/cjs/plugins/insert-block/index.js +1 -1
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +40 -44
- package/dist/cjs/plugins/layout/styles.js +2 -2
- package/dist/cjs/plugins/list/actions/conversions.js +1 -1
- package/dist/cjs/plugins/list/commands/listBackspace.js +5 -5
- package/dist/cjs/plugins/list/pm-plugins/main.js +2 -2
- package/dist/cjs/plugins/list/transforms.js +2 -2
- package/dist/cjs/plugins/list/utils/analytics.js +2 -2
- package/dist/cjs/plugins/list/utils/find.js +6 -6
- package/dist/cjs/plugins/list/utils/indentation.js +3 -3
- package/dist/cjs/plugins/list/utils/node.js +32 -23
- package/dist/cjs/plugins/list/utils/selection.js +11 -11
- package/dist/cjs/plugins/macro/actions.js +2 -2
- package/dist/cjs/plugins/media/commands/linking.js +1 -1
- package/dist/cjs/plugins/media/index.js +1 -1
- package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +31 -17
- package/dist/cjs/plugins/media/pm-plugins/alt-text/index.js +2 -2
- package/dist/cjs/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +3 -4
- package/dist/cjs/plugins/media/toolbar/filePreviewItem.js +2 -2
- package/dist/cjs/plugins/media/toolbar/linking-toolbar-appearance.js +4 -4
- package/dist/cjs/plugins/media/ui/ImageBorder/styles.js +4 -1
- package/dist/cjs/plugins/media/ui/MediaLinkingToolbar.js +3 -4
- package/dist/cjs/plugins/media/ui/ResizableMediaSingle/index.js +13 -4
- package/dist/cjs/plugins/media/utils/media-single.js +10 -57
- package/dist/cjs/plugins/paste/edge-cases/index.js +3 -3
- package/dist/cjs/plugins/paste/edge-cases/lists.js +1 -1
- package/dist/cjs/plugins/paste/handlers.js +16 -10
- package/dist/cjs/plugins/paste/pm-plugins/analytics.js +1 -1
- package/dist/cjs/plugins/paste/pm-plugins/main.js +13 -20
- package/dist/cjs/plugins/quick-insert/commands.js +1 -1
- package/dist/cjs/plugins/rule/pm-plugins/input-rule.js +1 -1
- package/dist/cjs/plugins/selection/commands.js +24 -23
- package/dist/cjs/plugins/selection/utils.js +2 -2
- package/dist/cjs/plugins/status/plugin.js +13 -7
- package/dist/cjs/plugins/status/ui/statusPicker.js +1 -1
- package/dist/cjs/plugins/type-ahead/insert-utils.js +2 -3
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadPopup.js +1 -1
- package/dist/cjs/plugins/width/index.js +12 -0
- package/dist/cjs/ui/Alignment/styles.js +1 -2
- package/dist/cjs/ui/Appearance/Comment/Toolbar.js +2 -3
- package/dist/cjs/ui/Appearance/FullPage/MainToolbar.js +1 -2
- package/dist/cjs/ui/ColorPickerButton/index.js +16 -9
- package/dist/cjs/ui/ConfigPanel/ErrorMessage/ErrorImage.js +1 -2
- package/dist/cjs/ui/ConfigPanel/Fields/ColorPicker.js +6 -3
- package/dist/cjs/ui/ConfigPanel/Fields/Expand.js +3 -4
- package/dist/cjs/ui/ConfigPanel/Fields/Fieldset.js +1 -2
- package/dist/cjs/ui/ConfigPanel/Fields/SelectItem.js +1 -2
- package/dist/cjs/ui/ConfigPanel/NestedForms/RemovableField.js +1 -2
- package/dist/cjs/ui/ContentStyles/index.js +2 -2
- package/dist/cjs/ui/ElementBrowser/InsertMenu.js +1 -1
- package/dist/cjs/ui/ElementBrowser/constants.js +4 -0
- package/dist/cjs/ui/ErrorBoundary/index.js +7 -0
- package/dist/cjs/ui/Resizer/index.js +4 -4
- package/dist/cjs/utils/commands.js +2 -2
- package/dist/cjs/utils/document.js +4 -12
- package/dist/cjs/utils/index.js +1 -14
- package/dist/cjs/utils/selection.js +1 -26
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/actions/index.js +1 -16
- package/dist/es2019/create-editor/ErrorBoundary.js +18 -7
- package/dist/es2019/create-editor/ReactEditorViewInternal.js +44 -27
- package/dist/es2019/editor-next/editor-internal.js +6 -1
- package/dist/es2019/labs/next/presets/create-stub-internal-apis.js +1 -39
- package/dist/es2019/labs/next/presets/default.js +27 -1
- package/dist/es2019/labs/next/presets/universal.js +9 -19
- package/dist/es2019/plugins/analytics/index.js +1 -1
- package/dist/es2019/plugins/analytics/plugin-key.js +8 -1
- package/dist/es2019/plugins/analytics/plugin.js +15 -38
- package/dist/es2019/plugins/analytics/utils.js +24 -11
- package/dist/es2019/plugins/base/index.js +4 -1
- package/dist/es2019/plugins/base/pm-plugins/decoration.js +9 -0
- package/dist/es2019/plugins/block-type/commands/block-type.js +1 -1
- package/dist/es2019/plugins/caption/index.js +3 -2
- package/dist/es2019/plugins/caption/pm-plugins/main.js +8 -7
- package/dist/es2019/plugins/card/index.js +2 -2
- package/dist/es2019/plugins/card/nodeviews/embedCard.js +105 -70
- package/dist/es2019/plugins/card/nodeviews/genericCard.js +3 -2
- package/dist/es2019/plugins/card/pm-plugins/analytics/events-from-tr.js +33 -16
- package/dist/es2019/plugins/card/pm-plugins/analytics/utils.js +43 -7
- package/dist/es2019/plugins/card/pm-plugins/doc.js +19 -19
- package/dist/es2019/plugins/card/pm-plugins/main.js +7 -3
- package/dist/es2019/plugins/card/pm-plugins/shouldReplaceLink.js +1 -1
- package/dist/es2019/plugins/card/pm-plugins/util/resolve.js +6 -6
- package/dist/es2019/plugins/card/toolbar.js +51 -30
- package/dist/es2019/plugins/card/ui/EditLinkToolbar.js +11 -5
- package/dist/es2019/plugins/card/ui/EditorSmartCardEventsNext.js +6 -0
- package/dist/es2019/plugins/card/ui/LinkToolbarAppearance.js +6 -5
- package/dist/es2019/plugins/card/ui/LinkToolbarButtonGroup.js +1 -1
- package/dist/es2019/plugins/card/ui/ResizableEmbedCard.js +1 -1
- package/dist/es2019/plugins/collab-edit/ui/styles.js +3 -4
- package/dist/es2019/plugins/date/index.js +4 -3
- package/dist/es2019/plugins/expand/ui/styles.js +1 -2
- package/dist/es2019/plugins/floating-toolbar/ui/Dropdown.js +1 -1
- package/dist/es2019/plugins/floating-toolbar/ui/DropdownMenu.js +6 -2
- package/dist/es2019/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +1 -1
- package/dist/es2019/plugins/floating-toolbar/ui/ScrollButtons.js +3 -5
- package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +9 -9
- package/dist/es2019/plugins/grid/index.js +76 -39
- package/dist/es2019/plugins/history/pm-history-types.js +1 -2
- package/dist/es2019/plugins/history/utils.js +1 -1
- package/dist/es2019/plugins/hyperlink/HyperlinkToolbarAppearance.js +4 -2
- package/dist/es2019/plugins/hyperlink/Toolbar.js +4 -3
- package/dist/es2019/plugins/hyperlink/commands.js +3 -3
- package/dist/es2019/plugins/hyperlink/index.js +7 -5
- package/dist/es2019/plugins/hyperlink/pm-plugins/input-rule.js +3 -3
- package/dist/es2019/plugins/hyperlink/pm-plugins/keymap.js +1 -2
- package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +1 -1
- package/dist/es2019/plugins/insert-block/index.js +1 -1
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +16 -19
- package/dist/es2019/plugins/layout/styles.js +4 -0
- package/dist/es2019/plugins/list/actions/conversions.js +1 -1
- package/dist/es2019/plugins/list/commands/listBackspace.js +1 -1
- package/dist/es2019/plugins/list/pm-plugins/main.js +1 -1
- package/dist/es2019/plugins/list/transforms.js +1 -1
- package/dist/es2019/plugins/list/utils/analytics.js +1 -1
- package/dist/es2019/plugins/list/utils/find.js +1 -1
- package/dist/es2019/plugins/list/utils/indentation.js +1 -1
- package/dist/es2019/plugins/list/utils/node.js +2 -12
- package/dist/es2019/plugins/list/utils/selection.js +1 -1
- package/dist/es2019/plugins/macro/actions.js +1 -1
- package/dist/es2019/plugins/media/commands/linking.js +1 -1
- package/dist/es2019/plugins/media/index.js +1 -1
- package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +20 -6
- package/dist/es2019/plugins/media/pm-plugins/alt-text/index.js +1 -1
- package/dist/es2019/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +1 -1
- package/dist/es2019/plugins/media/toolbar/filePreviewItem.js +1 -1
- package/dist/es2019/plugins/media/toolbar/linking-toolbar-appearance.js +1 -1
- package/dist/es2019/plugins/media/ui/ImageBorder/styles.js +4 -0
- package/dist/es2019/plugins/media/ui/MediaLinkingToolbar.js +2 -2
- package/dist/es2019/plugins/media/ui/ResizableMediaSingle/index.js +15 -3
- package/dist/es2019/plugins/media/utils/media-single.js +5 -53
- package/dist/es2019/plugins/paste/edge-cases/index.js +1 -1
- package/dist/es2019/plugins/paste/edge-cases/lists.js +1 -1
- package/dist/es2019/plugins/paste/handlers.js +11 -4
- package/dist/es2019/plugins/paste/pm-plugins/analytics.js +1 -1
- package/dist/es2019/plugins/paste/pm-plugins/main.js +2 -3
- package/dist/es2019/plugins/quick-insert/commands.js +1 -1
- package/dist/es2019/plugins/rule/pm-plugins/input-rule.js +1 -1
- package/dist/es2019/plugins/selection/commands.js +2 -1
- package/dist/es2019/plugins/selection/utils.js +1 -1
- package/dist/es2019/plugins/status/plugin.js +9 -3
- package/dist/es2019/plugins/status/ui/statusPicker.js +2 -2
- package/dist/es2019/plugins/type-ahead/insert-utils.js +1 -2
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadPopup.js +2 -2
- package/dist/es2019/plugins/width/index.js +12 -0
- package/dist/es2019/ui/Alignment/styles.js +1 -2
- package/dist/es2019/ui/Appearance/Comment/Toolbar.js +2 -3
- package/dist/es2019/ui/Appearance/FullPage/MainToolbar.js +3 -4
- package/dist/es2019/ui/ColorPickerButton/index.js +18 -9
- package/dist/es2019/ui/ConfigPanel/ErrorMessage/ErrorImage.js +1 -2
- package/dist/es2019/ui/ConfigPanel/Fields/ColorPicker.js +7 -3
- package/dist/es2019/ui/ConfigPanel/Fields/Expand.js +5 -6
- package/dist/es2019/ui/ConfigPanel/Fields/Fieldset.js +2 -3
- package/dist/es2019/ui/ConfigPanel/Fields/SelectItem.js +1 -2
- package/dist/es2019/ui/ConfigPanel/NestedForms/RemovableField.js +1 -2
- package/dist/es2019/ui/ContentStyles/index.js +2 -1
- package/dist/es2019/ui/ElementBrowser/InsertMenu.js +2 -2
- package/dist/es2019/ui/ElementBrowser/constants.js +3 -0
- package/dist/es2019/ui/ErrorBoundary/index.js +7 -0
- package/dist/es2019/ui/Resizer/index.js +4 -4
- package/dist/es2019/utils/commands.js +1 -1
- package/dist/es2019/utils/document.js +1 -8
- package/dist/es2019/utils/index.js +2 -2
- package/dist/es2019/utils/selection.js +0 -22
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/actions/index.js +1 -16
- package/dist/esm/create-editor/ErrorBoundary.js +19 -8
- package/dist/esm/create-editor/ReactEditorViewInternal.js +40 -21
- package/dist/esm/editor-next/editor-internal.js +6 -1
- package/dist/esm/labs/next/presets/create-stub-internal-apis.js +1 -41
- package/dist/esm/labs/next/presets/default.js +23 -1
- package/dist/esm/labs/next/presets/universal.js +9 -18
- package/dist/esm/plugins/analytics/index.js +1 -1
- package/dist/esm/plugins/analytics/plugin-key.js +8 -1
- package/dist/esm/plugins/analytics/plugin.js +17 -45
- package/dist/esm/plugins/analytics/utils.js +24 -11
- package/dist/esm/plugins/base/index.js +4 -1
- package/dist/esm/plugins/base/pm-plugins/decoration.js +9 -0
- package/dist/esm/plugins/block-type/commands/block-type.js +1 -1
- package/dist/esm/plugins/caption/index.js +3 -2
- package/dist/esm/plugins/caption/pm-plugins/main.js +8 -7
- package/dist/esm/plugins/card/index.js +2 -2
- package/dist/esm/plugins/card/nodeviews/embedCard.js +103 -70
- package/dist/esm/plugins/card/nodeviews/genericCard.js +3 -2
- package/dist/esm/plugins/card/pm-plugins/analytics/events-from-tr.js +36 -20
- package/dist/esm/plugins/card/pm-plugins/analytics/utils.js +43 -7
- package/dist/esm/plugins/card/pm-plugins/doc.js +19 -19
- package/dist/esm/plugins/card/pm-plugins/main.js +5 -3
- package/dist/esm/plugins/card/pm-plugins/shouldReplaceLink.js +1 -1
- package/dist/esm/plugins/card/pm-plugins/util/resolve.js +6 -6
- package/dist/esm/plugins/card/toolbar.js +86 -68
- package/dist/esm/plugins/card/ui/EditLinkToolbar.js +19 -13
- package/dist/esm/plugins/card/ui/EditorSmartCardEventsNext.js +9 -3
- package/dist/esm/plugins/card/ui/LinkToolbarAppearance.js +6 -5
- package/dist/esm/plugins/card/ui/LinkToolbarButtonGroup.js +1 -1
- package/dist/esm/plugins/card/ui/ResizableEmbedCard.js +1 -1
- package/dist/esm/plugins/collab-edit/ui/styles.js +2 -3
- package/dist/esm/plugins/date/index.js +4 -3
- package/dist/esm/plugins/expand/ui/styles.js +2 -3
- package/dist/esm/plugins/floating-toolbar/ui/Dropdown.js +1 -1
- package/dist/esm/plugins/floating-toolbar/ui/DropdownMenu.js +5 -1
- package/dist/esm/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +1 -1
- package/dist/esm/plugins/floating-toolbar/ui/ScrollButtons.js +2 -4
- package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +5 -5
- package/dist/esm/plugins/grid/index.js +72 -36
- package/dist/esm/plugins/history/pm-history-types.js +1 -2
- package/dist/esm/plugins/history/utils.js +1 -1
- package/dist/esm/plugins/hyperlink/HyperlinkToolbarAppearance.js +4 -2
- package/dist/esm/plugins/hyperlink/Toolbar.js +4 -3
- package/dist/esm/plugins/hyperlink/commands.js +3 -3
- package/dist/esm/plugins/hyperlink/index.js +7 -5
- package/dist/esm/plugins/hyperlink/pm-plugins/input-rule.js +3 -3
- package/dist/esm/plugins/hyperlink/pm-plugins/keymap.js +1 -2
- package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +1 -1
- package/dist/esm/plugins/insert-block/index.js +1 -1
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +40 -44
- package/dist/esm/plugins/layout/styles.js +3 -1
- package/dist/esm/plugins/list/actions/conversions.js +1 -1
- package/dist/esm/plugins/list/commands/listBackspace.js +1 -1
- package/dist/esm/plugins/list/pm-plugins/main.js +1 -1
- package/dist/esm/plugins/list/transforms.js +1 -1
- package/dist/esm/plugins/list/utils/analytics.js +1 -1
- package/dist/esm/plugins/list/utils/find.js +1 -1
- package/dist/esm/plugins/list/utils/indentation.js +1 -1
- package/dist/esm/plugins/list/utils/node.js +2 -12
- package/dist/esm/plugins/list/utils/selection.js +1 -1
- package/dist/esm/plugins/macro/actions.js +1 -1
- package/dist/esm/plugins/media/commands/linking.js +1 -1
- package/dist/esm/plugins/media/index.js +1 -1
- package/dist/esm/plugins/media/nodeviews/mediaSingle.js +31 -17
- package/dist/esm/plugins/media/pm-plugins/alt-text/index.js +1 -1
- package/dist/esm/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +1 -1
- package/dist/esm/plugins/media/toolbar/filePreviewItem.js +1 -1
- package/dist/esm/plugins/media/toolbar/linking-toolbar-appearance.js +1 -1
- package/dist/esm/plugins/media/ui/ImageBorder/styles.js +4 -0
- package/dist/esm/plugins/media/ui/MediaLinkingToolbar.js +2 -2
- package/dist/esm/plugins/media/ui/ResizableMediaSingle/index.js +13 -3
- package/dist/esm/plugins/media/utils/media-single.js +5 -51
- package/dist/esm/plugins/paste/edge-cases/index.js +1 -1
- package/dist/esm/plugins/paste/edge-cases/lists.js +1 -1
- package/dist/esm/plugins/paste/handlers.js +11 -4
- package/dist/esm/plugins/paste/pm-plugins/analytics.js +1 -1
- package/dist/esm/plugins/paste/pm-plugins/main.js +2 -3
- package/dist/esm/plugins/quick-insert/commands.js +1 -1
- package/dist/esm/plugins/rule/pm-plugins/input-rule.js +1 -1
- package/dist/esm/plugins/selection/commands.js +2 -1
- package/dist/esm/plugins/selection/utils.js +1 -1
- package/dist/esm/plugins/status/plugin.js +9 -3
- package/dist/esm/plugins/status/ui/statusPicker.js +2 -2
- package/dist/esm/plugins/type-ahead/insert-utils.js +1 -2
- package/dist/esm/plugins/type-ahead/ui/TypeAheadPopup.js +2 -2
- package/dist/esm/plugins/width/index.js +12 -0
- package/dist/esm/ui/Alignment/styles.js +1 -2
- package/dist/esm/ui/Appearance/Comment/Toolbar.js +2 -3
- package/dist/esm/ui/Appearance/FullPage/MainToolbar.js +1 -2
- package/dist/esm/ui/ColorPickerButton/index.js +16 -9
- package/dist/esm/ui/ConfigPanel/ErrorMessage/ErrorImage.js +1 -2
- package/dist/esm/ui/ConfigPanel/Fields/ColorPicker.js +6 -2
- package/dist/esm/ui/ConfigPanel/Fields/Expand.js +3 -4
- package/dist/esm/ui/ConfigPanel/Fields/Fieldset.js +1 -2
- package/dist/esm/ui/ConfigPanel/Fields/SelectItem.js +1 -2
- package/dist/esm/ui/ConfigPanel/NestedForms/RemovableField.js +1 -2
- package/dist/esm/ui/ContentStyles/index.js +3 -3
- package/dist/esm/ui/ElementBrowser/InsertMenu.js +2 -2
- package/dist/esm/ui/ElementBrowser/constants.js +3 -0
- package/dist/esm/ui/ErrorBoundary/index.js +7 -0
- package/dist/esm/ui/Resizer/index.js +4 -4
- package/dist/esm/utils/commands.js +1 -1
- package/dist/esm/utils/document.js +1 -8
- package/dist/esm/utils/index.js +2 -2
- package/dist/esm/utils/selection.js +0 -23
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/create-editor/ErrorBoundary.d.ts +2 -0
- package/dist/types/create-editor/ReactEditorViewInternal.d.ts +2 -1
- package/dist/types/labs/next/presets/create-stub-internal-apis.d.ts +0 -3
- package/dist/types/labs/next/presets/cxhtml.d.ts +63 -3
- package/dist/types/labs/next/presets/default.d.ts +129 -6
- package/dist/types/labs/next/presets/mobile.d.ts +63 -3
- package/dist/types/plugins/analytics/index.d.ts +1 -1
- package/dist/types/plugins/analytics/plugin-key.d.ts +6 -0
- package/dist/types/plugins/analytics/plugin.d.ts +9 -2
- package/dist/types/plugins/analytics/utils.d.ts +16 -3
- package/dist/types/plugins/base/index.d.ts +4 -0
- package/dist/types/plugins/base/pm-plugins/decoration.d.ts +8 -0
- package/dist/types/plugins/caption/index.d.ts +4 -1
- package/dist/types/plugins/caption/pm-plugins/main.d.ts +2 -1
- package/dist/types/plugins/card/index.d.ts +11 -1
- package/dist/types/plugins/card/nodeviews/embedCard.d.ts +1 -1
- package/dist/types/plugins/card/nodeviews/genericCard.d.ts +3 -0
- package/dist/types/plugins/card/pm-plugins/analytics/types.d.ts +2 -0
- package/dist/types/plugins/card/pm-plugins/analytics/utils.d.ts +8 -2
- package/dist/types/plugins/card/pm-plugins/doc.d.ts +7 -7
- package/dist/types/plugins/card/pm-plugins/main.d.ts +3 -1
- package/dist/types/plugins/card/pm-plugins/util/resolve.d.ts +2 -1
- package/dist/types/plugins/card/toolbar.d.ts +7 -4
- package/dist/types/plugins/card/types.d.ts +1 -0
- package/dist/types/plugins/card/ui/EditLinkToolbar.d.ts +4 -2
- package/dist/types/plugins/card/ui/LinkToolbarAppearance.d.ts +2 -0
- package/dist/types/plugins/date/index.d.ts +3 -2
- package/dist/types/plugins/date/ui/DatePicker/date-picker-input.d.ts +1 -1
- package/dist/types/plugins/date/ui/DatePicker/index.d.ts +1 -1
- package/dist/types/plugins/grid/index.d.ts +14 -7
- package/dist/types/plugins/grid/types.d.ts +3 -2
- package/dist/types/plugins/history/pm-history-types.d.ts +0 -1
- package/dist/types/plugins/hyperlink/HyperlinkToolbarAppearance.d.ts +2 -0
- package/dist/types/plugins/hyperlink/Toolbar.d.ts +2 -1
- package/dist/types/plugins/hyperlink/commands.d.ts +1 -1
- package/dist/types/plugins/hyperlink/index.d.ts +6 -2
- package/dist/types/plugins/insert-block/index.d.ts +6 -4
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/types.d.ts +3 -3
- package/dist/types/plugins/list/utils/node.d.ts +2 -6
- package/dist/types/plugins/media/index.d.ts +2 -1
- package/dist/types/plugins/media/nodeviews/mediaSingle.d.ts +4 -1
- package/dist/types/plugins/media/nodeviews/types.d.ts +4 -0
- package/dist/types/plugins/media/ui/ResizableMediaSingle/index.d.ts +1 -1
- package/dist/types/plugins/media/ui/ResizableMediaSingle/types.d.ts +1 -1
- package/dist/types/plugins/media/utils/media-single.d.ts +2 -15
- package/dist/types/plugins/paste/pm-plugins/main.d.ts +0 -1
- package/dist/types/plugins/width/index.d.ts +9 -1
- package/dist/types/types/performance-tracking.d.ts +1 -323
- package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +5 -5
- package/dist/types/ui/ColorPickerButton/index.d.ts +6 -1
- package/dist/types/ui/ContentStyles/index.d.ts +2 -2
- package/dist/types/ui/ElementBrowser/components/CategoryList.d.ts +1 -1
- package/dist/types/ui/ElementBrowser/components/ElementList/ElementList.d.ts +1 -1
- package/dist/types/ui/Resizer/types.d.ts +1 -1
- package/dist/types/utils/document.d.ts +0 -4
- package/dist/types/utils/index.d.ts +2 -2
- package/dist/types/utils/selection.d.ts +1 -2
- package/dist/types-ts4.5/create-editor/ErrorBoundary.d.ts +2 -0
- package/dist/types-ts4.5/create-editor/ReactEditorViewInternal.d.ts +2 -1
- package/dist/types-ts4.5/labs/next/presets/create-stub-internal-apis.d.ts +0 -3
- package/dist/types-ts4.5/labs/next/presets/cxhtml.d.ts +73 -3
- package/dist/types-ts4.5/labs/next/presets/default.d.ts +149 -6
- package/dist/types-ts4.5/labs/next/presets/mobile.d.ts +73 -3
- package/dist/types-ts4.5/plugins/analytics/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/analytics/plugin-key.d.ts +6 -0
- package/dist/types-ts4.5/plugins/analytics/plugin.d.ts +10 -2
- package/dist/types-ts4.5/plugins/analytics/utils.d.ts +16 -3
- package/dist/types-ts4.5/plugins/base/index.d.ts +4 -0
- package/dist/types-ts4.5/plugins/base/pm-plugins/decoration.d.ts +8 -0
- package/dist/types-ts4.5/plugins/caption/index.d.ts +6 -1
- package/dist/types-ts4.5/plugins/caption/pm-plugins/main.d.ts +2 -1
- package/dist/types-ts4.5/plugins/card/index.d.ts +9 -1
- package/dist/types-ts4.5/plugins/card/nodeviews/embedCard.d.ts +1 -1
- package/dist/types-ts4.5/plugins/card/nodeviews/genericCard.d.ts +3 -0
- package/dist/types-ts4.5/plugins/card/pm-plugins/analytics/types.d.ts +2 -0
- package/dist/types-ts4.5/plugins/card/pm-plugins/analytics/utils.d.ts +8 -2
- package/dist/types-ts4.5/plugins/card/pm-plugins/doc.d.ts +7 -7
- package/dist/types-ts4.5/plugins/card/pm-plugins/main.d.ts +3 -1
- package/dist/types-ts4.5/plugins/card/pm-plugins/util/resolve.d.ts +2 -1
- package/dist/types-ts4.5/plugins/card/toolbar.d.ts +7 -4
- package/dist/types-ts4.5/plugins/card/types.d.ts +1 -0
- package/dist/types-ts4.5/plugins/card/ui/EditLinkToolbar.d.ts +4 -2
- package/dist/types-ts4.5/plugins/card/ui/LinkToolbarAppearance.d.ts +2 -0
- package/dist/types-ts4.5/plugins/date/index.d.ts +3 -1
- package/dist/types-ts4.5/plugins/date/ui/DatePicker/date-picker-input.d.ts +1 -1
- package/dist/types-ts4.5/plugins/date/ui/DatePicker/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/grid/index.d.ts +16 -7
- package/dist/types-ts4.5/plugins/grid/types.d.ts +3 -2
- package/dist/types-ts4.5/plugins/history/pm-history-types.d.ts +0 -1
- package/dist/types-ts4.5/plugins/hyperlink/HyperlinkToolbarAppearance.d.ts +2 -0
- package/dist/types-ts4.5/plugins/hyperlink/Toolbar.d.ts +2 -1
- package/dist/types-ts4.5/plugins/hyperlink/commands.d.ts +1 -1
- package/dist/types-ts4.5/plugins/hyperlink/index.d.ts +4 -2
- package/dist/types-ts4.5/plugins/insert-block/index.d.ts +4 -4
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/types.d.ts +3 -3
- package/dist/types-ts4.5/plugins/list/utils/node.d.ts +2 -6
- package/dist/types-ts4.5/plugins/media/index.d.ts +3 -1
- package/dist/types-ts4.5/plugins/media/nodeviews/mediaSingle.d.ts +4 -1
- package/dist/types-ts4.5/plugins/media/nodeviews/types.d.ts +4 -0
- package/dist/types-ts4.5/plugins/media/ui/ResizableMediaSingle/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/media/ui/ResizableMediaSingle/types.d.ts +1 -1
- package/dist/types-ts4.5/plugins/media/utils/media-single.d.ts +2 -15
- package/dist/types-ts4.5/plugins/paste/pm-plugins/main.d.ts +0 -1
- package/dist/types-ts4.5/plugins/width/index.d.ts +9 -1
- package/dist/types-ts4.5/types/performance-tracking.d.ts +1 -323
- package/dist/types-ts4.5/ui/Appearance/FullPage/StyledComponents.d.ts +5 -5
- package/dist/types-ts4.5/ui/ColorPickerButton/index.d.ts +6 -1
- package/dist/types-ts4.5/ui/ContentStyles/index.d.ts +2 -2
- package/dist/types-ts4.5/ui/ElementBrowser/components/CategoryList.d.ts +1 -1
- package/dist/types-ts4.5/ui/ElementBrowser/components/ElementList/ElementList.d.ts +1 -1
- package/dist/types-ts4.5/ui/Resizer/types.d.ts +1 -1
- package/dist/types-ts4.5/utils/document.d.ts +0 -4
- package/dist/types-ts4.5/utils/index.d.ts +2 -2
- package/dist/types-ts4.5/utils/selection.d.ts +1 -2
- package/package.json +30 -23
- package/report.api.md +80 -151
- package/dist/cjs/analytics-api/api.js +0 -32
- package/dist/cjs/analytics-api/attach-payload-into-transaction.js +0 -36
- package/dist/cjs/analytics-api/editor-state-context.js +0 -77
- package/dist/cjs/analytics-api/map-attributes.js +0 -23
- package/dist/cjs/insert-api/api.js +0 -43
- package/dist/cjs/insert-api/insert-content-handlers.js +0 -94
- package/dist/cjs/insert-api/insert-node-helpers.js +0 -133
- package/dist/cjs/insert-api/types.js +0 -5
- package/dist/cjs/plugins/floating-toolbar/ui/Button.js +0 -93
- package/dist/cjs/plugins/hyperlink/analytics.js +0 -23
- package/dist/cjs/plugins/hyperlink/utils.js +0 -183
- package/dist/cjs/plugins/paste/md-plugins/ignore-list-heading-md-plugin.js +0 -47
- package/dist/cjs/plugins/paste/md-plugins/linkify-md-plugin.js +0 -135
- package/dist/cjs/plugins/paste/md-plugins/newline-md-plugin.js +0 -67
- package/dist/cjs/plugins/paste/md-plugins/paragraph-md-plugin.js +0 -73
- package/dist/cjs/plugins/paste/md.js +0 -31
- package/dist/cjs/plugins/undo-redo/undo-redo-input-source.js +0 -26
- package/dist/cjs/types/get-editor-props.js +0 -5
- package/dist/cjs/utils/get-editor-plugins.js +0 -30
- package/dist/cjs/utils/insert.js +0 -251
- package/dist/cjs/utils/sendLogs.js +0 -12
- package/dist/es2019/analytics-api/api.js +0 -28
- package/dist/es2019/analytics-api/attach-payload-into-transaction.js +0 -32
- package/dist/es2019/analytics-api/editor-state-context.js +0 -74
- package/dist/es2019/analytics-api/map-attributes.js +0 -14
- package/dist/es2019/insert-api/api.js +0 -42
- package/dist/es2019/insert-api/insert-content-handlers.js +0 -84
- package/dist/es2019/insert-api/insert-node-helpers.js +0 -137
- package/dist/es2019/insert-api/types.js +0 -1
- package/dist/es2019/plugins/floating-toolbar/ui/Button.js +0 -85
- package/dist/es2019/plugins/hyperlink/analytics.js +0 -17
- package/dist/es2019/plugins/hyperlink/utils.js +0 -149
- package/dist/es2019/plugins/paste/md-plugins/ignore-list-heading-md-plugin.js +0 -43
- package/dist/es2019/plugins/paste/md-plugins/linkify-md-plugin.js +0 -128
- package/dist/es2019/plugins/paste/md-plugins/newline-md-plugin.js +0 -58
- package/dist/es2019/plugins/paste/md-plugins/paragraph-md-plugin.js +0 -64
- package/dist/es2019/plugins/paste/md.js +0 -23
- package/dist/es2019/plugins/undo-redo/undo-redo-input-source.js +0 -17
- package/dist/es2019/types/get-editor-props.js +0 -1
- package/dist/es2019/utils/get-editor-plugins.js +0 -23
- package/dist/es2019/utils/insert.js +0 -244
- package/dist/es2019/utils/sendLogs.js +0 -1
- package/dist/esm/analytics-api/api.js +0 -25
- package/dist/esm/analytics-api/attach-payload-into-transaction.js +0 -29
- package/dist/esm/analytics-api/editor-state-context.js +0 -69
- package/dist/esm/analytics-api/map-attributes.js +0 -16
- package/dist/esm/insert-api/api.js +0 -36
- package/dist/esm/insert-api/insert-content-handlers.js +0 -86
- package/dist/esm/insert-api/insert-node-helpers.js +0 -123
- package/dist/esm/insert-api/types.js +0 -1
- package/dist/esm/plugins/floating-toolbar/ui/Button.js +0 -85
- package/dist/esm/plugins/hyperlink/analytics.js +0 -17
- package/dist/esm/plugins/hyperlink/utils.js +0 -168
- package/dist/esm/plugins/paste/md-plugins/ignore-list-heading-md-plugin.js +0 -41
- package/dist/esm/plugins/paste/md-plugins/linkify-md-plugin.js +0 -128
- package/dist/esm/plugins/paste/md-plugins/newline-md-plugin.js +0 -60
- package/dist/esm/plugins/paste/md-plugins/paragraph-md-plugin.js +0 -66
- package/dist/esm/plugins/paste/md.js +0 -23
- package/dist/esm/plugins/undo-redo/undo-redo-input-source.js +0 -18
- package/dist/esm/types/get-editor-props.js +0 -1
- package/dist/esm/utils/get-editor-plugins.js +0 -23
- package/dist/esm/utils/insert.js +0 -241
- package/dist/esm/utils/sendLogs.js +0 -1
- package/dist/types/analytics-api/api.d.ts +0 -9
- package/dist/types/analytics-api/attach-payload-into-transaction.d.ts +0 -10
- package/dist/types/analytics-api/editor-state-context.d.ts +0 -9
- package/dist/types/analytics-api/map-attributes.d.ts +0 -2
- package/dist/types/insert-api/api.d.ts +0 -9
- package/dist/types/insert-api/insert-content-handlers.d.ts +0 -9
- package/dist/types/insert-api/insert-node-helpers.d.ts +0 -30
- package/dist/types/insert-api/types.d.ts +0 -16
- package/dist/types/plugins/floating-toolbar/ui/Button.d.ts +0 -30
- package/dist/types/plugins/hyperlink/analytics.d.ts +0 -2
- package/dist/types/plugins/hyperlink/utils.d.ts +0 -25
- package/dist/types/plugins/paste/md-plugins/ignore-list-heading-md-plugin.d.ts +0 -2
- package/dist/types/plugins/paste/md-plugins/linkify-md-plugin.d.ts +0 -2
- package/dist/types/plugins/paste/md-plugins/newline-md-plugin.d.ts +0 -2
- package/dist/types/plugins/paste/md-plugins/paragraph-md-plugin.d.ts +0 -2
- package/dist/types/plugins/paste/md.d.ts +0 -2
- package/dist/types/plugins/undo-redo/undo-redo-input-source.d.ts +0 -3
- package/dist/types/types/get-editor-props.d.ts +0 -12
- package/dist/types/utils/get-editor-plugins.d.ts +0 -10
- package/dist/types/utils/insert.d.ts +0 -24
- package/dist/types/utils/sendLogs.d.ts +0 -1
- package/dist/types-ts4.5/analytics-api/api.d.ts +0 -9
- package/dist/types-ts4.5/analytics-api/attach-payload-into-transaction.d.ts +0 -10
- package/dist/types-ts4.5/analytics-api/editor-state-context.d.ts +0 -9
- package/dist/types-ts4.5/analytics-api/map-attributes.d.ts +0 -2
- package/dist/types-ts4.5/insert-api/api.d.ts +0 -9
- package/dist/types-ts4.5/insert-api/insert-content-handlers.d.ts +0 -9
- package/dist/types-ts4.5/insert-api/insert-node-helpers.d.ts +0 -30
- package/dist/types-ts4.5/insert-api/types.d.ts +0 -16
- package/dist/types-ts4.5/plugins/floating-toolbar/ui/Button.d.ts +0 -30
- package/dist/types-ts4.5/plugins/hyperlink/analytics.d.ts +0 -2
- package/dist/types-ts4.5/plugins/hyperlink/utils.d.ts +0 -25
- package/dist/types-ts4.5/plugins/paste/md-plugins/ignore-list-heading-md-plugin.d.ts +0 -2
- package/dist/types-ts4.5/plugins/paste/md-plugins/linkify-md-plugin.d.ts +0 -2
- package/dist/types-ts4.5/plugins/paste/md-plugins/newline-md-plugin.d.ts +0 -2
- package/dist/types-ts4.5/plugins/paste/md-plugins/paragraph-md-plugin.d.ts +0 -2
- package/dist/types-ts4.5/plugins/paste/md.d.ts +0 -2
- package/dist/types-ts4.5/plugins/undo-redo/undo-redo-input-source.d.ts +0 -3
- package/dist/types-ts4.5/types/get-editor-props.d.ts +0 -12
- package/dist/types-ts4.5/utils/get-editor-plugins.d.ts +0 -10
- package/dist/types-ts4.5/utils/insert.d.ts +0 -24
- package/dist/types-ts4.5/utils/sendLogs.d.ts +0 -1
|
@@ -4,56 +4,46 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.addAnalytics = addAnalytics;
|
|
7
|
-
Object.defineProperty(exports, "findInsertLocation", {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
get: function get() {
|
|
10
|
-
return _editorStateContext.findInsertLocation;
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
Object.defineProperty(exports, "getSelectionType", {
|
|
14
|
-
enumerable: true,
|
|
15
|
-
get: function get() {
|
|
16
|
-
return _editorStateContext.getSelectionType;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(exports, "getStateContext", {
|
|
20
|
-
enumerable: true,
|
|
21
|
-
get: function get() {
|
|
22
|
-
return _editorStateContext.getStateContext;
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
Object.defineProperty(exports, "mapActionSubjectIdToAttributes", {
|
|
26
|
-
enumerable: true,
|
|
27
|
-
get: function get() {
|
|
28
|
-
return _mapAttributes.mapActionSubjectIdToAttributes;
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
7
|
exports.withAnalytics = withAnalytics;
|
|
32
8
|
var _consts = require("./consts");
|
|
33
9
|
var _pluginKey = require("./plugin-key");
|
|
34
|
-
var _attachPayloadIntoTransaction = require("../../analytics-api/attach-payload-into-transaction");
|
|
35
|
-
var _mapAttributes = require("../../analytics-api/map-attributes");
|
|
36
|
-
var _editorStateContext = require("../../analytics-api/editor-state-context");
|
|
37
10
|
function getCreateUIAnalyticsEvent(editorState) {
|
|
38
11
|
var _analyticsPluginKey$g;
|
|
39
12
|
return (_analyticsPluginKey$g = _pluginKey.analyticsPluginKey.getState(editorState)) === null || _analyticsPluginKey$g === void 0 ? void 0 : _analyticsPluginKey$g.createAnalyticsEvent;
|
|
40
13
|
}
|
|
14
|
+
function getEditorAnalyticsAPI(editorState) {
|
|
15
|
+
var _analyticsPluginKey$g2;
|
|
16
|
+
return (_analyticsPluginKey$g2 = _pluginKey.analyticsPluginKey.getState(editorState)) === null || _analyticsPluginKey$g2 === void 0 ? void 0 : _analyticsPluginKey$g2.editorAnalyticsApi;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @private
|
|
22
|
+
* @deprecated
|
|
23
|
+
*
|
|
24
|
+
* Do not use this anymore. Please use @atlaskit/editor-plugin-analytics
|
|
25
|
+
*
|
|
26
|
+
*/
|
|
41
27
|
function addAnalytics(state, tr, payload) {
|
|
42
28
|
var channel = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : _consts.editorAnalyticsChannel;
|
|
43
29
|
var createAnalyticsEvent = getCreateUIAnalyticsEvent(state);
|
|
44
|
-
|
|
30
|
+
var editorAnalyticsApi = getEditorAnalyticsAPI(state);
|
|
31
|
+
if (!createAnalyticsEvent || !editorAnalyticsApi) {
|
|
45
32
|
return tr;
|
|
46
33
|
}
|
|
47
|
-
(
|
|
48
|
-
tr: tr,
|
|
49
|
-
editorState: state,
|
|
50
|
-
payload: payload,
|
|
51
|
-
channel: channel
|
|
52
|
-
});
|
|
34
|
+
editorAnalyticsApi === null || editorAnalyticsApi === void 0 ? void 0 : editorAnalyticsApi.attachAnalyticsEvent(payload, channel)(tr);
|
|
53
35
|
return tr;
|
|
54
36
|
}
|
|
55
37
|
// Below function has been copied to packages/editor/editor-plugin-ai/src/utils/analytics.ts
|
|
56
38
|
// If changes are made to this function, please make the same update in the linked file.
|
|
39
|
+
/**
|
|
40
|
+
*
|
|
41
|
+
* @private
|
|
42
|
+
* @deprecated
|
|
43
|
+
*
|
|
44
|
+
* Do not use this anymore. Please use @atlaskit/editor-plugin-analytics
|
|
45
|
+
*
|
|
46
|
+
*/
|
|
57
47
|
function withAnalytics(payload, channel) {
|
|
58
48
|
return function (command) {
|
|
59
49
|
return function (state, dispatch, view) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
@@ -19,11 +20,13 @@ var _newlinePreserveMarks = _interopRequireDefault(require("./pm-plugins/newline
|
|
|
19
20
|
var _inlineCursorTarget = _interopRequireDefault(require("./pm-plugins/inline-cursor-target"));
|
|
20
21
|
var _betterTypeHistory = _interopRequireDefault(require("./pm-plugins/better-type-history"));
|
|
21
22
|
var _reactNodeview = require("./pm-plugins/react-nodeview");
|
|
22
|
-
var _decoration =
|
|
23
|
+
var _decoration = _interopRequireWildcard(require("./pm-plugins/decoration"));
|
|
23
24
|
var _scrollGutter = _interopRequireDefault(require("./pm-plugins/scroll-gutter"));
|
|
24
25
|
var _keymap = require("../../utils/keymap");
|
|
25
26
|
var _frozenEditor = _interopRequireDefault(require("./pm-plugins/frozen-editor"));
|
|
26
27
|
var _composition = _interopRequireDefault(require("./pm-plugins/composition"));
|
|
28
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
29
|
+
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
30
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
28
31
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
29
32
|
// Chrome >= 88
|
|
@@ -158,6 +161,9 @@ var basePlugin = function basePlugin(options, api) {
|
|
|
158
161
|
name: 'text',
|
|
159
162
|
node: _adfSchema.text
|
|
160
163
|
}];
|
|
164
|
+
},
|
|
165
|
+
actions: {
|
|
166
|
+
hoverDecoration: _decoration.hoverDecoration
|
|
161
167
|
}
|
|
162
168
|
};
|
|
163
169
|
};
|
|
@@ -15,6 +15,14 @@ var ACTIONS = /*#__PURE__*/function (ACTIONS) {
|
|
|
15
15
|
ACTIONS[ACTIONS["DECORATION_REMOVE"] = 1] = "DECORATION_REMOVE";
|
|
16
16
|
return ACTIONS;
|
|
17
17
|
}({});
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* @private
|
|
21
|
+
* @deprecated
|
|
22
|
+
*
|
|
23
|
+
* Please use the actions of the base plugin rather than this function
|
|
24
|
+
* directly
|
|
25
|
+
*/
|
|
18
26
|
exports.ACTIONS = ACTIONS;
|
|
19
27
|
var hoverDecoration = function hoverDecoration(nodeType, add) {
|
|
20
28
|
var className = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'danger';
|
|
@@ -16,7 +16,7 @@ var _prosemirrorTransform = require("prosemirror-transform");
|
|
|
16
16
|
var _prosemirrorUtils = require("prosemirror-utils");
|
|
17
17
|
var _types = require("../types");
|
|
18
18
|
var _mark = require("../../../utils/mark");
|
|
19
|
-
var _insert = require("
|
|
19
|
+
var _insert = require("@atlaskit/editor-common/insert");
|
|
20
20
|
var _analytics = require("../../analytics");
|
|
21
21
|
var _utils = require("../../../utils");
|
|
22
22
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
@@ -8,7 +8,7 @@ exports.default = void 0;
|
|
|
8
8
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
9
9
|
var _main = _interopRequireDefault(require("./pm-plugins/main"));
|
|
10
10
|
var _keymap = require("./pm-plugins/keymap");
|
|
11
|
-
var captionPlugin = function captionPlugin() {
|
|
11
|
+
var captionPlugin = function captionPlugin(_, api) {
|
|
12
12
|
return {
|
|
13
13
|
name: 'caption',
|
|
14
14
|
nodes: function nodes() {
|
|
@@ -21,11 +21,12 @@ var captionPlugin = function captionPlugin() {
|
|
|
21
21
|
return [{
|
|
22
22
|
name: 'caption',
|
|
23
23
|
plugin: function plugin(_ref) {
|
|
24
|
+
var _api$dependencies$ana;
|
|
24
25
|
var portalProviderAPI = _ref.portalProviderAPI,
|
|
25
26
|
providerFactory = _ref.providerFactory,
|
|
26
27
|
eventDispatcher = _ref.eventDispatcher,
|
|
27
28
|
dispatch = _ref.dispatch;
|
|
28
|
-
return (0, _main.default)(portalProviderAPI, eventDispatcher, providerFactory, dispatch);
|
|
29
|
+
return (0, _main.default)(portalProviderAPI, eventDispatcher, providerFactory, dispatch, api === null || api === void 0 ? void 0 : (_api$dependencies$ana = api.dependencies.analytics) === null || _api$dependencies$ana === void 0 ? void 0 : _api$dependencies$ana.actions);
|
|
29
30
|
}
|
|
30
31
|
}, {
|
|
31
32
|
name: 'captionKeymap',
|
|
@@ -9,16 +9,16 @@ var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
|
9
9
|
var _prosemirrorUtils = require("prosemirror-utils");
|
|
10
10
|
var _pluginKey = require("./plugin-key");
|
|
11
11
|
var _nodeviews = _interopRequireDefault(require("./../nodeviews"));
|
|
12
|
-
var _analytics = require("
|
|
13
|
-
var
|
|
14
|
-
|
|
12
|
+
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
13
|
+
var fireAnalytics = function fireAnalytics(tr, action, analyticsApi) {
|
|
14
|
+
analyticsApi === null || analyticsApi === void 0 ? void 0 : analyticsApi.attachAnalyticsEvent({
|
|
15
15
|
action: action,
|
|
16
16
|
eventType: _analytics.EVENT_TYPE.TRACK,
|
|
17
17
|
actionSubject: _analytics.ACTION_SUBJECT.MEDIA_SINGLE,
|
|
18
18
|
actionSubjectId: _analytics.ACTION_SUBJECT_ID.CAPTION
|
|
19
|
-
});
|
|
19
|
+
})(tr);
|
|
20
20
|
};
|
|
21
|
-
var _default = function _default(portalProviderAPI, eventDispatcher, providerFactory, dispatch) {
|
|
21
|
+
var _default = function _default(portalProviderAPI, eventDispatcher, providerFactory, dispatch, analyticsApi) {
|
|
22
22
|
return new _safePlugin.SafePlugin({
|
|
23
23
|
appendTransaction: function appendTransaction(transactions, oldState, newState) {
|
|
24
24
|
// only run for transactions that change selection
|
|
@@ -37,10 +37,11 @@ var _default = function _default(portalProviderAPI, eventDispatcher, providerFac
|
|
|
37
37
|
if (oldSelectionCaption.node.childCount === 0) {
|
|
38
38
|
tr.delete(oldSelectionCaption.start - 1, oldSelectionCaption.start);
|
|
39
39
|
tr.setMeta('scrollIntoView', false);
|
|
40
|
-
|
|
40
|
+
fireAnalytics(tr, _analytics.ACTION.DELETED, analyticsApi);
|
|
41
41
|
return tr;
|
|
42
42
|
} else {
|
|
43
|
-
|
|
43
|
+
fireAnalytics(tr, _analytics.ACTION.EDITED, analyticsApi);
|
|
44
|
+
return tr;
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
47
|
},
|
|
@@ -54,7 +54,7 @@ var cardPlugin = function cardPlugin(options, api) {
|
|
|
54
54
|
useAlternativePreloader: useAlternativePreloader,
|
|
55
55
|
allowWrapping: allowWrapping,
|
|
56
56
|
allowAlignment: allowAlignment
|
|
57
|
-
}))
|
|
57
|
+
}), api)
|
|
58
58
|
}];
|
|
59
59
|
plugins.push({
|
|
60
60
|
name: 'cardKeymap',
|
|
@@ -75,7 +75,7 @@ var cardPlugin = function cardPlugin(options, api) {
|
|
|
75
75
|
}));
|
|
76
76
|
},
|
|
77
77
|
pluginsOptions: {
|
|
78
|
-
floatingToolbar: (0, _toolbar.floatingToolbar)(options, featureFlags, options.platform, options.linkPicker)
|
|
78
|
+
floatingToolbar: (0, _toolbar.floatingToolbar)(options, featureFlags, options.platform, options.linkPicker, api)
|
|
79
79
|
}
|
|
80
80
|
};
|
|
81
81
|
};
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.EmbedCardComponent = exports.EmbedCard = void 0;
|
|
8
8
|
var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
|
|
9
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
9
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
10
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
12
11
|
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
@@ -14,6 +13,7 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
14
13
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
15
14
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
16
15
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
17
17
|
var _react = _interopRequireDefault(require("react"));
|
|
18
18
|
var _smartCard = require("@atlaskit/smart-card");
|
|
19
19
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
@@ -24,15 +24,80 @@ var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
|
24
24
|
var _nodeviews = require("../../../nodeviews/");
|
|
25
25
|
var _actions = require("../pm-plugins/actions");
|
|
26
26
|
var _ResizableEmbedCard = _interopRequireDefault(require("../ui/ResizableEmbedCard"));
|
|
27
|
-
var _grid = require("../../../plugins/grid");
|
|
28
|
-
var _WithPluginState = _interopRequireDefault(require("../../../ui/WithPluginState"));
|
|
29
|
-
var _width = require("../../width");
|
|
30
27
|
var _richMediaUtils = require("../../../utils/rich-media-utils");
|
|
31
28
|
var _steps = require("@atlaskit/adf-schema/steps");
|
|
29
|
+
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
32
30
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
33
31
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
34
32
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
35
33
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
34
|
+
var CardInner = function CardInner(_ref) {
|
|
35
|
+
var pluginInjectionApi = _ref.pluginInjectionApi,
|
|
36
|
+
getPosSafely = _ref.getPosSafely,
|
|
37
|
+
getLineLength = _ref.getLineLength,
|
|
38
|
+
view = _ref.view,
|
|
39
|
+
smartCard = _ref.smartCard,
|
|
40
|
+
eventDispatcher = _ref.eventDispatcher,
|
|
41
|
+
updateSize = _ref.updateSize,
|
|
42
|
+
getPos = _ref.getPos,
|
|
43
|
+
aspectRatio = _ref.aspectRatio,
|
|
44
|
+
allowResizing = _ref.allowResizing,
|
|
45
|
+
hasPreview = _ref.hasPreview,
|
|
46
|
+
heightAlone = _ref.heightAlone,
|
|
47
|
+
cardProps = _ref.cardProps,
|
|
48
|
+
dispatchAnalyticsEvent = _ref.dispatchAnalyticsEvent;
|
|
49
|
+
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(pluginInjectionApi, ['width']),
|
|
50
|
+
widthState = _useSharedPluginState.widthState;
|
|
51
|
+
var widthStateLineLength = (widthState === null || widthState === void 0 ? void 0 : widthState.lineLength) || 0;
|
|
52
|
+
var widthStateWidth = (widthState === null || widthState === void 0 ? void 0 : widthState.width) || 0;
|
|
53
|
+
var pos = getPosSafely();
|
|
54
|
+
if (pos === undefined) {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
var lineLength = getLineLength(view, pos, widthStateLineLength);
|
|
58
|
+
var containerWidth = (0, _richMediaUtils.isRichMediaInsideOfBlockNode)(view, pos) ? lineLength : widthStateWidth;
|
|
59
|
+
if (!allowResizing || !hasPreview) {
|
|
60
|
+
// There are two ways `width` and `height` can be defined here:
|
|
61
|
+
// 1) Either as `heightAlone` as height value and no width
|
|
62
|
+
// 2) or as `1` for height and aspectRation (defined or a default one) as a width
|
|
63
|
+
// See above for how aspectRation is calculated.
|
|
64
|
+
var defaultAspectRatio = _editorSharedStyles.DEFAULT_EMBED_CARD_WIDTH / _editorSharedStyles.DEFAULT_EMBED_CARD_HEIGHT;
|
|
65
|
+
var richMediaWrapperHeight = 1;
|
|
66
|
+
var richMediaWrapperWidth = aspectRatio || defaultAspectRatio;
|
|
67
|
+
if (heightAlone) {
|
|
68
|
+
richMediaWrapperHeight = heightAlone;
|
|
69
|
+
richMediaWrapperWidth = undefined;
|
|
70
|
+
}
|
|
71
|
+
return /*#__PURE__*/_react.default.createElement(_ui.MediaSingle, (0, _extends2.default)({}, cardProps, {
|
|
72
|
+
height: richMediaWrapperHeight,
|
|
73
|
+
width: richMediaWrapperWidth,
|
|
74
|
+
nodeType: "embedCard",
|
|
75
|
+
hasFallbackContainer: hasPreview,
|
|
76
|
+
lineLength: lineLength,
|
|
77
|
+
containerWidth: containerWidth
|
|
78
|
+
}), smartCard);
|
|
79
|
+
}
|
|
80
|
+
var displayGrid = function displayGrid(visible, gridType, highlight) {
|
|
81
|
+
var _pluginInjectionApi$d, _pluginInjectionApi$d2;
|
|
82
|
+
return pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d = pluginInjectionApi.dependencies) === null || _pluginInjectionApi$d === void 0 ? void 0 : (_pluginInjectionApi$d2 = _pluginInjectionApi$d.grid) === null || _pluginInjectionApi$d2 === void 0 ? void 0 : _pluginInjectionApi$d2.actions.displayGrid(view)({
|
|
83
|
+
visible: visible,
|
|
84
|
+
gridType: gridType,
|
|
85
|
+
highlight: highlight
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
return /*#__PURE__*/_react.default.createElement(_ResizableEmbedCard.default, (0, _extends2.default)({}, cardProps, {
|
|
89
|
+
height: heightAlone,
|
|
90
|
+
aspectRatio: aspectRatio,
|
|
91
|
+
view: view,
|
|
92
|
+
getPos: getPos,
|
|
93
|
+
lineLength: lineLength,
|
|
94
|
+
gridSize: 12,
|
|
95
|
+
containerWidth: containerWidth,
|
|
96
|
+
displayGrid: displayGrid,
|
|
97
|
+
updateSize: updateSize,
|
|
98
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent
|
|
99
|
+
}), smartCard);
|
|
100
|
+
};
|
|
36
101
|
var EmbedCardComponent = /*#__PURE__*/function (_React$PureComponent) {
|
|
37
102
|
(0, _inherits2.default)(EmbedCardComponent, _React$PureComponent);
|
|
38
103
|
var _super = _createSuper(EmbedCardComponent);
|
|
@@ -187,7 +252,6 @@ var EmbedCardComponent = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
187
252
|
}, {
|
|
188
253
|
key: "render",
|
|
189
254
|
value: function render() {
|
|
190
|
-
var _this2 = this;
|
|
191
255
|
var _this$props = this.props,
|
|
192
256
|
node = _this$props.node,
|
|
193
257
|
cardContext = _this$props.cardContext,
|
|
@@ -196,7 +260,8 @@ var EmbedCardComponent = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
196
260
|
fullWidthMode = _this$props.fullWidthMode,
|
|
197
261
|
view = _this$props.view,
|
|
198
262
|
dispatchAnalyticsEvent = _this$props.dispatchAnalyticsEvent,
|
|
199
|
-
getPos = _this$props.getPos
|
|
263
|
+
getPos = _this$props.getPos,
|
|
264
|
+
pluginInjectionApi = _this$props.pluginInjectionApi;
|
|
200
265
|
var _node$attrs = node.attrs,
|
|
201
266
|
url = _node$attrs.url,
|
|
202
267
|
pctWidth = _node$attrs.width,
|
|
@@ -223,71 +288,37 @@ var EmbedCardComponent = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
223
288
|
pctWidth: pctWidth,
|
|
224
289
|
fullWidthMode: fullWidthMode
|
|
225
290
|
};
|
|
291
|
+
var smartCard = /*#__PURE__*/_react.default.createElement(_smartCard.Card, {
|
|
292
|
+
key: url,
|
|
293
|
+
url: url,
|
|
294
|
+
appearance: "embed",
|
|
295
|
+
onClick: this.onClick,
|
|
296
|
+
onResolve: this.onResolve,
|
|
297
|
+
showActions: platform === 'web',
|
|
298
|
+
isFrameVisible: true,
|
|
299
|
+
inheritDimensions: true,
|
|
300
|
+
platform: platform,
|
|
301
|
+
container: this.scrollContainer,
|
|
302
|
+
embedIframeRef: this.embedIframeRef
|
|
303
|
+
});
|
|
226
304
|
var cardInner = /*#__PURE__*/_react.default.createElement(_smartCard.EmbedResizeMessageListener, {
|
|
227
305
|
embedIframeRef: this.embedIframeRef,
|
|
228
306
|
onHeightUpdate: this.onHeightUpdate
|
|
229
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
var smartCard = /*#__PURE__*/_react.default.createElement(_smartCard.Card, {
|
|
245
|
-
key: url,
|
|
246
|
-
url: url,
|
|
247
|
-
appearance: "embed",
|
|
248
|
-
onClick: _this2.onClick,
|
|
249
|
-
onResolve: _this2.onResolve,
|
|
250
|
-
showActions: platform === 'web',
|
|
251
|
-
isFrameVisible: true,
|
|
252
|
-
inheritDimensions: true,
|
|
253
|
-
platform: platform,
|
|
254
|
-
container: _this2.scrollContainer,
|
|
255
|
-
embedIframeRef: _this2.embedIframeRef
|
|
256
|
-
});
|
|
257
|
-
if (!allowResizing || !hasPreview) {
|
|
258
|
-
// There are two ways `width` and `height` can be defined here:
|
|
259
|
-
// 1) Either as `heightAlone` as height value and no width
|
|
260
|
-
// 2) or as `1` for height and aspectRation (defined or a default one) as a width
|
|
261
|
-
// See above for how aspectRation is calculated.
|
|
262
|
-
var defaultAspectRatio = _editorSharedStyles.DEFAULT_EMBED_CARD_WIDTH / _editorSharedStyles.DEFAULT_EMBED_CARD_HEIGHT;
|
|
263
|
-
var richMediaWrapperHeight = 1;
|
|
264
|
-
var richMediaWrapperWidth = aspectRatio || defaultAspectRatio;
|
|
265
|
-
if (heightAlone) {
|
|
266
|
-
richMediaWrapperHeight = heightAlone;
|
|
267
|
-
richMediaWrapperWidth = undefined;
|
|
268
|
-
}
|
|
269
|
-
return /*#__PURE__*/_react.default.createElement(_ui.MediaSingle, (0, _extends2.default)({}, cardProps, {
|
|
270
|
-
height: richMediaWrapperHeight,
|
|
271
|
-
width: richMediaWrapperWidth,
|
|
272
|
-
nodeType: "embedCard",
|
|
273
|
-
hasFallbackContainer: hasPreview,
|
|
274
|
-
lineLength: lineLength,
|
|
275
|
-
containerWidth: containerWidth
|
|
276
|
-
}), smartCard);
|
|
277
|
-
}
|
|
278
|
-
return /*#__PURE__*/_react.default.createElement(_ResizableEmbedCard.default, (0, _extends2.default)({}, cardProps, {
|
|
279
|
-
height: heightAlone,
|
|
280
|
-
aspectRatio: aspectRatio,
|
|
281
|
-
view: _this2.props.view,
|
|
282
|
-
getPos: getPos,
|
|
283
|
-
lineLength: lineLength,
|
|
284
|
-
gridSize: 12,
|
|
285
|
-
containerWidth: containerWidth,
|
|
286
|
-
displayGrid: (0, _grid.createDisplayGrid)(_this2.props.eventDispatcher),
|
|
287
|
-
updateSize: _this2.updateSize,
|
|
288
|
-
dispatchAnalyticsEvent: dispatchAnalyticsEvent
|
|
289
|
-
}), smartCard);
|
|
290
|
-
}
|
|
307
|
+
}, /*#__PURE__*/_react.default.createElement(CardInner, {
|
|
308
|
+
pluginInjectionApi: pluginInjectionApi,
|
|
309
|
+
smartCard: smartCard,
|
|
310
|
+
hasPreview: hasPreview,
|
|
311
|
+
getPosSafely: this.getPosSafely,
|
|
312
|
+
view: view,
|
|
313
|
+
getLineLength: this.getLineLength,
|
|
314
|
+
eventDispatcher: this.props.eventDispatcher,
|
|
315
|
+
updateSize: this.updateSize,
|
|
316
|
+
getPos: getPos,
|
|
317
|
+
aspectRatio: aspectRatio,
|
|
318
|
+
allowResizing: allowResizing,
|
|
319
|
+
heightAlone: heightAlone,
|
|
320
|
+
cardProps: cardProps,
|
|
321
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent
|
|
291
322
|
}));
|
|
292
323
|
|
|
293
324
|
// [WS-2307]: we only render card wrapped into a Provider when the value is ready
|
|
@@ -338,7 +369,8 @@ var EmbedCard = /*#__PURE__*/function (_SelectionBasedNodeVi) {
|
|
|
338
369
|
allowResizing = _this$reactComponentP.allowResizing,
|
|
339
370
|
platform = _this$reactComponentP.platform,
|
|
340
371
|
fullWidthMode = _this$reactComponentP.fullWidthMode,
|
|
341
|
-
dispatchAnalyticsEvent = _this$reactComponentP.dispatchAnalyticsEvent
|
|
372
|
+
dispatchAnalyticsEvent = _this$reactComponentP.dispatchAnalyticsEvent,
|
|
373
|
+
pluginInjectionApi = _this$reactComponentP.pluginInjectionApi;
|
|
342
374
|
return /*#__PURE__*/_react.default.createElement(WrappedBlockCard, {
|
|
343
375
|
node: this.node,
|
|
344
376
|
view: this.view,
|
|
@@ -347,7 +379,8 @@ var EmbedCard = /*#__PURE__*/function (_SelectionBasedNodeVi) {
|
|
|
347
379
|
allowResizing: allowResizing,
|
|
348
380
|
platform: platform,
|
|
349
381
|
fullWidthMode: fullWidthMode,
|
|
350
|
-
dispatchAnalyticsEvent: dispatchAnalyticsEvent
|
|
382
|
+
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
383
|
+
pluginInjectionApi: pluginInjectionApi
|
|
351
384
|
});
|
|
352
385
|
}
|
|
353
386
|
}]);
|
|
@@ -93,13 +93,14 @@ function Card(SmartCardComponent, UnsupportedComponent) {
|
|
|
93
93
|
var _this$props = this.props,
|
|
94
94
|
view = _this$props.view,
|
|
95
95
|
node = _this$props.node,
|
|
96
|
-
getPos = _this$props.getPos
|
|
96
|
+
getPos = _this$props.getPos,
|
|
97
|
+
pluginInjectionApi = _this$props.pluginInjectionApi;
|
|
97
98
|
var _titleUrlPairFromNode2 = (0, _utils.titleUrlPairFromNode)(node),
|
|
98
99
|
url = _titleUrlPairFromNode2.url;
|
|
99
100
|
if (!getPos || typeof getPos === 'boolean') {
|
|
100
101
|
return;
|
|
101
102
|
}
|
|
102
|
-
(0, _doc.changeSelectedCardToLinkFallback)(undefined, url, true, node, getPos())(view.state, view.dispatch);
|
|
103
|
+
(0, _doc.changeSelectedCardToLinkFallback)(undefined, url, true, node, getPos(), pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.analytics.actions)(view.state, view.dispatch);
|
|
103
104
|
return null;
|
|
104
105
|
} else {
|
|
105
106
|
// Otherwise, render a blue link as fallback (above in render()).
|
|
@@ -14,19 +14,18 @@ var _analytics = require("@atlaskit/editor-common/analytics");
|
|
|
14
14
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
15
15
|
var _card = require("@atlaskit/editor-common/card");
|
|
16
16
|
var _steps = require("@atlaskit/adf-schema/steps");
|
|
17
|
-
var _pmHistoryTypes = require("../../../history/pm-history-types");
|
|
18
17
|
var _state = require("../util/state");
|
|
19
18
|
var _pluginKey = require("../plugin-key");
|
|
20
19
|
var _utils2 = require("./utils");
|
|
21
20
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
22
21
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
23
|
-
var findLinksInNodeRange = function findLinksInNodeRange(
|
|
22
|
+
var findLinksInNodeRange = function findLinksInNodeRange(doc, schema, from, to) {
|
|
24
23
|
var links = [];
|
|
25
|
-
|
|
24
|
+
doc.nodesBetween(from, to, function (node, pos) {
|
|
26
25
|
if ((0, _utils2.isLink)(schema, node)) {
|
|
27
26
|
var entireLinkInRange = pos >= from && pos + node.nodeSize <= to;
|
|
28
27
|
if (entireLinkInRange) {
|
|
29
|
-
var link = (0, _utils2.linkObjectFromNode)(schema, node, pos);
|
|
28
|
+
var link = (0, _utils2.linkObjectFromNode)(doc, schema, node, pos);
|
|
30
29
|
if (link) {
|
|
31
30
|
links.push(link);
|
|
32
31
|
}
|
|
@@ -44,15 +43,18 @@ var findChangedLinks = function findChangedLinks(tr, state) {
|
|
|
44
43
|
var isResolveReplace = isTransactionResolveReplace(tr);
|
|
45
44
|
|
|
46
45
|
// History
|
|
47
|
-
var historyMeta = tr.getMeta(
|
|
46
|
+
var historyMeta = tr.getMeta(_utils.pmHistoryPluginKey);
|
|
48
47
|
var isUndo = isHistoryMeta(historyMeta) && historyMeta.redo === false;
|
|
49
48
|
var isRedo = isHistoryMeta(historyMeta) && historyMeta.redo === true;
|
|
50
49
|
var isUpdate = isUpdateTr(tr, isUndo || isRedo);
|
|
51
50
|
var _loop = function _loop(i) {
|
|
51
|
+
var _tr$docs$i, _tr$docs;
|
|
52
52
|
var step = tr.steps[i];
|
|
53
53
|
var stepMap = step.getMap();
|
|
54
54
|
var removedInStep = [];
|
|
55
55
|
var insertedInStep = [];
|
|
56
|
+
var before = (_tr$docs$i = tr.docs[i]) !== null && _tr$docs$i !== void 0 ? _tr$docs$i : tr.before;
|
|
57
|
+
var after = (_tr$docs = tr.docs[i + 1]) !== null && _tr$docs !== void 0 ? _tr$docs : tr.doc;
|
|
56
58
|
|
|
57
59
|
/**
|
|
58
60
|
* AddMarkStep and RemoveMarkSteps don't produce stepMap ranges
|
|
@@ -68,27 +70,26 @@ var findChangedLinks = function findChangedLinks(tr, state) {
|
|
|
68
70
|
insertedInStep.push({
|
|
69
71
|
type: 'mark',
|
|
70
72
|
pos: addMarkStep.from,
|
|
71
|
-
mark: addMarkStep.mark
|
|
73
|
+
mark: addMarkStep.mark,
|
|
74
|
+
nodeContext: (0, _utils2.getLinkNodeContext)(after, addMarkStep.from)
|
|
72
75
|
});
|
|
73
76
|
}
|
|
74
77
|
}
|
|
75
78
|
if (step instanceof _prosemirrorTransform.RemoveMarkStep) {
|
|
76
79
|
var removeMarkStep = step;
|
|
77
80
|
if ((0, _utils.isLinkMark)(removeMarkStep.mark, schema)) {
|
|
78
|
-
/**
|
|
79
|
-
* For url text pasted on plain text
|
|
80
|
-
*/
|
|
81
81
|
removedInStep.push({
|
|
82
82
|
type: 'mark',
|
|
83
83
|
pos: removeMarkStep.from,
|
|
84
|
-
mark: removeMarkStep.mark
|
|
84
|
+
mark: removeMarkStep.mark,
|
|
85
|
+
nodeContext: (0, _utils2.getLinkNodeContext)(before, removeMarkStep.from)
|
|
85
86
|
});
|
|
86
87
|
}
|
|
87
88
|
}
|
|
88
89
|
stepMap.forEach(function (oldStart, oldEnd, newStart, newEnd) {
|
|
89
|
-
var _tr$
|
|
90
|
+
var _tr$docs2;
|
|
90
91
|
var before = tr.docs[i];
|
|
91
|
-
var after = (_tr$
|
|
92
|
+
var after = (_tr$docs2 = tr.docs[i + 1]) !== null && _tr$docs2 !== void 0 ? _tr$docs2 : tr.doc;
|
|
92
93
|
var removedInRange = [];
|
|
93
94
|
var insertedInRange = [];
|
|
94
95
|
|
|
@@ -137,6 +138,19 @@ var findChangedLinks = function findChangedLinks(tr, state) {
|
|
|
137
138
|
inserted.push.apply(inserted, (0, _toConsumableArray2.default)((0, _utils2.findLinksAtPositions)(tr, positions)));
|
|
138
139
|
}
|
|
139
140
|
if (!isUpdate) {
|
|
141
|
+
var _getLinkMetadataFromT = (0, _card.getLinkMetadataFromTransaction)(tr),
|
|
142
|
+
inputMethod = _getLinkMetadataFromT.inputMethod;
|
|
143
|
+
/**
|
|
144
|
+
* If there is no identifiable input method, and the links inserted and removed appear to be the same,
|
|
145
|
+
* then this transaction likely is not intended to be consided to be the insertion and removal of links
|
|
146
|
+
*/
|
|
147
|
+
if (!inputMethod && (0, _utils2.areSameLinks)(removed, inserted)) {
|
|
148
|
+
return {
|
|
149
|
+
removed: [],
|
|
150
|
+
inserted: [],
|
|
151
|
+
updated: updated
|
|
152
|
+
};
|
|
153
|
+
}
|
|
140
154
|
return {
|
|
141
155
|
removed: removed,
|
|
142
156
|
inserted: inserted,
|
|
@@ -266,17 +280,17 @@ function eventsFromTransaction(tr, state) {
|
|
|
266
280
|
if (isRemote || isReplaceDocument) {
|
|
267
281
|
return events;
|
|
268
282
|
}
|
|
269
|
-
var historyMeta = tr.getMeta(
|
|
283
|
+
var historyMeta = tr.getMeta(_utils.pmHistoryPluginKey);
|
|
270
284
|
var isUndo = isHistoryMeta(historyMeta) && historyMeta.redo === false;
|
|
271
285
|
var isRedo = isHistoryMeta(historyMeta) && historyMeta.redo === true;
|
|
272
286
|
|
|
273
287
|
/**
|
|
274
288
|
* Retrieve metadata from the LinkMetaStep(s) in the transaction
|
|
275
289
|
*/
|
|
276
|
-
var
|
|
277
|
-
action =
|
|
278
|
-
inputMethod =
|
|
279
|
-
sourceEvent =
|
|
290
|
+
var _getLinkMetadataFromT2 = (0, _card.getLinkMetadataFromTransaction)(tr),
|
|
291
|
+
action = _getLinkMetadataFromT2.action,
|
|
292
|
+
inputMethod = _getLinkMetadataFromT2.inputMethod,
|
|
293
|
+
sourceEvent = _getLinkMetadataFromT2.sourceEvent;
|
|
280
294
|
var contextualData = {
|
|
281
295
|
action: action,
|
|
282
296
|
inputMethod: inputMethod,
|
|
@@ -288,7 +302,7 @@ function eventsFromTransaction(tr, state) {
|
|
|
288
302
|
removed = _findChangedLinks.removed,
|
|
289
303
|
inserted = _findChangedLinks.inserted,
|
|
290
304
|
updated = _findChangedLinks.updated;
|
|
291
|
-
var MAX_LINK_EVENTS =
|
|
305
|
+
var MAX_LINK_EVENTS = 50;
|
|
292
306
|
if ([removed, inserted, updated].some(function (arr) {
|
|
293
307
|
return arr.length > MAX_LINK_EVENTS;
|
|
294
308
|
})) {
|
|
@@ -307,7 +321,8 @@ function eventsFromTransaction(tr, state) {
|
|
|
307
321
|
data: _objectSpread(_objectSpread({}, contextualData), {}, {
|
|
308
322
|
url: url,
|
|
309
323
|
display: display,
|
|
310
|
-
previousDisplay: previousDisplay
|
|
324
|
+
previousDisplay: previousDisplay,
|
|
325
|
+
nodeContext: link.nodeContext
|
|
311
326
|
})
|
|
312
327
|
});
|
|
313
328
|
}
|
|
@@ -322,7 +337,8 @@ function eventsFromTransaction(tr, state) {
|
|
|
322
337
|
type: type,
|
|
323
338
|
data: _objectSpread(_objectSpread({}, contextualData), {}, {
|
|
324
339
|
url: _url,
|
|
325
|
-
display: _display
|
|
340
|
+
display: _display,
|
|
341
|
+
nodeContext: _link.nodeContext
|
|
326
342
|
})
|
|
327
343
|
});
|
|
328
344
|
}
|