@atlaskit/editor-plugin-selection-toolbar 7.1.9 → 7.1.11

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.11
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 7.1.10
10
+
11
+ ### Patch Changes
12
+
13
+ - [`3170133bb745f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3170133bb745f) -
14
+ [EDITOR-3440] fixed breaking test related to the integration of platform toolbar ai menu and hero
15
+ button into the legacy toolbar'
16
+ - Updated dependencies
17
+
3
18
  ## 7.1.9
4
19
 
5
20
  ### Patch Changes
@@ -206,10 +206,12 @@ var selectionToolbarPlugin = exports.selectionToolbarPlugin = function selection
206
206
  // @ts-ignore - Workaround for help-center local consumption
207
207
 
208
208
  var target = event.target;
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';
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';
211
- if (isRovoChangeToneButton || isRovoTranslateButton) {
212
- return null;
209
+ if (target && target instanceof Element) {
210
+ var isRovoChangeToneButton = target.tagName === 'BUTTON' && _hasNestedSpanWithText(target, 'Change tone') || target.getAttribute('aria-label') === 'Change tone' || target.innerHTML === 'Change tone';
211
+ var isRovoTranslateButton = target.tagName === 'BUTTON' && _hasNestedSpanWithText(target, 'Translate options') || target.getAttribute('aria-label') === 'Translate options' || target.innerHTML === 'Translate options';
212
+ if (isRovoChangeToneButton || isRovoTranslateButton) {
213
+ return null;
214
+ }
213
215
  }
214
216
  }
215
217
  _view.dispatch(_view.state.tr.setMeta(_pluginKey.selectionToolbarPluginKey, {
@@ -404,7 +406,7 @@ function getSelectionNodeTypes(state) {
404
406
  var selectionNodeTypes = [];
405
407
  // @ts-ignore - Workaround for help-center local consumption
406
408
 
407
- state.doc.nodesBetween(state.selection.from, state.selection.to, function (node, _pos, parent) {
409
+ state.doc.nodesBetween(state.selection.from, state.selection.to, function (node) {
408
410
  if (selectionNodeTypes.indexOf(node.type) !== 0) {
409
411
  selectionNodeTypes.push(node.type);
410
412
  }
@@ -207,10 +207,12 @@ export const selectionToolbarPlugin = ({
207
207
  // @ts-ignore - Workaround for help-center local consumption
208
208
 
209
209
  const target = event.target;
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';
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';
212
- if (isRovoChangeToneButton || isRovoTranslateButton) {
213
- return null;
210
+ if (target && target instanceof Element) {
211
+ const isRovoChangeToneButton = target.tagName === 'BUTTON' && hasNestedSpanWithText(target, 'Change tone') || target.getAttribute('aria-label') === 'Change tone' || target.innerHTML === 'Change tone';
212
+ const isRovoTranslateButton = target.tagName === 'BUTTON' && hasNestedSpanWithText(target, 'Translate options') || target.getAttribute('aria-label') === 'Translate options' || target.innerHTML === 'Translate options';
213
+ if (isRovoChangeToneButton || isRovoTranslateButton) {
214
+ return null;
215
+ }
214
216
  }
215
217
  }
216
218
  view.dispatch(view.state.tr.setMeta(selectionToolbarPluginKey, {
@@ -402,7 +404,7 @@ function getSelectionNodeTypes(state) {
402
404
  const selectionNodeTypes = [];
403
405
  // @ts-ignore - Workaround for help-center local consumption
404
406
 
405
- state.doc.nodesBetween(state.selection.from, state.selection.to, (node, _pos, parent) => {
407
+ state.doc.nodesBetween(state.selection.from, state.selection.to, node => {
406
408
  if (selectionNodeTypes.indexOf(node.type) !== 0) {
407
409
  selectionNodeTypes.push(node.type);
408
410
  }
@@ -199,10 +199,12 @@ export var selectionToolbarPlugin = function selectionToolbarPlugin(_ref) {
199
199
  // @ts-ignore - Workaround for help-center local consumption
200
200
 
201
201
  var target = event.target;
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';
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';
204
- if (isRovoChangeToneButton || isRovoTranslateButton) {
205
- return null;
202
+ if (target && target instanceof Element) {
203
+ var isRovoChangeToneButton = target.tagName === 'BUTTON' && _hasNestedSpanWithText(target, 'Change tone') || target.getAttribute('aria-label') === 'Change tone' || target.innerHTML === 'Change tone';
204
+ var isRovoTranslateButton = target.tagName === 'BUTTON' && _hasNestedSpanWithText(target, 'Translate options') || target.getAttribute('aria-label') === 'Translate options' || target.innerHTML === 'Translate options';
205
+ if (isRovoChangeToneButton || isRovoTranslateButton) {
206
+ return null;
207
+ }
206
208
  }
207
209
  }
208
210
  _view.dispatch(_view.state.tr.setMeta(selectionToolbarPluginKey, {
@@ -397,7 +399,7 @@ function getSelectionNodeTypes(state) {
397
399
  var selectionNodeTypes = [];
398
400
  // @ts-ignore - Workaround for help-center local consumption
399
401
 
400
- state.doc.nodesBetween(state.selection.from, state.selection.to, function (node, _pos, parent) {
402
+ state.doc.nodesBetween(state.selection.from, state.selection.to, function (node) {
401
403
  if (selectionNodeTypes.indexOf(node.type) !== 0) {
402
404
  selectionNodeTypes.push(node.type);
403
405
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-selection-toolbar",
3
- "version": "7.1.9",
3
+ "version": "7.1.11",
4
4
  "description": "@atlaskit/editor-plugin-selection-toolbar for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -39,14 +39,14 @@
39
39
  "@atlaskit/editor-plugin-user-intent": "^4.0.0",
40
40
  "@atlaskit/editor-plugin-user-preferences": "^4.0.0",
41
41
  "@atlaskit/editor-prosemirror": "7.0.0",
42
- "@atlaskit/editor-toolbar": "^0.17.0",
42
+ "@atlaskit/editor-toolbar": "^0.18.0",
43
43
  "@atlaskit/editor-toolbar-model": "^0.2.0",
44
44
  "@atlaskit/icon": "^29.0.0",
45
45
  "@atlaskit/icon-lab": "^5.12.0",
46
46
  "@atlaskit/menu": "^8.4.0",
47
47
  "@atlaskit/platform-feature-flags": "^1.1.0",
48
48
  "@atlaskit/platform-feature-flags-react": "^0.4.0",
49
- "@atlaskit/tmp-editor-statsig": "^14.0.0",
49
+ "@atlaskit/tmp-editor-statsig": "^14.1.0",
50
50
  "@atlaskit/tokens": "^8.4.0",
51
51
  "@babel/runtime": "^7.0.0",
52
52
  "bind-event-listener": "^3.0.0"