@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.
- package/CHANGELOG.md +14 -0
- package/dist/cjs/editor-actions/isTransformToTargetDisabled.js +1 -1
- package/dist/cjs/editor-commands/selection.js +2 -1
- package/dist/cjs/editor-commands/transform-node-utils/TRANSFORMATION_MATRIX.js +272 -201
- package/dist/cjs/editor-commands/transform-node-utils/steps/wrapMixedContentStep.js +1 -1
- package/dist/cjs/editor-commands/transform-node-utils/transform.js +26 -6
- package/dist/cjs/editor-commands/transform-node-utils/types.js +1 -0
- package/dist/cjs/editor-commands/transform-node-utils/utils.js +14 -7
- package/dist/cjs/ui/utils/copyLink.js +17 -17
- package/dist/es2019/editor-actions/isTransformToTargetDisabled.js +1 -1
- package/dist/es2019/editor-commands/selection.js +2 -1
- package/dist/es2019/editor-commands/transform-node-utils/TRANSFORMATION_MATRIX.js +75 -7
- package/dist/es2019/editor-commands/transform-node-utils/steps/wrapMixedContentStep.js +1 -1
- package/dist/es2019/editor-commands/transform-node-utils/transform.js +25 -5
- package/dist/es2019/editor-commands/transform-node-utils/types.js +1 -0
- package/dist/es2019/editor-commands/transform-node-utils/utils.js +8 -1
- package/dist/esm/editor-actions/isTransformToTargetDisabled.js +1 -1
- package/dist/esm/editor-commands/selection.js +2 -1
- package/dist/esm/editor-commands/transform-node-utils/TRANSFORMATION_MATRIX.js +270 -200
- package/dist/esm/editor-commands/transform-node-utils/steps/wrapMixedContentStep.js +1 -1
- package/dist/esm/editor-commands/transform-node-utils/transform.js +25 -5
- package/dist/esm/editor-commands/transform-node-utils/types.js +1 -0
- package/dist/esm/editor-commands/transform-node-utils/utils.js +8 -1
- package/dist/esm/ui/utils/copyLink.js +17 -17
- package/dist/types/editor-commands/transform-node-utils/TRANSFORMATION_MATRIX.d.ts +4 -1
- package/dist/types/editor-commands/transform-node-utils/transform.d.ts +1 -0
- package/dist/types/editor-commands/transform-node-utils/types.d.ts +1 -1
- package/dist/types/editor-commands/transform-node-utils/utils.d.ts +1 -1
- package/dist/types/editor-commands/types.d.ts +1 -1
- package/dist/types-ts4.5/editor-commands/transform-node-utils/TRANSFORMATION_MATRIX.d.ts +4 -1
- package/dist/types-ts4.5/editor-commands/transform-node-utils/transform.d.ts +1 -0
- package/dist/types-ts4.5/editor-commands/transform-node-utils/types.d.ts +1 -1
- package/dist/types-ts4.5/editor-commands/transform-node-utils/utils.d.ts +1 -1
- package/dist/types-ts4.5/editor-commands/types.d.ts +1 -1
- 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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
taskList:
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
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,
|
|
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
|
-
|
|
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
|
};
|
|
@@ -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
|
|
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 =
|
|
16
|
+
_context.next = 1;
|
|
17
17
|
break;
|
|
18
18
|
}
|
|
19
19
|
return _context.abrupt("return", false);
|
|
20
|
-
case
|
|
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 =
|
|
24
|
+
_context.next = 2;
|
|
25
25
|
break;
|
|
26
26
|
}
|
|
27
27
|
return _context.abrupt("return", false);
|
|
28
|
-
case
|
|
28
|
+
case 2:
|
|
29
29
|
path = (getLinkPath === null || getLinkPath === void 0 ? void 0 : getLinkPath()) || location.pathname;
|
|
30
|
-
_context.prev =
|
|
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 =
|
|
34
|
+
_context.next = 4;
|
|
35
35
|
return copyToClipboard(href);
|
|
36
|
-
case
|
|
37
|
-
_context.next =
|
|
36
|
+
case 4:
|
|
37
|
+
_context.next = 6;
|
|
38
38
|
break;
|
|
39
|
-
case
|
|
40
|
-
_context.prev =
|
|
41
|
-
|
|
42
|
-
logException(
|
|
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
|
|
46
|
+
case 6:
|
|
47
47
|
return _context.abrupt("return", true);
|
|
48
|
-
case
|
|
48
|
+
case 7:
|
|
49
49
|
case "end":
|
|
50
50
|
return _context.stop();
|
|
51
51
|
}
|
|
52
|
-
}, _callee, null, [[
|
|
52
|
+
}, _callee, null, [[3, 5]]);
|
|
53
53
|
}));
|
|
54
54
|
return function copyLink(_x) {
|
|
55
55
|
return _ref2.apply(this, arguments);
|