@atlaskit/editor-toolbar 0.11.0 → 0.12.1

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,25 @@
1
1
  # @atlaskit/editor-toolbar
2
2
 
3
+ ## 0.12.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`a3254a75cdfb7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a3254a75cdfb7) -
8
+ [ED-29448] clean up experiment platform_editor_toolbar_aifc_patch_2
9
+ - Updated dependencies
10
+
11
+ ## 0.12.0
12
+
13
+ ### Minor Changes
14
+
15
+ - [`4ad69354a021d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4ad69354a021d) -
16
+ Remove references to platform_editor_toolbar_aifc_patch_1 experiment, remove
17
+ useToolbarDropdownMenuOld export from @atlaskit/editor-toolbar package
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies
22
+
3
23
  ## 0.11.0
4
24
 
5
25
  ### Minor Changes
@@ -1,4 +1,3 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
2
1
  "use strict";
3
2
 
4
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -7,22 +6,15 @@ Object.defineProperty(exports, "__esModule", {
7
6
  value: true
8
7
  });
9
8
  exports.default = void 0;
10
- require("./index.compiled.css");
11
- var _runtime = require("@compiled/react/runtime");
12
9
  var _react = _interopRequireWildcard(require("react"));
13
10
  var _chromatism = _interopRequireDefault(require("chromatism"));
14
11
  var _reactIntlNext = require("react-intl-next");
15
12
  var _compiled = require("@atlaskit/primitives/compiled");
16
- var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
17
13
  var _tokens = require("@atlaskit/tokens");
18
14
  var _Color = require("./Color");
19
15
  var _getColorMessage = _interopRequireDefault(require("./getColorMessage"));
20
16
  var _utils = require("./utils");
21
17
  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); }
22
- var styles = {
23
- paletteWrapper: "_1e0c1txw"
24
- };
25
-
26
18
  /**
27
19
  * For a given color pick the color from a list of colors with
28
20
  * the highest contrast
@@ -117,9 +109,6 @@ var ColorPalette = function ColorPalette(_ref) {
117
109
 
118
110
  // Initialize focus position and handle autofocus
119
111
  (0, _react.useEffect)(function () {
120
- if (!(0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_patch_1', 'isEnabled', true)) {
121
- return;
122
- }
123
112
  if (selectedRowIndex >= 0 && selectedColumnIndex >= 0) {
124
113
  currentFocusRef.current = {
125
114
  row: selectedRowIndex,
@@ -263,7 +252,7 @@ var ColorPalette = function ColorPalette(_ref) {
263
252
  }
264
253
  }
265
254
  }, [colorsPerRow, focusColorAt, onClick, onKeyDown]);
266
- return (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_patch_1', 'isEnabled', true) ? /*#__PURE__*/_react.default.createElement(_compiled.Grid, {
255
+ return /*#__PURE__*/_react.default.createElement(_compiled.Grid, {
267
256
  gap: "space.050",
268
257
  ref: paletteRef,
269
258
  role: "group"
@@ -311,41 +300,6 @@ var ColorPalette = function ColorPalette(_ref) {
311
300
  tabIndex: shouldBeFocusable ? 0 : -1
312
301
  });
313
302
  }));
314
- })) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, colorsPerRow.map(function (row) {
315
- return /*#__PURE__*/_react.default.createElement(_compiled.Box, {
316
- xcss: styles.paletteWrapper,
317
- key: "row-first-color-".concat(row[0].value),
318
- role: "radiogroup"
319
- }, row.map(function (_ref3) {
320
- var value = _ref3.value,
321
- label = _ref3.label,
322
- border = _ref3.border,
323
- message = _ref3.message,
324
- decorator = _ref3.decorator;
325
- var tooltipMessage = message;
326
-
327
- // Override with theme-specific tooltip messages if provided
328
- if (paletteColorTooltipMessages) {
329
- if (tokenTheme === 'dark') {
330
- tooltipMessage = (0, _getColorMessage.default)(paletteColorTooltipMessages.dark, value.toUpperCase());
331
- }
332
- if (tokenTheme === 'light') {
333
- tooltipMessage = (0, _getColorMessage.default)(paletteColorTooltipMessages.light, value.toUpperCase());
334
- }
335
- }
336
- return /*#__PURE__*/_react.default.createElement(_Color.Color, {
337
- key: value,
338
- value: value,
339
- borderColor: border,
340
- label: tooltipMessage ? formatMessage(tooltipMessage) : label,
341
- onClick: onClick,
342
- onKeyDown: onKeyDown,
343
- isSelected: value === selectedColor,
344
- checkMarkColor: getCheckMarkColor(value, useIconToken),
345
- hexToPaletteColor: hexToPaletteColor,
346
- decorator: decorator
347
- });
348
- }));
349
303
  }));
350
304
  };
351
305
  var _default = exports.default = ColorPalette;
@@ -13,12 +13,10 @@
13
13
  @container editor-area (max-width: 533px){._u47mglyw .show-above-md{display:none}._rut51ule .show-below-md{display:block}}
14
14
  @container editor-area (max-width: 700px){._fj5dglyw .show-above-lg{display:none}._5wt61ule .show-below-lg{display:block}}
15
15
  @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}}
16
- @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}}
17
- @container toolbar-container (max-width: 350px){._1vg1glyw .show-above-md{display:none}._1ei51ule .show-below-md{display:block}}
16
+ @container toolbar-container (max-width: 210px){._j094glyw._j094glyw .show-above-sm{display:none}._1mc51ule._1mc51ule .show-below-sm{display:block}}
18
17
  @container toolbar-container (max-width: 408px){._gipeglyw._gipeglyw .show-above-md{display:none}._311r1ule._311r1ule .show-below-md{display:block}}
19
18
  @container toolbar-container (max-width: 410px){._6nrqglyw .show-above-sm{display:none}._1fq21ule .show-below-sm{display:block}}
20
19
  @container toolbar-container (max-width: 476px){._1ireglyw .show-above-md{display:none}._zy2m1ule .show-below-md{display:block}}
21
- @container toolbar-container (max-width: 500px){._pjeuglyw .show-above-lg{display:none}._3bio1ule .show-below-lg{display:block}}
22
20
  @container toolbar-container (max-width: 575px){._11u4glyw._11u4glyw .show-above-lg{display:none}._v1i61ule._v1i61ule .show-below-lg{display:block}}
23
21
  @container toolbar-container (max-width: 768px){._hfbeglyw .show-above-lg{display:none}._gw6d1ule .show-below-lg{display:block}}
24
22
  @media (max-width:700px){._hmx4glyw .show-above-lg{display:none}._1rrm1ule .show-below-lg{display:block}}
@@ -14,12 +14,10 @@ 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 _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
18
17
  var styles = {
19
18
  responsiveContainer: "_1bsb1osq _7cca15wb _1f38ptqj _1bx91ule _1ehg1ule _1onx1ule _1xt01ule _zg9wglyw _1a2cglyw _sum2glyw _1vtcglyw",
20
19
  responsiveRules: "_t3a8glyw _1x5z1ule _6nrqglyw _1fq21ule _1ireglyw _zy2m1ule _hfbeglyw _gw6d1ule",
21
20
  responsiveRulesReduced: "_j094glyw _1mc51ule _gipeglyw _311r1ule _11u4glyw _v1i61ule _19x4glyw _qck01ule",
22
- responsiveRulesReducedOld: "_t3a8glyw _1x5z1ule _48suglyw _j2p61ule _1vg1glyw _1ei51ule _pjeuglyw _3bio1ule",
23
21
  responsiveRulesWrapper: "_1bx91ule _1ehg1ule _1onx1ule _1xt01ule _zg9wglyw _1a2cglyw _sum2glyw _1vtcglyw _33p2glyw _1dre1ule _u47mglyw _rut51ule _fj5dglyw _5wt61ule _hmx4glyw _1rrm1ule _ut18glyw _1nwo1ule _19fzglyw _1r831ule"
24
22
  };
25
23
  /**
@@ -69,7 +67,7 @@ var ResponsiveContainer = exports.ResponsiveContainer = function ResponsiveConta
69
67
  var children = _ref.children,
70
68
  reducedBreakpoints = _ref.reducedBreakpoints;
71
69
  return /*#__PURE__*/_react.default.createElement(_compiled.Box, {
72
- xcss: (0, _css.cx)(styles.responsiveContainer, reducedBreakpoints ? (0, _experiments.editorExperiment)('platform_editor_toolbar_aifc_patch_2', true) ? styles.responsiveRulesReduced : styles.responsiveRulesReducedOld : styles.responsiveRules)
70
+ xcss: (0, _css.cx)(styles.responsiveContainer, reducedBreakpoints ? styles.responsiveRulesReduced : styles.responsiveRules)
73
71
  }, children);
74
72
  };
75
73
 
@@ -11,7 +11,6 @@ var _react = _interopRequireWildcard(require("react"));
11
11
  var React = _react;
12
12
  var _runtime = require("@compiled/react/runtime");
13
13
  var _compiled = require("@atlaskit/primitives/compiled");
14
- var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
15
14
  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
15
  var styles = {
17
16
  container: "_1e0c1txw",
@@ -26,20 +25,12 @@ var ToolbarButtonGroup = exports.ToolbarButtonGroup = function ToolbarButtonGrou
26
25
  var FirstChild = items.at(0);
27
26
  var LastChild = items.at(-1);
28
27
  var middleChildren = items.slice(1, -1);
29
- var isToolbarPatch2Enabled = (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_patch_2', 'isEnabled', true);
30
- return isToolbarPatch2Enabled ? /*#__PURE__*/React.createElement(_compiled.Box, {
28
+ return /*#__PURE__*/React.createElement(_compiled.Box, {
31
29
  xcss: styles.container,
32
30
  "data-toolbar-component": "button-group"
33
31
  }, items.length <= 1 ? children : /*#__PURE__*/React.createElement(_react.Fragment, null, /*#__PURE__*/React.createElement("div", {
34
32
  className: (0, _runtime.ax)([styles.firstChildNew])
35
33
  }, FirstChild), middleChildren, /*#__PURE__*/React.createElement("div", {
36
34
  className: (0, _runtime.ax)([styles.lastChildNew])
37
- }, LastChild))) : /*#__PURE__*/React.createElement(_compiled.Box, {
38
- xcss: styles.container,
39
- "data-toolbar-component": "button-group"
40
- }, items.length <= 1 ? children : /*#__PURE__*/React.createElement(_react.Fragment, null, /*#__PURE__*/React.createElement("div", {
41
- className: (0, _runtime.ax)([styles.firstChild])
42
- }, FirstChild), middleChildren, /*#__PURE__*/React.createElement("div", {
43
- className: (0, _runtime.ax)([styles.lastChild])
44
35
  }, LastChild)));
45
36
  };
@@ -48,7 +48,7 @@ var CustomDropdownMenuItemButton = /*#__PURE__*/(0, _react.forwardRef)(function
48
48
  }, children);
49
49
  });
50
50
  var ToolbarDropdownItem = exports.ToolbarDropdownItem = function ToolbarDropdownItem(_ref2) {
51
- var onClick = _ref2.onClick,
51
+ var _onClick = _ref2.onClick,
52
52
  elemBefore = _ref2.elemBefore,
53
53
  elemAfter = _ref2.elemAfter,
54
54
  isSelected = _ref2.isSelected,
@@ -63,7 +63,7 @@ var ToolbarDropdownItem = exports.ToolbarDropdownItem = function ToolbarDropdown
63
63
  href = _ref2.href,
64
64
  target = _ref2.target,
65
65
  rel = _ref2.rel;
66
- var parentContext = (0, _ToolbarDropdownMenuContext.useToolbarDropdownMenuNew)();
66
+ var parentContext = (0, _ToolbarDropdownMenuContext.useToolbarDropdownMenu)();
67
67
  var injectedElemAfter = function () {
68
68
  if (! /*#__PURE__*/(0, _react.isValidElement)(elemAfter)) {
69
69
  return elemAfter;
@@ -77,12 +77,12 @@ var ToolbarDropdownItem = exports.ToolbarDropdownItem = function ToolbarDropdown
77
77
  }));
78
78
  }();
79
79
  return /*#__PURE__*/_react.default.createElement(_dropdownMenu.DropdownItem, {
80
- onClick: (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_patch_1', 'isEnabled', true) ? function (e) {
80
+ onClick: function onClick(e) {
81
81
  if (!hasNestedDropdownMenu) {
82
82
  parentContext === null || parentContext === void 0 || parentContext.closeMenu();
83
83
  }
84
- onClick === null || onClick === void 0 || onClick(e);
85
- } : onClick,
84
+ _onClick === null || _onClick === void 0 || _onClick(e);
85
+ },
86
86
  elemBefore: elemBefore,
87
87
  elemAfter: (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_patch_5', 'isEnabled', true) ? injectedElemAfter : elemAfter,
88
88
  isSelected: isSelected,
@@ -82,25 +82,14 @@ var ToolbarDropdownMenu = exports.ToolbarDropdownMenu = function ToolbarDropdown
82
82
  _ref2$enableMaxHeight = _ref2.enableMaxHeight,
83
83
  enableMaxHeight = _ref2$enableMaxHeight === void 0 ? false : _ref2$enableMaxHeight,
84
84
  onClick = _ref2.onClick;
85
- if ((0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_patch_1', 'isEnabled', true)) {
86
- return /*#__PURE__*/_react.default.createElement(ToolbarDropdownMenuContent, {
87
- iconBefore: iconBefore,
88
- isDisabled: isDisabled,
89
- testId: testId,
90
- label: label,
91
- onClick: onClick
92
- }, /*#__PURE__*/_react.default.createElement(_compiled.Box, {
93
- xcss: (0, _react2.cx)(hasSectionMargin && styles.sectionMargin, enableMaxHeight && styles.scrollContainer, (0, _expValEquals.expValEquals)('platform_editor_toolbar_migrate_loom', 'isEnabled', true) && styles.firstSectionSeparator),
94
- "data-toolbar-component": "menu"
95
- }, children));
96
- } else {
97
- return /*#__PURE__*/_react.default.createElement(_ToolbarDropdownMenuContext.ToolbarDropdownMenuProvider, null, /*#__PURE__*/_react.default.createElement(ToolbarDropdownMenuContent, {
98
- iconBefore: iconBefore,
99
- isDisabled: isDisabled,
100
- testId: testId,
101
- label: label
102
- }, /*#__PURE__*/_react.default.createElement("div", {
103
- className: (0, _runtime.ax)([hasSectionMargin && styles.sectionMargin, (0, _expValEquals.expValEquals)('platform_editor_toolbar_migrate_loom', 'isEnabled', true) && styles.firstSectionSeparator])
104
- }, children)));
105
- }
85
+ return /*#__PURE__*/_react.default.createElement(ToolbarDropdownMenuContent, {
86
+ iconBefore: iconBefore,
87
+ isDisabled: isDisabled,
88
+ testId: testId,
89
+ label: label,
90
+ onClick: onClick
91
+ }, /*#__PURE__*/_react.default.createElement(_compiled.Box, {
92
+ xcss: (0, _react2.cx)(hasSectionMargin && styles.sectionMargin, enableMaxHeight && styles.scrollContainer, (0, _expValEquals.expValEquals)('platform_editor_toolbar_migrate_loom', 'isEnabled', true) && styles.firstSectionSeparator),
93
+ "data-toolbar-component": "menu"
94
+ }, children));
106
95
  };
@@ -5,26 +5,14 @@ var _typeof = require("@babel/runtime/helpers/typeof");
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.useToolbarDropdownMenuOld = exports.useToolbarDropdownMenuNew = exports.useToolbarDropdownMenu = exports.ToolbarDropdownMenuProvider = void 0;
8
+ exports.useToolbarDropdownMenu = exports.ToolbarDropdownMenuProvider = void 0;
9
9
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
10
  var _react = _interopRequireWildcard(require("react"));
11
- var _platformFeatureFlagsReact = require("@atlaskit/platform-feature-flags-react");
12
- var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
13
11
  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); }
14
12
  var ToolbarDropdownMenuContext = /*#__PURE__*/(0, _react.createContext)(undefined);
15
- var useToolbarDropdownMenuOld = exports.useToolbarDropdownMenuOld = function useToolbarDropdownMenuOld() {
16
- var context = (0, _react.useContext)(ToolbarDropdownMenuContext);
17
- if (!context) {
18
- throw new Error('useToolbarDropdownMenu must be used within ToolbarDropdownMenuProvider');
19
- }
20
- return context;
21
- };
22
- var useToolbarDropdownMenuNew = exports.useToolbarDropdownMenuNew = function useToolbarDropdownMenuNew() {
13
+ var useToolbarDropdownMenu = exports.useToolbarDropdownMenu = function useToolbarDropdownMenu() {
23
14
  return (0, _react.useContext)(ToolbarDropdownMenuContext);
24
15
  };
25
- var useToolbarDropdownMenu = exports.useToolbarDropdownMenu = (0, _platformFeatureFlagsReact.conditionalHooksFactory)(function () {
26
- return (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_patch_1', 'isEnabled', true);
27
- }, useToolbarDropdownMenuNew, useToolbarDropdownMenuOld);
28
16
  var ToolbarDropdownMenuProvider = exports.ToolbarDropdownMenuProvider = function ToolbarDropdownMenuProvider(_ref) {
29
17
  var children = _ref.children;
30
18
  var _useState = (0, _react.useState)(false),
@@ -1,18 +1,11 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
2
- import "./index.compiled.css";
3
- import { ax, ix } from "@compiled/react/runtime";
4
1
  import React, { useMemo, useCallback, useRef, useEffect } from 'react';
5
2
  import chromatism from 'chromatism';
6
3
  import { useIntl } from 'react-intl-next';
7
- import { Box, Grid, Inline } from '@atlaskit/primitives/compiled';
8
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
4
+ import { Grid, Inline } from '@atlaskit/primitives/compiled';
9
5
  import { useThemeObserver } from '@atlaskit/tokens';
10
6
  import { Color } from './Color';
11
7
  import getColorMessage from './getColorMessage';
12
8
  import { DEFAULT_COLOR_PICKER_COLUMNS, getColorsPerRowFromPalette, getSelectedRowAndColumnFromPalette, getTokenCSSVariableValue } from './utils';
13
- const styles = {
14
- paletteWrapper: "_1e0c1txw"
15
- };
16
9
 
17
10
  /**
18
11
  * For a given color pick the color from a list of colors with
@@ -111,9 +104,6 @@ const ColorPalette = ({
111
104
 
112
105
  // Initialize focus position and handle autofocus
113
106
  useEffect(() => {
114
- if (!expValEquals('platform_editor_toolbar_aifc_patch_1', 'isEnabled', true)) {
115
- return;
116
- }
117
107
  if (selectedRowIndex >= 0 && selectedColumnIndex >= 0) {
118
108
  currentFocusRef.current = {
119
109
  row: selectedRowIndex,
@@ -258,7 +248,7 @@ const ColorPalette = ({
258
248
  }
259
249
  }
260
250
  }, [colorsPerRow, focusColorAt, onClick, onKeyDown]);
261
- return expValEquals('platform_editor_toolbar_aifc_patch_1', 'isEnabled', true) ? /*#__PURE__*/React.createElement(Grid, {
251
+ return /*#__PURE__*/React.createElement(Grid, {
262
252
  gap: "space.050",
263
253
  ref: paletteRef,
264
254
  role: "group"
@@ -305,40 +295,6 @@ const ColorPalette = ({
305
295
  decorator: decorator,
306
296
  tabIndex: shouldBeFocusable ? 0 : -1
307
297
  });
308
- })))) : /*#__PURE__*/React.createElement(React.Fragment, null, colorsPerRow.map(row => /*#__PURE__*/React.createElement(Box, {
309
- xcss: styles.paletteWrapper,
310
- key: `row-first-color-${row[0].value}`,
311
- role: "radiogroup"
312
- }, row.map(({
313
- value,
314
- label,
315
- border,
316
- message,
317
- decorator
318
- }) => {
319
- let tooltipMessage = message;
320
-
321
- // Override with theme-specific tooltip messages if provided
322
- if (paletteColorTooltipMessages) {
323
- if (tokenTheme === 'dark') {
324
- tooltipMessage = getColorMessage(paletteColorTooltipMessages.dark, value.toUpperCase());
325
- }
326
- if (tokenTheme === 'light') {
327
- tooltipMessage = getColorMessage(paletteColorTooltipMessages.light, value.toUpperCase());
328
- }
329
- }
330
- return /*#__PURE__*/React.createElement(Color, {
331
- key: value,
332
- value: value,
333
- borderColor: border,
334
- label: tooltipMessage ? formatMessage(tooltipMessage) : label,
335
- onClick: onClick,
336
- onKeyDown: onKeyDown,
337
- isSelected: value === selectedColor,
338
- checkMarkColor: getCheckMarkColor(value, useIconToken),
339
- hexToPaletteColor: hexToPaletteColor,
340
- decorator: decorator
341
- });
342
298
  }))));
343
299
  };
344
300
  export default ColorPalette;
@@ -13,12 +13,10 @@
13
13
  @container editor-area (max-width: 533px){._u47mglyw .show-above-md{display:none}._rut51ule .show-below-md{display:block}}
14
14
  @container editor-area (max-width: 700px){._fj5dglyw .show-above-lg{display:none}._5wt61ule .show-below-lg{display:block}}
15
15
  @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}}
16
- @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}}
17
- @container toolbar-container (max-width: 350px){._1vg1glyw .show-above-md{display:none}._1ei51ule .show-below-md{display:block}}
16
+ @container toolbar-container (max-width: 210px){._j094glyw._j094glyw .show-above-sm{display:none}._1mc51ule._1mc51ule .show-below-sm{display:block}}
18
17
  @container toolbar-container (max-width: 408px){._gipeglyw._gipeglyw .show-above-md{display:none}._311r1ule._311r1ule .show-below-md{display:block}}
19
18
  @container toolbar-container (max-width: 410px){._6nrqglyw .show-above-sm{display:none}._1fq21ule .show-below-sm{display:block}}
20
19
  @container toolbar-container (max-width: 476px){._1ireglyw .show-above-md{display:none}._zy2m1ule .show-below-md{display:block}}
21
- @container toolbar-container (max-width: 500px){._pjeuglyw .show-above-lg{display:none}._3bio1ule .show-below-lg{display:block}}
22
20
  @container toolbar-container (max-width: 575px){._11u4glyw._11u4glyw .show-above-lg{display:none}._v1i61ule._v1i61ule .show-below-lg{display:block}}
23
21
  @container toolbar-container (max-width: 768px){._hfbeglyw .show-above-lg{display:none}._gw6d1ule .show-below-lg{display:block}}
24
22
  @media (max-width:700px){._hmx4glyw .show-above-lg{display:none}._1rrm1ule .show-below-lg{display:block}}
@@ -7,12 +7,10 @@ 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 { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
11
10
  const styles = {
12
11
  responsiveContainer: "_1bsb1osq _7cca15wb _1f38ptqj _1bx91ule _1ehg1ule _1onx1ule _1xt01ule _zg9wglyw _1a2cglyw _sum2glyw _1vtcglyw",
13
12
  responsiveRules: "_t3a8glyw _1x5z1ule _6nrqglyw _1fq21ule _1ireglyw _zy2m1ule _hfbeglyw _gw6d1ule",
14
13
  responsiveRulesReduced: "_j094glyw _1mc51ule _gipeglyw _311r1ule _11u4glyw _v1i61ule _19x4glyw _qck01ule",
15
- responsiveRulesReducedOld: "_t3a8glyw _1x5z1ule _48suglyw _j2p61ule _1vg1glyw _1ei51ule _pjeuglyw _3bio1ule",
16
14
  responsiveRulesWrapper: "_1bx91ule _1ehg1ule _1onx1ule _1xt01ule _zg9wglyw _1a2cglyw _sum2glyw _1vtcglyw _33p2glyw _1dre1ule _u47mglyw _rut51ule _fj5dglyw _5wt61ule _hmx4glyw _1rrm1ule _ut18glyw _1nwo1ule _19fzglyw _1r831ule"
17
15
  };
18
16
  /**
@@ -63,7 +61,7 @@ export const ResponsiveContainer = ({
63
61
  reducedBreakpoints
64
62
  }) => {
65
63
  return /*#__PURE__*/React.createElement(Box, {
66
- xcss: cx(styles.responsiveContainer, reducedBreakpoints ? editorExperiment('platform_editor_toolbar_aifc_patch_2', true) ? styles.responsiveRulesReduced : styles.responsiveRulesReducedOld : styles.responsiveRules)
64
+ xcss: cx(styles.responsiveContainer, reducedBreakpoints ? styles.responsiveRulesReduced : styles.responsiveRules)
67
65
  }, children);
68
66
  };
69
67
 
@@ -4,7 +4,6 @@ import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
5
  import { Children, Fragment } from 'react';
6
6
  import { Box } from '@atlaskit/primitives/compiled';
7
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
8
7
  const styles = {
9
8
  container: "_1e0c1txw",
10
9
  firstChild: "_fb2512x7 _t1diidpf _u6eridpf",
@@ -19,20 +18,12 @@ export const ToolbarButtonGroup = ({
19
18
  const FirstChild = items.at(0);
20
19
  const LastChild = items.at(-1);
21
20
  const middleChildren = items.slice(1, -1);
22
- const isToolbarPatch2Enabled = expValEquals('platform_editor_toolbar_aifc_patch_2', 'isEnabled', true);
23
- return isToolbarPatch2Enabled ? /*#__PURE__*/React.createElement(Box, {
21
+ return /*#__PURE__*/React.createElement(Box, {
24
22
  xcss: styles.container,
25
23
  "data-toolbar-component": "button-group"
26
24
  }, items.length <= 1 ? children : /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
27
25
  className: ax([styles.firstChildNew])
28
26
  }, FirstChild), middleChildren, /*#__PURE__*/React.createElement("div", {
29
27
  className: ax([styles.lastChildNew])
30
- }, LastChild))) : /*#__PURE__*/React.createElement(Box, {
31
- xcss: styles.container,
32
- "data-toolbar-component": "button-group"
33
- }, items.length <= 1 ? children : /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
34
- className: ax([styles.firstChild])
35
- }, FirstChild), middleChildren, /*#__PURE__*/React.createElement("div", {
36
- className: ax([styles.lastChild])
37
28
  }, LastChild)));
38
29
  };
@@ -6,7 +6,7 @@ import { cx } from '@atlaskit/css';
6
6
  import { DropdownItem } from '@atlaskit/dropdown-menu';
7
7
  import { Pressable } from '@atlaskit/primitives/compiled';
8
8
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
9
- import { useToolbarDropdownMenuNew } from './ToolbarDropdownMenuContext';
9
+ import { useToolbarDropdownMenu } from './ToolbarDropdownMenuContext';
10
10
  const styles = {
11
11
  toolbarDropdownItem: "_11c82smr _18zrutpp _1rjc1b66 _1e0c1txw _kqswh2mm _bfhksm61 _1bsb1osq _1tkezwfg _1ul9eoa3 _syaz1gjq _1bas12b0 _1ah31i6y",
12
12
  enabled: "_irr3166n _1di61dty",
@@ -50,7 +50,7 @@ export const ToolbarDropdownItem = ({
50
50
  target,
51
51
  rel
52
52
  }) => {
53
- const parentContext = useToolbarDropdownMenuNew();
53
+ const parentContext = useToolbarDropdownMenu();
54
54
  const injectedElemAfter = (() => {
55
55
  if (! /*#__PURE__*/isValidElement(elemAfter)) {
56
56
  return elemAfter;
@@ -65,12 +65,12 @@ export const ToolbarDropdownItem = ({
65
65
  });
66
66
  })();
67
67
  return /*#__PURE__*/React.createElement(DropdownItem, {
68
- onClick: expValEquals('platform_editor_toolbar_aifc_patch_1', 'isEnabled', true) ? e => {
68
+ onClick: e => {
69
69
  if (!hasNestedDropdownMenu) {
70
70
  parentContext === null || parentContext === void 0 ? void 0 : parentContext.closeMenu();
71
71
  }
72
72
  onClick === null || onClick === void 0 ? void 0 : onClick(e);
73
- } : onClick,
73
+ },
74
74
  elemBefore: elemBefore,
75
75
  elemAfter: expValEquals('platform_editor_toolbar_aifc_patch_5', 'isEnabled', true) ? injectedElemAfter : elemAfter,
76
76
  isSelected: isSelected,
@@ -8,7 +8,7 @@ import { Box } from '@atlaskit/primitives/compiled';
8
8
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
9
9
  import { useToolbarUI } from '../hooks/ui-context';
10
10
  import { ToolbarButton } from './ToolbarButton';
11
- import { ToolbarDropdownMenuProvider, useToolbarDropdownMenu } from './ToolbarDropdownMenuContext';
11
+ import { useToolbarDropdownMenu } from './ToolbarDropdownMenuContext';
12
12
  const styles = {
13
13
  sectionMargin: "_1mouv77o",
14
14
  firstSectionSeparator: "_18l8n7od",
@@ -72,25 +72,14 @@ export const ToolbarDropdownMenu = ({
72
72
  enableMaxHeight = false,
73
73
  onClick
74
74
  }) => {
75
- if (expValEquals('platform_editor_toolbar_aifc_patch_1', 'isEnabled', true)) {
76
- return /*#__PURE__*/React.createElement(ToolbarDropdownMenuContent, {
77
- iconBefore: iconBefore,
78
- isDisabled: isDisabled,
79
- testId: testId,
80
- label: label,
81
- onClick: onClick
82
- }, /*#__PURE__*/React.createElement(Box, {
83
- xcss: cx(hasSectionMargin && styles.sectionMargin, enableMaxHeight && styles.scrollContainer, expValEquals('platform_editor_toolbar_migrate_loom', 'isEnabled', true) && styles.firstSectionSeparator),
84
- "data-toolbar-component": "menu"
85
- }, children));
86
- } else {
87
- return /*#__PURE__*/React.createElement(ToolbarDropdownMenuProvider, null, /*#__PURE__*/React.createElement(ToolbarDropdownMenuContent, {
88
- iconBefore: iconBefore,
89
- isDisabled: isDisabled,
90
- testId: testId,
91
- label: label
92
- }, /*#__PURE__*/React.createElement("div", {
93
- className: ax([hasSectionMargin && styles.sectionMargin, expValEquals('platform_editor_toolbar_migrate_loom', 'isEnabled', true) && styles.firstSectionSeparator])
94
- }, children)));
95
- }
75
+ return /*#__PURE__*/React.createElement(ToolbarDropdownMenuContent, {
76
+ iconBefore: iconBefore,
77
+ isDisabled: isDisabled,
78
+ testId: testId,
79
+ label: label,
80
+ onClick: onClick
81
+ }, /*#__PURE__*/React.createElement(Box, {
82
+ xcss: cx(hasSectionMargin && styles.sectionMargin, enableMaxHeight && styles.scrollContainer, expValEquals('platform_editor_toolbar_migrate_loom', 'isEnabled', true) && styles.firstSectionSeparator),
83
+ "data-toolbar-component": "menu"
84
+ }, children));
96
85
  };
@@ -1,18 +1,8 @@
1
1
  import React, { createContext, useContext, useState } from 'react';
2
- import { conditionalHooksFactory } from '@atlaskit/platform-feature-flags-react';
3
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
4
2
  const ToolbarDropdownMenuContext = /*#__PURE__*/createContext(undefined);
5
- export const useToolbarDropdownMenuOld = () => {
6
- const context = useContext(ToolbarDropdownMenuContext);
7
- if (!context) {
8
- throw new Error('useToolbarDropdownMenu must be used within ToolbarDropdownMenuProvider');
9
- }
10
- return context;
11
- };
12
- export const useToolbarDropdownMenuNew = () => {
3
+ export const useToolbarDropdownMenu = () => {
13
4
  return useContext(ToolbarDropdownMenuContext);
14
5
  };
15
- export const useToolbarDropdownMenu = conditionalHooksFactory(() => expValEquals('platform_editor_toolbar_aifc_patch_1', 'isEnabled', true), useToolbarDropdownMenuNew, useToolbarDropdownMenuOld);
16
6
  export const ToolbarDropdownMenuProvider = ({
17
7
  children
18
8
  }) => {
@@ -1,18 +1,11 @@
1
- /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
2
- import "./index.compiled.css";
3
- import { ax, ix } from "@compiled/react/runtime";
4
1
  import React, { useMemo, useCallback, useRef, useEffect } from 'react';
5
2
  import chromatism from 'chromatism';
6
3
  import { useIntl } from 'react-intl-next';
7
- import { Box, Grid, Inline } from '@atlaskit/primitives/compiled';
8
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
4
+ import { Grid, Inline } from '@atlaskit/primitives/compiled';
9
5
  import { useThemeObserver } from '@atlaskit/tokens';
10
6
  import { Color } from './Color';
11
7
  import getColorMessage from './getColorMessage';
12
8
  import { DEFAULT_COLOR_PICKER_COLUMNS, getColorsPerRowFromPalette, getSelectedRowAndColumnFromPalette, getTokenCSSVariableValue } from './utils';
13
- var styles = {
14
- paletteWrapper: "_1e0c1txw"
15
- };
16
9
 
17
10
  /**
18
11
  * For a given color pick the color from a list of colors with
@@ -108,9 +101,6 @@ var ColorPalette = function ColorPalette(_ref) {
108
101
 
109
102
  // Initialize focus position and handle autofocus
110
103
  useEffect(function () {
111
- if (!expValEquals('platform_editor_toolbar_aifc_patch_1', 'isEnabled', true)) {
112
- return;
113
- }
114
104
  if (selectedRowIndex >= 0 && selectedColumnIndex >= 0) {
115
105
  currentFocusRef.current = {
116
106
  row: selectedRowIndex,
@@ -254,7 +244,7 @@ var ColorPalette = function ColorPalette(_ref) {
254
244
  }
255
245
  }
256
246
  }, [colorsPerRow, focusColorAt, onClick, onKeyDown]);
257
- return expValEquals('platform_editor_toolbar_aifc_patch_1', 'isEnabled', true) ? /*#__PURE__*/React.createElement(Grid, {
247
+ return /*#__PURE__*/React.createElement(Grid, {
258
248
  gap: "space.050",
259
249
  ref: paletteRef,
260
250
  role: "group"
@@ -302,41 +292,6 @@ var ColorPalette = function ColorPalette(_ref) {
302
292
  tabIndex: shouldBeFocusable ? 0 : -1
303
293
  });
304
294
  }));
305
- })) : /*#__PURE__*/React.createElement(React.Fragment, null, colorsPerRow.map(function (row) {
306
- return /*#__PURE__*/React.createElement(Box, {
307
- xcss: styles.paletteWrapper,
308
- key: "row-first-color-".concat(row[0].value),
309
- role: "radiogroup"
310
- }, row.map(function (_ref3) {
311
- var value = _ref3.value,
312
- label = _ref3.label,
313
- border = _ref3.border,
314
- message = _ref3.message,
315
- decorator = _ref3.decorator;
316
- var tooltipMessage = message;
317
-
318
- // Override with theme-specific tooltip messages if provided
319
- if (paletteColorTooltipMessages) {
320
- if (tokenTheme === 'dark') {
321
- tooltipMessage = getColorMessage(paletteColorTooltipMessages.dark, value.toUpperCase());
322
- }
323
- if (tokenTheme === 'light') {
324
- tooltipMessage = getColorMessage(paletteColorTooltipMessages.light, value.toUpperCase());
325
- }
326
- }
327
- return /*#__PURE__*/React.createElement(Color, {
328
- key: value,
329
- value: value,
330
- borderColor: border,
331
- label: tooltipMessage ? formatMessage(tooltipMessage) : label,
332
- onClick: onClick,
333
- onKeyDown: onKeyDown,
334
- isSelected: value === selectedColor,
335
- checkMarkColor: getCheckMarkColor(value, useIconToken),
336
- hexToPaletteColor: hexToPaletteColor,
337
- decorator: decorator
338
- });
339
- }));
340
295
  }));
341
296
  };
342
297
  export default ColorPalette;
@@ -13,12 +13,10 @@
13
13
  @container editor-area (max-width: 533px){._u47mglyw .show-above-md{display:none}._rut51ule .show-below-md{display:block}}
14
14
  @container editor-area (max-width: 700px){._fj5dglyw .show-above-lg{display:none}._5wt61ule .show-below-lg{display:block}}
15
15
  @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}}
16
- @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}}
17
- @container toolbar-container (max-width: 350px){._1vg1glyw .show-above-md{display:none}._1ei51ule .show-below-md{display:block}}
16
+ @container toolbar-container (max-width: 210px){._j094glyw._j094glyw .show-above-sm{display:none}._1mc51ule._1mc51ule .show-below-sm{display:block}}
18
17
  @container toolbar-container (max-width: 408px){._gipeglyw._gipeglyw .show-above-md{display:none}._311r1ule._311r1ule .show-below-md{display:block}}
19
18
  @container toolbar-container (max-width: 410px){._6nrqglyw .show-above-sm{display:none}._1fq21ule .show-below-sm{display:block}}
20
19
  @container toolbar-container (max-width: 476px){._1ireglyw .show-above-md{display:none}._zy2m1ule .show-below-md{display:block}}
21
- @container toolbar-container (max-width: 500px){._pjeuglyw .show-above-lg{display:none}._3bio1ule .show-below-lg{display:block}}
22
20
  @container toolbar-container (max-width: 575px){._11u4glyw._11u4glyw .show-above-lg{display:none}._v1i61ule._v1i61ule .show-below-lg{display:block}}
23
21
  @container toolbar-container (max-width: 768px){._hfbeglyw .show-above-lg{display:none}._gw6d1ule .show-below-lg{display:block}}
24
22
  @media (max-width:700px){._hmx4glyw .show-above-lg{display:none}._1rrm1ule .show-below-lg{display:block}}
@@ -7,12 +7,10 @@ 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 { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
11
10
  var styles = {
12
11
  responsiveContainer: "_1bsb1osq _7cca15wb _1f38ptqj _1bx91ule _1ehg1ule _1onx1ule _1xt01ule _zg9wglyw _1a2cglyw _sum2glyw _1vtcglyw",
13
12
  responsiveRules: "_t3a8glyw _1x5z1ule _6nrqglyw _1fq21ule _1ireglyw _zy2m1ule _hfbeglyw _gw6d1ule",
14
13
  responsiveRulesReduced: "_j094glyw _1mc51ule _gipeglyw _311r1ule _11u4glyw _v1i61ule _19x4glyw _qck01ule",
15
- responsiveRulesReducedOld: "_t3a8glyw _1x5z1ule _48suglyw _j2p61ule _1vg1glyw _1ei51ule _pjeuglyw _3bio1ule",
16
14
  responsiveRulesWrapper: "_1bx91ule _1ehg1ule _1onx1ule _1xt01ule _zg9wglyw _1a2cglyw _sum2glyw _1vtcglyw _33p2glyw _1dre1ule _u47mglyw _rut51ule _fj5dglyw _5wt61ule _hmx4glyw _1rrm1ule _ut18glyw _1nwo1ule _19fzglyw _1r831ule"
17
15
  };
18
16
  /**
@@ -62,7 +60,7 @@ export var ResponsiveContainer = function ResponsiveContainer(_ref) {
62
60
  var children = _ref.children,
63
61
  reducedBreakpoints = _ref.reducedBreakpoints;
64
62
  return /*#__PURE__*/React.createElement(Box, {
65
- xcss: cx(styles.responsiveContainer, reducedBreakpoints ? editorExperiment('platform_editor_toolbar_aifc_patch_2', true) ? styles.responsiveRulesReduced : styles.responsiveRulesReducedOld : styles.responsiveRules)
63
+ xcss: cx(styles.responsiveContainer, reducedBreakpoints ? styles.responsiveRulesReduced : styles.responsiveRules)
66
64
  }, children);
67
65
  };
68
66
 
@@ -4,7 +4,6 @@ import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
5
  import { Children, Fragment } from 'react';
6
6
  import { Box } from '@atlaskit/primitives/compiled';
7
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
8
7
  var styles = {
9
8
  container: "_1e0c1txw",
10
9
  firstChild: "_fb2512x7 _t1diidpf _u6eridpf",
@@ -18,20 +17,12 @@ export var ToolbarButtonGroup = function ToolbarButtonGroup(_ref) {
18
17
  var FirstChild = items.at(0);
19
18
  var LastChild = items.at(-1);
20
19
  var middleChildren = items.slice(1, -1);
21
- var isToolbarPatch2Enabled = expValEquals('platform_editor_toolbar_aifc_patch_2', 'isEnabled', true);
22
- return isToolbarPatch2Enabled ? /*#__PURE__*/React.createElement(Box, {
20
+ return /*#__PURE__*/React.createElement(Box, {
23
21
  xcss: styles.container,
24
22
  "data-toolbar-component": "button-group"
25
23
  }, items.length <= 1 ? children : /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
26
24
  className: ax([styles.firstChildNew])
27
25
  }, FirstChild), middleChildren, /*#__PURE__*/React.createElement("div", {
28
26
  className: ax([styles.lastChildNew])
29
- }, LastChild))) : /*#__PURE__*/React.createElement(Box, {
30
- xcss: styles.container,
31
- "data-toolbar-component": "button-group"
32
- }, items.length <= 1 ? children : /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
33
- className: ax([styles.firstChild])
34
- }, FirstChild), middleChildren, /*#__PURE__*/React.createElement("div", {
35
- className: ax([styles.lastChild])
36
27
  }, LastChild)));
37
28
  };
@@ -9,7 +9,7 @@ import { cx } from '@atlaskit/css';
9
9
  import { DropdownItem } from '@atlaskit/dropdown-menu';
10
10
  import { Pressable } from '@atlaskit/primitives/compiled';
11
11
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
12
- import { useToolbarDropdownMenuNew } from './ToolbarDropdownMenuContext';
12
+ import { useToolbarDropdownMenu } from './ToolbarDropdownMenuContext';
13
13
  var styles = {
14
14
  toolbarDropdownItem: "_11c82smr _18zrutpp _1rjc1b66 _1e0c1txw _kqswh2mm _bfhksm61 _1bsb1osq _1tkezwfg _1ul9eoa3 _syaz1gjq _1bas12b0 _1ah31i6y",
15
15
  enabled: "_irr3166n _1di61dty",
@@ -39,7 +39,7 @@ var CustomDropdownMenuItemButton = /*#__PURE__*/forwardRef(function (_ref, ref)
39
39
  }, children);
40
40
  });
41
41
  export var ToolbarDropdownItem = function ToolbarDropdownItem(_ref2) {
42
- var onClick = _ref2.onClick,
42
+ var _onClick = _ref2.onClick,
43
43
  elemBefore = _ref2.elemBefore,
44
44
  elemAfter = _ref2.elemAfter,
45
45
  isSelected = _ref2.isSelected,
@@ -54,7 +54,7 @@ export var ToolbarDropdownItem = function ToolbarDropdownItem(_ref2) {
54
54
  href = _ref2.href,
55
55
  target = _ref2.target,
56
56
  rel = _ref2.rel;
57
- var parentContext = useToolbarDropdownMenuNew();
57
+ var parentContext = useToolbarDropdownMenu();
58
58
  var injectedElemAfter = function () {
59
59
  if (! /*#__PURE__*/isValidElement(elemAfter)) {
60
60
  return elemAfter;
@@ -68,12 +68,12 @@ export var ToolbarDropdownItem = function ToolbarDropdownItem(_ref2) {
68
68
  }));
69
69
  }();
70
70
  return /*#__PURE__*/React.createElement(DropdownItem, {
71
- onClick: expValEquals('platform_editor_toolbar_aifc_patch_1', 'isEnabled', true) ? function (e) {
71
+ onClick: function onClick(e) {
72
72
  if (!hasNestedDropdownMenu) {
73
73
  parentContext === null || parentContext === void 0 || parentContext.closeMenu();
74
74
  }
75
- onClick === null || onClick === void 0 || onClick(e);
76
- } : onClick,
75
+ _onClick === null || _onClick === void 0 || _onClick(e);
76
+ },
77
77
  elemBefore: elemBefore,
78
78
  elemAfter: expValEquals('platform_editor_toolbar_aifc_patch_5', 'isEnabled', true) ? injectedElemAfter : elemAfter,
79
79
  isSelected: isSelected,
@@ -8,7 +8,7 @@ import { Box } from '@atlaskit/primitives/compiled';
8
8
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
9
9
  import { useToolbarUI } from '../hooks/ui-context';
10
10
  import { ToolbarButton } from './ToolbarButton';
11
- import { ToolbarDropdownMenuProvider, useToolbarDropdownMenu } from './ToolbarDropdownMenuContext';
11
+ import { useToolbarDropdownMenu } from './ToolbarDropdownMenuContext';
12
12
  var styles = {
13
13
  sectionMargin: "_1mouv77o",
14
14
  firstSectionSeparator: "_18l8n7od",
@@ -73,25 +73,14 @@ export var ToolbarDropdownMenu = function ToolbarDropdownMenu(_ref2) {
73
73
  _ref2$enableMaxHeight = _ref2.enableMaxHeight,
74
74
  enableMaxHeight = _ref2$enableMaxHeight === void 0 ? false : _ref2$enableMaxHeight,
75
75
  onClick = _ref2.onClick;
76
- if (expValEquals('platform_editor_toolbar_aifc_patch_1', 'isEnabled', true)) {
77
- return /*#__PURE__*/React.createElement(ToolbarDropdownMenuContent, {
78
- iconBefore: iconBefore,
79
- isDisabled: isDisabled,
80
- testId: testId,
81
- label: label,
82
- onClick: onClick
83
- }, /*#__PURE__*/React.createElement(Box, {
84
- xcss: cx(hasSectionMargin && styles.sectionMargin, enableMaxHeight && styles.scrollContainer, expValEquals('platform_editor_toolbar_migrate_loom', 'isEnabled', true) && styles.firstSectionSeparator),
85
- "data-toolbar-component": "menu"
86
- }, children));
87
- } else {
88
- return /*#__PURE__*/React.createElement(ToolbarDropdownMenuProvider, null, /*#__PURE__*/React.createElement(ToolbarDropdownMenuContent, {
89
- iconBefore: iconBefore,
90
- isDisabled: isDisabled,
91
- testId: testId,
92
- label: label
93
- }, /*#__PURE__*/React.createElement("div", {
94
- className: ax([hasSectionMargin && styles.sectionMargin, expValEquals('platform_editor_toolbar_migrate_loom', 'isEnabled', true) && styles.firstSectionSeparator])
95
- }, children)));
96
- }
76
+ return /*#__PURE__*/React.createElement(ToolbarDropdownMenuContent, {
77
+ iconBefore: iconBefore,
78
+ isDisabled: isDisabled,
79
+ testId: testId,
80
+ label: label,
81
+ onClick: onClick
82
+ }, /*#__PURE__*/React.createElement(Box, {
83
+ xcss: cx(hasSectionMargin && styles.sectionMargin, enableMaxHeight && styles.scrollContainer, expValEquals('platform_editor_toolbar_migrate_loom', 'isEnabled', true) && styles.firstSectionSeparator),
84
+ "data-toolbar-component": "menu"
85
+ }, children));
97
86
  };
@@ -1,21 +1,9 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
2
  import React, { createContext, useContext, useState } from 'react';
3
- import { conditionalHooksFactory } from '@atlaskit/platform-feature-flags-react';
4
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
5
3
  var ToolbarDropdownMenuContext = /*#__PURE__*/createContext(undefined);
6
- export var useToolbarDropdownMenuOld = function useToolbarDropdownMenuOld() {
7
- var context = useContext(ToolbarDropdownMenuContext);
8
- if (!context) {
9
- throw new Error('useToolbarDropdownMenu must be used within ToolbarDropdownMenuProvider');
10
- }
11
- return context;
12
- };
13
- export var useToolbarDropdownMenuNew = function useToolbarDropdownMenuNew() {
4
+ export var useToolbarDropdownMenu = function useToolbarDropdownMenu() {
14
5
  return useContext(ToolbarDropdownMenuContext);
15
6
  };
16
- export var useToolbarDropdownMenu = conditionalHooksFactory(function () {
17
- return expValEquals('platform_editor_toolbar_aifc_patch_1', 'isEnabled', true);
18
- }, useToolbarDropdownMenuNew, useToolbarDropdownMenuOld);
19
7
  export var ToolbarDropdownMenuProvider = function ToolbarDropdownMenuProvider(_ref) {
20
8
  var children = _ref.children;
21
9
  var _useState = useState(false),
@@ -4,9 +4,7 @@ interface ToolbarDropdownMenuContextValue {
4
4
  isOpen: boolean;
5
5
  openMenu: () => void;
6
6
  }
7
- export declare const useToolbarDropdownMenuOld: () => ToolbarDropdownMenuContextValue;
8
- export declare const useToolbarDropdownMenuNew: () => ToolbarDropdownMenuContextValue | undefined;
9
- export declare const useToolbarDropdownMenu: (...args: never[]) => ToolbarDropdownMenuContextValue | undefined;
7
+ export declare const useToolbarDropdownMenu: () => ToolbarDropdownMenuContextValue | undefined;
10
8
  interface ToolbarDropdownMenuProviderProps {
11
9
  children: React.ReactNode;
12
10
  }
@@ -4,9 +4,7 @@ interface ToolbarDropdownMenuContextValue {
4
4
  isOpen: boolean;
5
5
  openMenu: () => void;
6
6
  }
7
- export declare const useToolbarDropdownMenuOld: () => ToolbarDropdownMenuContextValue;
8
- export declare const useToolbarDropdownMenuNew: () => ToolbarDropdownMenuContextValue | undefined;
9
- export declare const useToolbarDropdownMenu: (...args: never[]) => ToolbarDropdownMenuContextValue | undefined;
7
+ export declare const useToolbarDropdownMenu: () => ToolbarDropdownMenuContextValue | undefined;
10
8
  interface ToolbarDropdownMenuProviderProps {
11
9
  children: React.ReactNode;
12
10
  }
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "registry": "https://registry.npmjs.org/"
5
5
  },
6
- "version": "0.11.0",
6
+ "version": "0.12.1",
7
7
  "description": "Common UI for Toolbars across the platform",
8
8
  "atlassian": {
9
9
  "team": "Editor: Jenga",
@@ -22,7 +22,7 @@
22
22
  "atlaskit:src": "src/index.ts",
23
23
  "dependencies": {
24
24
  "@atlaskit/badge": "^18.2.0",
25
- "@atlaskit/button": "^23.4.0",
25
+ "@atlaskit/button": "^23.5.0",
26
26
  "@atlaskit/css": "^0.14.0",
27
27
  "@atlaskit/dropdown-menu": "^16.3.0",
28
28
  "@atlaskit/icon": "^28.3.0",
@@ -32,7 +32,7 @@
32
32
  "@atlaskit/platform-feature-flags-react": "^0.3.0",
33
33
  "@atlaskit/popup": "^4.4.0",
34
34
  "@atlaskit/primitives": "^14.15.0",
35
- "@atlaskit/tmp-editor-statsig": "^13.0.0",
35
+ "@atlaskit/tmp-editor-statsig": "^13.2.0",
36
36
  "@atlaskit/tokens": "^6.4.0",
37
37
  "@atlaskit/tooltip": "^20.5.0",
38
38
  "@babel/runtime": "^7.0.0",
@@ -1 +0,0 @@
1
- ._1e0c1txw{display:flex}
@@ -1 +0,0 @@
1
- ._1e0c1txw{display:flex}
@@ -1 +0,0 @@
1
- ._1e0c1txw{display:flex}