@atlaskit/editor-toolbar 0.8.5 → 0.8.6
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 +8 -0
- package/dist/cjs/ui/ResponsiveContainer.compiled.css +7 -1
- package/dist/cjs/ui/ResponsiveContainer.js +13 -2
- package/dist/cjs/ui/Toolbar.compiled.css +2 -1
- package/dist/cjs/ui/Toolbar.js +11 -2
- package/dist/es2019/ui/ResponsiveContainer.compiled.css +7 -1
- package/dist/es2019/ui/ResponsiveContainer.js +13 -1
- package/dist/es2019/ui/Toolbar.compiled.css +2 -1
- package/dist/es2019/ui/Toolbar.js +12 -3
- package/dist/esm/ui/ResponsiveContainer.compiled.css +7 -1
- package/dist/esm/ui/ResponsiveContainer.js +12 -1
- package/dist/esm/ui/Toolbar.compiled.css +2 -1
- package/dist/esm/ui/Toolbar.js +12 -3
- package/dist/types/ui/ResponsiveContainer.d.ts +6 -0
- package/dist/types/ui/Toolbar.d.ts +2 -0
- package/dist/types-ts4.5/ui/ResponsiveContainer.d.ts +6 -0
- package/dist/types-ts4.5/ui/Toolbar.d.ts +2 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-toolbar
|
|
2
2
|
|
|
3
|
+
## 0.8.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`345a4e1939d12`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/345a4e1939d12) -
|
|
8
|
+
[ux] [ED-28733] Add responsiveness support for selection toolbar
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 0.8.5
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
._1f38ptqj{container-name:toolbar-container}
|
|
4
4
|
._7cca15wb{container-type:inline-size}
|
|
5
5
|
._zg9wglyw .show-below-lg, ._1a2cglyw .show-below-md, ._sum2glyw .show-below-sm, ._1vtcglyw .show-below-xl{display:none}
|
|
6
|
+
@container editor-area (max-width: 365px){._33p2glyw .show-above-sm{display:none}._1dre1ule .show-below-sm{display:block}}
|
|
7
|
+
@container editor-area (max-width: 533px){._u47mglyw .show-above-md{display:none}._rut51ule .show-below-md{display:block}}
|
|
8
|
+
@container editor-area (max-width: 700px){._fj5dglyw .show-above-lg{display:none}._5wt61ule .show-below-lg{display:block}}
|
|
6
9
|
@container toolbar-container (max-width: 1024px){._19x4glyw._19x4glyw .show-above-xl{display:none}._qck01ule._qck01ule .show-below-xl{display:block}._t3a8glyw .show-above-xl{display:none}._1x5z1ule .show-below-xl{display:block}}
|
|
7
10
|
@container toolbar-container (max-width: 210px){._48suglyw .show-above-sm{display:none}._j2p61ule .show-below-sm{display:block}._j094glyw._j094glyw .show-above-sm{display:none}._1mc51ule._1mc51ule .show-below-sm{display:block}}
|
|
8
11
|
@container toolbar-container (max-width: 350px){._1vg1glyw .show-above-md{display:none}._1ei51ule .show-below-md{display:block}}
|
|
@@ -11,4 +14,7 @@
|
|
|
11
14
|
@container toolbar-container (max-width: 476px){._1ireglyw .show-above-md{display:none}._zy2m1ule .show-below-md{display:block}}
|
|
12
15
|
@container toolbar-container (max-width: 500px){._pjeuglyw .show-above-lg{display:none}._3bio1ule .show-below-lg{display:block}}
|
|
13
16
|
@container toolbar-container (max-width: 575px){._11u4glyw._11u4glyw .show-above-lg{display:none}._v1i61ule._v1i61ule .show-below-lg{display:block}}
|
|
14
|
-
@container toolbar-container (max-width: 768px){._hfbeglyw .show-above-lg{display:none}._gw6d1ule .show-below-lg{display:block}}
|
|
17
|
+
@container toolbar-container (max-width: 768px){._hfbeglyw .show-above-lg{display:none}._gw6d1ule .show-below-lg{display:block}}
|
|
18
|
+
@media (max-width:700px){._hmx4glyw .show-above-lg{display:none}._1rrm1ule .show-below-lg{display:block}}
|
|
19
|
+
@media (max-width:533px){._ut18glyw .show-above-md{display:none}._1nwo1ule .show-below-md{display:block}}
|
|
20
|
+
@media (max-width:365px){._19fzglyw .show-above-sm{display:none}._1r831ule .show-below-sm{display:block}}
|
|
@@ -8,7 +8,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", {
|
|
9
9
|
value: true
|
|
10
10
|
});
|
|
11
|
-
exports.ResponsiveContainer = void 0;
|
|
11
|
+
exports.ResponsiveWrapper = exports.ResponsiveContainer = void 0;
|
|
12
12
|
require("./ResponsiveContainer.compiled.css");
|
|
13
13
|
var _runtime = require("@compiled/react/runtime");
|
|
14
14
|
var _react = _interopRequireDefault(require("react"));
|
|
@@ -19,7 +19,8 @@ var styles = {
|
|
|
19
19
|
responsiveContainer: "_1bsb1osq _7cca15wb _1f38ptqj _1bx91ule _1ehg1ule _1onx1ule _1xt01ule _zg9wglyw _1a2cglyw _sum2glyw _1vtcglyw",
|
|
20
20
|
responsiveRules: "_t3a8glyw _1x5z1ule _6nrqglyw _1fq21ule _1ireglyw _zy2m1ule _hfbeglyw _gw6d1ule",
|
|
21
21
|
responsiveRulesReduced: "_j094glyw _1mc51ule _gipeglyw _311r1ule _11u4glyw _v1i61ule _19x4glyw _qck01ule",
|
|
22
|
-
responsiveRulesReducedOld: "_t3a8glyw _1x5z1ule _48suglyw _j2p61ule _1vg1glyw _1ei51ule _pjeuglyw _3bio1ule"
|
|
22
|
+
responsiveRulesReducedOld: "_t3a8glyw _1x5z1ule _48suglyw _j2p61ule _1vg1glyw _1ei51ule _pjeuglyw _3bio1ule",
|
|
23
|
+
responsiveRulesWrapper: "_1bx91ule _1ehg1ule _1onx1ule _1xt01ule _zg9wglyw _1a2cglyw _sum2glyw _1vtcglyw _33p2glyw _1dre1ule _u47mglyw _rut51ule _fj5dglyw _5wt61ule _hmx4glyw _1rrm1ule _ut18glyw _1nwo1ule _19fzglyw _1r831ule"
|
|
23
24
|
};
|
|
24
25
|
/**
|
|
25
26
|
* A responsive container that enables container query-based responsive design using CSS container queries.
|
|
@@ -70,4 +71,14 @@ var ResponsiveContainer = exports.ResponsiveContainer = function ResponsiveConta
|
|
|
70
71
|
return /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
71
72
|
xcss: (0, _css.cx)(styles.responsiveContainer, reducedBreakpoints ? (0, _experiments.editorExperiment)('platform_editor_toolbar_aifc_patch_2', true) ? styles.responsiveRulesReduced : styles.responsiveRulesReducedOld : styles.responsiveRules)
|
|
72
73
|
}, children);
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* A wrapper that supports responsiveness with media queries. It needs to used together with Show component
|
|
78
|
+
*/
|
|
79
|
+
var ResponsiveWrapper = exports.ResponsiveWrapper = function ResponsiveWrapper(_ref2) {
|
|
80
|
+
var children = _ref2.children;
|
|
81
|
+
return /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
82
|
+
xcss: styles.responsiveRulesWrapper
|
|
83
|
+
}, children);
|
|
73
84
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
._2rko1qi0{border-radius:var(--ds-radius-medium,6px)}
|
|
3
|
-
._zulp1b66{gap:var(--ds-space-050,4px)}
|
|
3
|
+
._zulp1b66{gap:var(--ds-space-050,4px)}
|
|
4
|
+
._195gpxbi{margin-inline:var(--ds-space-200,1pc)}._16qs1cd0{box-shadow:var(--ds-shadow-overlay,0 8px 9pt #091e4226,0 0 1px #091e424f)}
|
|
4
5
|
._18shglyw [class*=show-above-]:not(:has([data-toolbar-component=section] [data-toolbar-component=button],[data-toolbar-component=button-group] [data-toolbar-component=button])), ._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}
|
|
5
6
|
._19bv1b66{padding-left:var(--ds-space-050,4px)}
|
|
6
7
|
._1e0c1txw{display:flex}
|
package/dist/cjs/ui/Toolbar.js
CHANGED
|
@@ -18,20 +18,29 @@ var _ResponsiveContainer = require("./ResponsiveContainer");
|
|
|
18
18
|
var styles = {
|
|
19
19
|
toolbarBase: "_2rko1qi0 _zulp1b66 _1e0c1txw _4cvr1h6o",
|
|
20
20
|
toolbar: "_bfhk1bhr _4t3i14no _u5f31b66 _19bv1b66 _16qs1cd0",
|
|
21
|
+
toolbarResponsive: "_195gpxbi",
|
|
21
22
|
primaryToolbar: "_bfhkvuon _1tkezwfg",
|
|
22
23
|
hiddenSelectors: "_fy9oglyw _18shglyw _ze7rglyw"
|
|
23
24
|
};
|
|
24
25
|
/**
|
|
25
26
|
* A simple component representing a toolbar with box shadows - used to represent a secondary/floating toolbar
|
|
27
|
+
*
|
|
28
|
+
* @note: Responsiveness support replies on container query with container editor-area and media query
|
|
26
29
|
*/
|
|
27
30
|
var Toolbar = exports.Toolbar = function Toolbar(_ref) {
|
|
28
31
|
var children = _ref.children,
|
|
29
32
|
label = _ref.label;
|
|
30
|
-
|
|
31
|
-
|
|
33
|
+
var isResponsiveEnabled = (0, _expValEquals.expValEquals)('platform_editor_aifc_selection_toolbar_responsive', 'isEnabled', true);
|
|
34
|
+
var toolbar = /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
35
|
+
xcss: (0, _css.cx)(styles.toolbarBase, styles.toolbar, isResponsiveEnabled && styles.toolbarResponsive, (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) && styles.hiddenSelectors),
|
|
32
36
|
role: "toolbar",
|
|
33
37
|
"aria-label": label
|
|
34
38
|
}, children);
|
|
39
|
+
if (isResponsiveEnabled) {
|
|
40
|
+
return /*#__PURE__*/_react.default.createElement(_ResponsiveContainer.ResponsiveWrapper, null, toolbar);
|
|
41
|
+
} else {
|
|
42
|
+
return toolbar;
|
|
43
|
+
}
|
|
35
44
|
};
|
|
36
45
|
/**
|
|
37
46
|
* A simple component representing a toolbar without box shadows - used to represent a primary toolbar
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
._1f38ptqj{container-name:toolbar-container}
|
|
4
4
|
._7cca15wb{container-type:inline-size}
|
|
5
5
|
._zg9wglyw .show-below-lg, ._1a2cglyw .show-below-md, ._sum2glyw .show-below-sm, ._1vtcglyw .show-below-xl{display:none}
|
|
6
|
+
@container editor-area (max-width: 365px){._33p2glyw .show-above-sm{display:none}._1dre1ule .show-below-sm{display:block}}
|
|
7
|
+
@container editor-area (max-width: 533px){._u47mglyw .show-above-md{display:none}._rut51ule .show-below-md{display:block}}
|
|
8
|
+
@container editor-area (max-width: 700px){._fj5dglyw .show-above-lg{display:none}._5wt61ule .show-below-lg{display:block}}
|
|
6
9
|
@container toolbar-container (max-width: 1024px){._19x4glyw._19x4glyw .show-above-xl{display:none}._qck01ule._qck01ule .show-below-xl{display:block}._t3a8glyw .show-above-xl{display:none}._1x5z1ule .show-below-xl{display:block}}
|
|
7
10
|
@container toolbar-container (max-width: 210px){._48suglyw .show-above-sm{display:none}._j2p61ule .show-below-sm{display:block}._j094glyw._j094glyw .show-above-sm{display:none}._1mc51ule._1mc51ule .show-below-sm{display:block}}
|
|
8
11
|
@container toolbar-container (max-width: 350px){._1vg1glyw .show-above-md{display:none}._1ei51ule .show-below-md{display:block}}
|
|
@@ -11,4 +14,7 @@
|
|
|
11
14
|
@container toolbar-container (max-width: 476px){._1ireglyw .show-above-md{display:none}._zy2m1ule .show-below-md{display:block}}
|
|
12
15
|
@container toolbar-container (max-width: 500px){._pjeuglyw .show-above-lg{display:none}._3bio1ule .show-below-lg{display:block}}
|
|
13
16
|
@container toolbar-container (max-width: 575px){._11u4glyw._11u4glyw .show-above-lg{display:none}._v1i61ule._v1i61ule .show-below-lg{display:block}}
|
|
14
|
-
@container toolbar-container (max-width: 768px){._hfbeglyw .show-above-lg{display:none}._gw6d1ule .show-below-lg{display:block}}
|
|
17
|
+
@container toolbar-container (max-width: 768px){._hfbeglyw .show-above-lg{display:none}._gw6d1ule .show-below-lg{display:block}}
|
|
18
|
+
@media (max-width:700px){._hmx4glyw .show-above-lg{display:none}._1rrm1ule .show-below-lg{display:block}}
|
|
19
|
+
@media (max-width:533px){._ut18glyw .show-above-md{display:none}._1nwo1ule .show-below-md{display:block}}
|
|
20
|
+
@media (max-width:365px){._19fzglyw .show-above-sm{display:none}._1r831ule .show-below-sm{display:block}}
|
|
@@ -12,7 +12,8 @@ const styles = {
|
|
|
12
12
|
responsiveContainer: "_1bsb1osq _7cca15wb _1f38ptqj _1bx91ule _1ehg1ule _1onx1ule _1xt01ule _zg9wglyw _1a2cglyw _sum2glyw _1vtcglyw",
|
|
13
13
|
responsiveRules: "_t3a8glyw _1x5z1ule _6nrqglyw _1fq21ule _1ireglyw _zy2m1ule _hfbeglyw _gw6d1ule",
|
|
14
14
|
responsiveRulesReduced: "_j094glyw _1mc51ule _gipeglyw _311r1ule _11u4glyw _v1i61ule _19x4glyw _qck01ule",
|
|
15
|
-
responsiveRulesReducedOld: "_t3a8glyw _1x5z1ule _48suglyw _j2p61ule _1vg1glyw _1ei51ule _pjeuglyw _3bio1ule"
|
|
15
|
+
responsiveRulesReducedOld: "_t3a8glyw _1x5z1ule _48suglyw _j2p61ule _1vg1glyw _1ei51ule _pjeuglyw _3bio1ule",
|
|
16
|
+
responsiveRulesWrapper: "_1bx91ule _1ehg1ule _1onx1ule _1xt01ule _zg9wglyw _1a2cglyw _sum2glyw _1vtcglyw _33p2glyw _1dre1ule _u47mglyw _rut51ule _fj5dglyw _5wt61ule _hmx4glyw _1rrm1ule _ut18glyw _1nwo1ule _19fzglyw _1r831ule"
|
|
16
17
|
};
|
|
17
18
|
/**
|
|
18
19
|
* A responsive container that enables container query-based responsive design using CSS container queries.
|
|
@@ -64,4 +65,15 @@ export const ResponsiveContainer = ({
|
|
|
64
65
|
return /*#__PURE__*/React.createElement(Box, {
|
|
65
66
|
xcss: cx(styles.responsiveContainer, reducedBreakpoints ? editorExperiment('platform_editor_toolbar_aifc_patch_2', true) ? styles.responsiveRulesReduced : styles.responsiveRulesReducedOld : styles.responsiveRules)
|
|
66
67
|
}, children);
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* A wrapper that supports responsiveness with media queries. It needs to used together with Show component
|
|
72
|
+
*/
|
|
73
|
+
export const ResponsiveWrapper = ({
|
|
74
|
+
children
|
|
75
|
+
}) => {
|
|
76
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
77
|
+
xcss: styles.responsiveRulesWrapper
|
|
78
|
+
}, children);
|
|
67
79
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
._2rko1qi0{border-radius:var(--ds-radius-medium,6px)}
|
|
3
|
-
._zulp1b66{gap:var(--ds-space-050,4px)}
|
|
3
|
+
._zulp1b66{gap:var(--ds-space-050,4px)}
|
|
4
|
+
._195gpxbi{margin-inline:var(--ds-space-200,1pc)}._16qs1cd0{box-shadow:var(--ds-shadow-overlay,0 8px 9pt #091e4226,0 0 1px #091e424f)}
|
|
4
5
|
._18shglyw [class*=show-above-]:not(:has([data-toolbar-component=section] [data-toolbar-component=button],[data-toolbar-component=button-group] [data-toolbar-component=button])), ._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}
|
|
5
6
|
._19bv1b66{padding-left:var(--ds-space-050,4px)}
|
|
6
7
|
._1e0c1txw{display:flex}
|
|
@@ -7,25 +7,34 @@ import React from 'react';
|
|
|
7
7
|
import { cx } from '@atlaskit/css';
|
|
8
8
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
9
9
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
10
|
-
import { ResponsiveContainer } from './ResponsiveContainer';
|
|
10
|
+
import { ResponsiveContainer, ResponsiveWrapper } from './ResponsiveContainer';
|
|
11
11
|
const styles = {
|
|
12
12
|
toolbarBase: "_2rko1qi0 _zulp1b66 _1e0c1txw _4cvr1h6o",
|
|
13
13
|
toolbar: "_bfhk1bhr _4t3i14no _u5f31b66 _19bv1b66 _16qs1cd0",
|
|
14
|
+
toolbarResponsive: "_195gpxbi",
|
|
14
15
|
primaryToolbar: "_bfhkvuon _1tkezwfg",
|
|
15
16
|
hiddenSelectors: "_fy9oglyw _18shglyw _ze7rglyw"
|
|
16
17
|
};
|
|
17
18
|
/**
|
|
18
19
|
* A simple component representing a toolbar with box shadows - used to represent a secondary/floating toolbar
|
|
20
|
+
*
|
|
21
|
+
* @note: Responsiveness support replies on container query with container editor-area and media query
|
|
19
22
|
*/
|
|
20
23
|
export const Toolbar = ({
|
|
21
24
|
children,
|
|
22
25
|
label
|
|
23
26
|
}) => {
|
|
24
|
-
|
|
25
|
-
|
|
27
|
+
const isResponsiveEnabled = expValEquals('platform_editor_aifc_selection_toolbar_responsive', 'isEnabled', true);
|
|
28
|
+
const toolbar = /*#__PURE__*/React.createElement(Box, {
|
|
29
|
+
xcss: cx(styles.toolbarBase, styles.toolbar, isResponsiveEnabled && styles.toolbarResponsive, expValEquals('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) && styles.hiddenSelectors),
|
|
26
30
|
role: "toolbar",
|
|
27
31
|
"aria-label": label
|
|
28
32
|
}, children);
|
|
33
|
+
if (isResponsiveEnabled) {
|
|
34
|
+
return /*#__PURE__*/React.createElement(ResponsiveWrapper, null, toolbar);
|
|
35
|
+
} else {
|
|
36
|
+
return toolbar;
|
|
37
|
+
}
|
|
29
38
|
};
|
|
30
39
|
/**
|
|
31
40
|
* A simple component representing a toolbar without box shadows - used to represent a primary toolbar
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
._1f38ptqj{container-name:toolbar-container}
|
|
4
4
|
._7cca15wb{container-type:inline-size}
|
|
5
5
|
._zg9wglyw .show-below-lg, ._1a2cglyw .show-below-md, ._sum2glyw .show-below-sm, ._1vtcglyw .show-below-xl{display:none}
|
|
6
|
+
@container editor-area (max-width: 365px){._33p2glyw .show-above-sm{display:none}._1dre1ule .show-below-sm{display:block}}
|
|
7
|
+
@container editor-area (max-width: 533px){._u47mglyw .show-above-md{display:none}._rut51ule .show-below-md{display:block}}
|
|
8
|
+
@container editor-area (max-width: 700px){._fj5dglyw .show-above-lg{display:none}._5wt61ule .show-below-lg{display:block}}
|
|
6
9
|
@container toolbar-container (max-width: 1024px){._19x4glyw._19x4glyw .show-above-xl{display:none}._qck01ule._qck01ule .show-below-xl{display:block}._t3a8glyw .show-above-xl{display:none}._1x5z1ule .show-below-xl{display:block}}
|
|
7
10
|
@container toolbar-container (max-width: 210px){._48suglyw .show-above-sm{display:none}._j2p61ule .show-below-sm{display:block}._j094glyw._j094glyw .show-above-sm{display:none}._1mc51ule._1mc51ule .show-below-sm{display:block}}
|
|
8
11
|
@container toolbar-container (max-width: 350px){._1vg1glyw .show-above-md{display:none}._1ei51ule .show-below-md{display:block}}
|
|
@@ -11,4 +14,7 @@
|
|
|
11
14
|
@container toolbar-container (max-width: 476px){._1ireglyw .show-above-md{display:none}._zy2m1ule .show-below-md{display:block}}
|
|
12
15
|
@container toolbar-container (max-width: 500px){._pjeuglyw .show-above-lg{display:none}._3bio1ule .show-below-lg{display:block}}
|
|
13
16
|
@container toolbar-container (max-width: 575px){._11u4glyw._11u4glyw .show-above-lg{display:none}._v1i61ule._v1i61ule .show-below-lg{display:block}}
|
|
14
|
-
@container toolbar-container (max-width: 768px){._hfbeglyw .show-above-lg{display:none}._gw6d1ule .show-below-lg{display:block}}
|
|
17
|
+
@container toolbar-container (max-width: 768px){._hfbeglyw .show-above-lg{display:none}._gw6d1ule .show-below-lg{display:block}}
|
|
18
|
+
@media (max-width:700px){._hmx4glyw .show-above-lg{display:none}._1rrm1ule .show-below-lg{display:block}}
|
|
19
|
+
@media (max-width:533px){._ut18glyw .show-above-md{display:none}._1nwo1ule .show-below-md{display:block}}
|
|
20
|
+
@media (max-width:365px){._19fzglyw .show-above-sm{display:none}._1r831ule .show-below-sm{display:block}}
|
|
@@ -12,7 +12,8 @@ var styles = {
|
|
|
12
12
|
responsiveContainer: "_1bsb1osq _7cca15wb _1f38ptqj _1bx91ule _1ehg1ule _1onx1ule _1xt01ule _zg9wglyw _1a2cglyw _sum2glyw _1vtcglyw",
|
|
13
13
|
responsiveRules: "_t3a8glyw _1x5z1ule _6nrqglyw _1fq21ule _1ireglyw _zy2m1ule _hfbeglyw _gw6d1ule",
|
|
14
14
|
responsiveRulesReduced: "_j094glyw _1mc51ule _gipeglyw _311r1ule _11u4glyw _v1i61ule _19x4glyw _qck01ule",
|
|
15
|
-
responsiveRulesReducedOld: "_t3a8glyw _1x5z1ule _48suglyw _j2p61ule _1vg1glyw _1ei51ule _pjeuglyw _3bio1ule"
|
|
15
|
+
responsiveRulesReducedOld: "_t3a8glyw _1x5z1ule _48suglyw _j2p61ule _1vg1glyw _1ei51ule _pjeuglyw _3bio1ule",
|
|
16
|
+
responsiveRulesWrapper: "_1bx91ule _1ehg1ule _1onx1ule _1xt01ule _zg9wglyw _1a2cglyw _sum2glyw _1vtcglyw _33p2glyw _1dre1ule _u47mglyw _rut51ule _fj5dglyw _5wt61ule _hmx4glyw _1rrm1ule _ut18glyw _1nwo1ule _19fzglyw _1r831ule"
|
|
16
17
|
};
|
|
17
18
|
/**
|
|
18
19
|
* A responsive container that enables container query-based responsive design using CSS container queries.
|
|
@@ -63,4 +64,14 @@ export var ResponsiveContainer = function ResponsiveContainer(_ref) {
|
|
|
63
64
|
return /*#__PURE__*/React.createElement(Box, {
|
|
64
65
|
xcss: cx(styles.responsiveContainer, reducedBreakpoints ? editorExperiment('platform_editor_toolbar_aifc_patch_2', true) ? styles.responsiveRulesReduced : styles.responsiveRulesReducedOld : styles.responsiveRules)
|
|
65
66
|
}, children);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* A wrapper that supports responsiveness with media queries. It needs to used together with Show component
|
|
71
|
+
*/
|
|
72
|
+
export var ResponsiveWrapper = function ResponsiveWrapper(_ref2) {
|
|
73
|
+
var children = _ref2.children;
|
|
74
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
75
|
+
xcss: styles.responsiveRulesWrapper
|
|
76
|
+
}, children);
|
|
66
77
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
._2rko1qi0{border-radius:var(--ds-radius-medium,6px)}
|
|
3
|
-
._zulp1b66{gap:var(--ds-space-050,4px)}
|
|
3
|
+
._zulp1b66{gap:var(--ds-space-050,4px)}
|
|
4
|
+
._195gpxbi{margin-inline:var(--ds-space-200,1pc)}._16qs1cd0{box-shadow:var(--ds-shadow-overlay,0 8px 9pt #091e4226,0 0 1px #091e424f)}
|
|
4
5
|
._18shglyw [class*=show-above-]:not(:has([data-toolbar-component=section] [data-toolbar-component=button],[data-toolbar-component=button-group] [data-toolbar-component=button])), ._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}
|
|
5
6
|
._19bv1b66{padding-left:var(--ds-space-050,4px)}
|
|
6
7
|
._1e0c1txw{display:flex}
|
package/dist/esm/ui/Toolbar.js
CHANGED
|
@@ -7,24 +7,33 @@ import React from 'react';
|
|
|
7
7
|
import { cx } from '@atlaskit/css';
|
|
8
8
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
9
9
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
10
|
-
import { ResponsiveContainer } from './ResponsiveContainer';
|
|
10
|
+
import { ResponsiveContainer, ResponsiveWrapper } from './ResponsiveContainer';
|
|
11
11
|
var styles = {
|
|
12
12
|
toolbarBase: "_2rko1qi0 _zulp1b66 _1e0c1txw _4cvr1h6o",
|
|
13
13
|
toolbar: "_bfhk1bhr _4t3i14no _u5f31b66 _19bv1b66 _16qs1cd0",
|
|
14
|
+
toolbarResponsive: "_195gpxbi",
|
|
14
15
|
primaryToolbar: "_bfhkvuon _1tkezwfg",
|
|
15
16
|
hiddenSelectors: "_fy9oglyw _18shglyw _ze7rglyw"
|
|
16
17
|
};
|
|
17
18
|
/**
|
|
18
19
|
* A simple component representing a toolbar with box shadows - used to represent a secondary/floating toolbar
|
|
20
|
+
*
|
|
21
|
+
* @note: Responsiveness support replies on container query with container editor-area and media query
|
|
19
22
|
*/
|
|
20
23
|
export var Toolbar = function Toolbar(_ref) {
|
|
21
24
|
var children = _ref.children,
|
|
22
25
|
label = _ref.label;
|
|
23
|
-
|
|
24
|
-
|
|
26
|
+
var isResponsiveEnabled = expValEquals('platform_editor_aifc_selection_toolbar_responsive', 'isEnabled', true);
|
|
27
|
+
var toolbar = /*#__PURE__*/React.createElement(Box, {
|
|
28
|
+
xcss: cx(styles.toolbarBase, styles.toolbar, isResponsiveEnabled && styles.toolbarResponsive, expValEquals('platform_editor_toolbar_aifc_responsive', 'isEnabled', true) && styles.hiddenSelectors),
|
|
25
29
|
role: "toolbar",
|
|
26
30
|
"aria-label": label
|
|
27
31
|
}, children);
|
|
32
|
+
if (isResponsiveEnabled) {
|
|
33
|
+
return /*#__PURE__*/React.createElement(ResponsiveWrapper, null, toolbar);
|
|
34
|
+
} else {
|
|
35
|
+
return toolbar;
|
|
36
|
+
}
|
|
28
37
|
};
|
|
29
38
|
/**
|
|
30
39
|
* A simple component representing a toolbar without box shadows - used to represent a primary toolbar
|
|
@@ -52,3 +52,9 @@ export type ResponsiveContainerProps = {
|
|
|
52
52
|
* @returns A Box component with container query styles applied
|
|
53
53
|
*/
|
|
54
54
|
export declare const ResponsiveContainer: ({ children, reducedBreakpoints }: ResponsiveContainerProps) => React.JSX.Element;
|
|
55
|
+
/**
|
|
56
|
+
* A wrapper that supports responsiveness with media queries. It needs to used together with Show component
|
|
57
|
+
*/
|
|
58
|
+
export declare const ResponsiveWrapper: ({ children }: {
|
|
59
|
+
children: ReactNode;
|
|
60
|
+
}) => React.JSX.Element;
|
|
@@ -11,6 +11,8 @@ type ToolbarProps = {
|
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
13
13
|
* A simple component representing a toolbar with box shadows - used to represent a secondary/floating toolbar
|
|
14
|
+
*
|
|
15
|
+
* @note: Responsiveness support replies on container query with container editor-area and media query
|
|
14
16
|
*/
|
|
15
17
|
export declare const Toolbar: ({ children, label }: ToolbarProps) => React.JSX.Element;
|
|
16
18
|
type PrimaryToolbarProps = ToolbarProps & ResponsiveContainerProps;
|
|
@@ -52,3 +52,9 @@ export type ResponsiveContainerProps = {
|
|
|
52
52
|
* @returns A Box component with container query styles applied
|
|
53
53
|
*/
|
|
54
54
|
export declare const ResponsiveContainer: ({ children, reducedBreakpoints }: ResponsiveContainerProps) => React.JSX.Element;
|
|
55
|
+
/**
|
|
56
|
+
* A wrapper that supports responsiveness with media queries. It needs to used together with Show component
|
|
57
|
+
*/
|
|
58
|
+
export declare const ResponsiveWrapper: ({ children }: {
|
|
59
|
+
children: ReactNode;
|
|
60
|
+
}) => React.JSX.Element;
|
|
@@ -11,6 +11,8 @@ type ToolbarProps = {
|
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
13
13
|
* A simple component representing a toolbar with box shadows - used to represent a secondary/floating toolbar
|
|
14
|
+
*
|
|
15
|
+
* @note: Responsiveness support replies on container query with container editor-area and media query
|
|
14
16
|
*/
|
|
15
17
|
export declare const Toolbar: ({ children, label }: ToolbarProps) => React.JSX.Element;
|
|
16
18
|
type PrimaryToolbarProps = ToolbarProps & ResponsiveContainerProps;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"registry": "https://registry.npmjs.org/"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.8.
|
|
6
|
+
"version": "0.8.6",
|
|
7
7
|
"description": "Common UI for Toolbars across the platform",
|
|
8
8
|
"atlassian": {
|
|
9
9
|
"team": "Editor: Jenga",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@atlaskit/platform-feature-flags-react": "^0.3.0",
|
|
32
32
|
"@atlaskit/popup": "^4.3.0",
|
|
33
33
|
"@atlaskit/primitives": "^14.14.0",
|
|
34
|
-
"@atlaskit/tmp-editor-statsig": "^12.
|
|
34
|
+
"@atlaskit/tmp-editor-statsig": "^12.14.0",
|
|
35
35
|
"@atlaskit/tokens": "^6.3.0",
|
|
36
36
|
"@atlaskit/tooltip": "^20.4.0",
|
|
37
37
|
"@babel/runtime": "^7.0.0",
|