@atlaskit/editor-plugin-floating-toolbar 4.0.0 → 4.0.3
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 +31 -0
- package/dist/cjs/floatingToolbarPlugin.js +10 -2
- package/dist/cjs/ui/CheckboxModal.js +3 -3
- package/dist/cjs/ui/ExpandButton.js +2 -2
- package/dist/cjs/ui/SimpleModal.js +2 -2
- package/dist/cjs/ui/Toolbar.js +4 -4
- package/dist/es2019/floatingToolbarPlugin.js +10 -2
- package/dist/es2019/ui/CheckboxModal.js +1 -1
- package/dist/es2019/ui/ExpandButton.js +1 -1
- package/dist/es2019/ui/SimpleModal.js +1 -1
- package/dist/es2019/ui/Toolbar.js +4 -4
- package/dist/esm/floatingToolbarPlugin.js +10 -2
- package/dist/esm/ui/CheckboxModal.js +1 -1
- package/dist/esm/ui/ExpandButton.js +1 -1
- package/dist/esm/ui/SimpleModal.js +1 -1
- package/dist/esm/ui/Toolbar.js +4 -4
- package/dist/types/floatingToolbarPluginType.d.ts +3 -1
- package/dist/types-ts4.5/floatingToolbarPluginType.d.ts +3 -1
- package/package.json +5 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-floating-toolbar
|
|
2
2
|
|
|
3
|
+
## 4.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#142352](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/142352)
|
|
8
|
+
[`05903fde6d94d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/05903fde6d94d) -
|
|
9
|
+
Internal change to use Compiled variant of `@atlaskit/primitives`.
|
|
10
|
+
- [#141455](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/141455)
|
|
11
|
+
[`8a8bd624345b5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8a8bd624345b5) -
|
|
12
|
+
[ED-27542] Clean up platform_editor_controls_patch_2 used for floating toolbar scroll left/right
|
|
13
|
+
buttons
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
16
|
+
## 4.0.2
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- [#143960](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/143960)
|
|
21
|
+
[`e1bf8964b3cf8`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e1bf8964b3cf8) -
|
|
22
|
+
Adding press interaction performance tracking to Comment action in floating toolbar. No UI change.
|
|
23
|
+
- Updated dependencies
|
|
24
|
+
|
|
25
|
+
## 4.0.1
|
|
26
|
+
|
|
27
|
+
### Patch Changes
|
|
28
|
+
|
|
29
|
+
- [#140969](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/140969)
|
|
30
|
+
[`b4ac22e73d43c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b4ac22e73d43c) -
|
|
31
|
+
[ux] [ED-27253] hide selection states until editor has been interacted with
|
|
32
|
+
- Updated dependencies
|
|
33
|
+
|
|
3
34
|
## 4.0.0
|
|
4
35
|
|
|
5
36
|
### Major Changes
|
|
@@ -174,11 +174,19 @@ var floatingToolbarPlugin = exports.floatingToolbarPlugin = function floatingToo
|
|
|
174
174
|
}
|
|
175
175
|
},
|
|
176
176
|
getSharedState: function getSharedState(editorState) {
|
|
177
|
-
var
|
|
177
|
+
var _api$interaction;
|
|
178
178
|
if (!editorState) {
|
|
179
179
|
return undefined;
|
|
180
180
|
}
|
|
181
|
-
var
|
|
181
|
+
var hasHadInteraction = api === null || api === void 0 || (_api$interaction = api.interaction) === null || _api$interaction === void 0 || (_api$interaction = _api$interaction.sharedState.currentState()) === null || _api$interaction === void 0 ? void 0 : _api$interaction.hasHadInteraction;
|
|
182
|
+
var configWithNodeInfo;
|
|
183
|
+
if ((0, _platformFeatureFlags.fg)('platform_editor_no_selection_until_interaction')) {
|
|
184
|
+
var _pluginKey$getState$g, _pluginKey$getState, _pluginKey$getState$g2;
|
|
185
|
+
configWithNodeInfo = hasHadInteraction !== false ? (_pluginKey$getState$g = (_pluginKey$getState = pluginKey.getState(editorState)) === null || _pluginKey$getState === void 0 || (_pluginKey$getState$g2 = _pluginKey$getState.getConfigWithNodeInfo) === null || _pluginKey$getState$g2 === void 0 ? void 0 : _pluginKey$getState$g2.call(_pluginKey$getState, editorState)) !== null && _pluginKey$getState$g !== void 0 ? _pluginKey$getState$g : undefined : undefined;
|
|
186
|
+
} else {
|
|
187
|
+
var _pluginKey$getState$g3, _pluginKey$getState2, _pluginKey$getState2$;
|
|
188
|
+
configWithNodeInfo = (_pluginKey$getState$g3 = (_pluginKey$getState2 = pluginKey.getState(editorState)) === null || _pluginKey$getState2 === void 0 || (_pluginKey$getState2$ = _pluginKey$getState2.getConfigWithNodeInfo) === null || _pluginKey$getState2$ === void 0 ? void 0 : _pluginKey$getState2$.call(_pluginKey$getState2, editorState)) !== null && _pluginKey$getState$g3 !== void 0 ? _pluginKey$getState$g3 : undefined;
|
|
189
|
+
}
|
|
182
190
|
return {
|
|
183
191
|
configWithNodeInfo: configWithNodeInfo,
|
|
184
192
|
floatingToolbarData: _pluginKey.pluginKey.getState(editorState)
|
|
@@ -13,7 +13,7 @@ var _new = _interopRequireDefault(require("@atlaskit/button/new"));
|
|
|
13
13
|
var _checkbox = require("@atlaskit/checkbox");
|
|
14
14
|
var _floatingToolbar = require("@atlaskit/editor-common/floating-toolbar");
|
|
15
15
|
var _modalDialog = _interopRequireWildcard(require("@atlaskit/modal-dialog"));
|
|
16
|
-
var
|
|
16
|
+
var _compiled = require("@atlaskit/primitives/compiled");
|
|
17
17
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
18
18
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
19
19
|
var CheckboxModal = exports.CheckboxModal = function CheckboxModal(props) {
|
|
@@ -64,11 +64,11 @@ var CheckboxModal = exports.CheckboxModal = function CheckboxModal(props) {
|
|
|
64
64
|
testId: testId
|
|
65
65
|
}, /*#__PURE__*/_react.default.createElement(_modalDialog.ModalHeader, null, /*#__PURE__*/_react.default.createElement(_modalDialog.ModalTitle, {
|
|
66
66
|
appearance: "warning"
|
|
67
|
-
}, heading)), /*#__PURE__*/_react.default.createElement(_modalDialog.ModalBody, null, /*#__PURE__*/_react.default.createElement(
|
|
67
|
+
}, heading)), /*#__PURE__*/_react.default.createElement(_modalDialog.ModalBody, null, /*#__PURE__*/_react.default.createElement(_compiled.Text, {
|
|
68
68
|
as: "p"
|
|
69
69
|
}, options === null || options === void 0 ? void 0 : options.message), !!(childrenInfo !== null && childrenInfo !== void 0 && childrenInfo.length) && /*#__PURE__*/_react.default.createElement(ListComponent, {
|
|
70
70
|
nodes: childrenInfo
|
|
71
|
-
}), /*#__PURE__*/_react.default.createElement(
|
|
71
|
+
}), /*#__PURE__*/_react.default.createElement(_compiled.Text, {
|
|
72
72
|
as: "p"
|
|
73
73
|
}, /*#__PURE__*/_react.default.createElement(_checkbox.Checkbox, {
|
|
74
74
|
isChecked: isChecked,
|
|
@@ -7,9 +7,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.ExpandButton = ExpandButton;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _chevronRight = _interopRequireDefault(require("@atlaskit/icon/utility/chevron-right"));
|
|
10
|
-
var
|
|
10
|
+
var _compiled = require("@atlaskit/primitives/compiled");
|
|
11
11
|
function ExpandButton() {
|
|
12
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
12
|
+
return /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
13
13
|
paddingInline: "space.075"
|
|
14
14
|
}, /*#__PURE__*/_react.default.createElement(_chevronRight.default, {
|
|
15
15
|
label: 'Edit'
|
|
@@ -10,7 +10,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
10
10
|
var _new = _interopRequireDefault(require("@atlaskit/button/new"));
|
|
11
11
|
var _floatingToolbar = require("@atlaskit/editor-common/floating-toolbar");
|
|
12
12
|
var _modalDialog = _interopRequireWildcard(require("@atlaskit/modal-dialog"));
|
|
13
|
-
var
|
|
13
|
+
var _compiled = require("@atlaskit/primitives/compiled");
|
|
14
14
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
15
15
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
16
16
|
var SimpleModal = exports.SimpleModal = function SimpleModal(props) {
|
|
@@ -27,7 +27,7 @@ var SimpleModal = exports.SimpleModal = function SimpleModal(props) {
|
|
|
27
27
|
testId: testId
|
|
28
28
|
}, /*#__PURE__*/_react.default.createElement(_modalDialog.ModalHeader, null, /*#__PURE__*/_react.default.createElement(_modalDialog.ModalTitle, {
|
|
29
29
|
appearance: "warning"
|
|
30
|
-
}, heading)), /*#__PURE__*/_react.default.createElement(_modalDialog.ModalBody, null, /*#__PURE__*/_react.default.createElement(
|
|
30
|
+
}, heading)), /*#__PURE__*/_react.default.createElement(_modalDialog.ModalBody, null, /*#__PURE__*/_react.default.createElement(_compiled.Text, {
|
|
31
31
|
as: "p"
|
|
32
32
|
}, options === null || options === void 0 ? void 0 : options.message)), /*#__PURE__*/_react.default.createElement(_modalDialog.ModalFooter, null, /*#__PURE__*/_react.default.createElement(_new.default, {
|
|
33
33
|
appearance: "default",
|
package/dist/cjs/ui/Toolbar.js
CHANGED
|
@@ -166,7 +166,8 @@ var ToolbarItems = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
166
166
|
tabIndex: item.tabIndex,
|
|
167
167
|
isRadioButton: item.isRadioButton,
|
|
168
168
|
pulse: item.pulse,
|
|
169
|
-
spotlightConfig: item.spotlightConfig
|
|
169
|
+
spotlightConfig: item.spotlightConfig,
|
|
170
|
+
interactionName: item.interactionName
|
|
170
171
|
}, item.showTitle && item.title);
|
|
171
172
|
case 'input':
|
|
172
173
|
return (0, _react2.jsx)(_Input.Input, {
|
|
@@ -650,7 +651,6 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
650
651
|
scrollable = _this$props2.scrollable,
|
|
651
652
|
mediaAssistiveMessage = _this$props2.mediaAssistiveMessage;
|
|
652
653
|
var isEditorControlsEnabled = (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1');
|
|
653
|
-
var isEditorControlsPatch2Enabled = isEditorControlsEnabled && (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_2');
|
|
654
654
|
if (!items || !items.length) {
|
|
655
655
|
return null;
|
|
656
656
|
}
|
|
@@ -686,7 +686,7 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
686
686
|
}, (0, _react2.jsx)(_ui.Announcer, {
|
|
687
687
|
text: mediaAssistiveMessage ? "".concat(mediaAssistiveMessage, ", ").concat(intl.formatMessage(_floatingToolbar.messages.floatingToolbarAnnouncer)) : intl.formatMessage(_floatingToolbar.messages.floatingToolbarAnnouncer),
|
|
688
688
|
delay: 250
|
|
689
|
-
}), scrollable &&
|
|
689
|
+
}), scrollable && isEditorControlsEnabled && (0, _react2.jsx)(_ScrollButton.ScrollButton, {
|
|
690
690
|
intl: intl,
|
|
691
691
|
scrollContainerRef: this.scrollContainerRef,
|
|
692
692
|
node: node,
|
|
@@ -711,7 +711,7 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
711
711
|
setDisableScroll: this.setDisableScroll.bind(this),
|
|
712
712
|
mountRef: this.mountRef,
|
|
713
713
|
mounted: this.state.mounted
|
|
714
|
-
}))), scrollable && (
|
|
714
|
+
}))), scrollable && (isEditorControlsEnabled ? (0, _react2.jsx)(_ScrollButton.ScrollButton, {
|
|
715
715
|
intl: intl,
|
|
716
716
|
scrollContainerRef: this.scrollContainerRef,
|
|
717
717
|
node: node,
|
|
@@ -154,11 +154,19 @@ export const floatingToolbarPlugin = ({
|
|
|
154
154
|
copyNode: nodeType => copyNode(nodeType)
|
|
155
155
|
},
|
|
156
156
|
getSharedState(editorState) {
|
|
157
|
-
var
|
|
157
|
+
var _api$interaction, _api$interaction$shar;
|
|
158
158
|
if (!editorState) {
|
|
159
159
|
return undefined;
|
|
160
160
|
}
|
|
161
|
-
const
|
|
161
|
+
const hasHadInteraction = api === null || api === void 0 ? void 0 : (_api$interaction = api.interaction) === null || _api$interaction === void 0 ? void 0 : (_api$interaction$shar = _api$interaction.sharedState.currentState()) === null || _api$interaction$shar === void 0 ? void 0 : _api$interaction$shar.hasHadInteraction;
|
|
162
|
+
let configWithNodeInfo;
|
|
163
|
+
if (fg('platform_editor_no_selection_until_interaction')) {
|
|
164
|
+
var _pluginKey$getState$g, _pluginKey$getState, _pluginKey$getState$g2;
|
|
165
|
+
configWithNodeInfo = hasHadInteraction !== false ? (_pluginKey$getState$g = (_pluginKey$getState = pluginKey.getState(editorState)) === null || _pluginKey$getState === void 0 ? void 0 : (_pluginKey$getState$g2 = _pluginKey$getState.getConfigWithNodeInfo) === null || _pluginKey$getState$g2 === void 0 ? void 0 : _pluginKey$getState$g2.call(_pluginKey$getState, editorState)) !== null && _pluginKey$getState$g !== void 0 ? _pluginKey$getState$g : undefined : undefined;
|
|
166
|
+
} else {
|
|
167
|
+
var _pluginKey$getState$g3, _pluginKey$getState2, _pluginKey$getState2$;
|
|
168
|
+
configWithNodeInfo = (_pluginKey$getState$g3 = (_pluginKey$getState2 = pluginKey.getState(editorState)) === null || _pluginKey$getState2 === void 0 ? void 0 : (_pluginKey$getState2$ = _pluginKey$getState2.getConfigWithNodeInfo) === null || _pluginKey$getState2$ === void 0 ? void 0 : _pluginKey$getState2$.call(_pluginKey$getState2, editorState)) !== null && _pluginKey$getState$g3 !== void 0 ? _pluginKey$getState$g3 : undefined;
|
|
169
|
+
}
|
|
162
170
|
return {
|
|
163
171
|
configWithNodeInfo,
|
|
164
172
|
floatingToolbarData: dataPluginKey.getState(editorState)
|
|
@@ -4,7 +4,7 @@ import Button from '@atlaskit/button/new';
|
|
|
4
4
|
import { Checkbox } from '@atlaskit/checkbox';
|
|
5
5
|
import { messages } from '@atlaskit/editor-common/floating-toolbar';
|
|
6
6
|
import Modal, { ModalBody, ModalFooter, ModalHeader, ModalTitle } from '@atlaskit/modal-dialog';
|
|
7
|
-
import { Text } from '@atlaskit/primitives';
|
|
7
|
+
import { Text } from '@atlaskit/primitives/compiled';
|
|
8
8
|
export const CheckboxModal = props => {
|
|
9
9
|
var _options$getChildrenI;
|
|
10
10
|
const [isChecked, setCheckbox] = useState(false);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Icon from '@atlaskit/icon/utility/chevron-right';
|
|
3
|
-
import { Box } from '@atlaskit/primitives';
|
|
3
|
+
import { Box } from '@atlaskit/primitives/compiled';
|
|
4
4
|
export function ExpandButton() {
|
|
5
5
|
return /*#__PURE__*/React.createElement(Box, {
|
|
6
6
|
paddingInline: "space.075"
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import Button from '@atlaskit/button/new';
|
|
3
3
|
import { messages } from '@atlaskit/editor-common/floating-toolbar';
|
|
4
4
|
import Modal, { ModalBody, ModalFooter, ModalHeader, ModalTitle } from '@atlaskit/modal-dialog';
|
|
5
|
-
import { Text } from '@atlaskit/primitives';
|
|
5
|
+
import { Text } from '@atlaskit/primitives/compiled';
|
|
6
6
|
export const SimpleModal = props => {
|
|
7
7
|
const {
|
|
8
8
|
onConfirm,
|
|
@@ -147,7 +147,8 @@ const ToolbarItems = /*#__PURE__*/React.memo(({
|
|
|
147
147
|
tabIndex: item.tabIndex,
|
|
148
148
|
isRadioButton: item.isRadioButton,
|
|
149
149
|
pulse: item.pulse,
|
|
150
|
-
spotlightConfig: item.spotlightConfig
|
|
150
|
+
spotlightConfig: item.spotlightConfig,
|
|
151
|
+
interactionName: item.interactionName
|
|
151
152
|
}, item.showTitle && item.title);
|
|
152
153
|
case 'input':
|
|
153
154
|
return jsx(Input, {
|
|
@@ -604,7 +605,6 @@ class Toolbar extends Component {
|
|
|
604
605
|
mediaAssistiveMessage
|
|
605
606
|
} = this.props;
|
|
606
607
|
const isEditorControlsEnabled = editorExperiment('platform_editor_controls', 'variant1');
|
|
607
|
-
const isEditorControlsPatch2Enabled = isEditorControlsEnabled && fg('platform_editor_controls_patch_2');
|
|
608
608
|
if (!items || !items.length) {
|
|
609
609
|
return null;
|
|
610
610
|
}
|
|
@@ -636,7 +636,7 @@ class Toolbar extends Component {
|
|
|
636
636
|
}, jsx(Announcer, {
|
|
637
637
|
text: mediaAssistiveMessage ? `${mediaAssistiveMessage}, ${intl.formatMessage(messages.floatingToolbarAnnouncer)}` : intl.formatMessage(messages.floatingToolbarAnnouncer),
|
|
638
638
|
delay: 250
|
|
639
|
-
}), scrollable &&
|
|
639
|
+
}), scrollable && isEditorControlsEnabled && jsx(ScrollButton, {
|
|
640
640
|
intl: intl,
|
|
641
641
|
scrollContainerRef: this.scrollContainerRef,
|
|
642
642
|
node: node,
|
|
@@ -661,7 +661,7 @@ class Toolbar extends Component {
|
|
|
661
661
|
setDisableScroll: this.setDisableScroll.bind(this),
|
|
662
662
|
mountRef: this.mountRef,
|
|
663
663
|
mounted: this.state.mounted
|
|
664
|
-
}))), scrollable && (
|
|
664
|
+
}))), scrollable && (isEditorControlsEnabled ? jsx(ScrollButton, {
|
|
665
665
|
intl: intl,
|
|
666
666
|
scrollContainerRef: this.scrollContainerRef,
|
|
667
667
|
node: node,
|
|
@@ -162,11 +162,19 @@ export var floatingToolbarPlugin = function floatingToolbarPlugin(_ref) {
|
|
|
162
162
|
}
|
|
163
163
|
},
|
|
164
164
|
getSharedState: function getSharedState(editorState) {
|
|
165
|
-
var
|
|
165
|
+
var _api$interaction;
|
|
166
166
|
if (!editorState) {
|
|
167
167
|
return undefined;
|
|
168
168
|
}
|
|
169
|
-
var
|
|
169
|
+
var hasHadInteraction = api === null || api === void 0 || (_api$interaction = api.interaction) === null || _api$interaction === void 0 || (_api$interaction = _api$interaction.sharedState.currentState()) === null || _api$interaction === void 0 ? void 0 : _api$interaction.hasHadInteraction;
|
|
170
|
+
var configWithNodeInfo;
|
|
171
|
+
if (fg('platform_editor_no_selection_until_interaction')) {
|
|
172
|
+
var _pluginKey$getState$g, _pluginKey$getState, _pluginKey$getState$g2;
|
|
173
|
+
configWithNodeInfo = hasHadInteraction !== false ? (_pluginKey$getState$g = (_pluginKey$getState = pluginKey.getState(editorState)) === null || _pluginKey$getState === void 0 || (_pluginKey$getState$g2 = _pluginKey$getState.getConfigWithNodeInfo) === null || _pluginKey$getState$g2 === void 0 ? void 0 : _pluginKey$getState$g2.call(_pluginKey$getState, editorState)) !== null && _pluginKey$getState$g !== void 0 ? _pluginKey$getState$g : undefined : undefined;
|
|
174
|
+
} else {
|
|
175
|
+
var _pluginKey$getState$g3, _pluginKey$getState2, _pluginKey$getState2$;
|
|
176
|
+
configWithNodeInfo = (_pluginKey$getState$g3 = (_pluginKey$getState2 = pluginKey.getState(editorState)) === null || _pluginKey$getState2 === void 0 || (_pluginKey$getState2$ = _pluginKey$getState2.getConfigWithNodeInfo) === null || _pluginKey$getState2$ === void 0 ? void 0 : _pluginKey$getState2$.call(_pluginKey$getState2, editorState)) !== null && _pluginKey$getState$g3 !== void 0 ? _pluginKey$getState$g3 : undefined;
|
|
177
|
+
}
|
|
170
178
|
return {
|
|
171
179
|
configWithNodeInfo: configWithNodeInfo,
|
|
172
180
|
floatingToolbarData: dataPluginKey.getState(editorState)
|
|
@@ -5,7 +5,7 @@ import Button from '@atlaskit/button/new';
|
|
|
5
5
|
import { Checkbox } from '@atlaskit/checkbox';
|
|
6
6
|
import { messages } from '@atlaskit/editor-common/floating-toolbar';
|
|
7
7
|
import Modal, { ModalBody, ModalFooter, ModalHeader, ModalTitle } from '@atlaskit/modal-dialog';
|
|
8
|
-
import { Text } from '@atlaskit/primitives';
|
|
8
|
+
import { Text } from '@atlaskit/primitives/compiled';
|
|
9
9
|
export var CheckboxModal = function CheckboxModal(props) {
|
|
10
10
|
var _options$getChildrenI;
|
|
11
11
|
var _useState = useState(false),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Icon from '@atlaskit/icon/utility/chevron-right';
|
|
3
|
-
import { Box } from '@atlaskit/primitives';
|
|
3
|
+
import { Box } from '@atlaskit/primitives/compiled';
|
|
4
4
|
export function ExpandButton() {
|
|
5
5
|
return /*#__PURE__*/React.createElement(Box, {
|
|
6
6
|
paddingInline: "space.075"
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import Button from '@atlaskit/button/new';
|
|
3
3
|
import { messages } from '@atlaskit/editor-common/floating-toolbar';
|
|
4
4
|
import Modal, { ModalBody, ModalFooter, ModalHeader, ModalTitle } from '@atlaskit/modal-dialog';
|
|
5
|
-
import { Text } from '@atlaskit/primitives';
|
|
5
|
+
import { Text } from '@atlaskit/primitives/compiled';
|
|
6
6
|
export var SimpleModal = function SimpleModal(props) {
|
|
7
7
|
var onConfirm = props.onConfirm,
|
|
8
8
|
onClose = props.onClose,
|
package/dist/esm/ui/Toolbar.js
CHANGED
|
@@ -159,7 +159,8 @@ var ToolbarItems = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
159
159
|
tabIndex: item.tabIndex,
|
|
160
160
|
isRadioButton: item.isRadioButton,
|
|
161
161
|
pulse: item.pulse,
|
|
162
|
-
spotlightConfig: item.spotlightConfig
|
|
162
|
+
spotlightConfig: item.spotlightConfig,
|
|
163
|
+
interactionName: item.interactionName
|
|
163
164
|
}, item.showTitle && item.title);
|
|
164
165
|
case 'input':
|
|
165
166
|
return jsx(Input, {
|
|
@@ -643,7 +644,6 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
643
644
|
scrollable = _this$props2.scrollable,
|
|
644
645
|
mediaAssistiveMessage = _this$props2.mediaAssistiveMessage;
|
|
645
646
|
var isEditorControlsEnabled = editorExperiment('platform_editor_controls', 'variant1');
|
|
646
|
-
var isEditorControlsPatch2Enabled = isEditorControlsEnabled && fg('platform_editor_controls_patch_2');
|
|
647
647
|
if (!items || !items.length) {
|
|
648
648
|
return null;
|
|
649
649
|
}
|
|
@@ -679,7 +679,7 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
679
679
|
}, jsx(Announcer, {
|
|
680
680
|
text: mediaAssistiveMessage ? "".concat(mediaAssistiveMessage, ", ").concat(intl.formatMessage(messages.floatingToolbarAnnouncer)) : intl.formatMessage(messages.floatingToolbarAnnouncer),
|
|
681
681
|
delay: 250
|
|
682
|
-
}), scrollable &&
|
|
682
|
+
}), scrollable && isEditorControlsEnabled && jsx(ScrollButton, {
|
|
683
683
|
intl: intl,
|
|
684
684
|
scrollContainerRef: this.scrollContainerRef,
|
|
685
685
|
node: node,
|
|
@@ -704,7 +704,7 @@ var Toolbar = /*#__PURE__*/function (_Component) {
|
|
|
704
704
|
setDisableScroll: this.setDisableScroll.bind(this),
|
|
705
705
|
mountRef: this.mountRef,
|
|
706
706
|
mounted: this.state.mounted
|
|
707
|
-
}))), scrollable && (
|
|
707
|
+
}))), scrollable && (isEditorControlsEnabled ? jsx(ScrollButton, {
|
|
708
708
|
intl: intl,
|
|
709
709
|
scrollContainerRef: this.scrollContainerRef,
|
|
710
710
|
node: node,
|
|
@@ -7,6 +7,7 @@ import type { EditorViewModePlugin } from '@atlaskit/editor-plugin-editor-viewmo
|
|
|
7
7
|
import type { EmojiPlugin } from '@atlaskit/editor-plugin-emoji';
|
|
8
8
|
import type { ExtensionPlugin } from '@atlaskit/editor-plugin-extension';
|
|
9
9
|
import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
10
|
+
import type { InteractionPlugin } from '@atlaskit/editor-plugin-interaction';
|
|
10
11
|
import type { UserIntentPlugin } from '@atlaskit/editor-plugin-user-intent';
|
|
11
12
|
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
12
13
|
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
@@ -35,7 +36,8 @@ export type FloatingToolbarPluginDependencies = [
|
|
|
35
36
|
OptionalPlugin<EditorViewModePlugin>,
|
|
36
37
|
OptionalPlugin<FeatureFlagsPlugin>,
|
|
37
38
|
OptionalPlugin<EmojiPlugin>,
|
|
38
|
-
OptionalPlugin<UserIntentPlugin
|
|
39
|
+
OptionalPlugin<UserIntentPlugin>,
|
|
40
|
+
OptionalPlugin<InteractionPlugin>
|
|
39
41
|
];
|
|
40
42
|
export type FloatingToolbarPlugin = NextEditorPlugin<'floatingToolbar', {
|
|
41
43
|
dependencies: FloatingToolbarPluginDependencies;
|
|
@@ -7,6 +7,7 @@ import type { EditorViewModePlugin } from '@atlaskit/editor-plugin-editor-viewmo
|
|
|
7
7
|
import type { EmojiPlugin } from '@atlaskit/editor-plugin-emoji';
|
|
8
8
|
import type { ExtensionPlugin } from '@atlaskit/editor-plugin-extension';
|
|
9
9
|
import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
10
|
+
import type { InteractionPlugin } from '@atlaskit/editor-plugin-interaction';
|
|
10
11
|
import type { UserIntentPlugin } from '@atlaskit/editor-plugin-user-intent';
|
|
11
12
|
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
12
13
|
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
@@ -35,7 +36,8 @@ export type FloatingToolbarPluginDependencies = [
|
|
|
35
36
|
OptionalPlugin<EditorViewModePlugin>,
|
|
36
37
|
OptionalPlugin<FeatureFlagsPlugin>,
|
|
37
38
|
OptionalPlugin<EmojiPlugin>,
|
|
38
|
-
OptionalPlugin<UserIntentPlugin
|
|
39
|
+
OptionalPlugin<UserIntentPlugin>,
|
|
40
|
+
OptionalPlugin<InteractionPlugin>
|
|
39
41
|
];
|
|
40
42
|
export type FloatingToolbarPlugin = NextEditorPlugin<'floatingToolbar', {
|
|
41
43
|
dependencies: FloatingToolbarPluginDependencies;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-floating-toolbar",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.3",
|
|
4
4
|
"description": "Floating toolbar plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@atlaskit/adf-utils": "^19.19.0",
|
|
29
29
|
"@atlaskit/button": "^23.0.0",
|
|
30
30
|
"@atlaskit/checkbox": "^17.0.0",
|
|
31
|
-
"@atlaskit/editor-common": "^103.
|
|
31
|
+
"@atlaskit/editor-common": "^103.12.0",
|
|
32
32
|
"@atlaskit/editor-palette": "^2.1.0",
|
|
33
33
|
"@atlaskit/editor-plugin-context-panel": "^4.0.0",
|
|
34
34
|
"@atlaskit/editor-plugin-copy-button": "^2.0.0",
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"@atlaskit/editor-plugin-editor-viewmode": "^3.1.0",
|
|
38
38
|
"@atlaskit/editor-plugin-emoji": "^3.6.0",
|
|
39
39
|
"@atlaskit/editor-plugin-extension": "^5.2.0",
|
|
40
|
+
"@atlaskit/editor-plugin-interaction": "^1.0.0",
|
|
40
41
|
"@atlaskit/editor-plugin-table": "^10.8.0",
|
|
41
42
|
"@atlaskit/editor-plugin-user-intent": "^0.1.0",
|
|
42
43
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
@@ -132,10 +133,10 @@
|
|
|
132
133
|
"platform_editor_fix_floating_toolbar_scrollbar": {
|
|
133
134
|
"type": "boolean"
|
|
134
135
|
},
|
|
135
|
-
"
|
|
136
|
+
"platform_editor_controls_patch_4": {
|
|
136
137
|
"type": "boolean"
|
|
137
138
|
},
|
|
138
|
-
"
|
|
139
|
+
"platform_editor_no_selection_until_interaction": {
|
|
139
140
|
"type": "boolean"
|
|
140
141
|
},
|
|
141
142
|
"platform_editor_user_intent_plugin": {
|