@atlaskit/editor-plugin-floating-toolbar 1.5.0 → 1.7.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 +25 -0
- package/dist/cjs/ui/DropdownMenu.js +13 -8
- package/dist/cjs/ui/ExtensionsPlaceholder.js +14 -1
- package/dist/cjs/ui/Input.js +1 -1
- package/dist/cjs/ui/Toolbar.js +45 -9
- package/dist/es2019/ui/DropdownMenu.js +13 -8
- package/dist/es2019/ui/ExtensionsPlaceholder.js +14 -1
- package/dist/es2019/ui/Input.js +1 -1
- package/dist/es2019/ui/Toolbar.js +45 -9
- package/dist/esm/ui/DropdownMenu.js +13 -8
- package/dist/esm/ui/ExtensionsPlaceholder.js +14 -1
- package/dist/esm/ui/Input.js +1 -1
- package/dist/esm/ui/Toolbar.js +45 -9
- package/package.json +115 -115
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-floating-toolbar
|
|
2
2
|
|
|
3
|
+
## 1.7.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#111788](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/111788)
|
|
8
|
+
[`5a286a37540ff`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/5a286a37540ff) -
|
|
9
|
+
[ux] [EDF-770] Show agents in the floating toolbar dropdown
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
15
|
+
## 1.6.0
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- [#108718](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/108718)
|
|
20
|
+
[`1aad4f15416c2`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/1aad4f15416c2) -
|
|
21
|
+
[EDF-737] Add content warning to the floating toolbar of the ai panels, extended extensions
|
|
22
|
+
floating toolbar API to allow custom JSX
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- Updated dependencies
|
|
27
|
+
|
|
3
28
|
## 1.5.0
|
|
4
29
|
|
|
5
30
|
### Minor Changes
|
|
@@ -34,13 +34,14 @@ var spacerStyles = (0, _react2.css)({
|
|
|
34
34
|
|
|
35
35
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
36
36
|
var menuContainerStyles = (0, _react2.css)({
|
|
37
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
37
38
|
minWidth: "".concat(menuItemDimensions.width, "px"),
|
|
38
39
|
// temporary solution to retain spacing defined by @atlaskit/Item
|
|
39
|
-
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles
|
|
40
|
+
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
40
41
|
'& button': {
|
|
41
42
|
minHeight: "var(--ds-space-400, 32px)",
|
|
42
43
|
padding: "var(--ds-space-100, 8px)".concat(" ", "var(--ds-space-100, 8px)", " 7px"),
|
|
43
|
-
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles
|
|
44
|
+
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
44
45
|
'& > [data-item-elem-before]': {
|
|
45
46
|
marginRight: "var(--ds-space-050, 4px)"
|
|
46
47
|
}
|
|
@@ -67,12 +68,16 @@ var DropdownMenuItem = function DropdownMenuItem(props) {
|
|
|
67
68
|
intl = props.intl;
|
|
68
69
|
var itemSelected = item.selected;
|
|
69
70
|
var iconBefore = (0, _react.useMemo)(function () {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
71
|
+
if (item.icon) {
|
|
72
|
+
return item.icon;
|
|
73
|
+
} else {
|
|
74
|
+
return (0, _react2.jsx)(SelectedIconBefore, {
|
|
75
|
+
itemSelected: itemSelected,
|
|
76
|
+
showSelected: showSelected,
|
|
77
|
+
intl: intl
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
}, [itemSelected, showSelected, intl, item.icon]);
|
|
76
81
|
var _useState = (0, _react.useState)(item.tooltip || ''),
|
|
77
82
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
78
83
|
tooltipContent = _useState2[0],
|
|
@@ -84,14 +84,27 @@ var ExtensionButton = function ExtensionButton(props) {
|
|
|
84
84
|
var targetNodeAdf = (0, _utils.nodeToJSON)(node);
|
|
85
85
|
item.action(targetNodeAdf, extensionApi);
|
|
86
86
|
};
|
|
87
|
+
var getAriaLabel = function getAriaLabel() {
|
|
88
|
+
if (item.ariaLabel) {
|
|
89
|
+
return item.ariaLabel;
|
|
90
|
+
}
|
|
91
|
+
if (typeof item.tooltip === 'string') {
|
|
92
|
+
return item.tooltip;
|
|
93
|
+
}
|
|
94
|
+
if (item.label) {
|
|
95
|
+
return item.label;
|
|
96
|
+
}
|
|
97
|
+
return '';
|
|
98
|
+
};
|
|
87
99
|
return /*#__PURE__*/_react.default.createElement(_ui.FloatingToolbarButton, {
|
|
88
100
|
title: item.label,
|
|
89
|
-
ariaLabel:
|
|
101
|
+
ariaLabel: getAriaLabel(),
|
|
90
102
|
icon: ButtonIcon ? /*#__PURE__*/_react.default.createElement(ButtonIcon, {
|
|
91
103
|
label: item.label || ''
|
|
92
104
|
}) : undefined,
|
|
93
105
|
onClick: onClick,
|
|
94
106
|
tooltipContent: item.tooltip,
|
|
107
|
+
tooltipStyle: item.tooltipStyle,
|
|
95
108
|
disabled: item.disabled
|
|
96
109
|
}, item.label);
|
|
97
110
|
};
|
package/dist/cjs/ui/Input.js
CHANGED
|
@@ -66,7 +66,7 @@ var TextField = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
66
66
|
return (0, _react2.jsx)("form", {
|
|
67
67
|
onSubmit: this.handleSubmit
|
|
68
68
|
}, (0, _react2.jsx)("input", {
|
|
69
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
69
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
70
70
|
css: _ui.panelTextInput,
|
|
71
71
|
value: this.state.text,
|
|
72
72
|
onChange: this.handleChange,
|
package/dist/cjs/ui/Toolbar.js
CHANGED
|
@@ -309,43 +309,79 @@ var toolbarContainer = function toolbarContainer(scrollable, hasSelect, firstEle
|
|
|
309
309
|
display: 'flex',
|
|
310
310
|
lineHeight: 1,
|
|
311
311
|
boxSizing: 'border-box',
|
|
312
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
312
313
|
'& > div > div': {
|
|
313
314
|
alignItems: 'center'
|
|
314
315
|
}
|
|
315
|
-
},
|
|
316
|
+
},
|
|
317
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
318
|
+
scrollable ?
|
|
319
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
320
|
+
(0, _react2.css)(
|
|
321
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
322
|
+
hasSelect ?
|
|
323
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
324
|
+
(0, _react2.css)({
|
|
316
325
|
height: '40px'
|
|
317
|
-
}) :
|
|
326
|
+
}) :
|
|
327
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
328
|
+
(0, _react2.css)({
|
|
318
329
|
height: '32px'
|
|
319
330
|
}), {
|
|
320
331
|
overflow: 'hidden'
|
|
321
|
-
}) :
|
|
332
|
+
}) :
|
|
333
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
334
|
+
(0, _react2.css)({
|
|
322
335
|
padding: "var(--ds-space-050, 4px)".concat(" ", "var(--ds-space-100, 8px)")
|
|
323
|
-
},
|
|
336
|
+
},
|
|
337
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
338
|
+
firstElementIsSelect &&
|
|
339
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
340
|
+
(0, _react2.css)({
|
|
324
341
|
paddingLeft: "var(--ds-space-050, 4px)"
|
|
325
342
|
})));
|
|
326
343
|
};
|
|
327
344
|
|
|
328
345
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
329
346
|
var toolbarOverflow = function toolbarOverflow(scrollable, scrollDisabled, firstElementIsSelect) {
|
|
330
|
-
return (0, _react2.css)(
|
|
347
|
+
return (0, _react2.css)(
|
|
348
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
349
|
+
scrollable ?
|
|
350
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
351
|
+
(0, _react2.css)(
|
|
352
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
353
|
+
scrollDisabled ?
|
|
354
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
355
|
+
(0, _react2.css)({
|
|
331
356
|
overflow: 'hidden'
|
|
332
|
-
}) :
|
|
357
|
+
}) :
|
|
358
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
359
|
+
(0, _react2.css)({
|
|
333
360
|
overflowX: 'auto',
|
|
334
361
|
overflowY: 'hidden'
|
|
335
362
|
}), {
|
|
336
363
|
WebkitOverflowScrolling: 'touch',
|
|
337
364
|
padding: "var(--ds-space-050, 4px)".concat(" 0 ", "var(--ds-space-600, 48px)"),
|
|
365
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
338
366
|
'> div': {
|
|
339
|
-
|
|
367
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
368
|
+
'> div:first-child': firstElementIsSelect ?
|
|
369
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
370
|
+
(0, _react2.css)({
|
|
340
371
|
marginLeft: "var(--ds-space-050, 4px)"
|
|
341
|
-
}) :
|
|
372
|
+
}) :
|
|
373
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
374
|
+
(0, _react2.css)({
|
|
342
375
|
marginLeft: "var(--ds-space-100, 8px)"
|
|
343
376
|
}),
|
|
377
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
344
378
|
'> div:last-child': {
|
|
345
379
|
marginRight: "var(--ds-space-100, 8px)"
|
|
346
380
|
}
|
|
347
381
|
}
|
|
348
|
-
}) :
|
|
382
|
+
}) :
|
|
383
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
384
|
+
(0, _react2.css)({
|
|
349
385
|
display: 'flex'
|
|
350
386
|
}));
|
|
351
387
|
};
|
|
@@ -24,13 +24,14 @@ const spacerStyles = css({
|
|
|
24
24
|
|
|
25
25
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
26
26
|
const menuContainerStyles = css({
|
|
27
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
27
28
|
minWidth: `${menuItemDimensions.width}px`,
|
|
28
29
|
// temporary solution to retain spacing defined by @atlaskit/Item
|
|
29
|
-
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles
|
|
30
|
+
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
30
31
|
'& button': {
|
|
31
32
|
minHeight: "var(--ds-space-400, 32px)",
|
|
32
33
|
padding: `${"var(--ds-space-100, 8px)"} ${"var(--ds-space-100, 8px)"} 7px`,
|
|
33
|
-
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles
|
|
34
|
+
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
34
35
|
'& > [data-item-elem-before]': {
|
|
35
36
|
marginRight: "var(--ds-space-050, 4px)"
|
|
36
37
|
}
|
|
@@ -59,12 +60,16 @@ const DropdownMenuItem = props => {
|
|
|
59
60
|
} = props;
|
|
60
61
|
const itemSelected = item.selected;
|
|
61
62
|
const iconBefore = useMemo(() => {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
63
|
+
if (item.icon) {
|
|
64
|
+
return item.icon;
|
|
65
|
+
} else {
|
|
66
|
+
return jsx(SelectedIconBefore, {
|
|
67
|
+
itemSelected: itemSelected,
|
|
68
|
+
showSelected: showSelected,
|
|
69
|
+
intl: intl
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}, [itemSelected, showSelected, intl, item.icon]);
|
|
68
73
|
const [tooltipContent, setTooltipContent] = useState(item.tooltip || '');
|
|
69
74
|
const handleItemMouseOut = useCallback(() => {
|
|
70
75
|
setTooltipContent('');
|
|
@@ -33,14 +33,27 @@ const ExtensionButton = props => {
|
|
|
33
33
|
const targetNodeAdf = nodeToJSON(node);
|
|
34
34
|
item.action(targetNodeAdf, extensionApi);
|
|
35
35
|
};
|
|
36
|
+
const getAriaLabel = () => {
|
|
37
|
+
if (item.ariaLabel) {
|
|
38
|
+
return item.ariaLabel;
|
|
39
|
+
}
|
|
40
|
+
if (typeof item.tooltip === 'string') {
|
|
41
|
+
return item.tooltip;
|
|
42
|
+
}
|
|
43
|
+
if (item.label) {
|
|
44
|
+
return item.label;
|
|
45
|
+
}
|
|
46
|
+
return '';
|
|
47
|
+
};
|
|
36
48
|
return /*#__PURE__*/React.createElement(Button, {
|
|
37
49
|
title: item.label,
|
|
38
|
-
ariaLabel:
|
|
50
|
+
ariaLabel: getAriaLabel(),
|
|
39
51
|
icon: ButtonIcon ? /*#__PURE__*/React.createElement(ButtonIcon, {
|
|
40
52
|
label: item.label || ''
|
|
41
53
|
}) : undefined,
|
|
42
54
|
onClick: onClick,
|
|
43
55
|
tooltipContent: item.tooltip,
|
|
56
|
+
tooltipStyle: item.tooltipStyle,
|
|
44
57
|
disabled: item.disabled
|
|
45
58
|
}, item.label);
|
|
46
59
|
};
|
package/dist/es2019/ui/Input.js
CHANGED
|
@@ -42,7 +42,7 @@ export default class TextField extends Component {
|
|
|
42
42
|
return jsx("form", {
|
|
43
43
|
onSubmit: this.handleSubmit
|
|
44
44
|
}, jsx("input", {
|
|
45
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
45
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
46
46
|
css: panelTextInput,
|
|
47
47
|
value: this.state.text,
|
|
48
48
|
onChange: this.handleChange,
|
|
@@ -274,41 +274,77 @@ const toolbarContainer = (scrollable, hasSelect, firstElementIsSelect) => css({
|
|
|
274
274
|
display: 'flex',
|
|
275
275
|
lineHeight: 1,
|
|
276
276
|
boxSizing: 'border-box',
|
|
277
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
277
278
|
'& > div > div': {
|
|
278
279
|
alignItems: 'center'
|
|
279
280
|
}
|
|
280
|
-
},
|
|
281
|
+
},
|
|
282
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
283
|
+
scrollable ?
|
|
284
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
285
|
+
css(
|
|
286
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
287
|
+
hasSelect ?
|
|
288
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
289
|
+
css({
|
|
281
290
|
height: '40px'
|
|
282
|
-
}) :
|
|
291
|
+
}) :
|
|
292
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
293
|
+
css({
|
|
283
294
|
height: '32px'
|
|
284
295
|
}), {
|
|
285
296
|
overflow: 'hidden'
|
|
286
|
-
}) :
|
|
297
|
+
}) :
|
|
298
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
299
|
+
css({
|
|
287
300
|
padding: `${"var(--ds-space-050, 4px)"} ${"var(--ds-space-100, 8px)"}`
|
|
288
|
-
},
|
|
301
|
+
},
|
|
302
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
303
|
+
firstElementIsSelect &&
|
|
304
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
305
|
+
css({
|
|
289
306
|
paddingLeft: "var(--ds-space-050, 4px)"
|
|
290
307
|
})));
|
|
291
308
|
|
|
292
309
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
293
|
-
const toolbarOverflow = (scrollable, scrollDisabled, firstElementIsSelect) => css(
|
|
310
|
+
const toolbarOverflow = (scrollable, scrollDisabled, firstElementIsSelect) => css(
|
|
311
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
312
|
+
scrollable ?
|
|
313
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
314
|
+
css(
|
|
315
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
316
|
+
scrollDisabled ?
|
|
317
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
318
|
+
css({
|
|
294
319
|
overflow: 'hidden'
|
|
295
|
-
}) :
|
|
320
|
+
}) :
|
|
321
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
322
|
+
css({
|
|
296
323
|
overflowX: 'auto',
|
|
297
324
|
overflowY: 'hidden'
|
|
298
325
|
}), {
|
|
299
326
|
WebkitOverflowScrolling: 'touch',
|
|
300
327
|
padding: `${"var(--ds-space-050, 4px)"} 0 ${"var(--ds-space-600, 48px)"}`,
|
|
328
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
301
329
|
'> div': {
|
|
302
|
-
|
|
330
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
331
|
+
'> div:first-child': firstElementIsSelect ?
|
|
332
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
333
|
+
css({
|
|
303
334
|
marginLeft: "var(--ds-space-050, 4px)"
|
|
304
|
-
}) :
|
|
335
|
+
}) :
|
|
336
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
337
|
+
css({
|
|
305
338
|
marginLeft: "var(--ds-space-100, 8px)"
|
|
306
339
|
}),
|
|
340
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
307
341
|
'> div:last-child': {
|
|
308
342
|
marginRight: "var(--ds-space-100, 8px)"
|
|
309
343
|
}
|
|
310
344
|
}
|
|
311
|
-
}) :
|
|
345
|
+
}) :
|
|
346
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
347
|
+
css({
|
|
312
348
|
display: 'flex'
|
|
313
349
|
}));
|
|
314
350
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
@@ -25,13 +25,14 @@ var spacerStyles = css({
|
|
|
25
25
|
|
|
26
26
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
27
27
|
var menuContainerStyles = css({
|
|
28
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
28
29
|
minWidth: "".concat(menuItemDimensions.width, "px"),
|
|
29
30
|
// temporary solution to retain spacing defined by @atlaskit/Item
|
|
30
|
-
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles
|
|
31
|
+
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
31
32
|
'& button': {
|
|
32
33
|
minHeight: "var(--ds-space-400, 32px)",
|
|
33
34
|
padding: "var(--ds-space-100, 8px)".concat(" ", "var(--ds-space-100, 8px)", " 7px"),
|
|
34
|
-
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles
|
|
35
|
+
// eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
35
36
|
'& > [data-item-elem-before]': {
|
|
36
37
|
marginRight: "var(--ds-space-050, 4px)"
|
|
37
38
|
}
|
|
@@ -58,12 +59,16 @@ var DropdownMenuItem = function DropdownMenuItem(props) {
|
|
|
58
59
|
intl = props.intl;
|
|
59
60
|
var itemSelected = item.selected;
|
|
60
61
|
var iconBefore = useMemo(function () {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
if (item.icon) {
|
|
63
|
+
return item.icon;
|
|
64
|
+
} else {
|
|
65
|
+
return jsx(SelectedIconBefore, {
|
|
66
|
+
itemSelected: itemSelected,
|
|
67
|
+
showSelected: showSelected,
|
|
68
|
+
intl: intl
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}, [itemSelected, showSelected, intl, item.icon]);
|
|
67
72
|
var _useState = useState(item.tooltip || ''),
|
|
68
73
|
_useState2 = _slicedToArray(_useState, 2),
|
|
69
74
|
tooltipContent = _useState2[0],
|
|
@@ -74,14 +74,27 @@ var ExtensionButton = function ExtensionButton(props) {
|
|
|
74
74
|
var targetNodeAdf = nodeToJSON(node);
|
|
75
75
|
item.action(targetNodeAdf, extensionApi);
|
|
76
76
|
};
|
|
77
|
+
var getAriaLabel = function getAriaLabel() {
|
|
78
|
+
if (item.ariaLabel) {
|
|
79
|
+
return item.ariaLabel;
|
|
80
|
+
}
|
|
81
|
+
if (typeof item.tooltip === 'string') {
|
|
82
|
+
return item.tooltip;
|
|
83
|
+
}
|
|
84
|
+
if (item.label) {
|
|
85
|
+
return item.label;
|
|
86
|
+
}
|
|
87
|
+
return '';
|
|
88
|
+
};
|
|
77
89
|
return /*#__PURE__*/React.createElement(Button, {
|
|
78
90
|
title: item.label,
|
|
79
|
-
ariaLabel:
|
|
91
|
+
ariaLabel: getAriaLabel(),
|
|
80
92
|
icon: ButtonIcon ? /*#__PURE__*/React.createElement(ButtonIcon, {
|
|
81
93
|
label: item.label || ''
|
|
82
94
|
}) : undefined,
|
|
83
95
|
onClick: onClick,
|
|
84
96
|
tooltipContent: item.tooltip,
|
|
97
|
+
tooltipStyle: item.tooltipStyle,
|
|
85
98
|
disabled: item.disabled
|
|
86
99
|
}, item.label);
|
|
87
100
|
};
|
package/dist/esm/ui/Input.js
CHANGED
|
@@ -57,7 +57,7 @@ var TextField = /*#__PURE__*/function (_Component) {
|
|
|
57
57
|
return jsx("form", {
|
|
58
58
|
onSubmit: this.handleSubmit
|
|
59
59
|
}, jsx("input", {
|
|
60
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
60
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
61
61
|
css: panelTextInput,
|
|
62
62
|
value: this.state.text,
|
|
63
63
|
onChange: this.handleChange,
|
package/dist/esm/ui/Toolbar.js
CHANGED
|
@@ -300,43 +300,79 @@ var toolbarContainer = function toolbarContainer(scrollable, hasSelect, firstEle
|
|
|
300
300
|
display: 'flex',
|
|
301
301
|
lineHeight: 1,
|
|
302
302
|
boxSizing: 'border-box',
|
|
303
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
303
304
|
'& > div > div': {
|
|
304
305
|
alignItems: 'center'
|
|
305
306
|
}
|
|
306
|
-
},
|
|
307
|
+
},
|
|
308
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
309
|
+
scrollable ?
|
|
310
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
311
|
+
css(
|
|
312
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
313
|
+
hasSelect ?
|
|
314
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
315
|
+
css({
|
|
307
316
|
height: '40px'
|
|
308
|
-
}) :
|
|
317
|
+
}) :
|
|
318
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
319
|
+
css({
|
|
309
320
|
height: '32px'
|
|
310
321
|
}), {
|
|
311
322
|
overflow: 'hidden'
|
|
312
|
-
}) :
|
|
323
|
+
}) :
|
|
324
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
325
|
+
css({
|
|
313
326
|
padding: "var(--ds-space-050, 4px)".concat(" ", "var(--ds-space-100, 8px)")
|
|
314
|
-
},
|
|
327
|
+
},
|
|
328
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
329
|
+
firstElementIsSelect &&
|
|
330
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
331
|
+
css({
|
|
315
332
|
paddingLeft: "var(--ds-space-050, 4px)"
|
|
316
333
|
})));
|
|
317
334
|
};
|
|
318
335
|
|
|
319
336
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
320
337
|
var toolbarOverflow = function toolbarOverflow(scrollable, scrollDisabled, firstElementIsSelect) {
|
|
321
|
-
return css(
|
|
338
|
+
return css(
|
|
339
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
340
|
+
scrollable ?
|
|
341
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
342
|
+
css(
|
|
343
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
344
|
+
scrollDisabled ?
|
|
345
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
346
|
+
css({
|
|
322
347
|
overflow: 'hidden'
|
|
323
|
-
}) :
|
|
348
|
+
}) :
|
|
349
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
350
|
+
css({
|
|
324
351
|
overflowX: 'auto',
|
|
325
352
|
overflowY: 'hidden'
|
|
326
353
|
}), {
|
|
327
354
|
WebkitOverflowScrolling: 'touch',
|
|
328
355
|
padding: "var(--ds-space-050, 4px)".concat(" 0 ", "var(--ds-space-600, 48px)"),
|
|
356
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
329
357
|
'> div': {
|
|
330
|
-
|
|
358
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
359
|
+
'> div:first-child': firstElementIsSelect ?
|
|
360
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
361
|
+
css({
|
|
331
362
|
marginLeft: "var(--ds-space-050, 4px)"
|
|
332
|
-
}) :
|
|
363
|
+
}) :
|
|
364
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
365
|
+
css({
|
|
333
366
|
marginLeft: "var(--ds-space-100, 8px)"
|
|
334
367
|
}),
|
|
368
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
335
369
|
'> div:last-child': {
|
|
336
370
|
marginRight: "var(--ds-space-100, 8px)"
|
|
337
371
|
}
|
|
338
372
|
}
|
|
339
|
-
}) :
|
|
373
|
+
}) :
|
|
374
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
375
|
+
css({
|
|
340
376
|
display: 'flex'
|
|
341
377
|
}));
|
|
342
378
|
};
|
package/package.json
CHANGED
|
@@ -1,116 +1,116 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}
|
|
2
|
+
"name": "@atlaskit/editor-plugin-floating-toolbar",
|
|
3
|
+
"version": "1.7.0",
|
|
4
|
+
"description": "Floating toolbar plugin for @atlaskit/editor-core",
|
|
5
|
+
"author": "Atlassian Pty Ltd",
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"registry": "https://registry.npmjs.org/"
|
|
9
|
+
},
|
|
10
|
+
"atlassian": {
|
|
11
|
+
"team": "Editor: Lego",
|
|
12
|
+
"singleton": true,
|
|
13
|
+
"releaseModel": "continuous",
|
|
14
|
+
"runReact18": false
|
|
15
|
+
},
|
|
16
|
+
"repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
|
|
17
|
+
"main": "dist/cjs/index.js",
|
|
18
|
+
"module": "dist/esm/index.js",
|
|
19
|
+
"module:es2019": "dist/es2019/index.js",
|
|
20
|
+
"types": "dist/types/index.d.ts",
|
|
21
|
+
"sideEffects": false,
|
|
22
|
+
"atlaskit:src": "src/index.ts",
|
|
23
|
+
"af:exports": {
|
|
24
|
+
".": "./src/index.ts"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@atlaskit/adf-utils": "^19.2.0",
|
|
28
|
+
"@atlaskit/button": "^17.17.0",
|
|
29
|
+
"@atlaskit/checkbox": "^13.4.0",
|
|
30
|
+
"@atlaskit/editor-common": "^82.8.0",
|
|
31
|
+
"@atlaskit/editor-palette": "1.6.0",
|
|
32
|
+
"@atlaskit/editor-plugin-block-controls": "^1.4.1",
|
|
33
|
+
"@atlaskit/editor-plugin-context-panel": "^1.1.0",
|
|
34
|
+
"@atlaskit/editor-plugin-copy-button": "^1.1.0",
|
|
35
|
+
"@atlaskit/editor-plugin-decorations": "^1.1.0",
|
|
36
|
+
"@atlaskit/editor-plugin-editor-disabled": "^1.1.0",
|
|
37
|
+
"@atlaskit/editor-plugin-editor-viewmode": "^1.2.0",
|
|
38
|
+
"@atlaskit/editor-plugin-extension": "^1.6.0",
|
|
39
|
+
"@atlaskit/editor-plugin-table": "^7.17.0",
|
|
40
|
+
"@atlaskit/editor-prosemirror": "4.0.1",
|
|
41
|
+
"@atlaskit/emoji": "^67.6.0",
|
|
42
|
+
"@atlaskit/icon": "^22.3.0",
|
|
43
|
+
"@atlaskit/menu": "^2.4.0",
|
|
44
|
+
"@atlaskit/modal-dialog": "^12.13.0",
|
|
45
|
+
"@atlaskit/platform-feature-flags": "^0.2.5",
|
|
46
|
+
"@atlaskit/select": "^17.10.0",
|
|
47
|
+
"@atlaskit/theme": "^12.9.0",
|
|
48
|
+
"@atlaskit/tokens": "^1.50.0",
|
|
49
|
+
"@atlaskit/tooltip": "^18.4.0",
|
|
50
|
+
"@babel/runtime": "^7.0.0",
|
|
51
|
+
"@emotion/react": "^11.7.1",
|
|
52
|
+
"lodash": "^4.17.21",
|
|
53
|
+
"raf-schd": "^4.0.3",
|
|
54
|
+
"react-intl-next": "npm:react-intl@^5.18.1",
|
|
55
|
+
"react-loadable": "^5.1.0"
|
|
56
|
+
},
|
|
57
|
+
"peerDependencies": {
|
|
58
|
+
"react": "^16.8.0"
|
|
59
|
+
},
|
|
60
|
+
"devDependencies": {
|
|
61
|
+
"@atlaskit/visual-regression": "*",
|
|
62
|
+
"@testing-library/dom": "^8.17.1",
|
|
63
|
+
"@testing-library/react": "^12.1.5",
|
|
64
|
+
"@testing-library/user-event": "^14.4.3",
|
|
65
|
+
"enzyme": "^3.10.0",
|
|
66
|
+
"react-dom": "^16.8.0",
|
|
67
|
+
"typescript": "~5.4.2",
|
|
68
|
+
"wait-for-expect": "^1.2.0"
|
|
69
|
+
},
|
|
70
|
+
"techstack": {
|
|
71
|
+
"@atlassian/frontend": {
|
|
72
|
+
"import-structure": [
|
|
73
|
+
"atlassian-conventions"
|
|
74
|
+
],
|
|
75
|
+
"circular-dependencies": [
|
|
76
|
+
"file-and-folder-level"
|
|
77
|
+
]
|
|
78
|
+
},
|
|
79
|
+
"@repo/internal": {
|
|
80
|
+
"dom-events": "use-bind-event-listener",
|
|
81
|
+
"analytics": [
|
|
82
|
+
"analytics-next"
|
|
83
|
+
],
|
|
84
|
+
"design-tokens": [
|
|
85
|
+
"color"
|
|
86
|
+
],
|
|
87
|
+
"theming": [
|
|
88
|
+
"react-context"
|
|
89
|
+
],
|
|
90
|
+
"ui-components": [
|
|
91
|
+
"lite-mode"
|
|
92
|
+
],
|
|
93
|
+
"deprecation": "no-deprecated-imports",
|
|
94
|
+
"styling": [
|
|
95
|
+
"emotion",
|
|
96
|
+
"emotion"
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
"typesVersions": {
|
|
101
|
+
">=4.5 <4.9": {
|
|
102
|
+
"*": [
|
|
103
|
+
"dist/types-ts4.5/*",
|
|
104
|
+
"dist/types-ts4.5/index.d.ts"
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
"platform-feature-flags": {
|
|
109
|
+
"platform.editor.a11y-floating-toolbar-markup_vexmo": {
|
|
110
|
+
"type": "boolean"
|
|
111
|
+
},
|
|
112
|
+
"platform.editor.a11y-table-floating-toolbar-dropdown-menu_zkb33": {
|
|
113
|
+
"type": "boolean"
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|