@atlaskit/editor-plugin-block-menu 9.2.9 → 9.2.10

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.
Files changed (35) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/cjs/editor-actions/isTransformToTargetDisabled.js +1 -1
  3. package/dist/cjs/editor-commands/selection.js +2 -1
  4. package/dist/cjs/editor-commands/transform-node-utils/TRANSFORMATION_MATRIX.js +272 -201
  5. package/dist/cjs/editor-commands/transform-node-utils/steps/wrapMixedContentStep.js +1 -1
  6. package/dist/cjs/editor-commands/transform-node-utils/transform.js +26 -6
  7. package/dist/cjs/editor-commands/transform-node-utils/types.js +1 -0
  8. package/dist/cjs/editor-commands/transform-node-utils/utils.js +14 -7
  9. package/dist/cjs/ui/utils/copyLink.js +17 -17
  10. package/dist/es2019/editor-actions/isTransformToTargetDisabled.js +1 -1
  11. package/dist/es2019/editor-commands/selection.js +2 -1
  12. package/dist/es2019/editor-commands/transform-node-utils/TRANSFORMATION_MATRIX.js +75 -7
  13. package/dist/es2019/editor-commands/transform-node-utils/steps/wrapMixedContentStep.js +1 -1
  14. package/dist/es2019/editor-commands/transform-node-utils/transform.js +25 -5
  15. package/dist/es2019/editor-commands/transform-node-utils/types.js +1 -0
  16. package/dist/es2019/editor-commands/transform-node-utils/utils.js +8 -1
  17. package/dist/esm/editor-actions/isTransformToTargetDisabled.js +1 -1
  18. package/dist/esm/editor-commands/selection.js +2 -1
  19. package/dist/esm/editor-commands/transform-node-utils/TRANSFORMATION_MATRIX.js +270 -200
  20. package/dist/esm/editor-commands/transform-node-utils/steps/wrapMixedContentStep.js +1 -1
  21. package/dist/esm/editor-commands/transform-node-utils/transform.js +25 -5
  22. package/dist/esm/editor-commands/transform-node-utils/types.js +1 -0
  23. package/dist/esm/editor-commands/transform-node-utils/utils.js +8 -1
  24. package/dist/esm/ui/utils/copyLink.js +17 -17
  25. package/dist/types/editor-commands/transform-node-utils/TRANSFORMATION_MATRIX.d.ts +4 -1
  26. package/dist/types/editor-commands/transform-node-utils/transform.d.ts +1 -0
  27. package/dist/types/editor-commands/transform-node-utils/types.d.ts +1 -1
  28. package/dist/types/editor-commands/transform-node-utils/utils.d.ts +1 -1
  29. package/dist/types/editor-commands/types.d.ts +1 -1
  30. package/dist/types-ts4.5/editor-commands/transform-node-utils/TRANSFORMATION_MATRIX.d.ts +4 -1
  31. package/dist/types-ts4.5/editor-commands/transform-node-utils/transform.d.ts +1 -0
  32. package/dist/types-ts4.5/editor-commands/transform-node-utils/types.d.ts +1 -1
  33. package/dist/types-ts4.5/editor-commands/transform-node-utils/utils.d.ts +1 -1
  34. package/dist/types-ts4.5/editor-commands/types.d.ts +1 -1
  35. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @atlaskit/editor-plugin-block-menu
2
2
 
3
+ ## 9.2.10
4
+
5
+ ### Patch Changes
6
+
7
+ - [`78c42f10ef772`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/78c42f10ef772) -
8
+ Add support in block menu for new panel_c1 variant which allows tables inside
9
+ - Updated dependencies
10
+
3
11
  ## 9.2.9
4
12
 
5
13
  ### Patch Changes
@@ -10,7 +10,7 @@ var _transform = require("../editor-commands/transform-node-utils/transform");
10
10
  var _types = require("../editor-commands/transform-node-utils/types");
11
11
  var _utils = require("../editor-commands/transform-node-utils/utils");
12
12
  var canParentContainNodeType = exports.canParentContainNodeType = function canParentContainNodeType(schema, selectedNodeTypeName, parentNode, nodeTypeName, nodeTypeAttrs) {
13
- var adjustedNodeTypeName = (0, _utils.getTargetNodeTypeNameInContext)(nodeTypeName, true, parentNode);
13
+ var adjustedNodeTypeName = (0, _utils.getTargetNodeTypeNameInContext)(nodeTypeName, true, parentNode, schema);
14
14
  if (!adjustedNodeTypeName) {
15
15
  return false;
16
16
  }
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.setSelectionAfterTransform = void 0;
7
7
  var _state = require("@atlaskit/editor-prosemirror/state");
8
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
8
9
  /**
9
10
  * Sets the appropriate selection after transforming a node to a target type
10
11
  * @param newTr - The transaction containing the transformed node
@@ -23,7 +24,7 @@ var setSelectionAfterTransform = exports.setSelectionAfterTransform = function s
23
24
  // Check if target type is other than list, text, heading, blockquotes
24
25
  var isListNode = targetType === 'bulletList' || targetType === 'orderedList' || targetType === 'taskList';
25
26
  var isBlockquote = targetType === 'blockquote';
26
- var isContainer = ['panel', 'expand', 'codeBlock', 'layoutSection'].includes(targetType);
27
+ var isContainer = (0, _expValEquals.expValEquals)('platform_editor_nest_table_in_panel', 'isEnabled', true) ? ['panel', 'panel_c1', 'expand', 'codeBlock', 'layoutSection'].includes(targetType) : ['panel', 'expand', 'codeBlock', 'layoutSection'].includes(targetType);
27
28
  if (isListNode || isBlockquote) {
28
29
  // For taskList, select all content within the list
29
30
  var textStart = transformedNodePos.pos + 1; // Inside the taskList
@@ -1,9 +1,11 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
- exports.TRANSFORMATION_MATRIX = void 0;
7
+ exports.TRANSFORMATION_MATRIX_PANEL_C1 = exports.TRANSFORMATION_MATRIX = void 0;
8
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
7
9
  var _applyTargetTextTypeStep = require("./steps/applyTargetTextTypeStep");
8
10
  var _convertEachNodeStep = require("./steps/convertEachNodeStep");
9
11
  var _decisionListToListStep = require("./steps/decisionListToListStep");
@@ -20,203 +22,272 @@ var _wrapBlockquoteToDecisionListStep = require("./steps/wrapBlockquoteToDecisio
20
22
  var _wrapIntoListStep = require("./steps/wrapIntoListStep");
21
23
  var _wrapMixedContentStep = require("./steps/wrapMixedContentStep");
22
24
  var _wrapStep = require("./steps/wrapStep");
23
- // Transform steps for all node type pairs.
24
- // If a transformation is not defined (undefined), it is not available.
25
- var TRANSFORMATION_MATRIX = exports.TRANSFORMATION_MATRIX = {
26
- paragraph: {
27
- heading: [_flattenStep.flattenStep, _applyTargetTextTypeStep.applyTargetTextTypeStep],
28
- blockquote: [_wrapMixedContentStep.wrapMixedContentStep],
29
- codeBlock: [_wrapMixedContentStep.wrapMixedContentStep],
30
- expand: [_wrapMixedContentStep.wrapMixedContentStep],
31
- nestedExpand: [_wrapMixedContentStep.wrapMixedContentStep],
32
- layoutSection: [_wrapMixedContentStep.wrapMixedContentStep],
33
- panel: [_wrapMixedContentStep.wrapMixedContentStep],
34
- bulletList: [_wrapIntoListStep.wrapIntoListStep],
35
- orderedList: [_wrapIntoListStep.wrapIntoListStep],
36
- taskList: [_wrapIntoListStep.wrapIntoListStep],
37
- decisionList: [_wrapIntoListStep.wrapIntoListStep]
38
- },
39
- heading: {
40
- heading: [_flattenStep.flattenStep, _applyTargetTextTypeStep.applyTargetTextTypeStep],
41
- paragraph: [_flattenStep.flattenStep, _applyTargetTextTypeStep.applyTargetTextTypeStep],
42
- blockquote: [_wrapMixedContentStep.wrapMixedContentStep],
43
- codeBlock: [_wrapMixedContentStep.wrapMixedContentStep],
44
- expand: [_wrapMixedContentStep.wrapMixedContentStep],
45
- nestedExpand: [_wrapMixedContentStep.wrapMixedContentStep],
46
- layoutSection: [_wrapMixedContentStep.wrapMixedContentStep],
47
- panel: [_wrapMixedContentStep.wrapMixedContentStep],
48
- bulletList: [_wrapIntoListStep.wrapIntoListStep],
49
- orderedList: [_wrapIntoListStep.wrapIntoListStep],
50
- taskList: [_wrapIntoListStep.wrapIntoListStep],
51
- decisionList: [_wrapIntoListStep.wrapIntoListStep]
52
- },
53
- panel: {
54
- blockquote: [_unwrapStep.unwrapStep, _wrapMixedContentStep.wrapMixedContentStep],
55
- codeBlock: [_unwrapStep.unwrapStep, _wrapMixedContentStep.wrapMixedContentStep],
56
- expand: [_unwrapStep.unwrapStep, _wrapStep.wrapStep],
57
- nestedExpand: [_unwrapStep.unwrapStep, _wrapStep.wrapStep],
58
- layoutSection: [_unwrapStep.unwrapStep, _wrapMixedContentStep.wrapMixedContentStep],
59
- paragraph: [_unwrapStep.unwrapStep]
60
- },
61
- expand: {
62
- panel: [_unwrapExpandStep.unwrapExpandStep, _wrapMixedContentStep.wrapMixedContentStep],
63
- blockquote: [_unwrapExpandStep.unwrapExpandStep, _wrapMixedContentStep.wrapMixedContentStep],
64
- layoutSection: [_unwrapExpandStep.unwrapExpandStep, _wrapMixedContentStep.wrapMixedContentStep],
65
- nestedExpand: [_unwrapExpandStep.unwrapExpandStep, _wrapStep.wrapStep],
66
- paragraph: [_unwrapExpandStep.unwrapExpandStep]
67
- },
68
- nestedExpand: {
69
- panel: [_unwrapExpandStep.unwrapExpandStep, _wrapMixedContentStep.wrapMixedContentStep],
70
- blockquote: [_unwrapExpandStep.unwrapExpandStep, _wrapMixedContentStep.wrapMixedContentStep],
71
- layoutSection: [_unwrapExpandStep.unwrapExpandStep, _wrapMixedContentStep.wrapMixedContentStep],
72
- paragraph: [_unwrapExpandStep.unwrapExpandStep]
73
- },
74
- blockquote: {
75
- expand: [_wrapStep.wrapStep],
76
- nestedExpand: [_wrapStep.wrapStep],
77
- layoutSection: [_wrapMixedContentStep.wrapMixedContentStep],
78
- panel: [_unwrapStep.unwrapStep, _wrapStep.wrapStep],
79
- paragraph: [_unwrapStep.unwrapStep],
80
- decisionList: [_unwrapStep.unwrapStep, _wrapBlockquoteToDecisionListStep.wrapBlockquoteToDecisionListStep]
81
- },
82
- layoutSection: {
83
- blockquote: [_unwrapLayoutStep.unwrapLayoutStep, _wrapMixedContentStep.wrapMixedContentStep],
84
- expand: [_unwrapLayoutStep.unwrapLayoutStep, _wrapStep.wrapStep],
85
- nestedExpand: [_unwrapLayoutStep.unwrapLayoutStep, _wrapStep.wrapStep],
86
- panel: [_unwrapLayoutStep.unwrapLayoutStep, _wrapMixedContentStep.wrapMixedContentStep],
87
- paragraph: [_unwrapLayoutStep.unwrapLayoutStep]
88
- },
89
- codeBlock: {
90
- blockquote: [_wrapStep.wrapStep],
91
- expand: [_wrapStep.wrapStep],
92
- nestedExpand: [_wrapStep.wrapStep],
93
- layoutSection: [_wrapMixedContentStep.wrapMixedContentStep],
94
- panel: [_wrapStep.wrapStep],
95
- paragraph: [_applyTargetTextTypeStep.applyTargetTextTypeStep]
96
- },
97
- bulletList: {
98
- orderedList: [_listToListStep.listToListStep],
99
- taskList: [_listToListStep.listToListStep],
100
- decisionList: [_flattenListStep.flattenListStep, _listToDecisionListStep.listToDecisionListStep],
101
- blockquote: [_wrapStep.wrapStep],
102
- expand: [_wrapStep.wrapStep],
103
- nestedExpand: [_wrapStep.wrapStep],
104
- layoutSection: [_wrapMixedContentStep.wrapMixedContentStep],
105
- panel: [_wrapStep.wrapStep],
106
- paragraph: [_flattenListStep.flattenListStep, _unwrapListStep.unwrapListStep, _applyTargetTextTypeStep.applyTargetTextTypeStep]
107
- },
108
- orderedList: {
109
- bulletList: [_listToListStep.listToListStep],
110
- taskList: [_listToListStep.listToListStep],
111
- decisionList: [_flattenListStep.flattenListStep, _listToDecisionListStep.listToDecisionListStep],
112
- blockquote: [_wrapStep.wrapStep],
113
- expand: [_wrapStep.wrapStep],
114
- nestedExpand: [_wrapStep.wrapStep],
115
- layoutSection: [_wrapMixedContentStep.wrapMixedContentStep],
116
- panel: [_wrapStep.wrapStep],
117
- paragraph: [_flattenListStep.flattenListStep, _unwrapListStep.unwrapListStep, _applyTargetTextTypeStep.applyTargetTextTypeStep]
118
- },
119
- taskList: {
120
- bulletList: [_listToListStep.listToListStep],
121
- orderedList: [_listToListStep.listToListStep],
122
- decisionList: [_flattenListStep.flattenListStep, _listToDecisionListStep.listToDecisionListStep],
123
- expand: [_wrapStep.wrapStep],
124
- nestedExpand: [_wrapStep.wrapStep],
125
- layoutSection: [_wrapMixedContentStep.wrapMixedContentStep],
126
- panel: [_wrapStep.wrapStep],
127
- paragraph: [_flattenListStep.flattenListStep, _unwrapListStep.unwrapListStep, _applyTargetTextTypeStep.applyTargetTextTypeStep]
128
- },
129
- table: {
130
- expand: [_wrapStep.wrapStep],
131
- nestedExpand: [_wrapStep.wrapStep],
132
- layoutSection: [_wrapMixedContentStep.wrapMixedContentStep]
133
- },
134
- mediaSingle: {
135
- blockquote: [_wrapStep.wrapStep],
136
- expand: [_wrapStep.wrapStep],
137
- nestedExpand: [_wrapStep.wrapStep],
138
- layoutSection: [_wrapMixedContentStep.wrapMixedContentStep],
139
- panel: [_wrapStep.wrapStep],
140
- bulletList: [_wrapIntoListStep.wrapIntoListStep],
141
- orderedList: [_wrapIntoListStep.wrapIntoListStep]
142
- },
143
- mediaGroup: {
144
- blockquote: [_wrapStep.wrapStep],
145
- expand: [_wrapStep.wrapStep],
146
- nestedExpand: [_wrapStep.wrapStep],
147
- layoutSection: [_wrapMixedContentStep.wrapMixedContentStep],
148
- panel: [_wrapStep.wrapStep]
149
- },
150
- media: {
151
- blockquote: [_wrapStep.wrapStep],
152
- codeBlock: [_wrapStep.wrapStep],
153
- expand: [_wrapStep.wrapStep],
154
- nestedExpand: [_wrapStep.wrapStep],
155
- layoutSection: [_wrapStep.wrapStep],
156
- panel: [_wrapStep.wrapStep],
157
- bulletList: [_wrapIntoListStep.wrapIntoListStep],
158
- orderedList: [_wrapIntoListStep.wrapIntoListStep],
159
- taskList: [_wrapIntoListStep.wrapIntoListStep],
160
- decisionList: [_wrapIntoListStep.wrapIntoListStep]
161
- },
162
- decisionList: {
163
- bulletList: [_decisionListToListStep.decisionListToListStep],
164
- orderedList: [_decisionListToListStep.decisionListToListStep],
165
- taskList: [_decisionListToListStep.decisionListToListStep],
166
- blockquote: [_unwrapListStep.unwrapListStep, _wrapStep.wrapStep],
167
- expand: [_wrapStep.wrapStep],
168
- nestedExpand: [_wrapStep.wrapStep],
169
- layoutSection: [_wrapMixedContentStep.wrapMixedContentStep],
170
- panel: [_wrapStep.wrapStep],
171
- paragraph: [_flattenListStep.flattenListStep, _unwrapListStep.unwrapListStep, _applyTargetTextTypeStep.applyTargetTextTypeStep],
172
- heading: [_flattenListStep.flattenListStep, _unwrapListStep.unwrapListStep, _applyTargetTextTypeStep.applyTargetTextTypeStep]
173
- },
174
- blockCard: {
175
- expand: [_wrapStep.wrapStep],
176
- nestedExpand: [_wrapStep.wrapStep],
177
- layoutSection: [_wrapMixedContentStep.wrapMixedContentStep],
178
- panel: [_wrapStep.wrapStep]
179
- },
180
- embedCard: {
181
- expand: [_wrapStep.wrapStep],
182
- nestedExpand: [_wrapStep.wrapStep],
183
- layoutSection: [_wrapMixedContentStep.wrapMixedContentStep]
184
- },
185
- extension: {
186
- blockquote: [_wrapStep.wrapStep],
187
- expand: [_wrapStep.wrapStep],
188
- nestedExpand: [_wrapStep.wrapStep],
189
- layoutSection: [_wrapMixedContentStep.wrapMixedContentStep],
190
- panel: [_wrapStep.wrapStep]
191
- },
192
- bodiedExtension: {
193
- nestedExpand: [_wrapStep.wrapStep],
194
- layoutSection: [_wrapMixedContentStep.wrapMixedContentStep]
195
- },
196
- multiBodiedExtension: {
197
- blockquote: [_wrapStep.wrapStep],
198
- codeBlock: [_wrapStep.wrapStep],
199
- expand: [_wrapStep.wrapStep],
200
- nestedExpand: [_wrapStep.wrapStep],
201
- layoutSection: [_wrapStep.wrapStep],
202
- panel: [_wrapStep.wrapStep],
203
- bulletList: [_wrapIntoListStep.wrapIntoListStep],
204
- orderedList: [_wrapIntoListStep.wrapIntoListStep],
205
- taskList: [_wrapIntoListStep.wrapIntoListStep],
206
- decisionList: [_wrapIntoListStep.wrapIntoListStep]
207
- },
208
- multi: {
209
- blockquote: [_wrapMixedContentStep.wrapMixedContentStep],
210
- codeBlock: [_wrapMixedContentStep.wrapMixedContentStep],
211
- expand: [_wrapMixedContentStep.wrapMixedContentStep],
212
- nestedExpand: [_wrapMixedContentStep.wrapMixedContentStep],
213
- layoutSection: [_wrapMixedContentStep.wrapMixedContentStep],
214
- panel: [_wrapMixedContentStep.wrapMixedContentStep],
215
- bulletList: [_convertEachNodeStep.convertEachNodeStep, _mergeNeighbourListsStep.mergeNeighbourListsStep],
216
- orderedList: [_convertEachNodeStep.convertEachNodeStep, _mergeNeighbourListsStep.mergeNeighbourListsStep],
217
- taskList: [_convertEachNodeStep.convertEachNodeStep, _mergeNeighbourListsStep.mergeNeighbourListsStep],
218
- decisionList: [_convertEachNodeStep.convertEachNodeStep, _mergeNeighbourListsStep.mergeNeighbourListsStep],
219
- paragraph: [_convertEachNodeStep.convertEachNodeStep],
220
- heading: [_applyTargetTextTypeStep.applyTargetTextTypeStep]
221
- }
222
- };
25
+ 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; }
26
+ 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; }
27
+ /**
28
+ * Creates the transformation matrix for all node type pairs.
29
+ * When includePanelC1 is true (platform_editor_nest_table_in_panel experiment on),
30
+ * panel_c1 entries are included as both source and target types.
31
+ * If a transformation is not defined (undefined), it is not available.
32
+ */
33
+ var createTransformationMatrix = function createTransformationMatrix(includePanelC1) {
34
+ return {
35
+ paragraph: _objectSpread(_objectSpread({
36
+ heading: [_flattenStep.flattenStep, _applyTargetTextTypeStep.applyTargetTextTypeStep],
37
+ blockquote: [_wrapMixedContentStep.wrapMixedContentStep],
38
+ codeBlock: [_wrapMixedContentStep.wrapMixedContentStep],
39
+ expand: [_wrapMixedContentStep.wrapMixedContentStep],
40
+ nestedExpand: [_wrapMixedContentStep.wrapMixedContentStep],
41
+ layoutSection: [_wrapMixedContentStep.wrapMixedContentStep],
42
+ panel: [_wrapMixedContentStep.wrapMixedContentStep]
43
+ }, includePanelC1 ? {
44
+ panel_c1: [_wrapMixedContentStep.wrapMixedContentStep]
45
+ } : {}), {}, {
46
+ bulletList: [_wrapIntoListStep.wrapIntoListStep],
47
+ orderedList: [_wrapIntoListStep.wrapIntoListStep],
48
+ taskList: [_wrapIntoListStep.wrapIntoListStep],
49
+ decisionList: [_wrapIntoListStep.wrapIntoListStep]
50
+ }),
51
+ heading: _objectSpread(_objectSpread({
52
+ heading: [_flattenStep.flattenStep, _applyTargetTextTypeStep.applyTargetTextTypeStep],
53
+ paragraph: [_flattenStep.flattenStep, _applyTargetTextTypeStep.applyTargetTextTypeStep],
54
+ blockquote: [_wrapMixedContentStep.wrapMixedContentStep],
55
+ codeBlock: [_wrapMixedContentStep.wrapMixedContentStep],
56
+ expand: [_wrapMixedContentStep.wrapMixedContentStep],
57
+ nestedExpand: [_wrapMixedContentStep.wrapMixedContentStep],
58
+ layoutSection: [_wrapMixedContentStep.wrapMixedContentStep],
59
+ panel: [_wrapMixedContentStep.wrapMixedContentStep]
60
+ }, includePanelC1 ? {
61
+ panel_c1: [_wrapMixedContentStep.wrapMixedContentStep]
62
+ } : {}), {}, {
63
+ bulletList: [_wrapIntoListStep.wrapIntoListStep],
64
+ orderedList: [_wrapIntoListStep.wrapIntoListStep],
65
+ taskList: [_wrapIntoListStep.wrapIntoListStep],
66
+ decisionList: [_wrapIntoListStep.wrapIntoListStep]
67
+ }),
68
+ panel: {
69
+ blockquote: [_unwrapStep.unwrapStep, _wrapMixedContentStep.wrapMixedContentStep],
70
+ codeBlock: [_unwrapStep.unwrapStep, _wrapMixedContentStep.wrapMixedContentStep],
71
+ expand: [_unwrapStep.unwrapStep, _wrapStep.wrapStep],
72
+ nestedExpand: [_unwrapStep.unwrapStep, _wrapStep.wrapStep],
73
+ layoutSection: [_unwrapStep.unwrapStep, _wrapMixedContentStep.wrapMixedContentStep],
74
+ paragraph: [_unwrapStep.unwrapStep]
75
+ },
76
+ panel_c1: includePanelC1 ? {
77
+ blockquote: [_unwrapStep.unwrapStep, _wrapMixedContentStep.wrapMixedContentStep],
78
+ codeBlock: [_unwrapStep.unwrapStep, _wrapMixedContentStep.wrapMixedContentStep],
79
+ expand: [_unwrapStep.unwrapStep, _wrapStep.wrapStep],
80
+ nestedExpand: [_unwrapStep.unwrapStep, _wrapStep.wrapStep],
81
+ layoutSection: [_unwrapStep.unwrapStep, _wrapMixedContentStep.wrapMixedContentStep],
82
+ paragraph: [_unwrapStep.unwrapStep]
83
+ } : {},
84
+ expand: _objectSpread(_objectSpread({
85
+ panel: [_unwrapExpandStep.unwrapExpandStep, _wrapMixedContentStep.wrapMixedContentStep]
86
+ }, includePanelC1 ? {
87
+ panel_c1: [_unwrapExpandStep.unwrapExpandStep, _wrapMixedContentStep.wrapMixedContentStep]
88
+ } : {}), {}, {
89
+ blockquote: [_unwrapExpandStep.unwrapExpandStep, _wrapMixedContentStep.wrapMixedContentStep],
90
+ layoutSection: [_unwrapExpandStep.unwrapExpandStep, _wrapMixedContentStep.wrapMixedContentStep],
91
+ nestedExpand: [_unwrapExpandStep.unwrapExpandStep, _wrapStep.wrapStep],
92
+ paragraph: [_unwrapExpandStep.unwrapExpandStep]
93
+ }),
94
+ nestedExpand: _objectSpread(_objectSpread({
95
+ panel: [_unwrapExpandStep.unwrapExpandStep, _wrapMixedContentStep.wrapMixedContentStep]
96
+ }, includePanelC1 ? {
97
+ panel_c1: [_unwrapExpandStep.unwrapExpandStep, _wrapMixedContentStep.wrapMixedContentStep]
98
+ } : {}), {}, {
99
+ blockquote: [_unwrapExpandStep.unwrapExpandStep, _wrapMixedContentStep.wrapMixedContentStep],
100
+ layoutSection: [_unwrapExpandStep.unwrapExpandStep, _wrapMixedContentStep.wrapMixedContentStep],
101
+ paragraph: [_unwrapExpandStep.unwrapExpandStep]
102
+ }),
103
+ blockquote: _objectSpread(_objectSpread({
104
+ expand: [_wrapStep.wrapStep],
105
+ nestedExpand: [_wrapStep.wrapStep],
106
+ layoutSection: [_wrapMixedContentStep.wrapMixedContentStep],
107
+ panel: [_unwrapStep.unwrapStep, _wrapStep.wrapStep]
108
+ }, includePanelC1 ? {
109
+ panel_c1: [_unwrapStep.unwrapStep, _wrapStep.wrapStep]
110
+ } : {}), {}, {
111
+ paragraph: [_unwrapStep.unwrapStep],
112
+ decisionList: [_unwrapStep.unwrapStep, _wrapBlockquoteToDecisionListStep.wrapBlockquoteToDecisionListStep]
113
+ }),
114
+ layoutSection: _objectSpread(_objectSpread({
115
+ blockquote: [_unwrapLayoutStep.unwrapLayoutStep, _wrapMixedContentStep.wrapMixedContentStep],
116
+ expand: [_unwrapLayoutStep.unwrapLayoutStep, _wrapStep.wrapStep],
117
+ nestedExpand: [_unwrapLayoutStep.unwrapLayoutStep, _wrapStep.wrapStep],
118
+ panel: [_unwrapLayoutStep.unwrapLayoutStep, _wrapMixedContentStep.wrapMixedContentStep]
119
+ }, includePanelC1 ? {
120
+ panel_c1: [_unwrapLayoutStep.unwrapLayoutStep, _wrapMixedContentStep.wrapMixedContentStep]
121
+ } : {}), {}, {
122
+ paragraph: [_unwrapLayoutStep.unwrapLayoutStep]
123
+ }),
124
+ codeBlock: _objectSpread(_objectSpread({
125
+ blockquote: [_wrapStep.wrapStep],
126
+ expand: [_wrapStep.wrapStep],
127
+ nestedExpand: [_wrapStep.wrapStep],
128
+ layoutSection: [_wrapMixedContentStep.wrapMixedContentStep],
129
+ panel: [_wrapStep.wrapStep]
130
+ }, includePanelC1 ? {
131
+ panel_c1: [_wrapStep.wrapStep]
132
+ } : {}), {}, {
133
+ paragraph: [_applyTargetTextTypeStep.applyTargetTextTypeStep]
134
+ }),
135
+ bulletList: _objectSpread(_objectSpread({
136
+ orderedList: [_listToListStep.listToListStep],
137
+ taskList: [_listToListStep.listToListStep],
138
+ decisionList: [_flattenListStep.flattenListStep, _listToDecisionListStep.listToDecisionListStep],
139
+ blockquote: [_wrapStep.wrapStep],
140
+ expand: [_wrapStep.wrapStep],
141
+ nestedExpand: [_wrapStep.wrapStep],
142
+ layoutSection: [_wrapMixedContentStep.wrapMixedContentStep],
143
+ panel: [_wrapStep.wrapStep]
144
+ }, includePanelC1 ? {
145
+ panel_c1: [_wrapStep.wrapStep]
146
+ } : {}), {}, {
147
+ paragraph: [_flattenListStep.flattenListStep, _unwrapListStep.unwrapListStep, _applyTargetTextTypeStep.applyTargetTextTypeStep]
148
+ }),
149
+ orderedList: _objectSpread(_objectSpread({
150
+ bulletList: [_listToListStep.listToListStep],
151
+ taskList: [_listToListStep.listToListStep],
152
+ decisionList: [_flattenListStep.flattenListStep, _listToDecisionListStep.listToDecisionListStep],
153
+ blockquote: [_wrapStep.wrapStep],
154
+ expand: [_wrapStep.wrapStep],
155
+ nestedExpand: [_wrapStep.wrapStep],
156
+ layoutSection: [_wrapMixedContentStep.wrapMixedContentStep],
157
+ panel: [_wrapStep.wrapStep]
158
+ }, includePanelC1 ? {
159
+ panel_c1: [_wrapStep.wrapStep]
160
+ } : {}), {}, {
161
+ paragraph: [_flattenListStep.flattenListStep, _unwrapListStep.unwrapListStep, _applyTargetTextTypeStep.applyTargetTextTypeStep]
162
+ }),
163
+ taskList: _objectSpread(_objectSpread({
164
+ bulletList: [_listToListStep.listToListStep],
165
+ orderedList: [_listToListStep.listToListStep],
166
+ decisionList: [_flattenListStep.flattenListStep, _listToDecisionListStep.listToDecisionListStep],
167
+ expand: [_wrapStep.wrapStep],
168
+ nestedExpand: [_wrapStep.wrapStep],
169
+ layoutSection: [_wrapMixedContentStep.wrapMixedContentStep],
170
+ panel: [_wrapStep.wrapStep]
171
+ }, includePanelC1 ? {
172
+ panel_c1: [_wrapStep.wrapStep]
173
+ } : {}), {}, {
174
+ paragraph: [_flattenListStep.flattenListStep, _unwrapListStep.unwrapListStep, _applyTargetTextTypeStep.applyTargetTextTypeStep]
175
+ }),
176
+ table: {
177
+ expand: [_wrapStep.wrapStep],
178
+ nestedExpand: [_wrapStep.wrapStep],
179
+ layoutSection: [_wrapMixedContentStep.wrapMixedContentStep]
180
+ },
181
+ mediaSingle: _objectSpread(_objectSpread({
182
+ blockquote: [_wrapStep.wrapStep],
183
+ expand: [_wrapStep.wrapStep],
184
+ nestedExpand: [_wrapStep.wrapStep],
185
+ layoutSection: [_wrapMixedContentStep.wrapMixedContentStep],
186
+ panel: [_wrapStep.wrapStep]
187
+ }, includePanelC1 ? {
188
+ panel_c1: [_wrapStep.wrapStep]
189
+ } : {}), {}, {
190
+ bulletList: [_wrapIntoListStep.wrapIntoListStep],
191
+ orderedList: [_wrapIntoListStep.wrapIntoListStep]
192
+ }),
193
+ mediaGroup: _objectSpread({
194
+ blockquote: [_wrapStep.wrapStep],
195
+ expand: [_wrapStep.wrapStep],
196
+ nestedExpand: [_wrapStep.wrapStep],
197
+ layoutSection: [_wrapMixedContentStep.wrapMixedContentStep],
198
+ panel: [_wrapStep.wrapStep]
199
+ }, includePanelC1 ? {
200
+ panel_c1: [_wrapStep.wrapStep]
201
+ } : {}),
202
+ media: _objectSpread(_objectSpread({
203
+ blockquote: [_wrapStep.wrapStep],
204
+ codeBlock: [_wrapStep.wrapStep],
205
+ expand: [_wrapStep.wrapStep],
206
+ nestedExpand: [_wrapStep.wrapStep],
207
+ layoutSection: [_wrapStep.wrapStep],
208
+ panel: [_wrapStep.wrapStep]
209
+ }, includePanelC1 ? {
210
+ panel_c1: [_wrapStep.wrapStep]
211
+ } : {}), {}, {
212
+ bulletList: [_wrapIntoListStep.wrapIntoListStep],
213
+ orderedList: [_wrapIntoListStep.wrapIntoListStep],
214
+ taskList: [_wrapIntoListStep.wrapIntoListStep],
215
+ decisionList: [_wrapIntoListStep.wrapIntoListStep]
216
+ }),
217
+ decisionList: _objectSpread(_objectSpread({
218
+ bulletList: [_decisionListToListStep.decisionListToListStep],
219
+ orderedList: [_decisionListToListStep.decisionListToListStep],
220
+ taskList: [_decisionListToListStep.decisionListToListStep],
221
+ blockquote: [_unwrapListStep.unwrapListStep, _wrapStep.wrapStep],
222
+ expand: [_wrapStep.wrapStep],
223
+ nestedExpand: [_wrapStep.wrapStep],
224
+ layoutSection: [_wrapMixedContentStep.wrapMixedContentStep],
225
+ panel: [_wrapStep.wrapStep]
226
+ }, includePanelC1 ? {
227
+ panel_c1: [_wrapStep.wrapStep]
228
+ } : {}), {}, {
229
+ paragraph: [_flattenListStep.flattenListStep, _unwrapListStep.unwrapListStep, _applyTargetTextTypeStep.applyTargetTextTypeStep],
230
+ heading: [_flattenListStep.flattenListStep, _unwrapListStep.unwrapListStep, _applyTargetTextTypeStep.applyTargetTextTypeStep]
231
+ }),
232
+ blockCard: _objectSpread({
233
+ expand: [_wrapStep.wrapStep],
234
+ nestedExpand: [_wrapStep.wrapStep],
235
+ layoutSection: [_wrapMixedContentStep.wrapMixedContentStep],
236
+ panel: [_wrapStep.wrapStep]
237
+ }, includePanelC1 ? {
238
+ panel_c1: [_wrapStep.wrapStep]
239
+ } : {}),
240
+ embedCard: {
241
+ expand: [_wrapStep.wrapStep],
242
+ nestedExpand: [_wrapStep.wrapStep],
243
+ layoutSection: [_wrapMixedContentStep.wrapMixedContentStep]
244
+ },
245
+ extension: _objectSpread({
246
+ blockquote: [_wrapStep.wrapStep],
247
+ expand: [_wrapStep.wrapStep],
248
+ nestedExpand: [_wrapStep.wrapStep],
249
+ layoutSection: [_wrapMixedContentStep.wrapMixedContentStep],
250
+ panel: [_wrapStep.wrapStep]
251
+ }, includePanelC1 ? {
252
+ panel_c1: [_wrapStep.wrapStep]
253
+ } : {}),
254
+ bodiedExtension: {
255
+ nestedExpand: [_wrapStep.wrapStep],
256
+ layoutSection: [_wrapMixedContentStep.wrapMixedContentStep]
257
+ },
258
+ multiBodiedExtension: _objectSpread(_objectSpread({
259
+ blockquote: [_wrapStep.wrapStep],
260
+ codeBlock: [_wrapStep.wrapStep],
261
+ expand: [_wrapStep.wrapStep],
262
+ nestedExpand: [_wrapStep.wrapStep],
263
+ layoutSection: [_wrapStep.wrapStep],
264
+ panel: [_wrapStep.wrapStep]
265
+ }, includePanelC1 ? {
266
+ panel_c1: [_wrapStep.wrapStep]
267
+ } : {}), {}, {
268
+ bulletList: [_wrapIntoListStep.wrapIntoListStep],
269
+ orderedList: [_wrapIntoListStep.wrapIntoListStep],
270
+ taskList: [_wrapIntoListStep.wrapIntoListStep],
271
+ decisionList: [_wrapIntoListStep.wrapIntoListStep]
272
+ }),
273
+ multi: _objectSpread(_objectSpread({
274
+ blockquote: [_wrapMixedContentStep.wrapMixedContentStep],
275
+ codeBlock: [_wrapMixedContentStep.wrapMixedContentStep],
276
+ expand: [_wrapMixedContentStep.wrapMixedContentStep],
277
+ nestedExpand: [_wrapMixedContentStep.wrapMixedContentStep],
278
+ layoutSection: [_wrapMixedContentStep.wrapMixedContentStep],
279
+ panel: [_wrapMixedContentStep.wrapMixedContentStep]
280
+ }, includePanelC1 ? {
281
+ panel_c1: [_wrapMixedContentStep.wrapMixedContentStep]
282
+ } : {}), {}, {
283
+ bulletList: [_convertEachNodeStep.convertEachNodeStep, _mergeNeighbourListsStep.mergeNeighbourListsStep],
284
+ orderedList: [_convertEachNodeStep.convertEachNodeStep, _mergeNeighbourListsStep.mergeNeighbourListsStep],
285
+ taskList: [_convertEachNodeStep.convertEachNodeStep, _mergeNeighbourListsStep.mergeNeighbourListsStep],
286
+ decisionList: [_convertEachNodeStep.convertEachNodeStep, _mergeNeighbourListsStep.mergeNeighbourListsStep],
287
+ paragraph: [_convertEachNodeStep.convertEachNodeStep],
288
+ heading: [_applyTargetTextTypeStep.applyTargetTextTypeStep]
289
+ })
290
+ };
291
+ };
292
+ var TRANSFORMATION_MATRIX = exports.TRANSFORMATION_MATRIX = createTransformationMatrix(false);
293
+ var TRANSFORMATION_MATRIX_PANEL_C1 = exports.TRANSFORMATION_MATRIX_PANEL_C1 = createTransformationMatrix(true);
@@ -203,7 +203,7 @@ var wrapMixedContentStep = exports.wrapMixedContentStep = function wrapMixedCont
203
203
  }
204
204
 
205
205
  // All other nodes that cannot be wrapped in the target node - break out
206
- // Examples: same-type containers, tables in panels, layoutSections in layouts
206
+ // Examples: same-type containers, layoutSections in layouts
207
207
  handleUnsupportedNode(node);
208
208
  };
209
209
  nodes.forEach(processNode);
@@ -3,10 +3,29 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.isTransformDisabledBasedOnStepsConfig = exports.convertNodesToTargetType = void 0;
7
- var _utils = require("../transform-node-utils/utils");
6
+ exports.upgradePanelNodesToPanelC1 = exports.isTransformDisabledBasedOnStepsConfig = exports.convertNodesToTargetType = void 0;
7
+ var _utils = require("@atlaskit/editor-common/utils");
8
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
9
+ var _utils2 = require("../transform-node-utils/utils");
8
10
  var _TRANSFORMATION_MATRIX = require("./TRANSFORMATION_MATRIX");
9
11
  var _types = require("./types");
12
+ // Upgrade broken-out panel nodes to panel_c1 if the parent node allows it
13
+ var upgradePanelNodesToPanelC1 = exports.upgradePanelNodesToPanelC1 = function upgradePanelNodesToPanelC1(nodes, parentNode, schema) {
14
+ if (!schema.nodes['panel_c1'] || !(0, _expValEquals.expValEquals)('platform_editor_nest_table_in_panel', 'isEnabled', true)) {
15
+ return nodes;
16
+ }
17
+ return nodes.map(function (node) {
18
+ if (node.type.name === 'panel') {
19
+ var shouldUsePanelC1 = !parentNode || (0, _utils.isNodeTypeValidChildOf)('panel_c1', parentNode, schema);
20
+ if (shouldUsePanelC1) {
21
+ var _schema$nodes$panel_c;
22
+ return (_schema$nodes$panel_c = schema.nodes['panel_c1'].createAndFill(node.attrs, node.content, node.marks)) !== null && _schema$nodes$panel_c !== void 0 ? _schema$nodes$panel_c : node;
23
+ }
24
+ }
25
+ return node;
26
+ });
27
+ };
28
+
10
29
  /**
11
30
  * Convert a list of nodes to a target node type.
12
31
  * If no steps are found, the source nodes are returned unchanged.
@@ -35,11 +54,11 @@ var convertNodesToTargetType = exports.convertNodesToTargetType = function conve
35
54
  }
36
55
  var selectedNodeTypeName = (0, _types.toNodeTypeValue)((0, _types.getNodeName)(sourceNodes));
37
56
  var initialTargetNodeTypeName = (0, _types.toNodeTypeValue)(targetNodeType.name);
38
- var targetNodeTypeName = (0, _utils.getTargetNodeTypeNameInContext)(initialTargetNodeTypeName, isNested, parentNode);
57
+ var targetNodeTypeName = (0, _utils2.getTargetNodeTypeNameInContext)(initialTargetNodeTypeName, isNested, parentNode, schema);
39
58
  if (!selectedNodeTypeName || !targetNodeTypeName) {
40
59
  return sourceNodes;
41
60
  }
42
- var steps = _TRANSFORMATION_MATRIX.TRANSFORMATION_MATRIX[selectedNodeTypeName][targetNodeTypeName];
61
+ var steps = (0, _expValEquals.expValEquals)('platform_editor_nest_table_in_panel', 'isEnabled', true) ? _TRANSFORMATION_MATRIX.TRANSFORMATION_MATRIX_PANEL_C1[selectedNodeTypeName][targetNodeTypeName] : _TRANSFORMATION_MATRIX.TRANSFORMATION_MATRIX[selectedNodeTypeName][targetNodeTypeName];
43
62
  var context = {
44
63
  // sourceNode is incorrect now - what to do here?
45
64
  fromNode: sourceNode,
@@ -50,11 +69,12 @@ var convertNodesToTargetType = exports.convertNodesToTargetType = function conve
50
69
  if (!steps || steps.length === 0) {
51
70
  return sourceNodes;
52
71
  }
53
- return steps.reduce(function (nodes, step) {
72
+ var resultNodes = steps.reduce(function (nodes, step) {
54
73
  return step(nodes, context);
55
74
  }, sourceNodes);
75
+ return upgradePanelNodesToPanelC1(resultNodes, parentNode, schema);
56
76
  };
57
77
  var isTransformDisabledBasedOnStepsConfig = exports.isTransformDisabledBasedOnStepsConfig = function isTransformDisabledBasedOnStepsConfig(selectedNodeType, targetNodeType) {
58
- var steps = _TRANSFORMATION_MATRIX.TRANSFORMATION_MATRIX[selectedNodeType][targetNodeType];
78
+ var steps = (0, _expValEquals.expValEquals)('platform_editor_nest_table_in_panel', 'isEnabled', true) ? _TRANSFORMATION_MATRIX.TRANSFORMATION_MATRIX_PANEL_C1[selectedNodeType][targetNodeType] : _TRANSFORMATION_MATRIX.TRANSFORMATION_MATRIX[selectedNodeType][targetNodeType];
59
79
  return !steps || steps.length === 0;
60
80
  };
@@ -22,6 +22,7 @@ var NODE_CATEGORY_BY_TYPE = exports.NODE_CATEGORY_BY_TYPE = {
22
22
  multiBodiedExtension: 'atomic',
23
23
  orderedList: 'list',
24
24
  panel: 'container',
25
+ panel_c1: 'container',
25
26
  paragraph: 'text',
26
27
  nestedExpand: 'container',
27
28
  taskList: 'list',