@atlaskit/editor-plugin-floating-toolbar 1.14.16 → 1.14.18
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 +15 -0
- package/dist/cjs/ui/ExtensionsPlaceholder.js +8 -0
- package/dist/cjs/ui/Toolbar.js +2 -1
- package/dist/es2019/ui/ExtensionsPlaceholder.js +8 -0
- package/dist/es2019/ui/Toolbar.js +2 -1
- package/dist/esm/ui/ExtensionsPlaceholder.js +8 -0
- package/dist/esm/ui/Toolbar.js +2 -1
- package/dist/types/floatingToolbarPluginType.d.ts +12 -11
- package/dist/types-ts4.5/floatingToolbarPluginType.d.ts +12 -11
- package/package.json +14 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-floating-toolbar
|
|
2
2
|
|
|
3
|
+
## 1.14.18
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#100802](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/100802)
|
|
8
|
+
[`1506550eef60f`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/1506550eef60f) -
|
|
9
|
+
[ux] [ED-25647] this PR is disabling the confluence referentiality and charts extension from the
|
|
10
|
+
floating toolbar for tables nested in tables
|
|
11
|
+
|
|
12
|
+
## 1.14.17
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
3
18
|
## 1.14.16
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -13,8 +13,10 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
13
13
|
var _reactLoadable = _interopRequireDefault(require("react-loadable"));
|
|
14
14
|
var _buttonGroup = _interopRequireDefault(require("@atlaskit/button/button-group"));
|
|
15
15
|
var _extensions = require("@atlaskit/editor-common/extensions");
|
|
16
|
+
var _nesting = require("@atlaskit/editor-common/nesting");
|
|
16
17
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
17
18
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
19
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
18
20
|
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); }
|
|
19
21
|
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; }
|
|
20
22
|
var noop = function noop() {
|
|
@@ -177,9 +179,15 @@ var ExtensionsPlaceholder = exports.ExtensionsPlaceholder = function ExtensionsP
|
|
|
177
179
|
if (separator && ['start', 'both'].includes(separator)) {
|
|
178
180
|
children.push( /*#__PURE__*/_react.default.createElement(_ui.FloatingToolbarSeparator, null));
|
|
179
181
|
}
|
|
182
|
+
var isNestedTable = (0, _platformFeatureFlags.fg)('platform_editor_use_nested_table_pm_nodes') && (0, _nesting.isSelectionTableNestedInTable)(editorView.state);
|
|
183
|
+
|
|
180
184
|
// Ignored via go/ees005
|
|
181
185
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
182
186
|
extensionItems.forEach(function (item, index) {
|
|
187
|
+
// disable the referentiality and charts extensions for nested tables
|
|
188
|
+
if (isNestedTable && ['referentiality:connections', 'chart:insert-chart'].includes(item.key)) {
|
|
189
|
+
item.disabled = true;
|
|
190
|
+
}
|
|
183
191
|
children.push( /*#__PURE__*/_react.default.createElement(ExtensionButton, {
|
|
184
192
|
node: node,
|
|
185
193
|
item: item,
|
package/dist/cjs/ui/Toolbar.js
CHANGED
|
@@ -110,7 +110,7 @@ var ToolbarItems = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
|
110
110
|
if (selected) {
|
|
111
111
|
return "var(--ds-icon-selected, #0C66E4)";
|
|
112
112
|
}
|
|
113
|
-
return
|
|
113
|
+
return 'currentColor';
|
|
114
114
|
};
|
|
115
115
|
return (0, _react2.jsx)(_ui.FloatingToolbarButton
|
|
116
116
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
@@ -358,6 +358,7 @@ var toolbarContainer = function toolbarContainer(scrollable, hasSelect, firstEle
|
|
|
358
358
|
borderRadius: "var(--ds-border-radius, 3px)",
|
|
359
359
|
boxShadow: "var(--ds-shadow-overlay, ".concat("0 0 1px rgba(9, 30, 66, 0.31), 0 4px 8px -2px rgba(9, 30, 66, 0.25)", ")"),
|
|
360
360
|
display: 'flex',
|
|
361
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
361
362
|
lineHeight: 1,
|
|
362
363
|
boxSizing: 'border-box',
|
|
363
364
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
@@ -2,8 +2,10 @@ import React, { useEffect, useState } from 'react';
|
|
|
2
2
|
import Loadable from 'react-loadable';
|
|
3
3
|
import ButtonGroup from '@atlaskit/button/button-group';
|
|
4
4
|
import { getContextualToolbarItemsFromModule } from '@atlaskit/editor-common/extensions';
|
|
5
|
+
import { isSelectionTableNestedInTable } from '@atlaskit/editor-common/nesting';
|
|
5
6
|
import { FloatingToolbarButton as Button, FloatingToolbarSeparator as Separator } from '@atlaskit/editor-common/ui';
|
|
6
7
|
import { nodeToJSON } from '@atlaskit/editor-common/utils';
|
|
8
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
9
|
const noop = () => null;
|
|
8
10
|
const isDefaultExport = mod => {
|
|
9
11
|
return mod.hasOwnProperty('default');
|
|
@@ -99,9 +101,15 @@ export const ExtensionsPlaceholder = props => {
|
|
|
99
101
|
if (separator && ['start', 'both'].includes(separator)) {
|
|
100
102
|
children.push( /*#__PURE__*/React.createElement(Separator, null));
|
|
101
103
|
}
|
|
104
|
+
const isNestedTable = fg('platform_editor_use_nested_table_pm_nodes') && isSelectionTableNestedInTable(editorView.state);
|
|
105
|
+
|
|
102
106
|
// Ignored via go/ees005
|
|
103
107
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
104
108
|
extensionItems.forEach((item, index) => {
|
|
109
|
+
// disable the referentiality and charts extensions for nested tables
|
|
110
|
+
if (isNestedTable && ['referentiality:connections', 'chart:insert-chart'].includes(item.key)) {
|
|
111
|
+
item.disabled = true;
|
|
112
|
+
}
|
|
105
113
|
children.push( /*#__PURE__*/React.createElement(ExtensionButton, {
|
|
106
114
|
node: node,
|
|
107
115
|
item: item,
|
|
@@ -99,7 +99,7 @@ const ToolbarItems = /*#__PURE__*/React.memo(({
|
|
|
99
99
|
if (selected) {
|
|
100
100
|
return "var(--ds-icon-selected, #0C66E4)";
|
|
101
101
|
}
|
|
102
|
-
return
|
|
102
|
+
return 'currentColor';
|
|
103
103
|
};
|
|
104
104
|
return jsx(Button
|
|
105
105
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
@@ -320,6 +320,7 @@ const toolbarContainer = (scrollable, hasSelect, firstElementIsSelect) => css({
|
|
|
320
320
|
borderRadius: "var(--ds-border-radius, 3px)",
|
|
321
321
|
boxShadow: `var(--ds-shadow-overlay, ${`0 0 1px rgba(9, 30, 66, 0.31), 0 4px 8px -2px rgba(9, 30, 66, 0.25)`})`,
|
|
322
322
|
display: 'flex',
|
|
323
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
323
324
|
lineHeight: 1,
|
|
324
325
|
boxSizing: 'border-box',
|
|
325
326
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
@@ -5,8 +5,10 @@ import React, { useEffect, useState } from 'react';
|
|
|
5
5
|
import Loadable from 'react-loadable';
|
|
6
6
|
import ButtonGroup from '@atlaskit/button/button-group';
|
|
7
7
|
import { getContextualToolbarItemsFromModule } from '@atlaskit/editor-common/extensions';
|
|
8
|
+
import { isSelectionTableNestedInTable } from '@atlaskit/editor-common/nesting';
|
|
8
9
|
import { FloatingToolbarButton as Button, FloatingToolbarSeparator as Separator } from '@atlaskit/editor-common/ui';
|
|
9
10
|
import { nodeToJSON } from '@atlaskit/editor-common/utils';
|
|
11
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
12
|
var noop = function noop() {
|
|
11
13
|
return null;
|
|
12
14
|
};
|
|
@@ -167,9 +169,15 @@ export var ExtensionsPlaceholder = function ExtensionsPlaceholder(props) {
|
|
|
167
169
|
if (separator && ['start', 'both'].includes(separator)) {
|
|
168
170
|
children.push( /*#__PURE__*/React.createElement(Separator, null));
|
|
169
171
|
}
|
|
172
|
+
var isNestedTable = fg('platform_editor_use_nested_table_pm_nodes') && isSelectionTableNestedInTable(editorView.state);
|
|
173
|
+
|
|
170
174
|
// Ignored via go/ees005
|
|
171
175
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
172
176
|
extensionItems.forEach(function (item, index) {
|
|
177
|
+
// disable the referentiality and charts extensions for nested tables
|
|
178
|
+
if (isNestedTable && ['referentiality:connections', 'chart:insert-chart'].includes(item.key)) {
|
|
179
|
+
item.disabled = true;
|
|
180
|
+
}
|
|
173
181
|
children.push( /*#__PURE__*/React.createElement(ExtensionButton, {
|
|
174
182
|
node: node,
|
|
175
183
|
item: item,
|
package/dist/esm/ui/Toolbar.js
CHANGED
|
@@ -103,7 +103,7 @@ var ToolbarItems = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
103
103
|
if (selected) {
|
|
104
104
|
return "var(--ds-icon-selected, #0C66E4)";
|
|
105
105
|
}
|
|
106
|
-
return
|
|
106
|
+
return 'currentColor';
|
|
107
107
|
};
|
|
108
108
|
return jsx(Button
|
|
109
109
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
@@ -351,6 +351,7 @@ var toolbarContainer = function toolbarContainer(scrollable, hasSelect, firstEle
|
|
|
351
351
|
borderRadius: "var(--ds-border-radius, 3px)",
|
|
352
352
|
boxShadow: "var(--ds-shadow-overlay, ".concat("0 0 1px rgba(9, 30, 66, 0.31), 0 4px 8px -2px rgba(9, 30, 66, 0.25)", ")"),
|
|
353
353
|
display: 'flex',
|
|
354
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
354
355
|
lineHeight: 1,
|
|
355
356
|
boxSizing: 'border-box',
|
|
356
357
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
@@ -26,18 +26,19 @@ export type ForceFocusSelector = (selector: string | null) => (tr: Transaction)
|
|
|
26
26
|
* Floating toolbar plugin to be added to an `EditorPresetBuilder` and used with `ComposableEditor`
|
|
27
27
|
* from `@atlaskit/editor-core`.
|
|
28
28
|
*/
|
|
29
|
+
export type FloatingToolbarPluginDependencies = [
|
|
30
|
+
DecorationsPlugin,
|
|
31
|
+
OptionalPlugin<ContextPanelPlugin>,
|
|
32
|
+
OptionalPlugin<ExtensionPlugin>,
|
|
33
|
+
CopyButtonPlugin,
|
|
34
|
+
EditorDisabledPlugin,
|
|
35
|
+
OptionalPlugin<EditorViewModePlugin>,
|
|
36
|
+
OptionalPlugin<BlockControlsPlugin>,
|
|
37
|
+
OptionalPlugin<FeatureFlagsPlugin>,
|
|
38
|
+
OptionalPlugin<EmojiPlugin>
|
|
39
|
+
];
|
|
29
40
|
export type FloatingToolbarPlugin = NextEditorPlugin<'floatingToolbar', {
|
|
30
|
-
dependencies:
|
|
31
|
-
DecorationsPlugin,
|
|
32
|
-
OptionalPlugin<ContextPanelPlugin>,
|
|
33
|
-
OptionalPlugin<ExtensionPlugin>,
|
|
34
|
-
CopyButtonPlugin,
|
|
35
|
-
EditorDisabledPlugin,
|
|
36
|
-
OptionalPlugin<EditorViewModePlugin>,
|
|
37
|
-
OptionalPlugin<BlockControlsPlugin>,
|
|
38
|
-
OptionalPlugin<FeatureFlagsPlugin>,
|
|
39
|
-
OptionalPlugin<EmojiPlugin>
|
|
40
|
-
];
|
|
41
|
+
dependencies: FloatingToolbarPluginDependencies;
|
|
41
42
|
actions: {
|
|
42
43
|
forceFocusSelector: ForceFocusSelector;
|
|
43
44
|
};
|
|
@@ -26,18 +26,19 @@ export type ForceFocusSelector = (selector: string | null) => (tr: Transaction)
|
|
|
26
26
|
* Floating toolbar plugin to be added to an `EditorPresetBuilder` and used with `ComposableEditor`
|
|
27
27
|
* from `@atlaskit/editor-core`.
|
|
28
28
|
*/
|
|
29
|
+
export type FloatingToolbarPluginDependencies = [
|
|
30
|
+
DecorationsPlugin,
|
|
31
|
+
OptionalPlugin<ContextPanelPlugin>,
|
|
32
|
+
OptionalPlugin<ExtensionPlugin>,
|
|
33
|
+
CopyButtonPlugin,
|
|
34
|
+
EditorDisabledPlugin,
|
|
35
|
+
OptionalPlugin<EditorViewModePlugin>,
|
|
36
|
+
OptionalPlugin<BlockControlsPlugin>,
|
|
37
|
+
OptionalPlugin<FeatureFlagsPlugin>,
|
|
38
|
+
OptionalPlugin<EmojiPlugin>
|
|
39
|
+
];
|
|
29
40
|
export type FloatingToolbarPlugin = NextEditorPlugin<'floatingToolbar', {
|
|
30
|
-
dependencies:
|
|
31
|
-
DecorationsPlugin,
|
|
32
|
-
OptionalPlugin<ContextPanelPlugin>,
|
|
33
|
-
OptionalPlugin<ExtensionPlugin>,
|
|
34
|
-
CopyButtonPlugin,
|
|
35
|
-
EditorDisabledPlugin,
|
|
36
|
-
OptionalPlugin<EditorViewModePlugin>,
|
|
37
|
-
OptionalPlugin<BlockControlsPlugin>,
|
|
38
|
-
OptionalPlugin<FeatureFlagsPlugin>,
|
|
39
|
-
OptionalPlugin<EmojiPlugin>
|
|
40
|
-
];
|
|
41
|
+
dependencies: FloatingToolbarPluginDependencies;
|
|
41
42
|
actions: {
|
|
42
43
|
forceFocusSelector: ForceFocusSelector;
|
|
43
44
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-floating-toolbar",
|
|
3
|
-
"version": "1.14.
|
|
3
|
+
"version": "1.14.18",
|
|
4
4
|
"description": "Floating toolbar plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
".": "./src/index.ts"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@atlaskit/adf-utils": "^19.
|
|
26
|
+
"@atlaskit/adf-utils": "^19.16.0",
|
|
27
27
|
"@atlaskit/button": "^20.3.0",
|
|
28
28
|
"@atlaskit/checkbox": "^15.2.0",
|
|
29
|
-
"@atlaskit/editor-common": "^
|
|
30
|
-
"@atlaskit/editor-palette": "1.6.
|
|
31
|
-
"@atlaskit/editor-plugin-block-controls": "^2.
|
|
29
|
+
"@atlaskit/editor-common": "^99.1.0",
|
|
30
|
+
"@atlaskit/editor-palette": "1.6.4",
|
|
31
|
+
"@atlaskit/editor-plugin-block-controls": "^2.19.0",
|
|
32
32
|
"@atlaskit/editor-plugin-context-panel": "^1.4.0",
|
|
33
33
|
"@atlaskit/editor-plugin-copy-button": "^1.3.0",
|
|
34
34
|
"@atlaskit/editor-plugin-decorations": "^1.3.0",
|
|
@@ -36,18 +36,18 @@
|
|
|
36
36
|
"@atlaskit/editor-plugin-editor-viewmode": "^2.1.0",
|
|
37
37
|
"@atlaskit/editor-plugin-emoji": "^2.7.0",
|
|
38
38
|
"@atlaskit/editor-plugin-extension": "^3.0.0",
|
|
39
|
-
"@atlaskit/editor-plugin-table": "^9.
|
|
39
|
+
"@atlaskit/editor-plugin-table": "^9.1.0",
|
|
40
40
|
"@atlaskit/editor-prosemirror": "6.2.1",
|
|
41
|
-
"@atlaskit/emoji": "^67.
|
|
42
|
-
"@atlaskit/icon": "^23.
|
|
41
|
+
"@atlaskit/emoji": "^67.12.0",
|
|
42
|
+
"@atlaskit/icon": "^23.3.0",
|
|
43
43
|
"@atlaskit/menu": "^2.13.0",
|
|
44
|
-
"@atlaskit/modal-dialog": "^12.
|
|
44
|
+
"@atlaskit/modal-dialog": "^12.19.0",
|
|
45
45
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
46
46
|
"@atlaskit/primitives": "^13.3.0",
|
|
47
47
|
"@atlaskit/select": "^18.9.0",
|
|
48
48
|
"@atlaskit/theme": "^14.0.0",
|
|
49
|
-
"@atlaskit/tmp-editor-statsig": "^2.
|
|
50
|
-
"@atlaskit/tokens": "^
|
|
49
|
+
"@atlaskit/tmp-editor-statsig": "^2.33.0",
|
|
50
|
+
"@atlaskit/tokens": "^3.0.0",
|
|
51
51
|
"@atlaskit/tooltip": "^19.0.0",
|
|
52
52
|
"@babel/runtime": "^7.0.0",
|
|
53
53
|
"@emotion/react": "^11.7.1",
|
|
@@ -119,6 +119,9 @@
|
|
|
119
119
|
},
|
|
120
120
|
"platform-visual-refresh-icons": {
|
|
121
121
|
"type": "boolean"
|
|
122
|
+
},
|
|
123
|
+
"platform_editor_use_nested_table_pm_nodes": {
|
|
124
|
+
"type": "boolean"
|
|
122
125
|
}
|
|
123
126
|
}
|
|
124
127
|
}
|