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

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 +14 -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 +5 -5
@@ -1,3 +1,6 @@
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; }
1
4
  import { applyTargetTextTypeStep } from './steps/applyTargetTextTypeStep';
2
5
  import { convertEachNodeStep } from './steps/convertEachNodeStep';
3
6
  import { decisionListToListStep } from './steps/decisionListToListStep';
@@ -14,203 +17,270 @@ import { wrapBlockquoteToDecisionListStep } from './steps/wrapBlockquoteToDecisi
14
17
  import { wrapIntoListStep } from './steps/wrapIntoListStep';
15
18
  import { wrapMixedContentStep } from './steps/wrapMixedContentStep';
16
19
  import { wrapStep } from './steps/wrapStep';
17
- // Transform steps for all node type pairs.
18
- // If a transformation is not defined (undefined), it is not available.
19
- export var TRANSFORMATION_MATRIX = {
20
- paragraph: {
21
- heading: [flattenStep, applyTargetTextTypeStep],
22
- blockquote: [wrapMixedContentStep],
23
- codeBlock: [wrapMixedContentStep],
24
- expand: [wrapMixedContentStep],
25
- nestedExpand: [wrapMixedContentStep],
26
- layoutSection: [wrapMixedContentStep],
27
- panel: [wrapMixedContentStep],
28
- bulletList: [wrapIntoListStep],
29
- orderedList: [wrapIntoListStep],
30
- taskList: [wrapIntoListStep],
31
- decisionList: [wrapIntoListStep]
32
- },
33
- heading: {
34
- heading: [flattenStep, applyTargetTextTypeStep],
35
- paragraph: [flattenStep, applyTargetTextTypeStep],
36
- blockquote: [wrapMixedContentStep],
37
- codeBlock: [wrapMixedContentStep],
38
- expand: [wrapMixedContentStep],
39
- nestedExpand: [wrapMixedContentStep],
40
- layoutSection: [wrapMixedContentStep],
41
- panel: [wrapMixedContentStep],
42
- bulletList: [wrapIntoListStep],
43
- orderedList: [wrapIntoListStep],
44
- taskList: [wrapIntoListStep],
45
- decisionList: [wrapIntoListStep]
46
- },
47
- panel: {
48
- blockquote: [unwrapStep, wrapMixedContentStep],
49
- codeBlock: [unwrapStep, wrapMixedContentStep],
50
- expand: [unwrapStep, wrapStep],
51
- nestedExpand: [unwrapStep, wrapStep],
52
- layoutSection: [unwrapStep, wrapMixedContentStep],
53
- paragraph: [unwrapStep]
54
- },
55
- expand: {
56
- panel: [unwrapExpandStep, wrapMixedContentStep],
57
- blockquote: [unwrapExpandStep, wrapMixedContentStep],
58
- layoutSection: [unwrapExpandStep, wrapMixedContentStep],
59
- nestedExpand: [unwrapExpandStep, wrapStep],
60
- paragraph: [unwrapExpandStep]
61
- },
62
- nestedExpand: {
63
- panel: [unwrapExpandStep, wrapMixedContentStep],
64
- blockquote: [unwrapExpandStep, wrapMixedContentStep],
65
- layoutSection: [unwrapExpandStep, wrapMixedContentStep],
66
- paragraph: [unwrapExpandStep]
67
- },
68
- blockquote: {
69
- expand: [wrapStep],
70
- nestedExpand: [wrapStep],
71
- layoutSection: [wrapMixedContentStep],
72
- panel: [unwrapStep, wrapStep],
73
- paragraph: [unwrapStep],
74
- decisionList: [unwrapStep, wrapBlockquoteToDecisionListStep]
75
- },
76
- layoutSection: {
77
- blockquote: [unwrapLayoutStep, wrapMixedContentStep],
78
- expand: [unwrapLayoutStep, wrapStep],
79
- nestedExpand: [unwrapLayoutStep, wrapStep],
80
- panel: [unwrapLayoutStep, wrapMixedContentStep],
81
- paragraph: [unwrapLayoutStep]
82
- },
83
- codeBlock: {
84
- blockquote: [wrapStep],
85
- expand: [wrapStep],
86
- nestedExpand: [wrapStep],
87
- layoutSection: [wrapMixedContentStep],
88
- panel: [wrapStep],
89
- paragraph: [applyTargetTextTypeStep]
90
- },
91
- bulletList: {
92
- orderedList: [listToListStep],
93
- taskList: [listToListStep],
94
- decisionList: [flattenListStep, listToDecisionListStep],
95
- blockquote: [wrapStep],
96
- expand: [wrapStep],
97
- nestedExpand: [wrapStep],
98
- layoutSection: [wrapMixedContentStep],
99
- panel: [wrapStep],
100
- paragraph: [flattenListStep, unwrapListStep, applyTargetTextTypeStep]
101
- },
102
- orderedList: {
103
- bulletList: [listToListStep],
104
- taskList: [listToListStep],
105
- decisionList: [flattenListStep, listToDecisionListStep],
106
- blockquote: [wrapStep],
107
- expand: [wrapStep],
108
- nestedExpand: [wrapStep],
109
- layoutSection: [wrapMixedContentStep],
110
- panel: [wrapStep],
111
- paragraph: [flattenListStep, unwrapListStep, applyTargetTextTypeStep]
112
- },
113
- taskList: {
114
- bulletList: [listToListStep],
115
- orderedList: [listToListStep],
116
- decisionList: [flattenListStep, listToDecisionListStep],
117
- expand: [wrapStep],
118
- nestedExpand: [wrapStep],
119
- layoutSection: [wrapMixedContentStep],
120
- panel: [wrapStep],
121
- paragraph: [flattenListStep, unwrapListStep, applyTargetTextTypeStep]
122
- },
123
- table: {
124
- expand: [wrapStep],
125
- nestedExpand: [wrapStep],
126
- layoutSection: [wrapMixedContentStep]
127
- },
128
- mediaSingle: {
129
- blockquote: [wrapStep],
130
- expand: [wrapStep],
131
- nestedExpand: [wrapStep],
132
- layoutSection: [wrapMixedContentStep],
133
- panel: [wrapStep],
134
- bulletList: [wrapIntoListStep],
135
- orderedList: [wrapIntoListStep]
136
- },
137
- mediaGroup: {
138
- blockquote: [wrapStep],
139
- expand: [wrapStep],
140
- nestedExpand: [wrapStep],
141
- layoutSection: [wrapMixedContentStep],
142
- panel: [wrapStep]
143
- },
144
- media: {
145
- blockquote: [wrapStep],
146
- codeBlock: [wrapStep],
147
- expand: [wrapStep],
148
- nestedExpand: [wrapStep],
149
- layoutSection: [wrapStep],
150
- panel: [wrapStep],
151
- bulletList: [wrapIntoListStep],
152
- orderedList: [wrapIntoListStep],
153
- taskList: [wrapIntoListStep],
154
- decisionList: [wrapIntoListStep]
155
- },
156
- decisionList: {
157
- bulletList: [decisionListToListStep],
158
- orderedList: [decisionListToListStep],
159
- taskList: [decisionListToListStep],
160
- blockquote: [unwrapListStep, wrapStep],
161
- expand: [wrapStep],
162
- nestedExpand: [wrapStep],
163
- layoutSection: [wrapMixedContentStep],
164
- panel: [wrapStep],
165
- paragraph: [flattenListStep, unwrapListStep, applyTargetTextTypeStep],
166
- heading: [flattenListStep, unwrapListStep, applyTargetTextTypeStep]
167
- },
168
- blockCard: {
169
- expand: [wrapStep],
170
- nestedExpand: [wrapStep],
171
- layoutSection: [wrapMixedContentStep],
172
- panel: [wrapStep]
173
- },
174
- embedCard: {
175
- expand: [wrapStep],
176
- nestedExpand: [wrapStep],
177
- layoutSection: [wrapMixedContentStep]
178
- },
179
- extension: {
180
- blockquote: [wrapStep],
181
- expand: [wrapStep],
182
- nestedExpand: [wrapStep],
183
- layoutSection: [wrapMixedContentStep],
184
- panel: [wrapStep]
185
- },
186
- bodiedExtension: {
187
- nestedExpand: [wrapStep],
188
- layoutSection: [wrapMixedContentStep]
189
- },
190
- multiBodiedExtension: {
191
- blockquote: [wrapStep],
192
- codeBlock: [wrapStep],
193
- expand: [wrapStep],
194
- nestedExpand: [wrapStep],
195
- layoutSection: [wrapStep],
196
- panel: [wrapStep],
197
- bulletList: [wrapIntoListStep],
198
- orderedList: [wrapIntoListStep],
199
- taskList: [wrapIntoListStep],
200
- decisionList: [wrapIntoListStep]
201
- },
202
- multi: {
203
- blockquote: [wrapMixedContentStep],
204
- codeBlock: [wrapMixedContentStep],
205
- expand: [wrapMixedContentStep],
206
- nestedExpand: [wrapMixedContentStep],
207
- layoutSection: [wrapMixedContentStep],
208
- panel: [wrapMixedContentStep],
209
- bulletList: [convertEachNodeStep, mergeNeighbourListsStep],
210
- orderedList: [convertEachNodeStep, mergeNeighbourListsStep],
211
- taskList: [convertEachNodeStep, mergeNeighbourListsStep],
212
- decisionList: [convertEachNodeStep, mergeNeighbourListsStep],
213
- paragraph: [convertEachNodeStep],
214
- heading: [applyTargetTextTypeStep]
215
- }
216
- };
20
+ /**
21
+ * Creates the transformation matrix for all node type pairs.
22
+ * When includePanelC1 is true (platform_editor_nest_table_in_panel experiment on),
23
+ * panel_c1 entries are included as both source and target types.
24
+ * If a transformation is not defined (undefined), it is not available.
25
+ */
26
+ var createTransformationMatrix = function createTransformationMatrix(includePanelC1) {
27
+ return {
28
+ paragraph: _objectSpread(_objectSpread({
29
+ heading: [flattenStep, applyTargetTextTypeStep],
30
+ blockquote: [wrapMixedContentStep],
31
+ codeBlock: [wrapMixedContentStep],
32
+ expand: [wrapMixedContentStep],
33
+ nestedExpand: [wrapMixedContentStep],
34
+ layoutSection: [wrapMixedContentStep],
35
+ panel: [wrapMixedContentStep]
36
+ }, includePanelC1 ? {
37
+ panel_c1: [wrapMixedContentStep]
38
+ } : {}), {}, {
39
+ bulletList: [wrapIntoListStep],
40
+ orderedList: [wrapIntoListStep],
41
+ taskList: [wrapIntoListStep],
42
+ decisionList: [wrapIntoListStep]
43
+ }),
44
+ heading: _objectSpread(_objectSpread({
45
+ heading: [flattenStep, applyTargetTextTypeStep],
46
+ paragraph: [flattenStep, applyTargetTextTypeStep],
47
+ blockquote: [wrapMixedContentStep],
48
+ codeBlock: [wrapMixedContentStep],
49
+ expand: [wrapMixedContentStep],
50
+ nestedExpand: [wrapMixedContentStep],
51
+ layoutSection: [wrapMixedContentStep],
52
+ panel: [wrapMixedContentStep]
53
+ }, includePanelC1 ? {
54
+ panel_c1: [wrapMixedContentStep]
55
+ } : {}), {}, {
56
+ bulletList: [wrapIntoListStep],
57
+ orderedList: [wrapIntoListStep],
58
+ taskList: [wrapIntoListStep],
59
+ decisionList: [wrapIntoListStep]
60
+ }),
61
+ panel: {
62
+ blockquote: [unwrapStep, wrapMixedContentStep],
63
+ codeBlock: [unwrapStep, wrapMixedContentStep],
64
+ expand: [unwrapStep, wrapStep],
65
+ nestedExpand: [unwrapStep, wrapStep],
66
+ layoutSection: [unwrapStep, wrapMixedContentStep],
67
+ paragraph: [unwrapStep]
68
+ },
69
+ panel_c1: includePanelC1 ? {
70
+ blockquote: [unwrapStep, wrapMixedContentStep],
71
+ codeBlock: [unwrapStep, wrapMixedContentStep],
72
+ expand: [unwrapStep, wrapStep],
73
+ nestedExpand: [unwrapStep, wrapStep],
74
+ layoutSection: [unwrapStep, wrapMixedContentStep],
75
+ paragraph: [unwrapStep]
76
+ } : {},
77
+ expand: _objectSpread(_objectSpread({
78
+ panel: [unwrapExpandStep, wrapMixedContentStep]
79
+ }, includePanelC1 ? {
80
+ panel_c1: [unwrapExpandStep, wrapMixedContentStep]
81
+ } : {}), {}, {
82
+ blockquote: [unwrapExpandStep, wrapMixedContentStep],
83
+ layoutSection: [unwrapExpandStep, wrapMixedContentStep],
84
+ nestedExpand: [unwrapExpandStep, wrapStep],
85
+ paragraph: [unwrapExpandStep]
86
+ }),
87
+ nestedExpand: _objectSpread(_objectSpread({
88
+ panel: [unwrapExpandStep, wrapMixedContentStep]
89
+ }, includePanelC1 ? {
90
+ panel_c1: [unwrapExpandStep, wrapMixedContentStep]
91
+ } : {}), {}, {
92
+ blockquote: [unwrapExpandStep, wrapMixedContentStep],
93
+ layoutSection: [unwrapExpandStep, wrapMixedContentStep],
94
+ paragraph: [unwrapExpandStep]
95
+ }),
96
+ blockquote: _objectSpread(_objectSpread({
97
+ expand: [wrapStep],
98
+ nestedExpand: [wrapStep],
99
+ layoutSection: [wrapMixedContentStep],
100
+ panel: [unwrapStep, wrapStep]
101
+ }, includePanelC1 ? {
102
+ panel_c1: [unwrapStep, wrapStep]
103
+ } : {}), {}, {
104
+ paragraph: [unwrapStep],
105
+ decisionList: [unwrapStep, wrapBlockquoteToDecisionListStep]
106
+ }),
107
+ layoutSection: _objectSpread(_objectSpread({
108
+ blockquote: [unwrapLayoutStep, wrapMixedContentStep],
109
+ expand: [unwrapLayoutStep, wrapStep],
110
+ nestedExpand: [unwrapLayoutStep, wrapStep],
111
+ panel: [unwrapLayoutStep, wrapMixedContentStep]
112
+ }, includePanelC1 ? {
113
+ panel_c1: [unwrapLayoutStep, wrapMixedContentStep]
114
+ } : {}), {}, {
115
+ paragraph: [unwrapLayoutStep]
116
+ }),
117
+ codeBlock: _objectSpread(_objectSpread({
118
+ blockquote: [wrapStep],
119
+ expand: [wrapStep],
120
+ nestedExpand: [wrapStep],
121
+ layoutSection: [wrapMixedContentStep],
122
+ panel: [wrapStep]
123
+ }, includePanelC1 ? {
124
+ panel_c1: [wrapStep]
125
+ } : {}), {}, {
126
+ paragraph: [applyTargetTextTypeStep]
127
+ }),
128
+ bulletList: _objectSpread(_objectSpread({
129
+ orderedList: [listToListStep],
130
+ taskList: [listToListStep],
131
+ decisionList: [flattenListStep, listToDecisionListStep],
132
+ blockquote: [wrapStep],
133
+ expand: [wrapStep],
134
+ nestedExpand: [wrapStep],
135
+ layoutSection: [wrapMixedContentStep],
136
+ panel: [wrapStep]
137
+ }, includePanelC1 ? {
138
+ panel_c1: [wrapStep]
139
+ } : {}), {}, {
140
+ paragraph: [flattenListStep, unwrapListStep, applyTargetTextTypeStep]
141
+ }),
142
+ orderedList: _objectSpread(_objectSpread({
143
+ bulletList: [listToListStep],
144
+ taskList: [listToListStep],
145
+ decisionList: [flattenListStep, listToDecisionListStep],
146
+ blockquote: [wrapStep],
147
+ expand: [wrapStep],
148
+ nestedExpand: [wrapStep],
149
+ layoutSection: [wrapMixedContentStep],
150
+ panel: [wrapStep]
151
+ }, includePanelC1 ? {
152
+ panel_c1: [wrapStep]
153
+ } : {}), {}, {
154
+ paragraph: [flattenListStep, unwrapListStep, applyTargetTextTypeStep]
155
+ }),
156
+ taskList: _objectSpread(_objectSpread({
157
+ bulletList: [listToListStep],
158
+ orderedList: [listToListStep],
159
+ decisionList: [flattenListStep, listToDecisionListStep],
160
+ expand: [wrapStep],
161
+ nestedExpand: [wrapStep],
162
+ layoutSection: [wrapMixedContentStep],
163
+ panel: [wrapStep]
164
+ }, includePanelC1 ? {
165
+ panel_c1: [wrapStep]
166
+ } : {}), {}, {
167
+ paragraph: [flattenListStep, unwrapListStep, applyTargetTextTypeStep]
168
+ }),
169
+ table: {
170
+ expand: [wrapStep],
171
+ nestedExpand: [wrapStep],
172
+ layoutSection: [wrapMixedContentStep]
173
+ },
174
+ mediaSingle: _objectSpread(_objectSpread({
175
+ blockquote: [wrapStep],
176
+ expand: [wrapStep],
177
+ nestedExpand: [wrapStep],
178
+ layoutSection: [wrapMixedContentStep],
179
+ panel: [wrapStep]
180
+ }, includePanelC1 ? {
181
+ panel_c1: [wrapStep]
182
+ } : {}), {}, {
183
+ bulletList: [wrapIntoListStep],
184
+ orderedList: [wrapIntoListStep]
185
+ }),
186
+ mediaGroup: _objectSpread({
187
+ blockquote: [wrapStep],
188
+ expand: [wrapStep],
189
+ nestedExpand: [wrapStep],
190
+ layoutSection: [wrapMixedContentStep],
191
+ panel: [wrapStep]
192
+ }, includePanelC1 ? {
193
+ panel_c1: [wrapStep]
194
+ } : {}),
195
+ media: _objectSpread(_objectSpread({
196
+ blockquote: [wrapStep],
197
+ codeBlock: [wrapStep],
198
+ expand: [wrapStep],
199
+ nestedExpand: [wrapStep],
200
+ layoutSection: [wrapStep],
201
+ panel: [wrapStep]
202
+ }, includePanelC1 ? {
203
+ panel_c1: [wrapStep]
204
+ } : {}), {}, {
205
+ bulletList: [wrapIntoListStep],
206
+ orderedList: [wrapIntoListStep],
207
+ taskList: [wrapIntoListStep],
208
+ decisionList: [wrapIntoListStep]
209
+ }),
210
+ decisionList: _objectSpread(_objectSpread({
211
+ bulletList: [decisionListToListStep],
212
+ orderedList: [decisionListToListStep],
213
+ taskList: [decisionListToListStep],
214
+ blockquote: [unwrapListStep, wrapStep],
215
+ expand: [wrapStep],
216
+ nestedExpand: [wrapStep],
217
+ layoutSection: [wrapMixedContentStep],
218
+ panel: [wrapStep]
219
+ }, includePanelC1 ? {
220
+ panel_c1: [wrapStep]
221
+ } : {}), {}, {
222
+ paragraph: [flattenListStep, unwrapListStep, applyTargetTextTypeStep],
223
+ heading: [flattenListStep, unwrapListStep, applyTargetTextTypeStep]
224
+ }),
225
+ blockCard: _objectSpread({
226
+ expand: [wrapStep],
227
+ nestedExpand: [wrapStep],
228
+ layoutSection: [wrapMixedContentStep],
229
+ panel: [wrapStep]
230
+ }, includePanelC1 ? {
231
+ panel_c1: [wrapStep]
232
+ } : {}),
233
+ embedCard: {
234
+ expand: [wrapStep],
235
+ nestedExpand: [wrapStep],
236
+ layoutSection: [wrapMixedContentStep]
237
+ },
238
+ extension: _objectSpread({
239
+ blockquote: [wrapStep],
240
+ expand: [wrapStep],
241
+ nestedExpand: [wrapStep],
242
+ layoutSection: [wrapMixedContentStep],
243
+ panel: [wrapStep]
244
+ }, includePanelC1 ? {
245
+ panel_c1: [wrapStep]
246
+ } : {}),
247
+ bodiedExtension: {
248
+ nestedExpand: [wrapStep],
249
+ layoutSection: [wrapMixedContentStep]
250
+ },
251
+ multiBodiedExtension: _objectSpread(_objectSpread({
252
+ blockquote: [wrapStep],
253
+ codeBlock: [wrapStep],
254
+ expand: [wrapStep],
255
+ nestedExpand: [wrapStep],
256
+ layoutSection: [wrapStep],
257
+ panel: [wrapStep]
258
+ }, includePanelC1 ? {
259
+ panel_c1: [wrapStep]
260
+ } : {}), {}, {
261
+ bulletList: [wrapIntoListStep],
262
+ orderedList: [wrapIntoListStep],
263
+ taskList: [wrapIntoListStep],
264
+ decisionList: [wrapIntoListStep]
265
+ }),
266
+ multi: _objectSpread(_objectSpread({
267
+ blockquote: [wrapMixedContentStep],
268
+ codeBlock: [wrapMixedContentStep],
269
+ expand: [wrapMixedContentStep],
270
+ nestedExpand: [wrapMixedContentStep],
271
+ layoutSection: [wrapMixedContentStep],
272
+ panel: [wrapMixedContentStep]
273
+ }, includePanelC1 ? {
274
+ panel_c1: [wrapMixedContentStep]
275
+ } : {}), {}, {
276
+ bulletList: [convertEachNodeStep, mergeNeighbourListsStep],
277
+ orderedList: [convertEachNodeStep, mergeNeighbourListsStep],
278
+ taskList: [convertEachNodeStep, mergeNeighbourListsStep],
279
+ decisionList: [convertEachNodeStep, mergeNeighbourListsStep],
280
+ paragraph: [convertEachNodeStep],
281
+ heading: [applyTargetTextTypeStep]
282
+ })
283
+ };
284
+ };
285
+ export var TRANSFORMATION_MATRIX = createTransformationMatrix(false);
286
+ export var TRANSFORMATION_MATRIX_PANEL_C1 = createTransformationMatrix(true);
@@ -197,7 +197,7 @@ export var wrapMixedContentStep = function wrapMixedContentStep(nodes, context)
197
197
  }
198
198
 
199
199
  // All other nodes that cannot be wrapped in the target node - break out
200
- // Examples: same-type containers, tables in panels, layoutSections in layouts
200
+ // Examples: same-type containers, layoutSections in layouts
201
201
  handleUnsupportedNode(node);
202
202
  };
203
203
  nodes.forEach(processNode);
@@ -1,6 +1,25 @@
1
+ import { isNodeTypeValidChildOf } from '@atlaskit/editor-common/utils';
2
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
1
3
  import { getTargetNodeTypeNameInContext } from '../transform-node-utils/utils';
2
- import { TRANSFORMATION_MATRIX } from './TRANSFORMATION_MATRIX';
4
+ import { TRANSFORMATION_MATRIX, TRANSFORMATION_MATRIX_PANEL_C1 } from './TRANSFORMATION_MATRIX';
3
5
  import { getNodeName, toNodeTypeValue } from './types';
6
+ // Upgrade broken-out panel nodes to panel_c1 if the parent node allows it
7
+ export var upgradePanelNodesToPanelC1 = function upgradePanelNodesToPanelC1(nodes, parentNode, schema) {
8
+ if (!schema.nodes['panel_c1'] || !expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true)) {
9
+ return nodes;
10
+ }
11
+ return nodes.map(function (node) {
12
+ if (node.type.name === 'panel') {
13
+ var shouldUsePanelC1 = !parentNode || isNodeTypeValidChildOf('panel_c1', parentNode, schema);
14
+ if (shouldUsePanelC1) {
15
+ var _schema$nodes$panel_c;
16
+ 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;
17
+ }
18
+ }
19
+ return node;
20
+ });
21
+ };
22
+
4
23
  /**
5
24
  * Convert a list of nodes to a target node type.
6
25
  * If no steps are found, the source nodes are returned unchanged.
@@ -29,11 +48,11 @@ export var convertNodesToTargetType = function convertNodesToTargetType(_ref) {
29
48
  }
30
49
  var selectedNodeTypeName = toNodeTypeValue(getNodeName(sourceNodes));
31
50
  var initialTargetNodeTypeName = toNodeTypeValue(targetNodeType.name);
32
- var targetNodeTypeName = getTargetNodeTypeNameInContext(initialTargetNodeTypeName, isNested, parentNode);
51
+ var targetNodeTypeName = getTargetNodeTypeNameInContext(initialTargetNodeTypeName, isNested, parentNode, schema);
33
52
  if (!selectedNodeTypeName || !targetNodeTypeName) {
34
53
  return sourceNodes;
35
54
  }
36
- var steps = TRANSFORMATION_MATRIX[selectedNodeTypeName][targetNodeTypeName];
55
+ var steps = expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) ? TRANSFORMATION_MATRIX_PANEL_C1[selectedNodeTypeName][targetNodeTypeName] : TRANSFORMATION_MATRIX[selectedNodeTypeName][targetNodeTypeName];
37
56
  var context = {
38
57
  // sourceNode is incorrect now - what to do here?
39
58
  fromNode: sourceNode,
@@ -44,11 +63,12 @@ export var convertNodesToTargetType = function convertNodesToTargetType(_ref) {
44
63
  if (!steps || steps.length === 0) {
45
64
  return sourceNodes;
46
65
  }
47
- return steps.reduce(function (nodes, step) {
66
+ var resultNodes = steps.reduce(function (nodes, step) {
48
67
  return step(nodes, context);
49
68
  }, sourceNodes);
69
+ return upgradePanelNodesToPanelC1(resultNodes, parentNode, schema);
50
70
  };
51
71
  export var isTransformDisabledBasedOnStepsConfig = function isTransformDisabledBasedOnStepsConfig(selectedNodeType, targetNodeType) {
52
- var steps = TRANSFORMATION_MATRIX[selectedNodeType][targetNodeType];
72
+ var steps = expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) ? TRANSFORMATION_MATRIX_PANEL_C1[selectedNodeType][targetNodeType] : TRANSFORMATION_MATRIX[selectedNodeType][targetNodeType];
53
73
  return !steps || steps.length === 0;
54
74
  };
@@ -16,6 +16,7 @@ export var NODE_CATEGORY_BY_TYPE = {
16
16
  multiBodiedExtension: 'atomic',
17
17
  orderedList: 'list',
18
18
  panel: 'container',
19
+ panel_c1: 'container',
19
20
  paragraph: 'text',
20
21
  nestedExpand: 'container',
21
22
  taskList: 'list',
@@ -1,6 +1,8 @@
1
+ import { isNodeTypeValidChildOf } from '@atlaskit/editor-common/utils';
1
2
  import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
2
3
  import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
3
4
  import { CellSelection } from '@atlaskit/editor-tables';
5
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
4
6
  import { NODE_CATEGORY_BY_TYPE } from './types';
5
7
 
6
8
  /**
@@ -56,13 +58,18 @@ export var getSelectedNode = function getSelectedNode(selection) {
56
58
  }
57
59
  return undefined;
58
60
  };
59
- export var getTargetNodeTypeNameInContext = function getTargetNodeTypeNameInContext(nodeTypeName, isNested, parentNode) {
61
+ export var getTargetNodeTypeNameInContext = function getTargetNodeTypeNameInContext(nodeTypeName, isNested, parentNode, schema) {
60
62
  if (parentNode && isNested && (parentNode.type.name === 'layoutColumn' || parentNode.type.name === 'bodiedSyncBlock')) {
61
63
  return nodeTypeName;
62
64
  }
63
65
  if (nodeTypeName === 'expand' && isNested) {
64
66
  return 'nestedExpand';
65
67
  }
68
+ if (nodeTypeName === 'panel' && schema !== null && schema !== void 0 && schema.nodes['panel_c1'] && expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true)) {
69
+ if (!parentNode || isNodeTypeValidChildOf('panel_c1', parentNode, schema)) {
70
+ return 'panel_c1';
71
+ }
72
+ }
66
73
  return nodeTypeName;
67
74
  };
68
75
 
@@ -6,50 +6,50 @@ import { logException } from '@atlaskit/editor-common/monitoring';
6
6
  import { expandSelectionToBlockRange } from '@atlaskit/editor-common/selection';
7
7
  export var copyLink = /*#__PURE__*/function () {
8
8
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
9
- var getLinkPath, _ref$blockLinkHashPre, blockLinkHashPrefix, selection, blockRange, node, path, url, href;
10
- return _regeneratorRuntime.wrap(function _callee$(_context) {
9
+ var getLinkPath, _ref$blockLinkHashPre, blockLinkHashPrefix, selection, blockRange, node, path, url, href, _t;
10
+ return _regeneratorRuntime.wrap(function (_context) {
11
11
  while (1) switch (_context.prev = _context.next) {
12
12
  case 0:
13
13
  getLinkPath = _ref.getLinkPath, _ref$blockLinkHashPre = _ref.blockLinkHashPrefix, blockLinkHashPrefix = _ref$blockLinkHashPre === void 0 ? DEFAULT_BLOCK_LINK_HASH_PREFIX : _ref$blockLinkHashPre, selection = _ref.selection;
14
14
  blockRange = expandSelectionToBlockRange(selection);
15
15
  if (blockRange) {
16
- _context.next = 4;
16
+ _context.next = 1;
17
17
  break;
18
18
  }
19
19
  return _context.abrupt("return", false);
20
- case 4:
20
+ case 1:
21
21
  // get the link to the first node in the selection
22
22
  node = blockRange.$from.nodeAfter;
23
23
  if (!(!node || !node.attrs || !node.attrs.localId)) {
24
- _context.next = 7;
24
+ _context.next = 2;
25
25
  break;
26
26
  }
27
27
  return _context.abrupt("return", false);
28
- case 7:
28
+ case 2:
29
29
  path = (getLinkPath === null || getLinkPath === void 0 ? void 0 : getLinkPath()) || location.pathname;
30
- _context.prev = 8;
30
+ _context.prev = 3;
31
31
  url = new URL(location.origin + path);
32
32
  url.hash = createBlockLinkHashValue(node.attrs.localId, blockLinkHashPrefix);
33
33
  href = url.toString();
34
- _context.next = 14;
34
+ _context.next = 4;
35
35
  return copyToClipboard(href);
36
- case 14:
37
- _context.next = 20;
36
+ case 4:
37
+ _context.next = 6;
38
38
  break;
39
- case 16:
40
- _context.prev = 16;
41
- _context.t0 = _context["catch"](8);
42
- logException(_context.t0, {
39
+ case 5:
40
+ _context.prev = 5;
41
+ _t = _context["catch"](3);
42
+ logException(_t, {
43
43
  location: 'editor-plugin-block-menu'
44
44
  });
45
45
  return _context.abrupt("return", false);
46
- case 20:
46
+ case 6:
47
47
  return _context.abrupt("return", true);
48
- case 21:
48
+ case 7:
49
49
  case "end":
50
50
  return _context.stop();
51
51
  }
52
- }, _callee, null, [[8, 16]]);
52
+ }, _callee, null, [[3, 5]]);
53
53
  }));
54
54
  return function copyLink(_x) {
55
55
  return _ref2.apply(this, arguments);