@atlaskit/editor-plugin-breakout 22.0.8 → 22.0.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.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-breakout
|
|
2
2
|
|
|
3
|
+
## 22.0.10
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`5655e3d4d88fc`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5655e3d4d88fc) -
|
|
8
|
+
Clean up experiment `platform_editor_reduce_event_listener_count`. The treatment behaviour is now
|
|
9
|
+
permanent: node views that render nothing no longer mount a React portal, breakout resize tooltips
|
|
10
|
+
mount on first hover, and layout column dividers are keyed by section ordinal and found via a
|
|
11
|
+
scoped document walk.
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
14
|
+
## 22.0.9
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
3
20
|
## 22.0.8
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -128,9 +128,6 @@ var createPragmaticResizer = exports.createPragmaticResizer = function createPra
|
|
|
128
128
|
intl = _ref3.intl,
|
|
129
129
|
nodeViewPortalProviderAPI = _ref3.nodeViewPortalProviderAPI;
|
|
130
130
|
var state = 'default';
|
|
131
|
-
// Read once per resizer: `isExperimentEnabled` fires an exposure event, and `registerEvents` is
|
|
132
|
-
// bound to several elements so checking it inside the handler would emit one per element hovered.
|
|
133
|
-
var isDeferredTooltipEnabled = (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_reduce_event_listener_count');
|
|
134
131
|
var isLeftResizeHandleDisabled = (0, _expValEquals.expValEquals)('platform_editor_lovability_resize_dividers_panels', 'isEnabled', true) || (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_lovability_resize_extensions') || (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_remove_left_resize_handle');
|
|
135
132
|
var createHandle = function createHandle(side) {
|
|
136
133
|
var handle = document.createElement('div');
|
|
@@ -183,8 +180,8 @@ var createPragmaticResizer = exports.createPragmaticResizer = function createPra
|
|
|
183
180
|
};
|
|
184
181
|
var vanillaTooltip;
|
|
185
182
|
|
|
186
|
-
// Tracks whether there is anything to tear down
|
|
187
|
-
//
|
|
183
|
+
// Tracks whether there is anything to tear down: the tooltip mounts on first hover and so
|
|
184
|
+
// may never mount at all.
|
|
188
185
|
var isTooltipMounted = false;
|
|
189
186
|
var mountTooltip = function mountTooltip() {
|
|
190
187
|
if (isTooltipMounted) {
|
|
@@ -219,22 +216,8 @@ var createPragmaticResizer = exports.createPragmaticResizer = function createPra
|
|
|
219
216
|
//
|
|
220
217
|
// Parking the rail also needs `width: 100%`: without the ADS tooltip's wrappers (stretched
|
|
221
218
|
// by `pragmaticResizerStylesForTooltip`) it would size to its content as a flex item.
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
// says: no portal means no listener cost, and first hover is when the node name reads
|
|
225
|
-
// correctly.
|
|
226
|
-
rail.style.width = '100%';
|
|
227
|
-
tooltipContainer.appendChild(rail);
|
|
228
|
-
} else {
|
|
229
|
-
// Remove this while at `platform_editor_use_vanilla_components` cleanup.
|
|
230
|
-
if (isDeferredTooltipEnabled) {
|
|
231
|
-
rail.style.width = '100%';
|
|
232
|
-
tooltipContainer.appendChild(rail);
|
|
233
|
-
} else {
|
|
234
|
-
// Not `mountTooltip`: that would set `isTooltipMounted` where the control arm never did.
|
|
235
|
-
renderTooltip();
|
|
236
|
-
}
|
|
237
|
-
}
|
|
219
|
+
rail.style.width = '100%';
|
|
220
|
+
tooltipContainer.appendChild(rail);
|
|
238
221
|
return {
|
|
239
222
|
handle: handle,
|
|
240
223
|
rail: rail,
|
|
@@ -255,9 +238,9 @@ var createPragmaticResizer = exports.createPragmaticResizer = function createPra
|
|
|
255
238
|
return;
|
|
256
239
|
}
|
|
257
240
|
|
|
258
|
-
// The
|
|
259
|
-
//
|
|
260
|
-
if (
|
|
241
|
+
// The tooltip mounts on first hover, so `destroyTooltip` can be reached without
|
|
242
|
+
// anything having been mounted.
|
|
243
|
+
if (!isTooltipMounted) {
|
|
261
244
|
return;
|
|
262
245
|
}
|
|
263
246
|
nodeViewPortalProviderAPI.remove(key);
|
|
@@ -332,16 +315,11 @@ var createPragmaticResizer = exports.createPragmaticResizer = function createPra
|
|
|
332
315
|
return [(0, _bindEventListener.bind)(element, {
|
|
333
316
|
type: 'mouseenter',
|
|
334
317
|
listener: function listener(event) {
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
// Always mounts on first hover, so it also mounts when the deferred experiment is
|
|
340
|
-
// off. `mountTooltip` is a no-op once mounted, so the overlap is safe. At
|
|
341
|
-
// cleanup, drop the gate and delete the block above — this covers both.
|
|
318
|
+
// Mounted on first hover rather than up front, so a handle that is never
|
|
319
|
+
// hovered costs no portal and no listeners.
|
|
320
|
+
rightHandle.mountTooltip();
|
|
321
|
+
leftHandle === null || leftHandle === void 0 || leftHandle.mountTooltip();
|
|
342
322
|
if ((0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_use_vanilla_components')) {
|
|
343
|
-
rightHandle.mountTooltip();
|
|
344
|
-
leftHandle === null || leftHandle === void 0 || leftHandle.mountTooltip();
|
|
345
323
|
// After the mount above, so the tooltip always exists to be opened.
|
|
346
324
|
openTooltipAt(hoverAnchor, event);
|
|
347
325
|
}
|
|
@@ -117,9 +117,6 @@ export const createPragmaticResizer = ({
|
|
|
117
117
|
nodeViewPortalProviderAPI
|
|
118
118
|
}) => {
|
|
119
119
|
let state = 'default';
|
|
120
|
-
// Read once per resizer: `isExperimentEnabled` fires an exposure event, and `registerEvents` is
|
|
121
|
-
// bound to several elements so checking it inside the handler would emit one per element hovered.
|
|
122
|
-
const isDeferredTooltipEnabled = isExperimentEnabled('platform_editor_reduce_event_listener_count');
|
|
123
120
|
const isLeftResizeHandleDisabled = expValEquals('platform_editor_lovability_resize_dividers_panels', 'isEnabled', true) || isExperimentEnabled('platform_editor_lovability_resize_extensions') || isExperimentEnabled('platform_editor_remove_left_resize_handle');
|
|
124
121
|
const createHandle = side => {
|
|
125
122
|
const handle = document.createElement('div');
|
|
@@ -168,8 +165,8 @@ export const createPragmaticResizer = ({
|
|
|
168
165
|
}), tooltipContainer, key);
|
|
169
166
|
let vanillaTooltip;
|
|
170
167
|
|
|
171
|
-
// Tracks whether there is anything to tear down
|
|
172
|
-
//
|
|
168
|
+
// Tracks whether there is anything to tear down: the tooltip mounts on first hover and so
|
|
169
|
+
// may never mount at all.
|
|
173
170
|
let isTooltipMounted = false;
|
|
174
171
|
const mountTooltip = () => {
|
|
175
172
|
if (isTooltipMounted) {
|
|
@@ -204,22 +201,8 @@ export const createPragmaticResizer = ({
|
|
|
204
201
|
//
|
|
205
202
|
// Parking the rail also needs `width: 100%`: without the ADS tooltip's wrappers (stretched
|
|
206
203
|
// by `pragmaticResizerStylesForTooltip`) it would size to its content as a flex item.
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
// says: no portal means no listener cost, and first hover is when the node name reads
|
|
210
|
-
// correctly.
|
|
211
|
-
rail.style.width = '100%';
|
|
212
|
-
tooltipContainer.appendChild(rail);
|
|
213
|
-
} else {
|
|
214
|
-
// Remove this while at `platform_editor_use_vanilla_components` cleanup.
|
|
215
|
-
if (isDeferredTooltipEnabled) {
|
|
216
|
-
rail.style.width = '100%';
|
|
217
|
-
tooltipContainer.appendChild(rail);
|
|
218
|
-
} else {
|
|
219
|
-
// Not `mountTooltip`: that would set `isTooltipMounted` where the control arm never did.
|
|
220
|
-
renderTooltip();
|
|
221
|
-
}
|
|
222
|
-
}
|
|
204
|
+
rail.style.width = '100%';
|
|
205
|
+
tooltipContainer.appendChild(rail);
|
|
223
206
|
return {
|
|
224
207
|
handle,
|
|
225
208
|
rail,
|
|
@@ -240,9 +223,9 @@ export const createPragmaticResizer = ({
|
|
|
240
223
|
return;
|
|
241
224
|
}
|
|
242
225
|
|
|
243
|
-
// The
|
|
244
|
-
//
|
|
245
|
-
if (
|
|
226
|
+
// The tooltip mounts on first hover, so `destroyTooltip` can be reached without
|
|
227
|
+
// anything having been mounted.
|
|
228
|
+
if (!isTooltipMounted) {
|
|
246
229
|
return;
|
|
247
230
|
}
|
|
248
231
|
nodeViewPortalProviderAPI.remove(key);
|
|
@@ -316,16 +299,11 @@ export const createPragmaticResizer = ({
|
|
|
316
299
|
return [bind(element, {
|
|
317
300
|
type: 'mouseenter',
|
|
318
301
|
listener: event => {
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
// Always mounts on first hover, so it also mounts when the deferred experiment is
|
|
324
|
-
// off. `mountTooltip` is a no-op once mounted, so the overlap is safe. At
|
|
325
|
-
// cleanup, drop the gate and delete the block above — this covers both.
|
|
302
|
+
// Mounted on first hover rather than up front, so a handle that is never
|
|
303
|
+
// hovered costs no portal and no listeners.
|
|
304
|
+
rightHandle.mountTooltip();
|
|
305
|
+
leftHandle === null || leftHandle === void 0 ? void 0 : leftHandle.mountTooltip();
|
|
326
306
|
if (isExperimentEnabled('platform_editor_use_vanilla_components')) {
|
|
327
|
-
rightHandle.mountTooltip();
|
|
328
|
-
leftHandle === null || leftHandle === void 0 ? void 0 : leftHandle.mountTooltip();
|
|
329
307
|
// After the mount above, so the tooltip always exists to be opened.
|
|
330
308
|
openTooltipAt(hoverAnchor, event);
|
|
331
309
|
}
|
|
@@ -119,9 +119,6 @@ export var createPragmaticResizer = function createPragmaticResizer(_ref3) {
|
|
|
119
119
|
intl = _ref3.intl,
|
|
120
120
|
nodeViewPortalProviderAPI = _ref3.nodeViewPortalProviderAPI;
|
|
121
121
|
var state = 'default';
|
|
122
|
-
// Read once per resizer: `isExperimentEnabled` fires an exposure event, and `registerEvents` is
|
|
123
|
-
// bound to several elements so checking it inside the handler would emit one per element hovered.
|
|
124
|
-
var isDeferredTooltipEnabled = isExperimentEnabled('platform_editor_reduce_event_listener_count');
|
|
125
122
|
var isLeftResizeHandleDisabled = expValEquals('platform_editor_lovability_resize_dividers_panels', 'isEnabled', true) || isExperimentEnabled('platform_editor_lovability_resize_extensions') || isExperimentEnabled('platform_editor_remove_left_resize_handle');
|
|
126
123
|
var createHandle = function createHandle(side) {
|
|
127
124
|
var handle = document.createElement('div');
|
|
@@ -174,8 +171,8 @@ export var createPragmaticResizer = function createPragmaticResizer(_ref3) {
|
|
|
174
171
|
};
|
|
175
172
|
var vanillaTooltip;
|
|
176
173
|
|
|
177
|
-
// Tracks whether there is anything to tear down
|
|
178
|
-
//
|
|
174
|
+
// Tracks whether there is anything to tear down: the tooltip mounts on first hover and so
|
|
175
|
+
// may never mount at all.
|
|
179
176
|
var isTooltipMounted = false;
|
|
180
177
|
var mountTooltip = function mountTooltip() {
|
|
181
178
|
if (isTooltipMounted) {
|
|
@@ -210,22 +207,8 @@ export var createPragmaticResizer = function createPragmaticResizer(_ref3) {
|
|
|
210
207
|
//
|
|
211
208
|
// Parking the rail also needs `width: 100%`: without the ADS tooltip's wrappers (stretched
|
|
212
209
|
// by `pragmaticResizerStylesForTooltip`) it would size to its content as a flex item.
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
// says: no portal means no listener cost, and first hover is when the node name reads
|
|
216
|
-
// correctly.
|
|
217
|
-
rail.style.width = '100%';
|
|
218
|
-
tooltipContainer.appendChild(rail);
|
|
219
|
-
} else {
|
|
220
|
-
// Remove this while at `platform_editor_use_vanilla_components` cleanup.
|
|
221
|
-
if (isDeferredTooltipEnabled) {
|
|
222
|
-
rail.style.width = '100%';
|
|
223
|
-
tooltipContainer.appendChild(rail);
|
|
224
|
-
} else {
|
|
225
|
-
// Not `mountTooltip`: that would set `isTooltipMounted` where the control arm never did.
|
|
226
|
-
renderTooltip();
|
|
227
|
-
}
|
|
228
|
-
}
|
|
210
|
+
rail.style.width = '100%';
|
|
211
|
+
tooltipContainer.appendChild(rail);
|
|
229
212
|
return {
|
|
230
213
|
handle: handle,
|
|
231
214
|
rail: rail,
|
|
@@ -246,9 +229,9 @@ export var createPragmaticResizer = function createPragmaticResizer(_ref3) {
|
|
|
246
229
|
return;
|
|
247
230
|
}
|
|
248
231
|
|
|
249
|
-
// The
|
|
250
|
-
//
|
|
251
|
-
if (
|
|
232
|
+
// The tooltip mounts on first hover, so `destroyTooltip` can be reached without
|
|
233
|
+
// anything having been mounted.
|
|
234
|
+
if (!isTooltipMounted) {
|
|
252
235
|
return;
|
|
253
236
|
}
|
|
254
237
|
nodeViewPortalProviderAPI.remove(key);
|
|
@@ -323,16 +306,11 @@ export var createPragmaticResizer = function createPragmaticResizer(_ref3) {
|
|
|
323
306
|
return [bind(element, {
|
|
324
307
|
type: 'mouseenter',
|
|
325
308
|
listener: function listener(event) {
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
// Always mounts on first hover, so it also mounts when the deferred experiment is
|
|
331
|
-
// off. `mountTooltip` is a no-op once mounted, so the overlap is safe. At
|
|
332
|
-
// cleanup, drop the gate and delete the block above — this covers both.
|
|
309
|
+
// Mounted on first hover rather than up front, so a handle that is never
|
|
310
|
+
// hovered costs no portal and no listeners.
|
|
311
|
+
rightHandle.mountTooltip();
|
|
312
|
+
leftHandle === null || leftHandle === void 0 || leftHandle.mountTooltip();
|
|
333
313
|
if (isExperimentEnabled('platform_editor_use_vanilla_components')) {
|
|
334
|
-
rightHandle.mountTooltip();
|
|
335
|
-
leftHandle === null || leftHandle === void 0 || leftHandle.mountTooltip();
|
|
336
314
|
// After the mount above, so the tooltip always exists to be opened.
|
|
337
315
|
openTooltipAt(hoverAnchor, event);
|
|
338
316
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-breakout",
|
|
3
|
-
"version": "22.0.
|
|
3
|
+
"version": "22.0.10",
|
|
4
4
|
"description": "Breakout plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@atlaskit/platform-feature-flags": "^2.2.0",
|
|
37
37
|
"@atlaskit/pragmatic-drag-and-drop": "^4.0.0",
|
|
38
38
|
"@atlaskit/theme": "^28.2.0",
|
|
39
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
39
|
+
"@atlaskit/tmp-editor-statsig": "^218.0.0",
|
|
40
40
|
"@atlaskit/tokens": "^20.1.0",
|
|
41
41
|
"@atlaskit/tooltip": "^24.3.0",
|
|
42
42
|
"@babel/runtime": "^7.0.0",
|