@atlaskit/editor-core 161.0.0 → 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 +44 -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 +1 -2
- 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 +1 -2
- 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 +1 -2
- 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,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 */
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
/** @jsx jsx */
|
|
4
|
+
import React, { useMemo } from 'react';
|
|
5
|
+
import { jsx, css, useTheme } from '@emotion/react';
|
|
3
6
|
import styled from 'styled-components';
|
|
4
7
|
import { whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, blockMarksSharedStyles, shadowSharedStyle, dateSharedStyle, tasksAndDecisionsStyles, annotationSharedStyles, smartCardSharedStyles, textColorStyles } from '@atlaskit/editor-common/styles';
|
|
5
8
|
import { editorFontSize } from '@atlaskit/editor-shared-styles';
|
|
@@ -32,10 +35,16 @@ import { smartCardStyles } from '../../plugins/card/styles';
|
|
|
32
35
|
import { dateStyles } from '../../plugins/date/styles';
|
|
33
36
|
import { embedCardStyles } from '../../plugins/card/ui/styled';
|
|
34
37
|
import { useFeatureFlags } from '../../plugins/feature-flags-context';
|
|
35
|
-
|
|
38
|
+
|
|
39
|
+
const contentStyles = props => {
|
|
40
|
+
var _props$featureFlags;
|
|
41
|
+
|
|
42
|
+
return css`
|
|
36
43
|
.ProseMirror {
|
|
37
44
|
outline: none;
|
|
38
|
-
font-size: ${editorFontSize
|
|
45
|
+
font-size: ${editorFontSize({
|
|
46
|
+
theme: props.theme
|
|
47
|
+
})}px;
|
|
39
48
|
${whitespaceSharedStyles};
|
|
40
49
|
${paragraphSharedStyles};
|
|
41
50
|
${listsSharedStyles};
|
|
@@ -43,6 +52,27 @@ const ContentStyles = styled.div`
|
|
|
43
52
|
${shadowSharedStyle};
|
|
44
53
|
}
|
|
45
54
|
|
|
55
|
+
${tableStyles(props)}
|
|
56
|
+
${(_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.codeBlockSyntaxHighlighting ? highlightingCodeBlockStyles(props) : codeBlockStyles(props)}
|
|
57
|
+
|
|
58
|
+
${blocktypeStyles(props)}
|
|
59
|
+
${textFormattingStyles(props)}
|
|
60
|
+
${textColorStyles}
|
|
61
|
+
${mediaStyles}
|
|
62
|
+
${layoutStyles}
|
|
63
|
+
${tasksAndDecisionsStyles}
|
|
64
|
+
${blockMarksSharedStyles}
|
|
65
|
+
${dateSharedStyle}
|
|
66
|
+
${annotationSharedStyles(props)}
|
|
67
|
+
${embedCardStyles}
|
|
68
|
+
|
|
69
|
+
.mediaGroupView-content-wrap ul {
|
|
70
|
+
padding: 0;
|
|
71
|
+
}
|
|
72
|
+
`;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const DeprecatedContentStyles = styled.div`
|
|
46
76
|
.ProseMirror[contenteditable='false'] .taskItemView-content-wrap {
|
|
47
77
|
pointer-events: none;
|
|
48
78
|
opacity: 0.7;
|
|
@@ -64,52 +94,34 @@ const ContentStyles = styled.div`
|
|
|
64
94
|
outline: 2px solid #8cf;
|
|
65
95
|
}
|
|
66
96
|
|
|
67
|
-
${blocktypeStyles}
|
|
68
|
-
${textFormattingStyles}
|
|
69
97
|
${placeholderTextStyles}
|
|
70
98
|
${placeholderStyles}
|
|
71
|
-
${({
|
|
72
|
-
featureFlags
|
|
73
|
-
}) => featureFlags !== null && featureFlags !== void 0 && featureFlags.codeBlockSyntaxHighlighting ? highlightingCodeBlockStyles : codeBlockStyles}
|
|
74
|
-
${textColorStyles}
|
|
75
99
|
${listsStyles}
|
|
76
100
|
${ruleStyles}
|
|
77
|
-
${mediaStyles}
|
|
78
|
-
${layoutStyles}
|
|
79
101
|
${telepointerStyle}
|
|
80
102
|
${gapCursorStyles};
|
|
81
|
-
${tableStyles}
|
|
82
103
|
${panelStyles}
|
|
83
104
|
${fakeCursorStyles}
|
|
84
105
|
${mentionsStyles}
|
|
85
106
|
${({
|
|
86
107
|
featureFlags
|
|
87
108
|
}) => featureFlags !== null && featureFlags !== void 0 && featureFlags.nextEmojiNodeView ? emojiStylesNext : emojiStyles}
|
|
88
|
-
${tasksAndDecisionsStyles}
|
|
89
109
|
${gridStyles}
|
|
90
110
|
${linkStyles}
|
|
91
|
-
${blockMarksSharedStyles}
|
|
92
|
-
${dateSharedStyle}
|
|
93
111
|
${extensionStyles}
|
|
94
112
|
${expandStyles}
|
|
95
113
|
${findReplaceStyles}
|
|
96
114
|
${taskDecisionStyles}
|
|
97
115
|
${statusStyles}
|
|
98
|
-
${annotationSharedStyles}
|
|
99
116
|
${smartCardStyles}
|
|
100
117
|
${smartCardSharedStyles}
|
|
101
118
|
${dateStyles}
|
|
102
|
-
${embedCardStyles}
|
|
103
119
|
${unsupportedStyles}
|
|
104
120
|
|
|
105
121
|
.panelView-content-wrap {
|
|
106
122
|
box-sizing: border-box;
|
|
107
123
|
}
|
|
108
124
|
|
|
109
|
-
.mediaGroupView-content-wrap ul {
|
|
110
|
-
padding: 0;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
125
|
/** Needed to override any cleared floats, e.g. image wrapping */
|
|
114
126
|
|
|
115
127
|
div.fabric-editor-block-mark[class^='fabric-editor-align'] {
|
|
@@ -154,8 +166,18 @@ const ContentStyles = styled.div`
|
|
|
154
166
|
`;
|
|
155
167
|
export default /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
156
168
|
const featureFlags = useFeatureFlags();
|
|
157
|
-
|
|
169
|
+
const {
|
|
170
|
+
allowAnnotation
|
|
171
|
+
} = props;
|
|
172
|
+
const theme = useTheme();
|
|
173
|
+
const memoizedStyle = useMemo(() => contentStyles({
|
|
174
|
+
theme,
|
|
175
|
+
allowAnnotation,
|
|
176
|
+
featureFlags
|
|
177
|
+
}), [theme, featureFlags, allowAnnotation]);
|
|
178
|
+
return jsx(DeprecatedContentStyles, _extends({}, props, {
|
|
158
179
|
innerRef: ref,
|
|
159
|
-
featureFlags: featureFlags
|
|
180
|
+
featureFlags: featureFlags,
|
|
181
|
+
css: memoizedStyle
|
|
160
182
|
}));
|
|
161
183
|
});
|
|
@@ -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
|
|
|
@@ -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 let LookDirection;
|
|
9
9
|
|
|
10
10
|
(function (LookDirection) {
|
|
@@ -165,15 +165,7 @@ export const insertSelectedItem = (maybeNode, opts = {}) => (state, tr, start) =
|
|
|
165
165
|
*/
|
|
166
166
|
} else if (node.isInline || isInputFragment) {
|
|
167
167
|
const fragment = isInputFragment ? node : Fragment.fromArray([node, state.schema.text(' ')]);
|
|
168
|
-
tr = tr.replaceWith(start, start, fragment);
|
|
169
|
-
|
|
170
|
-
if (isChromeWithSelectionBug) {
|
|
171
|
-
const selection = document.getSelection();
|
|
172
|
-
|
|
173
|
-
if (selection) {
|
|
174
|
-
selection.empty();
|
|
175
|
-
}
|
|
176
|
-
}
|
|
168
|
+
tr = tr.replaceWith(start, start, fragment);
|
|
177
169
|
|
|
178
170
|
if (opts.selectInlineNode) {
|
|
179
171
|
// Select inserted node
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
2
2
|
import { NodeSelection, TextSelection, AllSelection } from 'prosemirror-state';
|
|
3
|
-
import { browser } from '@atlaskit/editor-common/utils';
|
|
4
3
|
import { GapCursorSelection } from '../plugins/selection/gap-cursor/selection';
|
|
5
4
|
export const setNodeSelection = (view, pos) => {
|
|
6
5
|
const {
|
|
@@ -66,11 +65,7 @@ export const normaliseNestedLayout = ({
|
|
|
66
65
|
}
|
|
67
66
|
|
|
68
67
|
return node;
|
|
69
|
-
};
|
|
70
|
-
// @see: https://bugs.chromium.org/p/chromium/issues/detail?id=740085
|
|
71
|
-
// Chrome >= 58 (desktop only)
|
|
72
|
-
|
|
73
|
-
export const isChromeWithSelectionBug = browser.chrome && !browser.android && browser.chrome_version >= 58;
|
|
68
|
+
};
|
|
74
69
|
export const isSelectionAtStartOfNode = ($pos, parentNode) => {
|
|
75
70
|
if (!parentNode) {
|
|
76
71
|
return false;
|
package/dist/es2019/version.json
CHANGED