@atlaskit/editor-plugin-quick-insert 6.0.12 → 6.0.13
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 +9 -0
- package/dist/cjs/pm-plugins/experiences/quick-insert-open-experience.js +15 -0
- package/dist/cjs/quickInsertPlugin.js +6 -0
- package/dist/es2019/pm-plugins/experiences/quick-insert-open-experience.js +15 -0
- package/dist/es2019/quickInsertPlugin.js +10 -0
- package/dist/esm/pm-plugins/experiences/quick-insert-open-experience.js +15 -0
- package/dist/esm/quickInsertPlugin.js +6 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-quick-insert
|
|
2
2
|
|
|
3
|
+
## 6.0.13
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`4d676bbdb3ce6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4d676bbdb3ce6) -
|
|
8
|
+
ts-ignore added temporarily to unblock local consumption for help-center, will be removed once
|
|
9
|
+
project refs are setup
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
3
12
|
## 6.0.12
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -44,6 +44,8 @@ var getQuickInsertOpenExperiencePlugin = exports.getQuickInsertOpenExperiencePlu
|
|
|
44
44
|
}), new _experiences.ExperienceCheckDomMutation({
|
|
45
45
|
onDomMutation: function onDomMutation(_ref2) {
|
|
46
46
|
var mutations = _ref2.mutations;
|
|
47
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
48
|
+
|
|
47
49
|
if (mutations.some(isQuickInsertMenuAddedInMutation)) {
|
|
48
50
|
return {
|
|
49
51
|
status: 'success'
|
|
@@ -63,7 +65,11 @@ var getQuickInsertOpenExperiencePlugin = exports.getQuickInsertOpenExperiencePlu
|
|
|
63
65
|
return new _safePlugin.SafePlugin({
|
|
64
66
|
key: pluginKey,
|
|
65
67
|
props: {
|
|
68
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
69
|
+
|
|
66
70
|
handleDOMEvents: {
|
|
71
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
72
|
+
|
|
67
73
|
click: function click(_view, event) {
|
|
68
74
|
if (isTargetQuickInsertButton(event.target)) {
|
|
69
75
|
experience.start({
|
|
@@ -71,6 +77,8 @@ var getQuickInsertOpenExperiencePlugin = exports.getQuickInsertOpenExperiencePlu
|
|
|
71
77
|
});
|
|
72
78
|
}
|
|
73
79
|
},
|
|
80
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
81
|
+
|
|
74
82
|
beforeinput: function beforeinput(view, event) {
|
|
75
83
|
if (isQuickInsertTrigger(event) && isSelectionWhichSupportsTypeahead(view)) {
|
|
76
84
|
experience.start({
|
|
@@ -78,6 +86,8 @@ var getQuickInsertOpenExperiencePlugin = exports.getQuickInsertOpenExperiencePlu
|
|
|
78
86
|
});
|
|
79
87
|
}
|
|
80
88
|
},
|
|
89
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
90
|
+
|
|
81
91
|
keydown: function keydown(_view, event) {
|
|
82
92
|
if (isCancelKey(event.key) && !isQuickInsertMenuWithinNode(getTarget())) {
|
|
83
93
|
experience.abort({
|
|
@@ -113,6 +123,9 @@ var isSelectionWhichSupportsTypeahead = function isSelectionWhichSupportsTypeahe
|
|
|
113
123
|
if ($from.parent.type.name === 'codeBlock') {
|
|
114
124
|
return false;
|
|
115
125
|
}
|
|
126
|
+
|
|
127
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
128
|
+
|
|
116
129
|
if ($from.marks().some(function (mark) {
|
|
117
130
|
return mark.type.name === 'code';
|
|
118
131
|
})) {
|
|
@@ -137,6 +150,8 @@ var isTargetQuickInsertButton = function isTargetQuickInsertButton(target) {
|
|
|
137
150
|
var isQuickInsertMenuAddedInMutation = function isQuickInsertMenuAddedInMutation(_ref5) {
|
|
138
151
|
var type = _ref5.type,
|
|
139
152
|
addedNodes = _ref5.addedNodes;
|
|
153
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
154
|
+
|
|
140
155
|
return type === 'childList' && (0, _toConsumableArray2.default)(addedNodes).some(isQuickInsertMenuWithinNode);
|
|
141
156
|
};
|
|
142
157
|
var isQuickInsertMenuWithinNode = function isQuickInsertMenuWithinNode(node) {
|
|
@@ -203,6 +203,7 @@ function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispat
|
|
|
203
203
|
return new _safePlugin.SafePlugin({
|
|
204
204
|
key: _pluginKey.pluginKey,
|
|
205
205
|
state: {
|
|
206
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
206
207
|
init: function init() {
|
|
207
208
|
return {
|
|
208
209
|
isElementBrowserModalOpen: false,
|
|
@@ -215,10 +216,13 @@ function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispat
|
|
|
215
216
|
}
|
|
216
217
|
};
|
|
217
218
|
},
|
|
219
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
218
220
|
apply: function apply(tr, pluginState) {
|
|
219
221
|
var meta = tr.getMeta(_pluginKey.pluginKey);
|
|
220
222
|
if (meta) {
|
|
221
223
|
var keys = Object.keys(meta);
|
|
224
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
225
|
+
|
|
222
226
|
var changed = keys.some(function (key) {
|
|
223
227
|
return pluginState[key] !== meta[key];
|
|
224
228
|
});
|
|
@@ -231,6 +235,7 @@ function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispat
|
|
|
231
235
|
return pluginState;
|
|
232
236
|
}
|
|
233
237
|
},
|
|
238
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
234
239
|
view: function view(editorView) {
|
|
235
240
|
var providerHandler = /*#__PURE__*/function () {
|
|
236
241
|
var _ref0 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_name, providerPromise) {
|
|
@@ -274,6 +279,7 @@ function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispat
|
|
|
274
279
|
}();
|
|
275
280
|
providerFactory.subscribe('quickInsertProvider', providerHandler);
|
|
276
281
|
return {
|
|
282
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
277
283
|
destroy: function destroy() {
|
|
278
284
|
providerFactory.unsubscribe('quickInsertProvider', providerHandler);
|
|
279
285
|
}
|
|
@@ -38,6 +38,8 @@ export const getQuickInsertOpenExperiencePlugin = ({
|
|
|
38
38
|
onDomMutation: ({
|
|
39
39
|
mutations
|
|
40
40
|
}) => {
|
|
41
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
42
|
+
|
|
41
43
|
if (mutations.some(isQuickInsertMenuAddedInMutation)) {
|
|
42
44
|
return {
|
|
43
45
|
status: 'success'
|
|
@@ -55,7 +57,11 @@ export const getQuickInsertOpenExperiencePlugin = ({
|
|
|
55
57
|
return new SafePlugin({
|
|
56
58
|
key: pluginKey,
|
|
57
59
|
props: {
|
|
60
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
61
|
+
|
|
58
62
|
handleDOMEvents: {
|
|
63
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
64
|
+
|
|
59
65
|
click: (_view, event) => {
|
|
60
66
|
if (isTargetQuickInsertButton(event.target)) {
|
|
61
67
|
experience.start({
|
|
@@ -63,6 +69,8 @@ export const getQuickInsertOpenExperiencePlugin = ({
|
|
|
63
69
|
});
|
|
64
70
|
}
|
|
65
71
|
},
|
|
72
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
73
|
+
|
|
66
74
|
beforeinput: (view, event) => {
|
|
67
75
|
if (isQuickInsertTrigger(event) && isSelectionWhichSupportsTypeahead(view)) {
|
|
68
76
|
experience.start({
|
|
@@ -70,6 +78,8 @@ export const getQuickInsertOpenExperiencePlugin = ({
|
|
|
70
78
|
});
|
|
71
79
|
}
|
|
72
80
|
},
|
|
81
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
82
|
+
|
|
73
83
|
keydown: (_view, event) => {
|
|
74
84
|
if (isCancelKey(event.key) && !isQuickInsertMenuWithinNode(getTarget())) {
|
|
75
85
|
experience.abort({
|
|
@@ -108,6 +118,9 @@ const isSelectionWhichSupportsTypeahead = ({
|
|
|
108
118
|
if ($from.parent.type.name === 'codeBlock') {
|
|
109
119
|
return false;
|
|
110
120
|
}
|
|
121
|
+
|
|
122
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
123
|
+
|
|
111
124
|
if ($from.marks().some(mark => mark.type.name === 'code')) {
|
|
112
125
|
return false;
|
|
113
126
|
}
|
|
@@ -131,6 +144,8 @@ const isQuickInsertMenuAddedInMutation = ({
|
|
|
131
144
|
type,
|
|
132
145
|
addedNodes
|
|
133
146
|
}) => {
|
|
147
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
148
|
+
|
|
134
149
|
return type === 'childList' && [...addedNodes].some(isQuickInsertMenuWithinNode);
|
|
135
150
|
};
|
|
136
151
|
const isQuickInsertMenuWithinNode = node => {
|
|
@@ -190,6 +190,8 @@ function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispat
|
|
|
190
190
|
return new SafePlugin({
|
|
191
191
|
key: pluginKey,
|
|
192
192
|
state: {
|
|
193
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
194
|
+
|
|
193
195
|
init() {
|
|
194
196
|
return {
|
|
195
197
|
isElementBrowserModalOpen: false,
|
|
@@ -200,10 +202,14 @@ function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispat
|
|
|
200
202
|
lazyDefaultItems: () => memoProcessQuickInsertItems(defaultItems || [], getIntl())
|
|
201
203
|
};
|
|
202
204
|
},
|
|
205
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
206
|
+
|
|
203
207
|
apply(tr, pluginState) {
|
|
204
208
|
const meta = tr.getMeta(pluginKey);
|
|
205
209
|
if (meta) {
|
|
206
210
|
const keys = Object.keys(meta);
|
|
211
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
212
|
+
|
|
207
213
|
const changed = keys.some(key => {
|
|
208
214
|
return pluginState[key] !== meta[key];
|
|
209
215
|
});
|
|
@@ -219,6 +225,8 @@ function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispat
|
|
|
219
225
|
return pluginState;
|
|
220
226
|
}
|
|
221
227
|
},
|
|
228
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
229
|
+
|
|
222
230
|
view(editorView) {
|
|
223
231
|
const providerHandler = async (_name, providerPromise) => {
|
|
224
232
|
if (providerPromise) {
|
|
@@ -237,6 +245,8 @@ function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispat
|
|
|
237
245
|
};
|
|
238
246
|
providerFactory.subscribe('quickInsertProvider', providerHandler);
|
|
239
247
|
return {
|
|
248
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
249
|
+
|
|
240
250
|
destroy() {
|
|
241
251
|
providerFactory.unsubscribe('quickInsertProvider', providerHandler);
|
|
242
252
|
}
|
|
@@ -37,6 +37,8 @@ export var getQuickInsertOpenExperiencePlugin = function getQuickInsertOpenExper
|
|
|
37
37
|
}), new ExperienceCheckDomMutation({
|
|
38
38
|
onDomMutation: function onDomMutation(_ref2) {
|
|
39
39
|
var mutations = _ref2.mutations;
|
|
40
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
41
|
+
|
|
40
42
|
if (mutations.some(isQuickInsertMenuAddedInMutation)) {
|
|
41
43
|
return {
|
|
42
44
|
status: 'success'
|
|
@@ -56,7 +58,11 @@ export var getQuickInsertOpenExperiencePlugin = function getQuickInsertOpenExper
|
|
|
56
58
|
return new SafePlugin({
|
|
57
59
|
key: pluginKey,
|
|
58
60
|
props: {
|
|
61
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
62
|
+
|
|
59
63
|
handleDOMEvents: {
|
|
64
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
65
|
+
|
|
60
66
|
click: function click(_view, event) {
|
|
61
67
|
if (isTargetQuickInsertButton(event.target)) {
|
|
62
68
|
experience.start({
|
|
@@ -64,6 +70,8 @@ export var getQuickInsertOpenExperiencePlugin = function getQuickInsertOpenExper
|
|
|
64
70
|
});
|
|
65
71
|
}
|
|
66
72
|
},
|
|
73
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
74
|
+
|
|
67
75
|
beforeinput: function beforeinput(view, event) {
|
|
68
76
|
if (isQuickInsertTrigger(event) && isSelectionWhichSupportsTypeahead(view)) {
|
|
69
77
|
experience.start({
|
|
@@ -71,6 +79,8 @@ export var getQuickInsertOpenExperiencePlugin = function getQuickInsertOpenExper
|
|
|
71
79
|
});
|
|
72
80
|
}
|
|
73
81
|
},
|
|
82
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
83
|
+
|
|
74
84
|
keydown: function keydown(_view, event) {
|
|
75
85
|
if (isCancelKey(event.key) && !isQuickInsertMenuWithinNode(getTarget())) {
|
|
76
86
|
experience.abort({
|
|
@@ -106,6 +116,9 @@ var isSelectionWhichSupportsTypeahead = function isSelectionWhichSupportsTypeahe
|
|
|
106
116
|
if ($from.parent.type.name === 'codeBlock') {
|
|
107
117
|
return false;
|
|
108
118
|
}
|
|
119
|
+
|
|
120
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
121
|
+
|
|
109
122
|
if ($from.marks().some(function (mark) {
|
|
110
123
|
return mark.type.name === 'code';
|
|
111
124
|
})) {
|
|
@@ -130,6 +143,8 @@ var isTargetQuickInsertButton = function isTargetQuickInsertButton(target) {
|
|
|
130
143
|
var isQuickInsertMenuAddedInMutation = function isQuickInsertMenuAddedInMutation(_ref5) {
|
|
131
144
|
var type = _ref5.type,
|
|
132
145
|
addedNodes = _ref5.addedNodes;
|
|
146
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
147
|
+
|
|
133
148
|
return type === 'childList' && _toConsumableArray(addedNodes).some(isQuickInsertMenuWithinNode);
|
|
134
149
|
};
|
|
135
150
|
var isQuickInsertMenuWithinNode = function isQuickInsertMenuWithinNode(node) {
|
|
@@ -196,6 +196,7 @@ function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispat
|
|
|
196
196
|
return new SafePlugin({
|
|
197
197
|
key: pluginKey,
|
|
198
198
|
state: {
|
|
199
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
199
200
|
init: function init() {
|
|
200
201
|
return {
|
|
201
202
|
isElementBrowserModalOpen: false,
|
|
@@ -208,10 +209,13 @@ function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispat
|
|
|
208
209
|
}
|
|
209
210
|
};
|
|
210
211
|
},
|
|
212
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
211
213
|
apply: function apply(tr, pluginState) {
|
|
212
214
|
var meta = tr.getMeta(pluginKey);
|
|
213
215
|
if (meta) {
|
|
214
216
|
var keys = Object.keys(meta);
|
|
217
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
218
|
+
|
|
215
219
|
var changed = keys.some(function (key) {
|
|
216
220
|
return pluginState[key] !== meta[key];
|
|
217
221
|
});
|
|
@@ -224,6 +228,7 @@ function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispat
|
|
|
224
228
|
return pluginState;
|
|
225
229
|
}
|
|
226
230
|
},
|
|
231
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
227
232
|
view: function view(editorView) {
|
|
228
233
|
var providerHandler = /*#__PURE__*/function () {
|
|
229
234
|
var _ref0 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_name, providerPromise) {
|
|
@@ -267,6 +272,7 @@ function quickInsertPluginFactory(defaultItems, providerFactory, getIntl, dispat
|
|
|
267
272
|
}();
|
|
268
273
|
providerFactory.subscribe('quickInsertProvider', providerHandler);
|
|
269
274
|
return {
|
|
275
|
+
// @ts-ignore - Workaround for help-center local consumption
|
|
270
276
|
destroy: function destroy() {
|
|
271
277
|
providerFactory.unsubscribe('quickInsertProvider', providerHandler);
|
|
272
278
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-quick-insert",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.13",
|
|
4
4
|
"description": "Quick insert plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
41
41
|
"@atlaskit/theme": "^21.0.0",
|
|
42
42
|
"@atlaskit/tmp-editor-statsig": "^13.42.0",
|
|
43
|
-
"@atlaskit/tokens": "^8.
|
|
43
|
+
"@atlaskit/tokens": "^8.3.0",
|
|
44
44
|
"@babel/runtime": "^7.0.0",
|
|
45
45
|
"@emotion/react": "^11.7.1"
|
|
46
46
|
},
|