@atlaskit/editor-core 202.3.3 → 202.4.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 CHANGED
@@ -1,5 +1,25 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 202.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#165765](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/165765)
8
+ [`3f441f30e6507`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3f441f30e6507) -
9
+ Bump adf-schema to 46.0.0
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
15
+ ## 202.3.4
16
+
17
+ ### Patch Changes
18
+
19
+ - [#168706](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/168706)
20
+ [`b1eef0648c061`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b1eef0648c061) -
21
+ [ED-25767] Fix responsiveness difference in editor vs renderer
22
+
3
23
  ## 202.3.3
4
24
 
5
25
  ### Patch Changes
@@ -8,10 +8,10 @@ exports.addMetadataAttributes = void 0;
8
8
  exports.createSchema = createSchema;
9
9
  exports.wrapToDOMProxy = exports.wrapNodeSpecProxy = void 0;
10
10
  var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
11
+ var _schema = require("@atlaskit/adf-schema/schema");
11
12
  var _prosemirrorDomMetadata = require("@atlaskit/editor-common/prosemirror-dom-metadata");
12
13
  var _model = require("@atlaskit/editor-prosemirror/model");
13
14
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
14
- var _sanitizeNodes = require("../utils/sanitizeNodes");
15
15
  var _createEditor = require("./create-editor");
16
16
  var _sortByOrder = require("./sort-by-order");
17
17
  /**
@@ -103,7 +103,7 @@ function createSchema(editorConfig) {
103
103
  }
104
104
  return acc;
105
105
  }, {}));
106
- var nodes = (0, _sanitizeNodes.sanitizeNodes)(editorConfig.nodes.sort((0, _sortByOrder.sortByOrder)('nodes')).reduce(function (acc, node) {
106
+ var nodes = (0, _schema.sanitizeNodes)(editorConfig.nodes.sort((0, _sortByOrder.sortByOrder)('nodes')).reduce(function (acc, node) {
107
107
  if ((0, _platformFeatureFlags.fg)('platform_editor_breakout_use_css')) {
108
108
  acc[node.name] = wrapNodeSpecProxy(node.node);
109
109
  } else {
@@ -25,7 +25,7 @@ var _consts = require("@atlaskit/editor-plugins/table/ui/consts");
25
25
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
26
26
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
27
27
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
28
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11; // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
28
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13; // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
29
29
  var isPreRelease2 = function isPreRelease2() {
30
30
  return (0, _experiments.editorExperiment)('advanced_layouts', true) || (0, _platformFeatureFlags.fg)('platform_editor_advanced_layouts_pre_release_2');
31
31
  };
@@ -58,15 +58,25 @@ var columnSeparatorStyles = function columnSeparatorStyles(viewMode) {
58
58
  };
59
59
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
60
60
  var rowSeparatorStyles = function rowSeparatorStyles(viewMode) {
61
- return (0, _react.css)(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n\t[data-layout-content]::before {\n\t\tcontent: '';\n\t\tborder-top: ", "px solid\n\t\t\t", ";\n\t\tposition: absolute;\n\t\twidth: calc(100% - 32px);\n\t\tmargin-top: -13px;\n\t}\n"])), viewMode === 'view' ? 0 : _editorSharedStyles.akEditorSelectedBorderSize, "var(--ds-border, #091E4224)");
61
+ return (0, _react.css)(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2.default)(["\n\t[data-layout-content]::before {\n\t\tcontent: '';\n\t\tborder-top: ", "px solid\n\t\t\t", ";\n\t\tposition: absolute;\n\t\twidth: calc(100% - 32px);\n\t\tmargin-top: -13px;\n\n\t\t/* clear styles for column separator */\n\t\tborder-left: unset;\n\t\tmargin-left: unset;\n\t\theight: unset;\n\t}\n"])), viewMode === 'view' ? 0 : _editorSharedStyles.akEditorSelectedBorderSize, "var(--ds-border, #091E4224)");
62
+ };
63
+ var layoutWithSeparatorBorderResponsiveStyles = function layoutWithSeparatorBorderResponsiveStyles(breakpoint, viewMode
64
+ // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
65
+ ) {
66
+ return (0, _react.css)(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2.default)(["\n\t&.selected,\n\t&:hover,\n\t&.selected.danger,\n\t&.", ":not(.danger) {\n\t\t[data-layout-column]:not(:first-of-type) {\n\t\t\t", " {\n\t\t\t\t", "\n\t\t\t}\n\t\t}\n\t}\n"])), _editorSharedStyles.akEditorSelectedNodeClassName, (0, _platformFeatureFlags.fg)('platform_editor_advanced_layouts_breakout_resizing') ? "@container editor-area (max-width:".concat(breakpoint, "px)") : "@media screen and (max-width: ".concat(_editorSharedStyles.gridMediumMaxWidth - 1, "px)"), rowSeparatorStyles(viewMode));
62
67
  };
63
68
 
64
69
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
65
70
  var layoutWithSeparatorBorderStyles = function layoutWithSeparatorBorderStyles(viewMode) {
66
- return (0, _react.css)(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2.default)(["\n\t&.selected [data-layout-column]:not(:first-of-type),\n\t&:hover [data-layout-column]:not(:first-of-type) {\n\t\t", " {\n\t\t\t", "\n\t\t}\n\t\t", " {\n\t\t\t", "\n\t\t}\n\t}\n\n\t&.selected.danger\n\t\t", " {\n\t\tbackground-color: ", ";\n\n\t\tbox-shadow: 0 0 0 ", "px\n\t\t\t", ";\n\t\tborder-radius: 4px;\n\t\t[data-layout-column]:not(:first-of-type) {\n\t\t\t", " {\n\t\t\t\t", "\n\t\t\t}\n\t\t\t", " {\n\t\t\t\t", "\n\t\t\t}\n\t\t}\n\t}\n\n\t&.", ":not(.danger)\n\t\t", " {\n\t\tbox-shadow: 0 0 0 ", "px\n\t\t\t", ";\n\t\tborder-radius: 4px;\n\t\tbackground-color: ", ";\n\t\t[data-layout-column] {\n\t\t\t", "\n\t\t\tborder: 0px;\n\t\t\t::before {\n\t\t\t\tbackground-color: transparent;\n\t\t\t}\n\t\t}\n\t\t[data-layout-column]:not(:first-of-type) {\n\t\t\t", " {\n\t\t\t\t", "\n\t\t\t}\n\t\t\t", " {\n\t\t\t\t", "\n\t\t\t}\n\t\t}\n\t}\n"])), (0, _platformFeatureFlags.fg)('platform_editor_advanced_layouts_breakout_resizing') ? "@container layout-area (min-width:".concat(_editorSharedStyles.layoutBreakpointWidth.MEDIUM, "px)") : "\t@media screen and (min-width: ".concat(_editorSharedStyles.gridMediumMaxWidth, "px)"), columnSeparatorStyles(viewMode), (0, _platformFeatureFlags.fg)('platform_editor_advanced_layouts_breakout_resizing') ? "@container layout-area (max-width:".concat(_editorSharedStyles.layoutBreakpointWidth.MEDIUM - 1, "px)") : "@media screen and (max-width: ".concat(_editorSharedStyles.gridMediumMaxWidth - 1, "px)"), rowSeparatorStyles(viewMode), (0, _platformFeatureFlags.fg)('platform_editor_advanced_layouts_breakout_resizing') ? "[data-layout-section]" : "", "var(--ds-background-danger, ".concat(_editorSharedStyles.akEditorDeleteBackground, ")"), viewMode === 'view' ? 0 : _editorSharedStyles.akEditorSelectedBorderSize, _editorSharedStyles.akEditorDeleteBorder, (0, _platformFeatureFlags.fg)('platform_editor_advanced_layouts_breakout_resizing') ? "@container layout-area (min-width:".concat(_editorSharedStyles.layoutBreakpointWidth.MEDIUM, "px)") : "\t@media screen and (min-width: ".concat(_editorSharedStyles.gridMediumMaxWidth, "px)"), columnSeparatorStyles(viewMode), (0, _platformFeatureFlags.fg)('platform_editor_advanced_layouts_breakout_resizing') ? "@container layout-area (max-width:".concat(_editorSharedStyles.layoutBreakpointWidth.MEDIUM - 1, "px)") : "@media screen and (max-width: ".concat(_editorSharedStyles.gridMediumMaxWidth - 1, "px)"), rowSeparatorStyles(viewMode), _editorSharedStyles.akEditorSelectedNodeClassName, (0, _platformFeatureFlags.fg)('platform_editor_advanced_layouts_breakout_resizing') ? "[data-layout-section]" : "", viewMode === 'view' ? 0 : _editorSharedStyles.akEditorSelectedBorderSize, "var(--ds-border-selected, #0C66E4)", "var(--ds-background-selected, #E9F2FF)", (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.Blanket]), (0, _platformFeatureFlags.fg)('platform_editor_advanced_layouts_breakout_resizing') ? "@container layout-area (min-width:".concat(_editorSharedStyles.layoutBreakpointWidth.MEDIUM, "px)") : "\t@media screen and (min-width: ".concat(_editorSharedStyles.gridMediumMaxWidth, "px)"), columnSeparatorStyles(viewMode), (0, _platformFeatureFlags.fg)('platform_editor_advanced_layouts_breakout_resizing') ? "@container layout-area (max-width:".concat(_editorSharedStyles.layoutBreakpointWidth.MEDIUM - 1, "px)") : "@media screen and (max-width: ".concat(_editorSharedStyles.gridMediumMaxWidth - 1, "px)"), rowSeparatorStyles(viewMode));
71
+ return (0, _react.css)(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2.default)(["\n\t&.selected [data-layout-column]:not(:first-of-type),\n\t&:hover [data-layout-column]:not(:first-of-type) {\n\t\t", "\n\t}\n\n\t&.selected.danger\n\t\t", " {\n\t\tbackground-color: ", ";\n\n\t\tbox-shadow: 0 0 0 ", "px\n\t\t\t", ";\n\t\tborder-radius: 4px;\n\t\t[data-layout-column]:not(:first-of-type) {\n\t\t\t", "\n\t\t}\n\t}\n\n\t&.", ":not(.danger)\n\t\t", " {\n\t\tbox-shadow: 0 0 0 ", "px\n\t\t\t", ";\n\t\tborder-radius: 4px;\n\t\tbackground-color: ", ";\n\t\t[data-layout-column] {\n\t\t\t", "\n\t\t\tborder: 0px;\n\t\t\t::before {\n\t\t\t\tbackground-color: transparent;\n\t\t\t}\n\t\t}\n\t\t[data-layout-column]:not(:first-of-type) {\n\t\t\t", "\n\t\t}\n\t}\n"])), columnSeparatorStyles(viewMode), (0, _platformFeatureFlags.fg)('platform_editor_advanced_layouts_breakout_resizing') ? "[data-layout-section]" : "", "var(--ds-background-danger, ".concat(_editorSharedStyles.akEditorDeleteBackground, ")"), viewMode === 'view' ? 0 : _editorSharedStyles.akEditorSelectedBorderSize, _editorSharedStyles.akEditorDeleteBorder, columnSeparatorStyles(viewMode), _editorSharedStyles.akEditorSelectedNodeClassName, (0, _platformFeatureFlags.fg)('platform_editor_advanced_layouts_breakout_resizing') ? "[data-layout-section]" : "", viewMode === 'view' ? 0 : _editorSharedStyles.akEditorSelectedBorderSize, "var(--ds-border-selected, #0C66E4)", "var(--ds-background-selected, #E9F2FF)", (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.Blanket]), columnSeparatorStyles(viewMode));
72
+ };
73
+ var layoutResponsiveStyles = function layoutResponsiveStyles(viewMode) {
74
+ return (// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
75
+ (0, _react.css)(_templateObject12 || (_templateObject12 = (0, _taggedTemplateLiteral2.default)(["\n\t\t/* chosen breakpoints in container queries are to make sure layout responsiveness in editor aligns with renderer */\n\t\t/* not resized layout in full-width editor */\n\t\t.fabric-editor--full-width-mode .ProseMirror {\n\t\t\t> .layoutSectionView-content-wrap {\n\t\t\t\t[data-layout-section] {\n\t\t\t\t\t@container editor-area (max-width:854px) {\n\t\t\t\t\t\tflex-direction: column;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t", "\n\t\t\t}\n\t\t}\n\n\t\t/* not resized layout in fixed-width editor */\n\t\t.ak-editor-content-area:not(.fabric-editor--full-width-mode) .ProseMirror {\n\t\t\t> .layoutSectionView-content-wrap {\n\t\t\t\t[data-layout-section] {\n\t\t\t\t\t@container editor-area (max-width:918px) {\n\t\t\t\t\t\tflex-direction: column;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t", "\n\t\t\t}\n\t\t}\n\n\t\t/* resized layout in full/fixed-width editor */\n\t\t.ProseMirror .fabric-editor-breakout-mark {\n\t\t\t.layoutSectionView-content-wrap {\n\t\t\t\t[data-layout-section] {\n\t\t\t\t\t@container editor-area (max-width:950px) {\n\t\t\t\t\t\tflex-direction: column;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t", "\n\t\t\t}\n\t\t}\n\t"])), layoutWithSeparatorBorderResponsiveStyles(854, viewMode), layoutWithSeparatorBorderResponsiveStyles(918, viewMode), layoutWithSeparatorBorderResponsiveStyles(950, viewMode))
76
+ );
67
77
  };
68
78
 
69
79
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Needs manual remediation
70
80
  var layoutStyles = exports.layoutStyles = function layoutStyles(viewMode) {
71
- return (0, _react.css)(_templateObject11 || (_templateObject11 = (0, _taggedTemplateLiteral2.default)(["\n\t.ProseMirror {\n\t\t", "\n\t\t[data-layout-section] {\n\t\t\t// TODO: Migrate away from gridSize\n\t\t\t// Recommendation: Replace directly with 7px\n\t\t\tmargin: ", " -", "px 0;\n\t\t\ttransition: border-color 0.3s ", ";\n\t\t\tcursor: ", ";\n\n\t\t\t/* Inner cursor located 26px from left */\n\t\t\t[data-layout-column] {\n\t\t\t\tflex: 1;\n\t\t\t\t", "\n\n\t\t\t\tmin-width: 0;\n\t\t\t\t/* disable 4 borders when in view mode and advanced layouts is on */\n\t\t\t\tborder: ", "px\n\t\t\t\t\tsolid ", ";\n\t\t\t\tborder-radius: 4px;\n\t\t\t\tpadding: ", "px\n\t\t\t\t\t", "px;\n\t\t\t\tbox-sizing: border-box;\n\n\t\t\t\t> div {\n\t\t\t\t\t", "\n\n\t\t\t\t\t> .embedCardView-content-wrap:first-of-type .rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t> .mediaSingleView-content-wrap:first-of-type .rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t> .ProseMirror-gapcursor.-right:first-child\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item,\n\t\t\t\t\t> style:first-child\n\t\t\t\t\t\t+ .ProseMirror-gapcursor.-right\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item,\n\t\t\t\t\t> .ProseMirror-gapcursor.-right:first-of-type\n\t\t\t\t\t\t+ .embedCardView-content-wrap\n\t\t\t\t\t\t.rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t> .ProseMirror-gapcursor:first-child\n\t\t\t\t\t\t+ span\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item,\n\t\t\t\t\t> style:first-child\n\t\t\t\t\t\t+ .ProseMirror-gapcursor\n\t\t\t\t\t\t+ span\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t/* Prevent first DecisionWrapper's margin-top: 8px from shifting decisions down\n and shrinking layout's node selectable area (leniency margin) */\n\t\t\t\t\t> [data-node-type='decisionList'] {\n\t\t\t\t\t\tli:first-of-type [data-decision-wrapper] {\n\t\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t/* Make the 'content' fill the entire height of the layout column to allow click\n handler of layout section nodeview to target only data-layout-column */\n\t\t\t\t[data-layout-content] {\n\t\t\t\t\theight: 100%;\n\t\t\t\t\tcursor: text;\n\t\t\t\t\t.mediaGroupView-content-wrap {\n\t\t\t\t\t\tclear: both;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t", "\n\t\t}\n\n\t\t// styles to support borders for layout\n\t\t[data-layout-section],\n\t\t.layoutSectionView-content-wrap {\n\t\t\t", "\n\t\t}\n\t}\n\n\t.fabric-editor--full-width-mode .ProseMirror {\n\t\t[data-layout-section] {\n\t\t\t.", " {\n\t\t\t\tmargin: 0 ", "px;\n\t\t\t}\n\t\t}\n\t}\n\n\t", "\n"])), layoutSectionStyles(), "var(--ds-space-100, 8px)", _editorSharedStyles.akLayoutGutterOffset, _editorSharedStyles.akEditorSwoopCubicBezier, viewMode === 'view' ? 'default' : 'pointer', (0, _platformFeatureFlags.fg)('platform_editor_drag_and_drop_target_v2') ? 'position: relative;' : '', viewMode === 'view' || (0, _experiments.editorExperiment)('advanced_layouts', true) ? 0 : _editorSharedStyles.akEditorSelectedBorderSize, "var(--ds-border, #091E4224)", _styles.LAYOUT_COLUMN_PADDING, _styles.LAYOUT_COLUMN_PADDING + ((0, _experiments.editorExperiment)('nested-dnd', true) ? 8 : 0), firstNodeWithNotMarginTop(), layoutColumnStyles(), (0, _experiments.editorExperiment)('advanced_layouts', true) ? layoutWithSeparatorBorderStyles(viewMode) : layoutBorderStyles(viewMode), _types.TableCssClassName.TABLE_CONTAINER, _consts.tableMarginFullWidthMode, (0, _experiments.editorExperiment)('nested-dnd', true) && !(0, _platformFeatureFlags.fg)('platform_editor_advanced_layouts_breakout_resizing') && ".ak-editor-content-area.appearance-full-page .ProseMirror [data-layout-section] {\n\t\t\t\tmargin: ".concat("var(--ds-space-100, 8px)", " -", _editorSharedStyles.akLayoutGutterOffset + 8, "px 0;\n\t\t\t\t}"));
81
+ return (0, _react.css)(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteral2.default)(["\n\t.ProseMirror {\n\t\t", "\n\t\t[data-layout-section] {\n\t\t\t// TODO: Migrate away from gridSize\n\t\t\t// Recommendation: Replace directly with 7px\n\t\t\tmargin: ", " -", "px 0;\n\t\t\ttransition: border-color 0.3s ", ";\n\t\t\tcursor: ", ";\n\n\t\t\t/* Inner cursor located 26px from left */\n\t\t\t[data-layout-column] {\n\t\t\t\tflex: 1;\n\t\t\t\t", "\n\n\t\t\t\tmin-width: 0;\n\t\t\t\t/* disable 4 borders when in view mode and advanced layouts is on */\n\t\t\t\tborder: ", "px\n\t\t\t\t\tsolid ", ";\n\t\t\t\tborder-radius: 4px;\n\t\t\t\tpadding: ", "px\n\t\t\t\t\t", "px;\n\t\t\t\tbox-sizing: border-box;\n\n\t\t\t\t> div {\n\t\t\t\t\t", "\n\n\t\t\t\t\t> .embedCardView-content-wrap:first-of-type .rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t> .mediaSingleView-content-wrap:first-of-type .rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t> .ProseMirror-gapcursor.-right:first-child\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item,\n\t\t\t\t\t> style:first-child\n\t\t\t\t\t\t+ .ProseMirror-gapcursor.-right\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item,\n\t\t\t\t\t> .ProseMirror-gapcursor.-right:first-of-type\n\t\t\t\t\t\t+ .embedCardView-content-wrap\n\t\t\t\t\t\t.rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t> .ProseMirror-gapcursor:first-child\n\t\t\t\t\t\t+ span\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item,\n\t\t\t\t\t> style:first-child\n\t\t\t\t\t\t+ .ProseMirror-gapcursor\n\t\t\t\t\t\t+ span\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t/* Prevent first DecisionWrapper's margin-top: 8px from shifting decisions down\n and shrinking layout's node selectable area (leniency margin) */\n\t\t\t\t\t> [data-node-type='decisionList'] {\n\t\t\t\t\t\tli:first-of-type [data-decision-wrapper] {\n\t\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t/* Make the 'content' fill the entire height of the layout column to allow click\n handler of layout section nodeview to target only data-layout-column */\n\t\t\t\t[data-layout-content] {\n\t\t\t\t\theight: 100%;\n\t\t\t\t\tcursor: text;\n\t\t\t\t\t.mediaGroupView-content-wrap {\n\t\t\t\t\t\tclear: both;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t", "\n\t\t}\n\n\t\t// styles to support borders for layout\n\t\t[data-layout-section],\n\t\t.layoutSectionView-content-wrap {\n\t\t\t", "\n\t\t}\n\t}\n\n\t", "\n\n\t.fabric-editor--full-width-mode .ProseMirror {\n\t\t[data-layout-section] {\n\t\t\t.", " {\n\t\t\t\tmargin: 0 ", "px;\n\t\t\t}\n\t\t}\n\t}\n\n\t", "\n"])), layoutSectionStyles(), "var(--ds-space-100, 8px)", _editorSharedStyles.akLayoutGutterOffset, _editorSharedStyles.akEditorSwoopCubicBezier, viewMode === 'view' ? 'default' : 'pointer', (0, _platformFeatureFlags.fg)('platform_editor_drag_and_drop_target_v2') ? 'position: relative;' : '', viewMode === 'view' || (0, _experiments.editorExperiment)('advanced_layouts', true) ? 0 : _editorSharedStyles.akEditorSelectedBorderSize, "var(--ds-border, #091E4224)", _styles.LAYOUT_COLUMN_PADDING, _styles.LAYOUT_COLUMN_PADDING + ((0, _experiments.editorExperiment)('nested-dnd', true) ? 8 : 0), firstNodeWithNotMarginTop(), layoutColumnStyles(), (0, _experiments.editorExperiment)('advanced_layouts', true) ? layoutWithSeparatorBorderStyles(viewMode) : layoutBorderStyles(viewMode), (0, _experiments.editorExperiment)('advanced_layouts', true) && layoutResponsiveStyles(viewMode), _types.TableCssClassName.TABLE_CONTAINER, _consts.tableMarginFullWidthMode, (0, _experiments.editorExperiment)('nested-dnd', true) && !(0, _platformFeatureFlags.fg)('platform_editor_advanced_layouts_breakout_resizing') && ".ak-editor-content-area.appearance-full-page .ProseMirror [data-layout-section] {\n\t\t\t\tmargin: ".concat("var(--ds-space-100, 8px)", " -", _editorSharedStyles.akLayoutGutterOffset + 8, "px 0;\n\t\t\t\t}"));
72
82
  };
@@ -5,4 +5,4 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.version = exports.name = void 0;
7
7
  var name = exports.name = "@atlaskit/editor-core";
8
- var version = exports.version = "202.3.3";
8
+ var version = exports.version = "202.4.0";
@@ -1,7 +1,7 @@
1
+ import { sanitizeNodes } from '@atlaskit/adf-schema/schema';
1
2
  import { createProseMirrorMetadata } from '@atlaskit/editor-common/prosemirror-dom-metadata';
2
3
  import { Schema } from '@atlaskit/editor-prosemirror/model';
3
4
  import { fg } from '@atlaskit/platform-feature-flags';
4
- import { sanitizeNodes } from '../utils/sanitizeNodes';
5
5
  import { fixExcludes } from './create-editor';
6
6
  import { sortByOrder } from './sort-by-order';
7
7
  /**
@@ -3,7 +3,7 @@ import { css } from '@emotion/react';
3
3
  import { columnLayoutResponsiveSharedStyle, columnLayoutSharedStyle, LAYOUT_COLUMN_PADDING, LAYOUT_SECTION_MARGIN } from '@atlaskit/editor-common/styles';
4
4
  import { TableCssClassName } from '@atlaskit/editor-plugins/table/types';
5
5
  import { tableMarginFullWidthMode } from '@atlaskit/editor-plugins/table/ui/consts';
6
- import { akEditorDeleteBackground, akEditorDeleteBorder, akEditorSelectedBorderSize, akEditorSelectedNodeClassName, akEditorSwoopCubicBezier, akLayoutGutterOffset, getSelectionStyles, gridMediumMaxWidth, layoutBreakpointWidth, SelectionStyle } from '@atlaskit/editor-shared-styles';
6
+ import { akEditorDeleteBackground, akEditorDeleteBorder, akEditorSelectedBorderSize, akEditorSelectedNodeClassName, akEditorSwoopCubicBezier, akLayoutGutterOffset, getSelectionStyles, gridMediumMaxWidth, SelectionStyle } from '@atlaskit/editor-shared-styles';
7
7
  import { fg } from '@atlaskit/platform-feature-flags';
8
8
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
9
9
  export { LAYOUT_COLUMN_PADDING, LAYOUT_SECTION_MARGIN };
@@ -160,6 +160,25 @@ const rowSeparatorStyles = viewMode => css`
160
160
  position: absolute;
161
161
  width: calc(100% - 32px);
162
162
  margin-top: -13px;
163
+
164
+ /* clear styles for column separator */
165
+ border-left: unset;
166
+ margin-left: unset;
167
+ height: unset;
168
+ }
169
+ `;
170
+ const layoutWithSeparatorBorderResponsiveStyles = (breakpoint, viewMode
171
+ // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
172
+ ) => css`
173
+ &.selected,
174
+ &:hover,
175
+ &.selected.danger,
176
+ &.${akEditorSelectedNodeClassName}:not(.danger) {
177
+ [data-layout-column]:not(:first-of-type) {
178
+ ${fg('platform_editor_advanced_layouts_breakout_resizing') ? `@container editor-area (max-width:${breakpoint}px)` : `@media screen and (max-width: ${gridMediumMaxWidth - 1}px)`} {
179
+ ${rowSeparatorStyles(viewMode)}
180
+ }
181
+ }
163
182
  }
164
183
  `;
165
184
 
@@ -167,12 +186,7 @@ const rowSeparatorStyles = viewMode => css`
167
186
  const layoutWithSeparatorBorderStyles = viewMode => css`
168
187
  &.selected [data-layout-column]:not(:first-of-type),
169
188
  &:hover [data-layout-column]:not(:first-of-type) {
170
- ${fg('platform_editor_advanced_layouts_breakout_resizing') ? `@container layout-area (min-width:${layoutBreakpointWidth.MEDIUM}px)` : ` @media screen and (min-width: ${gridMediumMaxWidth}px)`} {
171
- ${columnSeparatorStyles(viewMode)}
172
- }
173
- ${fg('platform_editor_advanced_layouts_breakout_resizing') ? `@container layout-area (max-width:${layoutBreakpointWidth.MEDIUM - 1}px)` : `@media screen and (max-width: ${gridMediumMaxWidth - 1}px)`} {
174
- ${rowSeparatorStyles(viewMode)}
175
- }
189
+ ${columnSeparatorStyles(viewMode)}
176
190
  }
177
191
 
178
192
  &.selected.danger
@@ -183,12 +197,7 @@ const layoutWithSeparatorBorderStyles = viewMode => css`
183
197
  ${akEditorDeleteBorder};
184
198
  border-radius: 4px;
185
199
  [data-layout-column]:not(:first-of-type) {
186
- ${fg('platform_editor_advanced_layouts_breakout_resizing') ? `@container layout-area (min-width:${layoutBreakpointWidth.MEDIUM}px)` : ` @media screen and (min-width: ${gridMediumMaxWidth}px)`} {
187
- ${columnSeparatorStyles(viewMode)}
188
- }
189
- ${fg('platform_editor_advanced_layouts_breakout_resizing') ? `@container layout-area (max-width:${layoutBreakpointWidth.MEDIUM - 1}px)` : `@media screen and (max-width: ${gridMediumMaxWidth - 1}px)`} {
190
- ${rowSeparatorStyles(viewMode)}
191
- }
200
+ ${columnSeparatorStyles(viewMode)}
192
201
  }
193
202
  }
194
203
 
@@ -206,15 +215,53 @@ const layoutWithSeparatorBorderStyles = viewMode => css`
206
215
  }
207
216
  }
208
217
  [data-layout-column]:not(:first-of-type) {
209
- ${fg('platform_editor_advanced_layouts_breakout_resizing') ? `@container layout-area (min-width:${layoutBreakpointWidth.MEDIUM}px)` : ` @media screen and (min-width: ${gridMediumMaxWidth}px)`} {
210
- ${columnSeparatorStyles(viewMode)}
211
- }
212
- ${fg('platform_editor_advanced_layouts_breakout_resizing') ? `@container layout-area (max-width:${layoutBreakpointWidth.MEDIUM - 1}px)` : `@media screen and (max-width: ${gridMediumMaxWidth - 1}px)`} {
213
- ${rowSeparatorStyles(viewMode)}
214
- }
218
+ ${columnSeparatorStyles(viewMode)}
215
219
  }
216
220
  }
217
221
  `;
222
+ const layoutResponsiveStyles = viewMode =>
223
+ // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
224
+ css`
225
+ /* chosen breakpoints in container queries are to make sure layout responsiveness in editor aligns with renderer */
226
+ /* not resized layout in full-width editor */
227
+ .fabric-editor--full-width-mode .ProseMirror {
228
+ > .layoutSectionView-content-wrap {
229
+ [data-layout-section] {
230
+ @container editor-area (max-width:854px) {
231
+ flex-direction: column;
232
+ }
233
+ }
234
+
235
+ ${layoutWithSeparatorBorderResponsiveStyles(854, viewMode)}
236
+ }
237
+ }
238
+
239
+ /* not resized layout in fixed-width editor */
240
+ .ak-editor-content-area:not(.fabric-editor--full-width-mode) .ProseMirror {
241
+ > .layoutSectionView-content-wrap {
242
+ [data-layout-section] {
243
+ @container editor-area (max-width:918px) {
244
+ flex-direction: column;
245
+ }
246
+ }
247
+
248
+ ${layoutWithSeparatorBorderResponsiveStyles(918, viewMode)}
249
+ }
250
+ }
251
+
252
+ /* resized layout in full/fixed-width editor */
253
+ .ProseMirror .fabric-editor-breakout-mark {
254
+ .layoutSectionView-content-wrap {
255
+ [data-layout-section] {
256
+ @container editor-area (max-width:950px) {
257
+ flex-direction: column;
258
+ }
259
+ }
260
+
261
+ ${layoutWithSeparatorBorderResponsiveStyles(950, viewMode)}
262
+ }
263
+ }
264
+ `;
218
265
 
219
266
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Needs manual remediation
220
267
  export const layoutStyles = viewMode => css`
@@ -307,6 +354,8 @@ export const layoutStyles = viewMode => css`
307
354
  }
308
355
  }
309
356
 
357
+ ${editorExperiment('advanced_layouts', true) && layoutResponsiveStyles(viewMode)}
358
+
310
359
  .fabric-editor--full-width-mode .ProseMirror {
311
360
  [data-layout-section] {
312
361
  .${TableCssClassName.TABLE_CONTAINER} {
@@ -1,2 +1,2 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "202.3.3";
2
+ export const version = "202.4.0";
@@ -1,8 +1,8 @@
1
1
  import _typeof from "@babel/runtime/helpers/typeof";
2
+ import { sanitizeNodes } from '@atlaskit/adf-schema/schema';
2
3
  import { createProseMirrorMetadata } from '@atlaskit/editor-common/prosemirror-dom-metadata';
3
4
  import { Schema } from '@atlaskit/editor-prosemirror/model';
4
5
  import { fg } from '@atlaskit/platform-feature-flags';
5
- import { sanitizeNodes } from '../utils/sanitizeNodes';
6
6
  import { fixExcludes } from './create-editor';
7
7
  import { sortByOrder } from './sort-by-order';
8
8
  /**
@@ -1,11 +1,11 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11;
2
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13;
3
3
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
4
4
  import { css } from '@emotion/react';
5
5
  import { columnLayoutResponsiveSharedStyle, columnLayoutSharedStyle, LAYOUT_COLUMN_PADDING, LAYOUT_SECTION_MARGIN } from '@atlaskit/editor-common/styles';
6
6
  import { TableCssClassName } from '@atlaskit/editor-plugins/table/types';
7
7
  import { tableMarginFullWidthMode } from '@atlaskit/editor-plugins/table/ui/consts';
8
- import { akEditorDeleteBackground, akEditorDeleteBorder, akEditorSelectedBorderSize, akEditorSelectedNodeClassName, akEditorSwoopCubicBezier, akLayoutGutterOffset, getSelectionStyles, gridMediumMaxWidth, layoutBreakpointWidth, SelectionStyle } from '@atlaskit/editor-shared-styles';
8
+ import { akEditorDeleteBackground, akEditorDeleteBorder, akEditorSelectedBorderSize, akEditorSelectedNodeClassName, akEditorSwoopCubicBezier, akLayoutGutterOffset, getSelectionStyles, gridMediumMaxWidth, SelectionStyle } from '@atlaskit/editor-shared-styles';
9
9
  import { fg } from '@atlaskit/platform-feature-flags';
10
10
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
11
11
  export { LAYOUT_COLUMN_PADDING, LAYOUT_SECTION_MARGIN };
@@ -41,15 +41,25 @@ var columnSeparatorStyles = function columnSeparatorStyles(viewMode) {
41
41
  };
42
42
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
43
43
  var rowSeparatorStyles = function rowSeparatorStyles(viewMode) {
44
- return css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n\t[data-layout-content]::before {\n\t\tcontent: '';\n\t\tborder-top: ", "px solid\n\t\t\t", ";\n\t\tposition: absolute;\n\t\twidth: calc(100% - 32px);\n\t\tmargin-top: -13px;\n\t}\n"])), viewMode === 'view' ? 0 : akEditorSelectedBorderSize, "var(--ds-border, #091E4224)");
44
+ return css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n\t[data-layout-content]::before {\n\t\tcontent: '';\n\t\tborder-top: ", "px solid\n\t\t\t", ";\n\t\tposition: absolute;\n\t\twidth: calc(100% - 32px);\n\t\tmargin-top: -13px;\n\n\t\t/* clear styles for column separator */\n\t\tborder-left: unset;\n\t\tmargin-left: unset;\n\t\theight: unset;\n\t}\n"])), viewMode === 'view' ? 0 : akEditorSelectedBorderSize, "var(--ds-border, #091E4224)");
45
+ };
46
+ var layoutWithSeparatorBorderResponsiveStyles = function layoutWithSeparatorBorderResponsiveStyles(breakpoint, viewMode
47
+ // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
48
+ ) {
49
+ return css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n\t&.selected,\n\t&:hover,\n\t&.selected.danger,\n\t&.", ":not(.danger) {\n\t\t[data-layout-column]:not(:first-of-type) {\n\t\t\t", " {\n\t\t\t\t", "\n\t\t\t}\n\t\t}\n\t}\n"])), akEditorSelectedNodeClassName, fg('platform_editor_advanced_layouts_breakout_resizing') ? "@container editor-area (max-width:".concat(breakpoint, "px)") : "@media screen and (max-width: ".concat(gridMediumMaxWidth - 1, "px)"), rowSeparatorStyles(viewMode));
45
50
  };
46
51
 
47
52
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
48
53
  var layoutWithSeparatorBorderStyles = function layoutWithSeparatorBorderStyles(viewMode) {
49
- return css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n\t&.selected [data-layout-column]:not(:first-of-type),\n\t&:hover [data-layout-column]:not(:first-of-type) {\n\t\t", " {\n\t\t\t", "\n\t\t}\n\t\t", " {\n\t\t\t", "\n\t\t}\n\t}\n\n\t&.selected.danger\n\t\t", " {\n\t\tbackground-color: ", ";\n\n\t\tbox-shadow: 0 0 0 ", "px\n\t\t\t", ";\n\t\tborder-radius: 4px;\n\t\t[data-layout-column]:not(:first-of-type) {\n\t\t\t", " {\n\t\t\t\t", "\n\t\t\t}\n\t\t\t", " {\n\t\t\t\t", "\n\t\t\t}\n\t\t}\n\t}\n\n\t&.", ":not(.danger)\n\t\t", " {\n\t\tbox-shadow: 0 0 0 ", "px\n\t\t\t", ";\n\t\tborder-radius: 4px;\n\t\tbackground-color: ", ";\n\t\t[data-layout-column] {\n\t\t\t", "\n\t\t\tborder: 0px;\n\t\t\t::before {\n\t\t\t\tbackground-color: transparent;\n\t\t\t}\n\t\t}\n\t\t[data-layout-column]:not(:first-of-type) {\n\t\t\t", " {\n\t\t\t\t", "\n\t\t\t}\n\t\t\t", " {\n\t\t\t\t", "\n\t\t\t}\n\t\t}\n\t}\n"])), fg('platform_editor_advanced_layouts_breakout_resizing') ? "@container layout-area (min-width:".concat(layoutBreakpointWidth.MEDIUM, "px)") : "\t@media screen and (min-width: ".concat(gridMediumMaxWidth, "px)"), columnSeparatorStyles(viewMode), fg('platform_editor_advanced_layouts_breakout_resizing') ? "@container layout-area (max-width:".concat(layoutBreakpointWidth.MEDIUM - 1, "px)") : "@media screen and (max-width: ".concat(gridMediumMaxWidth - 1, "px)"), rowSeparatorStyles(viewMode), fg('platform_editor_advanced_layouts_breakout_resizing') ? "[data-layout-section]" : "", "var(--ds-background-danger, ".concat(akEditorDeleteBackground, ")"), viewMode === 'view' ? 0 : akEditorSelectedBorderSize, akEditorDeleteBorder, fg('platform_editor_advanced_layouts_breakout_resizing') ? "@container layout-area (min-width:".concat(layoutBreakpointWidth.MEDIUM, "px)") : "\t@media screen and (min-width: ".concat(gridMediumMaxWidth, "px)"), columnSeparatorStyles(viewMode), fg('platform_editor_advanced_layouts_breakout_resizing') ? "@container layout-area (max-width:".concat(layoutBreakpointWidth.MEDIUM - 1, "px)") : "@media screen and (max-width: ".concat(gridMediumMaxWidth - 1, "px)"), rowSeparatorStyles(viewMode), akEditorSelectedNodeClassName, fg('platform_editor_advanced_layouts_breakout_resizing') ? "[data-layout-section]" : "", viewMode === 'view' ? 0 : akEditorSelectedBorderSize, "var(--ds-border-selected, #0C66E4)", "var(--ds-background-selected, #E9F2FF)", getSelectionStyles([SelectionStyle.Blanket]), fg('platform_editor_advanced_layouts_breakout_resizing') ? "@container layout-area (min-width:".concat(layoutBreakpointWidth.MEDIUM, "px)") : "\t@media screen and (min-width: ".concat(gridMediumMaxWidth, "px)"), columnSeparatorStyles(viewMode), fg('platform_editor_advanced_layouts_breakout_resizing') ? "@container layout-area (max-width:".concat(layoutBreakpointWidth.MEDIUM - 1, "px)") : "@media screen and (max-width: ".concat(gridMediumMaxWidth - 1, "px)"), rowSeparatorStyles(viewMode));
54
+ return css(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n\t&.selected [data-layout-column]:not(:first-of-type),\n\t&:hover [data-layout-column]:not(:first-of-type) {\n\t\t", "\n\t}\n\n\t&.selected.danger\n\t\t", " {\n\t\tbackground-color: ", ";\n\n\t\tbox-shadow: 0 0 0 ", "px\n\t\t\t", ";\n\t\tborder-radius: 4px;\n\t\t[data-layout-column]:not(:first-of-type) {\n\t\t\t", "\n\t\t}\n\t}\n\n\t&.", ":not(.danger)\n\t\t", " {\n\t\tbox-shadow: 0 0 0 ", "px\n\t\t\t", ";\n\t\tborder-radius: 4px;\n\t\tbackground-color: ", ";\n\t\t[data-layout-column] {\n\t\t\t", "\n\t\t\tborder: 0px;\n\t\t\t::before {\n\t\t\t\tbackground-color: transparent;\n\t\t\t}\n\t\t}\n\t\t[data-layout-column]:not(:first-of-type) {\n\t\t\t", "\n\t\t}\n\t}\n"])), columnSeparatorStyles(viewMode), fg('platform_editor_advanced_layouts_breakout_resizing') ? "[data-layout-section]" : "", "var(--ds-background-danger, ".concat(akEditorDeleteBackground, ")"), viewMode === 'view' ? 0 : akEditorSelectedBorderSize, akEditorDeleteBorder, columnSeparatorStyles(viewMode), akEditorSelectedNodeClassName, fg('platform_editor_advanced_layouts_breakout_resizing') ? "[data-layout-section]" : "", viewMode === 'view' ? 0 : akEditorSelectedBorderSize, "var(--ds-border-selected, #0C66E4)", "var(--ds-background-selected, #E9F2FF)", getSelectionStyles([SelectionStyle.Blanket]), columnSeparatorStyles(viewMode));
55
+ };
56
+ var layoutResponsiveStyles = function layoutResponsiveStyles(viewMode) {
57
+ return (// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
58
+ css(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n\t\t/* chosen breakpoints in container queries are to make sure layout responsiveness in editor aligns with renderer */\n\t\t/* not resized layout in full-width editor */\n\t\t.fabric-editor--full-width-mode .ProseMirror {\n\t\t\t> .layoutSectionView-content-wrap {\n\t\t\t\t[data-layout-section] {\n\t\t\t\t\t@container editor-area (max-width:854px) {\n\t\t\t\t\t\tflex-direction: column;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t", "\n\t\t\t}\n\t\t}\n\n\t\t/* not resized layout in fixed-width editor */\n\t\t.ak-editor-content-area:not(.fabric-editor--full-width-mode) .ProseMirror {\n\t\t\t> .layoutSectionView-content-wrap {\n\t\t\t\t[data-layout-section] {\n\t\t\t\t\t@container editor-area (max-width:918px) {\n\t\t\t\t\t\tflex-direction: column;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t", "\n\t\t\t}\n\t\t}\n\n\t\t/* resized layout in full/fixed-width editor */\n\t\t.ProseMirror .fabric-editor-breakout-mark {\n\t\t\t.layoutSectionView-content-wrap {\n\t\t\t\t[data-layout-section] {\n\t\t\t\t\t@container editor-area (max-width:950px) {\n\t\t\t\t\t\tflex-direction: column;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t", "\n\t\t\t}\n\t\t}\n\t"])), layoutWithSeparatorBorderResponsiveStyles(854, viewMode), layoutWithSeparatorBorderResponsiveStyles(918, viewMode), layoutWithSeparatorBorderResponsiveStyles(950, viewMode))
59
+ );
50
60
  };
51
61
 
52
62
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Needs manual remediation
53
63
  export var layoutStyles = function layoutStyles(viewMode) {
54
- return css(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n\t.ProseMirror {\n\t\t", "\n\t\t[data-layout-section] {\n\t\t\t// TODO: Migrate away from gridSize\n\t\t\t// Recommendation: Replace directly with 7px\n\t\t\tmargin: ", " -", "px 0;\n\t\t\ttransition: border-color 0.3s ", ";\n\t\t\tcursor: ", ";\n\n\t\t\t/* Inner cursor located 26px from left */\n\t\t\t[data-layout-column] {\n\t\t\t\tflex: 1;\n\t\t\t\t", "\n\n\t\t\t\tmin-width: 0;\n\t\t\t\t/* disable 4 borders when in view mode and advanced layouts is on */\n\t\t\t\tborder: ", "px\n\t\t\t\t\tsolid ", ";\n\t\t\t\tborder-radius: 4px;\n\t\t\t\tpadding: ", "px\n\t\t\t\t\t", "px;\n\t\t\t\tbox-sizing: border-box;\n\n\t\t\t\t> div {\n\t\t\t\t\t", "\n\n\t\t\t\t\t> .embedCardView-content-wrap:first-of-type .rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t> .mediaSingleView-content-wrap:first-of-type .rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t> .ProseMirror-gapcursor.-right:first-child\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item,\n\t\t\t\t\t> style:first-child\n\t\t\t\t\t\t+ .ProseMirror-gapcursor.-right\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item,\n\t\t\t\t\t> .ProseMirror-gapcursor.-right:first-of-type\n\t\t\t\t\t\t+ .embedCardView-content-wrap\n\t\t\t\t\t\t.rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t> .ProseMirror-gapcursor:first-child\n\t\t\t\t\t\t+ span\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item,\n\t\t\t\t\t> style:first-child\n\t\t\t\t\t\t+ .ProseMirror-gapcursor\n\t\t\t\t\t\t+ span\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t/* Prevent first DecisionWrapper's margin-top: 8px from shifting decisions down\n and shrinking layout's node selectable area (leniency margin) */\n\t\t\t\t\t> [data-node-type='decisionList'] {\n\t\t\t\t\t\tli:first-of-type [data-decision-wrapper] {\n\t\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t/* Make the 'content' fill the entire height of the layout column to allow click\n handler of layout section nodeview to target only data-layout-column */\n\t\t\t\t[data-layout-content] {\n\t\t\t\t\theight: 100%;\n\t\t\t\t\tcursor: text;\n\t\t\t\t\t.mediaGroupView-content-wrap {\n\t\t\t\t\t\tclear: both;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t", "\n\t\t}\n\n\t\t// styles to support borders for layout\n\t\t[data-layout-section],\n\t\t.layoutSectionView-content-wrap {\n\t\t\t", "\n\t\t}\n\t}\n\n\t.fabric-editor--full-width-mode .ProseMirror {\n\t\t[data-layout-section] {\n\t\t\t.", " {\n\t\t\t\tmargin: 0 ", "px;\n\t\t\t}\n\t\t}\n\t}\n\n\t", "\n"])), layoutSectionStyles(), "var(--ds-space-100, 8px)", akLayoutGutterOffset, akEditorSwoopCubicBezier, viewMode === 'view' ? 'default' : 'pointer', fg('platform_editor_drag_and_drop_target_v2') ? 'position: relative;' : '', viewMode === 'view' || editorExperiment('advanced_layouts', true) ? 0 : akEditorSelectedBorderSize, "var(--ds-border, #091E4224)", LAYOUT_COLUMN_PADDING, LAYOUT_COLUMN_PADDING + (editorExperiment('nested-dnd', true) ? 8 : 0), firstNodeWithNotMarginTop(), layoutColumnStyles(), editorExperiment('advanced_layouts', true) ? layoutWithSeparatorBorderStyles(viewMode) : layoutBorderStyles(viewMode), TableCssClassName.TABLE_CONTAINER, tableMarginFullWidthMode, editorExperiment('nested-dnd', true) && !fg('platform_editor_advanced_layouts_breakout_resizing') && ".ak-editor-content-area.appearance-full-page .ProseMirror [data-layout-section] {\n\t\t\t\tmargin: ".concat("var(--ds-space-100, 8px)", " -", akLayoutGutterOffset + 8, "px 0;\n\t\t\t\t}"));
64
+ return css(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n\t.ProseMirror {\n\t\t", "\n\t\t[data-layout-section] {\n\t\t\t// TODO: Migrate away from gridSize\n\t\t\t// Recommendation: Replace directly with 7px\n\t\t\tmargin: ", " -", "px 0;\n\t\t\ttransition: border-color 0.3s ", ";\n\t\t\tcursor: ", ";\n\n\t\t\t/* Inner cursor located 26px from left */\n\t\t\t[data-layout-column] {\n\t\t\t\tflex: 1;\n\t\t\t\t", "\n\n\t\t\t\tmin-width: 0;\n\t\t\t\t/* disable 4 borders when in view mode and advanced layouts is on */\n\t\t\t\tborder: ", "px\n\t\t\t\t\tsolid ", ";\n\t\t\t\tborder-radius: 4px;\n\t\t\t\tpadding: ", "px\n\t\t\t\t\t", "px;\n\t\t\t\tbox-sizing: border-box;\n\n\t\t\t\t> div {\n\t\t\t\t\t", "\n\n\t\t\t\t\t> .embedCardView-content-wrap:first-of-type .rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t> .mediaSingleView-content-wrap:first-of-type .rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t> .ProseMirror-gapcursor.-right:first-child\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item,\n\t\t\t\t\t> style:first-child\n\t\t\t\t\t\t+ .ProseMirror-gapcursor.-right\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item,\n\t\t\t\t\t> .ProseMirror-gapcursor.-right:first-of-type\n\t\t\t\t\t\t+ .embedCardView-content-wrap\n\t\t\t\t\t\t.rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t> .ProseMirror-gapcursor:first-child\n\t\t\t\t\t\t+ span\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item,\n\t\t\t\t\t> style:first-child\n\t\t\t\t\t\t+ .ProseMirror-gapcursor\n\t\t\t\t\t\t+ span\n\t\t\t\t\t\t+ .mediaSingleView-content-wrap\n\t\t\t\t\t\t.rich-media-item {\n\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t/* Prevent first DecisionWrapper's margin-top: 8px from shifting decisions down\n and shrinking layout's node selectable area (leniency margin) */\n\t\t\t\t\t> [data-node-type='decisionList'] {\n\t\t\t\t\t\tli:first-of-type [data-decision-wrapper] {\n\t\t\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t/* Make the 'content' fill the entire height of the layout column to allow click\n handler of layout section nodeview to target only data-layout-column */\n\t\t\t\t[data-layout-content] {\n\t\t\t\t\theight: 100%;\n\t\t\t\t\tcursor: text;\n\t\t\t\t\t.mediaGroupView-content-wrap {\n\t\t\t\t\t\tclear: both;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t", "\n\t\t}\n\n\t\t// styles to support borders for layout\n\t\t[data-layout-section],\n\t\t.layoutSectionView-content-wrap {\n\t\t\t", "\n\t\t}\n\t}\n\n\t", "\n\n\t.fabric-editor--full-width-mode .ProseMirror {\n\t\t[data-layout-section] {\n\t\t\t.", " {\n\t\t\t\tmargin: 0 ", "px;\n\t\t\t}\n\t\t}\n\t}\n\n\t", "\n"])), layoutSectionStyles(), "var(--ds-space-100, 8px)", akLayoutGutterOffset, akEditorSwoopCubicBezier, viewMode === 'view' ? 'default' : 'pointer', fg('platform_editor_drag_and_drop_target_v2') ? 'position: relative;' : '', viewMode === 'view' || editorExperiment('advanced_layouts', true) ? 0 : akEditorSelectedBorderSize, "var(--ds-border, #091E4224)", LAYOUT_COLUMN_PADDING, LAYOUT_COLUMN_PADDING + (editorExperiment('nested-dnd', true) ? 8 : 0), firstNodeWithNotMarginTop(), layoutColumnStyles(), editorExperiment('advanced_layouts', true) ? layoutWithSeparatorBorderStyles(viewMode) : layoutBorderStyles(viewMode), editorExperiment('advanced_layouts', true) && layoutResponsiveStyles(viewMode), TableCssClassName.TABLE_CONTAINER, tableMarginFullWidthMode, editorExperiment('nested-dnd', true) && !fg('platform_editor_advanced_layouts_breakout_resizing') && ".ak-editor-content-area.appearance-full-page .ProseMirror [data-layout-section] {\n\t\t\t\tmargin: ".concat("var(--ds-space-100, 8px)", " -", akLayoutGutterOffset + 8, "px 0;\n\t\t\t\t}"));
55
65
  };
@@ -1,2 +1,2 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "202.3.3";
2
+ export var version = "202.4.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "202.3.3",
3
+ "version": "202.4.0",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -38,12 +38,12 @@
38
38
  },
39
39
  "dependencies": {
40
40
  "@atlaskit/activity-provider": "^2.5.0",
41
- "@atlaskit/adf-schema": "^44.2.0",
41
+ "@atlaskit/adf-schema": "^46.1.0",
42
42
  "@atlaskit/analytics-namespaced-context": "^6.12.0",
43
43
  "@atlaskit/analytics-next": "^10.1.0",
44
44
  "@atlaskit/analytics-next-stable-react-context": "1.0.1",
45
45
  "@atlaskit/button": "^20.3.0",
46
- "@atlaskit/editor-common": "^95.6.0",
46
+ "@atlaskit/editor-common": "^95.7.0",
47
47
  "@atlaskit/editor-json-transformer": "^8.21.0",
48
48
  "@atlaskit/editor-plugin-quick-insert": "1.7.1",
49
49
  "@atlaskit/editor-plugins": "^5.7.0",
@@ -83,8 +83,8 @@
83
83
  "@af/visual-regression": "*",
84
84
  "@atlaskit/adf-utils": "^19.13.0",
85
85
  "@atlaskit/analytics-listeners": "^8.13.0",
86
- "@atlaskit/collab-provider": "10.1.2",
87
- "@atlaskit/editor-plugin-annotation": "1.25.2",
86
+ "@atlaskit/collab-provider": "10.1.3",
87
+ "@atlaskit/editor-plugin-annotation": "1.25.3",
88
88
  "@atlaskit/editor-plugin-card": "^4.4.0",
89
89
  "@atlaskit/editor-plugin-list": "^3.9.0",
90
90
  "@atlaskit/editor-plugin-paste": "^2.0.0",
@@ -356,6 +356,10 @@
356
356
  "platform_inline_node_as_valid_annotation_selection": {
357
357
  "type": "boolean",
358
358
  "referenceOnly": true
359
+ },
360
+ "platform_editor_hide_external_media_badge": {
361
+ "type": "boolean",
362
+ "referenceOnly": true
359
363
  }
360
364
  },
361
365
  "stricter": {
@@ -1,63 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.sanitizeNodes = sanitizeNodes;
8
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
10
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
11
- function sanitizeNodes(nodes, supportedMarks) {
12
- var nodeNames = Object.keys(nodes);
13
- nodeNames.forEach(function (nodeKey) {
14
- var nodeSpec = _objectSpread({}, nodes[nodeKey]);
15
- if (nodeSpec.marks && nodeSpec.marks !== '_') {
16
- nodeSpec.marks = nodeSpec.marks.split(' ').filter(function (mark) {
17
- return !!supportedMarks[mark];
18
- }).join(' ');
19
- }
20
- if (nodeSpec.content) {
21
- nodeSpec.content = sanitizeNodeSpecContent(nodes, nodeSpec.content);
22
- }
23
- nodes[nodeKey] = nodeSpec;
24
- });
25
- return nodes;
26
- }
27
- function sanitizeNodeSpecContent(nodes, rawContent) {
28
- var content = rawContent.replace(/\W/g, ' ');
29
- var contentKeys = content.split(' ');
30
- var unsupportedContentKeys = contentKeys.filter(function (contentKey) {
31
- return !isContentSupported(nodes, contentKey);
32
- });
33
- return unsupportedContentKeys.reduce(function (newContent, nodeName) {
34
- return sanitizedContent(newContent, nodeName);
35
- }, rawContent);
36
- }
37
- function sanitizedContent(content, invalidContent) {
38
- if (!invalidContent.length) {
39
- return content || '';
40
- }
41
- if (!content || !content.match(/\w/)) {
42
- return '';
43
- }
44
- var pattern = "(".concat(invalidContent, "((\\s)*\\|)+)|((\\|(\\s)*)+").concat(invalidContent, ")|(").concat(invalidContent, "$)|(").concat(invalidContent, "(\\+|\\*))");
45
- return content.replace(new RegExp(pattern, 'g'), '').replace(' ', ' ').trim();
46
- }
47
- function isContentSupported(nodes, contentKey) {
48
- var nodeKeys = Object.keys(nodes);
49
-
50
- // content is with valid node
51
- if (nodeKeys.indexOf(contentKey) > -1) {
52
- return true;
53
- }
54
-
55
- // content is with valid group
56
- for (var supportedKey in nodes) {
57
- var nodeSpec = nodes[supportedKey];
58
- if (nodeSpec && nodeSpec.group === contentKey) {
59
- return true;
60
- }
61
- }
62
- return false;
63
- }
@@ -1,49 +0,0 @@
1
- export function sanitizeNodes(nodes, supportedMarks) {
2
- const nodeNames = Object.keys(nodes);
3
- nodeNames.forEach(nodeKey => {
4
- const nodeSpec = {
5
- ...nodes[nodeKey]
6
- };
7
- if (nodeSpec.marks && nodeSpec.marks !== '_') {
8
- nodeSpec.marks = nodeSpec.marks.split(' ').filter(mark => !!supportedMarks[mark]).join(' ');
9
- }
10
- if (nodeSpec.content) {
11
- nodeSpec.content = sanitizeNodeSpecContent(nodes, nodeSpec.content);
12
- }
13
- nodes[nodeKey] = nodeSpec;
14
- });
15
- return nodes;
16
- }
17
- function sanitizeNodeSpecContent(nodes, rawContent) {
18
- const content = rawContent.replace(/\W/g, ' ');
19
- const contentKeys = content.split(' ');
20
- const unsupportedContentKeys = contentKeys.filter(contentKey => !isContentSupported(nodes, contentKey));
21
- return unsupportedContentKeys.reduce((newContent, nodeName) => sanitizedContent(newContent, nodeName), rawContent);
22
- }
23
- function sanitizedContent(content, invalidContent) {
24
- if (!invalidContent.length) {
25
- return content || '';
26
- }
27
- if (!content || !content.match(/\w/)) {
28
- return '';
29
- }
30
- const pattern = `(${invalidContent}((\\s)*\\|)+)|((\\|(\\s)*)+${invalidContent})|(${invalidContent}$)|(${invalidContent}(\\+|\\*))`;
31
- return content.replace(new RegExp(pattern, 'g'), '').replace(' ', ' ').trim();
32
- }
33
- function isContentSupported(nodes, contentKey) {
34
- const nodeKeys = Object.keys(nodes);
35
-
36
- // content is with valid node
37
- if (nodeKeys.indexOf(contentKey) > -1) {
38
- return true;
39
- }
40
-
41
- // content is with valid group
42
- for (const supportedKey in nodes) {
43
- const nodeSpec = nodes[supportedKey];
44
- if (nodeSpec && nodeSpec.group === contentKey) {
45
- return true;
46
- }
47
- }
48
- return false;
49
- }
@@ -1,56 +0,0 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
- export function sanitizeNodes(nodes, supportedMarks) {
5
- var nodeNames = Object.keys(nodes);
6
- nodeNames.forEach(function (nodeKey) {
7
- var nodeSpec = _objectSpread({}, nodes[nodeKey]);
8
- if (nodeSpec.marks && nodeSpec.marks !== '_') {
9
- nodeSpec.marks = nodeSpec.marks.split(' ').filter(function (mark) {
10
- return !!supportedMarks[mark];
11
- }).join(' ');
12
- }
13
- if (nodeSpec.content) {
14
- nodeSpec.content = sanitizeNodeSpecContent(nodes, nodeSpec.content);
15
- }
16
- nodes[nodeKey] = nodeSpec;
17
- });
18
- return nodes;
19
- }
20
- function sanitizeNodeSpecContent(nodes, rawContent) {
21
- var content = rawContent.replace(/\W/g, ' ');
22
- var contentKeys = content.split(' ');
23
- var unsupportedContentKeys = contentKeys.filter(function (contentKey) {
24
- return !isContentSupported(nodes, contentKey);
25
- });
26
- return unsupportedContentKeys.reduce(function (newContent, nodeName) {
27
- return sanitizedContent(newContent, nodeName);
28
- }, rawContent);
29
- }
30
- function sanitizedContent(content, invalidContent) {
31
- if (!invalidContent.length) {
32
- return content || '';
33
- }
34
- if (!content || !content.match(/\w/)) {
35
- return '';
36
- }
37
- var pattern = "(".concat(invalidContent, "((\\s)*\\|)+)|((\\|(\\s)*)+").concat(invalidContent, ")|(").concat(invalidContent, "$)|(").concat(invalidContent, "(\\+|\\*))");
38
- return content.replace(new RegExp(pattern, 'g'), '').replace(' ', ' ').trim();
39
- }
40
- function isContentSupported(nodes, contentKey) {
41
- var nodeKeys = Object.keys(nodes);
42
-
43
- // content is with valid node
44
- if (nodeKeys.indexOf(contentKey) > -1) {
45
- return true;
46
- }
47
-
48
- // content is with valid group
49
- for (var supportedKey in nodes) {
50
- var nodeSpec = nodes[supportedKey];
51
- if (nodeSpec && nodeSpec.group === contentKey) {
52
- return true;
53
- }
54
- }
55
- return false;
56
- }
@@ -1,8 +0,0 @@
1
- import type { MarkSpec, NodeSpec } from '@atlaskit/editor-prosemirror/model';
2
- export declare function sanitizeNodes(nodes: {
3
- [key: string]: NodeSpec;
4
- }, supportedMarks: {
5
- [key: string]: MarkSpec;
6
- }): {
7
- [key: string]: NodeSpec;
8
- };
@@ -1,8 +0,0 @@
1
- import type { MarkSpec, NodeSpec } from '@atlaskit/editor-prosemirror/model';
2
- export declare function sanitizeNodes(nodes: {
3
- [key: string]: NodeSpec;
4
- }, supportedMarks: {
5
- [key: string]: MarkSpec;
6
- }): {
7
- [key: string]: NodeSpec;
8
- };