@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
|
@@ -2,7 +2,7 @@ import { findWrapping } from 'prosemirror-transform';
|
|
|
2
2
|
import { Selection, TextSelection, NodeSelection } from 'prosemirror-state';
|
|
3
3
|
import { findParentNodeClosestToPos, findParentNodeOfType, hasParentNodeOfType } from 'prosemirror-utils';
|
|
4
4
|
import { GapCursorSelection } from '../../selection/gap-cursor-selection';
|
|
5
|
-
import { isListItemNode, isListNode, isParagraphNode } from '
|
|
5
|
+
import { isListItemNode, isListNode, isParagraphNode } from '@atlaskit/editor-common/utils';
|
|
6
6
|
export var isPosInsideParagraph = function isPosInsideParagraph($pos) {
|
|
7
7
|
return $pos.parent.type.name === 'paragraph';
|
|
8
8
|
};
|
|
@@ -7,7 +7,7 @@ import assert from 'assert';
|
|
|
7
7
|
import { Selection, NodeSelection, TextSelection } from 'prosemirror-state';
|
|
8
8
|
import { safeInsert, replaceSelectedNode, findSelectedNodeOfType, replaceParentNodeOfType } from 'prosemirror-utils';
|
|
9
9
|
import { getValidNode } from '@atlaskit/editor-common/validator';
|
|
10
|
-
import { normaliseNestedLayout } from '
|
|
10
|
+
import { normaliseNestedLayout } from '@atlaskit/editor-common/insert';
|
|
11
11
|
import { getPluginState as getExtensionPluginState } from '../extension/plugin-factory';
|
|
12
12
|
import { ACTION, ACTION_SUBJECT, INPUT_METHOD, EVENT_TYPE, addAnalytics } from '../analytics';
|
|
13
13
|
import { TARGET_SELECTION_SOURCE } from '../analytics/types/extension-events';
|
|
@@ -2,7 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
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; }
|
|
3
3
|
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) { _defineProperty(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; }
|
|
4
4
|
import { createMediaLinkingCommand, getMediaLinkingState, mediaLinkingPluginKey } from '../pm-plugins/linking';
|
|
5
|
-
import { normalizeUrl } from '
|
|
5
|
+
import { normalizeUrl } from '@atlaskit/editor-common/utils';
|
|
6
6
|
import { createToggleBlockMarkOnRange } from '../../../commands';
|
|
7
7
|
import { MediaLinkingActionsTypes } from '../pm-plugins/linking/actions';
|
|
8
8
|
import { addAnalytics, EVENT_TYPE, ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID } from '../../analytics';
|
|
@@ -81,7 +81,7 @@ var mediaPlugin = function mediaPlugin() {
|
|
|
81
81
|
providerFactory: providerFactory,
|
|
82
82
|
nodeViews: {
|
|
83
83
|
mediaGroup: ReactMediaGroupNode(portalProviderAPI, eventDispatcher, providerFactory, options),
|
|
84
|
-
mediaSingle: ReactMediaSingleNode(portalProviderAPI, eventDispatcher, providerFactory, dispatchAnalyticsEvent, options),
|
|
84
|
+
mediaSingle: ReactMediaSingleNode(portalProviderAPI, eventDispatcher, providerFactory, dispatchAnalyticsEvent, options, api),
|
|
85
85
|
media: ReactMediaNode(portalProviderAPI, eventDispatcher, providerFactory, options),
|
|
86
86
|
mediaInline: ReactMediaInlineNode(portalProviderAPI, eventDispatcher, providerFactory)
|
|
87
87
|
},
|
|
@@ -24,7 +24,6 @@ import WithPluginState from '../../../ui/WithPluginState';
|
|
|
24
24
|
import { pluginKey as widthPluginKey } from '../../width';
|
|
25
25
|
import { setNodeSelection, setTextSelection } from '../../../utils';
|
|
26
26
|
import ResizableMediaSingle from '../ui/ResizableMediaSingle';
|
|
27
|
-
import { createDisplayGrid } from '../../../plugins/grid';
|
|
28
27
|
import { stateKey as mediaPluginKey, MEDIA_CONTENT_WRAP_CLASS_NAME } from '../pm-plugins/main';
|
|
29
28
|
import { MediaNodeUpdater } from './mediaNodeUpdater';
|
|
30
29
|
import { findParentNodeOfTypeClosestToPos } from 'prosemirror-utils';
|
|
@@ -224,11 +223,22 @@ var MediaSingleNode = /*#__PURE__*/function (_Component) {
|
|
|
224
223
|
}
|
|
225
224
|
(_this$captionPlaceHol = _this.captionPlaceHolderRef.current) === null || _this$captionPlaceHol === void 0 ? void 0 : _this$captionPlaceHol.click();
|
|
226
225
|
});
|
|
227
|
-
_defineProperty(_assertThisInitialized(_this), "
|
|
226
|
+
_defineProperty(_assertThisInitialized(_this), "displayGrid", function (visible, gridType, highlight) {
|
|
227
|
+
var _pluginInjectionApi$d, _pluginInjectionApi$d2;
|
|
228
228
|
var _this$props = _this.props,
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
229
|
+
pluginInjectionApi = _this$props.pluginInjectionApi,
|
|
230
|
+
view = _this$props.view;
|
|
231
|
+
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)({
|
|
232
|
+
visible: visible,
|
|
233
|
+
gridType: gridType,
|
|
234
|
+
highlight: highlight
|
|
235
|
+
});
|
|
236
|
+
});
|
|
237
|
+
_defineProperty(_assertThisInitialized(_this), "clickPlaceholder", function () {
|
|
238
|
+
var _this$props2 = _this.props,
|
|
239
|
+
view = _this$props2.view,
|
|
240
|
+
getPos = _this$props2.getPos,
|
|
241
|
+
node = _this$props2.node;
|
|
232
242
|
if (typeof getPos === 'boolean') {
|
|
233
243
|
return;
|
|
234
244
|
}
|
|
@@ -300,14 +310,14 @@ var MediaSingleNode = /*#__PURE__*/function (_Component) {
|
|
|
300
310
|
}, {
|
|
301
311
|
key: "render",
|
|
302
312
|
value: function render() {
|
|
303
|
-
var _this$
|
|
304
|
-
selected = _this$
|
|
305
|
-
getPos = _this$
|
|
306
|
-
node = _this$
|
|
307
|
-
mediaOptions = _this$
|
|
308
|
-
fullWidthMode = _this$
|
|
309
|
-
state = _this$
|
|
310
|
-
view = _this$
|
|
313
|
+
var _this$props3 = this.props,
|
|
314
|
+
selected = _this$props3.selected,
|
|
315
|
+
getPos = _this$props3.getPos,
|
|
316
|
+
node = _this$props3.node,
|
|
317
|
+
mediaOptions = _this$props3.mediaOptions,
|
|
318
|
+
fullWidthMode = _this$props3.fullWidthMode,
|
|
319
|
+
state = _this$props3.view.state,
|
|
320
|
+
view = _this$props3.view;
|
|
311
321
|
var _ref4 = node.attrs,
|
|
312
322
|
layout = _ref4.layout,
|
|
313
323
|
mediaSingleWidth = _ref4.width;
|
|
@@ -379,7 +389,7 @@ var MediaSingleNode = /*#__PURE__*/function (_Component) {
|
|
|
379
389
|
view: this.props.view,
|
|
380
390
|
getPos: getPos,
|
|
381
391
|
updateSize: this.updateSize,
|
|
382
|
-
displayGrid:
|
|
392
|
+
displayGrid: this.displayGrid,
|
|
383
393
|
gridSize: 12,
|
|
384
394
|
viewMediaClientConfig: this.state.viewMediaClientConfig,
|
|
385
395
|
allowBreakoutSnapPoints: mediaOptions && mediaOptions.allowBreakoutSnapPoints,
|
|
@@ -487,7 +497,8 @@ var MediaSingleNodeView = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
487
497
|
fullWidthMode = _this$reactComponentP.fullWidthMode,
|
|
488
498
|
providerFactory = _this$reactComponentP.providerFactory,
|
|
489
499
|
mediaOptions = _this$reactComponentP.mediaOptions,
|
|
490
|
-
dispatchAnalyticsEvent = _this$reactComponentP.dispatchAnalyticsEvent
|
|
500
|
+
dispatchAnalyticsEvent = _this$reactComponentP.dispatchAnalyticsEvent,
|
|
501
|
+
pluginInjectionApi = _this$reactComponentP.pluginInjectionApi;
|
|
491
502
|
|
|
492
503
|
// getPos is a boolean for marks, since this is a node we know it must be a function
|
|
493
504
|
var getPos = this.getPos;
|
|
@@ -520,7 +531,8 @@ var MediaSingleNodeView = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
520
531
|
eventDispatcher: eventDispatcher,
|
|
521
532
|
mediaPluginState: mediaPluginState,
|
|
522
533
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
523
|
-
forwardRef: forwardRef
|
|
534
|
+
forwardRef: forwardRef,
|
|
535
|
+
pluginInjectionApi: pluginInjectionApi
|
|
524
536
|
});
|
|
525
537
|
}
|
|
526
538
|
});
|
|
@@ -548,6 +560,7 @@ var MediaSingleNodeView = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
548
560
|
}(ReactNodeView);
|
|
549
561
|
export var ReactMediaSingleNode = function ReactMediaSingleNode(portalProviderAPI, eventDispatcher, providerFactory, dispatchAnalyticsEvent) {
|
|
550
562
|
var mediaOptions = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
|
|
563
|
+
var pluginInjectionApi = arguments.length > 5 ? arguments[5] : undefined;
|
|
551
564
|
return function (node, view, getPos) {
|
|
552
565
|
var hasIntlContext = true;
|
|
553
566
|
return new MediaSingleNodeView(node, view, getPos, portalProviderAPI, eventDispatcher, {
|
|
@@ -556,7 +569,8 @@ export var ReactMediaSingleNode = function ReactMediaSingleNode(portalProviderAP
|
|
|
556
569
|
providerFactory: providerFactory,
|
|
557
570
|
mediaOptions: mediaOptions,
|
|
558
571
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
559
|
-
isCopyPasteEnabled: mediaOptions.isCopyPasteEnabled
|
|
572
|
+
isCopyPasteEnabled: mediaOptions.isCopyPasteEnabled,
|
|
573
|
+
pluginInjectionApi: pluginInjectionApi
|
|
560
574
|
}, undefined, undefined, undefined, hasIntlContext).init();
|
|
561
575
|
};
|
|
562
576
|
};
|
|
@@ -2,7 +2,7 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
|
2
2
|
import { PluginKey } from 'prosemirror-state';
|
|
3
3
|
import { pluginFactory } from '../../../../utils/plugin-state-factory';
|
|
4
4
|
import reducer from './reducer';
|
|
5
|
-
import { pmHistoryPluginKey } from '
|
|
5
|
+
import { pmHistoryPluginKey } from '@atlaskit/editor-common/utils';
|
|
6
6
|
export var pluginKey = new PluginKey('mediaAltTextPlugin');
|
|
7
7
|
var _pluginFactory = pluginFactory(pluginKey, reducer, {
|
|
8
8
|
onSelectionChanged: function onSelectionChanged(tr, newState) {
|
|
@@ -17,7 +17,7 @@ import ChevronLeftLargeIcon from '@atlaskit/icon/glyph/chevron-left-large';
|
|
|
17
17
|
import CrossCircleIcon from '@atlaskit/icon/glyph/cross-circle';
|
|
18
18
|
import { messages } from '../messages';
|
|
19
19
|
import { injectIntl } from 'react-intl-next';
|
|
20
|
-
import Button from '
|
|
20
|
+
import { FloatingToolbarButton as Button } from '@atlaskit/editor-common/ui';
|
|
21
21
|
import PanelTextInput from '../../../../../ui/PanelTextInput';
|
|
22
22
|
import * as keymaps from '../../../../../keymaps';
|
|
23
23
|
import { ToolTipContent } from '../../../../../keymaps';
|
|
@@ -4,7 +4,7 @@ import ReactDOM from 'react-dom';
|
|
|
4
4
|
import { MediaViewer } from '@atlaskit/media-viewer';
|
|
5
5
|
import { messages } from '@atlaskit/media-ui';
|
|
6
6
|
import FilePreviewIcon from '@atlaskit/icon/glyph/editor/file-preview';
|
|
7
|
-
import ToolbarButton from '
|
|
7
|
+
import { FloatingToolbarButton as ToolbarButton } from '@atlaskit/editor-common/ui';
|
|
8
8
|
import { getSelectedMediaContainerNodeAttrs } from './utils';
|
|
9
9
|
export var FilePreviewItem = function FilePreviewItem(_ref) {
|
|
10
10
|
var mediaPluginState = _ref.mediaPluginState,
|
|
@@ -8,7 +8,7 @@ import LinkIcon from '@atlaskit/icon/glyph/editor/link';
|
|
|
8
8
|
import OpenIcon from '@atlaskit/icon/glyph/shortcut';
|
|
9
9
|
import { isSafeUrl } from '@atlaskit/adf-schema';
|
|
10
10
|
import { checkMediaType } from '../utils/check-media-type';
|
|
11
|
-
import ToolbarButton from '
|
|
11
|
+
import { FloatingToolbarButton as ToolbarButton } from '@atlaskit/editor-common/ui';
|
|
12
12
|
import Separator from '../../floating-toolbar/ui/Separator';
|
|
13
13
|
import { linkToolbarMessages, linkMessages } from '../../../messages';
|
|
14
14
|
import { ToolTipContent, addLink } from '../../../keymaps';
|
|
@@ -4,6 +4,7 @@ import { css } from '@emotion/react';
|
|
|
4
4
|
import * as colors from '@atlaskit/theme/colors';
|
|
5
5
|
import { DEFAULT_BORDER_COLOR } from '@atlaskit/editor-common/ui-color';
|
|
6
6
|
import { N20A, N50, N60A, N90, N800, N0 } from '@atlaskit/theme/colors';
|
|
7
|
+
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
7
8
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
8
9
|
|
|
9
10
|
// menuItemDimensions and itemSpacing are copied from
|
|
@@ -13,6 +14,9 @@ export var menuItemDimensions = {
|
|
|
13
14
|
width: 175,
|
|
14
15
|
height: 32
|
|
15
16
|
};
|
|
17
|
+
|
|
18
|
+
// TODO: Migrate away from gridSize
|
|
19
|
+
// Recommendation: Replace directly with 4 due to itemSpacing being used in calculations
|
|
16
20
|
export var itemSpacing = gridSize() / 2;
|
|
17
21
|
export var contextualMenuArrow = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n &::after {\n content: '\u203A';\n margin-left: 4px;\n line-height: 20px;\n color: ", ";\n }\n"])), "var(--ds-icon, ".concat(N90, ")"));
|
|
18
22
|
export var contextualMenuColorIcon = function contextualMenuColorIcon(color) {
|
|
@@ -18,12 +18,12 @@ import EditorUnlinkIcon from '@atlaskit/icon/glyph/editor/unlink';
|
|
|
18
18
|
// Common Translations will live here
|
|
19
19
|
|
|
20
20
|
import PanelTextInput from '../../../ui/PanelTextInput';
|
|
21
|
-
import Button from '
|
|
21
|
+
import { FloatingToolbarButton as Button } from '@atlaskit/editor-common/ui';
|
|
22
22
|
import Separator from '../../floating-toolbar/ui/Separator';
|
|
23
23
|
import { container, containerWithProvider, inputWrapper } from '../../../ui/LinkSearch/ToolbarComponents';
|
|
24
24
|
import RecentSearch from '../../../ui/LinkSearch';
|
|
25
25
|
import { linkToolbarMessages } from '../../../messages';
|
|
26
|
-
import { normalizeUrl } from '
|
|
26
|
+
import { normalizeUrl } from '@atlaskit/editor-common/utils';
|
|
27
27
|
import { R400 } from '@atlaskit/theme/colors';
|
|
28
28
|
import { INPUT_METHOD } from '../../analytics/types/enums';
|
|
29
29
|
import { mediaLinkToolbarMessages } from './media-linking-toolbar-messages';
|
|
@@ -20,7 +20,7 @@ import { akEditorWideLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
|
20
20
|
import { wrapperStyle } from './styled';
|
|
21
21
|
import Resizer from '../../../../ui/Resizer';
|
|
22
22
|
import { snapTo, handleSides, imageAlignmentMap } from '../../../../ui/Resizer/utils';
|
|
23
|
-
import { calcMediaPxWidth } from '
|
|
23
|
+
import { calcMediaPxWidth } from '@atlaskit/editor-common/ui';
|
|
24
24
|
import { calculateSnapPoints } from '../../../../utils/rich-media-utils';
|
|
25
25
|
var ResizableMediaSingle = /*#__PURE__*/function (_React$Component) {
|
|
26
26
|
_inherits(ResizableMediaSingle, _React$Component);
|
|
@@ -86,6 +86,7 @@ var ResizableMediaSingle = /*#__PURE__*/function (_React$Component) {
|
|
|
86
86
|
fullWidthMode = _this$props2.fullWidthMode,
|
|
87
87
|
getPos = _this$props2.getPos,
|
|
88
88
|
state = _this$props2.view.state;
|
|
89
|
+
var resizedPctWidth = _this.state.resizedPctWidth;
|
|
89
90
|
var pos = typeof getPos === 'function' ? getPos() : undefined;
|
|
90
91
|
return calcMediaPxWidth({
|
|
91
92
|
origWidth: origWidth,
|
|
@@ -98,7 +99,8 @@ var ResizableMediaSingle = /*#__PURE__*/function (_React$Component) {
|
|
|
98
99
|
},
|
|
99
100
|
isFullWidthModeEnabled: fullWidthMode,
|
|
100
101
|
layout: useLayout || layout,
|
|
101
|
-
pos: pos
|
|
102
|
+
pos: pos,
|
|
103
|
+
resizedPctWidth: resizedPctWidth
|
|
102
104
|
});
|
|
103
105
|
});
|
|
104
106
|
_defineProperty(_assertThisInitialized(_this), "highlights", function (newWidth, snapPoints) {
|
|
@@ -139,13 +141,21 @@ var ResizableMediaSingle = /*#__PURE__*/function (_React$Component) {
|
|
|
139
141
|
}
|
|
140
142
|
_createClass(ResizableMediaSingle, [{
|
|
141
143
|
key: "componentDidUpdate",
|
|
142
|
-
value: function componentDidUpdate() {
|
|
144
|
+
value: function componentDidUpdate(prevProps) {
|
|
143
145
|
var offsetLeft = calcOffsetLeft(this.insideInlineLike, this.insideLayout, this.props.view.dom, this.wrapper);
|
|
144
146
|
if (offsetLeft !== this.state.offsetLeft && offsetLeft >= 0) {
|
|
145
147
|
this.setState({
|
|
146
148
|
offsetLeft: offsetLeft
|
|
147
149
|
});
|
|
148
150
|
}
|
|
151
|
+
|
|
152
|
+
// Handle undo, when the actual pctWidth changed,
|
|
153
|
+
// we sync up with the internal state.
|
|
154
|
+
if (prevProps.pctWidth !== this.props.pctWidth) {
|
|
155
|
+
this.setState({
|
|
156
|
+
resizedPctWidth: this.props.pctWidth
|
|
157
|
+
});
|
|
158
|
+
}
|
|
149
159
|
return true;
|
|
150
160
|
}
|
|
151
161
|
}, {
|
|
@@ -3,13 +3,13 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
3
3
|
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) { _defineProperty(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; }
|
|
4
4
|
import { Fragment, Slice } from 'prosemirror-model';
|
|
5
5
|
import { safeInsert as pmSafeInsert, hasParentNodeOfType } from 'prosemirror-utils';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { checkNodeDown, isEmptyParagraph } from '../../../utils';
|
|
6
|
+
import { checkNodeDown } from '../../../utils';
|
|
7
|
+
import { isEmptyParagraph } from '@atlaskit/editor-common/utils';
|
|
9
8
|
import { copyOptionalAttrsFromMediaState } from '../utils/media-common';
|
|
10
9
|
import { mapSlice } from '../../../utils/slice';
|
|
11
|
-
import { addAnalytics
|
|
12
|
-
import {
|
|
10
|
+
import { addAnalytics } from '../../analytics';
|
|
11
|
+
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
|
|
12
|
+
import { safeInsert, shouldSplitSelectedNodeOnNodeInsertion } from '@atlaskit/editor-common/insert';
|
|
13
13
|
import { isImage } from './is-image';
|
|
14
14
|
import { atTheBeginningOfBlock } from '../../../utils/prosemirror/position';
|
|
15
15
|
import { getRandomHex } from '@atlaskit/media-common';
|
|
@@ -188,52 +188,6 @@ export function transformSliceForMedia(slice, schema) {
|
|
|
188
188
|
return newSlice;
|
|
189
189
|
};
|
|
190
190
|
}
|
|
191
|
-
export var calcMediaPxWidth = function calcMediaPxWidth(opts) {
|
|
192
|
-
var origWidth = opts.origWidth,
|
|
193
|
-
origHeight = opts.origHeight,
|
|
194
|
-
layout = opts.layout,
|
|
195
|
-
pctWidth = opts.pctWidth,
|
|
196
|
-
containerWidth = opts.containerWidth,
|
|
197
|
-
resizedPctWidth = opts.resizedPctWidth;
|
|
198
|
-
var width = containerWidth.width,
|
|
199
|
-
lineLength = containerWidth.lineLength;
|
|
200
|
-
var calculatedPctWidth = calcPctWidth(containerWidth, pctWidth, origWidth, origHeight);
|
|
201
|
-
var calculatedResizedPctWidth = calcPctWidth(containerWidth, resizedPctWidth, origWidth, origHeight);
|
|
202
|
-
if (layout === 'wide') {
|
|
203
|
-
if (lineLength) {
|
|
204
|
-
var wideWidth = Math.ceil(lineLength * breakoutWideScaleRatio);
|
|
205
|
-
return wideWidth > width ? lineLength : wideWidth;
|
|
206
|
-
}
|
|
207
|
-
} else if (layout === 'full-width') {
|
|
208
|
-
return width - akEditorBreakoutPadding;
|
|
209
|
-
} else if (calculatedPctWidth) {
|
|
210
|
-
if (wrappedLayouts.indexOf(layout) > -1) {
|
|
211
|
-
if (calculatedResizedPctWidth) {
|
|
212
|
-
if (resizedPctWidth < 50) {
|
|
213
|
-
return calculatedResizedPctWidth;
|
|
214
|
-
}
|
|
215
|
-
return calculatedPctWidth;
|
|
216
|
-
}
|
|
217
|
-
return Math.min(calculatedPctWidth, origWidth);
|
|
218
|
-
}
|
|
219
|
-
if (calculatedResizedPctWidth) {
|
|
220
|
-
return calculatedResizedPctWidth;
|
|
221
|
-
}
|
|
222
|
-
return calculatedPctWidth;
|
|
223
|
-
} else if (layout === 'center') {
|
|
224
|
-
if (calculatedResizedPctWidth) {
|
|
225
|
-
return calculatedResizedPctWidth;
|
|
226
|
-
}
|
|
227
|
-
return Math.min(origWidth, lineLength || width);
|
|
228
|
-
} else if (layout && wrappedLayouts.indexOf(layout) !== -1) {
|
|
229
|
-
var halfLineLength = Math.ceil((lineLength || width) / 2);
|
|
230
|
-
return origWidth <= halfLineLength ? origWidth : halfLineLength;
|
|
231
|
-
}
|
|
232
|
-
return origWidth;
|
|
233
|
-
};
|
|
234
|
-
var calcPctWidth = function calcPctWidth(containerWidth, pctWidth, origWidth, origHeight) {
|
|
235
|
-
return pctWidth && origWidth && origHeight && Math.ceil(calcPxFromPct(pctWidth / 100, containerWidth.lineLength || containerWidth.width));
|
|
236
|
-
};
|
|
237
191
|
export function isCaptionNode(editorView) {
|
|
238
192
|
var $from = editorView.state.selection.$from;
|
|
239
193
|
var immediateWrapperParentNode = editorView.state.doc.nodeAt($from.before(Math.max($from.depth, 1)));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { findParentNodeOfType } from 'prosemirror-utils';
|
|
2
2
|
import { insertSliceIntoRangeSelectionInsideList, insertSliceInsideOfPanelNodeSelected, insertSliceAtNodeEdge, insertSliceIntoEmptyNode } from './lists';
|
|
3
|
-
import { isListNode } from '
|
|
3
|
+
import { isListNode } from '@atlaskit/editor-common/utils';
|
|
4
4
|
import { isSelectionInsidePanel, isEmptyNode, isCursorSelectionAtTextStartOrEnd } from '../util';
|
|
5
5
|
export function insertSliceForLists(_ref) {
|
|
6
6
|
var _slice$content$firstC;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Fragment } from 'prosemirror-model';
|
|
2
2
|
import { TextSelection, NodeSelection } from 'prosemirror-state';
|
|
3
3
|
import { Transform } from 'prosemirror-transform';
|
|
4
|
-
import { isEmptyParagraph } from '
|
|
4
|
+
import { isEmptyParagraph } from '@atlaskit/editor-common/utils';
|
|
5
5
|
export function insertSliceIntoEmptyNode(_ref) {
|
|
6
6
|
var tr = _ref.tr,
|
|
7
7
|
slice = _ref.slice;
|
|
@@ -17,12 +17,12 @@ import { mapSlice } from '../../utils/slice';
|
|
|
17
17
|
import { INPUT_METHOD } from '../analytics';
|
|
18
18
|
import { queueCardsFromChangedTr } from '../card/pm-plugins/doc';
|
|
19
19
|
import { GapCursorSelection, Side } from '../selection/gap-cursor-selection';
|
|
20
|
-
import { linkifyContent } from '
|
|
20
|
+
import { linkifyContent } from '@atlaskit/editor-common/utils';
|
|
21
21
|
import { runMacroAutoConvert } from '../macro';
|
|
22
22
|
import { insertMediaAsMediaSingle } from '../media/utils/media-single';
|
|
23
23
|
import { pluginKey as textFormattingPluginKey } from '../text-formatting/pm-plugins/main';
|
|
24
24
|
import { addReplaceSelectedTableAnalytics, applyTextMarksToSlice, hasOnlyNodesOfType } from './util';
|
|
25
|
-
import {
|
|
25
|
+
import { isListItemNode, isListNode } from '@atlaskit/editor-common/utils';
|
|
26
26
|
import { canLinkBeCreatedInRange } from '../hyperlink/pm-plugins/main';
|
|
27
27
|
import { insertSliceForLists } from './edge-cases';
|
|
28
28
|
import { startTrackingPastedMacroPositions, stopTrackingPastedMacroPositions } from './commands';
|
|
@@ -59,6 +59,7 @@ export function handlePasteIntoTaskOrDecisionOrPanel(slice) {
|
|
|
59
59
|
panel = _schema$nodes.panel,
|
|
60
60
|
bulletList = _schema$nodes.bulletList,
|
|
61
61
|
orderedList = _schema$nodes.orderedList,
|
|
62
|
+
taskList = _schema$nodes.taskList,
|
|
62
63
|
listItem = _schema$nodes.listItem,
|
|
63
64
|
expand = _schema$nodes.expand,
|
|
64
65
|
heading = _schema$nodes.heading;
|
|
@@ -73,6 +74,9 @@ export function handlePasteIntoTaskOrDecisionOrPanel(slice) {
|
|
|
73
74
|
if (node.type === bulletList || node.type === orderedList || node.type === expand || node.type === heading || node.type === listItem) {
|
|
74
75
|
sliceIsInvalid = true;
|
|
75
76
|
}
|
|
77
|
+
if (selectionIsPanel && node.type === taskList) {
|
|
78
|
+
sliceIsInvalid = true;
|
|
79
|
+
}
|
|
76
80
|
});
|
|
77
81
|
|
|
78
82
|
// If the selection is a panel,
|
|
@@ -743,7 +747,7 @@ export function flattenNestedListInSlice(slice) {
|
|
|
743
747
|
}
|
|
744
748
|
export function handleRichText(slice) {
|
|
745
749
|
return function (state, dispatch) {
|
|
746
|
-
var _slice$content, _slice$content2, _panelParentOverCurre;
|
|
750
|
+
var _slice$content, _slice$content2, _firstChildOfSlice$ty, _lastChildOfSlice$typ, _panelParentOverCurre;
|
|
747
751
|
var _state$schema$nodes3 = state.schema.nodes,
|
|
748
752
|
codeBlock = _state$schema$nodes3.codeBlock,
|
|
749
753
|
heading = _state$schema$nodes3.heading,
|
|
@@ -767,6 +771,9 @@ export function handleRichText(slice) {
|
|
|
767
771
|
var isFirstChildListNode = isListNode(firstChildOfSlice);
|
|
768
772
|
var isLastChildListNode = isListNode(lastChildOfSlice);
|
|
769
773
|
var isSliceContentListNodes = isFirstChildListNode || isLastChildListNode;
|
|
774
|
+
var isFirstChildTaskListNode = (firstChildOfSlice === null || firstChildOfSlice === void 0 ? void 0 : (_firstChildOfSlice$ty = firstChildOfSlice.type) === null || _firstChildOfSlice$ty === void 0 ? void 0 : _firstChildOfSlice$ty.name) === 'taskList';
|
|
775
|
+
var isLastChildTaskListNode = (lastChildOfSlice === null || lastChildOfSlice === void 0 ? void 0 : (_lastChildOfSlice$typ = lastChildOfSlice.type) === null || _lastChildOfSlice$typ === void 0 ? void 0 : _lastChildOfSlice$typ.name) === 'taskList';
|
|
776
|
+
var isSliceContentTaskListNodes = isFirstChildTaskListNode || isLastChildTaskListNode;
|
|
770
777
|
|
|
771
778
|
// We want to use safeInsert to insert invalid content, as it inserts at the closest non schema violating position
|
|
772
779
|
// rather than spliting the selection parent node in half (which is what replaceSelection does)
|
|
@@ -776,7 +783,7 @@ export function handleRichText(slice) {
|
|
|
776
783
|
var noNeedForSafeInsert = selection.$to.node().type.validContent(slice.content) || textNodes.includes(selection.$to.node().type) && selectionParent.type.validContent(slice.content);
|
|
777
784
|
var panelParentOverCurrentSelection = findParentNodeOfType(panel)(tr.selection);
|
|
778
785
|
var isTargetPanelEmpty = panelParentOverCurrentSelection && ((_panelParentOverCurre = panelParentOverCurrentSelection.node) === null || _panelParentOverCurre === void 0 ? void 0 : _panelParentOverCurre.content.size) === 2;
|
|
779
|
-
if (isSliceContentListNodes || isTargetPanelEmpty) {
|
|
786
|
+
if (!isSliceContentTaskListNodes && (isSliceContentListNodes || isTargetPanelEmpty)) {
|
|
780
787
|
insertSliceForLists({
|
|
781
788
|
tr: tr,
|
|
782
789
|
slice: slice,
|
|
@@ -7,7 +7,7 @@ import { getPasteSource } from '../util';
|
|
|
7
7
|
import { handlePasteAsPlainText, handlePasteIntoTaskOrDecisionOrPanel, handleCodeBlock, handleMediaSingle, handlePastePreservingMarks, handleMarkdown, handleRichText, handleExpandPasteInTable, handleSelectedTable, handlePasteLinkOnSelectedText, handlePasteIntoCaption, handlePastePanelOrDecisionContentIntoList, handlePasteNonNestableBlockNodesIntoList } from '../handlers';
|
|
8
8
|
import { findParentNode } from 'prosemirror-utils';
|
|
9
9
|
import { mapSlice } from '../../../utils/slice';
|
|
10
|
-
import { getLinkDomain } from '
|
|
10
|
+
import { getLinkDomain } from '@atlaskit/editor-common/utils';
|
|
11
11
|
var contentToPasteContent = {
|
|
12
12
|
url: PasteContents.url,
|
|
13
13
|
paragraph: PasteContents.text,
|
|
@@ -10,7 +10,7 @@ import { getExtensionAutoConvertersFromProvider } from '@atlaskit/editor-common/
|
|
|
10
10
|
import * as clipboard from '../../../utils/clipboard';
|
|
11
11
|
import { transformSliceForMedia } from '../../media/utils/media-single';
|
|
12
12
|
import { escapeLinks, htmlContainsSingleFile, isPastedFromWord, isPastedFromExcel, htmlHasInvalidLinkTags, removeDuplicateInvalidLinks } from '../util';
|
|
13
|
-
import { linkifyContent } from '
|
|
13
|
+
import { linkifyContent } from '@atlaskit/editor-common/utils';
|
|
14
14
|
import { transformSliceNestedExpandToExpand } from '../../expand/utils';
|
|
15
15
|
import { handleMacroAutoConvert, handleMention, handleParagraphBlockMarks } from '../handlers';
|
|
16
16
|
import { transformSliceToJoinAdjacentCodeBlocks, transformSingleLineCodeBlockToCodeMark } from '../../code-block/utils';
|
|
@@ -20,7 +20,7 @@ import { isInsideBlockQuote, insideTable, measurements } from '../../../utils';
|
|
|
20
20
|
import { measureRender } from '@atlaskit/editor-common/utils';
|
|
21
21
|
import { transformSliceToCorrectMediaWrapper, unwrapNestedMediaElements } from '../../media/utils/media-common';
|
|
22
22
|
import { upgradeTextToLists, splitParagraphs } from '../../list/transforms';
|
|
23
|
-
import { md } from '
|
|
23
|
+
import { md } from '@atlaskit/editor-common/paste';
|
|
24
24
|
import { transformUnsupportedBlockCardToInline } from '../../card/utils';
|
|
25
25
|
import { transformSliceToDecisionList } from '../../tasks-and-decisions/utils';
|
|
26
26
|
import { containsAnyAnnotations, stripNonExistingAnnotations } from '../../annotation/utils';
|
|
@@ -31,7 +31,6 @@ import { handlePaste as handlePasteTable } from '@atlaskit/editor-tables/utils';
|
|
|
31
31
|
import { extractSliceFromStep } from '../../../utils/step';
|
|
32
32
|
import { pluginKey as stateKey, createPluginState } from './plugin-factory';
|
|
33
33
|
export { pluginKey as stateKey } from './plugin-factory';
|
|
34
|
-
export { md } from '../md';
|
|
35
34
|
export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, cardOptions, sanitizePrivateContent, providerFactory) {
|
|
36
35
|
var atlassianMarkDownParser = new MarkdownTransformer(schema, md);
|
|
37
36
|
function getMarkdownSlice(text, openStart, openEnd) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// AFP-2532 TODO: Fix automatic suppressions below
|
|
2
2
|
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
3
|
-
import { insertSelectedItem } from '
|
|
3
|
+
import { insertSelectedItem } from '@atlaskit/editor-common/insert';
|
|
4
4
|
import { pluginKey } from './plugin-key';
|
|
5
5
|
export var openElementBrowserModal = function openElementBrowserModal() {
|
|
6
6
|
return function (state, dispatch) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Fragment, Slice } from 'prosemirror-model';
|
|
2
2
|
import { createRule, createPlugin } from '../../../utils/input-rules';
|
|
3
3
|
import { leafNodeReplacementCharacter } from '@atlaskit/prosemirror-input-rules';
|
|
4
|
-
import { safeInsert } from '
|
|
4
|
+
import { safeInsert } from '@atlaskit/editor-common/insert';
|
|
5
5
|
import { hasParentNodeOfType } from 'prosemirror-utils';
|
|
6
6
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, addAnalytics, EVENT_TYPE, INPUT_METHOD } from '../../analytics';
|
|
7
7
|
export var createHorizontalRule = function createHorizontalRule(state, featureFlags, start, end, inputMethod) {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { NodeSelection, TextSelection, Selection } from 'prosemirror-state';
|
|
2
2
|
import { GapCursorSelection, Side } from './gap-cursor-selection';
|
|
3
3
|
import { isIgnored as isIgnoredByGapCursor } from '../selection/gap-cursor/utils/is-ignored';
|
|
4
|
-
import { isNodeEmpty
|
|
4
|
+
import { isNodeEmpty } from '../../utils/document';
|
|
5
|
+
import { isEmptyParagraph } from '@atlaskit/editor-common/utils';
|
|
5
6
|
import { SelectionActionTypes } from './actions';
|
|
6
7
|
import { createCommand, getPluginState } from './plugin-factory';
|
|
7
8
|
import { isSelectableContainerNode, isSelectionAtEndOfParentNode, findSelectableContainerParent, isSelectionAtStartOfParentNode, findSelectableContainerBefore, findSelectableContainerAfter, findFirstChildNodeToSelect, findLastChildNodeToSelect } from './utils';
|
|
@@ -6,7 +6,7 @@ import { flatten, findParentNode } from 'prosemirror-utils';
|
|
|
6
6
|
import { akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
|
|
7
7
|
import { isSelectionAtStartOfNode, isSelectionAtEndOfNode } from '@atlaskit/editor-common/selection';
|
|
8
8
|
import { selectNode } from '../../utils/commands';
|
|
9
|
-
import { isEmptyParagraph } from '
|
|
9
|
+
import { isEmptyParagraph } from '@atlaskit/editor-common/utils';
|
|
10
10
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '../analytics';
|
|
11
11
|
import { isIgnored as isIgnoredByGapCursor } from '../selection/gap-cursor/utils/is-ignored';
|
|
12
12
|
import { selectionPluginKey } from './types';
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
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; }
|
|
3
3
|
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) { _defineProperty(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; }
|
|
4
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
5
4
|
import { NodeSelection, TextSelection } from 'prosemirror-state';
|
|
5
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
6
|
+
import { pmHistoryPluginKey } from '@atlaskit/editor-common/utils';
|
|
6
7
|
import { getInlineNodeViewProducer } from '../../nodeviews/getInlineNodeViewProducer';
|
|
7
8
|
import { StatusNodeView } from './nodeviews/status';
|
|
8
9
|
import { pluginKey } from './plugin-key';
|
|
@@ -76,9 +77,14 @@ var createPlugin = function createPlugin(pmPluginFactoryParams, options) {
|
|
|
76
77
|
var changed = false;
|
|
77
78
|
var tr = newEditorState.tr;
|
|
78
79
|
|
|
79
|
-
|
|
80
|
+
/**
|
|
81
|
+
* When user start creating status, and, when users navigates away
|
|
82
|
+
* while empty, then we want to remove empty ("set a status") status.
|
|
83
|
+
* But when transaction to add empty status happens from undo/redo
|
|
84
|
+
* we don't want to remove it.
|
|
85
|
+
*/
|
|
80
86
|
if (transactions.find(function (tr) {
|
|
81
|
-
return tr.selectionSet;
|
|
87
|
+
return tr.selectionSet && !tr.getMeta(pmHistoryPluginKey);
|
|
82
88
|
})) {
|
|
83
89
|
var oldStatus = mayGetStatusAtSelection(oldEditorState.selection);
|
|
84
90
|
var newStatus = mayGetStatusAtSelection(newEditorState.selection);
|
|
@@ -16,7 +16,7 @@ import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
|
16
16
|
import { Popup } from '@atlaskit/editor-common/ui';
|
|
17
17
|
import { akEditorFloatingDialogZIndex } from '@atlaskit/editor-shared-styles';
|
|
18
18
|
import { StatusPicker as AkStatusPicker } from '@atlaskit/status/picker';
|
|
19
|
-
import { borderRadius
|
|
19
|
+
import { borderRadius } from '@atlaskit/theme/constants';
|
|
20
20
|
import { N0 } from '@atlaskit/theme/colors';
|
|
21
21
|
import withOuterListeners from '../../../ui/with-outer-listeners';
|
|
22
22
|
import { DEFAULT_STATUS } from '../actions';
|
|
@@ -28,7 +28,7 @@ export var InputMethod = /*#__PURE__*/function (InputMethod) {
|
|
|
28
28
|
InputMethod["enterKey"] = "enterKey";
|
|
29
29
|
return InputMethod;
|
|
30
30
|
}({});
|
|
31
|
-
var pickerContainer = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background: ", ";\n padding: ", "
|
|
31
|
+
var pickerContainer = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background: ", ";\n padding: ", " 0;\n border-radius: ", "px;\n box-shadow: ", ";\n input {\n text-transform: uppercase;\n }\n"])), "var(--ds-surface-overlay, ".concat(N0, ")"), "var(--ds-space-100, 8px)", borderRadius(), "var(--ds-shadow-overlay, 0 0 1px rgba(9, 30, 66, 0.31), 0 4px 8px -2px rgba(9, 30, 66, 0.25))");
|
|
32
32
|
export var StatusPickerWithoutAnalytcs = /*#__PURE__*/function (_React$Component) {
|
|
33
33
|
_inherits(StatusPickerWithoutAnalytcs, _React$Component);
|
|
34
34
|
var _super = _createSuper(StatusPickerWithoutAnalytcs);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { TextSelection, NodeSelection } from 'prosemirror-state';
|
|
2
2
|
import { Node as PMNode, Slice, Fragment } from 'prosemirror-model';
|
|
3
|
-
import { normaliseNestedLayout } from '
|
|
4
|
-
import { safeInsert } from '../../utils/insert';
|
|
3
|
+
import { safeInsert, normaliseNestedLayout } from '@atlaskit/editor-common/insert';
|
|
5
4
|
function findInsertPoint(doc, pos, nodeToInsert) {
|
|
6
5
|
var $pos = doc.resolve(pos);
|
|
7
6
|
var createInsertPosition = function createInsertPosition(from, to) {
|
|
@@ -7,14 +7,14 @@ import { css, jsx } from '@emotion/react';
|
|
|
7
7
|
import rafSchedule from 'raf-schd';
|
|
8
8
|
import { akEditorFloatingDialogZIndex } from '@atlaskit/editor-shared-styles';
|
|
9
9
|
import { findOverflowScrollParent, Popup } from '@atlaskit/editor-common/ui';
|
|
10
|
-
import { borderRadius
|
|
10
|
+
import { borderRadius } from '@atlaskit/theme/constants';
|
|
11
11
|
import { N0, N60A, N50A } from '@atlaskit/theme/colors';
|
|
12
12
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
13
13
|
import { CloseSelectionOptions, TYPE_AHEAD_DECORATION_DATA_ATTRIBUTE, TYPE_AHEAD_POPUP_CONTENT_CLASS } from '../constants';
|
|
14
14
|
import { TypeAheadList } from './TypeAheadList';
|
|
15
15
|
import { ITEM_PADDING } from './TypeAheadListItem';
|
|
16
16
|
var DEFAULT_TYPEAHEAD_MENU_HEIGHT = 380;
|
|
17
|
-
var typeAheadContent = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background: ", ";\n border-radius: ", "px;\n box-shadow: ", ";\n padding: ", "
|
|
17
|
+
var typeAheadContent = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background: ", ";\n border-radius: ", "px;\n box-shadow: ", ";\n padding: ", " 0;\n width: 320px;\n max-height: 380px; /* ~5.5 visibile items */\n overflow-y: auto;\n -ms-overflow-style: -ms-autohiding-scrollbar;\n position: relative;\n"])), "var(--ds-surface-overlay, ".concat(N0, ")"), borderRadius(), "var(--ds-shadow-overlay, ".concat("0 0 1px ".concat(N60A, ", 0 4px 8px -2px ").concat(N50A), ")"), "var(--ds-space-050, 4px)");
|
|
18
18
|
var Highlight = function Highlight(_ref) {
|
|
19
19
|
var state = _ref.state,
|
|
20
20
|
triggerHandler = _ref.triggerHandler;
|
|
@@ -3,6 +3,12 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
3
3
|
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) { _defineProperty(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; }
|
|
4
4
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
5
5
|
import { PluginKey } from 'prosemirror-state';
|
|
6
|
+
/**
|
|
7
|
+
* @private
|
|
8
|
+
* @deprecated
|
|
9
|
+
*
|
|
10
|
+
* Do not use this plugin key directly. Please use the `sharedState` of this plugin instead.
|
|
11
|
+
*/
|
|
6
12
|
export var pluginKey = new PluginKey('widthPlugin');
|
|
7
13
|
export function createPlugin(dispatch) {
|
|
8
14
|
return new SafePlugin({
|
|
@@ -41,6 +47,12 @@ var widthPlugin = function widthPlugin() {
|
|
|
41
47
|
}
|
|
42
48
|
}];
|
|
43
49
|
},
|
|
50
|
+
getSharedState: function getSharedState(editorState) {
|
|
51
|
+
if (!editorState) {
|
|
52
|
+
return undefined;
|
|
53
|
+
}
|
|
54
|
+
return pluginKey.getState(editorState);
|
|
55
|
+
},
|
|
44
56
|
// do this early here, otherwise we have to wait for WidthEmitter to debounce
|
|
45
57
|
// which causes anything dependent on lineLength to jump around
|
|
46
58
|
contentComponent: function contentComponent(_ref2) {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
2
|
var _templateObject;
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
|
-
|
|
5
|
-
export var alignmentWrapper = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding: 0 ", "px;\n display: flex;\n flex-wrap: wrap;\n max-width: ", "px;\n"])), gridSize(), 3 * 32);
|
|
4
|
+
export var alignmentWrapper = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding: 0 ", ";\n display: flex;\n flex-wrap: wrap;\n max-width: ", "px;\n"])), "var(--ds-space-100, 8px)", 3 * 32);
|