@atlaskit/editor-plugin-floating-toolbar 18.0.7 → 18.0.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 +8 -0
- package/dist/cjs/pm-plugins/commands.js +2 -2
- package/dist/cjs/ui/ConfirmationModal.js +1 -1
- package/dist/cjs/ui/Toolbar.js +2 -11
- package/dist/es2019/pm-plugins/commands.js +1 -1
- package/dist/es2019/ui/ConfirmationModal.js +1 -1
- package/dist/es2019/ui/Toolbar.js +2 -11
- package/dist/esm/pm-plugins/commands.js +1 -1
- package/dist/esm/ui/ConfirmationModal.js +1 -1
- package/dist/esm/ui/Toolbar.js +2 -11
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-floating-toolbar
|
|
2
2
|
|
|
3
|
+
## 18.0.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`c4385174a8662`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c4385174a8662) -
|
|
8
|
+
Clean up experiment `editor_a11y_role_textbox`.
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 18.0.7
|
|
4
12
|
|
|
5
13
|
### 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
|
|
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,
|
|
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/
|
|
28
|
+
// eslint-disable-next-line @typescript-eslint/no-restricted-types
|
|
29
29
|
var ConfirmationModal = exports.ConfirmationModal = (0, _reactIntl.injectIntl)(ConfirmationModalImpl);
|
package/dist/cjs/ui/Toolbar.js
CHANGED
|
@@ -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
|
-
},
|
|
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/
|
|
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/
|
|
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/
|
|
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
|
-
},
|
|
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/
|
|
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/
|
|
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/
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-restricted-types
|
|
22
22
|
export var ConfirmationModal = injectIntl(ConfirmationModalImpl);
|
package/dist/esm/ui/Toolbar.js
CHANGED
|
@@ -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
|
-
},
|
|
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/
|
|
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.
|
|
3
|
+
"version": "18.0.8",
|
|
4
4
|
"description": "Floating toolbar plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@atlaskit/platform-feature-flags": "^2.1.0",
|
|
44
44
|
"@atlaskit/primitives": "^22.4.0",
|
|
45
45
|
"@atlaskit/select": "^22.10.0",
|
|
46
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
46
|
+
"@atlaskit/tmp-editor-statsig": "^168.0.0",
|
|
47
47
|
"@atlaskit/tokens": "^16.9.0",
|
|
48
48
|
"@atlaskit/tooltip": "^24.2.0",
|
|
49
49
|
"@babel/runtime": "^7.0.0",
|