@atlaskit/editor-plugin-quick-insert 19.0.4 → 19.0.6
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,20 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-quick-insert
|
|
2
2
|
|
|
3
|
+
## 19.0.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 19.0.5
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`89497a944a054`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/89497a944a054) -
|
|
14
|
+
Keep the block control Quick Insert button available after editor appearance changes behind
|
|
15
|
+
`platform_editor_block_control_migration`.
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
3
18
|
## 19.0.4
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -155,7 +155,7 @@ var quickInsertPlugin = exports.quickInsertPlugin = function quickInsertPlugin(_
|
|
|
155
155
|
dispatchAnalyticsEvent = _ref6.dispatchAnalyticsEvent;
|
|
156
156
|
return quickInsertPluginFactory((0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_slash_command') ? (defaultItems || []).filter(function (item) {
|
|
157
157
|
return item !== undefined;
|
|
158
|
-
}) : defaultItems, providerFactory, getIntl, dispatch, dispatchAnalyticsEvent, options === null || options === void 0 ? void 0 : options.emptyStateHandler, onInsert, options === null || options === void 0 ? void 0 : options.itemFilter, api);
|
|
158
|
+
}) : defaultItems, providerFactory, getIntl, dispatch, dispatchAnalyticsEvent, refs, options === null || options === void 0 ? void 0 : options.emptyStateHandler, onInsert, options === null || options === void 0 ? void 0 : options.itemFilter, api);
|
|
159
159
|
}
|
|
160
160
|
}, {
|
|
161
161
|
name: 'quickInsertOpenExperience',
|
|
@@ -177,7 +177,11 @@ var quickInsertPlugin = exports.quickInsertPlugin = function quickInsertPlugin(_
|
|
|
177
177
|
var editorView = _ref7.editorView,
|
|
178
178
|
popupsMountPoint = _ref7.popupsMountPoint,
|
|
179
179
|
wrapperElement = _ref7.wrapperElement;
|
|
180
|
-
|
|
180
|
+
// using contentComponent to set editorView can cause it to become stale when editor is reconfigured
|
|
181
|
+
// (e.g. page appearance change)
|
|
182
|
+
if (!(0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_block_control_migration')) {
|
|
183
|
+
refs.editorView = editorView || undefined;
|
|
184
|
+
}
|
|
181
185
|
refs.popupsMountPoint = popupsMountPoint || undefined;
|
|
182
186
|
refs.wrapperElement = wrapperElement || undefined;
|
|
183
187
|
if (!editorView || (0, _coreUtils.isSSR)()) {
|
|
@@ -342,10 +346,10 @@ var setProviderState = function setProviderState(providerState) {
|
|
|
342
346
|
return true;
|
|
343
347
|
};
|
|
344
348
|
};
|
|
345
|
-
function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispatch, dispatchAnalyticsEvent, emptyStateHandler) {
|
|
346
|
-
var onInsert = arguments.length >
|
|
347
|
-
var itemFilter = arguments.length >
|
|
348
|
-
var api = arguments.length >
|
|
349
|
+
function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispatch, dispatchAnalyticsEvent, refs, emptyStateHandler) {
|
|
350
|
+
var onInsert = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : function () {};
|
|
351
|
+
var itemFilter = arguments.length > 8 ? arguments[8] : undefined;
|
|
352
|
+
var api = arguments.length > 9 ? arguments[9] : undefined;
|
|
349
353
|
return new _safePlugin.SafePlugin({
|
|
350
354
|
key: _pluginKey.pluginKey,
|
|
351
355
|
state: {
|
|
@@ -379,6 +383,9 @@ function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispat
|
|
|
379
383
|
}
|
|
380
384
|
},
|
|
381
385
|
view: function view(editorView) {
|
|
386
|
+
if ((0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_block_control_migration')) {
|
|
387
|
+
refs.editorView = editorView;
|
|
388
|
+
}
|
|
382
389
|
var quickInsertItemsAnalyticsScheduler;
|
|
383
390
|
var isDestroyed = false;
|
|
384
391
|
var providerHandler = /*#__PURE__*/function () {
|
|
@@ -457,6 +464,9 @@ function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispat
|
|
|
457
464
|
return {
|
|
458
465
|
destroy: function destroy() {
|
|
459
466
|
var _quickInsertItemsAnal;
|
|
467
|
+
if ((0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_block_control_migration') && refs.editorView === editorView) {
|
|
468
|
+
refs.editorView = undefined;
|
|
469
|
+
}
|
|
460
470
|
isDestroyed = true;
|
|
461
471
|
(_quickInsertItemsAnal = quickInsertItemsAnalyticsScheduler) === null || _quickInsertItemsAnal === void 0 || _quickInsertItemsAnal.destroy();
|
|
462
472
|
providerFactory.unsubscribe('quickInsertProvider', providerHandler);
|
|
@@ -137,7 +137,7 @@ export const quickInsertPlugin = ({
|
|
|
137
137
|
getIntl,
|
|
138
138
|
dispatch,
|
|
139
139
|
dispatchAnalyticsEvent
|
|
140
|
-
}) => quickInsertPluginFactory(isExperimentEnabled('platform_editor_slash_command') ? (defaultItems || []).filter(item => item !== undefined) : defaultItems, providerFactory, getIntl, dispatch, dispatchAnalyticsEvent, options === null || options === void 0 ? void 0 : options.emptyStateHandler, onInsert, options === null || options === void 0 ? void 0 : options.itemFilter, api)
|
|
140
|
+
}) => quickInsertPluginFactory(isExperimentEnabled('platform_editor_slash_command') ? (defaultItems || []).filter(item => item !== undefined) : defaultItems, providerFactory, getIntl, dispatch, dispatchAnalyticsEvent, refs, options === null || options === void 0 ? void 0 : options.emptyStateHandler, onInsert, options === null || options === void 0 ? void 0 : options.itemFilter, api)
|
|
141
141
|
}, {
|
|
142
142
|
name: 'quickInsertOpenExperience',
|
|
143
143
|
plugin: () => getQuickInsertOpenExperiencePlugin({
|
|
@@ -157,7 +157,11 @@ export const quickInsertPlugin = ({
|
|
|
157
157
|
popupsMountPoint,
|
|
158
158
|
wrapperElement
|
|
159
159
|
}) {
|
|
160
|
-
|
|
160
|
+
// using contentComponent to set editorView can cause it to become stale when editor is reconfigured
|
|
161
|
+
// (e.g. page appearance change)
|
|
162
|
+
if (!isExperimentEnabled('platform_editor_block_control_migration')) {
|
|
163
|
+
refs.editorView = editorView || undefined;
|
|
164
|
+
}
|
|
161
165
|
refs.popupsMountPoint = popupsMountPoint || undefined;
|
|
162
166
|
refs.wrapperElement = wrapperElement || undefined;
|
|
163
167
|
if (!editorView || isSSR()) {
|
|
@@ -304,7 +308,7 @@ const setProviderState = providerState => (state, dispatch) => {
|
|
|
304
308
|
}
|
|
305
309
|
return true;
|
|
306
310
|
};
|
|
307
|
-
function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispatch, dispatchAnalyticsEvent, emptyStateHandler, onInsert = () => {}, itemFilter, api) {
|
|
311
|
+
function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispatch, dispatchAnalyticsEvent, refs, emptyStateHandler, onInsert = () => {}, itemFilter, api) {
|
|
308
312
|
return new SafePlugin({
|
|
309
313
|
key: pluginKey,
|
|
310
314
|
state: {
|
|
@@ -339,6 +343,9 @@ function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispat
|
|
|
339
343
|
}
|
|
340
344
|
},
|
|
341
345
|
view(editorView) {
|
|
346
|
+
if (isExperimentEnabled('platform_editor_block_control_migration')) {
|
|
347
|
+
refs.editorView = editorView;
|
|
348
|
+
}
|
|
342
349
|
let quickInsertItemsAnalyticsScheduler;
|
|
343
350
|
let isDestroyed = false;
|
|
344
351
|
const providerHandler = async (_name, providerPromise) => {
|
|
@@ -377,6 +384,9 @@ function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispat
|
|
|
377
384
|
return {
|
|
378
385
|
destroy() {
|
|
379
386
|
var _quickInsertItemsAnal;
|
|
387
|
+
if (isExperimentEnabled('platform_editor_block_control_migration') && refs.editorView === editorView) {
|
|
388
|
+
refs.editorView = undefined;
|
|
389
|
+
}
|
|
380
390
|
isDestroyed = true;
|
|
381
391
|
(_quickInsertItemsAnal = quickInsertItemsAnalyticsScheduler) === null || _quickInsertItemsAnal === void 0 ? void 0 : _quickInsertItemsAnal.destroy();
|
|
382
392
|
providerFactory.unsubscribe('quickInsertProvider', providerHandler);
|
|
@@ -148,7 +148,7 @@ export var quickInsertPlugin = function quickInsertPlugin(_ref) {
|
|
|
148
148
|
dispatchAnalyticsEvent = _ref6.dispatchAnalyticsEvent;
|
|
149
149
|
return quickInsertPluginFactory(isExperimentEnabled('platform_editor_slash_command') ? (defaultItems || []).filter(function (item) {
|
|
150
150
|
return item !== undefined;
|
|
151
|
-
}) : defaultItems, providerFactory, getIntl, dispatch, dispatchAnalyticsEvent, options === null || options === void 0 ? void 0 : options.emptyStateHandler, onInsert, options === null || options === void 0 ? void 0 : options.itemFilter, api);
|
|
151
|
+
}) : defaultItems, providerFactory, getIntl, dispatch, dispatchAnalyticsEvent, refs, options === null || options === void 0 ? void 0 : options.emptyStateHandler, onInsert, options === null || options === void 0 ? void 0 : options.itemFilter, api);
|
|
152
152
|
}
|
|
153
153
|
}, {
|
|
154
154
|
name: 'quickInsertOpenExperience',
|
|
@@ -170,7 +170,11 @@ export var quickInsertPlugin = function quickInsertPlugin(_ref) {
|
|
|
170
170
|
var editorView = _ref7.editorView,
|
|
171
171
|
popupsMountPoint = _ref7.popupsMountPoint,
|
|
172
172
|
wrapperElement = _ref7.wrapperElement;
|
|
173
|
-
|
|
173
|
+
// using contentComponent to set editorView can cause it to become stale when editor is reconfigured
|
|
174
|
+
// (e.g. page appearance change)
|
|
175
|
+
if (!isExperimentEnabled('platform_editor_block_control_migration')) {
|
|
176
|
+
refs.editorView = editorView || undefined;
|
|
177
|
+
}
|
|
174
178
|
refs.popupsMountPoint = popupsMountPoint || undefined;
|
|
175
179
|
refs.wrapperElement = wrapperElement || undefined;
|
|
176
180
|
if (!editorView || isSSR()) {
|
|
@@ -335,10 +339,10 @@ var setProviderState = function setProviderState(providerState) {
|
|
|
335
339
|
return true;
|
|
336
340
|
};
|
|
337
341
|
};
|
|
338
|
-
function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispatch, dispatchAnalyticsEvent, emptyStateHandler) {
|
|
339
|
-
var onInsert = arguments.length >
|
|
340
|
-
var itemFilter = arguments.length >
|
|
341
|
-
var api = arguments.length >
|
|
342
|
+
function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispatch, dispatchAnalyticsEvent, refs, emptyStateHandler) {
|
|
343
|
+
var onInsert = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : function () {};
|
|
344
|
+
var itemFilter = arguments.length > 8 ? arguments[8] : undefined;
|
|
345
|
+
var api = arguments.length > 9 ? arguments[9] : undefined;
|
|
342
346
|
return new SafePlugin({
|
|
343
347
|
key: pluginKey,
|
|
344
348
|
state: {
|
|
@@ -372,6 +376,9 @@ function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispat
|
|
|
372
376
|
}
|
|
373
377
|
},
|
|
374
378
|
view: function view(editorView) {
|
|
379
|
+
if (isExperimentEnabled('platform_editor_block_control_migration')) {
|
|
380
|
+
refs.editorView = editorView;
|
|
381
|
+
}
|
|
375
382
|
var quickInsertItemsAnalyticsScheduler;
|
|
376
383
|
var isDestroyed = false;
|
|
377
384
|
var providerHandler = /*#__PURE__*/function () {
|
|
@@ -450,6 +457,9 @@ function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispat
|
|
|
450
457
|
return {
|
|
451
458
|
destroy: function destroy() {
|
|
452
459
|
var _quickInsertItemsAnal;
|
|
460
|
+
if (isExperimentEnabled('platform_editor_block_control_migration') && refs.editorView === editorView) {
|
|
461
|
+
refs.editorView = undefined;
|
|
462
|
+
}
|
|
453
463
|
isDestroyed = true;
|
|
454
464
|
(_quickInsertItemsAnal = quickInsertItemsAnalyticsScheduler) === null || _quickInsertItemsAnal === void 0 || _quickInsertItemsAnal.destroy();
|
|
455
465
|
providerFactory.unsubscribe('quickInsertProvider', providerHandler);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-quick-insert",
|
|
3
|
-
"version": "19.0.
|
|
3
|
+
"version": "19.0.6",
|
|
4
4
|
"description": "Quick insert plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@atlaskit/platform-feature-flags": "^2.2.0",
|
|
44
44
|
"@atlaskit/primitives": "^22.5.0",
|
|
45
45
|
"@atlaskit/textfield": "^10.2.0",
|
|
46
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
46
|
+
"@atlaskit/tmp-editor-statsig": "^202.0.0",
|
|
47
47
|
"@atlaskit/tokens": "^18.2.0",
|
|
48
48
|
"@atlaskit/tooltip": "^24.3.0",
|
|
49
49
|
"@babel/runtime": "^7.0.0",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"@emotion/react": "^11.7.1"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
|
-
"@atlaskit/editor-common": "^123.
|
|
54
|
+
"@atlaskit/editor-common": "^123.5.0",
|
|
55
55
|
"react": "^18.2.0 || ^19.2.0",
|
|
56
56
|
"react-dom": "^18.2.0 || ^19.2.0",
|
|
57
57
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|