@atlaskit/editor-plugin-toolbar 0.2.2 → 0.2.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 +6 -0
- package/afm-cc/tsconfig.json +3 -0
- package/afm-dev-agents/tsconfig.json +3 -0
- package/afm-jira/tsconfig.json +3 -0
- package/afm-passionfruit/tsconfig.json +3 -0
- package/afm-post-office/tsconfig.json +3 -0
- package/afm-rovo-extension/tsconfig.json +3 -0
- package/afm-townsquare/tsconfig.json +3 -0
- package/dist/cjs/ui/SelectionToolbar/index.js +3 -1
- package/dist/es2019/ui/SelectionToolbar/index.js +3 -1
- package/dist/esm/ui/SelectionToolbar/index.js +3 -1
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
package/afm-cc/tsconfig.json
CHANGED
package/afm-jira/tsconfig.json
CHANGED
|
@@ -15,6 +15,7 @@ var _state = require("@atlaskit/editor-prosemirror/state");
|
|
|
15
15
|
var _utils2 = require("@atlaskit/editor-prosemirror/utils");
|
|
16
16
|
var _editorToolbar = require("@atlaskit/editor-toolbar");
|
|
17
17
|
var _editorToolbarModel = require("@atlaskit/editor-toolbar-model");
|
|
18
|
+
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
18
19
|
var _consts = require("../consts");
|
|
19
20
|
var isToolbarComponent = function isToolbarComponent(component) {
|
|
20
21
|
return component.type === 'toolbar' && component.key === 'inline-text-toolbar';
|
|
@@ -32,10 +33,11 @@ var SelectionToolbar = exports.SelectionToolbar = function SelectionToolbar(_ref
|
|
|
32
33
|
// @ts-expect-error
|
|
33
34
|
var selection = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'selection.selection');
|
|
34
35
|
var isTextSelection = !editorView.state.selection.empty && editorView.state.selection instanceof _state.TextSelection;
|
|
36
|
+
var isCellSelection = !editorView.state.selection.empty && '$anchorCell' in editorView.state.selection;
|
|
35
37
|
if (!components || !toolbar) {
|
|
36
38
|
return null;
|
|
37
39
|
}
|
|
38
|
-
if (!isTextSelection || currentUserIntent === 'dragging' || (0, _coreUtils.isSSR)()) {
|
|
40
|
+
if (!(isTextSelection || isCellSelection) || currentUserIntent === 'dragging' || currentUserIntent === 'blockMenuOpen' && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu', 'isEnabled', true) || (0, _coreUtils.isSSR)()) {
|
|
39
41
|
return null;
|
|
40
42
|
}
|
|
41
43
|
return /*#__PURE__*/_react.default.createElement(_ui.Popup, {
|
|
@@ -8,6 +8,7 @@ import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
|
8
8
|
import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
9
9
|
import { ToolbarSection, ToolbarButtonGroup, ToolbarDropdownItemSection } from '@atlaskit/editor-toolbar';
|
|
10
10
|
import { ToolbarModelRenderer } from '@atlaskit/editor-toolbar-model';
|
|
11
|
+
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
11
12
|
import { TOOLBAR_LABEL } from '../consts';
|
|
12
13
|
const isToolbarComponent = component => {
|
|
13
14
|
return component.type === 'toolbar' && component.key === 'inline-text-toolbar';
|
|
@@ -24,10 +25,11 @@ export const SelectionToolbar = ({
|
|
|
24
25
|
// @ts-expect-error
|
|
25
26
|
const selection = useSharedPluginStateSelector(api, 'selection.selection');
|
|
26
27
|
const isTextSelection = !editorView.state.selection.empty && editorView.state.selection instanceof TextSelection;
|
|
28
|
+
const isCellSelection = !editorView.state.selection.empty && '$anchorCell' in editorView.state.selection;
|
|
27
29
|
if (!components || !toolbar) {
|
|
28
30
|
return null;
|
|
29
31
|
}
|
|
30
|
-
if (!isTextSelection || currentUserIntent === 'dragging' || isSSR()) {
|
|
32
|
+
if (!(isTextSelection || isCellSelection) || currentUserIntent === 'dragging' || currentUserIntent === 'blockMenuOpen' && expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true) || isSSR()) {
|
|
31
33
|
return null;
|
|
32
34
|
}
|
|
33
35
|
return /*#__PURE__*/React.createElement(Popup, {
|
|
@@ -8,6 +8,7 @@ import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
|
8
8
|
import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
9
9
|
import { ToolbarSection, ToolbarButtonGroup, ToolbarDropdownItemSection } from '@atlaskit/editor-toolbar';
|
|
10
10
|
import { ToolbarModelRenderer } from '@atlaskit/editor-toolbar-model';
|
|
11
|
+
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
11
12
|
import { TOOLBAR_LABEL } from '../consts';
|
|
12
13
|
var isToolbarComponent = function isToolbarComponent(component) {
|
|
13
14
|
return component.type === 'toolbar' && component.key === 'inline-text-toolbar';
|
|
@@ -25,10 +26,11 @@ export var SelectionToolbar = function SelectionToolbar(_ref) {
|
|
|
25
26
|
// @ts-expect-error
|
|
26
27
|
var selection = useSharedPluginStateSelector(api, 'selection.selection');
|
|
27
28
|
var isTextSelection = !editorView.state.selection.empty && editorView.state.selection instanceof TextSelection;
|
|
29
|
+
var isCellSelection = !editorView.state.selection.empty && '$anchorCell' in editorView.state.selection;
|
|
28
30
|
if (!components || !toolbar) {
|
|
29
31
|
return null;
|
|
30
32
|
}
|
|
31
|
-
if (!isTextSelection || currentUserIntent === 'dragging' || isSSR()) {
|
|
33
|
+
if (!(isTextSelection || isCellSelection) || currentUserIntent === 'dragging' || currentUserIntent === 'blockMenuOpen' && expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true) || isSSR()) {
|
|
32
34
|
return null;
|
|
33
35
|
}
|
|
34
36
|
return /*#__PURE__*/React.createElement(Popup, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-toolbar",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "Toolbar plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -38,11 +38,12 @@
|
|
|
38
38
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
39
39
|
"@atlaskit/editor-toolbar": "^0.3.0",
|
|
40
40
|
"@atlaskit/editor-toolbar-model": "^0.1.0",
|
|
41
|
+
"@atlaskit/tmp-editor-statsig": "^11.0.0",
|
|
41
42
|
"@babel/runtime": "^7.0.0",
|
|
42
43
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
43
44
|
},
|
|
44
45
|
"peerDependencies": {
|
|
45
|
-
"@atlaskit/editor-common": "^107.
|
|
46
|
+
"@atlaskit/editor-common": "^107.25.0",
|
|
46
47
|
"react": "^18.2.0"
|
|
47
48
|
},
|
|
48
49
|
"techstack": {
|