@atlaskit/editor-plugin-quick-insert 6.0.12 → 6.0.14

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-quick-insert
2
2
 
3
+ ## 6.0.14
4
+
5
+ ### Patch Changes
6
+
7
+ - [`34ebbcd3440c2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/34ebbcd3440c2) -
8
+ NO-ISSUE Split by action subject id for experience tracking
9
+ - Updated dependencies
10
+
11
+ ## 6.0.13
12
+
13
+ ### Patch Changes
14
+
15
+ - [`4d676bbdb3ce6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4d676bbdb3ce6) -
16
+ ts-ignore added temporarily to unblock local consumption for help-center, will be removed once
17
+ project refs are setup
18
+ - Updated dependencies
19
+
3
20
  ## 6.0.12
4
21
 
5
22
  ### Patch Changes
@@ -37,13 +37,16 @@ var getQuickInsertOpenExperiencePlugin = exports.getQuickInsertOpenExperiencePlu
37
37
  }
38
38
  return targetEl;
39
39
  };
40
- var experience = new _experiences.Experience('quick-insert-open', {
40
+ var experience = new _experiences.Experience('menu-open', {
41
+ actionSubjectId: 'quick-insert-menu',
41
42
  dispatchAnalyticsEvent: dispatchAnalyticsEvent,
42
43
  checks: [new _experiences.ExperienceCheckTimeout({
43
44
  durationMs: 500
44
45
  }), new _experiences.ExperienceCheckDomMutation({
45
46
  onDomMutation: function onDomMutation(_ref2) {
46
47
  var mutations = _ref2.mutations;
48
+ // @ts-ignore - Workaround for help-center local consumption
49
+
47
50
  if (mutations.some(isQuickInsertMenuAddedInMutation)) {
48
51
  return {
49
52
  status: 'success'
@@ -63,7 +66,11 @@ var getQuickInsertOpenExperiencePlugin = exports.getQuickInsertOpenExperiencePlu
63
66
  return new _safePlugin.SafePlugin({
64
67
  key: pluginKey,
65
68
  props: {
69
+ // @ts-ignore - Workaround for help-center local consumption
70
+
66
71
  handleDOMEvents: {
72
+ // @ts-ignore - Workaround for help-center local consumption
73
+
67
74
  click: function click(_view, event) {
68
75
  if (isTargetQuickInsertButton(event.target)) {
69
76
  experience.start({
@@ -71,6 +78,8 @@ var getQuickInsertOpenExperiencePlugin = exports.getQuickInsertOpenExperiencePlu
71
78
  });
72
79
  }
73
80
  },
81
+ // @ts-ignore - Workaround for help-center local consumption
82
+
74
83
  beforeinput: function beforeinput(view, event) {
75
84
  if (isQuickInsertTrigger(event) && isSelectionWhichSupportsTypeahead(view)) {
76
85
  experience.start({
@@ -78,6 +87,8 @@ var getQuickInsertOpenExperiencePlugin = exports.getQuickInsertOpenExperiencePlu
78
87
  });
79
88
  }
80
89
  },
90
+ // @ts-ignore - Workaround for help-center local consumption
91
+
81
92
  keydown: function keydown(_view, event) {
82
93
  if (isCancelKey(event.key) && !isQuickInsertMenuWithinNode(getTarget())) {
83
94
  experience.abort({
@@ -113,6 +124,9 @@ var isSelectionWhichSupportsTypeahead = function isSelectionWhichSupportsTypeahe
113
124
  if ($from.parent.type.name === 'codeBlock') {
114
125
  return false;
115
126
  }
127
+
128
+ // @ts-ignore - Workaround for help-center local consumption
129
+
116
130
  if ($from.marks().some(function (mark) {
117
131
  return mark.type.name === 'code';
118
132
  })) {
@@ -137,6 +151,8 @@ var isTargetQuickInsertButton = function isTargetQuickInsertButton(target) {
137
151
  var isQuickInsertMenuAddedInMutation = function isQuickInsertMenuAddedInMutation(_ref5) {
138
152
  var type = _ref5.type,
139
153
  addedNodes = _ref5.addedNodes;
154
+ // @ts-ignore - Workaround for help-center local consumption
155
+
140
156
  return type === 'childList' && (0, _toConsumableArray2.default)(addedNodes).some(isQuickInsertMenuWithinNode);
141
157
  };
142
158
  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
  }
@@ -30,7 +30,8 @@ export const getQuickInsertOpenExperiencePlugin = ({
30
30
  }
31
31
  return targetEl;
32
32
  };
33
- const experience = new Experience('quick-insert-open', {
33
+ const experience = new Experience('menu-open', {
34
+ actionSubjectId: 'quick-insert-menu',
34
35
  dispatchAnalyticsEvent,
35
36
  checks: [new ExperienceCheckTimeout({
36
37
  durationMs: 500
@@ -38,6 +39,8 @@ export const getQuickInsertOpenExperiencePlugin = ({
38
39
  onDomMutation: ({
39
40
  mutations
40
41
  }) => {
42
+ // @ts-ignore - Workaround for help-center local consumption
43
+
41
44
  if (mutations.some(isQuickInsertMenuAddedInMutation)) {
42
45
  return {
43
46
  status: 'success'
@@ -55,7 +58,11 @@ export const getQuickInsertOpenExperiencePlugin = ({
55
58
  return new SafePlugin({
56
59
  key: pluginKey,
57
60
  props: {
61
+ // @ts-ignore - Workaround for help-center local consumption
62
+
58
63
  handleDOMEvents: {
64
+ // @ts-ignore - Workaround for help-center local consumption
65
+
59
66
  click: (_view, event) => {
60
67
  if (isTargetQuickInsertButton(event.target)) {
61
68
  experience.start({
@@ -63,6 +70,8 @@ export const getQuickInsertOpenExperiencePlugin = ({
63
70
  });
64
71
  }
65
72
  },
73
+ // @ts-ignore - Workaround for help-center local consumption
74
+
66
75
  beforeinput: (view, event) => {
67
76
  if (isQuickInsertTrigger(event) && isSelectionWhichSupportsTypeahead(view)) {
68
77
  experience.start({
@@ -70,6 +79,8 @@ export const getQuickInsertOpenExperiencePlugin = ({
70
79
  });
71
80
  }
72
81
  },
82
+ // @ts-ignore - Workaround for help-center local consumption
83
+
73
84
  keydown: (_view, event) => {
74
85
  if (isCancelKey(event.key) && !isQuickInsertMenuWithinNode(getTarget())) {
75
86
  experience.abort({
@@ -108,6 +119,9 @@ const isSelectionWhichSupportsTypeahead = ({
108
119
  if ($from.parent.type.name === 'codeBlock') {
109
120
  return false;
110
121
  }
122
+
123
+ // @ts-ignore - Workaround for help-center local consumption
124
+
111
125
  if ($from.marks().some(mark => mark.type.name === 'code')) {
112
126
  return false;
113
127
  }
@@ -131,6 +145,8 @@ const isQuickInsertMenuAddedInMutation = ({
131
145
  type,
132
146
  addedNodes
133
147
  }) => {
148
+ // @ts-ignore - Workaround for help-center local consumption
149
+
134
150
  return type === 'childList' && [...addedNodes].some(isQuickInsertMenuWithinNode);
135
151
  };
136
152
  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
  }
@@ -30,13 +30,16 @@ export var getQuickInsertOpenExperiencePlugin = function getQuickInsertOpenExper
30
30
  }
31
31
  return targetEl;
32
32
  };
33
- var experience = new Experience('quick-insert-open', {
33
+ var experience = new Experience('menu-open', {
34
+ actionSubjectId: 'quick-insert-menu',
34
35
  dispatchAnalyticsEvent: dispatchAnalyticsEvent,
35
36
  checks: [new ExperienceCheckTimeout({
36
37
  durationMs: 500
37
38
  }), new ExperienceCheckDomMutation({
38
39
  onDomMutation: function onDomMutation(_ref2) {
39
40
  var mutations = _ref2.mutations;
41
+ // @ts-ignore - Workaround for help-center local consumption
42
+
40
43
  if (mutations.some(isQuickInsertMenuAddedInMutation)) {
41
44
  return {
42
45
  status: 'success'
@@ -56,7 +59,11 @@ export var getQuickInsertOpenExperiencePlugin = function getQuickInsertOpenExper
56
59
  return new SafePlugin({
57
60
  key: pluginKey,
58
61
  props: {
62
+ // @ts-ignore - Workaround for help-center local consumption
63
+
59
64
  handleDOMEvents: {
65
+ // @ts-ignore - Workaround for help-center local consumption
66
+
60
67
  click: function click(_view, event) {
61
68
  if (isTargetQuickInsertButton(event.target)) {
62
69
  experience.start({
@@ -64,6 +71,8 @@ export var getQuickInsertOpenExperiencePlugin = function getQuickInsertOpenExper
64
71
  });
65
72
  }
66
73
  },
74
+ // @ts-ignore - Workaround for help-center local consumption
75
+
67
76
  beforeinput: function beforeinput(view, event) {
68
77
  if (isQuickInsertTrigger(event) && isSelectionWhichSupportsTypeahead(view)) {
69
78
  experience.start({
@@ -71,6 +80,8 @@ export var getQuickInsertOpenExperiencePlugin = function getQuickInsertOpenExper
71
80
  });
72
81
  }
73
82
  },
83
+ // @ts-ignore - Workaround for help-center local consumption
84
+
74
85
  keydown: function keydown(_view, event) {
75
86
  if (isCancelKey(event.key) && !isQuickInsertMenuWithinNode(getTarget())) {
76
87
  experience.abort({
@@ -106,6 +117,9 @@ var isSelectionWhichSupportsTypeahead = function isSelectionWhichSupportsTypeahe
106
117
  if ($from.parent.type.name === 'codeBlock') {
107
118
  return false;
108
119
  }
120
+
121
+ // @ts-ignore - Workaround for help-center local consumption
122
+
109
123
  if ($from.marks().some(function (mark) {
110
124
  return mark.type.name === 'code';
111
125
  })) {
@@ -130,6 +144,8 @@ var isTargetQuickInsertButton = function isTargetQuickInsertButton(target) {
130
144
  var isQuickInsertMenuAddedInMutation = function isQuickInsertMenuAddedInMutation(_ref5) {
131
145
  var type = _ref5.type,
132
146
  addedNodes = _ref5.addedNodes;
147
+ // @ts-ignore - Workaround for help-center local consumption
148
+
133
149
  return type === 'childList' && _toConsumableArray(addedNodes).some(isQuickInsertMenuWithinNode);
134
150
  };
135
151
  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.12",
3
+ "version": "6.0.14",
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.2.0",
43
+ "@atlaskit/tokens": "^8.3.0",
44
44
  "@babel/runtime": "^7.0.0",
45
45
  "@emotion/react": "^11.7.1"
46
46
  },