@atlaskit/editor-plugin-insert-block 8.7.2 → 8.7.3
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 +6 -0
- package/dist/cjs/pm-plugins/experiences/toolbar-action-experiences.js +24 -16
- package/dist/cjs/pm-plugins/experiences/toolbar-experience-utils.js +133 -187
- package/dist/es2019/pm-plugins/experiences/toolbar-action-experiences.js +25 -18
- package/dist/es2019/pm-plugins/experiences/toolbar-experience-utils.js +75 -91
- package/dist/esm/pm-plugins/experiences/toolbar-action-experiences.js +25 -17
- package/dist/esm/pm-plugins/experiences/toolbar-experience-utils.js +133 -186
- package/dist/types/pm-plugins/experiences/toolbar-experience-utils.d.ts +26 -13
- package/dist/types-ts4.5/pm-plugins/experiences/toolbar-experience-utils.d.ts +26 -13
- package/package.json +5 -5
|
@@ -6,6 +6,14 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
|
|
|
6
6
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
7
7
|
import { getDocument } from '@atlaskit/browser-apis';
|
|
8
8
|
import { EXPERIENCE_FAILURE_REASON, popupWithNestedElement } from '@atlaskit/editor-common/experiences';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Popup check type determines how popups are observed based on their DOM location:
|
|
12
|
+
* - 'inline': Popups appearing in toolbar button-groups (emoji, media, table selector, image)
|
|
13
|
+
* - 'editorRoot': Popups attached to editor root (e.g., mention popups)
|
|
14
|
+
* - 'editorContent': Content-level popups or modals in portal containers (e.g., block menu)
|
|
15
|
+
*/
|
|
16
|
+
|
|
9
17
|
/**
|
|
10
18
|
* DOM marker selectors for node types inserted via toolbar actions.
|
|
11
19
|
* Matches outermost wrapper elements set synchronously by ReactNodeView
|
|
@@ -26,62 +34,90 @@ export var isToolbarButtonClick = function isToolbarButtonClick(target, testId)
|
|
|
26
34
|
}
|
|
27
35
|
return !button.disabled && button.getAttribute('aria-disabled') !== 'true';
|
|
28
36
|
};
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* ExperienceCheck that observes popup mount point and all its
|
|
32
|
-
* `[data-editor-popup]` children with `{ childList: true }` (no subtree).
|
|
33
|
-
*
|
|
34
|
-
* Detects when a popup containing the given nested element is added to the
|
|
35
|
-
* DOM — either as a new `[data-editor-popup]` direct child, or as content
|
|
36
|
-
* rendered inside an existing `[data-editor-popup]` wrapper.
|
|
37
|
-
*/
|
|
38
|
-
export var TYPEAHEAD_DECORATION_SELECTOR = '[data-type-ahead="typeaheadDecoration"]';
|
|
39
|
-
export var handleTypeAheadOpenDomMutation = function handleTypeAheadOpenDomMutation(_ref) {
|
|
40
|
-
var mutations = _ref.mutations;
|
|
41
|
-
var _iterator = _createForOfIteratorHelper(mutations),
|
|
42
|
-
_step;
|
|
43
|
-
try {
|
|
44
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
45
|
-
var mutation = _step.value;
|
|
46
|
-
if (mutation.type !== 'childList') {
|
|
47
|
-
continue;
|
|
48
|
-
}
|
|
49
|
-
var _iterator2 = _createForOfIteratorHelper(mutation.addedNodes),
|
|
50
|
-
_step2;
|
|
51
|
-
try {
|
|
52
|
-
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
53
|
-
var node = _step2.value;
|
|
54
|
-
if (!(node instanceof HTMLElement)) {
|
|
55
|
-
continue;
|
|
56
|
-
}
|
|
57
|
-
if (node.matches(TYPEAHEAD_DECORATION_SELECTOR) || node.querySelector(TYPEAHEAD_DECORATION_SELECTOR)) {
|
|
58
|
-
return {
|
|
59
|
-
status: 'success'
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
} catch (err) {
|
|
64
|
-
_iterator2.e(err);
|
|
65
|
-
} finally {
|
|
66
|
-
_iterator2.f();
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
} catch (err) {
|
|
70
|
-
_iterator.e(err);
|
|
71
|
-
} finally {
|
|
72
|
-
_iterator.f();
|
|
73
|
-
}
|
|
74
|
-
return undefined;
|
|
75
|
-
};
|
|
76
37
|
export var ExperienceCheckPopupMutation = /*#__PURE__*/function () {
|
|
77
38
|
function ExperienceCheckPopupMutation(nestedElementQuery, getTarget, getEditorDom) {
|
|
39
|
+
var type = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'editorRoot';
|
|
78
40
|
_classCallCheck(this, ExperienceCheckPopupMutation);
|
|
79
41
|
_defineProperty(this, "observers", []);
|
|
80
42
|
this.nestedElementQuery = nestedElementQuery;
|
|
81
43
|
this.getTarget = getTarget;
|
|
82
44
|
this.getEditorDom = getEditorDom;
|
|
45
|
+
this.type = type;
|
|
83
46
|
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Returns the list of DOM elements to observe based on popup type.
|
|
50
|
+
*/
|
|
84
51
|
return _createClass(ExperienceCheckPopupMutation, [{
|
|
52
|
+
key: "getObserveTargets",
|
|
53
|
+
value: function getObserveTargets() {
|
|
54
|
+
switch (this.type) {
|
|
55
|
+
case 'inline':
|
|
56
|
+
return this.getInlineTargets();
|
|
57
|
+
case 'editorRoot':
|
|
58
|
+
return this.getEditorRootTargets();
|
|
59
|
+
}
|
|
60
|
+
// Should never reach here - all types handled above
|
|
61
|
+
return [];
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* For 'inline' type: observe only the button-group container.
|
|
66
|
+
* The target passed in should be the button-group (or button within it) from getInlinePopupTarget().
|
|
67
|
+
* Inline popups appear as direct children of button-group elements.
|
|
68
|
+
*/
|
|
69
|
+
}, {
|
|
70
|
+
key: "getInlineTargets",
|
|
71
|
+
value: function getInlineTargets() {
|
|
72
|
+
var target = this.getTarget();
|
|
73
|
+
if (!target) {
|
|
74
|
+
return [];
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Walk up to find the button-group container
|
|
78
|
+
var buttonGroup = target.closest('[data-toolbar-component="button-group"]');
|
|
79
|
+
|
|
80
|
+
// Target is already the button-group or button from getInlinePopupTarget()
|
|
81
|
+
// Just observe this single element
|
|
82
|
+
return buttonGroup ? [buttonGroup, target] : [target];
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* For 'editorRoot' type: observe the actual editor root container.
|
|
87
|
+
* The editorDom is the ProseMirror element, but popups appear as direct children
|
|
88
|
+
* of the parent .akEditor container. So we observe the parent of editorDom.
|
|
89
|
+
* No portal observation needed.
|
|
90
|
+
*/
|
|
91
|
+
}, {
|
|
92
|
+
key: "getEditorRootTargets",
|
|
93
|
+
value: function getEditorRootTargets() {
|
|
94
|
+
var targets = [];
|
|
95
|
+
var editorDom = this.getEditorDom();
|
|
96
|
+
if (editorDom) {
|
|
97
|
+
// Find the actual editor root (.akEditor) by walking up the DOM
|
|
98
|
+
var editorRoot = editorDom.closest('.akEditor') || editorDom.parentElement;
|
|
99
|
+
if (editorRoot instanceof HTMLElement) {
|
|
100
|
+
targets.push(editorRoot);
|
|
101
|
+
|
|
102
|
+
// Observe existing [data-editor-popup] wrappers
|
|
103
|
+
var wrappers = editorRoot.querySelectorAll('[data-editor-popup]');
|
|
104
|
+
var _iterator = _createForOfIteratorHelper(wrappers),
|
|
105
|
+
_step;
|
|
106
|
+
try {
|
|
107
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
108
|
+
var wrapper = _step.value;
|
|
109
|
+
targets.push(wrapper);
|
|
110
|
+
}
|
|
111
|
+
} catch (err) {
|
|
112
|
+
_iterator.e(err);
|
|
113
|
+
} finally {
|
|
114
|
+
_iterator.f();
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return targets;
|
|
119
|
+
}
|
|
120
|
+
}, {
|
|
85
121
|
key: "start",
|
|
86
122
|
value: function start(callback) {
|
|
87
123
|
var _this = this;
|
|
@@ -104,23 +140,24 @@ export var ExperienceCheckPopupMutation = /*#__PURE__*/function () {
|
|
|
104
140
|
}
|
|
105
141
|
var query = this.nestedElementQuery;
|
|
106
142
|
var onMutation = function onMutation(mutations) {
|
|
107
|
-
var
|
|
108
|
-
|
|
143
|
+
var _iterator2 = _createForOfIteratorHelper(mutations),
|
|
144
|
+
_step2;
|
|
109
145
|
try {
|
|
110
|
-
for (
|
|
111
|
-
var mutation =
|
|
146
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
147
|
+
var mutation = _step2.value;
|
|
112
148
|
if (mutation.type !== 'childList') {
|
|
113
149
|
continue;
|
|
114
150
|
}
|
|
115
|
-
var
|
|
116
|
-
|
|
151
|
+
var _iterator3 = _createForOfIteratorHelper(mutation.addedNodes),
|
|
152
|
+
_step3;
|
|
117
153
|
try {
|
|
118
|
-
for (
|
|
119
|
-
var node =
|
|
154
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
155
|
+
var node = _step3.value;
|
|
120
156
|
if (!(node instanceof HTMLElement)) {
|
|
121
157
|
continue;
|
|
122
158
|
}
|
|
123
|
-
|
|
159
|
+
var found = popupWithNestedElement(node, query) || node.matches(query) || !!node.querySelector(query);
|
|
160
|
+
if (found) {
|
|
124
161
|
_this.stop();
|
|
125
162
|
callback({
|
|
126
163
|
status: 'success'
|
|
@@ -129,15 +166,15 @@ export var ExperienceCheckPopupMutation = /*#__PURE__*/function () {
|
|
|
129
166
|
}
|
|
130
167
|
}
|
|
131
168
|
} catch (err) {
|
|
132
|
-
|
|
169
|
+
_iterator3.e(err);
|
|
133
170
|
} finally {
|
|
134
|
-
|
|
171
|
+
_iterator3.f();
|
|
135
172
|
}
|
|
136
173
|
}
|
|
137
174
|
} catch (err) {
|
|
138
|
-
|
|
175
|
+
_iterator2.e(err);
|
|
139
176
|
} finally {
|
|
140
|
-
|
|
177
|
+
_iterator2.f();
|
|
141
178
|
}
|
|
142
179
|
};
|
|
143
180
|
var observe = function observe(el) {
|
|
@@ -147,126 +184,36 @@ export var ExperienceCheckPopupMutation = /*#__PURE__*/function () {
|
|
|
147
184
|
});
|
|
148
185
|
_this.observers.push(observer);
|
|
149
186
|
};
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
187
|
+
|
|
188
|
+
// Get type-specific targets and observe them
|
|
189
|
+
var observeTargets = this.getObserveTargets();
|
|
190
|
+
var _iterator4 = _createForOfIteratorHelper(observeTargets),
|
|
191
|
+
_step4;
|
|
153
192
|
try {
|
|
154
|
-
for (
|
|
155
|
-
var
|
|
156
|
-
observe(
|
|
193
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
194
|
+
var observeTarget = _step4.value;
|
|
195
|
+
observe(observeTarget);
|
|
157
196
|
}
|
|
158
197
|
} catch (err) {
|
|
159
|
-
|
|
198
|
+
_iterator4.e(err);
|
|
160
199
|
} finally {
|
|
161
|
-
|
|
200
|
+
_iterator4.f();
|
|
162
201
|
}
|
|
163
|
-
var portalContainer = doc.querySelector('.atlaskit-portal-container');
|
|
164
|
-
if (portalContainer instanceof HTMLElement) {
|
|
165
|
-
var observePortal = function observePortal(portal) {
|
|
166
|
-
observe(portal);
|
|
167
|
-
var _iterator6 = _createForOfIteratorHelper(portal.children),
|
|
168
|
-
_step6;
|
|
169
|
-
try {
|
|
170
|
-
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
171
|
-
var child = _step6.value;
|
|
172
|
-
if (child instanceof HTMLElement) {
|
|
173
|
-
observe(child);
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
} catch (err) {
|
|
177
|
-
_iterator6.e(err);
|
|
178
|
-
} finally {
|
|
179
|
-
_iterator6.f();
|
|
180
|
-
}
|
|
181
|
-
};
|
|
182
|
-
var containerObserver = new MutationObserver(function (mutations) {
|
|
183
|
-
var _iterator7 = _createForOfIteratorHelper(mutations),
|
|
184
|
-
_step7;
|
|
185
|
-
try {
|
|
186
|
-
for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
|
|
187
|
-
var mutation = _step7.value;
|
|
188
|
-
if (mutation.type !== 'childList') {
|
|
189
|
-
continue;
|
|
190
|
-
}
|
|
191
|
-
var _iterator8 = _createForOfIteratorHelper(mutation.addedNodes),
|
|
192
|
-
_step8;
|
|
193
|
-
try {
|
|
194
|
-
for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
|
|
195
|
-
var node = _step8.value;
|
|
196
|
-
if (node instanceof HTMLElement) {
|
|
197
|
-
observePortal(node);
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
} catch (err) {
|
|
201
|
-
_iterator8.e(err);
|
|
202
|
-
} finally {
|
|
203
|
-
_iterator8.f();
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
} catch (err) {
|
|
207
|
-
_iterator7.e(err);
|
|
208
|
-
} finally {
|
|
209
|
-
_iterator7.f();
|
|
210
|
-
}
|
|
211
|
-
onMutation(mutations);
|
|
212
|
-
});
|
|
213
|
-
containerObserver.observe(portalContainer, {
|
|
214
|
-
childList: true
|
|
215
|
-
});
|
|
216
|
-
this.observers.push(containerObserver);
|
|
217
|
-
var _iterator9 = _createForOfIteratorHelper(portalContainer.querySelectorAll('.atlaskit-portal')),
|
|
218
|
-
_step9;
|
|
219
|
-
try {
|
|
220
|
-
for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
|
|
221
|
-
var portal = _step9.value;
|
|
222
|
-
observePortal(portal);
|
|
223
|
-
}
|
|
224
|
-
} catch (err) {
|
|
225
|
-
_iterator9.e(err);
|
|
226
|
-
} finally {
|
|
227
|
-
_iterator9.f();
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
var editorDom = this.getEditorDom();
|
|
231
|
-
if (editorDom !== null && editorDom !== void 0 && editorDom.parentElement) {
|
|
232
|
-
observe(editorDom.parentElement);
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
// Two-frame DOM check to handle cases where rendering happens before
|
|
236
|
-
// observers are attached.
|
|
237
|
-
var checkDom = function checkDom() {
|
|
238
|
-
if (doc.querySelector(query)) {
|
|
239
|
-
_this.stop();
|
|
240
|
-
callback({
|
|
241
|
-
status: 'success'
|
|
242
|
-
});
|
|
243
|
-
return;
|
|
244
|
-
}
|
|
245
|
-
requestAnimationFrame(function () {
|
|
246
|
-
if (doc.querySelector(query)) {
|
|
247
|
-
_this.stop();
|
|
248
|
-
callback({
|
|
249
|
-
status: 'success'
|
|
250
|
-
});
|
|
251
|
-
}
|
|
252
|
-
});
|
|
253
|
-
};
|
|
254
|
-
requestAnimationFrame(checkDom);
|
|
255
202
|
}
|
|
256
203
|
}, {
|
|
257
204
|
key: "stop",
|
|
258
205
|
value: function stop() {
|
|
259
|
-
var
|
|
260
|
-
|
|
206
|
+
var _iterator5 = _createForOfIteratorHelper(this.observers),
|
|
207
|
+
_step5;
|
|
261
208
|
try {
|
|
262
|
-
for (
|
|
263
|
-
var observer =
|
|
209
|
+
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
210
|
+
var observer = _step5.value;
|
|
264
211
|
observer.disconnect();
|
|
265
212
|
}
|
|
266
213
|
} catch (err) {
|
|
267
|
-
|
|
214
|
+
_iterator5.e(err);
|
|
268
215
|
} finally {
|
|
269
|
-
|
|
216
|
+
_iterator5.f();
|
|
270
217
|
}
|
|
271
218
|
this.observers = [];
|
|
272
219
|
}
|
|
@@ -343,23 +290,23 @@ var matchesNodeInsertMarker = function matchesNodeInsertMarker(node) {
|
|
|
343
290
|
* 1. Marker-based: checks `addedNodes` against known node insert selectors.
|
|
344
291
|
* 2. Structure-based: detects element add+remove (block-level replacement).
|
|
345
292
|
*/
|
|
346
|
-
export var handleEditorNodeInsertDomMutation = function handleEditorNodeInsertDomMutation(
|
|
347
|
-
var mutations =
|
|
293
|
+
export var handleEditorNodeInsertDomMutation = function handleEditorNodeInsertDomMutation(_ref) {
|
|
294
|
+
var mutations = _ref.mutations;
|
|
348
295
|
var hasAddedElement = false;
|
|
349
296
|
var hasRemovedElement = false;
|
|
350
|
-
var
|
|
351
|
-
|
|
297
|
+
var _iterator6 = _createForOfIteratorHelper(mutations),
|
|
298
|
+
_step6;
|
|
352
299
|
try {
|
|
353
|
-
for (
|
|
354
|
-
var mutation =
|
|
300
|
+
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
301
|
+
var mutation = _step6.value;
|
|
355
302
|
if (mutation.type !== 'childList') {
|
|
356
303
|
continue;
|
|
357
304
|
}
|
|
358
|
-
var
|
|
359
|
-
|
|
305
|
+
var _iterator7 = _createForOfIteratorHelper(mutation.addedNodes),
|
|
306
|
+
_step7;
|
|
360
307
|
try {
|
|
361
|
-
for (
|
|
362
|
-
var node =
|
|
308
|
+
for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
|
|
309
|
+
var node = _step7.value;
|
|
363
310
|
if (matchesNodeInsertMarker(node)) {
|
|
364
311
|
return {
|
|
365
312
|
status: 'success'
|
|
@@ -370,29 +317,29 @@ export var handleEditorNodeInsertDomMutation = function handleEditorNodeInsertDo
|
|
|
370
317
|
}
|
|
371
318
|
}
|
|
372
319
|
} catch (err) {
|
|
373
|
-
|
|
320
|
+
_iterator7.e(err);
|
|
374
321
|
} finally {
|
|
375
|
-
|
|
322
|
+
_iterator7.f();
|
|
376
323
|
}
|
|
377
|
-
var
|
|
378
|
-
|
|
324
|
+
var _iterator8 = _createForOfIteratorHelper(mutation.removedNodes),
|
|
325
|
+
_step8;
|
|
379
326
|
try {
|
|
380
|
-
for (
|
|
381
|
-
var _node =
|
|
327
|
+
for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
|
|
328
|
+
var _node = _step8.value;
|
|
382
329
|
if (_node instanceof HTMLElement) {
|
|
383
330
|
hasRemovedElement = true;
|
|
384
331
|
}
|
|
385
332
|
}
|
|
386
333
|
} catch (err) {
|
|
387
|
-
|
|
334
|
+
_iterator8.e(err);
|
|
388
335
|
} finally {
|
|
389
|
-
|
|
336
|
+
_iterator8.f();
|
|
390
337
|
}
|
|
391
338
|
}
|
|
392
339
|
} catch (err) {
|
|
393
|
-
|
|
340
|
+
_iterator6.e(err);
|
|
394
341
|
} finally {
|
|
395
|
-
|
|
342
|
+
_iterator6.f();
|
|
396
343
|
}
|
|
397
344
|
if (hasAddedElement && hasRemovedElement) {
|
|
398
345
|
return {
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import type { ExperienceCheck, ExperienceCheckCallback, ExperienceCheckResult } from '@atlaskit/editor-common/experiences';
|
|
2
2
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
|
+
/**
|
|
4
|
+
* Popup check type determines how popups are observed based on their DOM location:
|
|
5
|
+
* - 'inline': Popups appearing in toolbar button-groups (emoji, media, table selector, image)
|
|
6
|
+
* - 'editorRoot': Popups attached to editor root (e.g., mention popups)
|
|
7
|
+
* - 'editorContent': Content-level popups or modals in portal containers (e.g., block menu)
|
|
8
|
+
*/
|
|
9
|
+
export type PopupCheckType = 'inline' | 'editorRoot' | 'editorContent';
|
|
3
10
|
/**
|
|
4
11
|
* DOM marker selectors for node types inserted via toolbar actions.
|
|
5
12
|
* Matches outermost wrapper elements set synchronously by ReactNodeView
|
|
@@ -13,24 +20,30 @@ export declare const NODE_INSERT_MARKERS: {
|
|
|
13
20
|
readonly TASK_ITEM: ".taskItemView-content-wrap";
|
|
14
21
|
};
|
|
15
22
|
export declare const isToolbarButtonClick: (target: HTMLElement, testId: string) => boolean;
|
|
16
|
-
/**
|
|
17
|
-
* ExperienceCheck that observes popup mount point and all its
|
|
18
|
-
* `[data-editor-popup]` children with `{ childList: true }` (no subtree).
|
|
19
|
-
*
|
|
20
|
-
* Detects when a popup containing the given nested element is added to the
|
|
21
|
-
* DOM — either as a new `[data-editor-popup]` direct child, or as content
|
|
22
|
-
* rendered inside an existing `[data-editor-popup]` wrapper.
|
|
23
|
-
*/
|
|
24
|
-
export declare const TYPEAHEAD_DECORATION_SELECTOR = "[data-type-ahead=\"typeaheadDecoration\"]";
|
|
25
|
-
export declare const handleTypeAheadOpenDomMutation: ({ mutations, }: {
|
|
26
|
-
mutations: MutationRecord[];
|
|
27
|
-
}) => ExperienceCheckResult | undefined;
|
|
28
23
|
export declare class ExperienceCheckPopupMutation implements ExperienceCheck {
|
|
29
24
|
private nestedElementQuery;
|
|
30
25
|
private getTarget;
|
|
31
26
|
private getEditorDom;
|
|
27
|
+
private type;
|
|
32
28
|
private observers;
|
|
33
|
-
constructor(nestedElementQuery: string, getTarget: () => HTMLElement | undefined | null, getEditorDom: () => HTMLElement | undefined | null);
|
|
29
|
+
constructor(nestedElementQuery: string, getTarget: () => HTMLElement | undefined | null, getEditorDom: () => HTMLElement | undefined | null, type?: PopupCheckType);
|
|
30
|
+
/**
|
|
31
|
+
* Returns the list of DOM elements to observe based on popup type.
|
|
32
|
+
*/
|
|
33
|
+
private getObserveTargets;
|
|
34
|
+
/**
|
|
35
|
+
* For 'inline' type: observe only the button-group container.
|
|
36
|
+
* The target passed in should be the button-group (or button within it) from getInlinePopupTarget().
|
|
37
|
+
* Inline popups appear as direct children of button-group elements.
|
|
38
|
+
*/
|
|
39
|
+
private getInlineTargets;
|
|
40
|
+
/**
|
|
41
|
+
* For 'editorRoot' type: observe the actual editor root container.
|
|
42
|
+
* The editorDom is the ProseMirror element, but popups appear as direct children
|
|
43
|
+
* of the parent .akEditor container. So we observe the parent of editorDom.
|
|
44
|
+
* No portal observation needed.
|
|
45
|
+
*/
|
|
46
|
+
private getEditorRootTargets;
|
|
34
47
|
start(callback: ExperienceCheckCallback): void;
|
|
35
48
|
stop(): void;
|
|
36
49
|
}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import type { ExperienceCheck, ExperienceCheckCallback, ExperienceCheckResult } from '@atlaskit/editor-common/experiences';
|
|
2
2
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
|
+
/**
|
|
4
|
+
* Popup check type determines how popups are observed based on their DOM location:
|
|
5
|
+
* - 'inline': Popups appearing in toolbar button-groups (emoji, media, table selector, image)
|
|
6
|
+
* - 'editorRoot': Popups attached to editor root (e.g., mention popups)
|
|
7
|
+
* - 'editorContent': Content-level popups or modals in portal containers (e.g., block menu)
|
|
8
|
+
*/
|
|
9
|
+
export type PopupCheckType = 'inline' | 'editorRoot' | 'editorContent';
|
|
3
10
|
/**
|
|
4
11
|
* DOM marker selectors for node types inserted via toolbar actions.
|
|
5
12
|
* Matches outermost wrapper elements set synchronously by ReactNodeView
|
|
@@ -13,24 +20,30 @@ export declare const NODE_INSERT_MARKERS: {
|
|
|
13
20
|
readonly TASK_ITEM: ".taskItemView-content-wrap";
|
|
14
21
|
};
|
|
15
22
|
export declare const isToolbarButtonClick: (target: HTMLElement, testId: string) => boolean;
|
|
16
|
-
/**
|
|
17
|
-
* ExperienceCheck that observes popup mount point and all its
|
|
18
|
-
* `[data-editor-popup]` children with `{ childList: true }` (no subtree).
|
|
19
|
-
*
|
|
20
|
-
* Detects when a popup containing the given nested element is added to the
|
|
21
|
-
* DOM — either as a new `[data-editor-popup]` direct child, or as content
|
|
22
|
-
* rendered inside an existing `[data-editor-popup]` wrapper.
|
|
23
|
-
*/
|
|
24
|
-
export declare const TYPEAHEAD_DECORATION_SELECTOR = "[data-type-ahead=\"typeaheadDecoration\"]";
|
|
25
|
-
export declare const handleTypeAheadOpenDomMutation: ({ mutations, }: {
|
|
26
|
-
mutations: MutationRecord[];
|
|
27
|
-
}) => ExperienceCheckResult | undefined;
|
|
28
23
|
export declare class ExperienceCheckPopupMutation implements ExperienceCheck {
|
|
29
24
|
private nestedElementQuery;
|
|
30
25
|
private getTarget;
|
|
31
26
|
private getEditorDom;
|
|
27
|
+
private type;
|
|
32
28
|
private observers;
|
|
33
|
-
constructor(nestedElementQuery: string, getTarget: () => HTMLElement | undefined | null, getEditorDom: () => HTMLElement | undefined | null);
|
|
29
|
+
constructor(nestedElementQuery: string, getTarget: () => HTMLElement | undefined | null, getEditorDom: () => HTMLElement | undefined | null, type?: PopupCheckType);
|
|
30
|
+
/**
|
|
31
|
+
* Returns the list of DOM elements to observe based on popup type.
|
|
32
|
+
*/
|
|
33
|
+
private getObserveTargets;
|
|
34
|
+
/**
|
|
35
|
+
* For 'inline' type: observe only the button-group container.
|
|
36
|
+
* The target passed in should be the button-group (or button within it) from getInlinePopupTarget().
|
|
37
|
+
* Inline popups appear as direct children of button-group elements.
|
|
38
|
+
*/
|
|
39
|
+
private getInlineTargets;
|
|
40
|
+
/**
|
|
41
|
+
* For 'editorRoot' type: observe the actual editor root container.
|
|
42
|
+
* The editorDom is the ProseMirror element, but popups appear as direct children
|
|
43
|
+
* of the parent .akEditor container. So we observe the parent of editorDom.
|
|
44
|
+
* No portal observation needed.
|
|
45
|
+
*/
|
|
46
|
+
private getEditorRootTargets;
|
|
34
47
|
start(callback: ExperienceCheckCallback): void;
|
|
35
48
|
stop(): void;
|
|
36
49
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-insert-block",
|
|
3
|
-
"version": "8.7.
|
|
3
|
+
"version": "8.7.3",
|
|
4
4
|
"description": "Insert block plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@atlaskit/editor-plugin-connectivity": "^7.0.0",
|
|
37
37
|
"@atlaskit/editor-plugin-date": "^9.1.0",
|
|
38
38
|
"@atlaskit/editor-plugin-emoji": "^8.1.0",
|
|
39
|
-
"@atlaskit/editor-plugin-expand": "^8.
|
|
39
|
+
"@atlaskit/editor-plugin-expand": "^8.3.0",
|
|
40
40
|
"@atlaskit/editor-plugin-extension": "^10.1.0",
|
|
41
41
|
"@atlaskit/editor-plugin-feature-flags": "^6.0.0",
|
|
42
42
|
"@atlaskit/editor-plugin-hyperlink": "^9.0.0",
|
|
@@ -59,13 +59,13 @@
|
|
|
59
59
|
"@atlaskit/editor-prosemirror": "^7.3.0",
|
|
60
60
|
"@atlaskit/editor-shared-styles": "^3.10.0",
|
|
61
61
|
"@atlaskit/editor-toolbar": "^0.19.0",
|
|
62
|
-
"@atlaskit/editor-toolbar-model": "^0.
|
|
62
|
+
"@atlaskit/editor-toolbar-model": "^0.4.0",
|
|
63
63
|
"@atlaskit/emoji": "^69.10.0",
|
|
64
64
|
"@atlaskit/icon": "^31.0.0",
|
|
65
65
|
"@atlaskit/icon-lab": "^5.16.0",
|
|
66
66
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
67
67
|
"@atlaskit/theme": "^21.0.0",
|
|
68
|
-
"@atlaskit/tmp-editor-statsig": "^29.
|
|
68
|
+
"@atlaskit/tmp-editor-statsig": "^29.5.0",
|
|
69
69
|
"@atlaskit/tokens": "^11.0.0",
|
|
70
70
|
"@babel/runtime": "^7.0.0",
|
|
71
71
|
"@emotion/react": "^11.7.1",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"react-virtualized": "^9.22.6"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
78
|
-
"@atlaskit/editor-common": "^111.
|
|
78
|
+
"@atlaskit/editor-common": "^111.19.0",
|
|
79
79
|
"react": "^18.2.0",
|
|
80
80
|
"react-dom": "^18.2.0",
|
|
81
81
|
"react-intl-next": "npm:react-intl@^5.18.1"
|