@atlaskit/editor-common 114.35.0 → 114.36.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,20 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 114.36.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`4f2e912c65ae3`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4f2e912c65ae3) -
8
+ Gate table-in-panel ADF validation behind experiment (EDITOR-7168)
9
+ - [`dbd418b1304cd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/dbd418b1304cd) -
10
+ [ux] Added support to show an icon-only version of the hero prompt in the editor's AI toolbar on
11
+ smaller screen sizes, when Rovo is enabled on the product and an empty state hero item is
12
+ configured.
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies
17
+
3
18
  ## 114.35.0
4
19
 
5
20
  ### Minor Changes
@@ -19,7 +19,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
19
19
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
20
20
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
21
21
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
22
- var packageVersion = "114.34.0";
22
+ var packageVersion = "114.35.0";
23
23
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
24
24
  // Remove URL as it has UGC
25
25
  // Ignored via go/ees007
@@ -3,8 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.isSelectionTableNestedInTable = exports.isNestedTablesSupported = exports.getPositionAfterTopParentNodeOfType = exports.getParentOfTypeCount = void 0;
6
+ exports.isSelectionTableNestedInTable = exports.isPanelNestingTableSupported = exports.isNestedTablesSupported = exports.getPositionAfterTopParentNodeOfType = exports.getParentOfTypeCount = void 0;
7
7
  var _editorTables = require("@atlaskit/editor-tables");
8
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
8
9
  /*
9
10
  * Returns the level of nesting of a given `nodeType` in the current position.
10
11
  * eg. table > table is nested 1 level, table > table > table is nested 2 levels.
@@ -87,4 +88,26 @@ var isNestedTablesSupported = exports.isNestedTablesSupported = function isNeste
87
88
  var tableCellCanContainTable = ((_tableCell$contentMat = tableCell.contentMatch.matchType(table)) === null || _tableCell$contentMat === void 0 ? void 0 : _tableCell$contentMat.validEnd) === true;
88
89
  var tableHeaderCanContainTable = ((_tableHeader$contentM = tableHeader.contentMatch.matchType(table)) === null || _tableHeader$contentM === void 0 ? void 0 : _tableHeader$contentM.validEnd) === true;
89
90
  return tableCellCanContainTable || tableHeaderCanContainTable;
91
+ };
92
+
93
+ /*
94
+ * Returns true if the schema supports nesting a table inside a panel (panel_c1 variant),
95
+ * AND the `platform_editor_nest_table_in_panel` experiment is enabled.
96
+ *
97
+ * ```typescript
98
+ * const supportsTableInPanel = isPanelNestingTableSupported(state.schema);
99
+ * ```
100
+ */
101
+ var isPanelNestingTableSupported = exports.isPanelNestingTableSupported = function isPanelNestingTableSupported(schema) {
102
+ var _panel_c1$contentMatc;
103
+ var _schema$nodes2 = schema.nodes,
104
+ table = _schema$nodes2.table,
105
+ panel_c1 = _schema$nodes2.panel_c1;
106
+ if (!table || !panel_c1) {
107
+ return false;
108
+ }
109
+
110
+ // Confirm the PM schema actually allows table inside panel_c1
111
+ var panelC1CanContainTable = ((_panel_c1$contentMatc = panel_c1.contentMatch.matchType(table)) === null || _panel_c1$contentMatc === void 0 ? void 0 : _panel_c1$contentMatc.validEnd) === true;
112
+ return panelC1CanContainTable && (0, _expValEquals.expValEquals)('platform_editor_nest_table_in_panel', 'isEnabled', true);
90
113
  };
@@ -16,7 +16,7 @@ var TOOLBAR_RANK = exports.TOOLBAR_RANK = (_TOOLBAR_RANK = {}, (0, _defineProper
16
16
  var AI_SECTION_RANK = exports.AI_SECTION_RANK = (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, _keys.ROVO_GROUP.key, 100), _keys.ROVO_GROUP_DISPLAY_SMALL.key, 100), _keys.ROVO_GROUP_PRIMARY_TOOLBAR.key, 100), _keys.DEFINE_GROUP.key, 200), _keys.IMPROVE_WRITING_GROUP.key, 300), _keys.HERO_PROMPT_BUTTON_GROUP.key, 300), _keys.AI_SUGGESTIONS_GROUP.key, 400);
17
17
  var AI_SUGGESTIONS_GROUP_RANK = exports.AI_SUGGESTIONS_GROUP_RANK = (0, _defineProperty2.default)({}, _keys.AI_SUGGESTIONS_BUTTON.key, 100);
18
18
  var ROVO_GROUP_RANK = exports.ROVO_GROUP_RANK = (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, _keys.ROVO_HERO_BUTTON.key, 100), _keys.ROVO_WRITE_BUTTON_PRIMARY_TOOLBAR.key, 100), _keys.ROVO_MENU.key, 200);
19
- var ROVO_GROUP_DISPLAY_SMALL_RANK = exports.ROVO_GROUP_DISPLAY_SMALL_RANK = (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, _keys.ROVO_HERO_BUTTON.key, 100), _keys.ROVO_MENU_DISPLAY_SMALL.key, 200), _keys.AI_SUGGESTIONS_BUTTON.key, 300);
19
+ var ROVO_GROUP_DISPLAY_SMALL_RANK = exports.ROVO_GROUP_DISPLAY_SMALL_RANK = (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, _keys.ROVO_HERO_BUTTON.key, 100), _keys.ROVO_MENU_DISPLAY_SMALL.key, 200), _keys.HERO_PROMPT_BUTTON.key, 300), _keys.AI_SUGGESTIONS_BUTTON.key, 400);
20
20
  var DEFINE_GROUP_RANK = exports.DEFINE_GROUP_RANK = (0, _defineProperty2.default)({}, _keys.DEFINE_BUTTON.key, 100);
21
21
  var IMPROVE_WRITING_GROUP_RANK = exports.IMPROVE_WRITING_GROUP_RANK = (0, _defineProperty2.default)({}, _keys.IMPROVE_WRITING_BUTTON.key, 100);
22
22
  var HERO_PROMPT_BUTTON_GROUP_RANK = exports.HERO_PROMPT_BUTTON_GROUP_RANK = (0, _defineProperty2.default)({}, _keys.HERO_PROMPT_BUTTON.key, 100);
@@ -24,7 +24,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
24
24
  * @jsx jsx
25
25
  */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
26
26
  var packageName = "@atlaskit/editor-common";
27
- var packageVersion = "114.34.0";
27
+ var packageVersion = "114.35.0";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var fadeIn = (0, _react2.keyframes)({
@@ -248,9 +248,12 @@ function processRawValue(schema, value, providerFactory, sanitizePrivateContent,
248
248
  // Validate ADF first before converting nested-table extensions into nested tables
249
249
  // This matches the renderer's behavior in render-document.ts
250
250
  var allowNestedTables = (0, _utilities.isNestedTablesSupported)(schema);
251
- var entity = (0, _validateUsingSpec.validateADFEntity)(schema, transformedAdf || node, dispatchAnalyticsEvent, allowNestedTables ? {
252
- allowNestedTables: allowNestedTables
253
- } : undefined);
251
+ var allowTableInPanel = (0, _utilities.isPanelNestingTableSupported)(schema);
252
+ var validateADFEntityOptions = allowNestedTables || allowTableInPanel ? {
253
+ allowNestedTables: allowNestedTables || undefined,
254
+ allowTableInPanel: allowTableInPanel || undefined
255
+ } : undefined;
256
+ var entity = (0, _validateUsingSpec.validateADFEntity)(schema, transformedAdf || node, dispatchAnalyticsEvent, validateADFEntityOptions);
254
257
 
255
258
  // Convert nested-table extensions into nested tables
256
259
  var _transformNestedTable3 = transformNestedTablesWithAnalytics(entity, dispatchAnalyticsEvent);
@@ -16,7 +16,8 @@ var UNSUPPORTED_NODE_ATTRIBUTE = exports.UNSUPPORTED_NODE_ATTRIBUTE = 'unsupport
16
16
  var errorCallbackFor = function errorCallbackFor(marks, validate, dispatchAnalyticsEvent, validationOverrides) {
17
17
  return function (entity, error, options) {
18
18
  return validationErrorHandler(entity, error, _objectSpread(_objectSpread({}, options), {}, {
19
- allowNestedTables: validationOverrides === null || validationOverrides === void 0 ? void 0 : validationOverrides.allowNestedTables
19
+ allowNestedTables: validationOverrides === null || validationOverrides === void 0 ? void 0 : validationOverrides.allowNestedTables,
20
+ allowTableInPanel: validationOverrides === null || validationOverrides === void 0 ? void 0 : validationOverrides.allowTableInPanel
20
21
  }), marks, validate, dispatchAnalyticsEvent);
21
22
  };
22
23
  };
@@ -81,6 +82,17 @@ var validationErrorHandler = exports.validationErrorHandler = function validatio
81
82
  return entity;
82
83
  }
83
84
  }
85
+
86
+ // panel_c1 is a ProseMirror-only variant: on save, table-in-panel documents are stored as
87
+ // plain ADF `panel` nodes containing a `table`. The base validator-spec does not permit
88
+ // `table` inside `panel` (it's gated behind the experiment), so we suppress the
89
+ // INVALID_CONTENT error when the experiment is active.
90
+ if (options.allowTableInPanel) {
91
+ var _meta = error.meta;
92
+ if ((_meta === null || _meta === void 0 ? void 0 : _meta.parentType) === 'panel' && error.code === 'INVALID_CONTENT' && entity.type === 'table') {
93
+ return entity;
94
+ }
95
+ }
84
96
  if (options.allowUnsupportedBlock) {
85
97
  return wrapWithUnsupported(entity);
86
98
  }
@@ -4,7 +4,7 @@ import { isFedRamp } from './environment';
4
4
  import { normaliseSentryBreadcrumbs, SERIALIZABLE_ATTRIBUTES } from './normalise-sentry-breadcrumbs';
5
5
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
6
6
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
7
- const packageVersion = "114.34.0";
7
+ const packageVersion = "114.35.0";
8
8
  const sanitiseSentryEvents = (data, _hint) => {
9
9
  // Remove URL as it has UGC
10
10
  // Ignored via go/ees007
@@ -1,4 +1,5 @@
1
1
  import { findTable } from '@atlaskit/editor-tables';
2
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
2
3
 
3
4
  /*
4
5
  * Returns the level of nesting of a given `nodeType` in the current position.
@@ -79,4 +80,27 @@ export const isNestedTablesSupported = schema => {
79
80
  const tableCellCanContainTable = ((_tableCell$contentMat = tableCell.contentMatch.matchType(table)) === null || _tableCell$contentMat === void 0 ? void 0 : _tableCell$contentMat.validEnd) === true;
80
81
  const tableHeaderCanContainTable = ((_tableHeader$contentM = tableHeader.contentMatch.matchType(table)) === null || _tableHeader$contentM === void 0 ? void 0 : _tableHeader$contentM.validEnd) === true;
81
82
  return tableCellCanContainTable || tableHeaderCanContainTable;
83
+ };
84
+
85
+ /*
86
+ * Returns true if the schema supports nesting a table inside a panel (panel_c1 variant),
87
+ * AND the `platform_editor_nest_table_in_panel` experiment is enabled.
88
+ *
89
+ * ```typescript
90
+ * const supportsTableInPanel = isPanelNestingTableSupported(state.schema);
91
+ * ```
92
+ */
93
+ export const isPanelNestingTableSupported = schema => {
94
+ var _panel_c1$contentMatc;
95
+ const {
96
+ table,
97
+ panel_c1
98
+ } = schema.nodes;
99
+ if (!table || !panel_c1) {
100
+ return false;
101
+ }
102
+
103
+ // Confirm the PM schema actually allows table inside panel_c1
104
+ const panelC1CanContainTable = ((_panel_c1$contentMatc = panel_c1.contentMatch.matchType(table)) === null || _panel_c1$contentMatc === void 0 ? void 0 : _panel_c1$contentMatc.validEnd) === true;
105
+ return panelC1CanContainTable && expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true);
82
106
  };
@@ -42,7 +42,8 @@ export const ROVO_GROUP_RANK = {
42
42
  export const ROVO_GROUP_DISPLAY_SMALL_RANK = {
43
43
  [ROVO_HERO_BUTTON.key]: 100,
44
44
  [ROVO_MENU_DISPLAY_SMALL.key]: 200,
45
- [AI_SUGGESTIONS_BUTTON.key]: 300
45
+ [HERO_PROMPT_BUTTON.key]: 300,
46
+ [AI_SUGGESTIONS_BUTTON.key]: 400
46
47
  };
47
48
  export const DEFINE_GROUP_RANK = {
48
49
  [DEFINE_BUTTON.key]: 100
@@ -14,7 +14,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
14
14
  import { fg } from '@atlaskit/platform-feature-flags';
15
15
  import Layer from '../Layer';
16
16
  const packageName = "@atlaskit/editor-common";
17
- const packageVersion = "114.34.0";
17
+ const packageVersion = "114.35.0";
18
18
  const halfFocusRing = 1;
19
19
  const dropOffset = '0, 8';
20
20
  const fadeIn = keyframes({
@@ -2,7 +2,7 @@ import { syncBlockFallbackTransform, transformDedupeMarks, transformIndentationM
2
2
  import { Fragment, Node } from '@atlaskit/editor-prosemirror/model';
3
3
  import { fg } from '@atlaskit/platform-feature-flags';
4
4
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../analytics';
5
- import { isNestedTablesSupported } from '../nesting/utilities';
5
+ import { isNestedTablesSupported, isPanelNestingTableSupported } from '../nesting/utilities';
6
6
  import { sanitizeNodeForPrivacy } from './filter/privacy-filter';
7
7
  import { findAndTrackUnsupportedContentNodes } from './track-unsupported-content';
8
8
  import { validateADFEntity } from './validate-using-spec';
@@ -247,9 +247,12 @@ export function processRawValue(schema, value, providerFactory, sanitizePrivateC
247
247
  // Validate ADF first before converting nested-table extensions into nested tables
248
248
  // This matches the renderer's behavior in render-document.ts
249
249
  const allowNestedTables = isNestedTablesSupported(schema);
250
- let entity = validateADFEntity(schema, transformedAdf || node, dispatchAnalyticsEvent, allowNestedTables ? {
251
- allowNestedTables
252
- } : undefined);
250
+ const allowTableInPanel = isPanelNestingTableSupported(schema);
251
+ const validateADFEntityOptions = allowNestedTables || allowTableInPanel ? {
252
+ allowNestedTables: allowNestedTables || undefined,
253
+ allowTableInPanel: allowTableInPanel || undefined
254
+ } : undefined;
255
+ let entity = validateADFEntity(schema, transformedAdf || node, dispatchAnalyticsEvent, validateADFEntityOptions);
253
256
 
254
257
  // Convert nested-table extensions into nested tables
255
258
  ({
@@ -6,7 +6,8 @@ const errorCallbackFor = (marks, validate, dispatchAnalyticsEvent, validationOve
6
6
  return (entity, error, options) => {
7
7
  return validationErrorHandler(entity, error, {
8
8
  ...options,
9
- allowNestedTables: validationOverrides === null || validationOverrides === void 0 ? void 0 : validationOverrides.allowNestedTables
9
+ allowNestedTables: validationOverrides === null || validationOverrides === void 0 ? void 0 : validationOverrides.allowNestedTables,
10
+ allowTableInPanel: validationOverrides === null || validationOverrides === void 0 ? void 0 : validationOverrides.allowTableInPanel
10
11
  }, marks, validate, dispatchAnalyticsEvent);
11
12
  };
12
13
  };
@@ -71,6 +72,17 @@ export const validationErrorHandler = (entity, error, options, marks, validate,
71
72
  return entity;
72
73
  }
73
74
  }
75
+
76
+ // panel_c1 is a ProseMirror-only variant: on save, table-in-panel documents are stored as
77
+ // plain ADF `panel` nodes containing a `table`. The base validator-spec does not permit
78
+ // `table` inside `panel` (it's gated behind the experiment), so we suppress the
79
+ // INVALID_CONTENT error when the experiment is active.
80
+ if (options.allowTableInPanel) {
81
+ const meta = error.meta;
82
+ if ((meta === null || meta === void 0 ? void 0 : meta.parentType) === 'panel' && error.code === 'INVALID_CONTENT' && entity.type === 'table') {
83
+ return entity;
84
+ }
85
+ }
74
86
  if (options.allowUnsupportedBlock) {
75
87
  return wrapWithUnsupported(entity);
76
88
  }
@@ -10,7 +10,7 @@ import { isFedRamp } from './environment';
10
10
  import { normaliseSentryBreadcrumbs, SERIALIZABLE_ATTRIBUTES } from './normalise-sentry-breadcrumbs';
11
11
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
12
12
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
13
- var packageVersion = "114.34.0";
13
+ var packageVersion = "114.35.0";
14
14
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
15
15
  // Remove URL as it has UGC
16
16
  // Ignored via go/ees007
@@ -1,4 +1,5 @@
1
1
  import { findTable } from '@atlaskit/editor-tables';
2
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
2
3
 
3
4
  /*
4
5
  * Returns the level of nesting of a given `nodeType` in the current position.
@@ -82,4 +83,26 @@ export var isNestedTablesSupported = function isNestedTablesSupported(schema) {
82
83
  var tableCellCanContainTable = ((_tableCell$contentMat = tableCell.contentMatch.matchType(table)) === null || _tableCell$contentMat === void 0 ? void 0 : _tableCell$contentMat.validEnd) === true;
83
84
  var tableHeaderCanContainTable = ((_tableHeader$contentM = tableHeader.contentMatch.matchType(table)) === null || _tableHeader$contentM === void 0 ? void 0 : _tableHeader$contentM.validEnd) === true;
84
85
  return tableCellCanContainTable || tableHeaderCanContainTable;
86
+ };
87
+
88
+ /*
89
+ * Returns true if the schema supports nesting a table inside a panel (panel_c1 variant),
90
+ * AND the `platform_editor_nest_table_in_panel` experiment is enabled.
91
+ *
92
+ * ```typescript
93
+ * const supportsTableInPanel = isPanelNestingTableSupported(state.schema);
94
+ * ```
95
+ */
96
+ export var isPanelNestingTableSupported = function isPanelNestingTableSupported(schema) {
97
+ var _panel_c1$contentMatc;
98
+ var _schema$nodes2 = schema.nodes,
99
+ table = _schema$nodes2.table,
100
+ panel_c1 = _schema$nodes2.panel_c1;
101
+ if (!table || !panel_c1) {
102
+ return false;
103
+ }
104
+
105
+ // Confirm the PM schema actually allows table inside panel_c1
106
+ var panelC1CanContainTable = ((_panel_c1$contentMatc = panel_c1.contentMatch.matchType(table)) === null || _panel_c1$contentMatc === void 0 ? void 0 : _panel_c1$contentMatc.validEnd) === true;
107
+ return panelC1CanContainTable && expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true);
85
108
  };
@@ -9,7 +9,7 @@ export var TOOLBAR_RANK = (_TOOLBAR_RANK = {}, _defineProperty(_defineProperty(_
9
9
  export var AI_SECTION_RANK = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ROVO_GROUP.key, 100), ROVO_GROUP_DISPLAY_SMALL.key, 100), ROVO_GROUP_PRIMARY_TOOLBAR.key, 100), DEFINE_GROUP.key, 200), IMPROVE_WRITING_GROUP.key, 300), HERO_PROMPT_BUTTON_GROUP.key, 300), AI_SUGGESTIONS_GROUP.key, 400);
10
10
  export var AI_SUGGESTIONS_GROUP_RANK = _defineProperty({}, AI_SUGGESTIONS_BUTTON.key, 100);
11
11
  export var ROVO_GROUP_RANK = _defineProperty(_defineProperty(_defineProperty({}, ROVO_HERO_BUTTON.key, 100), ROVO_WRITE_BUTTON_PRIMARY_TOOLBAR.key, 100), ROVO_MENU.key, 200);
12
- export var ROVO_GROUP_DISPLAY_SMALL_RANK = _defineProperty(_defineProperty(_defineProperty({}, ROVO_HERO_BUTTON.key, 100), ROVO_MENU_DISPLAY_SMALL.key, 200), AI_SUGGESTIONS_BUTTON.key, 300);
12
+ export var ROVO_GROUP_DISPLAY_SMALL_RANK = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ROVO_HERO_BUTTON.key, 100), ROVO_MENU_DISPLAY_SMALL.key, 200), HERO_PROMPT_BUTTON.key, 300), AI_SUGGESTIONS_BUTTON.key, 400);
13
13
  export var DEFINE_GROUP_RANK = _defineProperty({}, DEFINE_BUTTON.key, 100);
14
14
  export var IMPROVE_WRITING_GROUP_RANK = _defineProperty({}, IMPROVE_WRITING_BUTTON.key, 100);
15
15
  export var HERO_PROMPT_BUTTON_GROUP_RANK = _defineProperty({}, HERO_PROMPT_BUTTON.key, 100);
@@ -21,7 +21,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
21
21
  import { fg } from '@atlaskit/platform-feature-flags';
22
22
  import Layer from '../Layer';
23
23
  var packageName = "@atlaskit/editor-common";
24
- var packageVersion = "114.34.0";
24
+ var packageVersion = "114.35.0";
25
25
  var halfFocusRing = 1;
26
26
  var dropOffset = '0, 8';
27
27
  var fadeIn = keyframes({
@@ -2,7 +2,7 @@ import { syncBlockFallbackTransform, transformDedupeMarks, transformIndentationM
2
2
  import { Fragment, Node } from '@atlaskit/editor-prosemirror/model';
3
3
  import { fg } from '@atlaskit/platform-feature-flags';
4
4
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../analytics';
5
- import { isNestedTablesSupported } from '../nesting/utilities';
5
+ import { isNestedTablesSupported, isPanelNestingTableSupported } from '../nesting/utilities';
6
6
  import { sanitizeNodeForPrivacy } from './filter/privacy-filter';
7
7
  import { findAndTrackUnsupportedContentNodes } from './track-unsupported-content';
8
8
  import { validateADFEntity } from './validate-using-spec';
@@ -240,9 +240,12 @@ export function processRawValue(schema, value, providerFactory, sanitizePrivateC
240
240
  // Validate ADF first before converting nested-table extensions into nested tables
241
241
  // This matches the renderer's behavior in render-document.ts
242
242
  var allowNestedTables = isNestedTablesSupported(schema);
243
- var entity = validateADFEntity(schema, transformedAdf || node, dispatchAnalyticsEvent, allowNestedTables ? {
244
- allowNestedTables: allowNestedTables
245
- } : undefined);
243
+ var allowTableInPanel = isPanelNestingTableSupported(schema);
244
+ var validateADFEntityOptions = allowNestedTables || allowTableInPanel ? {
245
+ allowNestedTables: allowNestedTables || undefined,
246
+ allowTableInPanel: allowTableInPanel || undefined
247
+ } : undefined;
248
+ var entity = validateADFEntity(schema, transformedAdf || node, dispatchAnalyticsEvent, validateADFEntityOptions);
246
249
 
247
250
  // Convert nested-table extensions into nested tables
248
251
  var _transformNestedTable3 = transformNestedTablesWithAnalytics(entity, dispatchAnalyticsEvent);
@@ -8,7 +8,8 @@ import { fireUnsupportedEvent } from './track-unsupported-content';
8
8
  var errorCallbackFor = function errorCallbackFor(marks, validate, dispatchAnalyticsEvent, validationOverrides) {
9
9
  return function (entity, error, options) {
10
10
  return validationErrorHandler(entity, error, _objectSpread(_objectSpread({}, options), {}, {
11
- allowNestedTables: validationOverrides === null || validationOverrides === void 0 ? void 0 : validationOverrides.allowNestedTables
11
+ allowNestedTables: validationOverrides === null || validationOverrides === void 0 ? void 0 : validationOverrides.allowNestedTables,
12
+ allowTableInPanel: validationOverrides === null || validationOverrides === void 0 ? void 0 : validationOverrides.allowTableInPanel
12
13
  }), marks, validate, dispatchAnalyticsEvent);
13
14
  };
14
15
  };
@@ -73,6 +74,17 @@ export var validationErrorHandler = function validationErrorHandler(entity, erro
73
74
  return entity;
74
75
  }
75
76
  }
77
+
78
+ // panel_c1 is a ProseMirror-only variant: on save, table-in-panel documents are stored as
79
+ // plain ADF `panel` nodes containing a `table`. The base validator-spec does not permit
80
+ // `table` inside `panel` (it's gated behind the experiment), so we suppress the
81
+ // INVALID_CONTENT error when the experiment is active.
82
+ if (options.allowTableInPanel) {
83
+ var _meta = error.meta;
84
+ if ((_meta === null || _meta === void 0 ? void 0 : _meta.parentType) === 'panel' && error.code === 'INVALID_CONTENT' && entity.type === 'table') {
85
+ return entity;
86
+ }
87
+ }
76
88
  if (options.allowUnsupportedBlock) {
77
89
  return wrapWithUnsupported(entity);
78
90
  }
@@ -4,3 +4,4 @@ export declare const getParentOfTypeCount: (nodeType: NodeType) => ($pos: Resolv
4
4
  export declare const getPositionAfterTopParentNodeOfType: (nodeType: NodeType) => ($pos: ResolvedPos) => number | undefined;
5
5
  export declare const isSelectionTableNestedInTable: (state: EditorState) => boolean;
6
6
  export declare const isNestedTablesSupported: (schema: Schema) => boolean;
7
+ export declare const isPanelNestingTableSupported: (schema: Schema) => boolean;
@@ -35,6 +35,7 @@ export declare const ROVO_GROUP_RANK: {
35
35
  };
36
36
  export declare const ROVO_GROUP_DISPLAY_SMALL_RANK: {
37
37
  'ai-suggestions-button': number;
38
+ 'hero-prompt-button': number;
38
39
  'rovo-hero-button': number;
39
40
  'rovo-menu-display-small': number;
40
41
  };
@@ -5,17 +5,18 @@ export declare const UNSUPPORTED_NODE_ATTRIBUTE = "unsupportedNodeAttribute";
5
5
  import type { UnsupportedContentPayload } from './unsupportedContent/types';
6
6
  export type DispatchAnalyticsEvent = (event: UnsupportedContentPayload) => void;
7
7
  export declare const validationErrorHandler: (entity: ADFEntity, error: ValidationError, options: ErrorCallbackOptions, marks: string[], validate: Validate, dispatchAnalyticsEvent?: DispatchAnalyticsEvent) => ADFEntity | {
8
- type: string;
9
8
  attrs: {
10
9
  originalValue: ADFEntity;
11
10
  };
11
+ type: string;
12
12
  } | undefined;
13
13
  export declare const validateADFEntity: (schema: Schema, node: ADFEntity, dispatchAnalyticsEvent?: DispatchAnalyticsEvent, validationOverrides?: {
14
14
  allowNestedTables?: boolean;
15
+ allowTableInPanel?: boolean;
15
16
  }) => ADFEntity;
16
17
  export declare function wrapWithUnsupported(originalValue: ADFEntity, type?: 'block' | 'inline' | 'mark'): {
17
- type: string;
18
18
  attrs: {
19
19
  originalValue: ADFEntity;
20
20
  };
21
+ type: string;
21
22
  };
@@ -4,3 +4,4 @@ export declare const getParentOfTypeCount: (nodeType: NodeType) => ($pos: Resolv
4
4
  export declare const getPositionAfterTopParentNodeOfType: (nodeType: NodeType) => ($pos: ResolvedPos) => number | undefined;
5
5
  export declare const isSelectionTableNestedInTable: (state: EditorState) => boolean;
6
6
  export declare const isNestedTablesSupported: (schema: Schema) => boolean;
7
+ export declare const isPanelNestingTableSupported: (schema: Schema) => boolean;
@@ -35,6 +35,7 @@ export declare const ROVO_GROUP_RANK: {
35
35
  };
36
36
  export declare const ROVO_GROUP_DISPLAY_SMALL_RANK: {
37
37
  'ai-suggestions-button': number;
38
+ 'hero-prompt-button': number;
38
39
  'rovo-hero-button': number;
39
40
  'rovo-menu-display-small': number;
40
41
  };
@@ -5,17 +5,18 @@ export declare const UNSUPPORTED_NODE_ATTRIBUTE = "unsupportedNodeAttribute";
5
5
  import type { UnsupportedContentPayload } from './unsupportedContent/types';
6
6
  export type DispatchAnalyticsEvent = (event: UnsupportedContentPayload) => void;
7
7
  export declare const validationErrorHandler: (entity: ADFEntity, error: ValidationError, options: ErrorCallbackOptions, marks: string[], validate: Validate, dispatchAnalyticsEvent?: DispatchAnalyticsEvent) => ADFEntity | {
8
- type: string;
9
8
  attrs: {
10
9
  originalValue: ADFEntity;
11
10
  };
11
+ type: string;
12
12
  } | undefined;
13
13
  export declare const validateADFEntity: (schema: Schema, node: ADFEntity, dispatchAnalyticsEvent?: DispatchAnalyticsEvent, validationOverrides?: {
14
14
  allowNestedTables?: boolean;
15
+ allowTableInPanel?: boolean;
15
16
  }) => ADFEntity;
16
17
  export declare function wrapWithUnsupported(originalValue: ADFEntity, type?: 'block' | 'inline' | 'mark'): {
17
- type: string;
18
18
  attrs: {
19
19
  originalValue: ADFEntity;
20
20
  };
21
+ type: string;
21
22
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "114.35.0",
3
+ "version": "114.36.0",
4
4
  "description": "A package that contains common classes and components for editor and renderer",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -37,8 +37,8 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "@atlaskit/activity-provider": "^2.6.0",
40
- "@atlaskit/adf-schema": "^52.11.0",
41
- "@atlaskit/adf-utils": "^19.29.0",
40
+ "@atlaskit/adf-schema": "^52.12.0",
41
+ "@atlaskit/adf-utils": "^19.30.0",
42
42
  "@atlaskit/afm-i18n-platform-editor-editor-common": "2.18.0",
43
43
  "@atlaskit/analytics-listeners": "^10.1.0",
44
44
  "@atlaskit/analytics-namespaced-context": "^7.3.0",
@@ -49,18 +49,18 @@
49
49
  "@atlaskit/codemod-utils": "^4.2.0",
50
50
  "@atlaskit/css": "^0.19.0",
51
51
  "@atlaskit/custom-steps": "^0.17.0",
52
- "@atlaskit/dropdown-menu": "^16.8.0",
52
+ "@atlaskit/dropdown-menu": "^16.9.0",
53
53
  "@atlaskit/editor-json-transformer": "^8.32.0",
54
54
  "@atlaskit/editor-palette": "^2.2.0",
55
55
  "@atlaskit/editor-prosemirror": "^7.3.0",
56
56
  "@atlaskit/editor-shared-styles": "^3.11.0",
57
57
  "@atlaskit/editor-tables": "^2.10.0",
58
- "@atlaskit/editor-toolbar": "^1.5.0",
58
+ "@atlaskit/editor-toolbar": "^1.6.0",
59
59
  "@atlaskit/editor-toolbar-model": "^0.5.0",
60
60
  "@atlaskit/emoji": "^70.9.0",
61
61
  "@atlaskit/icon": "^35.0.0",
62
62
  "@atlaskit/link": "^3.4.0",
63
- "@atlaskit/link-datasource": "^5.2.0",
63
+ "@atlaskit/link-datasource": "^5.3.0",
64
64
  "@atlaskit/link-picker": "^5.1.0",
65
65
  "@atlaskit/media-card": "^80.5.0",
66
66
  "@atlaskit/media-client": "^36.3.0",
@@ -87,7 +87,7 @@
87
87
  "@atlaskit/task-decision": "^20.1.0",
88
88
  "@atlaskit/teams-app-config": "^1.12.0",
89
89
  "@atlaskit/textfield": "^8.3.0",
90
- "@atlaskit/tmp-editor-statsig": "^81.1.0",
90
+ "@atlaskit/tmp-editor-statsig": "^81.2.0",
91
91
  "@atlaskit/tokens": "^13.0.0",
92
92
  "@atlaskit/tooltip": "^22.2.0",
93
93
  "@atlaskit/width-detector": "^5.1.0",
@@ -107,7 +107,7 @@
107
107
  "fuse.js": "^6.6.2",
108
108
  "linkify-it": "^3.0.3",
109
109
  "lodash": "^4.17.21",
110
- "markdown-it": "^14.1.1",
110
+ "markdown-it": "^13.0.2",
111
111
  "memoize-one": "^6.0.0",
112
112
  "popper.js": "^1.14.1",
113
113
  "prop-types": "^15.5.10",