@atlaskit/editor-toolbar 0.12.1 → 0.13.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 CHANGED
@@ -1,5 +1,21 @@
1
1
  # @atlaskit/editor-toolbar
2
2
 
3
+ ## 0.13.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`351022ab9c347`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/351022ab9c347) -
8
+ [ux] [ED-29060] add toolbar separators after the AI sections in the inline toolbars behind
9
+ platform_editor_toolbar_aifc_patch_6
10
+
11
+ ### Patch Changes
12
+
13
+ - [`7011f9be6a430`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7011f9be6a430) -
14
+ [ux] EDITOR-1653 add create synced block item to the block menu
15
+ - [`84e969325af68`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/84e969325af68) -
16
+ ED-29469 Comment editor in live-doc squishes before going to next breakpoint
17
+ - Updated dependencies
18
+
3
19
  ## 0.12.1
4
20
 
5
21
  ### 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}
@@ -23,7 +23,9 @@ var styles = {
23
23
  toolbar: "_bfhk1bhr _4t3i14no _u5f31b66 _19bv1b66 _16qs1cd0",
24
24
  toolbarResponsive: "_195gpxbi",
25
25
  primaryToolbar: "_bfhkvuon _1tkezwfg",
26
- hiddenSelectors: "_fy9oglyw _18shglyw _ze7rglyw"
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
  };
@@ -5,22 +5,41 @@ 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
+ }({});
21
+ ;
15
22
  var styles = {
16
23
  container: "_zulp1b66 _1e0c1txw _4cvr1h6o"
17
24
  };
18
25
  var separator = null;
26
+ var ToolbarSeparator = function ToolbarSeparator() {
27
+ return /*#__PURE__*/React.createElement("div", {
28
+ "data-toolbar-component": "separator",
29
+ role: "separator",
30
+ "aria-orientation": "vertical",
31
+ className: (0, _runtime.ax)(["_195gu2gc _4t3igktf _1bsbt94y _bfhkmuej"])
32
+ });
33
+ };
19
34
  var ToolbarSection = exports.ToolbarSection = function ToolbarSection(_ref) {
20
35
  var children = _ref.children,
21
36
  testId = _ref.testId,
22
37
  hasSeparator = _ref.hasSeparator;
23
- return /*#__PURE__*/React.createElement(_compiled.Box, {
38
+ return (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true) ? /*#__PURE__*/React.createElement(_compiled.Box, {
39
+ xcss: (0, _css.cx)(styles.container),
40
+ testId: testId,
41
+ "data-toolbar-component": "section"
42
+ }, hasSeparator === SeparatorPosition.START && /*#__PURE__*/React.createElement(ToolbarSeparator, null), children, hasSeparator === SeparatorPosition.END && /*#__PURE__*/React.createElement(ToolbarSeparator, null)) : /*#__PURE__*/React.createElement(_compiled.Box, {
24
43
  xcss: (0, _css.cx)(styles.container),
25
44
  testId: testId,
26
45
  "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"));
@@ -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
- hiddenSelectors: "_fy9oglyw _18shglyw _ze7rglyw"
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,16 +4,35 @@ 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
+ }({});
13
+ ;
7
14
  const styles = {
8
15
  container: "_zulp1b66 _1e0c1txw _4cvr1h6o"
9
16
  };
10
17
  const separator = null;
18
+ const ToolbarSeparator = () => {
19
+ return /*#__PURE__*/React.createElement("div", {
20
+ "data-toolbar-component": "separator",
21
+ role: "separator",
22
+ "aria-orientation": "vertical",
23
+ className: ax(["_195gu2gc _4t3igktf _1bsbt94y _bfhkmuej"])
24
+ });
25
+ };
11
26
  export const ToolbarSection = ({
12
27
  children,
13
28
  testId,
14
29
  hasSeparator
15
30
  }) => {
16
- return /*#__PURE__*/React.createElement(Box, {
31
+ return expValEquals('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true) ? /*#__PURE__*/React.createElement(Box, {
32
+ xcss: cx(styles.container),
33
+ testId: testId,
34
+ "data-toolbar-component": "section"
35
+ }, hasSeparator === SeparatorPosition.START && /*#__PURE__*/React.createElement(ToolbarSeparator, null), children, hasSeparator === SeparatorPosition.END && /*#__PURE__*/React.createElement(ToolbarSeparator, null)) : /*#__PURE__*/React.createElement(Box, {
17
36
  xcss: cx(styles.container),
18
37
  testId: testId,
19
38
  "data-toolbar-component": "section"
@@ -0,0 +1,2 @@
1
+ /* eslint-disable @atlaskit/editor/no-re-export */
2
+ export { default as SyncBlocksIcon } from '@atlaskit/icon-lab/core/sync';
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}
@@ -16,7 +16,9 @@ var styles = {
16
16
  toolbar: "_bfhk1bhr _4t3i14no _u5f31b66 _19bv1b66 _16qs1cd0",
17
17
  toolbarResponsive: "_195gpxbi",
18
18
  primaryToolbar: "_bfhkvuon _1tkezwfg",
19
- hiddenSelectors: "_fy9oglyw _18shglyw _ze7rglyw"
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
  };
@@ -4,15 +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 var SeparatorPosition = /*#__PURE__*/function (SeparatorPosition) {
9
+ SeparatorPosition["START"] = "start";
10
+ SeparatorPosition["END"] = "end";
11
+ return SeparatorPosition;
12
+ }({});
13
+ ;
7
14
  var styles = {
8
15
  container: "_zulp1b66 _1e0c1txw _4cvr1h6o"
9
16
  };
10
17
  var separator = null;
18
+ var ToolbarSeparator = function ToolbarSeparator() {
19
+ return /*#__PURE__*/React.createElement("div", {
20
+ "data-toolbar-component": "separator",
21
+ role: "separator",
22
+ "aria-orientation": "vertical",
23
+ className: ax(["_195gu2gc _4t3igktf _1bsbt94y _bfhkmuej"])
24
+ });
25
+ };
11
26
  export var ToolbarSection = function ToolbarSection(_ref) {
12
27
  var children = _ref.children,
13
28
  testId = _ref.testId,
14
29
  hasSeparator = _ref.hasSeparator;
15
- 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, {
16
35
  xcss: cx(styles.container),
17
36
  testId: testId,
18
37
  "data-toolbar-component": "section"
@@ -0,0 +1,2 @@
1
+ /* eslint-disable @atlaskit/editor/no-re-export */
2
+ 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';
@@ -5,9 +5,9 @@ type ToolbarProps = {
5
5
  children?: ReactNode;
6
6
  /**
7
7
  * aria-label for the toolbar (No localisation needed as it won't be read by screen readers).
8
- *
9
- * use case: query select the toolbar to position floating toolbar
10
- */
8
+ *
9
+ * use case: query select the toolbar to position floating toolbar
10
+ */
11
11
  label: string;
12
12
  testId?: string;
13
13
  } & ViewEventEmitterProps;
@@ -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';
@@ -5,9 +5,9 @@ type ToolbarProps = {
5
5
  children?: ReactNode;
6
6
  /**
7
7
  * aria-label for the toolbar (No localisation needed as it won't be read by screen readers).
8
- *
9
- * use case: query select the toolbar to position floating toolbar
10
- */
8
+ *
9
+ * use case: query select the toolbar to position floating toolbar
10
+ */
11
11
  label: string;
12
12
  testId?: string;
13
13
  } & ViewEventEmitterProps;
@@ -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.12.1",
6
+ "version": "0.13.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.3.0",
29
- "@atlaskit/icon-lab": "^5.8.0",
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",