@atlaskit/editor-plugin-selection-toolbar 7.1.6 → 7.1.8

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-selection-toolbar
2
2
 
3
+ ## 7.1.8
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
+
12
+ ## 7.1.7
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies
17
+
3
18
  ## 7.1.6
4
19
 
5
20
  ### Patch Changes
@@ -149,6 +149,7 @@ var selectionToolbarPlugin = exports.selectionToolbarPlugin = function selection
149
149
  return new _safePlugin.SafePlugin({
150
150
  key: _pluginKey.selectionToolbarPluginKey,
151
151
  state: {
152
+ // @ts-ignore - Workaround for help-center local consumption
152
153
  init: function init() {
153
154
  return {
154
155
  selectionStable: false,
@@ -156,6 +157,7 @@ var selectionToolbarPlugin = exports.selectionToolbarPlugin = function selection
156
157
  toolbarDocking: initialToolbarDocking
157
158
  };
158
159
  },
160
+ // @ts-ignore - Workaround for help-center local consumption
159
161
  apply: function apply(tr, pluginState) {
160
162
  var meta = tr.getMeta(_pluginKey.selectionToolbarPluginKey);
161
163
  var newPluginState = pluginState;
@@ -188,6 +190,7 @@ var selectionToolbarPlugin = exports.selectionToolbarPlugin = function selection
188
190
  return newPluginState;
189
191
  }
190
192
  },
193
+ // @ts-ignore - Workaround for help-center local consumption
191
194
  view: function view(_view) {
192
195
  var unbind = (0, _bindEventListener.bind)(_view.root, {
193
196
  type: 'mouseup',
@@ -200,6 +203,8 @@ var selectionToolbarPlugin = exports.selectionToolbarPlugin = function selection
200
203
  var editorViewModePlugin = api === null || api === void 0 || (_api$editorViewMode = api.editorViewMode) === null || _api$editorViewMode === void 0 ? void 0 : _api$editorViewMode.sharedState.currentState();
201
204
  var isViewModeEnabled = (editorViewModePlugin === null || editorViewModePlugin === void 0 ? void 0 : editorViewModePlugin.mode) === 'view';
202
205
  if ((0, _platformFeatureFlags.fg)('platform_editor_ai_generic_prep_for_aifc')) {
206
+ // @ts-ignore - Workaround for help-center local consumption
207
+
203
208
  var target = event.target;
204
209
  var isRovoChangeToneButton = (target === null || target === void 0 ? void 0 : target.tagName) === 'BUTTON' && _hasNestedSpanWithText(target, 'Change tone') || target.getAttribute('aria-label') === 'Change tone' || target.innerHTML === 'Change tone';
205
210
  var isRovoTranslateButton = (target === null || target === void 0 ? void 0 : target.tagName) === 'BUTTON' && _hasNestedSpanWithText(target, 'Translate options') || target.getAttribute('aria-label') === 'Translate options' || target.innerHTML === 'Translate options';
@@ -221,12 +226,14 @@ var selectionToolbarPlugin = exports.selectionToolbarPlugin = function selection
221
226
  }
222
227
  });
223
228
  return {
229
+ // @ts-ignore - Workaround for help-center local consumption
224
230
  destroy: function destroy() {
225
231
  unbind();
226
232
  unbindEditorViewFocus();
227
233
  }
228
234
  };
229
235
  },
236
+ // @ts-ignore - Workaround for help-center local consumption
230
237
  appendTransaction: function appendTransaction(_transactions, _oldState, newState) {
231
238
  if ((0, _platformFeatureFlags.fg)('platform_editor_use_preferences_plugin')) {
232
239
  return null;
@@ -253,7 +260,11 @@ var selectionToolbarPlugin = exports.selectionToolbarPlugin = function selection
253
260
  return null;
254
261
  },
255
262
  props: {
263
+ // @ts-ignore - Workaround for help-center local consumption
264
+
256
265
  handleDOMEvents: {
266
+ // @ts-ignore - Workaround for help-center local consumption
267
+
257
268
  mousedown: function mousedown(view) {
258
269
  view.dispatch(view.state.tr.setMeta(_pluginKey.selectionToolbarPluginKey, {
259
270
  selectionStable: false
@@ -298,9 +309,13 @@ var selectionToolbarPlugin = exports.selectionToolbarPlugin = function selection
298
309
 
299
310
  // Resolve the selectionToolbarHandlers to a list of SelectionToolbarGroups
300
311
  // and filter out any handlers which returned undefined
301
- var resolved = __selectionToolbarHandlers.map(function (selectionToolbarHandler) {
312
+ var resolved = __selectionToolbarHandlers
313
+ // @ts-ignore - Workaround for help-center local consumption
314
+ .map(function (selectionToolbarHandler) {
302
315
  return selectionToolbarHandler(state, intl, providerFactory);
303
- }).filter(function (resolved) {
316
+ })
317
+ // @ts-ignore - Workaround for help-center local consumption
318
+ .filter(function (resolved) {
304
319
  return resolved !== undefined;
305
320
  });
306
321
  // Sort the groups by rank
@@ -387,6 +402,8 @@ var selectionToolbarPlugin = exports.selectionToolbarPlugin = function selection
387
402
  };
388
403
  function getSelectionNodeTypes(state) {
389
404
  var selectionNodeTypes = [];
405
+ // @ts-ignore - Workaround for help-center local consumption
406
+
390
407
  state.doc.nodesBetween(state.selection.from, state.selection.to, function (node, _pos, parent) {
391
408
  if (selectionNodeTypes.indexOf(node.type) !== 0) {
392
409
  selectionNodeTypes.push(node.type);
@@ -142,6 +142,8 @@ export const selectionToolbarPlugin = ({
142
142
  return new SafePlugin({
143
143
  key: selectionToolbarPluginKey,
144
144
  state: {
145
+ // @ts-ignore - Workaround for help-center local consumption
146
+
145
147
  init() {
146
148
  return {
147
149
  selectionStable: false,
@@ -149,6 +151,8 @@ export const selectionToolbarPlugin = ({
149
151
  toolbarDocking: initialToolbarDocking
150
152
  };
151
153
  },
154
+ // @ts-ignore - Workaround for help-center local consumption
155
+
152
156
  apply(tr, pluginState) {
153
157
  const meta = tr.getMeta(selectionToolbarPluginKey);
154
158
  let newPluginState = pluginState;
@@ -186,6 +190,8 @@ export const selectionToolbarPlugin = ({
186
190
  return newPluginState;
187
191
  }
188
192
  },
193
+ // @ts-ignore - Workaround for help-center local consumption
194
+
189
195
  view(view) {
190
196
  const unbind = bind(view.root, {
191
197
  type: 'mouseup',
@@ -198,6 +204,8 @@ export const selectionToolbarPlugin = ({
198
204
  const editorViewModePlugin = api === null || api === void 0 ? void 0 : (_api$editorViewMode = api.editorViewMode) === null || _api$editorViewMode === void 0 ? void 0 : _api$editorViewMode.sharedState.currentState();
199
205
  const isViewModeEnabled = (editorViewModePlugin === null || editorViewModePlugin === void 0 ? void 0 : editorViewModePlugin.mode) === 'view';
200
206
  if (fg('platform_editor_ai_generic_prep_for_aifc')) {
207
+ // @ts-ignore - Workaround for help-center local consumption
208
+
201
209
  const target = event.target;
202
210
  const isRovoChangeToneButton = (target === null || target === void 0 ? void 0 : target.tagName) === 'BUTTON' && hasNestedSpanWithText(target, 'Change tone') || target.getAttribute('aria-label') === 'Change tone' || target.innerHTML === 'Change tone';
203
211
  const isRovoTranslateButton = (target === null || target === void 0 ? void 0 : target.tagName) === 'BUTTON' && hasNestedSpanWithText(target, 'Translate options') || target.getAttribute('aria-label') === 'Translate options' || target.innerHTML === 'Translate options';
@@ -219,12 +227,16 @@ export const selectionToolbarPlugin = ({
219
227
  }
220
228
  });
221
229
  return {
230
+ // @ts-ignore - Workaround for help-center local consumption
231
+
222
232
  destroy() {
223
233
  unbind();
224
234
  unbindEditorViewFocus();
225
235
  }
226
236
  };
227
237
  },
238
+ // @ts-ignore - Workaround for help-center local consumption
239
+
228
240
  appendTransaction(_transactions, _oldState, newState) {
229
241
  if (fg('platform_editor_use_preferences_plugin')) {
230
242
  return null;
@@ -251,7 +263,11 @@ export const selectionToolbarPlugin = ({
251
263
  return null;
252
264
  },
253
265
  props: {
266
+ // @ts-ignore - Workaround for help-center local consumption
267
+
254
268
  handleDOMEvents: {
269
+ // @ts-ignore - Workaround for help-center local consumption
270
+
255
271
  mousedown: view => {
256
272
  view.dispatch(view.state.tr.setMeta(selectionToolbarPluginKey, {
257
273
  selectionStable: false
@@ -297,7 +313,11 @@ export const selectionToolbarPlugin = ({
297
313
 
298
314
  // Resolve the selectionToolbarHandlers to a list of SelectionToolbarGroups
299
315
  // and filter out any handlers which returned undefined
300
- const resolved = __selectionToolbarHandlers.map(selectionToolbarHandler => selectionToolbarHandler(state, intl, providerFactory)).filter(resolved => resolved !== undefined);
316
+ const resolved = __selectionToolbarHandlers
317
+ // @ts-ignore - Workaround for help-center local consumption
318
+ .map(selectionToolbarHandler => selectionToolbarHandler(state, intl, providerFactory))
319
+ // @ts-ignore - Workaround for help-center local consumption
320
+ .filter(resolved => resolved !== undefined);
301
321
  // Sort the groups by rank
302
322
  // This is intended to allow different plugins to control the order of the groups
303
323
  // they add to the selection toolbar.
@@ -380,6 +400,8 @@ export const selectionToolbarPlugin = ({
380
400
  };
381
401
  function getSelectionNodeTypes(state) {
382
402
  const selectionNodeTypes = [];
403
+ // @ts-ignore - Workaround for help-center local consumption
404
+
383
405
  state.doc.nodesBetween(state.selection.from, state.selection.to, (node, _pos, parent) => {
384
406
  if (selectionNodeTypes.indexOf(node.type) !== 0) {
385
407
  selectionNodeTypes.push(node.type);
@@ -142,6 +142,7 @@ export var selectionToolbarPlugin = function selectionToolbarPlugin(_ref) {
142
142
  return new SafePlugin({
143
143
  key: selectionToolbarPluginKey,
144
144
  state: {
145
+ // @ts-ignore - Workaround for help-center local consumption
145
146
  init: function init() {
146
147
  return {
147
148
  selectionStable: false,
@@ -149,6 +150,7 @@ export var selectionToolbarPlugin = function selectionToolbarPlugin(_ref) {
149
150
  toolbarDocking: initialToolbarDocking
150
151
  };
151
152
  },
153
+ // @ts-ignore - Workaround for help-center local consumption
152
154
  apply: function apply(tr, pluginState) {
153
155
  var meta = tr.getMeta(selectionToolbarPluginKey);
154
156
  var newPluginState = pluginState;
@@ -181,6 +183,7 @@ export var selectionToolbarPlugin = function selectionToolbarPlugin(_ref) {
181
183
  return newPluginState;
182
184
  }
183
185
  },
186
+ // @ts-ignore - Workaround for help-center local consumption
184
187
  view: function view(_view) {
185
188
  var unbind = bind(_view.root, {
186
189
  type: 'mouseup',
@@ -193,6 +196,8 @@ export var selectionToolbarPlugin = function selectionToolbarPlugin(_ref) {
193
196
  var editorViewModePlugin = api === null || api === void 0 || (_api$editorViewMode = api.editorViewMode) === null || _api$editorViewMode === void 0 ? void 0 : _api$editorViewMode.sharedState.currentState();
194
197
  var isViewModeEnabled = (editorViewModePlugin === null || editorViewModePlugin === void 0 ? void 0 : editorViewModePlugin.mode) === 'view';
195
198
  if (fg('platform_editor_ai_generic_prep_for_aifc')) {
199
+ // @ts-ignore - Workaround for help-center local consumption
200
+
196
201
  var target = event.target;
197
202
  var isRovoChangeToneButton = (target === null || target === void 0 ? void 0 : target.tagName) === 'BUTTON' && _hasNestedSpanWithText(target, 'Change tone') || target.getAttribute('aria-label') === 'Change tone' || target.innerHTML === 'Change tone';
198
203
  var isRovoTranslateButton = (target === null || target === void 0 ? void 0 : target.tagName) === 'BUTTON' && _hasNestedSpanWithText(target, 'Translate options') || target.getAttribute('aria-label') === 'Translate options' || target.innerHTML === 'Translate options';
@@ -214,12 +219,14 @@ export var selectionToolbarPlugin = function selectionToolbarPlugin(_ref) {
214
219
  }
215
220
  });
216
221
  return {
222
+ // @ts-ignore - Workaround for help-center local consumption
217
223
  destroy: function destroy() {
218
224
  unbind();
219
225
  unbindEditorViewFocus();
220
226
  }
221
227
  };
222
228
  },
229
+ // @ts-ignore - Workaround for help-center local consumption
223
230
  appendTransaction: function appendTransaction(_transactions, _oldState, newState) {
224
231
  if (fg('platform_editor_use_preferences_plugin')) {
225
232
  return null;
@@ -246,7 +253,11 @@ export var selectionToolbarPlugin = function selectionToolbarPlugin(_ref) {
246
253
  return null;
247
254
  },
248
255
  props: {
256
+ // @ts-ignore - Workaround for help-center local consumption
257
+
249
258
  handleDOMEvents: {
259
+ // @ts-ignore - Workaround for help-center local consumption
260
+
250
261
  mousedown: function mousedown(view) {
251
262
  view.dispatch(view.state.tr.setMeta(selectionToolbarPluginKey, {
252
263
  selectionStable: false
@@ -291,9 +302,13 @@ export var selectionToolbarPlugin = function selectionToolbarPlugin(_ref) {
291
302
 
292
303
  // Resolve the selectionToolbarHandlers to a list of SelectionToolbarGroups
293
304
  // and filter out any handlers which returned undefined
294
- var resolved = __selectionToolbarHandlers.map(function (selectionToolbarHandler) {
305
+ var resolved = __selectionToolbarHandlers
306
+ // @ts-ignore - Workaround for help-center local consumption
307
+ .map(function (selectionToolbarHandler) {
295
308
  return selectionToolbarHandler(state, intl, providerFactory);
296
- }).filter(function (resolved) {
309
+ })
310
+ // @ts-ignore - Workaround for help-center local consumption
311
+ .filter(function (resolved) {
297
312
  return resolved !== undefined;
298
313
  });
299
314
  // Sort the groups by rank
@@ -380,6 +395,8 @@ export var selectionToolbarPlugin = function selectionToolbarPlugin(_ref) {
380
395
  };
381
396
  function getSelectionNodeTypes(state) {
382
397
  var selectionNodeTypes = [];
398
+ // @ts-ignore - Workaround for help-center local consumption
399
+
383
400
  state.doc.nodesBetween(state.selection.from, state.selection.to, function (node, _pos, parent) {
384
401
  if (selectionNodeTypes.indexOf(node.type) !== 0) {
385
402
  selectionNodeTypes.push(node.type);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-selection-toolbar",
3
- "version": "7.1.6",
3
+ "version": "7.1.8",
4
4
  "description": "@atlaskit/editor-plugin-selection-toolbar for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -29,7 +29,7 @@
29
29
  ],
30
30
  "atlaskit:src": "src/index.ts",
31
31
  "dependencies": {
32
- "@atlaskit/css": "^0.16.0",
32
+ "@atlaskit/css": "^0.17.0",
33
33
  "@atlaskit/editor-plugin-analytics": "^6.2.0",
34
34
  "@atlaskit/editor-plugin-block-controls": "^7.7.0",
35
35
  "@atlaskit/editor-plugin-connectivity": "^6.0.0",
@@ -47,7 +47,7 @@
47
47
  "@atlaskit/platform-feature-flags": "^1.1.0",
48
48
  "@atlaskit/platform-feature-flags-react": "^0.4.0",
49
49
  "@atlaskit/tmp-editor-statsig": "^13.42.0",
50
- "@atlaskit/tokens": "^8.2.0",
50
+ "@atlaskit/tokens": "^8.3.0",
51
51
  "@babel/runtime": "^7.0.0",
52
52
  "bind-event-listener": "^3.0.0"
53
53
  },