@atlaskit/editor-plugin-quick-insert 10.2.8 → 10.2.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 +14 -0
- package/dist/cjs/quickInsertPlugin.js +48 -31
- package/dist/es2019/quickInsertPlugin.js +18 -0
- package/dist/esm/quickInsertPlugin.js +48 -31
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-quick-insert
|
|
2
2
|
|
|
3
|
+
## 10.2.10
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`858c695a0a315`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/858c695a0a315) -
|
|
8
|
+
[EDITOR-6718] Show "Ask Rovo" action in the type-ahead empty search state
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 10.2.9
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 10.2.8
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -50,6 +50,23 @@ var quickInsertPlugin = exports.quickInsertPlugin = function quickInsertPlugin(_
|
|
|
50
50
|
itemFilter: options === null || options === void 0 ? void 0 : options.itemFilter
|
|
51
51
|
}, quickInsertState === null || quickInsertState === void 0 ? void 0 : quickInsertState.lazyDefaultItems, quickInsertState === null || quickInsertState === void 0 ? void 0 : quickInsertState.providedItems));
|
|
52
52
|
},
|
|
53
|
+
getEmptyItem: function getEmptyItem(_ref3) {
|
|
54
|
+
var editorState = _ref3.editorState;
|
|
55
|
+
if (!(0, _expValEquals.expValEquals)('platform_editor_insert_menu_ai', 'isEnabled', true)) {
|
|
56
|
+
return undefined;
|
|
57
|
+
}
|
|
58
|
+
var quickInsertState = _pluginKey.pluginKey.getState(editorState);
|
|
59
|
+
var matches = (0, _search.getQuickInsertSuggestions)({
|
|
60
|
+
query: '',
|
|
61
|
+
disableDefaultItems: options === null || options === void 0 ? void 0 : options.disableDefaultItems,
|
|
62
|
+
prioritySortingFn: options === null || options === void 0 ? void 0 : options.prioritySortingFn,
|
|
63
|
+
itemFilter: function itemFilter(item) {
|
|
64
|
+
var _item$categories$incl, _item$categories;
|
|
65
|
+
return (_item$categories$incl = (_item$categories = item.categories) === null || _item$categories === void 0 ? void 0 : _item$categories.includes('AI')) !== null && _item$categories$incl !== void 0 ? _item$categories$incl : false;
|
|
66
|
+
}
|
|
67
|
+
}, quickInsertState === null || quickInsertState === void 0 ? void 0 : quickInsertState.lazyDefaultItems, quickInsertState === null || quickInsertState === void 0 ? void 0 : quickInsertState.providedItems);
|
|
68
|
+
return matches[0];
|
|
69
|
+
},
|
|
53
70
|
selectItem: function selectItem(state, item, insert) {
|
|
54
71
|
var quickInsertItem = item;
|
|
55
72
|
var result = quickInsertItem.action(insert, state);
|
|
@@ -58,8 +75,8 @@ var quickInsertPlugin = exports.quickInsertPlugin = function quickInsertPlugin(_
|
|
|
58
75
|
}
|
|
59
76
|
return result;
|
|
60
77
|
},
|
|
61
|
-
getMoreOptionsButtonConfig: options !== null && options !== void 0 && options.enableElementBrowser ? function (
|
|
62
|
-
var formatMessage =
|
|
78
|
+
getMoreOptionsButtonConfig: options !== null && options !== void 0 && options.enableElementBrowser ? function (_ref4) {
|
|
79
|
+
var formatMessage = _ref4.formatMessage;
|
|
63
80
|
return {
|
|
64
81
|
title: formatMessage(_messages.toolbarInsertBlockMessages.viewMore),
|
|
65
82
|
ariaLabel: formatMessage(_messages.toolbarInsertBlockMessages.viewMoreAriaLabel),
|
|
@@ -77,10 +94,10 @@ var quickInsertPlugin = exports.quickInsertPlugin = function quickInsertPlugin(_
|
|
|
77
94
|
return [{
|
|
78
95
|
name: 'quickInsert',
|
|
79
96
|
// It's important that this plugin is above TypeAheadPlugin
|
|
80
|
-
plugin: function plugin(
|
|
81
|
-
var providerFactory =
|
|
82
|
-
getIntl =
|
|
83
|
-
dispatch =
|
|
97
|
+
plugin: function plugin(_ref5) {
|
|
98
|
+
var providerFactory = _ref5.providerFactory,
|
|
99
|
+
getIntl = _ref5.getIntl,
|
|
100
|
+
dispatch = _ref5.dispatch;
|
|
84
101
|
return quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispatch, options === null || options === void 0 ? void 0 : options.emptyStateHandler);
|
|
85
102
|
}
|
|
86
103
|
}].concat((0, _toConsumableArray2.default)((0, _expValEquals.expValEquals)('platform_editor_experience_tracking', 'isEnabled', true) ? [{
|
|
@@ -99,10 +116,10 @@ var quickInsertPlugin = exports.quickInsertPlugin = function quickInsertPlugin(_
|
|
|
99
116
|
pluginsOptions: {
|
|
100
117
|
typeAhead: typeAhead
|
|
101
118
|
},
|
|
102
|
-
contentComponent: function contentComponent(
|
|
103
|
-
var editorView =
|
|
104
|
-
popupsMountPoint =
|
|
105
|
-
wrapperElement =
|
|
119
|
+
contentComponent: function contentComponent(_ref6) {
|
|
120
|
+
var editorView = _ref6.editorView,
|
|
121
|
+
popupsMountPoint = _ref6.popupsMountPoint,
|
|
122
|
+
wrapperElement = _ref6.wrapperElement;
|
|
106
123
|
refs.popupsMountPoint = popupsMountPoint || undefined;
|
|
107
124
|
refs.wrapperElement = wrapperElement || undefined;
|
|
108
125
|
if (!editorView || (0, _coreUtils.isSSR)()) {
|
|
@@ -145,9 +162,9 @@ var quickInsertPlugin = exports.quickInsertPlugin = function quickInsertPlugin(_
|
|
|
145
162
|
},
|
|
146
163
|
getSuggestions: function getSuggestions(searchOptions) {
|
|
147
164
|
var _api$quickInsert$shar, _api$quickInsert;
|
|
148
|
-
var
|
|
149
|
-
lazyDefaultItems =
|
|
150
|
-
providedItems =
|
|
165
|
+
var _ref7 = (_api$quickInsert$shar = api === null || api === void 0 || (_api$quickInsert = api.quickInsert) === null || _api$quickInsert === void 0 ? void 0 : _api$quickInsert.sharedState.currentState()) !== null && _api$quickInsert$shar !== void 0 ? _api$quickInsert$shar : {},
|
|
166
|
+
lazyDefaultItems = _ref7.lazyDefaultItems,
|
|
167
|
+
providedItems = _ref7.providedItems;
|
|
151
168
|
if (options !== null && options !== void 0 && options.prioritySortingFn) {
|
|
152
169
|
searchOptions = _objectSpread(_objectSpread({}, searchOptions), {}, {
|
|
153
170
|
prioritySortingFn: options.prioritySortingFn
|
|
@@ -169,8 +186,8 @@ var quickInsertPlugin = exports.quickInsertPlugin = function quickInsertPlugin(_
|
|
|
169
186
|
}
|
|
170
187
|
},
|
|
171
188
|
commands: {
|
|
172
|
-
openElementBrowserModal: function openElementBrowserModal(
|
|
173
|
-
var tr =
|
|
189
|
+
openElementBrowserModal: function openElementBrowserModal(_ref8) {
|
|
190
|
+
var tr = _ref8.tr;
|
|
174
191
|
if ((0, _platformFeatureFlags.fg)('platform_editor_ease_of_use_metrics')) {
|
|
175
192
|
var _api$metrics;
|
|
176
193
|
api === null || api === void 0 || (_api$metrics = api.metrics) === null || _api$metrics === void 0 || _api$metrics.commands.handleIntentToStartEdit({
|
|
@@ -185,11 +202,11 @@ var quickInsertPlugin = exports.quickInsertPlugin = function quickInsertPlugin(_
|
|
|
185
202
|
});
|
|
186
203
|
},
|
|
187
204
|
addQuickInsertItem: function addQuickInsertItem(item) {
|
|
188
|
-
return function (
|
|
205
|
+
return function (_ref9) {
|
|
189
206
|
var _api$quickInsert$shar2, _api$quickInsert2;
|
|
190
|
-
var tr =
|
|
191
|
-
var
|
|
192
|
-
lazyDefaultItems =
|
|
207
|
+
var tr = _ref9.tr;
|
|
208
|
+
var _ref0 = (_api$quickInsert$shar2 = api === null || api === void 0 || (_api$quickInsert2 = api.quickInsert) === null || _api$quickInsert2 === void 0 ? void 0 : _api$quickInsert2.sharedState.currentState()) !== null && _api$quickInsert$shar2 !== void 0 ? _api$quickInsert$shar2 : {},
|
|
209
|
+
lazyDefaultItems = _ref0.lazyDefaultItems;
|
|
193
210
|
var defaultItems = lazyDefaultItems ? lazyDefaultItems() : [];
|
|
194
211
|
var memoisedNewItems = (0, _quickInsert.memoProcessQuickInsertItems)([item], intl);
|
|
195
212
|
return tr.setMeta(_pluginKey.pluginKey, {
|
|
@@ -200,12 +217,12 @@ var quickInsertPlugin = exports.quickInsertPlugin = function quickInsertPlugin(_
|
|
|
200
217
|
};
|
|
201
218
|
},
|
|
202
219
|
updateQuickInsertItem: function updateQuickInsertItem(key, item) {
|
|
203
|
-
return function (
|
|
220
|
+
return function (_ref1) {
|
|
204
221
|
var _api$quickInsert$shar3, _api$quickInsert3;
|
|
205
|
-
var tr =
|
|
206
|
-
var
|
|
207
|
-
providedItems =
|
|
208
|
-
lazyDefaultItems =
|
|
222
|
+
var tr = _ref1.tr;
|
|
223
|
+
var _ref10 = (_api$quickInsert$shar3 = api === null || api === void 0 || (_api$quickInsert3 = api.quickInsert) === null || _api$quickInsert3 === void 0 ? void 0 : _api$quickInsert3.sharedState.currentState()) !== null && _api$quickInsert$shar3 !== void 0 ? _api$quickInsert$shar3 : {},
|
|
224
|
+
providedItems = _ref10.providedItems,
|
|
225
|
+
lazyDefaultItems = _ref10.lazyDefaultItems;
|
|
209
226
|
var defaultItems = lazyDefaultItems ? lazyDefaultItems() : [];
|
|
210
227
|
var newItem = (0, _quickInsert.memoProcessQuickInsertItems)([item], intl);
|
|
211
228
|
var replaceByKey = function replaceByKey(items) {
|
|
@@ -230,12 +247,12 @@ var quickInsertPlugin = exports.quickInsertPlugin = function quickInsertPlugin(_
|
|
|
230
247
|
};
|
|
231
248
|
},
|
|
232
249
|
removeQuickInsertItem: function removeQuickInsertItem(key) {
|
|
233
|
-
return function (
|
|
250
|
+
return function (_ref11) {
|
|
234
251
|
var _api$quickInsert$shar4, _api$quickInsert4, _providedItems$filter;
|
|
235
|
-
var tr =
|
|
236
|
-
var
|
|
237
|
-
providedItems =
|
|
238
|
-
lazyDefaultItems =
|
|
252
|
+
var tr = _ref11.tr;
|
|
253
|
+
var _ref12 = (_api$quickInsert$shar4 = api === null || api === void 0 || (_api$quickInsert4 = api.quickInsert) === null || _api$quickInsert4 === void 0 ? void 0 : _api$quickInsert4.sharedState.currentState()) !== null && _api$quickInsert$shar4 !== void 0 ? _api$quickInsert$shar4 : {},
|
|
254
|
+
providedItems = _ref12.providedItems,
|
|
255
|
+
lazyDefaultItems = _ref12.lazyDefaultItems;
|
|
239
256
|
var defaultItems = lazyDefaultItems ? lazyDefaultItems() : [];
|
|
240
257
|
return tr.setMeta(_pluginKey.pluginKey, {
|
|
241
258
|
providedItems: (_providedItems$filter = providedItems === null || providedItems === void 0 ? void 0 : providedItems.filter(function (item) {
|
|
@@ -297,7 +314,7 @@ function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispat
|
|
|
297
314
|
},
|
|
298
315
|
view: function view(editorView) {
|
|
299
316
|
var providerHandler = /*#__PURE__*/function () {
|
|
300
|
-
var
|
|
317
|
+
var _ref13 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_name, providerPromise) {
|
|
301
318
|
var provider, providedItems;
|
|
302
319
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
303
320
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -333,7 +350,7 @@ function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispat
|
|
|
333
350
|
}, _callee, null, [[1, 11]]);
|
|
334
351
|
}));
|
|
335
352
|
return function providerHandler(_x, _x2) {
|
|
336
|
-
return
|
|
353
|
+
return _ref13.apply(this, arguments);
|
|
337
354
|
};
|
|
338
355
|
}();
|
|
339
356
|
providerFactory.subscribe('quickInsertProvider', providerHandler);
|
|
@@ -39,6 +39,24 @@ export const quickInsertPlugin = ({
|
|
|
39
39
|
itemFilter: options === null || options === void 0 ? void 0 : options.itemFilter
|
|
40
40
|
}, quickInsertState === null || quickInsertState === void 0 ? void 0 : quickInsertState.lazyDefaultItems, quickInsertState === null || quickInsertState === void 0 ? void 0 : quickInsertState.providedItems));
|
|
41
41
|
},
|
|
42
|
+
getEmptyItem({
|
|
43
|
+
editorState
|
|
44
|
+
}) {
|
|
45
|
+
if (!expValEquals('platform_editor_insert_menu_ai', 'isEnabled', true)) {
|
|
46
|
+
return undefined;
|
|
47
|
+
}
|
|
48
|
+
const quickInsertState = pluginKey.getState(editorState);
|
|
49
|
+
const matches = getQuickInsertSuggestions({
|
|
50
|
+
query: '',
|
|
51
|
+
disableDefaultItems: options === null || options === void 0 ? void 0 : options.disableDefaultItems,
|
|
52
|
+
prioritySortingFn: options === null || options === void 0 ? void 0 : options.prioritySortingFn,
|
|
53
|
+
itemFilter: item => {
|
|
54
|
+
var _item$categories$incl, _item$categories;
|
|
55
|
+
return (_item$categories$incl = (_item$categories = item.categories) === null || _item$categories === void 0 ? void 0 : _item$categories.includes('AI')) !== null && _item$categories$incl !== void 0 ? _item$categories$incl : false;
|
|
56
|
+
}
|
|
57
|
+
}, quickInsertState === null || quickInsertState === void 0 ? void 0 : quickInsertState.lazyDefaultItems, quickInsertState === null || quickInsertState === void 0 ? void 0 : quickInsertState.providedItems);
|
|
58
|
+
return matches[0];
|
|
59
|
+
},
|
|
42
60
|
selectItem: (state, item, insert) => {
|
|
43
61
|
const quickInsertItem = item;
|
|
44
62
|
const result = quickInsertItem.action(insert, state);
|
|
@@ -43,6 +43,23 @@ export var quickInsertPlugin = function quickInsertPlugin(_ref) {
|
|
|
43
43
|
itemFilter: options === null || options === void 0 ? void 0 : options.itemFilter
|
|
44
44
|
}, quickInsertState === null || quickInsertState === void 0 ? void 0 : quickInsertState.lazyDefaultItems, quickInsertState === null || quickInsertState === void 0 ? void 0 : quickInsertState.providedItems));
|
|
45
45
|
},
|
|
46
|
+
getEmptyItem: function getEmptyItem(_ref3) {
|
|
47
|
+
var editorState = _ref3.editorState;
|
|
48
|
+
if (!expValEquals('platform_editor_insert_menu_ai', 'isEnabled', true)) {
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
51
|
+
var quickInsertState = pluginKey.getState(editorState);
|
|
52
|
+
var matches = getQuickInsertSuggestions({
|
|
53
|
+
query: '',
|
|
54
|
+
disableDefaultItems: options === null || options === void 0 ? void 0 : options.disableDefaultItems,
|
|
55
|
+
prioritySortingFn: options === null || options === void 0 ? void 0 : options.prioritySortingFn,
|
|
56
|
+
itemFilter: function itemFilter(item) {
|
|
57
|
+
var _item$categories$incl, _item$categories;
|
|
58
|
+
return (_item$categories$incl = (_item$categories = item.categories) === null || _item$categories === void 0 ? void 0 : _item$categories.includes('AI')) !== null && _item$categories$incl !== void 0 ? _item$categories$incl : false;
|
|
59
|
+
}
|
|
60
|
+
}, quickInsertState === null || quickInsertState === void 0 ? void 0 : quickInsertState.lazyDefaultItems, quickInsertState === null || quickInsertState === void 0 ? void 0 : quickInsertState.providedItems);
|
|
61
|
+
return matches[0];
|
|
62
|
+
},
|
|
46
63
|
selectItem: function selectItem(state, item, insert) {
|
|
47
64
|
var quickInsertItem = item;
|
|
48
65
|
var result = quickInsertItem.action(insert, state);
|
|
@@ -51,8 +68,8 @@ export var quickInsertPlugin = function quickInsertPlugin(_ref) {
|
|
|
51
68
|
}
|
|
52
69
|
return result;
|
|
53
70
|
},
|
|
54
|
-
getMoreOptionsButtonConfig: options !== null && options !== void 0 && options.enableElementBrowser ? function (
|
|
55
|
-
var formatMessage =
|
|
71
|
+
getMoreOptionsButtonConfig: options !== null && options !== void 0 && options.enableElementBrowser ? function (_ref4) {
|
|
72
|
+
var formatMessage = _ref4.formatMessage;
|
|
56
73
|
return {
|
|
57
74
|
title: formatMessage(messages.viewMore),
|
|
58
75
|
ariaLabel: formatMessage(messages.viewMoreAriaLabel),
|
|
@@ -70,10 +87,10 @@ export var quickInsertPlugin = function quickInsertPlugin(_ref) {
|
|
|
70
87
|
return [{
|
|
71
88
|
name: 'quickInsert',
|
|
72
89
|
// It's important that this plugin is above TypeAheadPlugin
|
|
73
|
-
plugin: function plugin(
|
|
74
|
-
var providerFactory =
|
|
75
|
-
getIntl =
|
|
76
|
-
dispatch =
|
|
90
|
+
plugin: function plugin(_ref5) {
|
|
91
|
+
var providerFactory = _ref5.providerFactory,
|
|
92
|
+
getIntl = _ref5.getIntl,
|
|
93
|
+
dispatch = _ref5.dispatch;
|
|
77
94
|
return quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispatch, options === null || options === void 0 ? void 0 : options.emptyStateHandler);
|
|
78
95
|
}
|
|
79
96
|
}].concat(_toConsumableArray(expValEquals('platform_editor_experience_tracking', 'isEnabled', true) ? [{
|
|
@@ -92,10 +109,10 @@ export var quickInsertPlugin = function quickInsertPlugin(_ref) {
|
|
|
92
109
|
pluginsOptions: {
|
|
93
110
|
typeAhead: typeAhead
|
|
94
111
|
},
|
|
95
|
-
contentComponent: function contentComponent(
|
|
96
|
-
var editorView =
|
|
97
|
-
popupsMountPoint =
|
|
98
|
-
wrapperElement =
|
|
112
|
+
contentComponent: function contentComponent(_ref6) {
|
|
113
|
+
var editorView = _ref6.editorView,
|
|
114
|
+
popupsMountPoint = _ref6.popupsMountPoint,
|
|
115
|
+
wrapperElement = _ref6.wrapperElement;
|
|
99
116
|
refs.popupsMountPoint = popupsMountPoint || undefined;
|
|
100
117
|
refs.wrapperElement = wrapperElement || undefined;
|
|
101
118
|
if (!editorView || isSSR()) {
|
|
@@ -138,9 +155,9 @@ export var quickInsertPlugin = function quickInsertPlugin(_ref) {
|
|
|
138
155
|
},
|
|
139
156
|
getSuggestions: function getSuggestions(searchOptions) {
|
|
140
157
|
var _api$quickInsert$shar, _api$quickInsert;
|
|
141
|
-
var
|
|
142
|
-
lazyDefaultItems =
|
|
143
|
-
providedItems =
|
|
158
|
+
var _ref7 = (_api$quickInsert$shar = api === null || api === void 0 || (_api$quickInsert = api.quickInsert) === null || _api$quickInsert === void 0 ? void 0 : _api$quickInsert.sharedState.currentState()) !== null && _api$quickInsert$shar !== void 0 ? _api$quickInsert$shar : {},
|
|
159
|
+
lazyDefaultItems = _ref7.lazyDefaultItems,
|
|
160
|
+
providedItems = _ref7.providedItems;
|
|
144
161
|
if (options !== null && options !== void 0 && options.prioritySortingFn) {
|
|
145
162
|
searchOptions = _objectSpread(_objectSpread({}, searchOptions), {}, {
|
|
146
163
|
prioritySortingFn: options.prioritySortingFn
|
|
@@ -162,8 +179,8 @@ export var quickInsertPlugin = function quickInsertPlugin(_ref) {
|
|
|
162
179
|
}
|
|
163
180
|
},
|
|
164
181
|
commands: {
|
|
165
|
-
openElementBrowserModal: function openElementBrowserModal(
|
|
166
|
-
var tr =
|
|
182
|
+
openElementBrowserModal: function openElementBrowserModal(_ref8) {
|
|
183
|
+
var tr = _ref8.tr;
|
|
167
184
|
if (fg('platform_editor_ease_of_use_metrics')) {
|
|
168
185
|
var _api$metrics;
|
|
169
186
|
api === null || api === void 0 || (_api$metrics = api.metrics) === null || _api$metrics === void 0 || _api$metrics.commands.handleIntentToStartEdit({
|
|
@@ -178,11 +195,11 @@ export var quickInsertPlugin = function quickInsertPlugin(_ref) {
|
|
|
178
195
|
});
|
|
179
196
|
},
|
|
180
197
|
addQuickInsertItem: function addQuickInsertItem(item) {
|
|
181
|
-
return function (
|
|
198
|
+
return function (_ref9) {
|
|
182
199
|
var _api$quickInsert$shar2, _api$quickInsert2;
|
|
183
|
-
var tr =
|
|
184
|
-
var
|
|
185
|
-
lazyDefaultItems =
|
|
200
|
+
var tr = _ref9.tr;
|
|
201
|
+
var _ref0 = (_api$quickInsert$shar2 = api === null || api === void 0 || (_api$quickInsert2 = api.quickInsert) === null || _api$quickInsert2 === void 0 ? void 0 : _api$quickInsert2.sharedState.currentState()) !== null && _api$quickInsert$shar2 !== void 0 ? _api$quickInsert$shar2 : {},
|
|
202
|
+
lazyDefaultItems = _ref0.lazyDefaultItems;
|
|
186
203
|
var defaultItems = lazyDefaultItems ? lazyDefaultItems() : [];
|
|
187
204
|
var memoisedNewItems = memoProcessQuickInsertItems([item], intl);
|
|
188
205
|
return tr.setMeta(pluginKey, {
|
|
@@ -193,12 +210,12 @@ export var quickInsertPlugin = function quickInsertPlugin(_ref) {
|
|
|
193
210
|
};
|
|
194
211
|
},
|
|
195
212
|
updateQuickInsertItem: function updateQuickInsertItem(key, item) {
|
|
196
|
-
return function (
|
|
213
|
+
return function (_ref1) {
|
|
197
214
|
var _api$quickInsert$shar3, _api$quickInsert3;
|
|
198
|
-
var tr =
|
|
199
|
-
var
|
|
200
|
-
providedItems =
|
|
201
|
-
lazyDefaultItems =
|
|
215
|
+
var tr = _ref1.tr;
|
|
216
|
+
var _ref10 = (_api$quickInsert$shar3 = api === null || api === void 0 || (_api$quickInsert3 = api.quickInsert) === null || _api$quickInsert3 === void 0 ? void 0 : _api$quickInsert3.sharedState.currentState()) !== null && _api$quickInsert$shar3 !== void 0 ? _api$quickInsert$shar3 : {},
|
|
217
|
+
providedItems = _ref10.providedItems,
|
|
218
|
+
lazyDefaultItems = _ref10.lazyDefaultItems;
|
|
202
219
|
var defaultItems = lazyDefaultItems ? lazyDefaultItems() : [];
|
|
203
220
|
var newItem = memoProcessQuickInsertItems([item], intl);
|
|
204
221
|
var replaceByKey = function replaceByKey(items) {
|
|
@@ -223,12 +240,12 @@ export var quickInsertPlugin = function quickInsertPlugin(_ref) {
|
|
|
223
240
|
};
|
|
224
241
|
},
|
|
225
242
|
removeQuickInsertItem: function removeQuickInsertItem(key) {
|
|
226
|
-
return function (
|
|
243
|
+
return function (_ref11) {
|
|
227
244
|
var _api$quickInsert$shar4, _api$quickInsert4, _providedItems$filter;
|
|
228
|
-
var tr =
|
|
229
|
-
var
|
|
230
|
-
providedItems =
|
|
231
|
-
lazyDefaultItems =
|
|
245
|
+
var tr = _ref11.tr;
|
|
246
|
+
var _ref12 = (_api$quickInsert$shar4 = api === null || api === void 0 || (_api$quickInsert4 = api.quickInsert) === null || _api$quickInsert4 === void 0 ? void 0 : _api$quickInsert4.sharedState.currentState()) !== null && _api$quickInsert$shar4 !== void 0 ? _api$quickInsert$shar4 : {},
|
|
247
|
+
providedItems = _ref12.providedItems,
|
|
248
|
+
lazyDefaultItems = _ref12.lazyDefaultItems;
|
|
232
249
|
var defaultItems = lazyDefaultItems ? lazyDefaultItems() : [];
|
|
233
250
|
return tr.setMeta(pluginKey, {
|
|
234
251
|
providedItems: (_providedItems$filter = providedItems === null || providedItems === void 0 ? void 0 : providedItems.filter(function (item) {
|
|
@@ -290,7 +307,7 @@ function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispat
|
|
|
290
307
|
},
|
|
291
308
|
view: function view(editorView) {
|
|
292
309
|
var providerHandler = /*#__PURE__*/function () {
|
|
293
|
-
var
|
|
310
|
+
var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_name, providerPromise) {
|
|
294
311
|
var provider, providedItems;
|
|
295
312
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
296
313
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -326,7 +343,7 @@ function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispat
|
|
|
326
343
|
}, _callee, null, [[1, 11]]);
|
|
327
344
|
}));
|
|
328
345
|
return function providerHandler(_x, _x2) {
|
|
329
|
-
return
|
|
346
|
+
return _ref13.apply(this, arguments);
|
|
330
347
|
};
|
|
331
348
|
}();
|
|
332
349
|
providerFactory.subscribe('quickInsertProvider', providerHandler);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-quick-insert",
|
|
3
|
-
"version": "10.2.
|
|
3
|
+
"version": "10.2.10",
|
|
4
4
|
"description": "Quick insert plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -35,16 +35,16 @@
|
|
|
35
35
|
"@atlaskit/editor-plugin-metrics": "^11.0.0",
|
|
36
36
|
"@atlaskit/editor-plugin-type-ahead": "^10.0.0",
|
|
37
37
|
"@atlaskit/editor-prosemirror": "^7.3.0",
|
|
38
|
-
"@atlaskit/icon": "^34.
|
|
38
|
+
"@atlaskit/icon": "^34.5.0",
|
|
39
39
|
"@atlaskit/modal-dialog": "^15.0.0",
|
|
40
40
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
41
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
41
|
+
"@atlaskit/tmp-editor-statsig": "^78.0.0",
|
|
42
42
|
"@atlaskit/tokens": "^13.0.0",
|
|
43
43
|
"@babel/runtime": "^7.0.0",
|
|
44
44
|
"@emotion/react": "^11.7.1"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
|
-
"@atlaskit/editor-common": "^114.
|
|
47
|
+
"@atlaskit/editor-common": "^114.27.0",
|
|
48
48
|
"react": "^18.2.0",
|
|
49
49
|
"react-dom": "^18.2.0",
|
|
50
50
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|