@atlaskit/editor-plugin-floating-toolbar 18.0.7 → 18.1.0

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,24 @@
1
1
  # @atlaskit/editor-plugin-floating-toolbar
2
2
 
3
+ ## 18.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`bd2c5b0112185`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/bd2c5b0112185) -
8
+ Remove stale API report artifacts from published Platform packages.
9
+
10
+ ### Patch Changes
11
+
12
+ - Updated dependencies
13
+
14
+ ## 18.0.8
15
+
16
+ ### Patch Changes
17
+
18
+ - [`c4385174a8662`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c4385174a8662) -
19
+ Clean up experiment `editor_a11y_role_textbox`.
20
+ - Updated dependencies
21
+
3
22
  ## 18.0.7
4
23
 
5
24
  ### Patch Changes
@@ -8,7 +8,7 @@ var _browser = require("@atlaskit/editor-common/browser");
8
8
  var _clipboard = require("@atlaskit/editor-common/clipboard");
9
9
  var _copyButton = require("@atlaskit/editor-common/copy-button");
10
10
  var _state = require("@atlaskit/editor-prosemirror/state");
11
- var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
11
+ var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
12
12
  var copyNode = exports.copyNode = function copyNode(nodeType, editorAnalyticsApi, inputMethod) {
13
13
  return function (_ref) {
14
14
  var tr = _ref.tr;
@@ -26,7 +26,7 @@ var copyNode = exports.copyNode = function copyNode(nodeType, editorAnalyticsApi
26
26
  var schema = tr.doc.type.schema;
27
27
  var copyToClipboardTr = tr;
28
28
  var domNode = (0, _copyButton.toDOM)(contentNodeWithPos.node, schema);
29
- if ((0, _experiments.editorExperiment)('platform_editor_block_menu', true)) {
29
+ if ((0, _editorExperiment.editorExperiment)('platform_editor_block_menu', true)) {
30
30
  (0, _copyButton.copyDomNode)(domNode, contentNodeWithPos.node.type, tr.selection);
31
31
  } else {
32
32
  if (domNode) {
@@ -25,5 +25,5 @@ var ConfirmationModalImpl = function ConfirmationModalImpl(props) {
25
25
  return options ? /*#__PURE__*/_react.default.createElement(_modalTransition.default, null, renderModel(options === null || options === void 0 ? void 0 : options.isReferentialityDialog)) : null;
26
26
  };
27
27
 
28
- // eslint-disable-next-line @typescript-eslint/ban-types
28
+ // eslint-disable-next-line @typescript-eslint/no-restricted-types
29
29
  var ConfirmationModal = exports.ConfirmationModal = (0, _reactIntl.injectIntl)(ConfirmationModalImpl);
@@ -638,14 +638,6 @@ var Toolbar = /*#__PURE__*/function (_Component) {
638
638
  //Alt + F10 to reach first element in this floating toolbar
639
639
  return event.altKey && (event.key === 'F10' || event.keyCode === 121);
640
640
  });
641
- (0, _defineProperty2.default)(_this, "doesNodeRequireAssitiveMessage", function (node) {
642
- // Code blocks have an assistive message to announce the content of the code block to screen readers, so we don't need to announce the floating toolbar for those nodes
643
- var nodesWithAlternativeRoles = ['codeBlock'];
644
- if (nodesWithAlternativeRoles.includes(node.type.name)) {
645
- return false;
646
- }
647
- return true;
648
- });
649
641
  _this.scrollContainerRef = /*#__PURE__*/_react.default.createRef();
650
642
  _this.mountRef = /*#__PURE__*/_react.default.createRef();
651
643
  _this.toolbarContainerRef = /*#__PURE__*/_react.default.createRef();
@@ -718,7 +710,6 @@ var Toolbar = /*#__PURE__*/function (_Component) {
718
710
  var hasSelect = items.find(function (item) {
719
711
  return item.type === 'select' && item.selectType === 'list';
720
712
  });
721
- var shouldRenderAssistiveAnnouncer = (0, _expValEquals.expValEquals)('editor_a11y_role_textbox', 'isEnabled', true) ? this.doesNodeRequireAssitiveMessage(node) : true;
722
713
  return (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_uiMenu.ToolbarArrowKeyNavigationProvider, {
723
714
  editorView: this.props.editorView,
724
715
  handleEscape: this.handleEscape,
@@ -738,7 +729,7 @@ var Toolbar = /*#__PURE__*/function (_Component) {
738
729
  ,
739
730
  className: className,
740
731
  onMouseDown: areAnyNewToolbarFlagsEnabled ? this.captureMouseEvent : undefined
741
- }, shouldRenderAssistiveAnnouncer && (0, _react2.jsx)(_ui.Announcer, {
732
+ }, (0, _react2.jsx)(_ui.Announcer, {
742
733
  text: mediaAssistiveMessage ? "".concat(mediaAssistiveMessage, ", ").concat(intl.formatMessage(_floatingToolbar.messages.floatingToolbarAnnouncer)) : intl.formatMessage(_floatingToolbar.messages.floatingToolbarAnnouncer),
743
734
  delay: 250
744
735
  }), scrollable && areAnyNewToolbarFlagsEnabled && (0, _react2.jsx)(_ScrollButton.ScrollButton, {
@@ -782,6 +773,6 @@ var Toolbar = /*#__PURE__*/function (_Component) {
782
773
  })));
783
774
  }
784
775
  }]);
785
- }(_react.Component); // eslint-disable-next-line @typescript-eslint/ban-types
776
+ }(_react.Component); // eslint-disable-next-line @typescript-eslint/no-restricted-types
786
777
  var _default_1 = (0, _reactIntl.injectIntl)(Toolbar);
787
778
  var _default = exports.default = _default_1;
@@ -2,7 +2,7 @@ import { getBrowserInfo } from '@atlaskit/editor-common/browser';
2
2
  import { copyHTMLToClipboard, copyHTMLToClipboardPolyfill, getNodeCopiedAnalyticsPayload } from '@atlaskit/editor-common/clipboard';
3
3
  import { copyDomNode, getSelectedNodeOrNodeParentByNodeType, toDOM } from '@atlaskit/editor-common/copy-button';
4
4
  import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
5
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
5
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
6
6
  export const copyNode = (nodeType, editorAnalyticsApi, inputMethod) => ({
7
7
  tr
8
8
  }) => {
@@ -16,5 +16,5 @@ const ConfirmationModalImpl = props => {
16
16
  return options ? /*#__PURE__*/React.createElement(ModalTransition, null, renderModel(options === null || options === void 0 ? void 0 : options.isReferentialityDialog)) : null;
17
17
  };
18
18
 
19
- // eslint-disable-next-line @typescript-eslint/ban-types
19
+ // eslint-disable-next-line @typescript-eslint/no-restricted-types
20
20
  export const ConfirmationModal = injectIntl(ConfirmationModalImpl);
@@ -598,14 +598,6 @@ class Toolbar extends Component {
598
598
  //Alt + F10 to reach first element in this floating toolbar
599
599
  return event.altKey && (event.key === 'F10' || event.keyCode === 121);
600
600
  });
601
- _defineProperty(this, "doesNodeRequireAssitiveMessage", node => {
602
- // Code blocks have an assistive message to announce the content of the code block to screen readers, so we don't need to announce the floating toolbar for those nodes
603
- const nodesWithAlternativeRoles = ['codeBlock'];
604
- if (nodesWithAlternativeRoles.includes(node.type.name)) {
605
- return false;
606
- }
607
- return true;
608
- });
609
601
  this.scrollContainerRef = /*#__PURE__*/React.createRef();
610
602
  this.mountRef = /*#__PURE__*/React.createRef();
611
603
  this.toolbarContainerRef = /*#__PURE__*/React.createRef();
@@ -672,7 +664,6 @@ class Toolbar extends Component {
672
664
  // Select has left padding of 4px to the border, everything else 8px
673
665
  const firstElementIsSelect = items[0].type === 'select';
674
666
  const hasSelect = items.find(item => item.type === 'select' && item.selectType === 'list');
675
- const shouldRenderAssistiveAnnouncer = expValEquals('editor_a11y_role_textbox', 'isEnabled', true) ? this.doesNodeRequireAssitiveMessage(node) : true;
676
667
  return jsx(React.Fragment, null, jsx(ToolbarArrowKeyNavigationProvider, {
677
668
  editorView: this.props.editorView,
678
669
  handleEscape: this.handleEscape,
@@ -690,7 +681,7 @@ class Toolbar extends Component {
690
681
  ,
691
682
  className: className,
692
683
  onMouseDown: areAnyNewToolbarFlagsEnabled ? this.captureMouseEvent : undefined
693
- }, shouldRenderAssistiveAnnouncer && jsx(Announcer, {
684
+ }, jsx(Announcer, {
694
685
  text: mediaAssistiveMessage ? `${mediaAssistiveMessage}, ${intl.formatMessage(messages.floatingToolbarAnnouncer)}` : intl.formatMessage(messages.floatingToolbarAnnouncer),
695
686
  delay: 250
696
687
  }), scrollable && areAnyNewToolbarFlagsEnabled && jsx(ScrollButton, {
@@ -735,6 +726,6 @@ class Toolbar extends Component {
735
726
  }
736
727
  }
737
728
 
738
- // eslint-disable-next-line @typescript-eslint/ban-types
729
+ // eslint-disable-next-line @typescript-eslint/no-restricted-types
739
730
  const _default_1 = injectIntl(Toolbar);
740
731
  export default _default_1;
@@ -2,7 +2,7 @@ import { getBrowserInfo } from '@atlaskit/editor-common/browser';
2
2
  import { copyHTMLToClipboard, copyHTMLToClipboardPolyfill, getNodeCopiedAnalyticsPayload } from '@atlaskit/editor-common/clipboard';
3
3
  import { copyDomNode, getSelectedNodeOrNodeParentByNodeType, toDOM } from '@atlaskit/editor-common/copy-button';
4
4
  import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
5
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
5
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
6
6
  export var copyNode = function copyNode(nodeType, editorAnalyticsApi, inputMethod) {
7
7
  return function (_ref) {
8
8
  var tr = _ref.tr;
@@ -18,5 +18,5 @@ var ConfirmationModalImpl = function ConfirmationModalImpl(props) {
18
18
  return options ? /*#__PURE__*/React.createElement(ModalTransition, null, renderModel(options === null || options === void 0 ? void 0 : options.isReferentialityDialog)) : null;
19
19
  };
20
20
 
21
- // eslint-disable-next-line @typescript-eslint/ban-types
21
+ // eslint-disable-next-line @typescript-eslint/no-restricted-types
22
22
  export var ConfirmationModal = injectIntl(ConfirmationModalImpl);
@@ -632,14 +632,6 @@ var Toolbar = /*#__PURE__*/function (_Component) {
632
632
  //Alt + F10 to reach first element in this floating toolbar
633
633
  return event.altKey && (event.key === 'F10' || event.keyCode === 121);
634
634
  });
635
- _defineProperty(_this, "doesNodeRequireAssitiveMessage", function (node) {
636
- // Code blocks have an assistive message to announce the content of the code block to screen readers, so we don't need to announce the floating toolbar for those nodes
637
- var nodesWithAlternativeRoles = ['codeBlock'];
638
- if (nodesWithAlternativeRoles.includes(node.type.name)) {
639
- return false;
640
- }
641
- return true;
642
- });
643
635
  _this.scrollContainerRef = /*#__PURE__*/React.createRef();
644
636
  _this.mountRef = /*#__PURE__*/React.createRef();
645
637
  _this.toolbarContainerRef = /*#__PURE__*/React.createRef();
@@ -712,7 +704,6 @@ var Toolbar = /*#__PURE__*/function (_Component) {
712
704
  var hasSelect = items.find(function (item) {
713
705
  return item.type === 'select' && item.selectType === 'list';
714
706
  });
715
- var shouldRenderAssistiveAnnouncer = expValEquals('editor_a11y_role_textbox', 'isEnabled', true) ? this.doesNodeRequireAssitiveMessage(node) : true;
716
707
  return jsx(React.Fragment, null, jsx(ToolbarArrowKeyNavigationProvider, {
717
708
  editorView: this.props.editorView,
718
709
  handleEscape: this.handleEscape,
@@ -732,7 +723,7 @@ var Toolbar = /*#__PURE__*/function (_Component) {
732
723
  ,
733
724
  className: className,
734
725
  onMouseDown: areAnyNewToolbarFlagsEnabled ? this.captureMouseEvent : undefined
735
- }, shouldRenderAssistiveAnnouncer && jsx(Announcer, {
726
+ }, jsx(Announcer, {
736
727
  text: mediaAssistiveMessage ? "".concat(mediaAssistiveMessage, ", ").concat(intl.formatMessage(messages.floatingToolbarAnnouncer)) : intl.formatMessage(messages.floatingToolbarAnnouncer),
737
728
  delay: 250
738
729
  }), scrollable && areAnyNewToolbarFlagsEnabled && jsx(ScrollButton, {
@@ -776,6 +767,6 @@ var Toolbar = /*#__PURE__*/function (_Component) {
776
767
  })));
777
768
  }
778
769
  }]);
779
- }(Component); // eslint-disable-next-line @typescript-eslint/ban-types
770
+ }(Component); // eslint-disable-next-line @typescript-eslint/no-restricted-types
780
771
  var _default_1 = injectIntl(Toolbar);
781
772
  export default _default_1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-floating-toolbar",
3
- "version": "18.0.7",
3
+ "version": "18.1.0",
4
4
  "description": "Floating toolbar plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -21,31 +21,31 @@
21
21
  ],
22
22
  "atlaskit:src": "src/index.ts",
23
23
  "dependencies": {
24
- "@atlaskit/adf-utils": "^20.7.0",
25
- "@atlaskit/button": "^25.2.0",
26
- "@atlaskit/checkbox": "^19.1.0",
27
- "@atlaskit/editor-palette": "^3.4.0",
28
- "@atlaskit/editor-plugin-analytics": "^16.0.0",
29
- "@atlaskit/editor-plugin-context-panel": "^18.0.0",
30
- "@atlaskit/editor-plugin-copy-button": "^16.0.0",
31
- "@atlaskit/editor-plugin-decorations": "^16.0.0",
32
- "@atlaskit/editor-plugin-editor-disabled": "^16.0.0",
24
+ "@atlaskit/adf-utils": "^20.8.0",
25
+ "@atlaskit/button": "^25.3.0",
26
+ "@atlaskit/checkbox": "^19.2.0",
27
+ "@atlaskit/editor-palette": "^3.5.0",
28
+ "@atlaskit/editor-plugin-analytics": "^16.1.0",
29
+ "@atlaskit/editor-plugin-context-panel": "^18.1.0",
30
+ "@atlaskit/editor-plugin-copy-button": "^16.1.0",
31
+ "@atlaskit/editor-plugin-decorations": "^16.1.0",
32
+ "@atlaskit/editor-plugin-editor-disabled": "^16.1.0",
33
33
  "@atlaskit/editor-plugin-editor-viewmode": "^18.0.0",
34
- "@atlaskit/editor-plugin-emoji": "^17.0.0",
35
- "@atlaskit/editor-plugin-extension": "^19.0.0",
34
+ "@atlaskit/editor-plugin-emoji": "^17.1.0",
35
+ "@atlaskit/editor-plugin-extension": "^19.1.0",
36
36
  "@atlaskit/editor-plugin-interaction": "^27.0.0",
37
37
  "@atlaskit/editor-plugin-user-intent": "^14.0.0",
38
38
  "@atlaskit/editor-prosemirror": "^8.0.0",
39
- "@atlaskit/emoji": "^72.1.0",
40
- "@atlaskit/icon": "^37.5.0",
41
- "@atlaskit/menu": "^10.1.0",
42
- "@atlaskit/modal-dialog": "^16.5.0",
43
- "@atlaskit/platform-feature-flags": "^2.1.0",
44
- "@atlaskit/primitives": "^22.4.0",
45
- "@atlaskit/select": "^22.10.0",
46
- "@atlaskit/tmp-editor-statsig": "^167.0.0",
47
- "@atlaskit/tokens": "^16.9.0",
48
- "@atlaskit/tooltip": "^24.2.0",
39
+ "@atlaskit/emoji": "^72.2.0",
40
+ "@atlaskit/icon": "^37.6.0",
41
+ "@atlaskit/menu": "^10.2.0",
42
+ "@atlaskit/modal-dialog": "^16.6.0",
43
+ "@atlaskit/platform-feature-flags": "^2.2.0",
44
+ "@atlaskit/primitives": "^22.5.0",
45
+ "@atlaskit/select": "^22.11.0",
46
+ "@atlaskit/tmp-editor-statsig": "^168.0.0",
47
+ "@atlaskit/tokens": "^16.10.0",
48
+ "@atlaskit/tooltip": "^24.3.0",
49
49
  "@babel/runtime": "^7.0.0",
50
50
  "@emotion/react": "^11.7.1",
51
51
  "bind-event-listener": "^3.0.0",
@@ -54,7 +54,7 @@
54
54
  "react-loadable": "^5.1.0"
55
55
  },
56
56
  "peerDependencies": {
57
- "@atlaskit/editor-common": "^120.7.0",
57
+ "@atlaskit/editor-common": "^120.9.0",
58
58
  "react": "^18.2.0 || ^19.2.0",
59
59
  "react-dom": "^18.2.0 || ^19.2.0",
60
60
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
package/report.api.md DELETED
@@ -1,94 +0,0 @@
1
- <!-- API Report Version: 2.3 -->
2
-
3
- ## API Report File for "@atlaskit/editor-plugin-floating-toolbar"
4
-
5
- > Do not edit this file. This report is auto-generated using
6
- > [API Extractor](https://api-extractor.com/).
7
- > [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
8
-
9
- ### Table of contents
10
-
11
- - [Main Entry Types](#main-entry-types)
12
- - [Peer Dependencies](#peer-dependencies)
13
-
14
- ### Main Entry Types
15
-
16
- <!--SECTION START: Main Entry Types-->
17
-
18
- ```ts
19
- import type { ContextPanelPlugin } from '@atlaskit/editor-plugin-context-panel';
20
- import type { CopyButtonPlugin } from '@atlaskit/editor-plugin-copy-button';
21
- import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
22
- import type { EditorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled';
23
- import type { EditorState } from '@atlaskit/editor-prosemirror/state';
24
- import type { ExtensionPlugin } from '@atlaskit/editor-plugin-extension';
25
- import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
26
- import type { FloatingToolbarConfig } from '@atlaskit/editor-common/types';
27
- import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
28
- import type { Node as Node_2 } from '@atlaskit/editor-prosemirror/model';
29
- import type { OptionalPlugin } from '@atlaskit/editor-common/types';
30
- import type { Transaction } from '@atlaskit/editor-prosemirror/state';
31
-
32
- // @public (undocumented)
33
- export type ConfigWithNodeInfo = {
34
- config: FloatingToolbarConfig | undefined;
35
- pos: number;
36
- node: Node_2;
37
- };
38
-
39
- // @public
40
- export type FloatingToolbarPlugin = NextEditorPlugin<
41
- 'floatingToolbar',
42
- {
43
- dependencies: [
44
- OptionalPlugin<FeatureFlagsPlugin>,
45
- DecorationsPlugin,
46
- OptionalPlugin<ContextPanelPlugin>,
47
- OptionalPlugin<ExtensionPlugin>,
48
- CopyButtonPlugin,
49
- EditorDisabledPlugin,
50
- ];
51
- actions: {
52
- forceFocusSelector: ForceFocusSelector;
53
- };
54
- sharedState:
55
- | undefined
56
- | {
57
- configWithNodeInfo: ConfigWithNodeInfo | undefined;
58
- floatingToolbarData: FloatingToolbarPluginData | undefined;
59
- };
60
- }
61
- >;
62
-
63
- // @public (undocumented)
64
- export const floatingToolbarPlugin: FloatingToolbarPlugin;
65
-
66
- // @public (undocumented)
67
- export type FloatingToolbarPluginData = {
68
- confirmDialogForItem?: number;
69
- };
70
-
71
- // @public (undocumented)
72
- export type FloatingToolbarPluginState = {
73
- getConfigWithNodeInfo: (state: EditorState) => ConfigWithNodeInfo | null | undefined;
74
- };
75
-
76
- // @public (undocumented)
77
- export type ForceFocusSelector = (selector: null | string) => (tr: Transaction) => Transaction;
78
-
79
- // (No @packageDocumentation comment for this package)
80
- ```
81
-
82
- <!--SECTION END: Main Entry Types-->
83
-
84
- ### Peer Dependencies
85
-
86
- <!--SECTION START: Peer Dependencies-->
87
-
88
- ```json
89
- {
90
- "react": "^16.8.0"
91
- }
92
- ```
93
-
94
- <!--SECTION END: Peer Dependencies-->