@atlaskit/editor-toolbar 0.12.1 → 0.14.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 +23 -0
- package/dist/cjs/index.js +13 -0
- package/dist/cjs/ui/ResponsiveContainer.compiled.css +1 -0
- package/dist/cjs/ui/ResponsiveContainer.js +3 -1
- package/dist/cjs/ui/Toolbar.compiled.css +2 -0
- package/dist/cjs/ui/Toolbar.js +10 -5
- package/dist/cjs/ui/ToolbarDropdownMenuContext.js +16 -6
- package/dist/cjs/ui/ToolbarSection.js +20 -2
- package/dist/cjs/ui/icons/SyncBlocksIcon.js +13 -0
- package/dist/es2019/index.js +2 -1
- package/dist/es2019/ui/ResponsiveContainer.compiled.css +1 -0
- package/dist/es2019/ui/ResponsiveContainer.js +3 -1
- package/dist/es2019/ui/Toolbar.compiled.css +2 -0
- package/dist/es2019/ui/Toolbar.js +10 -5
- package/dist/es2019/ui/ToolbarDropdownMenuContext.js +17 -5
- package/dist/es2019/ui/ToolbarSection.js +19 -1
- package/dist/es2019/ui/icons/SyncBlocksIcon.js +2 -0
- package/dist/esm/index.js +2 -1
- package/dist/esm/ui/ResponsiveContainer.compiled.css +1 -0
- package/dist/esm/ui/ResponsiveContainer.js +3 -1
- package/dist/esm/ui/Toolbar.compiled.css +2 -0
- package/dist/esm/ui/Toolbar.js +10 -5
- package/dist/esm/ui/ToolbarDropdownMenuContext.js +16 -6
- package/dist/esm/ui/ToolbarSection.js +19 -1
- package/dist/esm/ui/icons/SyncBlocksIcon.js +2 -0
- package/dist/types/index.d.ts +2 -1
- package/dist/types/ui/ToolbarDropdownMenuContext.d.ts +3 -1
- package/dist/types/ui/ToolbarSection.d.ts +6 -2
- package/dist/types/ui/icons/SyncBlocksIcon.d.ts +1 -0
- package/dist/types-ts4.5/index.d.ts +2 -1
- package/dist/types-ts4.5/ui/ToolbarDropdownMenuContext.d.ts +3 -1
- package/dist/types-ts4.5/ui/ToolbarSection.d.ts +6 -2
- package/dist/types-ts4.5/ui/icons/SyncBlocksIcon.d.ts +1 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# @atlaskit/editor-toolbar
|
|
2
2
|
|
|
3
|
+
## 0.14.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`872bd8d576773`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/872bd8d576773) -
|
|
8
|
+
[ux] ED-29272 Add missing tooltip and shortcut for TextColorDropdownMenu
|
|
9
|
+
|
|
10
|
+
## 0.13.0
|
|
11
|
+
|
|
12
|
+
### Minor Changes
|
|
13
|
+
|
|
14
|
+
- [`351022ab9c347`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/351022ab9c347) -
|
|
15
|
+
[ux] [ED-29060] add toolbar separators after the AI sections in the inline toolbars behind
|
|
16
|
+
platform_editor_toolbar_aifc_patch_6
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- [`7011f9be6a430`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7011f9be6a430) -
|
|
21
|
+
[ux] EDITOR-1653 add create synced block item to the block menu
|
|
22
|
+
- [`84e969325af68`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/84e969325af68) -
|
|
23
|
+
ED-29469 Comment editor in live-doc squishes before going to next breakpoint
|
|
24
|
+
- Updated dependencies
|
|
25
|
+
|
|
3
26
|
## 0.12.1
|
|
4
27
|
|
|
5
28
|
### Patch Changes
|
package/dist/cjs/index.js
CHANGED
|
@@ -304,6 +304,12 @@ Object.defineProperty(exports, "ResponsiveContainer", {
|
|
|
304
304
|
return _ResponsiveContainer.ResponsiveContainer;
|
|
305
305
|
}
|
|
306
306
|
});
|
|
307
|
+
Object.defineProperty(exports, "SeparatorPosition", {
|
|
308
|
+
enumerable: true,
|
|
309
|
+
get: function get() {
|
|
310
|
+
return _ToolbarSection.SeparatorPosition;
|
|
311
|
+
}
|
|
312
|
+
});
|
|
307
313
|
Object.defineProperty(exports, "Show", {
|
|
308
314
|
enumerable: true,
|
|
309
315
|
get: function get() {
|
|
@@ -334,6 +340,12 @@ Object.defineProperty(exports, "SuperscriptIcon", {
|
|
|
334
340
|
return _SuperscriptIcon.SuperscriptIcon;
|
|
335
341
|
}
|
|
336
342
|
});
|
|
343
|
+
Object.defineProperty(exports, "SyncBlocksIcon", {
|
|
344
|
+
enumerable: true,
|
|
345
|
+
get: function get() {
|
|
346
|
+
return _SyncBlocksIcon.SyncBlocksIcon;
|
|
347
|
+
}
|
|
348
|
+
});
|
|
337
349
|
Object.defineProperty(exports, "TableIcon", {
|
|
338
350
|
enumerable: true,
|
|
339
351
|
get: function get() {
|
|
@@ -544,6 +556,7 @@ var _RedoIcon = require("./ui/icons/RedoIcon");
|
|
|
544
556
|
var _HistoryIcon = require("./ui/icons/HistoryIcon");
|
|
545
557
|
var _LoomIcon = require("./ui/icons/LoomIcon");
|
|
546
558
|
var _PlusIcon = require("./ui/icons/PlusIcon");
|
|
559
|
+
var _SyncBlocksIcon = require("./ui/icons/SyncBlocksIcon");
|
|
547
560
|
var _ColorPalette = _interopRequireDefault(require("./ui/ColorPalette"));
|
|
548
561
|
var _utils = require("./ui/ColorPalette/utils");
|
|
549
562
|
var _uiContext = require("./hooks/ui-context");
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
@container toolbar-container (max-width: 410px){._6nrqglyw .show-above-sm{display:none}._1fq21ule .show-below-sm{display:block}}
|
|
19
19
|
@container toolbar-container (max-width: 476px){._1ireglyw .show-above-md{display:none}._zy2m1ule .show-below-md{display:block}}
|
|
20
20
|
@container toolbar-container (max-width: 575px){._11u4glyw._11u4glyw .show-above-lg{display:none}._v1i61ule._v1i61ule .show-below-lg{display:block}}
|
|
21
|
+
@container toolbar-container (max-width: 648px){._e2nbglyw._e2nbglyw._e2nbglyw .show-above-lg{display:none}._ol4q1ule._ol4q1ule._ol4q1ule .show-below-lg{display:block}}
|
|
21
22
|
@container toolbar-container (max-width: 768px){._hfbeglyw .show-above-lg{display:none}._gw6d1ule .show-below-lg{display:block}}
|
|
22
23
|
@media (max-width:700px){._hmx4glyw .show-above-lg{display:none}._1rrm1ule .show-below-lg{display:block}}
|
|
23
24
|
@media (max-width:533px){._ut18glyw .show-above-md{display:none}._1nwo1ule .show-below-md{display:block}}
|
|
@@ -14,10 +14,12 @@ var _runtime = require("@compiled/react/runtime");
|
|
|
14
14
|
var _react = _interopRequireDefault(require("react"));
|
|
15
15
|
var _css = require("@atlaskit/css");
|
|
16
16
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
17
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
17
18
|
var styles = {
|
|
18
19
|
responsiveContainer: "_1bsb1osq _7cca15wb _1f38ptqj _1bx91ule _1ehg1ule _1onx1ule _1xt01ule _zg9wglyw _1a2cglyw _sum2glyw _1vtcglyw",
|
|
19
20
|
responsiveRules: "_t3a8glyw _1x5z1ule _6nrqglyw _1fq21ule _1ireglyw _zy2m1ule _hfbeglyw _gw6d1ule",
|
|
20
21
|
responsiveRulesReduced: "_j094glyw _1mc51ule _gipeglyw _311r1ule _11u4glyw _v1i61ule _19x4glyw _qck01ule",
|
|
22
|
+
responsiveRulesReducedOverridden: "_e2nbglyw _ol4q1ule",
|
|
21
23
|
responsiveRulesWrapper: "_1bx91ule _1ehg1ule _1onx1ule _1xt01ule _zg9wglyw _1a2cglyw _sum2glyw _1vtcglyw _33p2glyw _1dre1ule _u47mglyw _rut51ule _fj5dglyw _5wt61ule _hmx4glyw _1rrm1ule _ut18glyw _1nwo1ule _19fzglyw _1r831ule"
|
|
22
24
|
};
|
|
23
25
|
/**
|
|
@@ -67,7 +69,7 @@ var ResponsiveContainer = exports.ResponsiveContainer = function ResponsiveConta
|
|
|
67
69
|
var children = _ref.children,
|
|
68
70
|
reducedBreakpoints = _ref.reducedBreakpoints;
|
|
69
71
|
return /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
70
|
-
xcss: (0, _css.cx)(styles.responsiveContainer, reducedBreakpoints ? styles.responsiveRulesReduced : styles.responsiveRules)
|
|
72
|
+
xcss: (0, _css.cx)(styles.responsiveContainer, reducedBreakpoints ? styles.responsiveRulesReduced : styles.responsiveRules, reducedBreakpoints && (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true) && styles.responsiveRulesReducedOverridden)
|
|
71
73
|
}, children);
|
|
72
74
|
};
|
|
73
75
|
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
._18shglyw [class*=show-above-]:not(:has([data-toolbar-component=section] [data-toolbar-component=button],[data-toolbar-component=button-group] [data-toolbar-component=button])){display:none}
|
|
6
6
|
._19bv1b66{padding-left:var(--ds-space-050,4px)}
|
|
7
7
|
._1e0c1txw{display:flex}
|
|
8
|
+
._1mj714no[data-toolbar-type=inline] [data-toolbar-component=separator]{height:36px}
|
|
8
9
|
._1tkezwfg{min-height:2pc}
|
|
9
10
|
._4cvr1h6o{align-items:center}
|
|
10
11
|
._4t3i14no{height:36px}
|
|
@@ -12,4 +13,5 @@
|
|
|
12
13
|
._bfhkvuon{background-color:var(--ds-surface,#fff)}
|
|
13
14
|
._fy9oglyw [data-toolbar-component=section]:not(:has([data-toolbar-component=button])){display:none}
|
|
14
15
|
._u5f31b66{padding-right:var(--ds-space-050,4px)}
|
|
16
|
+
._z5m7glyw [data-toolbar-component=section]:not(:has(~[data-toolbar-component=section])) [data-toolbar-component=separator]{display:none}
|
|
15
17
|
._ze7rglyw [class*=show-below-]:not(:has([data-toolbar-component=section] [data-toolbar-component=button],[data-toolbar-component=button-group] [data-toolbar-component=button])){display:none}
|
package/dist/cjs/ui/Toolbar.js
CHANGED
|
@@ -23,7 +23,9 @@ var styles = {
|
|
|
23
23
|
toolbar: "_bfhk1bhr _4t3i14no _u5f31b66 _19bv1b66 _16qs1cd0",
|
|
24
24
|
toolbarResponsive: "_195gpxbi",
|
|
25
25
|
primaryToolbar: "_bfhkvuon _1tkezwfg",
|
|
26
|
-
|
|
26
|
+
toolbarSeparator: "_1mj714no",
|
|
27
|
+
hiddenSelectors: "_fy9oglyw _18shglyw _ze7rglyw",
|
|
28
|
+
hiddenSelectorsPatch: "_z5m7glyw"
|
|
27
29
|
};
|
|
28
30
|
/**
|
|
29
31
|
* A simple component representing a toolbar with box shadows - used to represent a secondary/floating toolbar
|
|
@@ -37,10 +39,11 @@ var Toolbar = exports.Toolbar = function Toolbar(_ref) {
|
|
|
37
39
|
testId = _ref.testId;
|
|
38
40
|
var isResponsiveEnabled = (0, _expValEquals.expValEquals)('platform_editor_aifc_selection_toolbar_responsive', 'isEnabled', true);
|
|
39
41
|
var toolbar = /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
40
|
-
xcss: (0, _css.cx)(styles.toolbarBase, styles.toolbar, isResponsiveEnabled && styles.toolbarResponsive, (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) && styles.hiddenSelectors),
|
|
42
|
+
xcss: (0, _css.cx)(styles.toolbarBase, styles.toolbar, isResponsiveEnabled && styles.toolbarResponsive, (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) && styles.hiddenSelectors, (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true) && styles.toolbarSeparator, (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true) && styles.hiddenSelectorsPatch),
|
|
41
43
|
role: "toolbar",
|
|
42
44
|
"aria-label": label,
|
|
43
|
-
testId: testId
|
|
45
|
+
testId: testId,
|
|
46
|
+
"data-toolbar-type": (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true) ? 'inline' : undefined
|
|
44
47
|
}, (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_toolbar_analytic', 'isEnabled', true) ? /*#__PURE__*/_react.default.createElement(_ViewEventEmitter.ViewEventEmitter, {
|
|
45
48
|
actionSubject: _ViewEventEmitter.ACTION_SUBJECT.TOOLBAR,
|
|
46
49
|
actionSubjectId: actionSubjectId
|
|
@@ -85,12 +88,14 @@ var PrimaryToolbar = exports.PrimaryToolbar = function PrimaryToolbar(_ref2) {
|
|
|
85
88
|
}, /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
86
89
|
xcss: (0, _css.cx)(styles.toolbarBase, styles.primaryToolbar, styles.hiddenSelectors),
|
|
87
90
|
role: "toolbar",
|
|
88
|
-
"aria-label": label
|
|
91
|
+
"aria-label": label,
|
|
92
|
+
"data-toolbar-type": (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true) ? 'primary' : undefined
|
|
89
93
|
}, children));
|
|
90
94
|
}
|
|
91
95
|
return /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
92
96
|
xcss: (0, _css.cx)(styles.toolbarBase, styles.primaryToolbar),
|
|
93
97
|
role: "toolbar",
|
|
94
|
-
"aria-label": label
|
|
98
|
+
"aria-label": label,
|
|
99
|
+
"data-toolbar-type": (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true) ? 'primary' : undefined
|
|
95
100
|
}, children);
|
|
96
101
|
};
|
|
@@ -14,21 +14,31 @@ var useToolbarDropdownMenu = exports.useToolbarDropdownMenu = function useToolba
|
|
|
14
14
|
return (0, _react.useContext)(ToolbarDropdownMenuContext);
|
|
15
15
|
};
|
|
16
16
|
var ToolbarDropdownMenuProvider = exports.ToolbarDropdownMenuProvider = function ToolbarDropdownMenuProvider(_ref) {
|
|
17
|
-
var children = _ref.children
|
|
17
|
+
var children = _ref.children,
|
|
18
|
+
isOpen = _ref.isOpen,
|
|
19
|
+
setIsOpen = _ref.setIsOpen;
|
|
18
20
|
var _useState = (0, _react.useState)(false),
|
|
19
21
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
isOpenInternal = _useState2[0],
|
|
23
|
+
setIsOpenInternal = _useState2[1];
|
|
22
24
|
var openMenu = function openMenu() {
|
|
23
|
-
|
|
25
|
+
if (setIsOpen !== undefined) {
|
|
26
|
+
setIsOpen(true);
|
|
27
|
+
} else {
|
|
28
|
+
setIsOpenInternal(true);
|
|
29
|
+
}
|
|
24
30
|
};
|
|
25
31
|
var closeMenu = function closeMenu() {
|
|
26
|
-
setIsOpen
|
|
32
|
+
if (setIsOpen !== undefined) {
|
|
33
|
+
setIsOpen(false);
|
|
34
|
+
} else {
|
|
35
|
+
setIsOpenInternal(false);
|
|
36
|
+
}
|
|
27
37
|
};
|
|
28
38
|
var contextValue = {
|
|
29
39
|
openMenu: openMenu,
|
|
30
40
|
closeMenu: closeMenu,
|
|
31
|
-
isOpen: isOpen
|
|
41
|
+
isOpen: isOpen !== undefined ? isOpen : isOpenInternal
|
|
32
42
|
};
|
|
33
43
|
return /*#__PURE__*/_react.default.createElement(ToolbarDropdownMenuContext.Provider, {
|
|
34
44
|
value: contextValue
|
|
@@ -5,22 +5,40 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.ToolbarSection = void 0;
|
|
8
|
+
exports.ToolbarSection = exports.SeparatorPosition = void 0;
|
|
9
9
|
require("./ToolbarSection.compiled.css");
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _runtime = require("@compiled/react/runtime");
|
|
12
12
|
var _css = require("@atlaskit/css");
|
|
13
13
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
14
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
14
15
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
16
|
+
var SeparatorPosition = exports.SeparatorPosition = /*#__PURE__*/function (SeparatorPosition) {
|
|
17
|
+
SeparatorPosition["START"] = "start";
|
|
18
|
+
SeparatorPosition["END"] = "end";
|
|
19
|
+
return SeparatorPosition;
|
|
20
|
+
}({});
|
|
15
21
|
var styles = {
|
|
16
22
|
container: "_zulp1b66 _1e0c1txw _4cvr1h6o"
|
|
17
23
|
};
|
|
18
24
|
var separator = null;
|
|
25
|
+
var ToolbarSeparator = function ToolbarSeparator() {
|
|
26
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
27
|
+
"data-toolbar-component": "separator",
|
|
28
|
+
role: "separator",
|
|
29
|
+
"aria-orientation": "vertical",
|
|
30
|
+
className: (0, _runtime.ax)(["_195gu2gc _4t3igktf _1bsbt94y _bfhkmuej"])
|
|
31
|
+
});
|
|
32
|
+
};
|
|
19
33
|
var ToolbarSection = exports.ToolbarSection = function ToolbarSection(_ref) {
|
|
20
34
|
var children = _ref.children,
|
|
21
35
|
testId = _ref.testId,
|
|
22
36
|
hasSeparator = _ref.hasSeparator;
|
|
23
|
-
return /*#__PURE__*/React.createElement(_compiled.Box, {
|
|
37
|
+
return (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true) ? /*#__PURE__*/React.createElement(_compiled.Box, {
|
|
38
|
+
xcss: (0, _css.cx)(styles.container),
|
|
39
|
+
testId: testId,
|
|
40
|
+
"data-toolbar-component": "section"
|
|
41
|
+
}, hasSeparator === SeparatorPosition.START && /*#__PURE__*/React.createElement(ToolbarSeparator, null), children, hasSeparator === SeparatorPosition.END && /*#__PURE__*/React.createElement(ToolbarSeparator, null)) : /*#__PURE__*/React.createElement(_compiled.Box, {
|
|
24
42
|
xcss: (0, _css.cx)(styles.container),
|
|
25
43
|
testId: testId,
|
|
26
44
|
"data-toolbar-component": "section"
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
Object.defineProperty(exports, "SyncBlocksIcon", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function get() {
|
|
10
|
+
return _sync.default;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
var _sync = _interopRequireDefault(require("@atlaskit/icon-lab/core/sync"));
|
package/dist/es2019/index.js
CHANGED
|
@@ -8,7 +8,7 @@ export { ToolbarDropdownItemSection } from './ui/ToolbarDropdownItemSection';
|
|
|
8
8
|
export { ToolbarNestedDropdownMenu } from './ui/ToolbarNestedDropdownMenu';
|
|
9
9
|
export { ToolbarKeyboardNavigationProvider } from './ui/ToolbarKeyboardNavigationProvider';
|
|
10
10
|
export { ToolbarKeyboardShortcutHint } from './ui/ToolbarKeyboardShortcutHint';
|
|
11
|
-
export { ToolbarSection } from './ui/ToolbarSection';
|
|
11
|
+
export { ToolbarSection, SeparatorPosition } from './ui/ToolbarSection';
|
|
12
12
|
export { ToolbarTooltip } from './ui/ToolbarTooltip';
|
|
13
13
|
export { ToolbarColorSwatch } from './ui/ToolbarColorSwatch';
|
|
14
14
|
export { useToolbarDropdownMenu, ToolbarDropdownMenuProvider } from './ui/ToolbarDropdownMenuContext';
|
|
@@ -71,6 +71,7 @@ export { RedoIcon } from './ui/icons/RedoIcon';
|
|
|
71
71
|
export { HistoryIcon } from './ui/icons/HistoryIcon';
|
|
72
72
|
export { LoomIcon } from './ui/icons/LoomIcon';
|
|
73
73
|
export { PlusIcon } from './ui/icons/PlusIcon';
|
|
74
|
+
export { SyncBlocksIcon } from './ui/icons/SyncBlocksIcon';
|
|
74
75
|
export { default as ColorPalette } from './ui/ColorPalette';
|
|
75
76
|
export { getContrastingBackgroundColor } from './ui/ColorPalette/utils';
|
|
76
77
|
export { useToolbarUI, ToolbarUIProvider } from './hooks/ui-context';
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
@container toolbar-container (max-width: 410px){._6nrqglyw .show-above-sm{display:none}._1fq21ule .show-below-sm{display:block}}
|
|
19
19
|
@container toolbar-container (max-width: 476px){._1ireglyw .show-above-md{display:none}._zy2m1ule .show-below-md{display:block}}
|
|
20
20
|
@container toolbar-container (max-width: 575px){._11u4glyw._11u4glyw .show-above-lg{display:none}._v1i61ule._v1i61ule .show-below-lg{display:block}}
|
|
21
|
+
@container toolbar-container (max-width: 648px){._e2nbglyw._e2nbglyw._e2nbglyw .show-above-lg{display:none}._ol4q1ule._ol4q1ule._ol4q1ule .show-below-lg{display:block}}
|
|
21
22
|
@container toolbar-container (max-width: 768px){._hfbeglyw .show-above-lg{display:none}._gw6d1ule .show-below-lg{display:block}}
|
|
22
23
|
@media (max-width:700px){._hmx4glyw .show-above-lg{display:none}._1rrm1ule .show-below-lg{display:block}}
|
|
23
24
|
@media (max-width:533px){._ut18glyw .show-above-md{display:none}._1nwo1ule .show-below-md{display:block}}
|
|
@@ -7,10 +7,12 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { cx } from '@atlaskit/css';
|
|
9
9
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
10
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
10
11
|
const styles = {
|
|
11
12
|
responsiveContainer: "_1bsb1osq _7cca15wb _1f38ptqj _1bx91ule _1ehg1ule _1onx1ule _1xt01ule _zg9wglyw _1a2cglyw _sum2glyw _1vtcglyw",
|
|
12
13
|
responsiveRules: "_t3a8glyw _1x5z1ule _6nrqglyw _1fq21ule _1ireglyw _zy2m1ule _hfbeglyw _gw6d1ule",
|
|
13
14
|
responsiveRulesReduced: "_j094glyw _1mc51ule _gipeglyw _311r1ule _11u4glyw _v1i61ule _19x4glyw _qck01ule",
|
|
15
|
+
responsiveRulesReducedOverridden: "_e2nbglyw _ol4q1ule",
|
|
14
16
|
responsiveRulesWrapper: "_1bx91ule _1ehg1ule _1onx1ule _1xt01ule _zg9wglyw _1a2cglyw _sum2glyw _1vtcglyw _33p2glyw _1dre1ule _u47mglyw _rut51ule _fj5dglyw _5wt61ule _hmx4glyw _1rrm1ule _ut18glyw _1nwo1ule _19fzglyw _1r831ule"
|
|
15
17
|
};
|
|
16
18
|
/**
|
|
@@ -61,7 +63,7 @@ export const ResponsiveContainer = ({
|
|
|
61
63
|
reducedBreakpoints
|
|
62
64
|
}) => {
|
|
63
65
|
return /*#__PURE__*/React.createElement(Box, {
|
|
64
|
-
xcss: cx(styles.responsiveContainer, reducedBreakpoints ? styles.responsiveRulesReduced : styles.responsiveRules)
|
|
66
|
+
xcss: cx(styles.responsiveContainer, reducedBreakpoints ? styles.responsiveRulesReduced : styles.responsiveRules, reducedBreakpoints && expValEquals('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true) && styles.responsiveRulesReducedOverridden)
|
|
65
67
|
}, children);
|
|
66
68
|
};
|
|
67
69
|
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
._18shglyw [class*=show-above-]:not(:has([data-toolbar-component=section] [data-toolbar-component=button],[data-toolbar-component=button-group] [data-toolbar-component=button])){display:none}
|
|
6
6
|
._19bv1b66{padding-left:var(--ds-space-050,4px)}
|
|
7
7
|
._1e0c1txw{display:flex}
|
|
8
|
+
._1mj714no[data-toolbar-type=inline] [data-toolbar-component=separator]{height:36px}
|
|
8
9
|
._1tkezwfg{min-height:2pc}
|
|
9
10
|
._4cvr1h6o{align-items:center}
|
|
10
11
|
._4t3i14no{height:36px}
|
|
@@ -12,4 +13,5 @@
|
|
|
12
13
|
._bfhkvuon{background-color:var(--ds-surface,#fff)}
|
|
13
14
|
._fy9oglyw [data-toolbar-component=section]:not(:has([data-toolbar-component=button])){display:none}
|
|
14
15
|
._u5f31b66{padding-right:var(--ds-space-050,4px)}
|
|
16
|
+
._z5m7glyw [data-toolbar-component=section]:not(:has(~[data-toolbar-component=section])) [data-toolbar-component=separator]{display:none}
|
|
15
17
|
._ze7rglyw [class*=show-below-]:not(:has([data-toolbar-component=section] [data-toolbar-component=button],[data-toolbar-component=button-group] [data-toolbar-component=button])){display:none}
|
|
@@ -16,7 +16,9 @@ const styles = {
|
|
|
16
16
|
toolbar: "_bfhk1bhr _4t3i14no _u5f31b66 _19bv1b66 _16qs1cd0",
|
|
17
17
|
toolbarResponsive: "_195gpxbi",
|
|
18
18
|
primaryToolbar: "_bfhkvuon _1tkezwfg",
|
|
19
|
-
|
|
19
|
+
toolbarSeparator: "_1mj714no",
|
|
20
|
+
hiddenSelectors: "_fy9oglyw _18shglyw _ze7rglyw",
|
|
21
|
+
hiddenSelectorsPatch: "_z5m7glyw"
|
|
20
22
|
};
|
|
21
23
|
/**
|
|
22
24
|
* A simple component representing a toolbar with box shadows - used to represent a secondary/floating toolbar
|
|
@@ -31,10 +33,11 @@ export const Toolbar = ({
|
|
|
31
33
|
}) => {
|
|
32
34
|
const isResponsiveEnabled = expValEquals('platform_editor_aifc_selection_toolbar_responsive', 'isEnabled', true);
|
|
33
35
|
const toolbar = /*#__PURE__*/React.createElement(Box, {
|
|
34
|
-
xcss: cx(styles.toolbarBase, styles.toolbar, isResponsiveEnabled && styles.toolbarResponsive, expValEquals('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) && styles.hiddenSelectors),
|
|
36
|
+
xcss: cx(styles.toolbarBase, styles.toolbar, isResponsiveEnabled && styles.toolbarResponsive, expValEquals('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) && styles.hiddenSelectors, expValEquals('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true) && styles.toolbarSeparator, expValEquals('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true) && styles.hiddenSelectorsPatch),
|
|
35
37
|
role: "toolbar",
|
|
36
38
|
"aria-label": label,
|
|
37
|
-
testId: testId
|
|
39
|
+
testId: testId,
|
|
40
|
+
"data-toolbar-type": expValEquals('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true) ? 'inline' : undefined
|
|
38
41
|
}, expValEquals('platform_editor_toolbar_aifc_toolbar_analytic', 'isEnabled', true) ? /*#__PURE__*/React.createElement(ViewEventEmitter, {
|
|
39
42
|
actionSubject: ACTION_SUBJECT.TOOLBAR,
|
|
40
43
|
actionSubjectId: actionSubjectId
|
|
@@ -83,12 +86,14 @@ export const PrimaryToolbar = ({
|
|
|
83
86
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
84
87
|
xcss: cx(styles.toolbarBase, styles.primaryToolbar, styles.hiddenSelectors),
|
|
85
88
|
role: "toolbar",
|
|
86
|
-
"aria-label": label
|
|
89
|
+
"aria-label": label,
|
|
90
|
+
"data-toolbar-type": expValEquals('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true) ? 'primary' : undefined
|
|
87
91
|
}, children));
|
|
88
92
|
}
|
|
89
93
|
return /*#__PURE__*/React.createElement(Box, {
|
|
90
94
|
xcss: cx(styles.toolbarBase, styles.primaryToolbar),
|
|
91
95
|
role: "toolbar",
|
|
92
|
-
"aria-label": label
|
|
96
|
+
"aria-label": label,
|
|
97
|
+
"data-toolbar-type": expValEquals('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true) ? 'primary' : undefined
|
|
93
98
|
}, children);
|
|
94
99
|
};
|
|
@@ -4,17 +4,29 @@ export const useToolbarDropdownMenu = () => {
|
|
|
4
4
|
return useContext(ToolbarDropdownMenuContext);
|
|
5
5
|
};
|
|
6
6
|
export const ToolbarDropdownMenuProvider = ({
|
|
7
|
-
children
|
|
7
|
+
children,
|
|
8
|
+
isOpen,
|
|
9
|
+
setIsOpen
|
|
8
10
|
}) => {
|
|
9
|
-
const [
|
|
10
|
-
const openMenu = () =>
|
|
11
|
+
const [isOpenInternal, setIsOpenInternal] = useState(false);
|
|
12
|
+
const openMenu = () => {
|
|
13
|
+
if (setIsOpen !== undefined) {
|
|
14
|
+
setIsOpen(true);
|
|
15
|
+
} else {
|
|
16
|
+
setIsOpenInternal(true);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
11
19
|
const closeMenu = () => {
|
|
12
|
-
setIsOpen
|
|
20
|
+
if (setIsOpen !== undefined) {
|
|
21
|
+
setIsOpen(false);
|
|
22
|
+
} else {
|
|
23
|
+
setIsOpenInternal(false);
|
|
24
|
+
}
|
|
13
25
|
};
|
|
14
26
|
const contextValue = {
|
|
15
27
|
openMenu,
|
|
16
28
|
closeMenu,
|
|
17
|
-
isOpen
|
|
29
|
+
isOpen: isOpen !== undefined ? isOpen : isOpenInternal
|
|
18
30
|
};
|
|
19
31
|
return /*#__PURE__*/React.createElement(ToolbarDropdownMenuContext.Provider, {
|
|
20
32
|
value: contextValue
|
|
@@ -4,16 +4,34 @@ import * as React from 'react';
|
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
5
|
import { cx } from '@atlaskit/css';
|
|
6
6
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
7
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
8
|
+
export let SeparatorPosition = /*#__PURE__*/function (SeparatorPosition) {
|
|
9
|
+
SeparatorPosition["START"] = "start";
|
|
10
|
+
SeparatorPosition["END"] = "end";
|
|
11
|
+
return SeparatorPosition;
|
|
12
|
+
}({});
|
|
7
13
|
const styles = {
|
|
8
14
|
container: "_zulp1b66 _1e0c1txw _4cvr1h6o"
|
|
9
15
|
};
|
|
10
16
|
const separator = null;
|
|
17
|
+
const ToolbarSeparator = () => {
|
|
18
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
19
|
+
"data-toolbar-component": "separator",
|
|
20
|
+
role: "separator",
|
|
21
|
+
"aria-orientation": "vertical",
|
|
22
|
+
className: ax(["_195gu2gc _4t3igktf _1bsbt94y _bfhkmuej"])
|
|
23
|
+
});
|
|
24
|
+
};
|
|
11
25
|
export const ToolbarSection = ({
|
|
12
26
|
children,
|
|
13
27
|
testId,
|
|
14
28
|
hasSeparator
|
|
15
29
|
}) => {
|
|
16
|
-
return /*#__PURE__*/React.createElement(Box, {
|
|
30
|
+
return expValEquals('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true) ? /*#__PURE__*/React.createElement(Box, {
|
|
31
|
+
xcss: cx(styles.container),
|
|
32
|
+
testId: testId,
|
|
33
|
+
"data-toolbar-component": "section"
|
|
34
|
+
}, hasSeparator === SeparatorPosition.START && /*#__PURE__*/React.createElement(ToolbarSeparator, null), children, hasSeparator === SeparatorPosition.END && /*#__PURE__*/React.createElement(ToolbarSeparator, null)) : /*#__PURE__*/React.createElement(Box, {
|
|
17
35
|
xcss: cx(styles.container),
|
|
18
36
|
testId: testId,
|
|
19
37
|
"data-toolbar-component": "section"
|
package/dist/esm/index.js
CHANGED
|
@@ -8,7 +8,7 @@ export { ToolbarDropdownItemSection } from './ui/ToolbarDropdownItemSection';
|
|
|
8
8
|
export { ToolbarNestedDropdownMenu } from './ui/ToolbarNestedDropdownMenu';
|
|
9
9
|
export { ToolbarKeyboardNavigationProvider } from './ui/ToolbarKeyboardNavigationProvider';
|
|
10
10
|
export { ToolbarKeyboardShortcutHint } from './ui/ToolbarKeyboardShortcutHint';
|
|
11
|
-
export { ToolbarSection } from './ui/ToolbarSection';
|
|
11
|
+
export { ToolbarSection, SeparatorPosition } from './ui/ToolbarSection';
|
|
12
12
|
export { ToolbarTooltip } from './ui/ToolbarTooltip';
|
|
13
13
|
export { ToolbarColorSwatch } from './ui/ToolbarColorSwatch';
|
|
14
14
|
export { useToolbarDropdownMenu, ToolbarDropdownMenuProvider } from './ui/ToolbarDropdownMenuContext';
|
|
@@ -71,6 +71,7 @@ export { RedoIcon } from './ui/icons/RedoIcon';
|
|
|
71
71
|
export { HistoryIcon } from './ui/icons/HistoryIcon';
|
|
72
72
|
export { LoomIcon } from './ui/icons/LoomIcon';
|
|
73
73
|
export { PlusIcon } from './ui/icons/PlusIcon';
|
|
74
|
+
export { SyncBlocksIcon } from './ui/icons/SyncBlocksIcon';
|
|
74
75
|
export { default as ColorPalette } from './ui/ColorPalette';
|
|
75
76
|
export { getContrastingBackgroundColor } from './ui/ColorPalette/utils';
|
|
76
77
|
export { useToolbarUI, ToolbarUIProvider } from './hooks/ui-context';
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
@container toolbar-container (max-width: 410px){._6nrqglyw .show-above-sm{display:none}._1fq21ule .show-below-sm{display:block}}
|
|
19
19
|
@container toolbar-container (max-width: 476px){._1ireglyw .show-above-md{display:none}._zy2m1ule .show-below-md{display:block}}
|
|
20
20
|
@container toolbar-container (max-width: 575px){._11u4glyw._11u4glyw .show-above-lg{display:none}._v1i61ule._v1i61ule .show-below-lg{display:block}}
|
|
21
|
+
@container toolbar-container (max-width: 648px){._e2nbglyw._e2nbglyw._e2nbglyw .show-above-lg{display:none}._ol4q1ule._ol4q1ule._ol4q1ule .show-below-lg{display:block}}
|
|
21
22
|
@container toolbar-container (max-width: 768px){._hfbeglyw .show-above-lg{display:none}._gw6d1ule .show-below-lg{display:block}}
|
|
22
23
|
@media (max-width:700px){._hmx4glyw .show-above-lg{display:none}._1rrm1ule .show-below-lg{display:block}}
|
|
23
24
|
@media (max-width:533px){._ut18glyw .show-above-md{display:none}._1nwo1ule .show-below-md{display:block}}
|
|
@@ -7,10 +7,12 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { cx } from '@atlaskit/css';
|
|
9
9
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
10
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
10
11
|
var styles = {
|
|
11
12
|
responsiveContainer: "_1bsb1osq _7cca15wb _1f38ptqj _1bx91ule _1ehg1ule _1onx1ule _1xt01ule _zg9wglyw _1a2cglyw _sum2glyw _1vtcglyw",
|
|
12
13
|
responsiveRules: "_t3a8glyw _1x5z1ule _6nrqglyw _1fq21ule _1ireglyw _zy2m1ule _hfbeglyw _gw6d1ule",
|
|
13
14
|
responsiveRulesReduced: "_j094glyw _1mc51ule _gipeglyw _311r1ule _11u4glyw _v1i61ule _19x4glyw _qck01ule",
|
|
15
|
+
responsiveRulesReducedOverridden: "_e2nbglyw _ol4q1ule",
|
|
14
16
|
responsiveRulesWrapper: "_1bx91ule _1ehg1ule _1onx1ule _1xt01ule _zg9wglyw _1a2cglyw _sum2glyw _1vtcglyw _33p2glyw _1dre1ule _u47mglyw _rut51ule _fj5dglyw _5wt61ule _hmx4glyw _1rrm1ule _ut18glyw _1nwo1ule _19fzglyw _1r831ule"
|
|
15
17
|
};
|
|
16
18
|
/**
|
|
@@ -60,7 +62,7 @@ export var ResponsiveContainer = function ResponsiveContainer(_ref) {
|
|
|
60
62
|
var children = _ref.children,
|
|
61
63
|
reducedBreakpoints = _ref.reducedBreakpoints;
|
|
62
64
|
return /*#__PURE__*/React.createElement(Box, {
|
|
63
|
-
xcss: cx(styles.responsiveContainer, reducedBreakpoints ? styles.responsiveRulesReduced : styles.responsiveRules)
|
|
65
|
+
xcss: cx(styles.responsiveContainer, reducedBreakpoints ? styles.responsiveRulesReduced : styles.responsiveRules, reducedBreakpoints && expValEquals('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true) && styles.responsiveRulesReducedOverridden)
|
|
64
66
|
}, children);
|
|
65
67
|
};
|
|
66
68
|
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
._18shglyw [class*=show-above-]:not(:has([data-toolbar-component=section] [data-toolbar-component=button],[data-toolbar-component=button-group] [data-toolbar-component=button])){display:none}
|
|
6
6
|
._19bv1b66{padding-left:var(--ds-space-050,4px)}
|
|
7
7
|
._1e0c1txw{display:flex}
|
|
8
|
+
._1mj714no[data-toolbar-type=inline] [data-toolbar-component=separator]{height:36px}
|
|
8
9
|
._1tkezwfg{min-height:2pc}
|
|
9
10
|
._4cvr1h6o{align-items:center}
|
|
10
11
|
._4t3i14no{height:36px}
|
|
@@ -12,4 +13,5 @@
|
|
|
12
13
|
._bfhkvuon{background-color:var(--ds-surface,#fff)}
|
|
13
14
|
._fy9oglyw [data-toolbar-component=section]:not(:has([data-toolbar-component=button])){display:none}
|
|
14
15
|
._u5f31b66{padding-right:var(--ds-space-050,4px)}
|
|
16
|
+
._z5m7glyw [data-toolbar-component=section]:not(:has(~[data-toolbar-component=section])) [data-toolbar-component=separator]{display:none}
|
|
15
17
|
._ze7rglyw [class*=show-below-]:not(:has([data-toolbar-component=section] [data-toolbar-component=button],[data-toolbar-component=button-group] [data-toolbar-component=button])){display:none}
|
package/dist/esm/ui/Toolbar.js
CHANGED
|
@@ -16,7 +16,9 @@ var styles = {
|
|
|
16
16
|
toolbar: "_bfhk1bhr _4t3i14no _u5f31b66 _19bv1b66 _16qs1cd0",
|
|
17
17
|
toolbarResponsive: "_195gpxbi",
|
|
18
18
|
primaryToolbar: "_bfhkvuon _1tkezwfg",
|
|
19
|
-
|
|
19
|
+
toolbarSeparator: "_1mj714no",
|
|
20
|
+
hiddenSelectors: "_fy9oglyw _18shglyw _ze7rglyw",
|
|
21
|
+
hiddenSelectorsPatch: "_z5m7glyw"
|
|
20
22
|
};
|
|
21
23
|
/**
|
|
22
24
|
* A simple component representing a toolbar with box shadows - used to represent a secondary/floating toolbar
|
|
@@ -30,10 +32,11 @@ export var Toolbar = function Toolbar(_ref) {
|
|
|
30
32
|
testId = _ref.testId;
|
|
31
33
|
var isResponsiveEnabled = expValEquals('platform_editor_aifc_selection_toolbar_responsive', 'isEnabled', true);
|
|
32
34
|
var toolbar = /*#__PURE__*/React.createElement(Box, {
|
|
33
|
-
xcss: cx(styles.toolbarBase, styles.toolbar, isResponsiveEnabled && styles.toolbarResponsive, expValEquals('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) && styles.hiddenSelectors),
|
|
35
|
+
xcss: cx(styles.toolbarBase, styles.toolbar, isResponsiveEnabled && styles.toolbarResponsive, expValEquals('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) && styles.hiddenSelectors, expValEquals('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true) && styles.toolbarSeparator, expValEquals('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true) && styles.hiddenSelectorsPatch),
|
|
34
36
|
role: "toolbar",
|
|
35
37
|
"aria-label": label,
|
|
36
|
-
testId: testId
|
|
38
|
+
testId: testId,
|
|
39
|
+
"data-toolbar-type": expValEquals('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true) ? 'inline' : undefined
|
|
37
40
|
}, expValEquals('platform_editor_toolbar_aifc_toolbar_analytic', 'isEnabled', true) ? /*#__PURE__*/React.createElement(ViewEventEmitter, {
|
|
38
41
|
actionSubject: ACTION_SUBJECT.TOOLBAR,
|
|
39
42
|
actionSubjectId: actionSubjectId
|
|
@@ -78,12 +81,14 @@ export var PrimaryToolbar = function PrimaryToolbar(_ref2) {
|
|
|
78
81
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
79
82
|
xcss: cx(styles.toolbarBase, styles.primaryToolbar, styles.hiddenSelectors),
|
|
80
83
|
role: "toolbar",
|
|
81
|
-
"aria-label": label
|
|
84
|
+
"aria-label": label,
|
|
85
|
+
"data-toolbar-type": expValEquals('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true) ? 'primary' : undefined
|
|
82
86
|
}, children));
|
|
83
87
|
}
|
|
84
88
|
return /*#__PURE__*/React.createElement(Box, {
|
|
85
89
|
xcss: cx(styles.toolbarBase, styles.primaryToolbar),
|
|
86
90
|
role: "toolbar",
|
|
87
|
-
"aria-label": label
|
|
91
|
+
"aria-label": label,
|
|
92
|
+
"data-toolbar-type": expValEquals('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true) ? 'primary' : undefined
|
|
88
93
|
}, children);
|
|
89
94
|
};
|
|
@@ -5,21 +5,31 @@ export var useToolbarDropdownMenu = function useToolbarDropdownMenu() {
|
|
|
5
5
|
return useContext(ToolbarDropdownMenuContext);
|
|
6
6
|
};
|
|
7
7
|
export var ToolbarDropdownMenuProvider = function ToolbarDropdownMenuProvider(_ref) {
|
|
8
|
-
var children = _ref.children
|
|
8
|
+
var children = _ref.children,
|
|
9
|
+
isOpen = _ref.isOpen,
|
|
10
|
+
setIsOpen = _ref.setIsOpen;
|
|
9
11
|
var _useState = useState(false),
|
|
10
12
|
_useState2 = _slicedToArray(_useState, 2),
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
isOpenInternal = _useState2[0],
|
|
14
|
+
setIsOpenInternal = _useState2[1];
|
|
13
15
|
var openMenu = function openMenu() {
|
|
14
|
-
|
|
16
|
+
if (setIsOpen !== undefined) {
|
|
17
|
+
setIsOpen(true);
|
|
18
|
+
} else {
|
|
19
|
+
setIsOpenInternal(true);
|
|
20
|
+
}
|
|
15
21
|
};
|
|
16
22
|
var closeMenu = function closeMenu() {
|
|
17
|
-
setIsOpen
|
|
23
|
+
if (setIsOpen !== undefined) {
|
|
24
|
+
setIsOpen(false);
|
|
25
|
+
} else {
|
|
26
|
+
setIsOpenInternal(false);
|
|
27
|
+
}
|
|
18
28
|
};
|
|
19
29
|
var contextValue = {
|
|
20
30
|
openMenu: openMenu,
|
|
21
31
|
closeMenu: closeMenu,
|
|
22
|
-
isOpen: isOpen
|
|
32
|
+
isOpen: isOpen !== undefined ? isOpen : isOpenInternal
|
|
23
33
|
};
|
|
24
34
|
return /*#__PURE__*/React.createElement(ToolbarDropdownMenuContext.Provider, {
|
|
25
35
|
value: contextValue
|
|
@@ -4,15 +4,33 @@ import * as React from 'react';
|
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
5
|
import { cx } from '@atlaskit/css';
|
|
6
6
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
7
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
8
|
+
export var SeparatorPosition = /*#__PURE__*/function (SeparatorPosition) {
|
|
9
|
+
SeparatorPosition["START"] = "start";
|
|
10
|
+
SeparatorPosition["END"] = "end";
|
|
11
|
+
return SeparatorPosition;
|
|
12
|
+
}({});
|
|
7
13
|
var styles = {
|
|
8
14
|
container: "_zulp1b66 _1e0c1txw _4cvr1h6o"
|
|
9
15
|
};
|
|
10
16
|
var separator = null;
|
|
17
|
+
var ToolbarSeparator = function ToolbarSeparator() {
|
|
18
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
19
|
+
"data-toolbar-component": "separator",
|
|
20
|
+
role: "separator",
|
|
21
|
+
"aria-orientation": "vertical",
|
|
22
|
+
className: ax(["_195gu2gc _4t3igktf _1bsbt94y _bfhkmuej"])
|
|
23
|
+
});
|
|
24
|
+
};
|
|
11
25
|
export var ToolbarSection = function ToolbarSection(_ref) {
|
|
12
26
|
var children = _ref.children,
|
|
13
27
|
testId = _ref.testId,
|
|
14
28
|
hasSeparator = _ref.hasSeparator;
|
|
15
|
-
return /*#__PURE__*/React.createElement(Box, {
|
|
29
|
+
return expValEquals('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true) ? /*#__PURE__*/React.createElement(Box, {
|
|
30
|
+
xcss: cx(styles.container),
|
|
31
|
+
testId: testId,
|
|
32
|
+
"data-toolbar-component": "section"
|
|
33
|
+
}, hasSeparator === SeparatorPosition.START && /*#__PURE__*/React.createElement(ToolbarSeparator, null), children, hasSeparator === SeparatorPosition.END && /*#__PURE__*/React.createElement(ToolbarSeparator, null)) : /*#__PURE__*/React.createElement(Box, {
|
|
16
34
|
xcss: cx(styles.container),
|
|
17
35
|
testId: testId,
|
|
18
36
|
"data-toolbar-component": "section"
|
package/dist/types/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export { ToolbarDropdownItemSection } from './ui/ToolbarDropdownItemSection';
|
|
|
7
7
|
export { ToolbarNestedDropdownMenu } from './ui/ToolbarNestedDropdownMenu';
|
|
8
8
|
export { ToolbarKeyboardNavigationProvider } from './ui/ToolbarKeyboardNavigationProvider';
|
|
9
9
|
export { ToolbarKeyboardShortcutHint } from './ui/ToolbarKeyboardShortcutHint';
|
|
10
|
-
export { ToolbarSection } from './ui/ToolbarSection';
|
|
10
|
+
export { ToolbarSection, SeparatorPosition } from './ui/ToolbarSection';
|
|
11
11
|
export { ToolbarTooltip } from './ui/ToolbarTooltip';
|
|
12
12
|
export { ToolbarColorSwatch } from './ui/ToolbarColorSwatch';
|
|
13
13
|
export { useToolbarDropdownMenu, ToolbarDropdownMenuProvider, } from './ui/ToolbarDropdownMenuContext';
|
|
@@ -70,6 +70,7 @@ export { RedoIcon } from './ui/icons/RedoIcon';
|
|
|
70
70
|
export { HistoryIcon } from './ui/icons/HistoryIcon';
|
|
71
71
|
export { LoomIcon } from './ui/icons/LoomIcon';
|
|
72
72
|
export { PlusIcon } from './ui/icons/PlusIcon';
|
|
73
|
+
export { SyncBlocksIcon } from './ui/icons/SyncBlocksIcon';
|
|
73
74
|
export { default as ColorPalette } from './ui/ColorPalette';
|
|
74
75
|
export { getContrastingBackgroundColor } from './ui/ColorPalette/utils';
|
|
75
76
|
export type { IconComponent, ToolbarKeyboardNavigationProviderConfig } from './types';
|
|
@@ -7,6 +7,8 @@ interface ToolbarDropdownMenuContextValue {
|
|
|
7
7
|
export declare const useToolbarDropdownMenu: () => ToolbarDropdownMenuContextValue | undefined;
|
|
8
8
|
interface ToolbarDropdownMenuProviderProps {
|
|
9
9
|
children: React.ReactNode;
|
|
10
|
+
isOpen?: boolean;
|
|
11
|
+
setIsOpen?: (isOpen: boolean) => void;
|
|
10
12
|
}
|
|
11
|
-
export declare const ToolbarDropdownMenuProvider: ({ children }: ToolbarDropdownMenuProviderProps) => React.JSX.Element;
|
|
13
|
+
export declare const ToolbarDropdownMenuProvider: ({ children, isOpen, setIsOpen, }: ToolbarDropdownMenuProviderProps) => React.JSX.Element;
|
|
12
14
|
export {};
|
|
@@ -3,12 +3,16 @@
|
|
|
3
3
|
* @jsx jsx
|
|
4
4
|
*/
|
|
5
5
|
import { type ReactNode } from 'react';
|
|
6
|
+
export declare enum SeparatorPosition {
|
|
7
|
+
START = "start",
|
|
8
|
+
END = "end"
|
|
9
|
+
}
|
|
6
10
|
type ToolbarSectionProps = {
|
|
7
11
|
children?: ReactNode;
|
|
8
12
|
/**
|
|
9
|
-
* Whether to add a separator at the start of the section
|
|
13
|
+
* Whether to add a separator at the start or end of the section
|
|
10
14
|
*/
|
|
11
|
-
hasSeparator?: boolean;
|
|
15
|
+
hasSeparator?: SeparatorPosition | boolean;
|
|
12
16
|
testId?: string;
|
|
13
17
|
};
|
|
14
18
|
export declare const ToolbarSection: ({ children, testId, hasSeparator }: ToolbarSectionProps) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as SyncBlocksIcon } from '@atlaskit/icon-lab/core/sync';
|
|
@@ -7,7 +7,7 @@ export { ToolbarDropdownItemSection } from './ui/ToolbarDropdownItemSection';
|
|
|
7
7
|
export { ToolbarNestedDropdownMenu } from './ui/ToolbarNestedDropdownMenu';
|
|
8
8
|
export { ToolbarKeyboardNavigationProvider } from './ui/ToolbarKeyboardNavigationProvider';
|
|
9
9
|
export { ToolbarKeyboardShortcutHint } from './ui/ToolbarKeyboardShortcutHint';
|
|
10
|
-
export { ToolbarSection } from './ui/ToolbarSection';
|
|
10
|
+
export { ToolbarSection, SeparatorPosition } from './ui/ToolbarSection';
|
|
11
11
|
export { ToolbarTooltip } from './ui/ToolbarTooltip';
|
|
12
12
|
export { ToolbarColorSwatch } from './ui/ToolbarColorSwatch';
|
|
13
13
|
export { useToolbarDropdownMenu, ToolbarDropdownMenuProvider, } from './ui/ToolbarDropdownMenuContext';
|
|
@@ -70,6 +70,7 @@ export { RedoIcon } from './ui/icons/RedoIcon';
|
|
|
70
70
|
export { HistoryIcon } from './ui/icons/HistoryIcon';
|
|
71
71
|
export { LoomIcon } from './ui/icons/LoomIcon';
|
|
72
72
|
export { PlusIcon } from './ui/icons/PlusIcon';
|
|
73
|
+
export { SyncBlocksIcon } from './ui/icons/SyncBlocksIcon';
|
|
73
74
|
export { default as ColorPalette } from './ui/ColorPalette';
|
|
74
75
|
export { getContrastingBackgroundColor } from './ui/ColorPalette/utils';
|
|
75
76
|
export type { IconComponent, ToolbarKeyboardNavigationProviderConfig } from './types';
|
|
@@ -7,6 +7,8 @@ interface ToolbarDropdownMenuContextValue {
|
|
|
7
7
|
export declare const useToolbarDropdownMenu: () => ToolbarDropdownMenuContextValue | undefined;
|
|
8
8
|
interface ToolbarDropdownMenuProviderProps {
|
|
9
9
|
children: React.ReactNode;
|
|
10
|
+
isOpen?: boolean;
|
|
11
|
+
setIsOpen?: (isOpen: boolean) => void;
|
|
10
12
|
}
|
|
11
|
-
export declare const ToolbarDropdownMenuProvider: ({ children }: ToolbarDropdownMenuProviderProps) => React.JSX.Element;
|
|
13
|
+
export declare const ToolbarDropdownMenuProvider: ({ children, isOpen, setIsOpen, }: ToolbarDropdownMenuProviderProps) => React.JSX.Element;
|
|
12
14
|
export {};
|
|
@@ -3,12 +3,16 @@
|
|
|
3
3
|
* @jsx jsx
|
|
4
4
|
*/
|
|
5
5
|
import { type ReactNode } from 'react';
|
|
6
|
+
export declare enum SeparatorPosition {
|
|
7
|
+
START = "start",
|
|
8
|
+
END = "end"
|
|
9
|
+
}
|
|
6
10
|
type ToolbarSectionProps = {
|
|
7
11
|
children?: ReactNode;
|
|
8
12
|
/**
|
|
9
|
-
* Whether to add a separator at the start of the section
|
|
13
|
+
* Whether to add a separator at the start or end of the section
|
|
10
14
|
*/
|
|
11
|
-
hasSeparator?: boolean;
|
|
15
|
+
hasSeparator?: SeparatorPosition | boolean;
|
|
12
16
|
testId?: string;
|
|
13
17
|
};
|
|
14
18
|
export declare const ToolbarSection: ({ children, testId, hasSeparator }: ToolbarSectionProps) => JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as SyncBlocksIcon } from '@atlaskit/icon-lab/core/sync';
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"registry": "https://registry.npmjs.org/"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.
|
|
6
|
+
"version": "0.14.0",
|
|
7
7
|
"description": "Common UI for Toolbars across the platform",
|
|
8
8
|
"atlassian": {
|
|
9
9
|
"team": "Editor: Jenga",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"@atlaskit/button": "^23.5.0",
|
|
26
26
|
"@atlaskit/css": "^0.14.0",
|
|
27
27
|
"@atlaskit/dropdown-menu": "^16.3.0",
|
|
28
|
-
"@atlaskit/icon": "^28.
|
|
29
|
-
"@atlaskit/icon-lab": "^5.
|
|
28
|
+
"@atlaskit/icon": "^28.4.0",
|
|
29
|
+
"@atlaskit/icon-lab": "^5.9.0",
|
|
30
30
|
"@atlaskit/logo": "^19.8.0",
|
|
31
31
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
32
32
|
"@atlaskit/platform-feature-flags-react": "^0.3.0",
|