@atlaskit/editor-core 183.0.12 → 183.1.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 +28 -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 +22 -15
- 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
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 183.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`6bc52e5a406`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6bc52e5a406) - [ED-17687] Capture errors caught in error boundaries in Sentry
|
|
8
|
+
- [`5cc449dac8d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5cc449dac8d) - Decouple card plugin so that it uses new NextEditorPlugin for any injected dependencies.
|
|
9
|
+
- [`4dcb7845a4d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4dcb7845a4d) - COLLAB-2425 Fixed mediasingle resize issue.
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`2ce80b34bff`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2ce80b34bff) - Add platform feature flag in editor example page
|
|
14
|
+
- [`8a391616ecc`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8a391616ecc) - Moving insert node API to a new editor plugin to allow it to be more extensible. Also exposing a new editor plugin action for tables to allow for consistent insertion.
|
|
15
|
+
- [`9220da2225b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9220da2225b) - ED-16320: Add checks to certain SLO related events to see if they are explicitly disabled, in preparation for disabling them for synthetic tenants in prod
|
|
16
|
+
- [`e6e4b524824`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e6e4b524824) - Minor refactor to toolbar insert block props.
|
|
17
|
+
- [`06ec9abd06e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/06ec9abd06e) - Add nodeContext attribute to link analytics
|
|
18
|
+
- [`b804d3ad561`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b804d3ad561) - Remove unused code related to GASv2 table analytics from editor-plugin table, editor-core and editor-common
|
|
19
|
+
- [`6550d08f5af`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6550d08f5af) - [ux] Color picker button should not be focused after selecting color.
|
|
20
|
+
- [`9ddf10cda28`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9ddf10cda28) - Bumps maximum number of link analytics callbacks for any given transaction.
|
|
21
|
+
- [`017e02e34db`](https://bitbucket.org/atlassian/atlassian-frontend/commits/017e02e34db) - ED-17539 Redo for multiple statues are working now.
|
|
22
|
+
- [`8d4d36690ec`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8d4d36690ec) - Updates lpAnalyticsEventsNext feature flag link events to ignore transactions where inserted and deleted links appear to be identical.
|
|
23
|
+
- [`e20cca743c4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e20cca743c4) - Moving editor analytics plugin to new package.
|
|
24
|
+
- [`f621ae6490a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f621ae6490a) - Adding type dependency on analytics plugin to tables plugin.
|
|
25
|
+
- [`a142ba1aa28`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a142ba1aa28) - [ED17172] Bump prosemirror-model to 1.16.0 and prosemirror-view to 1.23.7 and removed work-arounds for fixed issues
|
|
26
|
+
- [`be561d3491c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/be561d3491c) - [ED-17622] Adds styles and creates an example for the new Resizer component
|
|
27
|
+
- [`9369cc38a68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9369cc38a68) - Migrated use of `gridSize` to space tokens where possible. There is no expected visual or behaviour change.
|
|
28
|
+
- [`acaceaa764e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/acaceaa764e) - [ux] ED-17308 fix paste action item in panel. It should paste below panel (or decision)
|
|
29
|
+
- Updated dependencies
|
|
30
|
+
|
|
3
31
|
## 183.0.12
|
|
4
32
|
|
|
5
33
|
### Patch Changes
|
|
@@ -166,22 +166,7 @@ var EditorActions = /*#__PURE__*/function () {
|
|
|
166
166
|
if (!this.editorView || this.editorView.hasFocus()) {
|
|
167
167
|
return false;
|
|
168
168
|
}
|
|
169
|
-
|
|
170
|
-
// If we focus on componentDidMount the editor can crash due to a prosemirror error.
|
|
171
|
-
// This is fixed in prosemirror-view@1.23.7
|
|
172
|
-
// See: https:github.com/ProseMirror/prosemirror-view/commit/735b88107d1cbe7575a188edb85f05c22fb56e35
|
|
173
|
-
//
|
|
174
|
-
// We don't want this error to crash the editor in the case we can't
|
|
175
|
-
// focus correctly.
|
|
176
|
-
// Revert workaround in: https://product-fabric.atlassian.net/browse/ED-17172
|
|
177
|
-
try {
|
|
178
|
-
this.editorView.focus();
|
|
179
|
-
} catch (err) {
|
|
180
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
181
|
-
// eslint-disable-next-line no-console
|
|
182
|
-
console.error('EditorView focus failed with an error', err);
|
|
183
|
-
}
|
|
184
|
-
}
|
|
169
|
+
this.editorView.focus();
|
|
185
170
|
this.editorView.dispatch(this.editorView.state.tr.scrollIntoView());
|
|
186
171
|
return true;
|
|
187
172
|
}
|
|
@@ -19,10 +19,12 @@ var _uuid = _interopRequireDefault(require("uuid"));
|
|
|
19
19
|
var _ufo = require("@atlaskit/editor-common/ufo");
|
|
20
20
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
21
21
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
22
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
22
23
|
var _analytics = require("../plugins/analytics");
|
|
23
24
|
var _consts = require("../plugins/analytics/consts");
|
|
24
25
|
var _documentLogger = require("../utils/document-logger");
|
|
25
26
|
var _WithEditorView = require("./WithEditorView");
|
|
27
|
+
var _monitoring = require("@atlaskit/editor-common/monitoring");
|
|
26
28
|
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; }
|
|
27
29
|
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; }
|
|
28
30
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
@@ -55,7 +57,7 @@ var ErrorBoundaryWithEditorView = /*#__PURE__*/function (_React$Component) {
|
|
|
55
57
|
attributes = {
|
|
56
58
|
product: product,
|
|
57
59
|
browserInfo: browserInfo,
|
|
58
|
-
error: error,
|
|
60
|
+
error: error.toString(),
|
|
59
61
|
errorInfo: errorInfo,
|
|
60
62
|
errorId: sharedId,
|
|
61
63
|
browserExtensions: _this.browserExtensions,
|
|
@@ -86,7 +88,13 @@ var ErrorBoundaryWithEditorView = /*#__PURE__*/function (_React$Component) {
|
|
|
86
88
|
errorStack: errorStack
|
|
87
89
|
}));
|
|
88
90
|
}
|
|
89
|
-
|
|
91
|
+
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.sentry-error-monitoring_6bksu')) {
|
|
92
|
+
(0, _monitoring.logException)(error, {
|
|
93
|
+
location: 'editor-core/create-editor',
|
|
94
|
+
product: product
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
case 11:
|
|
90
98
|
case "end":
|
|
91
99
|
return _context.stop();
|
|
92
100
|
}
|
|
@@ -150,11 +158,13 @@ var ErrorBoundaryWithEditorView = /*#__PURE__*/function (_React$Component) {
|
|
|
150
158
|
key: "componentDidCatch",
|
|
151
159
|
value: function componentDidCatch(error, errorInfo) {
|
|
152
160
|
var _this2 = this;
|
|
153
|
-
this.
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
161
|
+
if (this.props.errorTracking) {
|
|
162
|
+
this.sendErrorData({
|
|
163
|
+
error: error,
|
|
164
|
+
errorInfo: errorInfo,
|
|
165
|
+
errorStack: error.stack
|
|
166
|
+
});
|
|
167
|
+
}
|
|
158
168
|
|
|
159
169
|
// // Update state to allow a re-render to attempt graceful recovery (in the event that
|
|
160
170
|
// // the error was caused by a race condition or is intermittent)
|
|
@@ -208,7 +218,8 @@ var ErrorBoundaryWithEditorView = /*#__PURE__*/function (_React$Component) {
|
|
|
208
218
|
}(_react.default.Component);
|
|
209
219
|
exports.ErrorBoundaryWithEditorView = ErrorBoundaryWithEditorView;
|
|
210
220
|
(0, _defineProperty2.default)(ErrorBoundaryWithEditorView, "defaultProps", {
|
|
211
|
-
rethrow: true
|
|
221
|
+
rethrow: true,
|
|
222
|
+
errorTracking: true
|
|
212
223
|
});
|
|
213
224
|
var _default = (0, _WithEditorView.WithEditorView)(ErrorBoundaryWithEditorView);
|
|
214
225
|
exports.default = _default;
|
|
@@ -60,6 +60,7 @@ var ReactEditorView = /*#__PURE__*/function (_React$Component) {
|
|
|
60
60
|
(0, _inherits2.default)(ReactEditorView, _React$Component);
|
|
61
61
|
var _super = _createSuper(ReactEditorView);
|
|
62
62
|
function ReactEditorView(props, context) {
|
|
63
|
+
var _props$editorProps, _props$editorProps$pe, _props$editorProps$pe2;
|
|
63
64
|
var _this;
|
|
64
65
|
(0, _classCallCheck2.default)(this, ReactEditorView);
|
|
65
66
|
_this = _super.call(this, props, context);
|
|
@@ -219,7 +220,7 @@ var ReactEditorView = /*#__PURE__*/function (_React$Component) {
|
|
|
219
220
|
});
|
|
220
221
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "trackValidTransactions", function () {
|
|
221
222
|
var editorProps = _this.props.editorProps;
|
|
222
|
-
if (editorProps !== null && editorProps !== void 0 && editorProps.trackValidTransactions) {
|
|
223
|
+
if (!_this.isTransactionTrackingExplicitlyDisabled() && editorProps !== null && editorProps !== void 0 && editorProps.trackValidTransactions) {
|
|
223
224
|
_this.validTransactionCount++;
|
|
224
225
|
var samplingRate = (0, _typeof2.default)(editorProps.trackValidTransactions) === 'object' && editorProps.trackValidTransactions.samplingRate || _consts.DEFAULT_SAMPLING_RATE_VALID_TRANSACTIONS;
|
|
225
226
|
if (_this.validTransactionCount >= samplingRate) {
|
|
@@ -327,15 +328,17 @@ var ReactEditorView = /*#__PURE__*/function (_React$Component) {
|
|
|
327
328
|
compact: true
|
|
328
329
|
});
|
|
329
330
|
});
|
|
330
|
-
_this.
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
331
|
+
if (!_this.isTransactionTrackingExplicitlyDisabled()) {
|
|
332
|
+
_this.dispatchAnalyticsEvent({
|
|
333
|
+
action: _analytics.ACTION.DISPATCHED_INVALID_TRANSACTION,
|
|
334
|
+
actionSubject: _analytics.ACTION_SUBJECT.EDITOR,
|
|
335
|
+
eventType: _analytics.EVENT_TYPE.OPERATIONAL,
|
|
336
|
+
attributes: {
|
|
337
|
+
analyticsEventPayloads: (0, _analytics.getAnalyticsEventsFromTransaction)(transaction),
|
|
338
|
+
invalidNodes: invalidNodes
|
|
339
|
+
}
|
|
340
|
+
});
|
|
341
|
+
}
|
|
339
342
|
(_this$experienceStore8 = _this.experienceStore) === null || _this$experienceStore8 === void 0 ? void 0 : _this$experienceStore8.fail(_ufo.EditorExperience.interaction, {
|
|
340
343
|
reason: 'invalid transaction',
|
|
341
344
|
invalidNodes: invalidNodes.toString()
|
|
@@ -531,15 +534,22 @@ var ReactEditorView = /*#__PURE__*/function (_React$Component) {
|
|
|
531
534
|
// ED-4759: Don't set selection at end for full-page editor - should be at start.
|
|
532
535
|
selectionAtStart: (0, _isFullPage.isFullPage)(props.editorProps.appearance)
|
|
533
536
|
});
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
537
|
+
|
|
538
|
+
// ED-16320: Check for explicit disable so that by default
|
|
539
|
+
// it will still be enabled as it currently is. Then we can
|
|
540
|
+
// progressively opt out synthetic tenants.
|
|
541
|
+
var isEditorStartedExplicitlyDisabled = ((_props$editorProps = props.editorProps) === null || _props$editorProps === void 0 ? void 0 : (_props$editorProps$pe = _props$editorProps.performanceTracking) === null || _props$editorProps$pe === void 0 ? void 0 : (_props$editorProps$pe2 = _props$editorProps$pe.startedTracking) === null || _props$editorProps$pe2 === void 0 ? void 0 : _props$editorProps$pe2.enabled) === false;
|
|
542
|
+
if (!isEditorStartedExplicitlyDisabled) {
|
|
543
|
+
_this.dispatchAnalyticsEvent({
|
|
544
|
+
action: _analytics.ACTION.STARTED,
|
|
545
|
+
actionSubject: _analytics.ACTION_SUBJECT.EDITOR,
|
|
546
|
+
attributes: {
|
|
547
|
+
platform: _analytics.PLATFORMS.WEB,
|
|
548
|
+
featureFlags: featureFlagsEnabled
|
|
549
|
+
},
|
|
550
|
+
eventType: _analytics.EVENT_TYPE.UI
|
|
551
|
+
});
|
|
552
|
+
}
|
|
543
553
|
return _this;
|
|
544
554
|
}
|
|
545
555
|
(0, _createClass2.default)(ReactEditorView, [{
|
|
@@ -562,6 +572,15 @@ var ReactEditorView = /*#__PURE__*/function (_React$Component) {
|
|
|
562
572
|
value: function countNodes() {
|
|
563
573
|
return (0, _countNodes2.countNodes)(this.editorState);
|
|
564
574
|
}
|
|
575
|
+
}, {
|
|
576
|
+
key: "isTransactionTrackingExplicitlyDisabled",
|
|
577
|
+
value: function isTransactionTrackingExplicitlyDisabled() {
|
|
578
|
+
var _this$props$editorPro9, _this$props$editorPro10, _this$props$editorPro11;
|
|
579
|
+
// ED-16320: Check for explicit disable so that by default
|
|
580
|
+
// it will still be enabled as it currently is. Then we can
|
|
581
|
+
// progressively opt out synthetic tenants.
|
|
582
|
+
return ((_this$props$editorPro9 = this.props.editorProps) === null || _this$props$editorPro9 === void 0 ? void 0 : (_this$props$editorPro10 = _this$props$editorPro9.performanceTracking) === null || _this$props$editorPro10 === void 0 ? void 0 : (_this$props$editorPro11 = _this$props$editorPro10.transactionTracking) === null || _this$props$editorPro11 === void 0 ? void 0 : _this$props$editorPro11.enabled) === false;
|
|
583
|
+
}
|
|
565
584
|
}, {
|
|
566
585
|
key: "UNSAFE_componentWillReceiveProps",
|
|
567
586
|
value: function UNSAFE_componentWillReceiveProps(nextProps) {
|
|
@@ -708,8 +727,8 @@ var ReactEditorView = /*#__PURE__*/function (_React$Component) {
|
|
|
708
727
|
}, {
|
|
709
728
|
key: "render",
|
|
710
729
|
value: function render() {
|
|
711
|
-
var _this$props$
|
|
712
|
-
var renderTracking = (_this$props$
|
|
730
|
+
var _this$props$editorPro12, _this$props$editorPro13;
|
|
731
|
+
var renderTracking = (_this$props$editorPro12 = this.props.editorProps.performanceTracking) === null || _this$props$editorPro12 === void 0 ? void 0 : (_this$props$editorPro13 = _this$props$editorPro12.renderTracking) === null || _this$props$editorPro13 === void 0 ? void 0 : _this$props$editorPro13.reactEditorView;
|
|
713
732
|
var renderTrackingEnabled = renderTracking === null || renderTracking === void 0 ? void 0 : renderTracking.enabled;
|
|
714
733
|
var useShallow = renderTracking === null || renderTracking === void 0 ? void 0 : renderTracking.useShallow;
|
|
715
734
|
return /*#__PURE__*/_react.default.createElement(_ReactEditorViewContext.default.Provider, {
|
|
@@ -46,7 +46,7 @@ function EditorInternal(props) {
|
|
|
46
46
|
* from the `render` method of `Editor` and share it with `EditorNext`.
|
|
47
47
|
*/
|
|
48
48
|
function EditorInternalWithoutHooks(_ref) {
|
|
49
|
-
var _props$performanceTra, _props$performanceTra2;
|
|
49
|
+
var _props$performanceTra, _props$performanceTra2, _props$performanceTra3, _props$performanceTra4;
|
|
50
50
|
var props = _ref.props,
|
|
51
51
|
handleAnalyticsEvent = _ref.handleAnalyticsEvent,
|
|
52
52
|
createAnalyticsEvent = _ref.createAnalyticsEvent,
|
|
@@ -66,6 +66,10 @@ function EditorInternalWithoutHooks(_ref) {
|
|
|
66
66
|
var renderTracking = (_props$performanceTra = props.performanceTracking) === null || _props$performanceTra === void 0 ? void 0 : (_props$performanceTra2 = _props$performanceTra.renderTracking) === null || _props$performanceTra2 === void 0 ? void 0 : _props$performanceTra2.editor;
|
|
67
67
|
var renderTrackingEnabled = renderTracking === null || renderTracking === void 0 ? void 0 : renderTracking.enabled;
|
|
68
68
|
var useShallow = renderTracking === null || renderTracking === void 0 ? void 0 : renderTracking.useShallow;
|
|
69
|
+
// ED-16320: Check for explicit disable so that by default
|
|
70
|
+
// it will still be enabled as it currently is. Then we can
|
|
71
|
+
// progressively opt out synthetic tenants.
|
|
72
|
+
var isErrorTrackingExplicitlyDisabled = ((_props$performanceTra3 = props.performanceTracking) === null || _props$performanceTra3 === void 0 ? void 0 : (_props$performanceTra4 = _props$performanceTra3.errorTracking) === null || _props$performanceTra4 === void 0 ? void 0 : _props$performanceTra4.enabled) === false;
|
|
69
73
|
return (0, _react.jsx)(_react2.Fragment, null, renderTrackingEnabled && (0, _react.jsx)(_RenderTracking.RenderTracking, {
|
|
70
74
|
componentProps: props,
|
|
71
75
|
action: _analytics.ACTION.RE_RENDERED,
|
|
@@ -74,6 +78,7 @@ function EditorInternalWithoutHooks(_ref) {
|
|
|
74
78
|
propsToIgnore: ['defaultValue'],
|
|
75
79
|
useShallow: useShallow
|
|
76
80
|
}), (0, _react.jsx)(_ErrorBoundary.default, {
|
|
81
|
+
errorTracking: !isErrorTrackingExplicitlyDisabled,
|
|
77
82
|
createAnalyticsEvent: createAnalyticsEvent,
|
|
78
83
|
contextIdentifierProvider: props.contextIdentifierProvider,
|
|
79
84
|
featureFlags: featureFlags
|
|
@@ -7,21 +7,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.createStubInternalApis = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
10
|
-
var _editorPluginTable = require("@atlaskit/editor-plugin-table");
|
|
11
10
|
var _api = require("../../../selection-api/api");
|
|
12
|
-
var _api2 = require("../../../insert-api/api");
|
|
13
11
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
14
|
-
var _attachPayloadIntoTransaction = require("../../../analytics-api/attach-payload-into-transaction");
|
|
15
|
-
var _analyticsListeners = require("@atlaskit/analytics-listeners");
|
|
16
12
|
/**
|
|
17
13
|
* DO NOT USE THIS FUNCTION
|
|
18
14
|
*
|
|
19
15
|
* IT IS A TEMPORARY PLACEHOLDER UNTIL THOSE TICKETS XX-11111 XX-22222 are done
|
|
20
16
|
**/
|
|
21
17
|
var createStubInternalApis = function createStubInternalApis() {
|
|
22
|
-
var editorViewRef = {
|
|
23
|
-
current: null
|
|
24
|
-
};
|
|
25
18
|
var createAnalyticsEventRef = {
|
|
26
19
|
current: null
|
|
27
20
|
};
|
|
@@ -43,35 +36,6 @@ var createStubInternalApis = function createStubInternalApis() {
|
|
|
43
36
|
};
|
|
44
37
|
};
|
|
45
38
|
var editorSelectionAPI = (0, _api.createEditorSelectionAPI)();
|
|
46
|
-
var editorAnalyticsAPI = {
|
|
47
|
-
attachAnalyticsEvent: function attachAnalyticsEvent(payload) {
|
|
48
|
-
return function (tr) {
|
|
49
|
-
var editorView = editorViewRef.current;
|
|
50
|
-
if (!tr || !createAnalyticsEvent || !editorView) {
|
|
51
|
-
return false;
|
|
52
|
-
}
|
|
53
|
-
(0, _attachPayloadIntoTransaction.attachPayloadIntoTransaction)({
|
|
54
|
-
tr: tr,
|
|
55
|
-
editorState: editorView.state,
|
|
56
|
-
payload: payload,
|
|
57
|
-
channel: _analyticsListeners.FabricChannel.editor
|
|
58
|
-
});
|
|
59
|
-
return true;
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
var insertNodeAPI = (0, _api2.createInsertNodeAPI)({
|
|
64
|
-
getEditorView: function getEditorView() {
|
|
65
|
-
return editorViewRef.current;
|
|
66
|
-
},
|
|
67
|
-
getEditorPlugins: function getEditorPlugins() {
|
|
68
|
-
var fakeTablePlugin = (0, _editorPluginTable.tablesPlugin)();
|
|
69
|
-
if (!(fakeTablePlugin !== null && fakeTablePlugin !== void 0 && fakeTablePlugin.pluginsOptions)) {
|
|
70
|
-
return [];
|
|
71
|
-
}
|
|
72
|
-
return [fakeTablePlugin];
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
39
|
var MountCreateAnalyticsEventRef = function MountCreateAnalyticsEventRef() {
|
|
76
40
|
var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
|
|
77
41
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
@@ -88,11 +52,9 @@ var createStubInternalApis = function createStubInternalApis() {
|
|
|
88
52
|
name: 'stubInternalApisPMPlugin',
|
|
89
53
|
plugin: function plugin() {
|
|
90
54
|
return new _safePlugin.SafePlugin({
|
|
91
|
-
view: function view(
|
|
92
|
-
editorViewRef.current = editorView;
|
|
55
|
+
view: function view() {
|
|
93
56
|
return {
|
|
94
57
|
destroy: function destroy() {
|
|
95
|
-
editorViewRef.current = null;
|
|
96
58
|
createAnalyticsEventRef.current = null;
|
|
97
59
|
}
|
|
98
60
|
};
|
|
@@ -108,8 +70,6 @@ var createStubInternalApis = function createStubInternalApis() {
|
|
|
108
70
|
};
|
|
109
71
|
return {
|
|
110
72
|
editorSelectionAPI: editorSelectionAPI,
|
|
111
|
-
insertNodeAPI: insertNodeAPI,
|
|
112
|
-
editorAnalyticsAPI: editorAnalyticsAPI,
|
|
113
73
|
createAnalyticsEvent: createAnalyticsEvent,
|
|
114
74
|
stubInternalApisPlugin: stubInternalApisPlugin
|
|
115
75
|
};
|
|
@@ -21,6 +21,8 @@ var _fakeTextCursor = _interopRequireDefault(require("../../../plugins/fake-text
|
|
|
21
21
|
var _editorPluginFeatureFlags = _interopRequireDefault(require("@atlaskit/editor-plugin-feature-flags"));
|
|
22
22
|
var _floatingToolbar = _interopRequireDefault(require("../../../plugins/floating-toolbar"));
|
|
23
23
|
var _clipboard = _interopRequireDefault(require("../../../plugins/clipboard"));
|
|
24
|
+
var _plugins = require("../../../plugins");
|
|
25
|
+
var _editorPluginAnalytics = require("@atlaskit/editor-plugin-analytics");
|
|
24
26
|
var _placeholder = _interopRequireDefault(require("../../../plugins/placeholder"));
|
|
25
27
|
var _annotation = _interopRequireDefault(require("../../../plugins/annotation"));
|
|
26
28
|
var _quickInsert = _interopRequireDefault(require("../../../plugins/quick-insert"));
|
|
@@ -37,7 +39,27 @@ var _preset = require("@atlaskit/editor-common/preset");
|
|
|
37
39
|
* their placement in the editor toolbar
|
|
38
40
|
*/
|
|
39
41
|
function createDefaultPreset(options) {
|
|
40
|
-
var preset = new _preset.EditorPresetBuilder().add([_editorPluginFeatureFlags.default, options.featureFlags || {}]).
|
|
42
|
+
var preset = new _preset.EditorPresetBuilder().add([_editorPluginFeatureFlags.default, options.featureFlags || {}]).maybeAdd(_editorPluginAnalytics.analyticsPlugin, function (plugin, builder) {
|
|
43
|
+
if (options.allowAnalyticsGASV3) {
|
|
44
|
+
var performanceTracking = options.performanceTracking,
|
|
45
|
+
createAnalyticsEvent = options.createAnalyticsEvent;
|
|
46
|
+
return builder.add([plugin, {
|
|
47
|
+
createAnalyticsEvent: createAnalyticsEvent,
|
|
48
|
+
performanceTracking: performanceTracking
|
|
49
|
+
}]);
|
|
50
|
+
}
|
|
51
|
+
return builder;
|
|
52
|
+
}).maybeAdd(_plugins.analyticsPlugin, function (plugin, builder) {
|
|
53
|
+
if (options.allowAnalyticsGASV3) {
|
|
54
|
+
var performanceTracking = options.performanceTracking,
|
|
55
|
+
createAnalyticsEvent = options.createAnalyticsEvent;
|
|
56
|
+
return builder.add([plugin, {
|
|
57
|
+
createAnalyticsEvent: createAnalyticsEvent,
|
|
58
|
+
performanceTracking: performanceTracking
|
|
59
|
+
}]);
|
|
60
|
+
}
|
|
61
|
+
return builder;
|
|
62
|
+
}).add([_paste.default, options.paste]).add(_clipboard.default).add([_base.default, options.base]).maybeAdd(_undoRedo.default, function (p, builder) {
|
|
41
63
|
var _options$featureFlags;
|
|
42
64
|
// The undo redo plugin needs to be add before the blockTypePlugin
|
|
43
65
|
if ((_options$featureFlags = options.featureFlags) !== null && _options$featureFlags !== void 0 && _options$featureFlags.undoRedoButtons) {
|
|
@@ -5,10 +5,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = createUniversalPreset;
|
|
8
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
8
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
9
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
10
|
var _plugins = require("../../../plugins");
|
|
11
|
+
var _card = _interopRequireDefault(require("../../../plugins/card"));
|
|
11
12
|
var _editorPluginTable = require("@atlaskit/editor-plugin-table");
|
|
13
|
+
var _editorPluginContentInsertion = require("@atlaskit/editor-plugin-content-insertion");
|
|
12
14
|
var _isFullPage = require("../../../utils/is-full-page");
|
|
13
15
|
var _mediaCommon = require("@atlaskit/media-common");
|
|
14
16
|
var _default = require("./default");
|
|
@@ -31,16 +33,16 @@ function createUniversalPreset(appearance, props, featureFlags, prevAppearance,
|
|
|
31
33
|
var isMobile = appearance === 'mobile';
|
|
32
34
|
var isComment = appearance === 'comment';
|
|
33
35
|
var isFullPage = (0, _isFullPage.isFullPage)(appearance);
|
|
34
|
-
var defaultPreset = (0, _default.createDefaultPreset)(props);
|
|
35
36
|
var getEditorFeatureFlags = function getEditorFeatureFlags() {
|
|
36
37
|
return featureFlags;
|
|
37
38
|
};
|
|
38
39
|
var stubs = (0, _createStubInternalApis.createStubInternalApis)();
|
|
39
40
|
var editorSelectionAPI = stubs.editorSelectionAPI,
|
|
40
|
-
insertNodeAPI = stubs.insertNodeAPI,
|
|
41
|
-
editorAnalyticsAPI = stubs.editorAnalyticsAPI,
|
|
42
41
|
stubInternalApisPlugin = stubs.stubInternalApisPlugin;
|
|
43
42
|
var createAnalyticsEvent = maybeCreateAnalyticsEvent ? maybeCreateAnalyticsEvent : stubs.createAnalyticsEvent;
|
|
43
|
+
var defaultPreset = (0, _default.createDefaultPreset)(_objectSpread(_objectSpread({}, props), {}, {
|
|
44
|
+
createAnalyticsEvent: createAnalyticsEvent
|
|
45
|
+
}));
|
|
44
46
|
var statusMenuDisabled = !props.allowStatus ? true : (0, _typeof2.default)(props.allowStatus) === 'object' ? Boolean(props.allowStatus.menuDisabled) : false;
|
|
45
47
|
var hasBeforePrimaryToolbar = function hasBeforePrimaryToolbar(components) {
|
|
46
48
|
if (components && 'before' in components) {
|
|
@@ -48,16 +50,7 @@ function createUniversalPreset(appearance, props, featureFlags, prevAppearance,
|
|
|
48
50
|
}
|
|
49
51
|
return false;
|
|
50
52
|
};
|
|
51
|
-
var finalPreset = defaultPreset.add(stubInternalApisPlugin).add(_plugins.dataConsumerMarkPlugin).maybeAdd(_plugins.
|
|
52
|
-
if (props.allowAnalyticsGASV3) {
|
|
53
|
-
var performanceTracking = props.performanceTracking;
|
|
54
|
-
return builder.add([plugin, {
|
|
55
|
-
createAnalyticsEvent: createAnalyticsEvent,
|
|
56
|
-
performanceTracking: performanceTracking
|
|
57
|
-
}]);
|
|
58
|
-
}
|
|
59
|
-
return builder;
|
|
60
|
-
}).maybeAdd(_plugins.breakoutPlugin, function (plugin, builder) {
|
|
53
|
+
var finalPreset = defaultPreset.add(stubInternalApisPlugin).add(_plugins.dataConsumerMarkPlugin).add(_editorPluginContentInsertion.contentInsertionPlugin).maybeAdd(_plugins.breakoutPlugin, function (plugin, builder) {
|
|
61
54
|
if (props.allowBreakout && isFullPage) {
|
|
62
55
|
return builder.add([plugin, {
|
|
63
56
|
allowBreakoutButton: appearance === 'full-page'
|
|
@@ -157,7 +150,6 @@ function createUniversalPreset(appearance, props, featureFlags, prevAppearance,
|
|
|
157
150
|
allowContextualMenu: !isMobile,
|
|
158
151
|
fullWidthEnabled: appearance === 'full-width',
|
|
159
152
|
wasFullWidthEnabled: prevAppearance && prevAppearance === 'full-width',
|
|
160
|
-
editorAnalyticsAPI: editorAnalyticsAPI,
|
|
161
153
|
editorSelectionAPI: editorSelectionAPI,
|
|
162
154
|
getEditorFeatureFlags: getEditorFeatureFlags
|
|
163
155
|
}]);
|
|
@@ -282,7 +274,7 @@ function createUniversalPreset(appearance, props, featureFlags, prevAppearance,
|
|
|
282
274
|
})]);
|
|
283
275
|
}
|
|
284
276
|
return builder;
|
|
285
|
-
}).maybeAdd(
|
|
277
|
+
}).maybeAdd(_card.default, function (plugin, builder) {
|
|
286
278
|
var _props$linking;
|
|
287
279
|
if ((_props$linking = props.linking) !== null && _props$linking !== void 0 && _props$linking.smartLinks || props.smartLinks || props.UNSAFE_cards) {
|
|
288
280
|
var _props$linking2, _props$linking3;
|
|
@@ -349,8 +341,7 @@ function createUniversalPreset(appearance, props, featureFlags, prevAppearance,
|
|
|
349
341
|
horizontalRuleEnabled: props.allowRule,
|
|
350
342
|
nativeStatusSupported: !statusMenuDisabled,
|
|
351
343
|
showElementBrowserLink: props.elementBrowser && props.elementBrowser.showModal || false,
|
|
352
|
-
replacePlusMenuWithElementBrowser: props.elementBrowser && props.elementBrowser.replacePlusMenu || false
|
|
353
|
-
insertNodeAPI: insertNodeAPI
|
|
344
|
+
replacePlusMenuWithElementBrowser: props.elementBrowser && props.elementBrowser.replacePlusMenu || false
|
|
354
345
|
}]).maybeAdd(_plugins.beforePrimaryToolbarPlugin, function (plugin, builder) {
|
|
355
346
|
if (hasBeforePrimaryToolbar(props.primaryToolbarComponents) && !featureFlags.twoLineEditorToolbar) {
|
|
356
347
|
return builder.add([plugin, {
|
|
@@ -161,12 +161,6 @@ Object.defineProperty(exports, "addAnalytics", {
|
|
|
161
161
|
}
|
|
162
162
|
});
|
|
163
163
|
exports.default = exports.analyticsPluginKey = void 0;
|
|
164
|
-
Object.defineProperty(exports, "findInsertLocation", {
|
|
165
|
-
enumerable: true,
|
|
166
|
-
get: function get() {
|
|
167
|
-
return _utils.findInsertLocation;
|
|
168
|
-
}
|
|
169
|
-
});
|
|
170
164
|
Object.defineProperty(exports, "fireAnalyticsEvent", {
|
|
171
165
|
enumerable: true,
|
|
172
166
|
get: function get() {
|
|
@@ -179,24 +173,6 @@ Object.defineProperty(exports, "getAnalyticsEventsFromTransaction", {
|
|
|
179
173
|
return _analytics.getAnalyticsEventsFromTransaction;
|
|
180
174
|
}
|
|
181
175
|
});
|
|
182
|
-
Object.defineProperty(exports, "getSelectionType", {
|
|
183
|
-
enumerable: true,
|
|
184
|
-
get: function get() {
|
|
185
|
-
return _utils.getSelectionType;
|
|
186
|
-
}
|
|
187
|
-
});
|
|
188
|
-
Object.defineProperty(exports, "getStateContext", {
|
|
189
|
-
enumerable: true,
|
|
190
|
-
get: function get() {
|
|
191
|
-
return _utils.getStateContext;
|
|
192
|
-
}
|
|
193
|
-
});
|
|
194
|
-
Object.defineProperty(exports, "mapActionSubjectIdToAttributes", {
|
|
195
|
-
enumerable: true,
|
|
196
|
-
get: function get() {
|
|
197
|
-
return _utils.mapActionSubjectIdToAttributes;
|
|
198
|
-
}
|
|
199
|
-
});
|
|
200
176
|
Object.defineProperty(exports, "withAnalytics", {
|
|
201
177
|
enumerable: true,
|
|
202
178
|
get: function get() {
|
|
@@ -5,5 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.analyticsPluginKey = void 0;
|
|
7
7
|
var _prosemirrorState = require("prosemirror-state");
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* @private
|
|
10
|
+
* @deprecated
|
|
11
|
+
* Do not use the analytics plugin key directly.
|
|
12
|
+
* This will be deprecated soon.
|
|
13
|
+
*/
|
|
14
|
+
var analyticsPluginKey = new _prosemirrorState.PluginKey('deprecatedAnalyticsPlugin');
|
|
9
15
|
exports.analyticsPluginKey = analyticsPluginKey;
|
|
@@ -6,21 +6,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
exports.extendPayload = extendPayload;
|
|
9
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
10
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
10
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
12
11
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
13
12
|
var _types = require("./types");
|
|
14
13
|
var _pluginKey = require("./plugin-key");
|
|
15
14
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
16
|
-
var _steps = require("@atlaskit/adf-schema/steps");
|
|
17
|
-
var _undoRedoInputSource = require("../undo-redo/undo-redo-input-source");
|
|
18
15
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
19
16
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
20
17
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
21
18
|
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
19
|
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
|
-
function createPlugin(options, featureFlags) {
|
|
20
|
+
function createPlugin(options, featureFlags, editorAnalyticsApi) {
|
|
24
21
|
if (!options || !options.createAnalyticsEvent) {
|
|
25
22
|
return;
|
|
26
23
|
}
|
|
@@ -30,7 +27,8 @@ function createPlugin(options, featureFlags) {
|
|
|
30
27
|
state: {
|
|
31
28
|
init: function init() {
|
|
32
29
|
return _objectSpread(_objectSpread({}, options), {}, {
|
|
33
|
-
fireAnalytics: (0, _analytics.fireAnalyticsEvent)(options.createAnalyticsEvent)
|
|
30
|
+
fireAnalytics: (0, _analytics.fireAnalyticsEvent)(options.createAnalyticsEvent),
|
|
31
|
+
editorAnalyticsApi: editorAnalyticsApi
|
|
34
32
|
});
|
|
35
33
|
},
|
|
36
34
|
apply: function apply(tr, pluginState, _, state) {
|
|
@@ -87,59 +85,33 @@ function createPlugin(options, featureFlags) {
|
|
|
87
85
|
}
|
|
88
86
|
});
|
|
89
87
|
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* @private
|
|
91
|
+
* @deprecated
|
|
92
|
+
* Do not use this analytics plugin.
|
|
93
|
+
* This will be deprecated soon.
|
|
94
|
+
*/
|
|
90
95
|
var analyticsPlugin = function analyticsPlugin(options, api) {
|
|
91
96
|
var _api$dependencies$fea;
|
|
92
97
|
var featureFlags = (api === null || api === void 0 ? void 0 : (_api$dependencies$fea = api.dependencies.featureFlags) === null || _api$dependencies$fea === void 0 ? void 0 : _api$dependencies$fea.sharedState.currentState()) || {};
|
|
93
98
|
return {
|
|
94
|
-
name: '
|
|
99
|
+
name: 'deprecatedAnalytics',
|
|
95
100
|
pmPlugins: function pmPlugins() {
|
|
96
101
|
return [{
|
|
97
102
|
name: 'analyticsPlugin',
|
|
98
103
|
plugin: function plugin() {
|
|
99
|
-
|
|
104
|
+
var _api$dependencies, _api$dependencies$ana;
|
|
105
|
+
return createPlugin(options, featureFlags, api === null || api === void 0 ? void 0 : (_api$dependencies = api.dependencies) === null || _api$dependencies === void 0 ? void 0 : (_api$dependencies$ana = _api$dependencies.analytics) === null || _api$dependencies$ana === void 0 ? void 0 : _api$dependencies$ana.actions);
|
|
100
106
|
}
|
|
101
107
|
}];
|
|
102
|
-
},
|
|
103
|
-
onEditorViewStateUpdated: function onEditorViewStateUpdated(_ref2) {
|
|
104
|
-
var originalTransaction = _ref2.originalTransaction,
|
|
105
|
-
transactions = _ref2.transactions,
|
|
106
|
-
newEditorState = _ref2.newEditorState;
|
|
107
|
-
var pluginState = _pluginKey.analyticsPluginKey.getState(newEditorState);
|
|
108
|
-
if (!pluginState || !pluginState.createAnalyticsEvent) {
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
var steps = transactions.reduce(function (acc, tr) {
|
|
112
|
-
var payloads = tr.steps.filter(function (step) {
|
|
113
|
-
return step instanceof _steps.AnalyticsStep;
|
|
114
|
-
}).map(function (x) {
|
|
115
|
-
return x.analyticsEvents;
|
|
116
|
-
}).reduce(function (acc, val) {
|
|
117
|
-
return acc.concat(val);
|
|
118
|
-
}, []);
|
|
119
|
-
acc.push.apply(acc, (0, _toConsumableArray2.default)(payloads));
|
|
120
|
-
return acc;
|
|
121
|
-
}, []);
|
|
122
|
-
if (steps.length === 0) {
|
|
123
|
-
return;
|
|
124
|
-
}
|
|
125
|
-
var createAnalyticsEvent = pluginState.createAnalyticsEvent;
|
|
126
|
-
var undoAnaltyicsEventTransformer = (0, _undoRedoInputSource.generateUndoRedoInputSoucePayload)(originalTransaction);
|
|
127
|
-
steps.forEach(function (_ref3) {
|
|
128
|
-
var payload = _ref3.payload,
|
|
129
|
-
channel = _ref3.channel;
|
|
130
|
-
var nextPayload = undoAnaltyicsEventTransformer(payload);
|
|
131
|
-
(0, _analytics.fireAnalyticsEvent)(createAnalyticsEvent)({
|
|
132
|
-
payload: nextPayload,
|
|
133
|
-
channel: channel
|
|
134
|
-
});
|
|
135
|
-
});
|
|
136
108
|
}
|
|
137
109
|
};
|
|
138
110
|
};
|
|
139
|
-
function extendPayload(
|
|
140
|
-
var payload =
|
|
141
|
-
duration =
|
|
142
|
-
distortedDuration =
|
|
111
|
+
function extendPayload(_ref2) {
|
|
112
|
+
var payload = _ref2.payload,
|
|
113
|
+
duration = _ref2.duration,
|
|
114
|
+
distortedDuration = _ref2.distortedDuration;
|
|
143
115
|
return _objectSpread(_objectSpread({}, payload), {}, {
|
|
144
116
|
attributes: _objectSpread(_objectSpread({}, payload.attributes), {}, {
|
|
145
117
|
duration: duration,
|