@atlaskit/editor-core 160.0.0 → 162.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +56 -0
- package/dist/cjs/actions/index.js +76 -48
- package/dist/cjs/extensibility.js +2 -2
- package/dist/cjs/labs/next/full-page.js +2 -2
- package/dist/cjs/plugins/block-type/styles.js +5 -2
- package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/index.js +13 -11
- package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/styled.js +11 -7
- package/dist/cjs/plugins/card/messages.js +4 -4
- package/dist/cjs/plugins/card/ui/LinkToolbarAppearance.js +29 -11
- package/dist/cjs/plugins/card/ui/LinkToolbarButtonGroup.js +66 -7
- package/dist/cjs/plugins/card/ui/LinkToolbarIconDropdown.js +166 -7
- package/dist/cjs/plugins/card/ui/ResizableEmbedCard.js +9 -6
- package/dist/cjs/plugins/card/ui/assets/card.js +1 -1
- package/dist/cjs/plugins/card/ui/assets/embed.js +1 -1
- package/dist/cjs/plugins/card/ui/assets/inline.js +1 -1
- package/dist/cjs/plugins/card/ui/assets/url.js +1 -1
- package/dist/cjs/plugins/card/ui/link-toolbar-button-group-options.js +60 -0
- package/dist/cjs/plugins/card/ui/link-toolbar-icon-dropdown-options.js +66 -0
- package/dist/cjs/plugins/card/ui/styled.js +5 -13
- package/dist/cjs/plugins/card/ui/types.js +5 -0
- package/dist/cjs/plugins/clipboard/pm-plugins/main.js +99 -3
- package/dist/cjs/plugins/code-block/styles.js +45 -38
- package/dist/cjs/plugins/extension/plugin-factory.js +4 -1
- package/dist/cjs/plugins/extension/pm-plugins/main.js +34 -11
- package/dist/cjs/plugins/extension/utils.js +57 -12
- package/dist/cjs/plugins/find-replace/ui/Find.js +12 -12
- package/dist/cjs/plugins/find-replace/ui/FindReplace.js +5 -5
- package/dist/cjs/plugins/find-replace/ui/Replace.js +5 -5
- package/dist/cjs/plugins/find-replace/ui/styles.js +12 -15
- package/dist/cjs/plugins/layout/styles.js +2 -2
- package/dist/cjs/plugins/list/actions/wrap-and-join-lists.js +180 -0
- package/dist/cjs/plugins/list/commands/index.js +35 -38
- package/dist/cjs/plugins/list/utils/replace-content.js +31 -0
- package/dist/cjs/plugins/media/nodeviews/mediaNodeUpdater.js +3 -3
- package/dist/cjs/plugins/media/styles.js +2 -2
- package/dist/cjs/plugins/media/utils/media-single.js +15 -2
- package/dist/cjs/plugins/paste/handlers.js +19 -5
- package/dist/cjs/plugins/paste/pm-plugins/analytics.js +1 -1
- package/dist/cjs/plugins/placeholder-text/index.js +45 -1
- package/dist/cjs/plugins/placeholder-text/placeholder-text-nodeview.js +66 -22
- package/dist/cjs/plugins/placeholder-text/selection-utils.js +19 -0
- package/dist/cjs/plugins/placeholder-text/styles.js +3 -1
- package/dist/cjs/plugins/table/commands/index.js +0 -6
- package/dist/cjs/plugins/table/commands/insert.js +1 -1
- package/dist/cjs/plugins/table/commands/misc.js +5 -18
- package/dist/cjs/plugins/table/commands-with-analytics.js +1 -1
- package/dist/cjs/plugins/table/handlers.js +6 -2
- package/dist/cjs/plugins/table/index.js +7 -13
- package/dist/cjs/plugins/table/nodeviews/TableComponent.js +2 -2
- package/dist/cjs/plugins/table/nodeviews/table.js +7 -38
- package/dist/cjs/plugins/table/pm-plugins/decorations/plugin.js +2 -2
- package/dist/cjs/plugins/table/pm-plugins/main.js +3 -1
- package/dist/cjs/plugins/table/pm-plugins/plugin-factory.js +4 -7
- package/dist/cjs/plugins/table/pm-plugins/plugin-key.js +11 -0
- package/dist/cjs/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js +2 -0
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +3 -3
- package/dist/cjs/plugins/table/reducer.js +0 -7
- package/dist/cjs/plugins/table/toolbar.js +5 -15
- package/dist/cjs/plugins/table/transforms/metadata.js +2 -2
- package/dist/cjs/plugins/table/ui/FloatingContextualButton/index.js +1 -1
- package/dist/cjs/plugins/table/ui/FloatingContextualButton/{styles.css.js → styles.js} +0 -0
- package/dist/cjs/plugins/table/ui/FloatingContextualMenu/index.js +4 -2
- package/dist/cjs/plugins/table/ui/FloatingContextualMenu/{styles.css.js → styles.js} +0 -0
- package/dist/cjs/plugins/table/ui/FloatingInsertButton/index.js +1 -1
- package/dist/cjs/plugins/table/ui/LayoutButton/index.js +1 -2
- package/dist/cjs/plugins/table/ui/common-styles.js +53 -0
- package/dist/cjs/plugins/table/ui/ui-styles.js +109 -0
- package/dist/cjs/plugins/table/utils/nodes.js +15 -15
- package/dist/cjs/plugins/tasks-and-decisions/commands.js +15 -1
- package/dist/cjs/plugins/text-formatting/styles.js +5 -2
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/index.js +71 -1
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/toolbar-messages.js +30 -0
- package/dist/cjs/plugins/text-formatting/utils.js +30 -2
- package/dist/cjs/plugins/type-ahead/api.js +32 -1
- package/dist/cjs/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +20 -5
- package/dist/cjs/plugins/type-ahead/utils.js +22 -4
- package/dist/cjs/ui/Appearance/Comment/Comment.js +2 -2
- package/dist/cjs/ui/Appearance/FullPage/StyledComponents.js +2 -2
- package/dist/cjs/ui/ContentStyles/index.js +33 -10
- package/dist/cjs/utils/index.js +1 -8
- package/dist/cjs/utils/insert.js +1 -9
- package/dist/cjs/utils/selection.js +2 -9
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/actions/index.js +20 -23
- package/dist/es2019/extensibility.js +1 -1
- package/dist/es2019/labs/next/full-page.js +2 -2
- package/dist/es2019/plugins/block-type/styles.js +3 -3
- package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/index.js +15 -12
- package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/styled.js +19 -14
- package/dist/es2019/plugins/card/messages.js +4 -4
- package/dist/es2019/plugins/card/ui/LinkToolbarAppearance.js +21 -9
- package/dist/es2019/plugins/card/ui/LinkToolbarButtonGroup.js +54 -3
- package/dist/es2019/plugins/card/ui/LinkToolbarIconDropdown.js +145 -3
- package/dist/es2019/plugins/card/ui/ResizableEmbedCard.js +10 -6
- package/dist/es2019/plugins/card/ui/assets/card.js +1 -1
- package/dist/es2019/plugins/card/ui/assets/embed.js +1 -1
- package/dist/es2019/plugins/card/ui/assets/inline.js +1 -1
- package/dist/es2019/plugins/card/ui/assets/url.js +1 -1
- package/dist/es2019/plugins/card/ui/link-toolbar-button-group-options.js +45 -0
- package/dist/es2019/plugins/card/ui/link-toolbar-icon-dropdown-options.js +51 -0
- package/dist/es2019/plugins/card/ui/styled.js +2 -2
- package/dist/es2019/plugins/card/ui/types.js +1 -0
- package/dist/es2019/plugins/clipboard/pm-plugins/main.js +91 -9
- package/dist/es2019/plugins/code-block/styles.js +14 -14
- package/dist/es2019/plugins/extension/plugin-factory.js +3 -1
- package/dist/es2019/plugins/extension/pm-plugins/main.js +38 -12
- package/dist/es2019/plugins/extension/utils.js +37 -2
- package/dist/es2019/plugins/find-replace/ui/Find.js +1 -1
- package/dist/es2019/plugins/find-replace/ui/FindReplace.js +1 -1
- package/dist/es2019/plugins/find-replace/ui/Replace.js +1 -1
- package/dist/es2019/plugins/find-replace/ui/styles.js +14 -9
- package/dist/es2019/plugins/layout/styles.js +5 -1
- package/dist/es2019/plugins/list/actions/wrap-and-join-lists.js +163 -0
- package/dist/es2019/plugins/list/commands/index.js +29 -28
- package/dist/es2019/plugins/list/utils/replace-content.js +22 -0
- package/dist/es2019/plugins/media/nodeviews/mediaNodeUpdater.js +3 -3
- package/dist/es2019/plugins/media/styles.js +1 -1
- package/dist/es2019/plugins/media/utils/media-single.js +14 -1
- package/dist/es2019/plugins/paste/handlers.js +19 -5
- package/dist/es2019/plugins/paste/pm-plugins/analytics.js +2 -2
- package/dist/es2019/plugins/placeholder-text/index.js +46 -1
- package/dist/es2019/plugins/placeholder-text/placeholder-text-nodeview.js +66 -20
- package/dist/es2019/plugins/placeholder-text/selection-utils.js +9 -0
- package/dist/es2019/plugins/placeholder-text/styles.js +22 -0
- package/dist/es2019/plugins/table/commands/index.js +1 -1
- package/dist/es2019/plugins/table/commands/insert.js +1 -1
- package/dist/es2019/plugins/table/commands/misc.js +5 -11
- package/dist/es2019/plugins/table/commands-with-analytics.js +1 -1
- package/dist/es2019/plugins/table/handlers.js +6 -2
- package/dist/es2019/plugins/table/index.js +4 -8
- package/dist/es2019/plugins/table/nodeviews/TableComponent.js +2 -2
- package/dist/es2019/plugins/table/nodeviews/table.js +2 -16
- package/dist/es2019/plugins/table/pm-plugins/decorations/plugin.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/main.js +2 -1
- package/dist/es2019/plugins/table/pm-plugins/plugin-factory.js +1 -2
- package/dist/es2019/plugins/table/pm-plugins/plugin-key.js +2 -0
- package/dist/es2019/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js +2 -0
- package/dist/es2019/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +1 -1
- package/dist/es2019/plugins/table/reducer.js +0 -9
- package/dist/es2019/plugins/table/toolbar.js +1 -4
- package/dist/es2019/plugins/table/transforms/metadata.js +1 -1
- package/dist/es2019/plugins/table/ui/FloatingContextualButton/index.js +1 -1
- package/dist/es2019/plugins/table/ui/FloatingContextualButton/{styles.css.js → styles.js} +0 -0
- package/dist/es2019/plugins/table/ui/FloatingContextualMenu/index.js +3 -2
- package/dist/es2019/plugins/table/ui/FloatingContextualMenu/{styles.css.js → styles.js} +0 -0
- package/dist/es2019/plugins/table/ui/FloatingInsertButton/index.js +1 -1
- package/dist/es2019/plugins/table/ui/LayoutButton/index.js +1 -2
- package/dist/es2019/plugins/table/ui/{common-styles.css.js → common-styles.js} +57 -27
- package/dist/es2019/plugins/table/ui/{ui-styles.css.js → ui-styles.js} +99 -78
- package/dist/es2019/plugins/table/utils/nodes.js +11 -11
- package/dist/es2019/plugins/tasks-and-decisions/commands.js +13 -1
- package/dist/es2019/plugins/text-formatting/styles.js +3 -3
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/index.js +61 -2
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/toolbar-messages.js +30 -0
- package/dist/es2019/plugins/text-formatting/utils.js +13 -1
- package/dist/es2019/plugins/type-ahead/api.js +31 -2
- package/dist/es2019/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +17 -5
- package/dist/es2019/plugins/type-ahead/utils.js +15 -0
- package/dist/es2019/ui/Appearance/Comment/Comment.js +2 -2
- package/dist/es2019/ui/Appearance/FullPage/StyledComponents.js +2 -2
- package/dist/es2019/ui/ContentStyles/index.js +46 -24
- package/dist/es2019/utils/index.js +1 -1
- package/dist/es2019/utils/insert.js +2 -10
- package/dist/es2019/utils/selection.js +1 -6
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/actions/index.js +76 -48
- package/dist/esm/extensibility.js +1 -1
- package/dist/esm/labs/next/full-page.js +2 -2
- package/dist/esm/plugins/block-type/styles.js +4 -2
- package/dist/esm/plugins/block-type/ui/ToolbarBlockType/index.js +14 -12
- package/dist/esm/plugins/block-type/ui/ToolbarBlockType/styled.js +9 -5
- package/dist/esm/plugins/card/messages.js +4 -4
- package/dist/esm/plugins/card/ui/LinkToolbarAppearance.js +25 -9
- package/dist/esm/plugins/card/ui/LinkToolbarButtonGroup.js +57 -5
- package/dist/esm/plugins/card/ui/LinkToolbarIconDropdown.js +154 -5
- package/dist/esm/plugins/card/ui/ResizableEmbedCard.js +9 -6
- package/dist/esm/plugins/card/ui/assets/card.js +1 -1
- package/dist/esm/plugins/card/ui/assets/embed.js +1 -1
- package/dist/esm/plugins/card/ui/assets/inline.js +1 -1
- package/dist/esm/plugins/card/ui/assets/url.js +1 -1
- package/dist/esm/plugins/card/ui/link-toolbar-button-group-options.js +45 -0
- package/dist/esm/plugins/card/ui/link-toolbar-icon-dropdown-options.js +51 -0
- package/dist/esm/plugins/card/ui/styled.js +2 -2
- package/dist/esm/plugins/card/ui/types.js +1 -0
- package/dist/esm/plugins/clipboard/pm-plugins/main.js +91 -2
- package/dist/esm/plugins/code-block/styles.js +42 -38
- package/dist/esm/plugins/extension/plugin-factory.js +3 -1
- package/dist/esm/plugins/extension/pm-plugins/main.js +34 -11
- package/dist/esm/plugins/extension/utils.js +51 -9
- package/dist/esm/plugins/find-replace/ui/Find.js +1 -1
- package/dist/esm/plugins/find-replace/ui/FindReplace.js +1 -1
- package/dist/esm/plugins/find-replace/ui/Replace.js +1 -1
- package/dist/esm/plugins/find-replace/ui/styles.js +6 -10
- package/dist/esm/plugins/layout/styles.js +2 -2
- package/dist/esm/plugins/list/actions/wrap-and-join-lists.js +168 -0
- package/dist/esm/plugins/list/commands/index.js +33 -34
- package/dist/esm/plugins/list/utils/replace-content.js +21 -0
- package/dist/esm/plugins/media/nodeviews/mediaNodeUpdater.js +3 -3
- package/dist/esm/plugins/media/styles.js +1 -1
- package/dist/esm/plugins/media/utils/media-single.js +12 -1
- package/dist/esm/plugins/paste/handlers.js +19 -5
- package/dist/esm/plugins/paste/pm-plugins/analytics.js +2 -2
- package/dist/esm/plugins/placeholder-text/index.js +44 -1
- package/dist/esm/plugins/placeholder-text/placeholder-text-nodeview.js +67 -20
- package/dist/esm/plugins/placeholder-text/selection-utils.js +9 -0
- package/dist/esm/plugins/placeholder-text/styles.js +2 -1
- package/dist/esm/plugins/table/commands/index.js +1 -1
- package/dist/esm/plugins/table/commands/insert.js +1 -1
- package/dist/esm/plugins/table/commands/misc.js +5 -15
- package/dist/esm/plugins/table/commands-with-analytics.js +1 -1
- package/dist/esm/plugins/table/handlers.js +6 -2
- package/dist/esm/plugins/table/index.js +6 -11
- package/dist/esm/plugins/table/nodeviews/TableComponent.js +2 -2
- package/dist/esm/plugins/table/nodeviews/table.js +6 -37
- package/dist/esm/plugins/table/pm-plugins/decorations/plugin.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/main.js +2 -1
- package/dist/esm/plugins/table/pm-plugins/plugin-factory.js +1 -2
- package/dist/esm/plugins/table/pm-plugins/plugin-key.js +2 -0
- package/dist/esm/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js +2 -0
- package/dist/esm/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +1 -1
- package/dist/esm/plugins/table/reducer.js +0 -7
- package/dist/esm/plugins/table/toolbar.js +1 -10
- package/dist/esm/plugins/table/transforms/metadata.js +1 -1
- package/dist/esm/plugins/table/ui/FloatingContextualButton/index.js +1 -1
- package/dist/esm/plugins/table/ui/FloatingContextualButton/{styles.css.js → styles.js} +0 -0
- package/dist/esm/plugins/table/ui/FloatingContextualMenu/index.js +3 -2
- package/dist/esm/plugins/table/ui/FloatingContextualMenu/{styles.css.js → styles.js} +0 -0
- package/dist/esm/plugins/table/ui/FloatingInsertButton/index.js +1 -1
- package/dist/esm/plugins/table/ui/LayoutButton/index.js +1 -2
- package/dist/esm/plugins/table/ui/common-styles.js +27 -0
- package/dist/esm/plugins/table/ui/ui-styles.js +68 -0
- package/dist/esm/plugins/table/utils/nodes.js +14 -14
- package/dist/esm/plugins/tasks-and-decisions/commands.js +13 -1
- package/dist/esm/plugins/text-formatting/styles.js +4 -2
- package/dist/esm/plugins/text-formatting/ui/Toolbar/index.js +69 -2
- package/dist/esm/plugins/text-formatting/ui/Toolbar/toolbar-messages.js +30 -0
- package/dist/esm/plugins/text-formatting/utils.js +18 -0
- package/dist/esm/plugins/type-ahead/api.js +30 -2
- package/dist/esm/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +16 -4
- package/dist/esm/plugins/type-ahead/utils.js +17 -3
- package/dist/esm/ui/Appearance/Comment/Comment.js +2 -2
- package/dist/esm/ui/Appearance/FullPage/StyledComponents.js +2 -2
- package/dist/esm/ui/ContentStyles/index.js +28 -10
- package/dist/esm/utils/index.js +1 -1
- package/dist/esm/utils/insert.js +2 -10
- package/dist/esm/utils/selection.js +1 -6
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/actions/index.d.ts +2 -2
- package/dist/types/extensibility.d.ts +1 -1
- package/dist/types/plugins/analytics/types/list-events.d.ts +0 -1
- package/dist/types/plugins/block-type/styles.d.ts +2 -1
- package/dist/types/plugins/block-type/ui/ToolbarBlockType/index.d.ts +1 -0
- package/dist/types/plugins/block-type/ui/ToolbarBlockType/styled.d.ts +2 -7
- package/dist/types/plugins/card/messages.d.ts +2 -2
- package/dist/types/plugins/card/ui/LinkToolbarButtonGroup.d.ts +18 -2
- package/dist/types/plugins/card/ui/LinkToolbarIconDropdown.d.ts +23 -3
- package/dist/types/plugins/card/ui/ResizableEmbedCard.d.ts +3 -1
- package/dist/types/plugins/card/ui/link-toolbar-button-group-options.d.ts +5 -0
- package/dist/types/plugins/card/ui/link-toolbar-icon-dropdown-options.d.ts +5 -0
- package/dist/types/plugins/card/ui/styled.d.ts +2 -3
- package/dist/types/plugins/card/ui/types.d.ts +12 -0
- package/dist/types/plugins/clipboard/pm-plugins/main.d.ts +10 -1
- package/dist/types/plugins/code-block/styles.d.ts +3 -2
- package/dist/types/plugins/extension/pm-plugins/main.d.ts +2 -1
- package/dist/types/plugins/extension/types.d.ts +1 -0
- package/dist/types/plugins/extension/utils.d.ts +3 -1
- package/dist/types/plugins/find-replace/ui/FindReplace.d.ts +2 -1
- package/dist/types/plugins/find-replace/ui/styles.d.ts +5 -5
- package/dist/types/plugins/layout/styles.d.ts +1 -1
- package/dist/types/plugins/list/actions/wrap-and-join-lists.d.ts +25 -0
- package/dist/types/plugins/list/commands/index.d.ts +0 -1
- package/dist/types/plugins/list/utils/replace-content.d.ts +8 -0
- package/dist/types/plugins/media/nodeviews/mediaNodeUpdater.d.ts +2 -2
- package/dist/types/plugins/media/styles.d.ts +1 -1
- package/dist/types/plugins/media/utils/media-single.d.ts +1 -0
- package/dist/types/plugins/panel/styles.d.ts +1 -1
- package/dist/types/plugins/paste/handlers.d.ts +1 -1
- package/dist/types/plugins/placeholder-text/placeholder-text-nodeview.d.ts +3 -2
- package/dist/types/plugins/placeholder-text/selection-utils.d.ts +2 -0
- package/dist/types/plugins/rule/styles.d.ts +1 -1
- package/dist/types/plugins/table/commands/index.d.ts +1 -1
- package/dist/types/plugins/table/commands/misc.d.ts +0 -1
- package/dist/types/plugins/table/nodeviews/table.d.ts +0 -1
- package/dist/types/plugins/table/pm-plugins/plugin-factory.d.ts +1 -4
- package/dist/types/plugins/table/pm-plugins/plugin-key.d.ts +3 -0
- package/dist/types/plugins/table/types.d.ts +1 -8
- package/dist/types/plugins/table/ui/FloatingContextualButton/{styles.css.d.ts → styles.d.ts} +0 -0
- package/dist/types/plugins/table/ui/FloatingContextualMenu/{styles.css.d.ts → styles.d.ts} +0 -0
- package/dist/types/plugins/table/ui/LayoutButton/index.d.ts +0 -1
- package/dist/types/plugins/table/ui/common-styles.d.ts +6 -0
- package/dist/types/plugins/table/ui/ui-styles.d.ts +15 -0
- package/dist/types/plugins/table/utils/nodes.d.ts +6 -6
- package/dist/types/plugins/text-formatting/pm-plugins/smart-input-rule.d.ts +1 -1
- package/dist/types/plugins/text-formatting/styles.d.ts +2 -1
- package/dist/types/plugins/text-formatting/ui/Toolbar/toolbar-messages.d.ts +30 -0
- package/dist/types/plugins/text-formatting/utils.d.ts +4 -0
- package/dist/types/plugins/type-ahead/api.d.ts +11 -1
- package/dist/types/plugins/type-ahead/transforms/open-typeahead-at-cursor.d.ts +1 -0
- package/dist/types/plugins/type-ahead/utils.d.ts +4 -0
- package/dist/types/ui/ContentStyles/index.d.ts +1 -0
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/types/utils/selection.d.ts +0 -1
- package/package.json +28 -26
- package/dist/cjs/plugins/table/ui/common-styles.css.js +0 -44
- package/dist/cjs/plugins/table/ui/ui-styles.css.js +0 -95
- package/dist/esm/plugins/table/ui/common-styles.css.js +0 -23
- package/dist/esm/plugins/table/ui/ui-styles.css.js +0 -59
- package/dist/types/plugins/table/ui/common-styles.css.d.ts +0 -3
- package/dist/types/plugins/table/ui/ui-styles.css.d.ts +0 -14
|
@@ -4,12 +4,13 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
4
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
6
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
7
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
7
8
|
|
|
8
9
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
9
10
|
|
|
10
11
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
11
12
|
|
|
12
|
-
import React, { useMemo } from 'react';
|
|
13
|
+
import React, { useMemo, useState, useEffect } from 'react';
|
|
13
14
|
import { injectIntl } from 'react-intl-next';
|
|
14
15
|
import { Separator, Wrapper, ButtonGroup } from '../../../../ui/styles';
|
|
15
16
|
import { useFormattingIcons, useHasFormattingActived } from './hooks/formatting-icons';
|
|
@@ -19,6 +20,8 @@ import { SingleToolbarButtons } from './single-toolbar-buttons';
|
|
|
19
20
|
import { MoreButton } from './more-button';
|
|
20
21
|
import { FormattingTextDropdownMenu } from './dropdown-menu';
|
|
21
22
|
import { toolbarMessages } from './toolbar-messages';
|
|
23
|
+
import { usePreviousObjectState, compareItemsArrays, isArrayContainsContent } from '../../utils';
|
|
24
|
+
import Announcer from '../../../../utils/announcer/announcer';
|
|
22
25
|
|
|
23
26
|
var ToolbarFormatting = function ToolbarFormatting(_ref) {
|
|
24
27
|
var shouldUseResponsiveToolbar = _ref.shouldUseResponsiveToolbar,
|
|
@@ -33,6 +36,12 @@ var ToolbarFormatting = function ToolbarFormatting(_ref) {
|
|
|
33
36
|
var editorState = useMemo(function () {
|
|
34
37
|
return editorView.state;
|
|
35
38
|
}, [editorView.state]);
|
|
39
|
+
|
|
40
|
+
var _useState = useState(''),
|
|
41
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
42
|
+
message = _useState2[0],
|
|
43
|
+
setMessage = _useState2[1];
|
|
44
|
+
|
|
36
45
|
var defaultIcons = useFormattingIcons({
|
|
37
46
|
editorState: editorState,
|
|
38
47
|
intl: intl,
|
|
@@ -59,6 +68,54 @@ var ToolbarFormatting = function ToolbarFormatting(_ref) {
|
|
|
59
68
|
dropdownItems = _useResponsiveToolbar.dropdownItems,
|
|
60
69
|
singleItems = _useResponsiveToolbar.singleItems;
|
|
61
70
|
|
|
71
|
+
var clearFormattingStatus = intl.formatMessage(toolbarMessages.textFormattingOff);
|
|
72
|
+
var superscriptOffSubscriptOnStatus = intl.formatMessage(toolbarMessages.superscriptOffSubscriptOn);
|
|
73
|
+
var subscriptOffSuperscriptOnStatus = intl.formatMessage(toolbarMessages.subscriptOffSuperscriptOn);
|
|
74
|
+
var activeItems = [].concat(_toConsumableArray(dropdownItems), _toConsumableArray(singleItems)).filter(function (item) {
|
|
75
|
+
return item.isActive;
|
|
76
|
+
});
|
|
77
|
+
var prevActiveItems = usePreviousObjectState(activeItems);
|
|
78
|
+
var fromSuperscriptToSubscript = isArrayContainsContent(activeItems, 'Subscript') && isArrayContainsContent(prevActiveItems, 'Superscript');
|
|
79
|
+
var fromSubscriptToSuperscript = isArrayContainsContent(activeItems, 'Superscript') && isArrayContainsContent(prevActiveItems, 'Subscript');
|
|
80
|
+
var comparedItems;
|
|
81
|
+
var screenReaderMessage = '';
|
|
82
|
+
|
|
83
|
+
if (prevActiveItems && activeItems.length > prevActiveItems.length) {
|
|
84
|
+
comparedItems = compareItemsArrays(activeItems, prevActiveItems);
|
|
85
|
+
screenReaderMessage = intl.formatMessage(toolbarMessages.on, {
|
|
86
|
+
formattingType: comparedItems[0].content
|
|
87
|
+
});
|
|
88
|
+
} else {
|
|
89
|
+
comparedItems = compareItemsArrays(prevActiveItems, activeItems);
|
|
90
|
+
|
|
91
|
+
if (comparedItems && comparedItems.length) {
|
|
92
|
+
var _activeItems$;
|
|
93
|
+
|
|
94
|
+
screenReaderMessage = intl.formatMessage(toolbarMessages.off, {
|
|
95
|
+
formattingType: comparedItems[0].content
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
if (((_activeItems$ = activeItems[0]) === null || _activeItems$ === void 0 ? void 0 : _activeItems$.content) === 'Code') {
|
|
99
|
+
screenReaderMessage = intl.formatMessage(toolbarMessages.codeOn, {
|
|
100
|
+
textFormattingOff: (prevActiveItems === null || prevActiveItems === void 0 ? void 0 : prevActiveItems.length) > 1 ? clearFormattingStatus : screenReaderMessage
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (fromSuperscriptToSubscript) {
|
|
105
|
+
screenReaderMessage = superscriptOffSubscriptOnStatus;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if (fromSubscriptToSuperscript) {
|
|
109
|
+
screenReaderMessage = subscriptOffSuperscriptOnStatus;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
} // handle 'Clear formatting' status for screen readers
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
if (!(activeItems !== null && activeItems !== void 0 && activeItems.length) && (prevActiveItems === null || prevActiveItems === void 0 ? void 0 : prevActiveItems.length) > 1) {
|
|
116
|
+
screenReaderMessage = clearFormattingStatus;
|
|
117
|
+
}
|
|
118
|
+
|
|
62
119
|
var items = useMemo(function () {
|
|
63
120
|
if (!clearIcon) {
|
|
64
121
|
return dropdownItems;
|
|
@@ -67,9 +124,19 @@ var ToolbarFormatting = function ToolbarFormatting(_ref) {
|
|
|
67
124
|
return [].concat(_toConsumableArray(dropdownItems), [clearIcon]);
|
|
68
125
|
}, [clearIcon, dropdownItems]);
|
|
69
126
|
var moreFormattingButtonLabel = intl.formatMessage(toolbarMessages.moreFormatting);
|
|
127
|
+
useEffect(function () {
|
|
128
|
+
if (screenReaderMessage) {
|
|
129
|
+
setMessage(screenReaderMessage);
|
|
130
|
+
}
|
|
131
|
+
}, [screenReaderMessage]);
|
|
70
132
|
return /*#__PURE__*/React.createElement(ButtonGroup, {
|
|
71
133
|
width: isReducedSpacing ? 'small' : 'large'
|
|
72
|
-
}, /*#__PURE__*/React.createElement(
|
|
134
|
+
}, message && /*#__PURE__*/React.createElement(Announcer, {
|
|
135
|
+
ariaLive: "assertive",
|
|
136
|
+
text: message,
|
|
137
|
+
ariaRelevant: "additions",
|
|
138
|
+
delay: 250
|
|
139
|
+
}), /*#__PURE__*/React.createElement(SingleToolbarButtons, {
|
|
73
140
|
items: singleItems,
|
|
74
141
|
editorView: editorView,
|
|
75
142
|
isReducedSpacing: isReducedSpacing
|
|
@@ -15,16 +15,31 @@ export var toolbarMessages = defineMessages({
|
|
|
15
15
|
defaultMessage: 'Code',
|
|
16
16
|
description: 'Whether the text selection has monospaced/code font'
|
|
17
17
|
},
|
|
18
|
+
codeOn: {
|
|
19
|
+
id: 'fabric.editor.code.on',
|
|
20
|
+
defaultMessage: '{textFormattingOff}, Code On',
|
|
21
|
+
description: 'Reports that code formatting has been turned on'
|
|
22
|
+
},
|
|
18
23
|
subscript: {
|
|
19
24
|
id: 'fabric.editor.subscript',
|
|
20
25
|
defaultMessage: 'Subscript',
|
|
21
26
|
description: 'Whether the text selection is written below the line in a slightly smaller size'
|
|
22
27
|
},
|
|
28
|
+
subscriptOffSuperscriptOn: {
|
|
29
|
+
id: 'fabric.editor.subscript.off.superscript.on',
|
|
30
|
+
defaultMessage: 'Subscript Off, Superscript On',
|
|
31
|
+
description: 'Reports text formatting in case when subscript off and superscript on'
|
|
32
|
+
},
|
|
23
33
|
superscript: {
|
|
24
34
|
id: 'fabric.editor.superscript',
|
|
25
35
|
defaultMessage: 'Superscript',
|
|
26
36
|
description: 'Whether the text selection is written above the line in a slightly smaller size'
|
|
27
37
|
},
|
|
38
|
+
superscriptOffSubscriptOn: {
|
|
39
|
+
id: 'fabric.editor.superscript.off.subscript.on',
|
|
40
|
+
defaultMessage: 'Superscript Off, Subscript On',
|
|
41
|
+
description: 'Describe text formatting in case when Superscript Off and Subscript on'
|
|
42
|
+
},
|
|
28
43
|
clearFormatting: {
|
|
29
44
|
id: 'fabric.editor.clearFormatting',
|
|
30
45
|
defaultMessage: 'Clear formatting',
|
|
@@ -44,5 +59,20 @@ export var toolbarMessages = defineMessages({
|
|
|
44
59
|
id: 'fabric.editor.italic',
|
|
45
60
|
defaultMessage: 'Italic',
|
|
46
61
|
description: 'This refers to italics or emphasized formatting.'
|
|
62
|
+
},
|
|
63
|
+
on: {
|
|
64
|
+
id: 'fabric.editor.on',
|
|
65
|
+
defaultMessage: '{formattingType} On',
|
|
66
|
+
description: 'Reports that text formatting has been turned on'
|
|
67
|
+
},
|
|
68
|
+
off: {
|
|
69
|
+
id: 'fabric.editor.off',
|
|
70
|
+
defaultMessage: '{formattingType} Off',
|
|
71
|
+
description: 'Reports that text formatting has been turned off'
|
|
72
|
+
},
|
|
73
|
+
textFormattingOff: {
|
|
74
|
+
id: 'fabric.editor.text.formatting.off',
|
|
75
|
+
defaultMessage: 'Text formatting Off',
|
|
76
|
+
description: 'Reports that text formatting has been turned off'
|
|
47
77
|
}
|
|
48
78
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useRef, useEffect } from 'react';
|
|
1
2
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
2
3
|
import { FORMATTING_MARK_TYPES, FORMATTING_NODE_TYPES } from './commands/clear-formatting';
|
|
3
4
|
export var nodeLen = function nodeLen(node) {
|
|
@@ -127,4 +128,21 @@ var marksArePresent = function marksArePresent(state) {
|
|
|
127
128
|
|
|
128
129
|
export var checkFormattingIsPresent = function checkFormattingIsPresent(state) {
|
|
129
130
|
return marksArePresent(state) || blockStylingIsPresent(state);
|
|
131
|
+
};
|
|
132
|
+
export var usePreviousObjectState = function usePreviousObjectState(value) {
|
|
133
|
+
var ref = useRef();
|
|
134
|
+
useEffect(function () {
|
|
135
|
+
ref.current = value;
|
|
136
|
+
});
|
|
137
|
+
return ref.current;
|
|
138
|
+
};
|
|
139
|
+
export var compareItemsArrays = function compareItemsArrays(items, prevItems) {
|
|
140
|
+
return items && items.filter(function (item) {
|
|
141
|
+
return !prevItems.includes(item);
|
|
142
|
+
});
|
|
143
|
+
};
|
|
144
|
+
export var isArrayContainsContent = function isArrayContainsContent(items, content) {
|
|
145
|
+
return items.filter(function (item) {
|
|
146
|
+
return item.content === content;
|
|
147
|
+
}).length > 0;
|
|
130
148
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TypeAheadAvailableNodes, SelectItemMode } from '@atlaskit/editor-common/type-ahead';
|
|
2
|
-
import { findHandler, isTypeAheadOpen, getTypeAheadHandler, getTypeAheadQuery } from './utils';
|
|
2
|
+
import { findHandler, findHandlerByTrigger, isTypeAheadOpen, getTypeAheadHandler, getTypeAheadQuery } from './utils';
|
|
3
3
|
import { INPUT_METHOD } from '../analytics/types/enums';
|
|
4
|
-
import { openTypeAheadAtCursor } from './transforms/open-typeahead-at-cursor';
|
|
4
|
+
import { openTypeAheadAtCursor, openTypeAhead } from './transforms/open-typeahead-at-cursor';
|
|
5
5
|
import { closeTypeAhead } from './transforms/close-type-ahead';
|
|
6
6
|
import { updateQuery } from './commands/update-query';
|
|
7
7
|
import { insertTypeAheadItem } from './commands/insert-type-ahead-item';
|
|
@@ -207,6 +207,34 @@ var currentQuery = function currentQuery(_ref8) {
|
|
|
207
207
|
};
|
|
208
208
|
};
|
|
209
209
|
|
|
210
|
+
var find = function find(_ref9) {
|
|
211
|
+
var editorView = _ref9.editorView;
|
|
212
|
+
return function (trigger) {
|
|
213
|
+
var editorState = editorView.state;
|
|
214
|
+
var handler = findHandlerByTrigger({
|
|
215
|
+
trigger: trigger,
|
|
216
|
+
editorState: editorState
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
if (!handler) {
|
|
220
|
+
return null;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
return handler;
|
|
224
|
+
};
|
|
225
|
+
}; // This is an internal tool to be used inside of others Editor Plugins
|
|
226
|
+
// We shouldn't public export this method.
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
export var createInternalTypeAheadTools = function createInternalTypeAheadTools(editorView) {
|
|
230
|
+
var props = {
|
|
231
|
+
editorView: editorView
|
|
232
|
+
};
|
|
233
|
+
return {
|
|
234
|
+
findTypeAheadHandler: find(props),
|
|
235
|
+
openTypeAheadHandler: openTypeAhead
|
|
236
|
+
};
|
|
237
|
+
};
|
|
210
238
|
export var createTypeAheadTools = function createTypeAheadTools(editorView) {
|
|
211
239
|
var props = {
|
|
212
240
|
editorView: editorView
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { TextSelection } from 'prosemirror-state';
|
|
2
2
|
import { pluginKey } from '../pm-plugins/key';
|
|
3
3
|
import { ACTIONS } from '../pm-plugins/actions';
|
|
4
|
-
export var
|
|
5
|
-
var triggerHandler = _ref.triggerHandler,
|
|
6
|
-
inputMethod = _ref.inputMethod,
|
|
7
|
-
query = _ref.query;
|
|
4
|
+
export var openTypeAhead = function openTypeAhead(props) {
|
|
8
5
|
return function (tr) {
|
|
6
|
+
var triggerHandler = props.triggerHandler,
|
|
7
|
+
inputMethod = props.inputMethod,
|
|
8
|
+
query = props.query;
|
|
9
9
|
tr.setMeta(pluginKey, {
|
|
10
10
|
action: ACTIONS.OPEN_TYPEAHEAD_AT_CURSOR,
|
|
11
11
|
params: {
|
|
@@ -14,6 +14,18 @@ export var openTypeAheadAtCursor = function openTypeAheadAtCursor(_ref) {
|
|
|
14
14
|
query: query
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export var openTypeAheadAtCursor = function openTypeAheadAtCursor(_ref) {
|
|
20
|
+
var triggerHandler = _ref.triggerHandler,
|
|
21
|
+
inputMethod = _ref.inputMethod,
|
|
22
|
+
query = _ref.query;
|
|
23
|
+
return function (tr) {
|
|
24
|
+
openTypeAhead({
|
|
25
|
+
triggerHandler: triggerHandler,
|
|
26
|
+
inputMethod: inputMethod,
|
|
27
|
+
query: query
|
|
28
|
+
})(tr);
|
|
17
29
|
var selection = tr.selection;
|
|
18
30
|
|
|
19
31
|
if (!(selection instanceof TextSelection)) {
|
|
@@ -60,9 +60,23 @@ export var findHandler = function findHandler(id, state) {
|
|
|
60
60
|
return h.id === id;
|
|
61
61
|
}) || null;
|
|
62
62
|
};
|
|
63
|
-
export var
|
|
64
|
-
var
|
|
65
|
-
|
|
63
|
+
export var findHandlerByTrigger = function findHandlerByTrigger(_ref) {
|
|
64
|
+
var trigger = _ref.trigger,
|
|
65
|
+
editorState = _ref.editorState;
|
|
66
|
+
var pluginState = typeAheadPluginKey.getState(editorState);
|
|
67
|
+
|
|
68
|
+
if (!pluginState || !pluginState.typeAheadHandlers || pluginState.typeAheadHandlers.length === 0) {
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
var typeAheadHandlers = pluginState.typeAheadHandlers;
|
|
73
|
+
return typeAheadHandlers.find(function (h) {
|
|
74
|
+
return h.trigger === trigger;
|
|
75
|
+
}) || null;
|
|
76
|
+
};
|
|
77
|
+
export var moveSelectedIndex = function moveSelectedIndex(_ref2) {
|
|
78
|
+
var editorView = _ref2.editorView,
|
|
79
|
+
direction = _ref2.direction;
|
|
66
80
|
return function () {
|
|
67
81
|
var typeAheadState = getPluginState(editorView.state);
|
|
68
82
|
|
|
@@ -26,7 +26,7 @@ import ContentStyles from '../../ContentStyles';
|
|
|
26
26
|
import { pluginKey as maxContentSizePluginKey } from '../../../plugins/max-content-size';
|
|
27
27
|
import { stateKey as mediaPluginKey } from '../../../plugins/media/pm-plugins/plugin-key';
|
|
28
28
|
import { ClickAreaBlock } from '../../Addon';
|
|
29
|
-
import {
|
|
29
|
+
import { deprecatedTableCommentEditorStyles } from '../../../plugins/table/ui/common-styles';
|
|
30
30
|
import WithFlash from '../../WithFlash';
|
|
31
31
|
import { WidthConsumer } from '@atlaskit/editor-common/ui';
|
|
32
32
|
import { akEditorMobileBreakoutPoint } from '@atlaskit/editor-shared-styles';
|
|
@@ -42,7 +42,7 @@ var CommentEditor = styled.div(_templateObject || (_templateObject = _taggedTemp
|
|
|
42
42
|
CommentEditor.displayName = 'CommentEditor';
|
|
43
43
|
var ContentArea = styled(ContentStyles)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n flex-grow: 1;\n overflow-x: hidden;\n overflow-y: auto;\n line-height: 24px;\n ", ";\n\n /** Hack for Bitbucket to ensure entire editorView gets drop event; see ED-3294 **/\n /** Hack for tables controlls. Otherwise marging collapse and controlls are misplaced. **/\n .ProseMirror {\n margin: 12px ", "px ", "px;\n }\n\n .gridParent {\n margin-left: ", "px;\n margin-right: ", "px;\n width: calc(100% + ", "px);\n }\n\n padding: ", "px;\n\n ", ";\n"])), function (props) {
|
|
44
44
|
return props.maxHeight ? 'max-height: ' + props.maxHeight + 'px;' : '';
|
|
45
|
-
}, CommentEditorMargin, CommentEditorMargin, CommentEditorMargin - GRID_GUTTER, CommentEditorMargin - GRID_GUTTER, CommentEditorMargin - GRID_GUTTER, TableControlsPadding,
|
|
45
|
+
}, CommentEditorMargin, CommentEditorMargin, CommentEditorMargin - GRID_GUTTER, CommentEditorMargin - GRID_GUTTER, CommentEditorMargin - GRID_GUTTER, TableControlsPadding, deprecatedTableCommentEditorStyles);
|
|
46
46
|
ContentArea.displayName = 'ContentArea';
|
|
47
47
|
var SecondaryToolbar = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n box-sizing: border-box;\n justify-content: flex-end;\n align-items: center;\n display: flex;\n padding: 12px 1px;\n"])));
|
|
48
48
|
SecondaryToolbar.displayName = 'SecondaryToolbar';
|
|
@@ -6,7 +6,7 @@ import styled from 'styled-components';
|
|
|
6
6
|
import { akEditorFullWidthLayoutWidth, akEditorGutterPadding, akEditorSwoopCubicBezier, akLayoutGutterOffset, ATLASSIAN_NAVIGATION_HEIGHT, akEditorContextPanelWidth } from '@atlaskit/editor-shared-styles';
|
|
7
7
|
import { taskListSelector, decisionListSelector } from '@atlaskit/adf-schema';
|
|
8
8
|
import ContentStyles from '../../ContentStyles';
|
|
9
|
-
import {
|
|
9
|
+
import { deprecatedTableFullPageEditorStyles } from '../../../plugins/table/ui/common-styles';
|
|
10
10
|
import { tableMarginFullWidthMode } from '../../../plugins/table/ui/consts';
|
|
11
11
|
import { scrollbarStyles } from '../../styles';
|
|
12
12
|
var SWOOP_ANIMATION = "0.5s ".concat(akEditorSwoopCubicBezier);
|
|
@@ -27,7 +27,7 @@ export var EditorContentArea = styled.div(_templateObject5 || (_templateObject5
|
|
|
27
27
|
var theme = _ref.theme,
|
|
28
28
|
fullWidthMode = _ref.fullWidthMode;
|
|
29
29
|
return (fullWidthMode ? akEditorFullWidthLayoutWidth : theme.layoutMaxWidth) + TOTAL_PADDING;
|
|
30
|
-
}, SWOOP_ANIMATION, taskListSelector, decisionListSelector,
|
|
30
|
+
}, SWOOP_ANIMATION, taskListSelector, decisionListSelector, deprecatedTableFullPageEditorStyles, function (_ref2) {
|
|
31
31
|
var containerWidth = _ref2.containerWidth;
|
|
32
32
|
|
|
33
33
|
if (!containerWidth) {
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
3
3
|
|
|
4
|
-
var _templateObject;
|
|
4
|
+
var _templateObject, _templateObject2;
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
/** @jsx jsx */
|
|
7
|
+
import React, { useMemo } from 'react';
|
|
8
|
+
import { jsx, css, useTheme } from '@emotion/react';
|
|
7
9
|
import styled from 'styled-components';
|
|
8
10
|
import { whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, blockMarksSharedStyles, shadowSharedStyle, dateSharedStyle, tasksAndDecisionsStyles, annotationSharedStyles, smartCardSharedStyles, textColorStyles } from '@atlaskit/editor-common/styles';
|
|
9
11
|
import { editorFontSize } from '@atlaskit/editor-shared-styles';
|
|
10
12
|
import { unsupportedStyles } from '../../plugins/unsupported-content/styles';
|
|
11
13
|
import { telepointerStyle } from '../../plugins/collab-edit/styles';
|
|
12
14
|
import { gapCursorStyles } from '../../plugins/selection/gap-cursor/styles';
|
|
13
|
-
import { tableStyles } from '../../plugins/table/ui/common-styles
|
|
15
|
+
import { tableStyles } from '../../plugins/table/ui/common-styles';
|
|
14
16
|
import { placeholderStyles } from '../../plugins/placeholder/styles';
|
|
15
17
|
import { blocktypeStyles } from '../../plugins/block-type/styles';
|
|
16
18
|
import { codeBlockStyles, highlightingCodeBlockStyles } from '../../plugins/code-block/styles';
|
|
@@ -36,17 +38,33 @@ import { smartCardStyles } from '../../plugins/card/styles';
|
|
|
36
38
|
import { dateStyles } from '../../plugins/date/styles';
|
|
37
39
|
import { embedCardStyles } from '../../plugins/card/ui/styled';
|
|
38
40
|
import { useFeatureFlags } from '../../plugins/feature-flags-context';
|
|
39
|
-
|
|
41
|
+
|
|
42
|
+
var contentStyles = function contentStyles(props) {
|
|
43
|
+
var _props$featureFlags;
|
|
44
|
+
|
|
45
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ProseMirror {\n outline: none;\n font-size: ", "px;\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n }\n\n ", "\n ", "\n\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n\n .mediaGroupView-content-wrap ul {\n padding: 0;\n }\n"])), editorFontSize({
|
|
46
|
+
theme: props.theme
|
|
47
|
+
}), whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, shadowSharedStyle, tableStyles(props), (_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.codeBlockSyntaxHighlighting ? highlightingCodeBlockStyles(props) : codeBlockStyles(props), blocktypeStyles(props), textFormattingStyles(props), textColorStyles, mediaStyles, layoutStyles, tasksAndDecisionsStyles, blockMarksSharedStyles, dateSharedStyle, annotationSharedStyles(props), embedCardStyles);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
var DeprecatedContentStyles = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .ProseMirror[contenteditable='false'] .taskItemView-content-wrap {\n pointer-events: none;\n opacity: 0.7;\n }\n\n .ProseMirror-hideselection *::selection {\n background: transparent;\n }\n\n .ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n }\n\n .ProseMirror-selectednode {\n outline: none;\n }\n\n .ProseMirror-selectednode:empty {\n outline: 2px solid #8cf;\n }\n\n ", "\n ", "\n ", "\n ", "\n ", "\n ", ";\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n\n .panelView-content-wrap {\n box-sizing: border-box;\n }\n\n /** Needed to override any cleared floats, e.g. image wrapping */\n\n div.fabric-editor-block-mark[class^='fabric-editor-align'] {\n clear: none !important;\n }\n\n .fabric-editor-align-end {\n text-align: right;\n }\n\n .fabric-editor-align-start {\n text-align: left;\n }\n\n .fabric-editor-align-center {\n text-align: center;\n }\n\n .pm-table-header-content-wrap,\n .pm-table-cell-content-wrap div.fabric-editor-block-mark {\n p:first-child {\n margin-top: 0;\n }\n }\n\n .hyperlink-floating-toolbar,\n .", " {\n padding: 0;\n }\n\n /* Link icon in the Atlaskit package\n is bigger than the others\n */\n .hyperlink-open-link {\n svg {\n max-width: 18px;\n }\n &[href] {\n padding: 0 4px;\n }\n }\n"])), placeholderTextStyles, placeholderStyles, listsStyles, ruleStyles, telepointerStyle, gapCursorStyles, panelStyles, fakeCursorStyles, mentionsStyles, function (_ref) {
|
|
40
51
|
var featureFlags = _ref.featureFlags;
|
|
41
|
-
return featureFlags !== null && featureFlags !== void 0 && featureFlags.codeBlockSyntaxHighlighting ? highlightingCodeBlockStyles : codeBlockStyles;
|
|
42
|
-
}, textColorStyles, listsStyles, ruleStyles, mediaStyles, layoutStyles, telepointerStyle, gapCursorStyles, tableStyles, panelStyles, fakeCursorStyles, mentionsStyles, function (_ref2) {
|
|
43
|
-
var featureFlags = _ref2.featureFlags;
|
|
44
52
|
return featureFlags !== null && featureFlags !== void 0 && featureFlags.nextEmojiNodeView ? emojiStylesNext : emojiStyles;
|
|
45
|
-
},
|
|
53
|
+
}, gridStyles, linkStyles, extensionStyles, expandStyles, findReplaceStyles, taskDecisionStyles, statusStyles, smartCardStyles, smartCardSharedStyles, dateStyles, unsupportedStyles, ClassNames.FLOATING_TOOLBAR_COMPONENT);
|
|
46
54
|
export default /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
47
55
|
var featureFlags = useFeatureFlags();
|
|
48
|
-
|
|
56
|
+
var allowAnnotation = props.allowAnnotation;
|
|
57
|
+
var theme = useTheme();
|
|
58
|
+
var memoizedStyle = useMemo(function () {
|
|
59
|
+
return contentStyles({
|
|
60
|
+
theme: theme,
|
|
61
|
+
allowAnnotation: allowAnnotation,
|
|
62
|
+
featureFlags: featureFlags
|
|
63
|
+
});
|
|
64
|
+
}, [theme, featureFlags, allowAnnotation]);
|
|
65
|
+
return jsx(DeprecatedContentStyles, _extends({}, props, {
|
|
49
66
|
innerRef: ref,
|
|
50
|
-
featureFlags: featureFlags
|
|
67
|
+
featureFlags: featureFlags,
|
|
68
|
+
css: memoizedStyle
|
|
51
69
|
}));
|
|
52
70
|
});
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -12,7 +12,7 @@ export { isEmptyParagraph, hasVisibleContent, isNodeEmpty, isEmptyDocument, proc
|
|
|
12
12
|
export { cascadeCommands, getEditorValueWithMedia } from './action';
|
|
13
13
|
export { isMarkAllowedInRange, isMarkExcluded, removeBlockMarks, sanitiseSelectionMarksForWrapping, sanitiseMarksInSelection } from './mark';
|
|
14
14
|
export { isParagraph, isText, isLinkMark, validateNodes } from './nodes';
|
|
15
|
-
export {
|
|
15
|
+
export { normaliseNestedLayout, setNodeSelection, setAllSelection, setGapCursorSelection, setCellSelection, setTextSelection, isValidPosition } from './selection';
|
|
16
16
|
export { containsClassName } from './dom';
|
|
17
17
|
export { default as measurements } from './performance/measure-enum';
|
|
18
18
|
|
package/dist/esm/utils/insert.js
CHANGED
|
@@ -4,7 +4,7 @@ import { NodeSelection, Selection } from 'prosemirror-state';
|
|
|
4
4
|
import { ReplaceStep, ReplaceAroundStep } from 'prosemirror-transform';
|
|
5
5
|
import { isEmptyParagraph } from './document';
|
|
6
6
|
import { GapCursorSelection, Side } from '../plugins/selection/gap-cursor-selection';
|
|
7
|
-
import {
|
|
7
|
+
import { normaliseNestedLayout } from './selection';
|
|
8
8
|
export var LookDirection;
|
|
9
9
|
|
|
10
10
|
(function (LookDirection) {
|
|
@@ -167,15 +167,7 @@ export var insertSelectedItem = function insertSelectedItem(maybeNode) {
|
|
|
167
167
|
*/
|
|
168
168
|
} else if (node.isInline || isInputFragment) {
|
|
169
169
|
var fragment = isInputFragment ? node : Fragment.fromArray([node, state.schema.text(' ')]);
|
|
170
|
-
tr = tr.replaceWith(start, start, fragment);
|
|
171
|
-
|
|
172
|
-
if (isChromeWithSelectionBug) {
|
|
173
|
-
var selection = document.getSelection();
|
|
174
|
-
|
|
175
|
-
if (selection) {
|
|
176
|
-
selection.empty();
|
|
177
|
-
}
|
|
178
|
-
}
|
|
170
|
+
tr = tr.replaceWith(start, start, fragment);
|
|
179
171
|
|
|
180
172
|
if (opts.selectInlineNode) {
|
|
181
173
|
// Select inserted node
|
|
@@ -6,7 +6,6 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
6
6
|
|
|
7
7
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
8
8
|
import { NodeSelection, TextSelection, AllSelection } from 'prosemirror-state';
|
|
9
|
-
import { browser } from '@atlaskit/editor-common/utils';
|
|
10
9
|
import { GapCursorSelection } from '../plugins/selection/gap-cursor/selection';
|
|
11
10
|
export var setNodeSelection = function setNodeSelection(view, pos) {
|
|
12
11
|
var state = view.state,
|
|
@@ -62,11 +61,7 @@ export var normaliseNestedLayout = function normaliseNestedLayout(_ref, node) {
|
|
|
62
61
|
}
|
|
63
62
|
|
|
64
63
|
return node;
|
|
65
|
-
};
|
|
66
|
-
// @see: https://bugs.chromium.org/p/chromium/issues/detail?id=740085
|
|
67
|
-
// Chrome >= 58 (desktop only)
|
|
68
|
-
|
|
69
|
-
export var isChromeWithSelectionBug = browser.chrome && !browser.android && browser.chrome_version >= 58;
|
|
64
|
+
};
|
|
70
65
|
export var isSelectionAtStartOfNode = function isSelectionAtStartOfNode($pos, parentNode) {
|
|
71
66
|
if (!parentNode) {
|
|
72
67
|
return false;
|
package/dist/esm/version.json
CHANGED
|
@@ -16,7 +16,7 @@ export interface EditorActionsOptions<T> {
|
|
|
16
16
|
replaceSelection(rawValue: Node | Object | string): boolean;
|
|
17
17
|
appendText(text: string): boolean;
|
|
18
18
|
isDocumentEmpty(): boolean;
|
|
19
|
-
getResolvedEditorState(): Promise<ResolvedEditorState>;
|
|
19
|
+
getResolvedEditorState(): Promise<ResolvedEditorState | undefined>;
|
|
20
20
|
}
|
|
21
21
|
export default class EditorActions<T = any> implements EditorActionsOptions<T> {
|
|
22
22
|
private editorView?;
|
|
@@ -50,5 +50,5 @@ export default class EditorActions<T = any> implements EditorActionsOptions<T> {
|
|
|
50
50
|
* refers to the latest state of editor with confirmed
|
|
51
51
|
* steps.
|
|
52
52
|
*/
|
|
53
|
-
getResolvedEditorState: () => Promise<ResolvedEditorState>;
|
|
53
|
+
getResolvedEditorState: () => Promise<ResolvedEditorState | undefined>;
|
|
54
54
|
}
|
|
@@ -4,7 +4,7 @@ export { toJSON } from './utils';
|
|
|
4
4
|
export { default as Extension } from './plugins/extension/ui/Extension';
|
|
5
5
|
export { default as ExtensionNodeWrapper } from './plugins/extension/ui/Extension/ExtensionNodeWrapper';
|
|
6
6
|
export { ExtensionNode } from './plugins/extension/nodeviews/extension';
|
|
7
|
-
export { pluginKey as tablePluginKey } from './plugins/table/pm-plugins/plugin-
|
|
7
|
+
export { pluginKey as tablePluginKey } from './plugins/table/pm-plugins/plugin-key';
|
|
8
8
|
export declare const EmitterEvents: {
|
|
9
9
|
TABLE_DELETED: string;
|
|
10
10
|
};
|
|
@@ -36,7 +36,6 @@ declare type ListConvertedTrackAEP = TrackAEP<ACTION.CONVERTED, ACTION_SUBJECT.L
|
|
|
36
36
|
} & CommonListAnalyticsAttributes, undefined>;
|
|
37
37
|
declare type ListIndentedAEP = TrackAEP<ACTION.INDENTED, ACTION_SUBJECT.LIST, ACTION_SUBJECT_ID.FORMAT_LIST_BULLET | ACTION_SUBJECT_ID.FORMAT_LIST_NUMBER, {
|
|
38
38
|
inputMethod: INPUT_METHOD;
|
|
39
|
-
canSink?: boolean;
|
|
40
39
|
} & CommonListAnalyticsAttributes, undefined>;
|
|
41
40
|
declare type ListOutdentedAEP = TrackAEP<ACTION.OUTDENTED, ACTION_SUBJECT.LIST, ACTION_SUBJECT_ID.FORMAT_LIST_BULLET | ACTION_SUBJECT_ID.FORMAT_LIST_NUMBER, {
|
|
42
41
|
inputMethod: INPUT_METHOD;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { ThemeProps } from '@atlaskit/theme/types';
|
|
2
|
+
export declare const blocktypeStyles: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
+
import { ThemeProps } from '@atlaskit/theme/types';
|
|
1
2
|
import { HTMLAttributes, ComponentClass } from 'react';
|
|
2
|
-
export declare const
|
|
3
|
-
tagName: string;
|
|
4
|
-
selected?: boolean | undefined;
|
|
5
|
-
}, any, import("react").ClassAttributes<HTMLDivElement> & HTMLAttributes<HTMLDivElement> & {
|
|
6
|
-
tagName: string;
|
|
7
|
-
selected?: boolean | undefined;
|
|
8
|
-
}>;
|
|
3
|
+
export declare const blockTypeMenuItemStyle: (tagName: string, selected?: boolean | undefined) => (themeProps: ThemeProps) => import("@emotion/react").SerializedStyles;
|
|
9
4
|
export declare const KeyboardShortcut: ComponentClass<HTMLAttributes<{}> & {
|
|
10
5
|
selected?: boolean;
|
|
11
6
|
}>;
|
|
@@ -44,7 +44,7 @@ export declare const messages: {
|
|
|
44
44
|
defaultMessage: string;
|
|
45
45
|
description: string;
|
|
46
46
|
};
|
|
47
|
-
|
|
47
|
+
blockTitle: {
|
|
48
48
|
id: string;
|
|
49
49
|
defaultMessage: string;
|
|
50
50
|
description: string;
|
|
@@ -64,7 +64,7 @@ export declare const messages: {
|
|
|
64
64
|
defaultMessage: string;
|
|
65
65
|
description: string;
|
|
66
66
|
};
|
|
67
|
-
|
|
67
|
+
blockDescription: {
|
|
68
68
|
id: string;
|
|
69
69
|
defaultMessage: string;
|
|
70
70
|
description: string;
|
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import type { GlyphProps } from '@atlaskit/icon/types';
|
|
3
|
+
/**
|
|
4
|
+
* Applying `pointer-events: none;` when disabled allows the Tooltip to be displayed
|
|
5
|
+
*/
|
|
6
|
+
export declare const StyledButton: import("styled-components").StyledComponentClass<import("../../floating-toolbar/ui/Button").Props, any, Pick<import("../../floating-toolbar/ui/Button").Props, "title" | "children" | "className" | "tabIndex" | "onFocus" | "onBlur" | "onClick" | "onMouseEnter" | "onMouseLeave" | "icon" | "appearance" | "disabled" | "target" | "iconAfter" | "selected" | "href" | "tooltipContent" | "testId" | "hideTooltipOnClick" | "ariaHasPopup"> & {
|
|
7
|
+
theme?: any;
|
|
8
|
+
}>;
|
|
9
|
+
export interface ButtonOptionProps {
|
|
10
|
+
title: string;
|
|
11
|
+
selected: boolean;
|
|
12
|
+
testId: string;
|
|
13
|
+
disabled: boolean;
|
|
14
|
+
tooltipContent?: string | null;
|
|
15
|
+
onClick: () => void;
|
|
16
|
+
icon: (props: GlyphProps) => JSX.Element;
|
|
17
|
+
}
|
|
2
18
|
export interface LinkToolbarButtonGroupProps {
|
|
19
|
+
options: ButtonOptionProps[];
|
|
3
20
|
}
|
|
4
|
-
declare const LinkToolbarButtonGroup: ({}: LinkToolbarButtonGroupProps) => JSX.Element;
|
|
5
|
-
export default LinkToolbarButtonGroup;
|
|
21
|
+
export declare const LinkToolbarButtonGroup: ({ options, }: LinkToolbarButtonGroupProps) => JSX.Element;
|
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
3
|
+
import type { GlyphProps } from '@atlaskit/icon/types';
|
|
4
|
+
import { Props as DropdownProps } from '../../floating-toolbar/ui/Dropdown';
|
|
5
|
+
export declare const ICON_HEIGHT = 40;
|
|
6
|
+
export declare const ICON_WIDTH = 40;
|
|
7
|
+
interface IconSizeProps {
|
|
8
|
+
width?: number;
|
|
9
|
+
height?: number;
|
|
3
10
|
}
|
|
4
|
-
|
|
5
|
-
|
|
11
|
+
export interface IconDropdownOptionProps {
|
|
12
|
+
title: string;
|
|
13
|
+
description: string;
|
|
14
|
+
selected: boolean;
|
|
15
|
+
disabled: boolean;
|
|
16
|
+
onClick: () => void;
|
|
17
|
+
icon: (props: GlyphProps & IconSizeProps) => JSX.Element;
|
|
18
|
+
testId?: string;
|
|
19
|
+
tooltipContent?: string | null;
|
|
20
|
+
}
|
|
21
|
+
export interface LinkToolbarIconDropdownProps extends DropdownProps {
|
|
22
|
+
options: IconDropdownOptionProps[];
|
|
23
|
+
}
|
|
24
|
+
export declare const LinkToolbarIconDropdown: ({ options, ...rest }: LinkToolbarIconDropdownProps) => jsx.JSX.Element;
|
|
25
|
+
export {};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
1
2
|
import React from 'react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
2
4
|
import { RichMediaLayout } from '@atlaskit/adf-schema';
|
|
3
5
|
import { Props as ResizerProps } from '../../../ui/Resizer/types';
|
|
4
6
|
declare type State = {
|
|
@@ -53,6 +55,6 @@ export default class ResizableEmbedCard extends React.Component<Props, State> {
|
|
|
53
55
|
* and hence we use `style` prop.
|
|
54
56
|
*/
|
|
55
57
|
private getHeightDefiningComponent;
|
|
56
|
-
render(): JSX.Element;
|
|
58
|
+
render(): jsx.JSX.Element;
|
|
57
59
|
}
|
|
58
60
|
export {};
|