@atlaskit/editor-core 181.0.1 → 182.0.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 +40 -0
- package/codemods/140.0.0-rc-kraken-fix-type-errors.ts +0 -2
- package/codemods/__tests__/next-remove-allow-more-text-colors-prop.ts +0 -17
- package/codemods/migrates/next-remove-allow-more-text-colors-prop.ts +0 -4
- package/dist/cjs/create-editor/sort-by-order.js +12 -0
- package/dist/cjs/editor-next/editor-migration-component.js +4 -1
- package/dist/cjs/editor-next/utils/deprecationWarnings.js +0 -5
- package/dist/cjs/labs/next/full-page.js +2 -1
- package/dist/cjs/labs/next/presets/default.js +2 -1
- package/dist/cjs/labs/next/presets/universal.js +7 -1
- package/dist/cjs/plugins/alignment/ui/ToolbarAlignment/index.js +2 -1
- package/dist/cjs/plugins/alignment/ui/ToolbarAlignment/styles.js +4 -7
- package/dist/cjs/plugins/analytics/plugin.js +6 -6
- package/dist/cjs/plugins/avatar-group/index.js +5 -2
- package/dist/cjs/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +4 -2
- package/dist/cjs/plugins/base/index.js +4 -2
- package/dist/cjs/plugins/base/pm-plugins/disable-spell-checking.js +1 -3
- package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/blocktype-button.js +1 -6
- package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/index.js +2 -8
- package/dist/cjs/plugins/border/index.js +20 -0
- package/dist/cjs/plugins/card/index.js +4 -2
- package/dist/cjs/plugins/card/toolbar.js +12 -15
- package/dist/cjs/plugins/card/ui/EditLinkToolbar.js +7 -3
- package/dist/cjs/plugins/code-block/toolbar.js +1 -1
- package/dist/cjs/plugins/collab-edit/analytics.js +2 -3
- package/dist/cjs/plugins/collab-edit/events/handlers.js +2 -2
- package/dist/cjs/plugins/collab-edit/events/initialize.js +3 -2
- package/dist/cjs/plugins/collab-edit/index.js +5 -3
- package/dist/cjs/plugins/collab-edit/plugin.js +4 -3
- package/dist/cjs/plugins/collab-edit/ui/avatars-with-plugin-state.js +5 -3
- package/dist/cjs/plugins/collab-edit/ui/avatars.js +2 -3
- package/dist/cjs/plugins/date/index.js +90 -64
- package/dist/cjs/plugins/editor-disabled/index.js +8 -0
- package/dist/cjs/plugins/expand/index.js +4 -1
- package/dist/cjs/plugins/expand/nodeviews/index.js +6 -7
- package/dist/cjs/plugins/expand/pm-plugins/main.js +5 -2
- package/dist/cjs/plugins/extension/extension-api.js +27 -14
- package/dist/cjs/plugins/extension/pm-plugins/main.js +117 -177
- package/dist/cjs/plugins/extension/pm-plugins/utils.js +80 -0
- package/dist/cjs/plugins/feature-flags-context/get-enabled-feature-flag-keys.js +7 -11
- package/dist/cjs/plugins/find-replace/FindReplaceToolbarButtonWithState.js +3 -4
- package/dist/cjs/plugins/find-replace/index.js +5 -2
- package/dist/cjs/plugins/floating-toolbar/index.js +15 -7
- package/dist/cjs/plugins/floating-toolbar/ui/CheckboxModal.js +2 -1
- package/dist/cjs/plugins/floating-toolbar/ui/EmojiPickerButton.js +13 -3
- package/dist/cjs/plugins/floating-toolbar/ui/SimpleModal.js +2 -1
- package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +6 -5
- package/dist/cjs/plugins/hyperlink/Toolbar.js +9 -12
- package/dist/cjs/plugins/hyperlink/index.js +6 -2
- package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +3 -4
- package/dist/cjs/plugins/index.js +7 -0
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +2 -1
- package/dist/cjs/plugins/list/actions/outdent-list-items-selected.js +5 -5
- package/dist/cjs/plugins/list/commands/index.js +31 -27
- package/dist/cjs/plugins/list/commands/outdent-list.js +2 -3
- package/dist/cjs/plugins/list/index.js +4 -3
- package/dist/cjs/plugins/list/pm-plugins/input-rules/create-list-input-rule.js +3 -1
- package/dist/cjs/plugins/list/pm-plugins/input-rules/index.js +2 -1
- package/dist/cjs/plugins/list/pm-plugins/input-rules/wrapping-join-rule.js +58 -0
- package/dist/cjs/plugins/list/pm-plugins/keymap.js +4 -4
- package/dist/cjs/plugins/list/pm-plugins/main.js +23 -21
- package/dist/cjs/plugins/media/nodeviews/mediaNodeView/media.js +6 -1
- package/dist/cjs/plugins/media/nodeviews/styles.js +13 -1
- package/dist/cjs/plugins/media/toolbar/commands.js +105 -2
- package/dist/cjs/plugins/media/toolbar/imageBorder.js +20 -0
- package/dist/cjs/plugins/media/toolbar/index.js +33 -4
- package/dist/cjs/plugins/media/ui/ImageBorder/index.js +219 -0
- package/dist/cjs/plugins/media/ui/ImageBorder/messages.js +50 -0
- package/dist/cjs/plugins/media/ui/ImageBorder/styles.js +54 -0
- package/dist/cjs/plugins/media/utils/current-media-node.js +28 -5
- package/dist/cjs/plugins/paste/util/index.js +2 -0
- package/dist/cjs/plugins/rank.js +1 -1
- package/dist/cjs/plugins/rule/pm-plugins/input-rule.js +5 -0
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/hooks/clear-formatting-icon.js +2 -1
- package/dist/cjs/plugins/toolbar-lists-indentation/index.js +3 -1
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/Toolbar.js +2 -1
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +2 -1
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/index.js +6 -3
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/onItemActivated.js +3 -2
- package/dist/cjs/test-utils.js +3 -1
- package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +4 -2
- package/dist/cjs/ui/styles.js +1 -1
- package/dist/cjs/utils/input-rules.js +0 -17
- package/dist/cjs/utils/insert.js +53 -7
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/create-editor/sort-by-order.js +11 -0
- package/dist/es2019/editor-next/editor-migration-component.js +4 -1
- package/dist/es2019/editor-next/utils/deprecationWarnings.js +0 -5
- package/dist/es2019/labs/next/full-page.js +2 -1
- package/dist/es2019/labs/next/presets/default.js +2 -1
- package/dist/es2019/labs/next/presets/universal.js +8 -2
- package/dist/es2019/plugins/alignment/ui/ToolbarAlignment/index.js +3 -2
- package/dist/es2019/plugins/alignment/ui/ToolbarAlignment/styles.js +0 -8
- package/dist/es2019/plugins/analytics/plugin.js +45 -43
- package/dist/es2019/plugins/avatar-group/index.js +26 -21
- package/dist/es2019/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +4 -2
- package/dist/es2019/plugins/base/index.js +101 -97
- package/dist/es2019/plugins/base/pm-plugins/disable-spell-checking.js +1 -3
- package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/blocktype-button.js +1 -6
- package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/index.js +2 -7
- package/dist/es2019/plugins/border/index.js +11 -0
- package/dist/es2019/plugins/card/index.js +4 -2
- package/dist/es2019/plugins/card/toolbar.js +10 -11
- package/dist/es2019/plugins/card/ui/EditLinkToolbar.js +7 -3
- package/dist/es2019/plugins/code-block/toolbar.js +2 -2
- package/dist/es2019/plugins/collab-edit/analytics.js +2 -3
- package/dist/es2019/plugins/collab-edit/events/handlers.js +2 -2
- package/dist/es2019/plugins/collab-edit/events/initialize.js +3 -2
- package/dist/es2019/plugins/collab-edit/index.js +5 -3
- package/dist/es2019/plugins/collab-edit/plugin.js +4 -3
- package/dist/es2019/plugins/collab-edit/ui/avatars-with-plugin-state.js +5 -3
- package/dist/es2019/plugins/collab-edit/ui/avatars.js +2 -3
- package/dist/es2019/plugins/date/index.js +92 -64
- package/dist/es2019/plugins/editor-disabled/index.js +8 -0
- package/dist/es2019/plugins/expand/index.js +57 -53
- package/dist/es2019/plugins/expand/nodeviews/index.js +6 -9
- package/dist/es2019/plugins/expand/pm-plugins/main.js +5 -3
- package/dist/es2019/plugins/extension/extension-api.js +31 -13
- package/dist/es2019/plugins/extension/pm-plugins/main.js +77 -96
- package/dist/es2019/plugins/extension/pm-plugins/utils.js +30 -0
- package/dist/es2019/plugins/feature-flags-context/get-enabled-feature-flag-keys.js +1 -8
- package/dist/es2019/plugins/find-replace/FindReplaceToolbarButtonWithState.js +3 -3
- package/dist/es2019/plugins/find-replace/index.js +5 -2
- package/dist/es2019/plugins/floating-toolbar/index.js +159 -149
- package/dist/es2019/plugins/floating-toolbar/ui/CheckboxModal.js +4 -1
- package/dist/es2019/plugins/floating-toolbar/ui/EmojiPickerButton.js +13 -3
- package/dist/es2019/plugins/floating-toolbar/ui/SimpleModal.js +4 -1
- package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +6 -5
- package/dist/es2019/plugins/hyperlink/Toolbar.js +7 -9
- package/dist/es2019/plugins/hyperlink/index.js +66 -62
- package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +3 -3
- package/dist/es2019/plugins/index.js +2 -1
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +2 -1
- package/dist/es2019/plugins/list/actions/outdent-list-items-selected.js +5 -5
- package/dist/es2019/plugins/list/commands/index.js +4 -4
- package/dist/es2019/plugins/list/commands/outdent-list.js +2 -4
- package/dist/es2019/plugins/list/index.js +80 -77
- package/dist/es2019/plugins/list/pm-plugins/input-rules/create-list-input-rule.js +3 -1
- package/dist/es2019/plugins/list/pm-plugins/input-rules/index.js +2 -1
- package/dist/es2019/plugins/list/pm-plugins/input-rules/wrapping-join-rule.js +52 -0
- package/dist/es2019/plugins/list/pm-plugins/keymap.js +4 -4
- package/dist/es2019/plugins/list/pm-plugins/main.js +46 -46
- package/dist/es2019/plugins/media/nodeviews/mediaNodeView/media.js +4 -1
- package/dist/es2019/plugins/media/nodeviews/styles.js +12 -1
- package/dist/es2019/plugins/media/toolbar/commands.js +93 -0
- package/dist/es2019/plugins/media/toolbar/imageBorder.js +15 -0
- package/dist/es2019/plugins/media/toolbar/index.js +36 -5
- package/dist/es2019/plugins/media/ui/ImageBorder/index.js +206 -0
- package/dist/es2019/plugins/media/ui/ImageBorder/messages.js +43 -0
- package/dist/es2019/plugins/media/ui/ImageBorder/styles.js +124 -0
- package/dist/es2019/plugins/media/utils/current-media-node.js +22 -3
- package/dist/es2019/plugins/paste/util/index.js +2 -0
- package/dist/es2019/plugins/rank.js +1 -1
- package/dist/es2019/plugins/rule/pm-plugins/input-rule.js +7 -0
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/hooks/clear-formatting-icon.js +2 -1
- package/dist/es2019/plugins/toolbar-lists-indentation/index.js +59 -55
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/Toolbar.js +2 -1
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +2 -1
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/index.js +6 -3
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/onItemActivated.js +3 -2
- package/dist/es2019/test-utils.js +3 -1
- package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +4 -2
- package/dist/es2019/ui/styles.js +1 -0
- package/dist/es2019/utils/input-rules.js +0 -17
- package/dist/es2019/utils/insert.js +61 -10
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/create-editor/sort-by-order.js +11 -0
- package/dist/esm/editor-next/editor-migration-component.js +3 -0
- package/dist/esm/editor-next/utils/deprecationWarnings.js +0 -5
- package/dist/esm/labs/next/full-page.js +2 -1
- package/dist/esm/labs/next/presets/default.js +2 -1
- package/dist/esm/labs/next/presets/universal.js +8 -2
- package/dist/esm/plugins/alignment/ui/ToolbarAlignment/index.js +3 -2
- package/dist/esm/plugins/alignment/ui/ToolbarAlignment/styles.js +3 -5
- package/dist/esm/plugins/analytics/plugin.js +6 -6
- package/dist/esm/plugins/avatar-group/index.js +5 -2
- package/dist/esm/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +4 -2
- package/dist/esm/plugins/base/index.js +4 -2
- package/dist/esm/plugins/base/pm-plugins/disable-spell-checking.js +1 -3
- package/dist/esm/plugins/block-type/ui/ToolbarBlockType/blocktype-button.js +1 -6
- package/dist/esm/plugins/block-type/ui/ToolbarBlockType/index.js +2 -8
- package/dist/esm/plugins/border/index.js +13 -0
- package/dist/esm/plugins/card/index.js +4 -2
- package/dist/esm/plugins/card/toolbar.js +12 -15
- package/dist/esm/plugins/card/ui/EditLinkToolbar.js +7 -3
- package/dist/esm/plugins/code-block/toolbar.js +2 -2
- package/dist/esm/plugins/collab-edit/analytics.js +2 -3
- package/dist/esm/plugins/collab-edit/events/handlers.js +2 -2
- package/dist/esm/plugins/collab-edit/events/initialize.js +3 -2
- package/dist/esm/plugins/collab-edit/index.js +5 -3
- package/dist/esm/plugins/collab-edit/plugin.js +4 -3
- package/dist/esm/plugins/collab-edit/ui/avatars-with-plugin-state.js +5 -3
- package/dist/esm/plugins/collab-edit/ui/avatars.js +2 -3
- package/dist/esm/plugins/date/index.js +90 -64
- package/dist/esm/plugins/editor-disabled/index.js +8 -0
- package/dist/esm/plugins/expand/index.js +4 -1
- package/dist/esm/plugins/expand/nodeviews/index.js +6 -7
- package/dist/esm/plugins/expand/pm-plugins/main.js +5 -2
- package/dist/esm/plugins/extension/extension-api.js +24 -12
- package/dist/esm/plugins/extension/pm-plugins/main.js +113 -173
- package/dist/esm/plugins/extension/pm-plugins/utils.js +72 -0
- package/dist/esm/plugins/feature-flags-context/get-enabled-feature-flag-keys.js +1 -10
- package/dist/esm/plugins/find-replace/FindReplaceToolbarButtonWithState.js +3 -4
- package/dist/esm/plugins/find-replace/index.js +5 -2
- package/dist/esm/plugins/floating-toolbar/index.js +15 -7
- package/dist/esm/plugins/floating-toolbar/ui/CheckboxModal.js +2 -1
- package/dist/esm/plugins/floating-toolbar/ui/EmojiPickerButton.js +13 -3
- package/dist/esm/plugins/floating-toolbar/ui/SimpleModal.js +2 -1
- package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +6 -5
- package/dist/esm/plugins/hyperlink/Toolbar.js +9 -13
- package/dist/esm/plugins/hyperlink/index.js +6 -2
- package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +3 -4
- package/dist/esm/plugins/index.js +2 -1
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +2 -1
- package/dist/esm/plugins/list/actions/outdent-list-items-selected.js +5 -5
- package/dist/esm/plugins/list/commands/index.js +31 -27
- package/dist/esm/plugins/list/commands/outdent-list.js +2 -3
- package/dist/esm/plugins/list/index.js +4 -3
- package/dist/esm/plugins/list/pm-plugins/input-rules/create-list-input-rule.js +3 -1
- package/dist/esm/plugins/list/pm-plugins/input-rules/index.js +2 -1
- package/dist/esm/plugins/list/pm-plugins/input-rules/wrapping-join-rule.js +51 -0
- package/dist/esm/plugins/list/pm-plugins/keymap.js +4 -4
- package/dist/esm/plugins/list/pm-plugins/main.js +23 -21
- package/dist/esm/plugins/media/nodeviews/mediaNodeView/media.js +6 -1
- package/dist/esm/plugins/media/nodeviews/styles.js +13 -1
- package/dist/esm/plugins/media/toolbar/commands.js +99 -0
- package/dist/esm/plugins/media/toolbar/imageBorder.js +14 -0
- package/dist/esm/plugins/media/toolbar/index.js +34 -5
- package/dist/esm/plugins/media/ui/ImageBorder/index.js +211 -0
- package/dist/esm/plugins/media/ui/ImageBorder/messages.js +43 -0
- package/dist/esm/plugins/media/ui/ImageBorder/styles.js +37 -0
- package/dist/esm/plugins/media/utils/current-media-node.js +24 -3
- package/dist/esm/plugins/paste/util/index.js +2 -0
- package/dist/esm/plugins/rank.js +1 -1
- package/dist/esm/plugins/rule/pm-plugins/input-rule.js +5 -0
- package/dist/esm/plugins/text-formatting/ui/Toolbar/hooks/clear-formatting-icon.js +2 -1
- package/dist/esm/plugins/toolbar-lists-indentation/index.js +3 -1
- package/dist/esm/plugins/toolbar-lists-indentation/ui/Toolbar.js +2 -1
- package/dist/esm/plugins/toolbar-lists-indentation/ui/ToolbarDropdown.js +2 -1
- package/dist/esm/plugins/toolbar-lists-indentation/ui/index.js +6 -3
- package/dist/esm/plugins/toolbar-lists-indentation/ui/onItemActivated.js +3 -2
- package/dist/esm/test-utils.js +3 -1
- package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +4 -2
- package/dist/esm/ui/styles.js +1 -1
- package/dist/esm/utils/input-rules.js +0 -17
- package/dist/esm/utils/insert.js +56 -10
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/create-editor/sort-by-order.d.ts +9 -0
- package/dist/types/editor-next/editor-migration-component.d.ts +1 -0
- package/dist/types/labs/next/presets/cxhtml.d.ts +36 -2
- package/dist/types/labs/next/presets/default.d.ts +72 -4
- package/dist/types/labs/next/presets/mobile.d.ts +36 -2
- package/dist/types/plugins/alignment/ui/ToolbarAlignment/styles.d.ts +0 -1
- package/dist/types/plugins/analytics/plugin.d.ts +2 -0
- package/dist/types/plugins/avatar-group/index.d.ts +2 -0
- package/dist/types/plugins/avatar-group/ui/AvatarGroupPluginWrapper.d.ts +2 -0
- package/dist/types/plugins/base/index.d.ts +2 -0
- package/dist/types/plugins/base/pm-plugins/disable-spell-checking.d.ts +2 -1
- package/dist/types/plugins/border/index.d.ts +3 -0
- package/dist/types/plugins/card/index.d.ts +2 -0
- package/dist/types/plugins/card/toolbar.d.ts +2 -1
- package/dist/types/plugins/card/ui/EditLinkToolbar.d.ts +5 -2
- package/dist/types/plugins/collab-edit/analytics.d.ts +2 -1
- package/dist/types/plugins/collab-edit/events/handlers.d.ts +2 -1
- package/dist/types/plugins/collab-edit/events/initialize.d.ts +3 -1
- package/dist/types/plugins/collab-edit/index.d.ts +2 -0
- package/dist/types/plugins/collab-edit/plugin.d.ts +2 -1
- package/dist/types/plugins/collab-edit/ui/avatars-with-plugin-state.d.ts +4 -0
- package/dist/types/plugins/collab-edit/ui/avatars.d.ts +2 -0
- package/dist/types/plugins/date/index.d.ts +9 -1
- package/dist/types/plugins/editor-disabled/index.d.ts +3 -1
- package/dist/types/plugins/expand/index.d.ts +2 -0
- package/dist/types/plugins/expand/nodeviews/index.d.ts +5 -2
- package/dist/types/plugins/expand/pm-plugins/main.d.ts +2 -1
- package/dist/types/plugins/extension/pm-plugins/main.d.ts +8 -2
- package/dist/types/plugins/extension/pm-plugins/utils.d.ts +3 -0
- package/dist/types/plugins/feature-flags-context/get-enabled-feature-flag-keys.d.ts +1 -7
- package/dist/types/plugins/find-replace/FindReplaceToolbarButtonWithState.d.ts +2 -0
- package/dist/types/plugins/find-replace/index.d.ts +2 -0
- package/dist/types/plugins/floating-toolbar/index.d.ts +4 -1
- package/dist/types/plugins/floating-toolbar/ui/Toolbar.d.ts +2 -0
- package/dist/types/plugins/hyperlink/Toolbar.d.ts +2 -1
- package/dist/types/plugins/hyperlink/index.d.ts +2 -0
- package/dist/types/plugins/hyperlink/ui/HyperlinkAddToolbar/index.d.ts +2 -0
- package/dist/types/plugins/index.d.ts +1 -0
- package/dist/types/plugins/list/actions/outdent-list-items-selected.d.ts +2 -1
- package/dist/types/plugins/list/commands/index.d.ts +3 -2
- package/dist/types/plugins/list/commands/outdent-list.d.ts +2 -1
- package/dist/types/plugins/list/index.d.ts +2 -0
- package/dist/types/plugins/list/pm-plugins/input-rules/create-list-input-rule.d.ts +1 -1
- package/dist/types/plugins/list/pm-plugins/input-rules/wrapping-join-rule.d.ts +13 -0
- package/dist/types/plugins/list/pm-plugins/keymap.d.ts +2 -1
- package/dist/types/plugins/list/pm-plugins/main.d.ts +3 -2
- package/dist/types/plugins/media/nodeviews/styles.d.ts +3 -1
- package/dist/types/plugins/media/toolbar/commands.d.ts +5 -0
- package/dist/types/plugins/media/toolbar/imageBorder.d.ts +2 -0
- package/dist/types/plugins/media/types.d.ts +3 -0
- package/dist/types/plugins/media/ui/ImageBorder/index.d.ts +13 -0
- package/dist/types/plugins/media/ui/ImageBorder/messages.d.ts +42 -0
- package/dist/types/plugins/media/ui/ImageBorder/styles.d.ts +15 -0
- package/dist/types/plugins/media/utils/current-media-node.d.ts +6 -0
- package/dist/types/plugins/text-color/pm-plugins/main.d.ts +0 -2
- package/dist/types/plugins/toolbar-lists-indentation/index.d.ts +2 -0
- package/dist/types/plugins/toolbar-lists-indentation/types.d.ts +2 -0
- package/dist/types/plugins/toolbar-lists-indentation/ui/index.d.ts +2 -0
- package/dist/types/plugins/toolbar-lists-indentation/ui/onItemActivated.d.ts +3 -1
- package/dist/types/test-utils.d.ts +4 -2
- package/dist/types/types/editor-props.d.ts +5 -0
- package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +5 -5
- package/dist/types/ui/ConfigPanel/ConfigPanel.d.ts +1 -1
- package/dist/types/ui/ContentStyles/index.d.ts +2 -2
- package/package.json +12 -11
- package/report.api.md +12 -4
- package/codemods/__tests__/rename-experimental-text-color-prop.ts +0 -204
- package/codemods/migrates/rename-experimental-text-color-prop.ts +0 -6
|
@@ -3,6 +3,9 @@ import { NodeSelection } from 'prosemirror-state';
|
|
|
3
3
|
import { isNodeSelection, removeSelectedNode, safeInsert } from 'prosemirror-utils';
|
|
4
4
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, addAnalytics, EVENT_TYPE } from '../../analytics';
|
|
5
5
|
import { removeMediaGroupNode } from './utils';
|
|
6
|
+
import { currentMediaNodeWithPos } from '../utils/current-media-node';
|
|
7
|
+
export var DEFAULT_BORDER_COLOR = '#091e4224';
|
|
8
|
+
export var DEFAULT_BORDER_SIZE = 2;
|
|
6
9
|
export var changeInlineToMediaCard = function changeInlineToMediaCard(state, dispatch) {
|
|
7
10
|
var _state$schema$nodes = state.schema.nodes,
|
|
8
11
|
media = _state$schema$nodes.media,
|
|
@@ -81,4 +84,100 @@ export var removeInlineCard = function removeInlineCard(state, dispatch) {
|
|
|
81
84
|
return true;
|
|
82
85
|
}
|
|
83
86
|
return false;
|
|
87
|
+
};
|
|
88
|
+
export var toggleBorderMark = function toggleBorderMark(state, dispatch) {
|
|
89
|
+
var nodeWithPos = currentMediaNodeWithPos(state);
|
|
90
|
+
if (!nodeWithPos) {
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
var node = nodeWithPos.node,
|
|
94
|
+
pos = nodeWithPos.pos;
|
|
95
|
+
var borderMark = node.marks.find(function (m) {
|
|
96
|
+
return m.type.name === 'border';
|
|
97
|
+
});
|
|
98
|
+
var marks = node.marks.filter(function (m) {
|
|
99
|
+
return m.type.name !== 'border';
|
|
100
|
+
}).concat(borderMark ? [] : state.schema.marks.border.create({
|
|
101
|
+
color: DEFAULT_BORDER_COLOR,
|
|
102
|
+
size: DEFAULT_BORDER_SIZE
|
|
103
|
+
}));
|
|
104
|
+
var tr = state.tr.setNodeMarkup(pos, node.type, node.attrs, marks);
|
|
105
|
+
tr.setMeta('scrollIntoView', false);
|
|
106
|
+
if (state.selection instanceof NodeSelection) {
|
|
107
|
+
if (state.selection.$anchor.pos === state.selection.from) {
|
|
108
|
+
tr.setSelection(NodeSelection.create(tr.doc, state.selection.from));
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
if (dispatch) {
|
|
112
|
+
if (borderMark !== null && borderMark !== void 0 && borderMark.attrs) {
|
|
113
|
+
addAnalytics(state, tr, {
|
|
114
|
+
action: ACTION.DELETED,
|
|
115
|
+
actionSubject: ACTION_SUBJECT.MEDIA,
|
|
116
|
+
actionSubjectId: ACTION_SUBJECT_ID.BORDER,
|
|
117
|
+
eventType: EVENT_TYPE.TRACK,
|
|
118
|
+
attributes: {
|
|
119
|
+
previousColor: borderMark.attrs.color,
|
|
120
|
+
previousSize: borderMark.attrs.size
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
} else {
|
|
124
|
+
addAnalytics(state, tr, {
|
|
125
|
+
action: ACTION.ADDED,
|
|
126
|
+
actionSubject: ACTION_SUBJECT.MEDIA,
|
|
127
|
+
actionSubjectId: ACTION_SUBJECT_ID.BORDER,
|
|
128
|
+
eventType: EVENT_TYPE.TRACK,
|
|
129
|
+
attributes: {
|
|
130
|
+
color: DEFAULT_BORDER_COLOR,
|
|
131
|
+
size: DEFAULT_BORDER_SIZE
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
dispatch(tr);
|
|
136
|
+
}
|
|
137
|
+
return true;
|
|
138
|
+
};
|
|
139
|
+
export var setBorderMark = function setBorderMark(attrs) {
|
|
140
|
+
return function (state, dispatch) {
|
|
141
|
+
var _node$marks$find, _ref, _attrs$color, _ref2, _attrs$size;
|
|
142
|
+
var nodeWithPos = currentMediaNodeWithPos(state);
|
|
143
|
+
if (!nodeWithPos) {
|
|
144
|
+
return false;
|
|
145
|
+
}
|
|
146
|
+
var node = nodeWithPos.node,
|
|
147
|
+
pos = nodeWithPos.pos;
|
|
148
|
+
var borderMark = (_node$marks$find = node.marks.find(function (m) {
|
|
149
|
+
return m.type.name === 'border';
|
|
150
|
+
})) === null || _node$marks$find === void 0 ? void 0 : _node$marks$find.attrs;
|
|
151
|
+
var color = (_ref = (_attrs$color = attrs.color) !== null && _attrs$color !== void 0 ? _attrs$color : borderMark === null || borderMark === void 0 ? void 0 : borderMark.color) !== null && _ref !== void 0 ? _ref : DEFAULT_BORDER_COLOR;
|
|
152
|
+
var size = (_ref2 = (_attrs$size = attrs.size) !== null && _attrs$size !== void 0 ? _attrs$size : borderMark === null || borderMark === void 0 ? void 0 : borderMark.size) !== null && _ref2 !== void 0 ? _ref2 : DEFAULT_BORDER_SIZE;
|
|
153
|
+
var marks = node.marks.filter(function (m) {
|
|
154
|
+
return m.type.name !== 'border';
|
|
155
|
+
}).concat(state.schema.marks.border.create({
|
|
156
|
+
color: color,
|
|
157
|
+
size: size
|
|
158
|
+
}));
|
|
159
|
+
var tr = state.tr.setNodeMarkup(pos, node.type, node.attrs, marks);
|
|
160
|
+
tr.setMeta('scrollIntoView', false);
|
|
161
|
+
if (state.selection instanceof NodeSelection) {
|
|
162
|
+
if (state.selection.$anchor.pos === state.selection.from) {
|
|
163
|
+
tr.setSelection(NodeSelection.create(tr.doc, state.selection.from));
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
if (dispatch) {
|
|
167
|
+
addAnalytics(state, tr, {
|
|
168
|
+
action: ACTION.UPDATED,
|
|
169
|
+
actionSubject: ACTION_SUBJECT.MEDIA,
|
|
170
|
+
actionSubjectId: ACTION_SUBJECT_ID.BORDER,
|
|
171
|
+
eventType: EVENT_TYPE.TRACK,
|
|
172
|
+
attributes: {
|
|
173
|
+
previousColor: borderMark === null || borderMark === void 0 ? void 0 : borderMark.color,
|
|
174
|
+
previousSize: borderMark === null || borderMark === void 0 ? void 0 : borderMark.size,
|
|
175
|
+
newColor: color,
|
|
176
|
+
newSize: size
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
dispatch(tr);
|
|
180
|
+
}
|
|
181
|
+
return true;
|
|
182
|
+
};
|
|
84
183
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { currentMediaNodeWithPos } from '../utils/current-media-node';
|
|
2
|
+
export function shouldShowImageBorder(editorState) {
|
|
3
|
+
var border = editorState.schema.marks.border;
|
|
4
|
+
if (!border) {
|
|
5
|
+
return false;
|
|
6
|
+
}
|
|
7
|
+
var nodeWithPos = currentMediaNodeWithPos(editorState);
|
|
8
|
+
if (!nodeWithPos) {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
var _editorState$doc$reso = editorState.doc.resolve(nodeWithPos.pos),
|
|
12
|
+
parent = _editorState$doc$reso.parent;
|
|
13
|
+
return parent && parent.type.allowsMarkType(border);
|
|
14
|
+
}
|
|
@@ -23,8 +23,11 @@ import { messages } from '@atlaskit/media-ui';
|
|
|
23
23
|
import { messages as cardMessages } from '../../card/messages';
|
|
24
24
|
import { FilePreviewItem } from './filePreviewItem';
|
|
25
25
|
import { downloadMedia, removeMediaGroupNode } from './utils';
|
|
26
|
-
import { changeInlineToMediaCard, changeMediaCardToInline, removeInlineCard } from './commands';
|
|
26
|
+
import { changeInlineToMediaCard, changeMediaCardToInline, removeInlineCard, setBorderMark, toggleBorderMark } from './commands';
|
|
27
27
|
import { MediaInlineNodeSelector, MediaSingleNodeSelector } from '../nodeviews/styles';
|
|
28
|
+
import ImageBorderItem from '../ui/ImageBorder';
|
|
29
|
+
import { currentMediaNodeBorderMark } from '../utils/current-media-node';
|
|
30
|
+
import { shouldShowImageBorder } from './imageBorder';
|
|
28
31
|
var remove = function remove(state, dispatch) {
|
|
29
32
|
if (dispatch) {
|
|
30
33
|
dispatch(removeSelectedNode(state.tr));
|
|
@@ -184,7 +187,7 @@ var generateMediaInlineFloatingToolbar = function generateMediaInlineFloatingToo
|
|
|
184
187
|
}];
|
|
185
188
|
return items;
|
|
186
189
|
};
|
|
187
|
-
var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToolbar(state, intl, options, pluginState, mediaLinkingState) {
|
|
190
|
+
var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToolbar(state, intl, options, pluginState, mediaLinkingState, getEditorFeatureFlags) {
|
|
188
191
|
var mediaSingle = state.schema.nodes.mediaSingle;
|
|
189
192
|
var allowResizing = options.allowResizing,
|
|
190
193
|
allowLinking = options.allowLinking,
|
|
@@ -192,8 +195,33 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
|
|
|
192
195
|
allowResizingInTables = options.allowResizingInTables,
|
|
193
196
|
allowAltTextOnImages = options.allowAltTextOnImages;
|
|
194
197
|
var toolbarButtons = [];
|
|
198
|
+
if (shouldShowImageBorder(state)) {
|
|
199
|
+
toolbarButtons.push({
|
|
200
|
+
type: 'custom',
|
|
201
|
+
fallback: [],
|
|
202
|
+
render: function render(editorView) {
|
|
203
|
+
if (!editorView) {
|
|
204
|
+
return null;
|
|
205
|
+
}
|
|
206
|
+
var dispatch = editorView.dispatch,
|
|
207
|
+
state = editorView.state;
|
|
208
|
+
var borderMark = currentMediaNodeBorderMark(state);
|
|
209
|
+
return /*#__PURE__*/React.createElement(ImageBorderItem, {
|
|
210
|
+
toggleBorder: function toggleBorder() {
|
|
211
|
+
toggleBorderMark(state, dispatch);
|
|
212
|
+
},
|
|
213
|
+
setBorder: function setBorder(attrs) {
|
|
214
|
+
setBorderMark(attrs)(state, dispatch);
|
|
215
|
+
},
|
|
216
|
+
showSomewhatSemanticTooltips: getEditorFeatureFlags === null || getEditorFeatureFlags === void 0 ? void 0 : getEditorFeatureFlags().useSomewhatSemanticTextColorNames,
|
|
217
|
+
borderMark: borderMark,
|
|
218
|
+
intl: intl
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
}
|
|
195
223
|
if (allowAdvancedToolBarOptions) {
|
|
196
|
-
toolbarButtons = buildLayoutButtons(state, intl, state.schema.nodes.mediaSingle, allowResizing, allowResizingInTables);
|
|
224
|
+
toolbarButtons = [].concat(_toConsumableArray(toolbarButtons), _toConsumableArray(buildLayoutButtons(state, intl, state.schema.nodes.mediaSingle, allowResizing, allowResizingInTables)));
|
|
197
225
|
if (toolbarButtons.length) {
|
|
198
226
|
toolbarButtons.push({
|
|
199
227
|
type: 'separator'
|
|
@@ -282,7 +310,8 @@ export var floatingToolbar = function floatingToolbar(state, intl) {
|
|
|
282
310
|
allowLinking = options.allowLinking,
|
|
283
311
|
allowAltTextOnImages = options.allowAltTextOnImages,
|
|
284
312
|
providerFactory = options.providerFactory,
|
|
285
|
-
allowMediaInline = options.allowMediaInline
|
|
313
|
+
allowMediaInline = options.allowMediaInline,
|
|
314
|
+
getEditorFeatureFlags = options.getEditorFeatureFlags;
|
|
286
315
|
var mediaPluginState = stateKey.getState(state);
|
|
287
316
|
var mediaLinkingState = getMediaLinkingState(state);
|
|
288
317
|
if (!mediaPluginState) {
|
|
@@ -337,7 +366,7 @@ export var floatingToolbar = function floatingToolbar(state, intl) {
|
|
|
337
366
|
var element = (_mediaPluginState$ele3 = mediaPluginState.element) === null || _mediaPluginState$ele3 === void 0 ? void 0 : _mediaPluginState$ele3.querySelector(".".concat(MediaSingleNodeSelector));
|
|
338
367
|
return element || mediaPluginState.element;
|
|
339
368
|
};
|
|
340
|
-
items = generateMediaSingleFloatingToolbar(state, intl, options, mediaPluginState, mediaLinkingState);
|
|
369
|
+
items = generateMediaSingleFloatingToolbar(state, intl, options, mediaPluginState, mediaLinkingState, getEditorFeatureFlags);
|
|
341
370
|
}
|
|
342
371
|
return _objectSpread(_objectSpread({}, baseToolbar), {}, {
|
|
343
372
|
items: items,
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
/** @jsx jsx */
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
4
|
+
import ExpandIcon from '@atlaskit/icon/glyph/chevron-down';
|
|
5
|
+
import { DropdownMenuSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
6
|
+
import ImageBorderIcon from '@atlaskit/icon/glyph/image-border';
|
|
7
|
+
import { useRef, useState } from 'react';
|
|
8
|
+
import { ColorPalette, borderPaletteTooltipMessages } from '@atlaskit/editor-common/ui-color';
|
|
9
|
+
import { hexToEditorBorderPaletteColor } from '@atlaskit/editor-palette';
|
|
10
|
+
import { borderColorPalette } from '@atlaskit/editor-common/ui-color';
|
|
11
|
+
import { ArrowKeyNavigationType, DropdownMenu } from '@atlaskit/editor-common/ui-menu';
|
|
12
|
+
import Tooltip from '@atlaskit/tooltip';
|
|
13
|
+
import { Popup } from '@atlaskit/editor-common/ui';
|
|
14
|
+
import ToolbarButton from '../../../../ui/ToolbarButton';
|
|
15
|
+
import { buttonStyle, buttonWrapperStyle, contextualMenuArrow, contextualMenuColorIcon, contextualSubMenu, itemSpacing, line, menuItemDimensions, toolbarButtonWrapper } from './styles';
|
|
16
|
+
import { messages } from './messages';
|
|
17
|
+
var ImageBorder = function ImageBorder(_ref) {
|
|
18
|
+
var formatMessage = _ref.intl.formatMessage,
|
|
19
|
+
toggleBorder = _ref.toggleBorder,
|
|
20
|
+
showSomewhatSemanticTooltips = _ref.showSomewhatSemanticTooltips,
|
|
21
|
+
borderMark = _ref.borderMark,
|
|
22
|
+
setBorder = _ref.setBorder;
|
|
23
|
+
var popupTarget = useRef(null);
|
|
24
|
+
var enabled = !!borderMark;
|
|
25
|
+
var color = borderMark === null || borderMark === void 0 ? void 0 : borderMark.color;
|
|
26
|
+
var size = borderMark === null || borderMark === void 0 ? void 0 : borderMark.size;
|
|
27
|
+
var _useState = useState(false),
|
|
28
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
29
|
+
isOpen = _useState2[0],
|
|
30
|
+
setIsOpen = _useState2[1];
|
|
31
|
+
var _useState3 = useState(false),
|
|
32
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
33
|
+
isColorSubmenuOpen = _useState4[0],
|
|
34
|
+
setIsColorSubmenuOpen = _useState4[1];
|
|
35
|
+
var _useState5 = useState(false),
|
|
36
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
37
|
+
isSizeSubmenuOpen = _useState6[0],
|
|
38
|
+
setIsSizeSubmenuOpen = _useState6[1];
|
|
39
|
+
var borderSizeOptions = [{
|
|
40
|
+
name: formatMessage(messages.borderSizeSubtle),
|
|
41
|
+
value: 1
|
|
42
|
+
}, {
|
|
43
|
+
name: formatMessage(messages.borderSizeMedium),
|
|
44
|
+
value: 2
|
|
45
|
+
}, {
|
|
46
|
+
name: formatMessage(messages.borderSizeBold),
|
|
47
|
+
value: 3
|
|
48
|
+
}];
|
|
49
|
+
var items = [{
|
|
50
|
+
content: formatMessage(messages.borderColor),
|
|
51
|
+
value: {
|
|
52
|
+
name: 'color'
|
|
53
|
+
},
|
|
54
|
+
elemAfter: jsx("div", {
|
|
55
|
+
className: DropdownMenuSharedCssClassName.SUBMENU
|
|
56
|
+
}, jsx("div", {
|
|
57
|
+
css: contextualMenuColorIcon(color && hexToEditorBorderPaletteColor(color))
|
|
58
|
+
}), isColorSubmenuOpen && jsx("div", {
|
|
59
|
+
css: contextualSubMenu(0)
|
|
60
|
+
}, jsx(ColorPalette, {
|
|
61
|
+
onClick: function onClick(color) {
|
|
62
|
+
setBorder({
|
|
63
|
+
color: color
|
|
64
|
+
});
|
|
65
|
+
setIsOpen(!isOpen);
|
|
66
|
+
},
|
|
67
|
+
selectedColor: color !== null && color !== void 0 ? color : null,
|
|
68
|
+
paletteOptions: {
|
|
69
|
+
palette: borderColorPalette,
|
|
70
|
+
paletteColorTooltipMessages: borderPaletteTooltipMessages,
|
|
71
|
+
hexToPaletteColor: hexToEditorBorderPaletteColor,
|
|
72
|
+
showSomewhatSemanticTooltips: showSomewhatSemanticTooltips
|
|
73
|
+
}
|
|
74
|
+
})))
|
|
75
|
+
}, {
|
|
76
|
+
content: formatMessage(messages.borderSize),
|
|
77
|
+
value: {
|
|
78
|
+
name: 'size'
|
|
79
|
+
},
|
|
80
|
+
elemAfter: jsx("div", {
|
|
81
|
+
className: DropdownMenuSharedCssClassName.SUBMENU
|
|
82
|
+
}, jsx("div", {
|
|
83
|
+
css: contextualMenuArrow
|
|
84
|
+
}), isSizeSubmenuOpen && jsx("div", {
|
|
85
|
+
css: contextualSubMenu(1)
|
|
86
|
+
}, borderSizeOptions.map(function (_ref2, idx) {
|
|
87
|
+
var name = _ref2.name,
|
|
88
|
+
value = _ref2.value;
|
|
89
|
+
return jsx(Tooltip, {
|
|
90
|
+
key: idx,
|
|
91
|
+
content: name
|
|
92
|
+
}, jsx("span", {
|
|
93
|
+
css: buttonWrapperStyle
|
|
94
|
+
}, jsx("button", {
|
|
95
|
+
css: buttonStyle(value === size),
|
|
96
|
+
"aria-label": name,
|
|
97
|
+
role: "radio",
|
|
98
|
+
"aria-checked": value === size,
|
|
99
|
+
onClick: function onClick() {
|
|
100
|
+
setBorder({
|
|
101
|
+
size: value
|
|
102
|
+
});
|
|
103
|
+
setIsOpen(false);
|
|
104
|
+
},
|
|
105
|
+
onMouseDown: function onMouseDown(e) {
|
|
106
|
+
e.preventDefault();
|
|
107
|
+
}
|
|
108
|
+
}, jsx("div", {
|
|
109
|
+
css: line(value, value === size),
|
|
110
|
+
role: "presentation"
|
|
111
|
+
}))));
|
|
112
|
+
})))
|
|
113
|
+
}];
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* We want to change direction of our dropdowns a bit early,
|
|
117
|
+
* not exactly when it hits the boundary.
|
|
118
|
+
*/
|
|
119
|
+
var fitTolerance = 10;
|
|
120
|
+
var fitWidth = menuItemDimensions.width;
|
|
121
|
+
var fitHeight = items.length * (menuItemDimensions.height + itemSpacing);
|
|
122
|
+
return jsx("div", null, jsx("div", {
|
|
123
|
+
css: toolbarButtonWrapper({
|
|
124
|
+
enabled: enabled,
|
|
125
|
+
isOpen: isOpen
|
|
126
|
+
})
|
|
127
|
+
}, jsx(ToolbarButton, {
|
|
128
|
+
className: "image-border-toolbar-btn",
|
|
129
|
+
selected: enabled,
|
|
130
|
+
onClick: toggleBorder,
|
|
131
|
+
spacing: "compact",
|
|
132
|
+
"aria-label": enabled ? formatMessage(messages.removeBorder) : formatMessage(messages.addBorder),
|
|
133
|
+
iconBefore: jsx(ImageBorderIcon, {
|
|
134
|
+
label: ""
|
|
135
|
+
}),
|
|
136
|
+
title: enabled ? formatMessage(messages.removeBorder) : formatMessage(messages.addBorder)
|
|
137
|
+
}), jsx("div", {
|
|
138
|
+
ref: popupTarget
|
|
139
|
+
}, jsx(ToolbarButton, {
|
|
140
|
+
className: "image-border-toolbar-dropdown",
|
|
141
|
+
selected: isOpen,
|
|
142
|
+
"aria-label": formatMessage(messages.borderOptions),
|
|
143
|
+
title: formatMessage(messages.borderOptions),
|
|
144
|
+
spacing: "compact",
|
|
145
|
+
iconBefore: jsx(ExpandIcon, {
|
|
146
|
+
label: ""
|
|
147
|
+
}),
|
|
148
|
+
onClick: function onClick() {
|
|
149
|
+
setIsOpen(!isOpen);
|
|
150
|
+
}
|
|
151
|
+
}))), jsx(Popup, {
|
|
152
|
+
target: popupTarget.current ? popupTarget.current : undefined,
|
|
153
|
+
fitWidth: fitWidth + fitTolerance,
|
|
154
|
+
fitHeight: fitHeight + fitTolerance,
|
|
155
|
+
forcePlacement: true,
|
|
156
|
+
stick: true
|
|
157
|
+
}, jsx("div", {
|
|
158
|
+
onMouseLeave: function onMouseLeave() {
|
|
159
|
+
setIsColorSubmenuOpen(false);
|
|
160
|
+
setIsSizeSubmenuOpen(false);
|
|
161
|
+
}
|
|
162
|
+
}, jsx(DropdownMenu
|
|
163
|
+
//This needs be removed when the a11y is completely handled
|
|
164
|
+
//Disabling key navigation now as it works only partially
|
|
165
|
+
//Same with packages/editor/editor-plugin-table/src/plugins/table/ui/FloatingContextualMenu/ContextualMenu.tsx
|
|
166
|
+
, {
|
|
167
|
+
arrowKeyNavigationProviderOptions: {
|
|
168
|
+
type: ArrowKeyNavigationType.MENU,
|
|
169
|
+
disableArrowKeyNavigation: true
|
|
170
|
+
},
|
|
171
|
+
items: [{
|
|
172
|
+
items: items
|
|
173
|
+
}],
|
|
174
|
+
isOpen: isOpen,
|
|
175
|
+
onOpenChange: function onOpenChange() {
|
|
176
|
+
setIsOpen(false);
|
|
177
|
+
setIsColorSubmenuOpen(false);
|
|
178
|
+
setIsSizeSubmenuOpen(false);
|
|
179
|
+
},
|
|
180
|
+
onItemActivated: function onItemActivated(_ref3) {
|
|
181
|
+
var item = _ref3.item;
|
|
182
|
+
if (item.value.name === 'color') {
|
|
183
|
+
setIsColorSubmenuOpen(!isColorSubmenuOpen);
|
|
184
|
+
}
|
|
185
|
+
if (item.value.name === 'size') {
|
|
186
|
+
setIsSizeSubmenuOpen(!isSizeSubmenuOpen);
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
onMouseEnter: function onMouseEnter(_ref4) {
|
|
190
|
+
var item = _ref4.item;
|
|
191
|
+
if (item.value.name === 'color') {
|
|
192
|
+
setIsColorSubmenuOpen(true);
|
|
193
|
+
}
|
|
194
|
+
if (item.value.name === 'size') {
|
|
195
|
+
setIsSizeSubmenuOpen(true);
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
onMouseLeave: function onMouseLeave(_ref5) {
|
|
199
|
+
var item = _ref5.item;
|
|
200
|
+
if (item.value.name === 'color') {
|
|
201
|
+
setIsColorSubmenuOpen(false);
|
|
202
|
+
}
|
|
203
|
+
if (item.value.name === 'size') {
|
|
204
|
+
setIsSizeSubmenuOpen(false);
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
fitWidth: fitWidth + fitTolerance,
|
|
208
|
+
fitHeight: fitHeight + fitTolerance
|
|
209
|
+
}))));
|
|
210
|
+
};
|
|
211
|
+
export default ImageBorder;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { defineMessages } from 'react-intl-next';
|
|
2
|
+
export var messages = defineMessages({
|
|
3
|
+
borderColor: {
|
|
4
|
+
id: 'fabric.editor.imageBorderColor',
|
|
5
|
+
defaultMessage: 'Color',
|
|
6
|
+
description: 'Change the border color of an image.'
|
|
7
|
+
},
|
|
8
|
+
borderSize: {
|
|
9
|
+
id: 'fabric.editor.imageBorderSize',
|
|
10
|
+
defaultMessage: 'Size',
|
|
11
|
+
description: 'Change the border size of an image.'
|
|
12
|
+
},
|
|
13
|
+
addBorder: {
|
|
14
|
+
id: 'fabric.editor.addImageBorder',
|
|
15
|
+
defaultMessage: 'Add border',
|
|
16
|
+
description: 'Add a border to an image.'
|
|
17
|
+
},
|
|
18
|
+
removeBorder: {
|
|
19
|
+
id: 'fabric.editor.removeImageBorder',
|
|
20
|
+
defaultMessage: 'Remove border',
|
|
21
|
+
description: 'Remove the border of an image.'
|
|
22
|
+
},
|
|
23
|
+
borderOptions: {
|
|
24
|
+
id: 'fabric.editor.imageBorderOptions',
|
|
25
|
+
defaultMessage: 'Border options',
|
|
26
|
+
description: 'Display options available for customizing the border of an image.'
|
|
27
|
+
},
|
|
28
|
+
borderSizeSubtle: {
|
|
29
|
+
id: 'fabric.editor.imageBorderSubtle',
|
|
30
|
+
defaultMessage: 'Subtle',
|
|
31
|
+
description: 'Name of a border size.'
|
|
32
|
+
},
|
|
33
|
+
borderSizeMedium: {
|
|
34
|
+
id: 'fabric.editor.imageBorderMedium',
|
|
35
|
+
defaultMessage: 'Medium',
|
|
36
|
+
description: 'Name of a border size.'
|
|
37
|
+
},
|
|
38
|
+
borderSizeBold: {
|
|
39
|
+
id: 'fabric.editor.imageBorderBold',
|
|
40
|
+
defaultMessage: 'Bold',
|
|
41
|
+
description: 'Name of a border size.'
|
|
42
|
+
}
|
|
43
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
|
3
|
+
import { css } from '@emotion/react';
|
|
4
|
+
import * as colors from '@atlaskit/theme/colors';
|
|
5
|
+
import { DEFAULT_BORDER_COLOR } from '@atlaskit/editor-common/ui-color';
|
|
6
|
+
import { N20A, N50, N60A, N90, N800, N0 } from '@atlaskit/theme/colors';
|
|
7
|
+
import { gridSize } from '@atlaskit/theme/constants';
|
|
8
|
+
|
|
9
|
+
// menuItemDimensions and itemSpacing are copied from
|
|
10
|
+
// packages/editor/editor-core/src/plugins/floating-toolbar/ui/DropdownMenu.tsx
|
|
11
|
+
|
|
12
|
+
export var menuItemDimensions = {
|
|
13
|
+
width: 175,
|
|
14
|
+
height: 32
|
|
15
|
+
};
|
|
16
|
+
export var itemSpacing = gridSize() / 2;
|
|
17
|
+
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
|
+
export var contextualMenuColorIcon = function contextualMenuColorIcon(color) {
|
|
19
|
+
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", "\n &::before {\n content: '';\n display: block;\n border: 1px solid ", ";\n border-radius: ", ";\n width: 20px;\n height: 20px;\n ", "\n }\n"])), contextualMenuArrow, DEFAULT_BORDER_COLOR, "var(--ds-radius-100, 3px)", color && "background: ".concat(color));
|
|
20
|
+
};
|
|
21
|
+
export var contextualSubMenu = function contextualSubMenu(index) {
|
|
22
|
+
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n border-radius: ", ";\n background: ", ";\n box-shadow: ", ";\n display: flex;\n position: absolute;\n top: ", "px;\n left: ", "px;\n padding: 8px;\n\n > div {\n padding: 0;\n }\n"])), "var(--ds-radius-100, 3px)", "var(--ds-surface-overlay, white)", "var(--ds-shadow-overlay, ".concat("0 4px 8px -2px ".concat(N60A, ", 0 0 1px ").concat(N60A), ")"), index * (menuItemDimensions.height + itemSpacing * 2), menuItemDimensions.width);
|
|
23
|
+
};
|
|
24
|
+
export var buttonStyle = function buttonStyle(selected) {
|
|
25
|
+
return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n height: 26px;\n width: 26px;\n padding: 0;\n border-radius: 4px;\n background-color: ", ";\n border: 1px solid ", ";\n cursor: pointer;\n display: block;\n"])), selected ? "var(--ds-text, ".concat(N800, ")") : "var(--ds-background-neutral, ".concat(N20A, ")"), DEFAULT_BORDER_COLOR);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
29
|
+
export var buttonWrapperStyle = css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n border: 1px solid transparent;\n margin: 1px;\n font-size: 0;\n display: flex;\n align-items: center;\n padding: 1px;\n border-radius: 6px;\n &:focus-within,\n &:focus,\n &:hover {\n border-color: ", " !important;\n }\n"])), N50);
|
|
30
|
+
export var line = function line(size, selected) {
|
|
31
|
+
return css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n position: relative;\n &:before {\n content: '';\n display: block;\n position: absolute;\n top: 50%;\n left: 50%;\n width: 12px;\n height: ", "px;\n background-color: ", ";\n border-radius: 90px;\n transform: translate(-50%, -50%) rotate(135deg);\n }\n"])), size, selected ? "var(--ds-icon-inverse, ".concat(N0, ")") : "var(--ds-icon, #44546F)");
|
|
32
|
+
};
|
|
33
|
+
export var toolbarButtonWrapper = function toolbarButtonWrapper(_ref) {
|
|
34
|
+
var enabled = _ref.enabled,
|
|
35
|
+
isOpen = _ref.isOpen;
|
|
36
|
+
return css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n display: flex;\n .image-border-toolbar-btn {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n padding: 0;\n & > span {\n margin: 0;\n }\n }\n .image-border-toolbar-dropdown {\n padding: 0;\n & > span {\n margin: 0;\n }\n width: 16px !important;\n border-top-left-radius: 0 !important;\n border-bottom-left-radius: 0 !important;\n margin-left: 1px;\n }\n\n &:hover {\n .image-border-toolbar-btn {\n ", "\n }\n\n .image-border-toolbar-dropdown {\n ", "\n }\n }\n"])), !enabled && " background: ".concat("var(--ds-background-neutral-subtle-hovered, ".concat(colors.N30A, ")"), ";"), !isOpen && "background: ".concat("var(--ds-background-neutral-subtle-hovered, ".concat(colors.N30A, ")"), ";"));
|
|
37
|
+
};
|
|
@@ -1,14 +1,35 @@
|
|
|
1
1
|
import { NodeSelection } from 'prosemirror-state';
|
|
2
|
-
export var
|
|
2
|
+
export var currentMediaNodeWithPos = function currentMediaNodeWithPos(editorState) {
|
|
3
3
|
var doc = editorState.doc,
|
|
4
4
|
selection = editorState.selection,
|
|
5
5
|
schema = editorState.schema;
|
|
6
6
|
if (!doc || !selection || !(selection instanceof NodeSelection) || selection.node.type !== schema.nodes.mediaSingle) {
|
|
7
7
|
return;
|
|
8
8
|
}
|
|
9
|
-
var
|
|
9
|
+
var pos = selection.$anchor.pos + 1;
|
|
10
|
+
var node = doc.nodeAt(pos);
|
|
10
11
|
if (!node || node.type !== schema.nodes.media) {
|
|
11
12
|
return;
|
|
12
13
|
}
|
|
13
|
-
return
|
|
14
|
+
return {
|
|
15
|
+
node: node,
|
|
16
|
+
pos: pos
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export var currentMediaNode = function currentMediaNode(editorState) {
|
|
20
|
+
var _currentMediaNodeWith;
|
|
21
|
+
return (_currentMediaNodeWith = currentMediaNodeWithPos(editorState)) === null || _currentMediaNodeWith === void 0 ? void 0 : _currentMediaNodeWith.node;
|
|
22
|
+
};
|
|
23
|
+
export var currentMediaNodeBorderMark = function currentMediaNodeBorderMark(editorState) {
|
|
24
|
+
var node = currentMediaNode(editorState);
|
|
25
|
+
if (!node) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
var borderMark = node.marks.find(function (m) {
|
|
29
|
+
return m.type.name === 'border';
|
|
30
|
+
});
|
|
31
|
+
if (!borderMark) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
return borderMark.attrs;
|
|
14
35
|
};
|
|
@@ -5,6 +5,7 @@ import { ACTION_SUBJECT, addAnalytics, EVENT_TYPE, INPUT_METHOD, TABLE_ACTION }
|
|
|
5
5
|
import { TextSelection, NodeSelection } from 'prosemirror-state';
|
|
6
6
|
import { findParentNodeOfType } from 'prosemirror-utils';
|
|
7
7
|
import { getSelectedTableInfo, isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
8
|
+
import { sortByOrderWithTypeName } from '../../../create-editor/sort-by-order';
|
|
8
9
|
export function isPastedFromWord(html) {
|
|
9
10
|
return !!html && html.indexOf('urn:schemas-microsoft-com:office:word') >= 0;
|
|
10
11
|
}
|
|
@@ -92,6 +93,7 @@ export function applyTextMarksToSlice(schema, marks) {
|
|
|
92
93
|
}) || []), _toConsumableArray(parent.type.allowedMarks(marks).filter(function (mark) {
|
|
93
94
|
return mark.type !== linkMark;
|
|
94
95
|
})));
|
|
96
|
+
node.marks.sort(sortByOrderWithTypeName('marks'));
|
|
95
97
|
return false;
|
|
96
98
|
}
|
|
97
99
|
return true;
|
package/dist/esm/plugins/rank.js
CHANGED
|
@@ -21,7 +21,7 @@ export default {
|
|
|
21
21
|
// Inline marks
|
|
22
22
|
'link', 'em', 'strong', 'textColor', 'strike', 'subsup', 'underline', 'code', 'typeAheadQuery',
|
|
23
23
|
// Block marks
|
|
24
|
-
'alignment', 'breakout', 'indentation', 'annotation', 'dataConsumer',
|
|
24
|
+
'alignment', 'breakout', 'indentation', 'annotation', 'dataConsumer', 'border',
|
|
25
25
|
// Unsupported mark
|
|
26
26
|
'unsupportedMark', 'unsupportedNodeAttribute']
|
|
27
27
|
};
|
|
@@ -2,6 +2,7 @@ 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
4
|
import { safeInsert } from '../../../utils/insert';
|
|
5
|
+
import { hasParentNodeOfType } from 'prosemirror-utils';
|
|
5
6
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, addAnalytics, EVENT_TYPE, INPUT_METHOD } from '../../analytics';
|
|
6
7
|
import { getFeatureFlags } from '../../feature-flags-context';
|
|
7
8
|
export var createHorizontalRule = function createHorizontalRule(state, start, end, inputMethod) {
|
|
@@ -35,6 +36,10 @@ export var createHorizontalRule = function createHorizontalRule(state, start, en
|
|
|
35
36
|
});
|
|
36
37
|
};
|
|
37
38
|
var createHorizontalRuleAutoformat = function createHorizontalRuleAutoformat(state, start, end) {
|
|
39
|
+
var listItem = state.schema.nodes.listItem;
|
|
40
|
+
if (hasParentNodeOfType(listItem)(state.selection)) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
38
43
|
return createHorizontalRule(state, start, end, INPUT_METHOD.FORMATTING);
|
|
39
44
|
};
|
|
40
45
|
export function inputRulePlugin(schema, featureFlags) {
|
|
@@ -35,7 +35,8 @@ export var useClearIcon = function useClearIcon(_ref) {
|
|
|
35
35
|
name: 'clearFormatting'
|
|
36
36
|
},
|
|
37
37
|
isActive: false,
|
|
38
|
-
isDisabled: !formattingIsPresent
|
|
38
|
+
isDisabled: !formattingIsPresent,
|
|
39
|
+
'aria-label': clearFormattingKeymap ? tooltip(clearFormattingKeymap, String(clearFormattingLabel)) : String(clearFormattingLabel)
|
|
39
40
|
};
|
|
40
41
|
}, [clearFormattingLabel, isPluginAvailable, formattingIsPresent]);
|
|
41
42
|
};
|
|
@@ -4,9 +4,10 @@ import WithPluginState from '../../ui/WithPluginState';
|
|
|
4
4
|
import { ToolbarSize } from '../../ui/Toolbar/types';
|
|
5
5
|
import { pluginKey as listPluginKey } from '../list/pm-plugins/main';
|
|
6
6
|
import { pluginKey as indentationButtonsPluginKey, createPlugin as indentationButtonsPlugin } from './pm-plugins/indentation-buttons';
|
|
7
|
-
var toolbarListsIndentationPlugin = function toolbarListsIndentationPlugin(_ref) {
|
|
7
|
+
var toolbarListsIndentationPlugin = function toolbarListsIndentationPlugin(_ref, api) {
|
|
8
8
|
var showIndentationButtons = _ref.showIndentationButtons,
|
|
9
9
|
allowHeadingAndParagraphIndentation = _ref.allowHeadingAndParagraphIndentation;
|
|
10
|
+
var featureFlags = (api === null || api === void 0 ? void 0 : api.dependencies.featureFlags.sharedState.currentState()) || {};
|
|
10
11
|
return {
|
|
11
12
|
name: 'toolbarListsIndentation',
|
|
12
13
|
pmPlugins: function pmPlugins() {
|
|
@@ -43,6 +44,7 @@ var toolbarListsIndentationPlugin = function toolbarListsIndentationPlugin(_ref)
|
|
|
43
44
|
return null;
|
|
44
45
|
}
|
|
45
46
|
return /*#__PURE__*/React.createElement(ToolbarListsIndentation, {
|
|
47
|
+
featureFlags: featureFlags,
|
|
46
48
|
isSmall: isSmall,
|
|
47
49
|
isReducedSpacing: isToolbarReducedSpacing,
|
|
48
50
|
disabled: disabled,
|
|
@@ -54,7 +54,8 @@ export function ToolbarDropdown(props) {
|
|
|
54
54
|
setIsDropdownOpen(!shouldCloseMenu);
|
|
55
55
|
return onItemActivated({
|
|
56
56
|
editorView: props.editorView,
|
|
57
|
-
buttonName: item.value.name
|
|
57
|
+
buttonName: item.value.name,
|
|
58
|
+
featureFlags: props.featureFlags
|
|
58
59
|
});
|
|
59
60
|
};
|
|
60
61
|
return jsx("span", {
|
|
@@ -16,7 +16,8 @@ export default function ToolbarListsIndentation(props) {
|
|
|
16
16
|
popupsBoundariesElement = props.popupsBoundariesElement,
|
|
17
17
|
popupsScrollableElement = props.popupsScrollableElement,
|
|
18
18
|
indentDisabled = props.indentDisabled,
|
|
19
|
-
outdentDisabled = props.outdentDisabled
|
|
19
|
+
outdentDisabled = props.outdentDisabled,
|
|
20
|
+
featureFlags = props.featureFlags;
|
|
20
21
|
if (isSmall) {
|
|
21
22
|
return jsx(ToolbarDropdown, {
|
|
22
23
|
editorView: props.editorView,
|
|
@@ -32,7 +33,8 @@ export default function ToolbarListsIndentation(props) {
|
|
|
32
33
|
indentDisabled: indentDisabled,
|
|
33
34
|
outdentDisabled: outdentDisabled,
|
|
34
35
|
disabled: disabled,
|
|
35
|
-
onItemActivated: onItemActivated
|
|
36
|
+
onItemActivated: onItemActivated,
|
|
37
|
+
featureFlags: featureFlags
|
|
36
38
|
});
|
|
37
39
|
}
|
|
38
40
|
return jsx(Toolbar, {
|
|
@@ -46,6 +48,7 @@ export default function ToolbarListsIndentation(props) {
|
|
|
46
48
|
indentDisabled: indentDisabled,
|
|
47
49
|
outdentDisabled: outdentDisabled,
|
|
48
50
|
disabled: disabled,
|
|
49
|
-
onItemActivated: onItemActivated
|
|
51
|
+
onItemActivated: onItemActivated,
|
|
52
|
+
featureFlags: featureFlags
|
|
50
53
|
});
|
|
51
54
|
}
|