@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
|
@@ -7,7 +7,7 @@ import ChevronLeftLargeIcon from '@atlaskit/icon/glyph/chevron-left-large';
|
|
|
7
7
|
import CrossCircleIcon from '@atlaskit/icon/glyph/cross-circle';
|
|
8
8
|
import { messages } from '../messages';
|
|
9
9
|
import { injectIntl } from 'react-intl-next';
|
|
10
|
-
import Button from '
|
|
10
|
+
import { FloatingToolbarButton as Button } from '@atlaskit/editor-common/ui';
|
|
11
11
|
import PanelTextInput from '../../../../../ui/PanelTextInput';
|
|
12
12
|
import * as keymaps from '../../../../../keymaps';
|
|
13
13
|
import { ToolTipContent } from '../../../../../keymaps';
|
|
@@ -3,7 +3,7 @@ import ReactDOM from 'react-dom';
|
|
|
3
3
|
import { MediaViewer } from '@atlaskit/media-viewer';
|
|
4
4
|
import { messages } from '@atlaskit/media-ui';
|
|
5
5
|
import FilePreviewIcon from '@atlaskit/icon/glyph/editor/file-preview';
|
|
6
|
-
import ToolbarButton from '
|
|
6
|
+
import { FloatingToolbarButton as ToolbarButton } from '@atlaskit/editor-common/ui';
|
|
7
7
|
import { getSelectedMediaContainerNodeAttrs } from './utils';
|
|
8
8
|
export const FilePreviewItem = ({
|
|
9
9
|
mediaPluginState,
|
|
@@ -5,7 +5,7 @@ import LinkIcon from '@atlaskit/icon/glyph/editor/link';
|
|
|
5
5
|
import OpenIcon from '@atlaskit/icon/glyph/shortcut';
|
|
6
6
|
import { isSafeUrl } from '@atlaskit/adf-schema';
|
|
7
7
|
import { checkMediaType } from '../utils/check-media-type';
|
|
8
|
-
import ToolbarButton from '
|
|
8
|
+
import { FloatingToolbarButton as ToolbarButton } from '@atlaskit/editor-common/ui';
|
|
9
9
|
import Separator from '../../floating-toolbar/ui/Separator';
|
|
10
10
|
import { linkToolbarMessages, linkMessages } from '../../../messages';
|
|
11
11
|
import { ToolTipContent, addLink } from '../../../keymaps';
|
|
@@ -2,6 +2,7 @@ import { css } from '@emotion/react';
|
|
|
2
2
|
import * as colors from '@atlaskit/theme/colors';
|
|
3
3
|
import { DEFAULT_BORDER_COLOR } from '@atlaskit/editor-common/ui-color';
|
|
4
4
|
import { N20A, N50, N60A, N90, N800, N0 } from '@atlaskit/theme/colors';
|
|
5
|
+
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
5
6
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
6
7
|
|
|
7
8
|
// menuItemDimensions and itemSpacing are copied from
|
|
@@ -11,6 +12,9 @@ export const menuItemDimensions = {
|
|
|
11
12
|
width: 175,
|
|
12
13
|
height: 32
|
|
13
14
|
};
|
|
15
|
+
|
|
16
|
+
// TODO: Migrate away from gridSize
|
|
17
|
+
// Recommendation: Replace directly with 4 due to itemSpacing being used in calculations
|
|
14
18
|
export const itemSpacing = gridSize() / 2;
|
|
15
19
|
export const contextualMenuArrow = css`
|
|
16
20
|
display: flex;
|
|
@@ -8,12 +8,12 @@ import EditorUnlinkIcon from '@atlaskit/icon/glyph/editor/unlink';
|
|
|
8
8
|
// Common Translations will live here
|
|
9
9
|
|
|
10
10
|
import PanelTextInput from '../../../ui/PanelTextInput';
|
|
11
|
-
import Button from '
|
|
11
|
+
import { FloatingToolbarButton as Button } from '@atlaskit/editor-common/ui';
|
|
12
12
|
import Separator from '../../floating-toolbar/ui/Separator';
|
|
13
13
|
import { container, containerWithProvider, inputWrapper } from '../../../ui/LinkSearch/ToolbarComponents';
|
|
14
14
|
import RecentSearch from '../../../ui/LinkSearch';
|
|
15
15
|
import { linkToolbarMessages } from '../../../messages';
|
|
16
|
-
import { normalizeUrl } from '
|
|
16
|
+
import { normalizeUrl } from '@atlaskit/editor-common/utils';
|
|
17
17
|
import { R400 } from '@atlaskit/theme/colors';
|
|
18
18
|
import { INPUT_METHOD } from '../../analytics/types/enums';
|
|
19
19
|
import { mediaLinkToolbarMessages } from './media-linking-toolbar-messages';
|
|
@@ -10,7 +10,7 @@ import { akEditorWideLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
|
10
10
|
import { wrapperStyle } from './styled';
|
|
11
11
|
import Resizer from '../../../../ui/Resizer';
|
|
12
12
|
import { snapTo, handleSides, imageAlignmentMap } from '../../../../ui/Resizer/utils';
|
|
13
|
-
import { calcMediaPxWidth } from '
|
|
13
|
+
import { calcMediaPxWidth } from '@atlaskit/editor-common/ui';
|
|
14
14
|
import { calculateSnapPoints } from '../../../../utils/rich-media-utils';
|
|
15
15
|
export default class ResizableMediaSingle extends React.Component {
|
|
16
16
|
constructor(...args) {
|
|
@@ -76,6 +76,9 @@ export default class ResizableMediaSingle extends React.Component {
|
|
|
76
76
|
state
|
|
77
77
|
}
|
|
78
78
|
} = this.props;
|
|
79
|
+
const {
|
|
80
|
+
resizedPctWidth
|
|
81
|
+
} = this.state;
|
|
79
82
|
const pos = typeof getPos === 'function' ? getPos() : undefined;
|
|
80
83
|
return calcMediaPxWidth({
|
|
81
84
|
origWidth,
|
|
@@ -88,7 +91,8 @@ export default class ResizableMediaSingle extends React.Component {
|
|
|
88
91
|
},
|
|
89
92
|
isFullWidthModeEnabled: fullWidthMode,
|
|
90
93
|
layout: useLayout || layout,
|
|
91
|
-
pos
|
|
94
|
+
pos,
|
|
95
|
+
resizedPctWidth
|
|
92
96
|
});
|
|
93
97
|
});
|
|
94
98
|
_defineProperty(this, "highlights", (newWidth, snapPoints) => {
|
|
@@ -126,13 +130,21 @@ export default class ResizableMediaSingle extends React.Component {
|
|
|
126
130
|
});
|
|
127
131
|
_defineProperty(this, "saveWrapper", wrapper => this.wrapper = wrapper);
|
|
128
132
|
}
|
|
129
|
-
componentDidUpdate() {
|
|
133
|
+
componentDidUpdate(prevProps) {
|
|
130
134
|
const offsetLeft = calcOffsetLeft(this.insideInlineLike, this.insideLayout, this.props.view.dom, this.wrapper);
|
|
131
135
|
if (offsetLeft !== this.state.offsetLeft && offsetLeft >= 0) {
|
|
132
136
|
this.setState({
|
|
133
137
|
offsetLeft
|
|
134
138
|
});
|
|
135
139
|
}
|
|
140
|
+
|
|
141
|
+
// Handle undo, when the actual pctWidth changed,
|
|
142
|
+
// we sync up with the internal state.
|
|
143
|
+
if (prevProps.pctWidth !== this.props.pctWidth) {
|
|
144
|
+
this.setState({
|
|
145
|
+
resizedPctWidth: this.props.pctWidth
|
|
146
|
+
});
|
|
147
|
+
}
|
|
136
148
|
return true;
|
|
137
149
|
}
|
|
138
150
|
get wrappedLayout() {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Fragment, Slice } from 'prosemirror-model';
|
|
2
2
|
import { safeInsert as pmSafeInsert, hasParentNodeOfType } from 'prosemirror-utils';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { checkNodeDown, isEmptyParagraph } from '../../../utils';
|
|
3
|
+
import { checkNodeDown } from '../../../utils';
|
|
4
|
+
import { isEmptyParagraph } from '@atlaskit/editor-common/utils';
|
|
6
5
|
import { copyOptionalAttrsFromMediaState } from '../utils/media-common';
|
|
7
6
|
import { mapSlice } from '../../../utils/slice';
|
|
8
|
-
import { addAnalytics
|
|
9
|
-
import {
|
|
7
|
+
import { addAnalytics } from '../../analytics';
|
|
8
|
+
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
|
|
9
|
+
import { safeInsert, shouldSplitSelectedNodeOnNodeInsertion } from '@atlaskit/editor-common/insert';
|
|
10
10
|
import { isImage } from './is-image';
|
|
11
11
|
import { atTheBeginningOfBlock } from '../../../utils/prosemirror/position';
|
|
12
12
|
import { getRandomHex } from '@atlaskit/media-common';
|
|
@@ -195,54 +195,6 @@ export function transformSliceForMedia(slice, schema) {
|
|
|
195
195
|
return newSlice;
|
|
196
196
|
};
|
|
197
197
|
}
|
|
198
|
-
export const calcMediaPxWidth = opts => {
|
|
199
|
-
const {
|
|
200
|
-
origWidth,
|
|
201
|
-
origHeight,
|
|
202
|
-
layout,
|
|
203
|
-
pctWidth,
|
|
204
|
-
containerWidth,
|
|
205
|
-
resizedPctWidth
|
|
206
|
-
} = opts;
|
|
207
|
-
const {
|
|
208
|
-
width,
|
|
209
|
-
lineLength
|
|
210
|
-
} = containerWidth;
|
|
211
|
-
const calculatedPctWidth = calcPctWidth(containerWidth, pctWidth, origWidth, origHeight);
|
|
212
|
-
const calculatedResizedPctWidth = calcPctWidth(containerWidth, resizedPctWidth, origWidth, origHeight);
|
|
213
|
-
if (layout === 'wide') {
|
|
214
|
-
if (lineLength) {
|
|
215
|
-
const wideWidth = Math.ceil(lineLength * breakoutWideScaleRatio);
|
|
216
|
-
return wideWidth > width ? lineLength : wideWidth;
|
|
217
|
-
}
|
|
218
|
-
} else if (layout === 'full-width') {
|
|
219
|
-
return width - akEditorBreakoutPadding;
|
|
220
|
-
} else if (calculatedPctWidth) {
|
|
221
|
-
if (wrappedLayouts.indexOf(layout) > -1) {
|
|
222
|
-
if (calculatedResizedPctWidth) {
|
|
223
|
-
if (resizedPctWidth < 50) {
|
|
224
|
-
return calculatedResizedPctWidth;
|
|
225
|
-
}
|
|
226
|
-
return calculatedPctWidth;
|
|
227
|
-
}
|
|
228
|
-
return Math.min(calculatedPctWidth, origWidth);
|
|
229
|
-
}
|
|
230
|
-
if (calculatedResizedPctWidth) {
|
|
231
|
-
return calculatedResizedPctWidth;
|
|
232
|
-
}
|
|
233
|
-
return calculatedPctWidth;
|
|
234
|
-
} else if (layout === 'center') {
|
|
235
|
-
if (calculatedResizedPctWidth) {
|
|
236
|
-
return calculatedResizedPctWidth;
|
|
237
|
-
}
|
|
238
|
-
return Math.min(origWidth, lineLength || width);
|
|
239
|
-
} else if (layout && wrappedLayouts.indexOf(layout) !== -1) {
|
|
240
|
-
const halfLineLength = Math.ceil((lineLength || width) / 2);
|
|
241
|
-
return origWidth <= halfLineLength ? origWidth : halfLineLength;
|
|
242
|
-
}
|
|
243
|
-
return origWidth;
|
|
244
|
-
};
|
|
245
|
-
const calcPctWidth = (containerWidth, pctWidth, origWidth, origHeight) => pctWidth && origWidth && origHeight && Math.ceil(calcPxFromPct(pctWidth / 100, containerWidth.lineLength || containerWidth.width));
|
|
246
198
|
export function isCaptionNode(editorView) {
|
|
247
199
|
const {
|
|
248
200
|
$from
|
|
@@ -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({
|
|
6
6
|
tr,
|
|
@@ -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({
|
|
6
6
|
tr,
|
|
7
7
|
slice
|
|
@@ -9,12 +9,12 @@ import { mapSlice } from '../../utils/slice';
|
|
|
9
9
|
import { INPUT_METHOD } from '../analytics';
|
|
10
10
|
import { queueCardsFromChangedTr } from '../card/pm-plugins/doc';
|
|
11
11
|
import { GapCursorSelection, Side } from '../selection/gap-cursor-selection';
|
|
12
|
-
import { linkifyContent } from '
|
|
12
|
+
import { linkifyContent } from '@atlaskit/editor-common/utils';
|
|
13
13
|
import { runMacroAutoConvert } from '../macro';
|
|
14
14
|
import { insertMediaAsMediaSingle } from '../media/utils/media-single';
|
|
15
15
|
import { pluginKey as textFormattingPluginKey } from '../text-formatting/pm-plugins/main';
|
|
16
16
|
import { addReplaceSelectedTableAnalytics, applyTextMarksToSlice, hasOnlyNodesOfType } from './util';
|
|
17
|
-
import {
|
|
17
|
+
import { isListItemNode, isListNode } from '@atlaskit/editor-common/utils';
|
|
18
18
|
import { canLinkBeCreatedInRange } from '../hyperlink/pm-plugins/main';
|
|
19
19
|
import { insertSliceForLists } from './edge-cases';
|
|
20
20
|
import { startTrackingPastedMacroPositions, stopTrackingPastedMacroPositions } from './commands';
|
|
@@ -59,6 +59,7 @@ export function handlePasteIntoTaskOrDecisionOrPanel(slice) {
|
|
|
59
59
|
panel,
|
|
60
60
|
bulletList,
|
|
61
61
|
orderedList,
|
|
62
|
+
taskList,
|
|
62
63
|
listItem,
|
|
63
64
|
expand,
|
|
64
65
|
heading
|
|
@@ -75,6 +76,9 @@ export function handlePasteIntoTaskOrDecisionOrPanel(slice) {
|
|
|
75
76
|
if (node.type === bulletList || node.type === orderedList || node.type === expand || node.type === heading || node.type === listItem) {
|
|
76
77
|
sliceIsInvalid = true;
|
|
77
78
|
}
|
|
79
|
+
if (selectionIsPanel && node.type === taskList) {
|
|
80
|
+
sliceIsInvalid = true;
|
|
81
|
+
}
|
|
78
82
|
});
|
|
79
83
|
|
|
80
84
|
// If the selection is a panel,
|
|
@@ -746,7 +750,7 @@ export function flattenNestedListInSlice(slice) {
|
|
|
746
750
|
}
|
|
747
751
|
export function handleRichText(slice) {
|
|
748
752
|
return (state, dispatch) => {
|
|
749
|
-
var _slice$content, _slice$content2, _panelParentOverCurre;
|
|
753
|
+
var _slice$content, _slice$content2, _firstChildOfSlice$ty, _lastChildOfSlice$typ, _panelParentOverCurre;
|
|
750
754
|
const {
|
|
751
755
|
codeBlock,
|
|
752
756
|
heading,
|
|
@@ -773,6 +777,9 @@ export function handleRichText(slice) {
|
|
|
773
777
|
const isFirstChildListNode = isListNode(firstChildOfSlice);
|
|
774
778
|
const isLastChildListNode = isListNode(lastChildOfSlice);
|
|
775
779
|
const isSliceContentListNodes = isFirstChildListNode || isLastChildListNode;
|
|
780
|
+
const isFirstChildTaskListNode = (firstChildOfSlice === null || firstChildOfSlice === void 0 ? void 0 : (_firstChildOfSlice$ty = firstChildOfSlice.type) === null || _firstChildOfSlice$ty === void 0 ? void 0 : _firstChildOfSlice$ty.name) === 'taskList';
|
|
781
|
+
const isLastChildTaskListNode = (lastChildOfSlice === null || lastChildOfSlice === void 0 ? void 0 : (_lastChildOfSlice$typ = lastChildOfSlice.type) === null || _lastChildOfSlice$typ === void 0 ? void 0 : _lastChildOfSlice$typ.name) === 'taskList';
|
|
782
|
+
const isSliceContentTaskListNodes = isFirstChildTaskListNode || isLastChildTaskListNode;
|
|
776
783
|
|
|
777
784
|
// We want to use safeInsert to insert invalid content, as it inserts at the closest non schema violating position
|
|
778
785
|
// rather than spliting the selection parent node in half (which is what replaceSelection does)
|
|
@@ -782,7 +789,7 @@ export function handleRichText(slice) {
|
|
|
782
789
|
const noNeedForSafeInsert = selection.$to.node().type.validContent(slice.content) || textNodes.includes(selection.$to.node().type) && selectionParent.type.validContent(slice.content);
|
|
783
790
|
let panelParentOverCurrentSelection = findParentNodeOfType(panel)(tr.selection);
|
|
784
791
|
const isTargetPanelEmpty = panelParentOverCurrentSelection && ((_panelParentOverCurre = panelParentOverCurrentSelection.node) === null || _panelParentOverCurre === void 0 ? void 0 : _panelParentOverCurre.content.size) === 2;
|
|
785
|
-
if (isSliceContentListNodes || isTargetPanelEmpty) {
|
|
792
|
+
if (!isSliceContentTaskListNodes && (isSliceContentListNodes || isTargetPanelEmpty)) {
|
|
786
793
|
insertSliceForLists({
|
|
787
794
|
tr,
|
|
788
795
|
slice,
|
|
@@ -3,7 +3,7 @@ import { getPasteSource } from '../util';
|
|
|
3
3
|
import { handlePasteAsPlainText, handlePasteIntoTaskOrDecisionOrPanel, handleCodeBlock, handleMediaSingle, handlePastePreservingMarks, handleMarkdown, handleRichText, handleExpandPasteInTable, handleSelectedTable, handlePasteLinkOnSelectedText, handlePasteIntoCaption, handlePastePanelOrDecisionContentIntoList, handlePasteNonNestableBlockNodesIntoList } from '../handlers';
|
|
4
4
|
import { findParentNode } from 'prosemirror-utils';
|
|
5
5
|
import { mapSlice } from '../../../utils/slice';
|
|
6
|
-
import { getLinkDomain } from '
|
|
6
|
+
import { getLinkDomain } from '@atlaskit/editor-common/utils';
|
|
7
7
|
const contentToPasteContent = {
|
|
8
8
|
url: PasteContents.url,
|
|
9
9
|
paragraph: PasteContents.text,
|
|
@@ -8,7 +8,7 @@ import { getExtensionAutoConvertersFromProvider } from '@atlaskit/editor-common/
|
|
|
8
8
|
import * as clipboard from '../../../utils/clipboard';
|
|
9
9
|
import { transformSliceForMedia } from '../../media/utils/media-single';
|
|
10
10
|
import { escapeLinks, htmlContainsSingleFile, isPastedFromWord, isPastedFromExcel, htmlHasInvalidLinkTags, removeDuplicateInvalidLinks } from '../util';
|
|
11
|
-
import { linkifyContent } from '
|
|
11
|
+
import { linkifyContent } from '@atlaskit/editor-common/utils';
|
|
12
12
|
import { transformSliceNestedExpandToExpand } from '../../expand/utils';
|
|
13
13
|
import { handleMacroAutoConvert, handleMention, handleParagraphBlockMarks } from '../handlers';
|
|
14
14
|
import { transformSliceToJoinAdjacentCodeBlocks, transformSingleLineCodeBlockToCodeMark } from '../../code-block/utils';
|
|
@@ -18,7 +18,7 @@ import { isInsideBlockQuote, insideTable, measurements } from '../../../utils';
|
|
|
18
18
|
import { measureRender } from '@atlaskit/editor-common/utils';
|
|
19
19
|
import { transformSliceToCorrectMediaWrapper, unwrapNestedMediaElements } from '../../media/utils/media-common';
|
|
20
20
|
import { upgradeTextToLists, splitParagraphs } from '../../list/transforms';
|
|
21
|
-
import { md } from '
|
|
21
|
+
import { md } from '@atlaskit/editor-common/paste';
|
|
22
22
|
import { transformUnsupportedBlockCardToInline } from '../../card/utils';
|
|
23
23
|
import { transformSliceToDecisionList } from '../../tasks-and-decisions/utils';
|
|
24
24
|
import { containsAnyAnnotations, stripNonExistingAnnotations } from '../../annotation/utils';
|
|
@@ -29,7 +29,6 @@ import { handlePaste as handlePasteTable } from '@atlaskit/editor-tables/utils';
|
|
|
29
29
|
import { extractSliceFromStep } from '../../../utils/step';
|
|
30
30
|
import { pluginKey as stateKey, createPluginState } from './plugin-factory';
|
|
31
31
|
export { pluginKey as stateKey } from './plugin-factory';
|
|
32
|
-
export { md } from '../md';
|
|
33
32
|
export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, cardOptions, sanitizePrivateContent, providerFactory) {
|
|
34
33
|
const atlassianMarkDownParser = new MarkdownTransformer(schema, md);
|
|
35
34
|
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 const openElementBrowserModal = () => (state, dispatch) => {
|
|
6
6
|
if (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 const 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,5 +1,6 @@
|
|
|
1
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
1
|
import { NodeSelection, TextSelection } from 'prosemirror-state';
|
|
2
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
|
+
import { pmHistoryPluginKey } from '@atlaskit/editor-common/utils';
|
|
3
4
|
import { getInlineNodeViewProducer } from '../../nodeviews/getInlineNodeViewProducer';
|
|
4
5
|
import { StatusNodeView } from './nodeviews/status';
|
|
5
6
|
import { pluginKey } from './plugin-key';
|
|
@@ -77,8 +78,13 @@ const createPlugin = (pmPluginFactoryParams, options) => new SafePlugin({
|
|
|
77
78
|
let changed = false;
|
|
78
79
|
let tr = newEditorState.tr;
|
|
79
80
|
|
|
80
|
-
|
|
81
|
-
|
|
81
|
+
/**
|
|
82
|
+
* When user start creating status, and, when users navigates away
|
|
83
|
+
* while empty, then we want to remove empty ("set a status") status.
|
|
84
|
+
* But when transaction to add empty status happens from undo/redo
|
|
85
|
+
* we don't want to remove it.
|
|
86
|
+
*/
|
|
87
|
+
if (transactions.find(tr => tr.selectionSet && !tr.getMeta(pmHistoryPluginKey))) {
|
|
82
88
|
let oldStatus = mayGetStatusAtSelection(oldEditorState.selection);
|
|
83
89
|
let newStatus = mayGetStatusAtSelection(newEditorState.selection);
|
|
84
90
|
if (oldStatus && (newStatus && oldStatus.localId !== newStatus.localId || !newStatus)) {
|
|
@@ -6,7 +6,7 @@ import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
|
6
6
|
import { Popup } from '@atlaskit/editor-common/ui';
|
|
7
7
|
import { akEditorFloatingDialogZIndex } from '@atlaskit/editor-shared-styles';
|
|
8
8
|
import { StatusPicker as AkStatusPicker } from '@atlaskit/status/picker';
|
|
9
|
-
import { borderRadius
|
|
9
|
+
import { borderRadius } from '@atlaskit/theme/constants';
|
|
10
10
|
import { N0 } from '@atlaskit/theme/colors';
|
|
11
11
|
import withOuterListeners from '../../../ui/with-outer-listeners';
|
|
12
12
|
import { DEFAULT_STATUS } from '../actions';
|
|
@@ -20,7 +20,7 @@ export let InputMethod = /*#__PURE__*/function (InputMethod) {
|
|
|
20
20
|
}({});
|
|
21
21
|
const pickerContainer = css`
|
|
22
22
|
background: ${`var(--ds-surface-overlay, ${N0})`};
|
|
23
|
-
padding: ${
|
|
23
|
+
padding: ${"var(--ds-space-100, 8px)"} 0;
|
|
24
24
|
border-radius: ${borderRadius()}px;
|
|
25
25
|
box-shadow: ${"var(--ds-shadow-overlay, 0 0 1px rgba(9, 30, 66, 0.31), 0 4px 8px -2px rgba(9, 30, 66, 0.25))"};
|
|
26
26
|
input {
|
|
@@ -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
|
const $pos = doc.resolve(pos);
|
|
7
6
|
const createInsertPosition = (from, to) => ({
|
|
@@ -4,7 +4,7 @@ import { css, jsx } from '@emotion/react';
|
|
|
4
4
|
import rafSchedule from 'raf-schd';
|
|
5
5
|
import { akEditorFloatingDialogZIndex } from '@atlaskit/editor-shared-styles';
|
|
6
6
|
import { findOverflowScrollParent, Popup } from '@atlaskit/editor-common/ui';
|
|
7
|
-
import { borderRadius
|
|
7
|
+
import { borderRadius } from '@atlaskit/theme/constants';
|
|
8
8
|
import { N0, N60A, N50A } from '@atlaskit/theme/colors';
|
|
9
9
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
10
10
|
import { CloseSelectionOptions, TYPE_AHEAD_DECORATION_DATA_ATTRIBUTE, TYPE_AHEAD_POPUP_CONTENT_CLASS } from '../constants';
|
|
@@ -15,7 +15,7 @@ const typeAheadContent = css`
|
|
|
15
15
|
background: ${`var(--ds-surface-overlay, ${N0})`};
|
|
16
16
|
border-radius: ${borderRadius()}px;
|
|
17
17
|
box-shadow: ${`var(--ds-shadow-overlay, ${`0 0 1px ${N60A}, 0 4px 8px -2px ${N50A}`})`};
|
|
18
|
-
padding: ${
|
|
18
|
+
padding: ${"var(--ds-space-050, 4px)"} 0;
|
|
19
19
|
width: 320px;
|
|
20
20
|
max-height: 380px; /* ~5.5 visibile items */
|
|
21
21
|
overflow-y: auto;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import { PluginKey } from 'prosemirror-state';
|
|
3
|
+
/**
|
|
4
|
+
* @private
|
|
5
|
+
* @deprecated
|
|
6
|
+
*
|
|
7
|
+
* Do not use this plugin key directly. Please use the `sharedState` of this plugin instead.
|
|
8
|
+
*/
|
|
3
9
|
export const pluginKey = new PluginKey('widthPlugin');
|
|
4
10
|
export function createPlugin(dispatch) {
|
|
5
11
|
return new SafePlugin({
|
|
@@ -35,6 +41,12 @@ const widthPlugin = () => ({
|
|
|
35
41
|
dispatch
|
|
36
42
|
}) => createPlugin(dispatch)
|
|
37
43
|
}],
|
|
44
|
+
getSharedState: editorState => {
|
|
45
|
+
if (!editorState) {
|
|
46
|
+
return undefined;
|
|
47
|
+
}
|
|
48
|
+
return pluginKey.getState(editorState);
|
|
49
|
+
},
|
|
38
50
|
// do this early here, otherwise we have to wait for WidthEmitter to debounce
|
|
39
51
|
// which causes anything dependent on lineLength to jump around
|
|
40
52
|
contentComponent({
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
|
-
import { gridSize } from '@atlaskit/theme/constants';
|
|
3
2
|
export const alignmentWrapper = css`
|
|
4
|
-
padding: 0 ${
|
|
3
|
+
padding: 0 ${"var(--ds-space-100, 8px)"};
|
|
5
4
|
display: flex;
|
|
6
5
|
flex-wrap: wrap;
|
|
7
6
|
max-width: ${3 * 32}px;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React, { useEffect, useState } from 'react';
|
|
3
3
|
import { css, jsx } from '@emotion/react';
|
|
4
|
-
import { gridSize } from '@atlaskit/theme/constants';
|
|
5
4
|
import { N30 } from '@atlaskit/theme/colors';
|
|
6
5
|
import { akEditorToolbarKeylineHeight, akEditorMenuZIndex } from '@atlaskit/editor-shared-styles';
|
|
7
6
|
export const TableControlsPadding = 20;
|
|
8
7
|
const mainToolbarWrapperStyle = css`
|
|
9
8
|
position: relative;
|
|
10
9
|
align-items: center;
|
|
11
|
-
padding: ${
|
|
10
|
+
padding: ${"var(--ds-space-100, 8px)"} ${"var(--ds-space-100, 8px)"} 0;
|
|
12
11
|
display: flex;
|
|
13
12
|
height: auto;
|
|
14
13
|
background-color: ${"var(--ds-surface, white)"};
|
|
@@ -31,7 +30,7 @@ const stickyToolbarWrapperStyle = css`
|
|
|
31
30
|
position: relative;
|
|
32
31
|
position: sticky;
|
|
33
32
|
/* stylelint-enable declaration-block-no-duplicate-properties */
|
|
34
|
-
padding-bottom: ${
|
|
33
|
+
padding-bottom: ${"var(--ds-space-100, 8px)"};
|
|
35
34
|
z-index: ${akEditorMenuZIndex};
|
|
36
35
|
transition: box-shadow ease-in-out 0.2s;
|
|
37
36
|
&.show-keyline {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
2
|
import { N30 } from '@atlaskit/theme/colors';
|
|
3
|
-
import { gridSize } from '@atlaskit/theme/constants';
|
|
4
3
|
import { akEditorMenuZIndex, akEditorSwoopCubicBezier, akEditorToolbarKeylineHeight, akEditorMobileMaxWidth } from '@atlaskit/editor-shared-styles';
|
|
5
4
|
export const MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT = 868;
|
|
6
5
|
const toolbarLineHeight = 56;
|
|
@@ -39,9 +38,9 @@ const mainToolbar = css`
|
|
|
39
38
|
`;
|
|
40
39
|
export const mainToolbarStyle = (showKeyline, twoLineEditorToolbar) => [mainToolbar, showKeyline && mainToolbarWithKeyline, twoLineEditorToolbar && mainToolbarTwoLineStyle];
|
|
41
40
|
export const mainToolbarIconBeforeStyle = css`
|
|
42
|
-
margin: ${
|
|
43
|
-
height: ${
|
|
44
|
-
width: ${
|
|
41
|
+
margin: ${"var(--ds-space-200, 16px)"};
|
|
42
|
+
height: ${"var(--ds-space-400, 32px)"};
|
|
43
|
+
width: ${"var(--ds-space-400, 32px)"};
|
|
45
44
|
@media (max-width: ${akEditorMobileMaxWidth}px) {
|
|
46
45
|
grid-column: 1;
|
|
47
46
|
grid-row: 1;
|
|
@@ -67,12 +67,19 @@ const ColorPickerButton = props => {
|
|
|
67
67
|
return position;
|
|
68
68
|
}, []);
|
|
69
69
|
const ColorPaletteWithListeners = withOuterListeners(ColorPalette);
|
|
70
|
-
const
|
|
70
|
+
const {
|
|
71
|
+
onChange,
|
|
72
|
+
createAnalyticsEvent,
|
|
73
|
+
colorPalette,
|
|
74
|
+
placement,
|
|
75
|
+
skipFocusButtonAfterPick
|
|
76
|
+
} = props;
|
|
77
|
+
const onColorSelected = React.useCallback((color, label) => {
|
|
71
78
|
setIsOpenedByKeyboard(false);
|
|
72
79
|
setIsPopupOpen(false);
|
|
73
80
|
setIsPopupPositioned(false);
|
|
74
|
-
if (
|
|
75
|
-
if (
|
|
81
|
+
if (onChange) {
|
|
82
|
+
if (createAnalyticsEvent) {
|
|
76
83
|
// fire analytics
|
|
77
84
|
const payload = {
|
|
78
85
|
action: ACTION.UPDATED,
|
|
@@ -81,17 +88,19 @@ const ColorPickerButton = props => {
|
|
|
81
88
|
attributes: {
|
|
82
89
|
color,
|
|
83
90
|
label,
|
|
84
|
-
placement:
|
|
91
|
+
placement: placement
|
|
85
92
|
},
|
|
86
93
|
eventType: EVENT_TYPE.TRACK
|
|
87
94
|
};
|
|
88
|
-
|
|
95
|
+
createAnalyticsEvent(payload).fire(editorAnalyticsChannel);
|
|
89
96
|
}
|
|
90
|
-
const newPalette =
|
|
91
|
-
newPalette &&
|
|
97
|
+
const newPalette = colorPalette.find(colorPalette => colorPalette.value === color);
|
|
98
|
+
newPalette && onChange(newPalette);
|
|
92
99
|
}
|
|
93
|
-
|
|
94
|
-
|
|
100
|
+
if (!skipFocusButtonAfterPick) {
|
|
101
|
+
focusButton();
|
|
102
|
+
}
|
|
103
|
+
}, [colorPalette, onChange, createAnalyticsEvent, placement, skipFocusButtonAfterPick]);
|
|
95
104
|
const renderPopup = () => {
|
|
96
105
|
if (!isPopupOpen || !buttonRef.current) {
|
|
97
106
|
return;
|
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
/** @jsx jsx */
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { css, jsx } from '@emotion/react';
|
|
6
|
-
import { gridSize } from '@atlaskit/theme/constants';
|
|
7
6
|
const imageContainer = css`
|
|
8
|
-
margin: 0 auto ${
|
|
7
|
+
margin: 0 auto ${"var(--ds-space-300, 24px)"};
|
|
9
8
|
height: 80px;
|
|
10
9
|
`;
|
|
11
10
|
const ErrorImage = () => jsx("div", {
|
|
@@ -5,6 +5,7 @@ import { Field } from '@atlaskit/form';
|
|
|
5
5
|
import { hexToEditorTableChartsPaletteColor } from '@atlaskit/editor-palette';
|
|
6
6
|
import { DEFAULT_BORDER_COLOR } from '../../../ui/ColorPalette/Palettes/common';
|
|
7
7
|
import { validate } from '../utils';
|
|
8
|
+
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
8
9
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
9
10
|
import { requiredIndicator } from './common/RequiredIndicator';
|
|
10
11
|
import { headingSizes } from '@atlaskit/theme/typography';
|
|
@@ -320,8 +321,8 @@ const colorPickerWrapper = css`
|
|
|
320
321
|
display: flex;
|
|
321
322
|
justify-content: space-between;
|
|
322
323
|
align-items: center;
|
|
323
|
-
height: ${
|
|
324
|
-
padding-right: ${
|
|
324
|
+
height: ${"var(--ds-space-400, 32px)"};
|
|
325
|
+
padding-right: ${"var(--ds-space-100, 8px)"};
|
|
325
326
|
`;
|
|
326
327
|
const colorPickerLabel = css`
|
|
327
328
|
font-size: ${headingSizes.h400.size}px;
|
|
@@ -372,7 +373,10 @@ const ColorPicker = props => {
|
|
|
372
373
|
showSomewhatSemanticTooltips: useSomewhatSemanticTextColorNames,
|
|
373
374
|
cols: EXPANDED_COLOR_PICKER_COLUMNS,
|
|
374
375
|
alignX: "right",
|
|
375
|
-
placement: "ConfigPanel"
|
|
376
|
+
placement: "ConfigPanel"
|
|
377
|
+
// TODO: Migrate away from gridSize
|
|
378
|
+
// Recommendation: Update types of size object to accept string width/height and then replace gridSize with tokens
|
|
379
|
+
,
|
|
376
380
|
size: {
|
|
377
381
|
width: 3 * gridSize(),
|
|
378
382
|
height: 3 * gridSize()
|
|
@@ -6,24 +6,23 @@ import { N40 } from '@atlaskit/theme/colors';
|
|
|
6
6
|
import ChevronDownIcon from '@atlaskit/icon/glyph/chevron-down';
|
|
7
7
|
import ChevronRightIcon from '@atlaskit/icon/glyph/chevron-right';
|
|
8
8
|
import Button from '@atlaskit/button';
|
|
9
|
-
import { gridSize } from '@atlaskit/theme/constants';
|
|
10
9
|
import { messages } from '../messages';
|
|
11
10
|
export const expandContainer = css`
|
|
12
11
|
border-bottom: 1px solid ${`var(--ds-border, ${N40})`};
|
|
13
12
|
`;
|
|
14
13
|
export const expandControl = css`
|
|
15
14
|
display: flex;
|
|
16
|
-
height: ${
|
|
15
|
+
height: ${"var(--ds-space-600, 48px)"};
|
|
17
16
|
justify-content: center;
|
|
18
|
-
padding-right: ${
|
|
17
|
+
padding-right: ${"var(--ds-space-100, 8px)"};
|
|
19
18
|
`;
|
|
20
19
|
const chevronContainer = css`
|
|
21
20
|
display: flex;
|
|
22
21
|
align-items: center;
|
|
23
22
|
|
|
24
23
|
& > button {
|
|
25
|
-
width: ${
|
|
26
|
-
height: ${
|
|
24
|
+
width: ${"var(--ds-space-300, 24px)"};
|
|
25
|
+
height: ${"var(--ds-space-300, 24px)"};
|
|
27
26
|
}
|
|
28
27
|
`;
|
|
29
28
|
const labelContainer = css`
|
|
@@ -34,7 +33,7 @@ const labelContainer = css`
|
|
|
34
33
|
`;
|
|
35
34
|
const expandContentContainer = isHidden => css`
|
|
36
35
|
display: ${isHidden ? 'none' : 'block'};
|
|
37
|
-
margin-top:
|
|
36
|
+
margin-top: calc(-1 * ${"var(--ds-space-100, 8px)"});
|
|
38
37
|
`;
|
|
39
38
|
function Expand({
|
|
40
39
|
field,
|