@atlaskit/editor-core 159.0.1 → 162.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 +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 +1 -1
- 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/FloatingContextualMenu/index.js +3 -1
- package/dist/cjs/plugins/table/ui/FloatingInsertButton/index.js +1 -1
- package/dist/cjs/plugins/table/ui/LayoutButton/index.js +47 -8
- package/dist/cjs/plugins/table/ui/common-styles.css.js +17 -8
- package/dist/cjs/plugins/table/ui/ui-styles.css.js +39 -25
- 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 +1 -1
- package/dist/cjs/ui/Appearance/FullPage/StyledComponents.js +1 -1
- package/dist/cjs/ui/ContentStyles/index.js +32 -9
- 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/FloatingContextualMenu/index.js +2 -1
- package/dist/es2019/plugins/table/ui/FloatingInsertButton/index.js +1 -1
- package/dist/es2019/plugins/table/ui/LayoutButton/index.js +41 -8
- package/dist/es2019/plugins/table/ui/common-styles.css.js +51 -26
- package/dist/es2019/plugins/table/ui/ui-styles.css.js +57 -56
- 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 +45 -23
- 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/FloatingContextualMenu/index.js +2 -1
- package/dist/esm/plugins/table/ui/FloatingInsertButton/index.js +1 -1
- package/dist/esm/plugins/table/ui/LayoutButton/index.js +43 -8
- package/dist/esm/plugins/table/ui/common-styles.css.js +10 -6
- package/dist/esm/plugins/table/ui/ui-styles.css.js +20 -11
- 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 +27 -9
- 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/LayoutButton/index.d.ts +0 -1
- package/dist/types/plugins/table/ui/common-styles.css.d.ts +6 -3
- package/dist/types/plugins/table/ui/ui-styles.css.d.ts +15 -14
- 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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { css } from '
|
|
1
|
+
import { css } from '@emotion/react';
|
|
2
2
|
import { tableCellBorderWidth, tableMarginBottom, tableMarginTop } from '@atlaskit/editor-common/styles';
|
|
3
3
|
import { akEditorShadowZIndex, akEditorTableNumberColumnWidth, akEditorUnitZIndex } from '@atlaskit/editor-shared-styles';
|
|
4
4
|
import { N40A, B300, N300, R300, N20A, N60A, N0, Y50, Y200 } from '@atlaskit/theme/colors';
|
|
@@ -16,17 +16,18 @@ const InsertLine = cssString => css`
|
|
|
16
16
|
}
|
|
17
17
|
`;
|
|
18
18
|
|
|
19
|
-
const Marker = css`
|
|
20
|
-
background-color: ${tableBorderColor};
|
|
19
|
+
const Marker = props => css`
|
|
20
|
+
background-color: ${tableBorderColor(props)};
|
|
21
21
|
position: absolute;
|
|
22
22
|
height: ${lineMarkerSize}px;
|
|
23
23
|
width: ${lineMarkerSize}px;
|
|
24
24
|
border-radius: 50%;
|
|
25
25
|
pointer-events: none;
|
|
26
26
|
`;
|
|
27
|
-
|
|
27
|
+
|
|
28
|
+
export const InsertMarker = (props, cssString) => css`
|
|
28
29
|
.${ClassName.CONTROLS_INSERT_MARKER} {
|
|
29
|
-
${Marker};
|
|
30
|
+
${Marker(props)};
|
|
30
31
|
${cssString}
|
|
31
32
|
}
|
|
32
33
|
`;
|
|
@@ -52,10 +53,10 @@ const Button = cssString => css`
|
|
|
52
53
|
${cssString}
|
|
53
54
|
`;
|
|
54
55
|
|
|
55
|
-
export const HeaderButton = cssString => css`
|
|
56
|
+
export const HeaderButton = (props, cssString) => css`
|
|
56
57
|
.${ClassName.CONTROLS_BUTTON} {
|
|
57
|
-
background: ${tableToolbarColor};
|
|
58
|
-
border: 1px solid ${tableBorderColor};
|
|
58
|
+
background: ${tableToolbarColor(props)};
|
|
59
|
+
border: 1px solid ${tableBorderColor(props)};
|
|
59
60
|
display: block;
|
|
60
61
|
box-sizing: border-box;
|
|
61
62
|
padding: 0;
|
|
@@ -151,14 +152,14 @@ export const insertRowButtonWrapper = css`
|
|
|
151
152
|
left: ${tableInsertColumnButtonSize - 1}px;
|
|
152
153
|
`)}
|
|
153
154
|
`;
|
|
154
|
-
export const columnControlsLineMarker = css`
|
|
155
|
+
export const columnControlsLineMarker = props => css`
|
|
155
156
|
.${ClassName.TABLE_CONTAINER}.${ClassName.WITH_CONTROLS} table tr:first-child td,
|
|
156
157
|
.${ClassName.TABLE_CONTAINER}.${ClassName.WITH_CONTROLS} table tr:first-child th {
|
|
157
158
|
position: relative;
|
|
158
159
|
|
|
159
160
|
&::before {
|
|
160
161
|
content: ' ';
|
|
161
|
-
${Marker};
|
|
162
|
+
${Marker(props)};
|
|
162
163
|
top: -${tableToolbarSize + lineMarkerOffsetFromColumnControls}px;
|
|
163
164
|
right: -${lineMarkerSize / 2}px;
|
|
164
165
|
}
|
|
@@ -185,57 +186,57 @@ export const DeleteButton = css`
|
|
|
185
186
|
cursor: pointer;
|
|
186
187
|
}
|
|
187
188
|
`;
|
|
188
|
-
export const OverflowShadow = css`
|
|
189
|
-
.${ClassName.TABLE_RIGHT_SHADOW},
|
|
190
|
-
.${ClassName.TABLE_LEFT_SHADOW}{
|
|
191
|
-
display: block;
|
|
192
|
-
height: calc(100% - ${tableMarginTop + tableMarginBottom + tableToolbarSize - 2}px);
|
|
193
|
-
position: absolute;
|
|
194
|
-
pointer-events: none;
|
|
195
|
-
top: ${tableMarginTop + tableToolbarSize - 1}px;
|
|
196
|
-
z-index: ${akEditorShadowZIndex};
|
|
197
|
-
width: 8px;
|
|
198
|
-
}
|
|
199
|
-
.${ClassName.TABLE_LEFT_SHADOW} {
|
|
200
|
-
background: linear-gradient(
|
|
201
|
-
to left,
|
|
202
|
-
rgba(99, 114, 130, 0) 0,
|
|
203
|
-
${N40A} 100%
|
|
204
|
-
);
|
|
205
|
-
left: 0px;
|
|
206
|
-
}
|
|
207
|
-
.${ClassName.TABLE_CONTAINER}[data-number-column='true'] > :not(.${ClassName.TABLE_STICKY_SHADOW}).${ClassName.TABLE_LEFT_SHADOW} {
|
|
208
|
-
left: ${akEditorTableNumberColumnWidth - 1}px;
|
|
209
|
-
}
|
|
210
|
-
.${ClassName.TABLE_RIGHT_SHADOW} {
|
|
211
|
-
background: linear-gradient(
|
|
212
|
-
to right,
|
|
213
|
-
rgba(99, 114, 130, 0) 0,
|
|
214
|
-
${N40A} 100%
|
|
215
|
-
);
|
|
216
|
-
left: calc(100% + 2px);
|
|
217
|
-
}
|
|
218
|
-
.${ClassName.WITH_CONTROLS} {
|
|
189
|
+
export const OverflowShadow = props => css`
|
|
219
190
|
.${ClassName.TABLE_RIGHT_SHADOW},
|
|
220
191
|
.${ClassName.TABLE_LEFT_SHADOW}{
|
|
221
|
-
|
|
222
|
-
|
|
192
|
+
display: block;
|
|
193
|
+
height: calc(100% - ${tableMarginTop + tableMarginBottom + tableToolbarSize - 2}px);
|
|
194
|
+
position: absolute;
|
|
195
|
+
pointer-events: none;
|
|
196
|
+
top: ${tableMarginTop + tableToolbarSize - 1}px;
|
|
197
|
+
z-index: ${akEditorShadowZIndex};
|
|
198
|
+
width: 8px;
|
|
223
199
|
}
|
|
224
200
|
.${ClassName.TABLE_LEFT_SHADOW} {
|
|
225
|
-
|
|
201
|
+
background: linear-gradient(
|
|
202
|
+
to left,
|
|
203
|
+
rgba(99, 114, 130, 0) 0,
|
|
204
|
+
${N40A} 100%
|
|
205
|
+
);
|
|
206
|
+
left: 0px;
|
|
226
207
|
}
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
.${ClassName.
|
|
231
|
-
|
|
208
|
+
.${ClassName.TABLE_CONTAINER}[data-number-column='true'] > :not(.${ClassName.TABLE_STICKY_SHADOW}).${ClassName.TABLE_LEFT_SHADOW} {
|
|
209
|
+
left: ${akEditorTableNumberColumnWidth - 1}px;
|
|
210
|
+
}
|
|
211
|
+
.${ClassName.TABLE_RIGHT_SHADOW} {
|
|
212
|
+
background: linear-gradient(
|
|
213
|
+
to right,
|
|
214
|
+
rgba(99, 114, 130, 0) 0,
|
|
215
|
+
${N40A} 100%
|
|
216
|
+
);
|
|
217
|
+
left: calc(100% + 2px);
|
|
218
|
+
}
|
|
219
|
+
.${ClassName.WITH_CONTROLS} {
|
|
220
|
+
.${ClassName.TABLE_RIGHT_SHADOW},
|
|
221
|
+
.${ClassName.TABLE_LEFT_SHADOW}{
|
|
222
|
+
height: calc(100% - ${tableMarginTop + tableMarginBottom - 2}px);
|
|
223
|
+
top: ${tableMarginTop - 1}px;
|
|
224
|
+
}
|
|
225
|
+
.${ClassName.TABLE_LEFT_SHADOW} {
|
|
226
|
+
border-left: 1px solid ${tableBorderColor(props)};
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
.${ClassName.WITH_CONTROLS}.${ClassName.TABLE_STICKY} {
|
|
230
|
+
.${ClassName.TABLE_RIGHT_SHADOW},
|
|
231
|
+
.${ClassName.TABLE_LEFT_SHADOW} {
|
|
232
|
+
top: ${tableControlsSpacing}px;
|
|
233
|
+
}
|
|
232
234
|
}
|
|
233
|
-
}
|
|
234
235
|
`;
|
|
235
236
|
|
|
236
|
-
const columnHeaderButton = cssString => css`
|
|
237
|
-
background: ${tableToolbarColor};
|
|
238
|
-
border: 1px solid ${tableBorderColor};
|
|
237
|
+
const columnHeaderButton = (props, cssString) => css`
|
|
238
|
+
background: ${tableToolbarColor(props)};
|
|
239
|
+
border: 1px solid ${tableBorderColor(props)};
|
|
239
240
|
display: block;
|
|
240
241
|
box-sizing: border-box;
|
|
241
242
|
padding: 0;
|
|
@@ -253,7 +254,7 @@ const columnHeaderButtonSelected = css`
|
|
|
253
254
|
border-color: ${tableBorderSelectedColor};
|
|
254
255
|
z-index: ${columnControlsSelectedZIndex};
|
|
255
256
|
`;
|
|
256
|
-
export const columnControlsDecoration = css`
|
|
257
|
+
export const columnControlsDecoration = props => css`
|
|
257
258
|
.${ClassName.COLUMN_CONTROLS_DECORATIONS} {
|
|
258
259
|
display: none;
|
|
259
260
|
cursor: pointer;
|
|
@@ -266,8 +267,8 @@ export const columnControlsDecoration = css`
|
|
|
266
267
|
&::after {
|
|
267
268
|
content: ' ';
|
|
268
269
|
|
|
269
|
-
${columnHeaderButton(`
|
|
270
|
-
border-right: ${tableCellBorderWidth}px solid ${tableBorderColor};
|
|
270
|
+
${columnHeaderButton(props, `
|
|
271
|
+
border-right: ${tableCellBorderWidth}px solid ${tableBorderColor(props)};
|
|
271
272
|
border-bottom: none;
|
|
272
273
|
height: ${tableToolbarSize}px;
|
|
273
274
|
width: 100%;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
2
2
|
import { hasParentNodeOfType } from 'prosemirror-utils';
|
|
3
3
|
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
4
|
-
import { pluginKey } from '../pm-plugins/plugin-
|
|
4
|
+
import { pluginKey } from '../pm-plugins/plugin-key';
|
|
5
5
|
export const isIsolating = node => {
|
|
6
6
|
return !!node.type.spec.isolating;
|
|
7
7
|
};
|
|
8
|
-
export const containsHeaderColumn =
|
|
8
|
+
export const containsHeaderColumn = table => {
|
|
9
9
|
const map = TableMap.get(table); // Get cell positions for first column.
|
|
10
10
|
|
|
11
11
|
const cellPositions = map.cellsInRect({
|
|
@@ -19,7 +19,7 @@ export const containsHeaderColumn = (state, table) => {
|
|
|
19
19
|
try {
|
|
20
20
|
const cell = table.nodeAt(cellPositions[i]);
|
|
21
21
|
|
|
22
|
-
if (cell && cell.type !==
|
|
22
|
+
if (cell && cell.type !== table.type.schema.nodes.tableHeader) {
|
|
23
23
|
return false;
|
|
24
24
|
}
|
|
25
25
|
} catch (e) {
|
|
@@ -29,22 +29,22 @@ export const containsHeaderColumn = (state, table) => {
|
|
|
29
29
|
|
|
30
30
|
return true;
|
|
31
31
|
};
|
|
32
|
-
export const containsHeaderRow =
|
|
32
|
+
export const containsHeaderRow = table => {
|
|
33
33
|
const map = TableMap.get(table);
|
|
34
34
|
|
|
35
35
|
for (let i = 0; i < map.width; i++) {
|
|
36
36
|
const cell = table.nodeAt(map.map[i]);
|
|
37
37
|
|
|
38
|
-
if (cell && cell.type !==
|
|
38
|
+
if (cell && cell.type !== table.type.schema.nodes.tableHeader) {
|
|
39
39
|
return false;
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
return true;
|
|
44
44
|
};
|
|
45
|
-
export const checkIfHeaderColumnEnabled =
|
|
46
|
-
export const checkIfHeaderRowEnabled =
|
|
47
|
-
export const checkIfNumberColumnEnabled =
|
|
45
|
+
export const checkIfHeaderColumnEnabled = selection => filterNearSelection(selection, findTable, containsHeaderColumn, false);
|
|
46
|
+
export const checkIfHeaderRowEnabled = selection => filterNearSelection(selection, findTable, containsHeaderRow, false);
|
|
47
|
+
export const checkIfNumberColumnEnabled = selection => filterNearSelection(selection, findTable, table => !!table.attrs.isNumberColumnEnabled, false);
|
|
48
48
|
export const isLayoutSupported = state => {
|
|
49
49
|
const {
|
|
50
50
|
permittedLayouts
|
|
@@ -78,14 +78,14 @@ export const tablesHaveDifferentNoOfColumns = (currentTable, previousTable) => {
|
|
|
78
78
|
return prevMap.width !== currentMap.width;
|
|
79
79
|
};
|
|
80
80
|
|
|
81
|
-
function filterNearSelection(
|
|
82
|
-
const found = findNode(
|
|
81
|
+
function filterNearSelection(selection, findNode, predicate, defaultValue) {
|
|
82
|
+
const found = findNode(selection);
|
|
83
83
|
|
|
84
84
|
if (!found) {
|
|
85
85
|
return defaultValue;
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
return predicate(
|
|
88
|
+
return predicate(found.node, found.pos);
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
function getTableWidths(node) {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { autoJoin } from 'prosemirror-commands';
|
|
2
|
+
import { NodeRange } from 'prosemirror-model';
|
|
2
3
|
import { TextSelection } from 'prosemirror-state';
|
|
3
4
|
import { findParentNodeOfType, hasParentNodeOfType, replaceParentNodeOfType, safeInsert, setTextSelection } from 'prosemirror-utils';
|
|
5
|
+
import { liftTarget } from 'prosemirror-transform';
|
|
4
6
|
import { uuid } from '@atlaskit/adf-schema';
|
|
5
7
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, addAnalytics, EVENT_TYPE, INPUT_METHOD, USER_CONTEXT } from '../analytics';
|
|
6
8
|
import { GapCursorSelection } from '../selection/gap-cursor-selection';
|
|
@@ -234,6 +236,14 @@ export const createListAtSelection = (tr, list, item, schema, state, listLocalId
|
|
|
234
236
|
}, [item.create({
|
|
235
237
|
localId: uuid.generate()
|
|
236
238
|
}, $from.node($from.depth).content)]);
|
|
239
|
+
const hasBlockquoteParent = findParentNodeOfType(blockquote)(selection);
|
|
240
|
+
|
|
241
|
+
if (hasBlockquoteParent) {
|
|
242
|
+
const liftedDepth = $from.depth - 1;
|
|
243
|
+
const range = new NodeRange($from, $to, liftedDepth);
|
|
244
|
+
tr.lift(range, liftTarget(range));
|
|
245
|
+
}
|
|
246
|
+
|
|
237
247
|
const listParent = findParentNodeOfType(taskList)(selection) || findParentNodeOfType(decisionList)(selection);
|
|
238
248
|
const listItem = findParentNodeOfType(taskItem)(selection) || findParentNodeOfType(decisionItem)(selection); // For a selection inside a task/decision list, we can't just simply replace the
|
|
239
249
|
// node type as it will mess up lists with > 1 item
|
|
@@ -265,10 +275,12 @@ export const createListAtSelection = (tr, list, item, schema, state, listLocalId
|
|
|
265
275
|
|
|
266
276
|
const nodeTypesToReplace = [blockquote];
|
|
267
277
|
|
|
268
|
-
if (nodeType === paragraph && childCount > 0) {
|
|
278
|
+
if (nodeType === paragraph && childCount > 0 || hasBlockquoteParent) {
|
|
269
279
|
// Only convert paragraphs containing content.
|
|
270
280
|
// Empty paragraphs use the default flow.
|
|
271
281
|
// This distinction ensures the text selection remains in the correct location.
|
|
282
|
+
// We also want to replace the paragraph type when we are inside a blockQuote
|
|
283
|
+
// to avoid inserting an extra taskList whilst keeping the paragraph
|
|
272
284
|
nodeTypesToReplace.push(paragraph);
|
|
273
285
|
}
|
|
274
286
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { css } from '
|
|
1
|
+
import { css } from '@emotion/react';
|
|
2
2
|
import { codeMarkSharedStyles } from '@atlaskit/editor-common/styles';
|
|
3
|
-
export const textFormattingStyles = css`
|
|
4
|
-
${codeMarkSharedStyles}
|
|
3
|
+
export const textFormattingStyles = props => css`
|
|
4
|
+
${codeMarkSharedStyles(props)}
|
|
5
5
|
`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useMemo } from 'react';
|
|
1
|
+
import React, { useMemo, useState, useEffect } from 'react';
|
|
2
2
|
import { injectIntl } from 'react-intl-next';
|
|
3
3
|
import { Separator, Wrapper, ButtonGroup } from '../../../../ui/styles';
|
|
4
4
|
import { useFormattingIcons, useHasFormattingActived } from './hooks/formatting-icons';
|
|
@@ -8,6 +8,8 @@ import { SingleToolbarButtons } from './single-toolbar-buttons';
|
|
|
8
8
|
import { MoreButton } from './more-button';
|
|
9
9
|
import { FormattingTextDropdownMenu } from './dropdown-menu';
|
|
10
10
|
import { toolbarMessages } from './toolbar-messages';
|
|
11
|
+
import { usePreviousObjectState, compareItemsArrays, isArrayContainsContent } from '../../utils';
|
|
12
|
+
import Announcer from '../../../../utils/announcer/announcer';
|
|
11
13
|
|
|
12
14
|
const ToolbarFormatting = ({
|
|
13
15
|
shouldUseResponsiveToolbar,
|
|
@@ -21,6 +23,7 @@ const ToolbarFormatting = ({
|
|
|
21
23
|
intl
|
|
22
24
|
}) => {
|
|
23
25
|
const editorState = useMemo(() => editorView.state, [editorView.state]);
|
|
26
|
+
const [message, setMessage] = useState('');
|
|
24
27
|
const defaultIcons = useFormattingIcons({
|
|
25
28
|
editorState,
|
|
26
29
|
intl,
|
|
@@ -46,6 +49,52 @@ const ToolbarFormatting = ({
|
|
|
46
49
|
toolbarSize,
|
|
47
50
|
responsivenessEnabled: shouldUseResponsiveToolbar
|
|
48
51
|
});
|
|
52
|
+
const clearFormattingStatus = intl.formatMessage(toolbarMessages.textFormattingOff);
|
|
53
|
+
const superscriptOffSubscriptOnStatus = intl.formatMessage(toolbarMessages.superscriptOffSubscriptOn);
|
|
54
|
+
const subscriptOffSuperscriptOnStatus = intl.formatMessage(toolbarMessages.subscriptOffSuperscriptOn);
|
|
55
|
+
const activeItems = [...dropdownItems, ...singleItems].filter(item => item.isActive);
|
|
56
|
+
const prevActiveItems = usePreviousObjectState(activeItems);
|
|
57
|
+
const fromSuperscriptToSubscript = isArrayContainsContent(activeItems, 'Subscript') && isArrayContainsContent(prevActiveItems, 'Superscript');
|
|
58
|
+
const fromSubscriptToSuperscript = isArrayContainsContent(activeItems, 'Superscript') && isArrayContainsContent(prevActiveItems, 'Subscript');
|
|
59
|
+
let comparedItems;
|
|
60
|
+
let screenReaderMessage = '';
|
|
61
|
+
|
|
62
|
+
if (prevActiveItems && activeItems.length > prevActiveItems.length) {
|
|
63
|
+
comparedItems = compareItemsArrays(activeItems, prevActiveItems);
|
|
64
|
+
screenReaderMessage = intl.formatMessage(toolbarMessages.on, {
|
|
65
|
+
formattingType: comparedItems[0].content
|
|
66
|
+
});
|
|
67
|
+
} else {
|
|
68
|
+
comparedItems = compareItemsArrays(prevActiveItems, activeItems);
|
|
69
|
+
|
|
70
|
+
if (comparedItems && comparedItems.length) {
|
|
71
|
+
var _activeItems$;
|
|
72
|
+
|
|
73
|
+
screenReaderMessage = intl.formatMessage(toolbarMessages.off, {
|
|
74
|
+
formattingType: comparedItems[0].content
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
if (((_activeItems$ = activeItems[0]) === null || _activeItems$ === void 0 ? void 0 : _activeItems$.content) === 'Code') {
|
|
78
|
+
screenReaderMessage = intl.formatMessage(toolbarMessages.codeOn, {
|
|
79
|
+
textFormattingOff: (prevActiveItems === null || prevActiveItems === void 0 ? void 0 : prevActiveItems.length) > 1 ? clearFormattingStatus : screenReaderMessage
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if (fromSuperscriptToSubscript) {
|
|
84
|
+
screenReaderMessage = superscriptOffSubscriptOnStatus;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (fromSubscriptToSuperscript) {
|
|
88
|
+
screenReaderMessage = subscriptOffSuperscriptOnStatus;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
} // handle 'Clear formatting' status for screen readers
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
if (!(activeItems !== null && activeItems !== void 0 && activeItems.length) && (prevActiveItems === null || prevActiveItems === void 0 ? void 0 : prevActiveItems.length) > 1) {
|
|
95
|
+
screenReaderMessage = clearFormattingStatus;
|
|
96
|
+
}
|
|
97
|
+
|
|
49
98
|
const items = useMemo(() => {
|
|
50
99
|
if (!clearIcon) {
|
|
51
100
|
return dropdownItems;
|
|
@@ -54,9 +103,19 @@ const ToolbarFormatting = ({
|
|
|
54
103
|
return [...dropdownItems, clearIcon];
|
|
55
104
|
}, [clearIcon, dropdownItems]);
|
|
56
105
|
const moreFormattingButtonLabel = intl.formatMessage(toolbarMessages.moreFormatting);
|
|
106
|
+
useEffect(() => {
|
|
107
|
+
if (screenReaderMessage) {
|
|
108
|
+
setMessage(screenReaderMessage);
|
|
109
|
+
}
|
|
110
|
+
}, [screenReaderMessage]);
|
|
57
111
|
return /*#__PURE__*/React.createElement(ButtonGroup, {
|
|
58
112
|
width: isReducedSpacing ? 'small' : 'large'
|
|
59
|
-
}, /*#__PURE__*/React.createElement(
|
|
113
|
+
}, message && /*#__PURE__*/React.createElement(Announcer, {
|
|
114
|
+
ariaLive: "assertive",
|
|
115
|
+
text: message,
|
|
116
|
+
ariaRelevant: "additions",
|
|
117
|
+
delay: 250
|
|
118
|
+
}), /*#__PURE__*/React.createElement(SingleToolbarButtons, {
|
|
60
119
|
items: singleItems,
|
|
61
120
|
editorView: editorView,
|
|
62
121
|
isReducedSpacing: isReducedSpacing
|
|
@@ -15,16 +15,31 @@ export const 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 const 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 const nodeLen = node => {
|
|
@@ -131,4 +132,15 @@ const marksArePresent = state => {
|
|
|
131
132
|
|
|
132
133
|
export const checkFormattingIsPresent = state => {
|
|
133
134
|
return marksArePresent(state) || blockStylingIsPresent(state);
|
|
134
|
-
};
|
|
135
|
+
};
|
|
136
|
+
export const usePreviousObjectState = value => {
|
|
137
|
+
const ref = useRef();
|
|
138
|
+
useEffect(() => {
|
|
139
|
+
ref.current = value;
|
|
140
|
+
});
|
|
141
|
+
return ref.current;
|
|
142
|
+
};
|
|
143
|
+
export const compareItemsArrays = (items, prevItems) => {
|
|
144
|
+
return items && items.filter(item => !prevItems.includes(item));
|
|
145
|
+
};
|
|
146
|
+
export const isArrayContainsContent = (items, content) => items.filter(item => item.content === content).length > 0;
|
|
@@ -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';
|
|
@@ -203,6 +203,35 @@ const currentQuery = ({
|
|
|
203
203
|
return getTypeAheadQuery(editorView.state);
|
|
204
204
|
};
|
|
205
205
|
|
|
206
|
+
const find = ({
|
|
207
|
+
editorView
|
|
208
|
+
}) => trigger => {
|
|
209
|
+
const {
|
|
210
|
+
state: editorState
|
|
211
|
+
} = editorView;
|
|
212
|
+
const handler = findHandlerByTrigger({
|
|
213
|
+
trigger,
|
|
214
|
+
editorState
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
if (!handler) {
|
|
218
|
+
return null;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
return handler;
|
|
222
|
+
}; // This is an internal tool to be used inside of others Editor Plugins
|
|
223
|
+
// We shouldn't public export this method.
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
export const createInternalTypeAheadTools = editorView => {
|
|
227
|
+
const props = {
|
|
228
|
+
editorView
|
|
229
|
+
};
|
|
230
|
+
return {
|
|
231
|
+
findTypeAheadHandler: find(props),
|
|
232
|
+
openTypeAheadHandler: openTypeAhead
|
|
233
|
+
};
|
|
234
|
+
};
|
|
206
235
|
export const createTypeAheadTools = editorView => {
|
|
207
236
|
const props = {
|
|
208
237
|
editorView
|
|
@@ -1,11 +1,12 @@
|
|
|
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 const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
export const openTypeAhead = props => tr => {
|
|
5
|
+
const {
|
|
6
|
+
triggerHandler,
|
|
7
|
+
inputMethod,
|
|
8
|
+
query
|
|
9
|
+
} = props;
|
|
9
10
|
tr.setMeta(pluginKey, {
|
|
10
11
|
action: ACTIONS.OPEN_TYPEAHEAD_AT_CURSOR,
|
|
11
12
|
params: {
|
|
@@ -14,6 +15,17 @@ export const openTypeAheadAtCursor = ({
|
|
|
14
15
|
query
|
|
15
16
|
}
|
|
16
17
|
});
|
|
18
|
+
};
|
|
19
|
+
export const openTypeAheadAtCursor = ({
|
|
20
|
+
triggerHandler,
|
|
21
|
+
inputMethod,
|
|
22
|
+
query
|
|
23
|
+
}) => tr => {
|
|
24
|
+
openTypeAhead({
|
|
25
|
+
triggerHandler,
|
|
26
|
+
inputMethod,
|
|
27
|
+
query
|
|
28
|
+
})(tr);
|
|
17
29
|
const {
|
|
18
30
|
selection
|
|
19
31
|
} = tr;
|
|
@@ -64,6 +64,21 @@ export const findHandler = (id, state) => {
|
|
|
64
64
|
} = pluginState;
|
|
65
65
|
return typeAheadHandlers.find(h => h.id === id) || null;
|
|
66
66
|
};
|
|
67
|
+
export const findHandlerByTrigger = ({
|
|
68
|
+
trigger,
|
|
69
|
+
editorState
|
|
70
|
+
}) => {
|
|
71
|
+
const pluginState = typeAheadPluginKey.getState(editorState);
|
|
72
|
+
|
|
73
|
+
if (!pluginState || !pluginState.typeAheadHandlers || pluginState.typeAheadHandlers.length === 0) {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const {
|
|
78
|
+
typeAheadHandlers
|
|
79
|
+
} = pluginState;
|
|
80
|
+
return typeAheadHandlers.find(h => h.trigger === trigger) || null;
|
|
81
|
+
};
|
|
67
82
|
export const moveSelectedIndex = ({
|
|
68
83
|
editorView,
|
|
69
84
|
direction
|
|
@@ -12,7 +12,7 @@ import ContentStyles from '../../ContentStyles';
|
|
|
12
12
|
import { pluginKey as maxContentSizePluginKey } from '../../../plugins/max-content-size';
|
|
13
13
|
import { stateKey as mediaPluginKey } from '../../../plugins/media/pm-plugins/plugin-key';
|
|
14
14
|
import { ClickAreaBlock } from '../../Addon';
|
|
15
|
-
import {
|
|
15
|
+
import { deprecatedTableCommentEditorStyles } from '../../../plugins/table/ui/common-styles.css';
|
|
16
16
|
import WithFlash from '../../WithFlash';
|
|
17
17
|
import { WidthConsumer } from '@atlaskit/editor-common/ui';
|
|
18
18
|
import { akEditorMobileBreakoutPoint } from '@atlaskit/editor-shared-styles';
|
|
@@ -67,7 +67,7 @@ const ContentArea = styled(ContentStyles)`
|
|
|
67
67
|
|
|
68
68
|
padding: ${TableControlsPadding}px;
|
|
69
69
|
|
|
70
|
-
${
|
|
70
|
+
${deprecatedTableCommentEditorStyles};
|
|
71
71
|
`;
|
|
72
72
|
ContentArea.displayName = 'ContentArea';
|
|
73
73
|
const SecondaryToolbar = styled.div`
|
|
@@ -2,7 +2,7 @@ import styled from 'styled-components';
|
|
|
2
2
|
import { akEditorFullWidthLayoutWidth, akEditorGutterPadding, akEditorSwoopCubicBezier, akLayoutGutterOffset, ATLASSIAN_NAVIGATION_HEIGHT, akEditorContextPanelWidth } from '@atlaskit/editor-shared-styles';
|
|
3
3
|
import { taskListSelector, decisionListSelector } from '@atlaskit/adf-schema';
|
|
4
4
|
import ContentStyles from '../../ContentStyles';
|
|
5
|
-
import {
|
|
5
|
+
import { deprecatedTableFullPageEditorStyles } from '../../../plugins/table/ui/common-styles.css';
|
|
6
6
|
import { tableMarginFullWidthMode } from '../../../plugins/table/ui/consts';
|
|
7
7
|
import { scrollbarStyles } from '../../styles';
|
|
8
8
|
const SWOOP_ANIMATION = `0.5s ${akEditorSwoopCubicBezier}`;
|
|
@@ -93,7 +93,7 @@ export const EditorContentArea = styled.div`
|
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
${
|
|
96
|
+
${deprecatedTableFullPageEditorStyles};
|
|
97
97
|
|
|
98
98
|
.fabric-editor--full-width-mode {
|
|
99
99
|
/* Full Width Mode styles for ignoring breakout sizes */
|