@atlaskit/editor-toolbar 0.17.4 → 0.17.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 CHANGED
@@ -1,5 +1,19 @@
1
1
  # @atlaskit/editor-toolbar
2
2
 
3
+ ## 0.17.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [`fd59b4b1d712d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/fd59b4b1d712d) -
8
+ [ux] ED-29573 Improve JSM comment responsiveness
9
+
10
+ ## 0.17.5
11
+
12
+ ### Patch Changes
13
+
14
+ - [`8263f21e34dff`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8263f21e34dff) -
15
+ [ux] ED-29646 Implement ResponsiveContainer breakpoint preset system
16
+
3
17
  ## 0.17.4
4
18
 
5
19
  ### Patch Changes
@@ -14,11 +14,14 @@
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
16
  @container toolbar-container (max-width: 210px){._j094glyw._j094glyw .show-above-sm{display:none}._1mc51ule._1mc51ule .show-below-sm{display:block}}
17
+ @container toolbar-container (max-width: 320px){._1jfeglyw._1jfeglyw .show-above-sm{display:none}._5rhr1ule._5rhr1ule .show-below-sm{display:block}}
17
18
  @container toolbar-container (max-width: 408px){._gipeglyw._gipeglyw .show-above-md{display:none}._311r1ule._311r1ule .show-below-md{display:block}}
18
19
  @container toolbar-container (max-width: 410px){._6nrqglyw .show-above-sm{display:none}._1fq21ule .show-below-sm{display:block}}
20
+ @container toolbar-container (max-width: 460px){._1uedglyw._1uedglyw .show-above-md{display:none}._r2zg1ule._r2zg1ule .show-below-md{display:block}}
19
21
  @container toolbar-container (max-width: 476px){._1ireglyw .show-above-md{display:none}._zy2m1ule .show-below-md{display:block}}
20
22
  @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}}
23
+ @container toolbar-container (max-width: 590px){._1amcglyw._1amcglyw .show-above-lg{display:none}._1ya51ule._1ya51ule .show-below-lg{display:block}}
24
+ @container toolbar-container (max-width: 648px){._4kfbglyw._4kfbglyw .show-above-lg{display:none}._j1h31ule._j1h31ule .show-below-lg{display:block}._e2nbglyw._e2nbglyw._e2nbglyw .show-above-lg{display:none}._ol4q1ule._ol4q1ule._ol4q1ule .show-below-lg{display:block}}
22
25
  @container toolbar-container (max-width: 768px){._hfbeglyw .show-above-lg{display:none}._gw6d1ule .show-below-lg{display:block}}
23
26
  @media (max-width:700px){._hmx4glyw .show-above-lg{display:none}._1rrm1ule .show-below-lg{display:block}}
24
27
  @media (max-width:533px){._ut18glyw .show-above-md{display:none}._1nwo1ule .show-below-md{display:block}}
@@ -13,15 +13,35 @@ require("./ResponsiveContainer.compiled.css");
13
13
  var _runtime = require("@compiled/react/runtime");
14
14
  var _react = _interopRequireDefault(require("react"));
15
15
  var _css = require("@atlaskit/css");
16
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
16
17
  var _compiled = require("@atlaskit/primitives/compiled");
17
18
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
18
19
  var styles = {
19
20
  responsiveContainer: "_1bsb1osq _7cca15wb _1f38ptqj _1bx91ule _1ehg1ule _1onx1ule _1xt01ule _zg9wglyw _1a2cglyw _sum2glyw _1vtcglyw",
21
+ fullpage: "_t3a8glyw _1x5z1ule _6nrqglyw _1fq21ule _1ireglyw _zy2m1ule _hfbeglyw _gw6d1ule",
22
+ reduced: "_j094glyw _1mc51ule _gipeglyw _311r1ule _11u4glyw _v1i61ule _19x4glyw _qck01ule",
23
+ jiraIssue: "_j094glyw _1mc51ule _gipeglyw _311r1ule _11u4glyw _v1i61ule _19x4glyw _qck01ule",
24
+ jsmComment: "_1jfeglyw _5rhr1ule _1uedglyw _r2zg1ule _1amcglyw _1ya51ule _19x4glyw _qck01ule",
25
+ confluenceComment: "_j094glyw _1mc51ule _gipeglyw _311r1ule _4kfbglyw _j1h31ule _19x4glyw _qck01ule",
20
26
  responsiveRules: "_t3a8glyw _1x5z1ule _6nrqglyw _1fq21ule _1ireglyw _zy2m1ule _hfbeglyw _gw6d1ule",
21
27
  responsiveRulesReduced: "_j094glyw _1mc51ule _gipeglyw _311r1ule _11u4glyw _v1i61ule _19x4glyw _qck01ule",
22
28
  responsiveRulesReducedOverridden: "_e2nbglyw _ol4q1ule",
23
29
  responsiveRulesWrapper: "_1bx91ule _1ehg1ule _1onx1ule _1xt01ule _zg9wglyw _1a2cglyw _sum2glyw _1vtcglyw _33p2glyw _1dre1ule _u47mglyw _rut51ule _fj5dglyw _5wt61ule _hmx4glyw _1rrm1ule _ut18glyw _1nwo1ule _19fzglyw _1r831ule"
24
30
  };
31
+
32
+ /**
33
+ * Breakpoint preset names for ResponsiveContainer.
34
+ * Each preset defines a specific set of breakpoints optimized for different use cases.
35
+ */
36
+
37
+ // Map preset names to camelCase style keys
38
+ var presetStyleMap = {
39
+ fullpage: styles.fullpage,
40
+ reduced: styles.reduced,
41
+ 'jira-issue': styles.jiraIssue,
42
+ 'jsm-comment': styles.jsmComment,
43
+ 'confluence-comment': styles.confluenceComment
44
+ };
25
45
  /**
26
46
  * A responsive container that enables container query-based responsive design using CSS container queries.
27
47
  * This component establishes a containment context named 'toolbar-container' that child components can
@@ -62,12 +82,21 @@ var styles = {
62
82
  * </ResponsiveContainer>
63
83
  * ```
64
84
  *
65
- * @param children - React nodes to render within the responsive container context
85
+ * @param preset - Selects the breakpoint preset for the responsive container
86
+ *
87
+ * @param reducedBreakpoints - Legacy prop for reduced breakpoints (deprecated, use preset instead)
66
88
  * @returns A Box component with container query styles applied
67
89
  */
68
90
  var ResponsiveContainer = exports.ResponsiveContainer = function ResponsiveContainer(_ref) {
69
91
  var children = _ref.children,
92
+ breakpointPreset = _ref.breakpointPreset,
70
93
  reducedBreakpoints = _ref.reducedBreakpoints;
94
+ // Use new preset-based logic when preset is provided and feature gate is enabled
95
+ if (breakpointPreset && (0, _platformFeatureFlags.fg)('platform_editor_toolbar_aifc_responsive_improve')) {
96
+ return /*#__PURE__*/_react.default.createElement(_compiled.Box, {
97
+ xcss: (0, _css.cx)(styles.responsiveContainer, presetStyleMap[breakpointPreset])
98
+ }, children);
99
+ }
71
100
  return /*#__PURE__*/_react.default.createElement(_compiled.Box, {
72
101
  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)
73
102
  }, children);
@@ -80,9 +80,11 @@ var Toolbar = exports.Toolbar = function Toolbar(_ref) {
80
80
  var PrimaryToolbar = exports.PrimaryToolbar = function PrimaryToolbar(_ref2) {
81
81
  var children = _ref2.children,
82
82
  label = _ref2.label,
83
+ breakpointPreset = _ref2.breakpointPreset,
83
84
  reducedBreakpoints = _ref2.reducedBreakpoints;
84
85
  if ((0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_responsive', 'isEnabled', true)) {
85
86
  return /*#__PURE__*/_react.default.createElement(_ResponsiveContainer.ResponsiveContainer, {
87
+ breakpointPreset: breakpointPreset,
86
88
  reducedBreakpoints: reducedBreakpoints
87
89
  }, /*#__PURE__*/_react.default.createElement(_compiled.Box, {
88
90
  xcss: (0, _css.cx)(styles.toolbarBase, styles.primaryToolbar, styles.hiddenSelectors),
@@ -14,11 +14,14 @@
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
16
  @container toolbar-container (max-width: 210px){._j094glyw._j094glyw .show-above-sm{display:none}._1mc51ule._1mc51ule .show-below-sm{display:block}}
17
+ @container toolbar-container (max-width: 320px){._1jfeglyw._1jfeglyw .show-above-sm{display:none}._5rhr1ule._5rhr1ule .show-below-sm{display:block}}
17
18
  @container toolbar-container (max-width: 408px){._gipeglyw._gipeglyw .show-above-md{display:none}._311r1ule._311r1ule .show-below-md{display:block}}
18
19
  @container toolbar-container (max-width: 410px){._6nrqglyw .show-above-sm{display:none}._1fq21ule .show-below-sm{display:block}}
20
+ @container toolbar-container (max-width: 460px){._1uedglyw._1uedglyw .show-above-md{display:none}._r2zg1ule._r2zg1ule .show-below-md{display:block}}
19
21
  @container toolbar-container (max-width: 476px){._1ireglyw .show-above-md{display:none}._zy2m1ule .show-below-md{display:block}}
20
22
  @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}}
23
+ @container toolbar-container (max-width: 590px){._1amcglyw._1amcglyw .show-above-lg{display:none}._1ya51ule._1ya51ule .show-below-lg{display:block}}
24
+ @container toolbar-container (max-width: 648px){._4kfbglyw._4kfbglyw .show-above-lg{display:none}._j1h31ule._j1h31ule .show-below-lg{display:block}._e2nbglyw._e2nbglyw._e2nbglyw .show-above-lg{display:none}._ol4q1ule._ol4q1ule._ol4q1ule .show-below-lg{display:block}}
22
25
  @container toolbar-container (max-width: 768px){._hfbeglyw .show-above-lg{display:none}._gw6d1ule .show-below-lg{display:block}}
23
26
  @media (max-width:700px){._hmx4glyw .show-above-lg{display:none}._1rrm1ule .show-below-lg{display:block}}
24
27
  @media (max-width:533px){._ut18glyw .show-above-md{display:none}._1nwo1ule .show-below-md{display:block}}
@@ -6,15 +6,35 @@ import "./ResponsiveContainer.compiled.css";
6
6
  import { ax, ix } from "@compiled/react/runtime";
7
7
  import React from 'react';
8
8
  import { cx } from '@atlaskit/css';
9
+ import { fg } from '@atlaskit/platform-feature-flags';
9
10
  import { Box } from '@atlaskit/primitives/compiled';
10
11
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
11
12
  const styles = {
12
13
  responsiveContainer: "_1bsb1osq _7cca15wb _1f38ptqj _1bx91ule _1ehg1ule _1onx1ule _1xt01ule _zg9wglyw _1a2cglyw _sum2glyw _1vtcglyw",
14
+ fullpage: "_t3a8glyw _1x5z1ule _6nrqglyw _1fq21ule _1ireglyw _zy2m1ule _hfbeglyw _gw6d1ule",
15
+ reduced: "_j094glyw _1mc51ule _gipeglyw _311r1ule _11u4glyw _v1i61ule _19x4glyw _qck01ule",
16
+ jiraIssue: "_j094glyw _1mc51ule _gipeglyw _311r1ule _11u4glyw _v1i61ule _19x4glyw _qck01ule",
17
+ jsmComment: "_1jfeglyw _5rhr1ule _1uedglyw _r2zg1ule _1amcglyw _1ya51ule _19x4glyw _qck01ule",
18
+ confluenceComment: "_j094glyw _1mc51ule _gipeglyw _311r1ule _4kfbglyw _j1h31ule _19x4glyw _qck01ule",
13
19
  responsiveRules: "_t3a8glyw _1x5z1ule _6nrqglyw _1fq21ule _1ireglyw _zy2m1ule _hfbeglyw _gw6d1ule",
14
20
  responsiveRulesReduced: "_j094glyw _1mc51ule _gipeglyw _311r1ule _11u4glyw _v1i61ule _19x4glyw _qck01ule",
15
21
  responsiveRulesReducedOverridden: "_e2nbglyw _ol4q1ule",
16
22
  responsiveRulesWrapper: "_1bx91ule _1ehg1ule _1onx1ule _1xt01ule _zg9wglyw _1a2cglyw _sum2glyw _1vtcglyw _33p2glyw _1dre1ule _u47mglyw _rut51ule _fj5dglyw _5wt61ule _hmx4glyw _1rrm1ule _ut18glyw _1nwo1ule _19fzglyw _1r831ule"
17
23
  };
24
+
25
+ /**
26
+ * Breakpoint preset names for ResponsiveContainer.
27
+ * Each preset defines a specific set of breakpoints optimized for different use cases.
28
+ */
29
+
30
+ // Map preset names to camelCase style keys
31
+ const presetStyleMap = {
32
+ fullpage: styles.fullpage,
33
+ reduced: styles.reduced,
34
+ 'jira-issue': styles.jiraIssue,
35
+ 'jsm-comment': styles.jsmComment,
36
+ 'confluence-comment': styles.confluenceComment
37
+ };
18
38
  /**
19
39
  * A responsive container that enables container query-based responsive design using CSS container queries.
20
40
  * This component establishes a containment context named 'toolbar-container' that child components can
@@ -55,13 +75,22 @@ const styles = {
55
75
  * </ResponsiveContainer>
56
76
  * ```
57
77
  *
58
- * @param children - React nodes to render within the responsive container context
78
+ * @param preset - Selects the breakpoint preset for the responsive container
79
+ *
80
+ * @param reducedBreakpoints - Legacy prop for reduced breakpoints (deprecated, use preset instead)
59
81
  * @returns A Box component with container query styles applied
60
82
  */
61
83
  export const ResponsiveContainer = ({
62
84
  children,
85
+ breakpointPreset,
63
86
  reducedBreakpoints
64
87
  }) => {
88
+ // Use new preset-based logic when preset is provided and feature gate is enabled
89
+ if (breakpointPreset && fg('platform_editor_toolbar_aifc_responsive_improve')) {
90
+ return /*#__PURE__*/React.createElement(Box, {
91
+ xcss: cx(styles.responsiveContainer, presetStyleMap[breakpointPreset])
92
+ }, children);
93
+ }
65
94
  return /*#__PURE__*/React.createElement(Box, {
66
95
  xcss: cx(styles.responsiveContainer, reducedBreakpoints ? styles.responsiveRulesReduced : styles.responsiveRules, reducedBreakpoints && expValEquals('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true) && styles.responsiveRulesReducedOverridden)
67
96
  }, children);
@@ -77,10 +77,12 @@ export const Toolbar = ({
77
77
  export const PrimaryToolbar = ({
78
78
  children,
79
79
  label,
80
+ breakpointPreset,
80
81
  reducedBreakpoints
81
82
  }) => {
82
83
  if (expValEquals('platform_editor_toolbar_aifc_responsive', 'isEnabled', true)) {
83
84
  return /*#__PURE__*/React.createElement(ResponsiveContainer, {
85
+ breakpointPreset: breakpointPreset,
84
86
  reducedBreakpoints: reducedBreakpoints
85
87
  }, /*#__PURE__*/React.createElement(Box, {
86
88
  xcss: cx(styles.toolbarBase, styles.primaryToolbar, styles.hiddenSelectors),
@@ -14,11 +14,14 @@
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
16
  @container toolbar-container (max-width: 210px){._j094glyw._j094glyw .show-above-sm{display:none}._1mc51ule._1mc51ule .show-below-sm{display:block}}
17
+ @container toolbar-container (max-width: 320px){._1jfeglyw._1jfeglyw .show-above-sm{display:none}._5rhr1ule._5rhr1ule .show-below-sm{display:block}}
17
18
  @container toolbar-container (max-width: 408px){._gipeglyw._gipeglyw .show-above-md{display:none}._311r1ule._311r1ule .show-below-md{display:block}}
18
19
  @container toolbar-container (max-width: 410px){._6nrqglyw .show-above-sm{display:none}._1fq21ule .show-below-sm{display:block}}
20
+ @container toolbar-container (max-width: 460px){._1uedglyw._1uedglyw .show-above-md{display:none}._r2zg1ule._r2zg1ule .show-below-md{display:block}}
19
21
  @container toolbar-container (max-width: 476px){._1ireglyw .show-above-md{display:none}._zy2m1ule .show-below-md{display:block}}
20
22
  @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}}
23
+ @container toolbar-container (max-width: 590px){._1amcglyw._1amcglyw .show-above-lg{display:none}._1ya51ule._1ya51ule .show-below-lg{display:block}}
24
+ @container toolbar-container (max-width: 648px){._4kfbglyw._4kfbglyw .show-above-lg{display:none}._j1h31ule._j1h31ule .show-below-lg{display:block}._e2nbglyw._e2nbglyw._e2nbglyw .show-above-lg{display:none}._ol4q1ule._ol4q1ule._ol4q1ule .show-below-lg{display:block}}
22
25
  @container toolbar-container (max-width: 768px){._hfbeglyw .show-above-lg{display:none}._gw6d1ule .show-below-lg{display:block}}
23
26
  @media (max-width:700px){._hmx4glyw .show-above-lg{display:none}._1rrm1ule .show-below-lg{display:block}}
24
27
  @media (max-width:533px){._ut18glyw .show-above-md{display:none}._1nwo1ule .show-below-md{display:block}}
@@ -6,15 +6,35 @@ import "./ResponsiveContainer.compiled.css";
6
6
  import { ax, ix } from "@compiled/react/runtime";
7
7
  import React from 'react';
8
8
  import { cx } from '@atlaskit/css';
9
+ import { fg } from '@atlaskit/platform-feature-flags';
9
10
  import { Box } from '@atlaskit/primitives/compiled';
10
11
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
11
12
  var styles = {
12
13
  responsiveContainer: "_1bsb1osq _7cca15wb _1f38ptqj _1bx91ule _1ehg1ule _1onx1ule _1xt01ule _zg9wglyw _1a2cglyw _sum2glyw _1vtcglyw",
14
+ fullpage: "_t3a8glyw _1x5z1ule _6nrqglyw _1fq21ule _1ireglyw _zy2m1ule _hfbeglyw _gw6d1ule",
15
+ reduced: "_j094glyw _1mc51ule _gipeglyw _311r1ule _11u4glyw _v1i61ule _19x4glyw _qck01ule",
16
+ jiraIssue: "_j094glyw _1mc51ule _gipeglyw _311r1ule _11u4glyw _v1i61ule _19x4glyw _qck01ule",
17
+ jsmComment: "_1jfeglyw _5rhr1ule _1uedglyw _r2zg1ule _1amcglyw _1ya51ule _19x4glyw _qck01ule",
18
+ confluenceComment: "_j094glyw _1mc51ule _gipeglyw _311r1ule _4kfbglyw _j1h31ule _19x4glyw _qck01ule",
13
19
  responsiveRules: "_t3a8glyw _1x5z1ule _6nrqglyw _1fq21ule _1ireglyw _zy2m1ule _hfbeglyw _gw6d1ule",
14
20
  responsiveRulesReduced: "_j094glyw _1mc51ule _gipeglyw _311r1ule _11u4glyw _v1i61ule _19x4glyw _qck01ule",
15
21
  responsiveRulesReducedOverridden: "_e2nbglyw _ol4q1ule",
16
22
  responsiveRulesWrapper: "_1bx91ule _1ehg1ule _1onx1ule _1xt01ule _zg9wglyw _1a2cglyw _sum2glyw _1vtcglyw _33p2glyw _1dre1ule _u47mglyw _rut51ule _fj5dglyw _5wt61ule _hmx4glyw _1rrm1ule _ut18glyw _1nwo1ule _19fzglyw _1r831ule"
17
23
  };
24
+
25
+ /**
26
+ * Breakpoint preset names for ResponsiveContainer.
27
+ * Each preset defines a specific set of breakpoints optimized for different use cases.
28
+ */
29
+
30
+ // Map preset names to camelCase style keys
31
+ var presetStyleMap = {
32
+ fullpage: styles.fullpage,
33
+ reduced: styles.reduced,
34
+ 'jira-issue': styles.jiraIssue,
35
+ 'jsm-comment': styles.jsmComment,
36
+ 'confluence-comment': styles.confluenceComment
37
+ };
18
38
  /**
19
39
  * A responsive container that enables container query-based responsive design using CSS container queries.
20
40
  * This component establishes a containment context named 'toolbar-container' that child components can
@@ -55,12 +75,21 @@ var styles = {
55
75
  * </ResponsiveContainer>
56
76
  * ```
57
77
  *
58
- * @param children - React nodes to render within the responsive container context
78
+ * @param preset - Selects the breakpoint preset for the responsive container
79
+ *
80
+ * @param reducedBreakpoints - Legacy prop for reduced breakpoints (deprecated, use preset instead)
59
81
  * @returns A Box component with container query styles applied
60
82
  */
61
83
  export var ResponsiveContainer = function ResponsiveContainer(_ref) {
62
84
  var children = _ref.children,
85
+ breakpointPreset = _ref.breakpointPreset,
63
86
  reducedBreakpoints = _ref.reducedBreakpoints;
87
+ // Use new preset-based logic when preset is provided and feature gate is enabled
88
+ if (breakpointPreset && fg('platform_editor_toolbar_aifc_responsive_improve')) {
89
+ return /*#__PURE__*/React.createElement(Box, {
90
+ xcss: cx(styles.responsiveContainer, presetStyleMap[breakpointPreset])
91
+ }, children);
92
+ }
64
93
  return /*#__PURE__*/React.createElement(Box, {
65
94
  xcss: cx(styles.responsiveContainer, reducedBreakpoints ? styles.responsiveRulesReduced : styles.responsiveRules, reducedBreakpoints && expValEquals('platform_editor_toolbar_aifc_patch_6', 'isEnabled', true) && styles.responsiveRulesReducedOverridden)
66
95
  }, children);
@@ -73,9 +73,11 @@ export var Toolbar = function Toolbar(_ref) {
73
73
  export var PrimaryToolbar = function PrimaryToolbar(_ref2) {
74
74
  var children = _ref2.children,
75
75
  label = _ref2.label,
76
+ breakpointPreset = _ref2.breakpointPreset,
76
77
  reducedBreakpoints = _ref2.reducedBreakpoints;
77
78
  if (expValEquals('platform_editor_toolbar_aifc_responsive', 'isEnabled', true)) {
78
79
  return /*#__PURE__*/React.createElement(ResponsiveContainer, {
80
+ breakpointPreset: breakpointPreset,
79
81
  reducedBreakpoints: reducedBreakpoints
80
82
  }, /*#__PURE__*/React.createElement(Box, {
81
83
  xcss: cx(styles.toolbarBase, styles.primaryToolbar, styles.hiddenSelectors),
@@ -11,7 +11,7 @@ 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';
14
- export { ResponsiveContainer } from './ui/ResponsiveContainer';
14
+ export { ResponsiveContainer, type BreakpointPreset } from './ui/ResponsiveContainer';
15
15
  export { Show } from './ui/Show';
16
16
  export { AIAdjustLengthIcon } from './ui/icons/AIAdjustLengthIcon';
17
17
  export { AIChatIcon } from './ui/icons/AIChatIcon';
@@ -1,9 +1,26 @@
1
1
  import React, { type ReactNode } from 'react';
2
+ /**
3
+ * Breakpoint preset names for ResponsiveContainer.
4
+ * Each preset defines a specific set of breakpoints optimized for different use cases.
5
+ */
6
+ export type BreakpointPreset = 'fullpage' | 'reduced' | 'jira-issue' | 'jsm-comment' | 'confluence-comment';
2
7
  export type ResponsiveContainerProps = {
3
- children: ReactNode;
4
8
  /**
5
- * This flag changes the breakpoint definitions, which reduces them to cater for smaller editor widths.
9
+ * Selects the breakpoint preset for the responsive container.
10
+ *
11
+ * Available presets:
12
+ * - 'fullpage': (410, 476, 768, 1024) - Editor full-page experiences
13
+ * - 'reduced': (210, 408, 575, 1024) - Default compact toolbars, constrained layouts
14
+ * - 'jira-issue': (210, 408, 575, 1024) - Jira issue view and similar contexts
15
+ * - 'jsm-comment': (210, 408, 550, 1024) - JSM comment editor with canned responses button
16
+ * - 'confluence-comment': (210, 408, 648, 1024) - Confluence comment editor and inline contexts
6
17
  *
18
+ * @default 'fullpage'
19
+ */
20
+ breakpointPreset?: BreakpointPreset;
21
+ children: ReactNode;
22
+ /**
23
+ * Use `preset` prop instead. This flag changes the breakpoint definitions, which reduces them to cater for smaller editor widths.
7
24
  * Usages - for smaller editors such as comments
8
25
  */
9
26
  reducedBreakpoints?: boolean;
@@ -48,10 +65,12 @@ export type ResponsiveContainerProps = {
48
65
  * </ResponsiveContainer>
49
66
  * ```
50
67
  *
51
- * @param children - React nodes to render within the responsive container context
68
+ * @param preset - Selects the breakpoint preset for the responsive container
69
+ *
70
+ * @param reducedBreakpoints - Legacy prop for reduced breakpoints (deprecated, use preset instead)
52
71
  * @returns A Box component with container query styles applied
53
72
  */
54
- export declare const ResponsiveContainer: ({ children, reducedBreakpoints }: ResponsiveContainerProps) => React.JSX.Element;
73
+ export declare const ResponsiveContainer: ({ children, breakpointPreset, reducedBreakpoints, }: ResponsiveContainerProps) => React.JSX.Element;
55
74
  /**
56
75
  * A wrapper that supports responsiveness with media queries. It needs to used together with Show component
57
76
  */
@@ -21,5 +21,5 @@ type PrimaryToolbarProps = ToolbarProps & ResponsiveContainerProps;
21
21
  /**
22
22
  * A simple component representing a toolbar without box shadows - used to represent a primary toolbar
23
23
  */
24
- export declare const PrimaryToolbar: ({ children, label, reducedBreakpoints }: PrimaryToolbarProps) => React.JSX.Element;
24
+ export declare const PrimaryToolbar: ({ children, label, breakpointPreset, reducedBreakpoints, }: PrimaryToolbarProps) => React.JSX.Element;
25
25
  export {};
@@ -11,7 +11,7 @@ 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';
14
- export { ResponsiveContainer } from './ui/ResponsiveContainer';
14
+ export { ResponsiveContainer, type BreakpointPreset } from './ui/ResponsiveContainer';
15
15
  export { Show } from './ui/Show';
16
16
  export { AIAdjustLengthIcon } from './ui/icons/AIAdjustLengthIcon';
17
17
  export { AIChatIcon } from './ui/icons/AIChatIcon';
@@ -1,9 +1,26 @@
1
1
  import React, { type ReactNode } from 'react';
2
+ /**
3
+ * Breakpoint preset names for ResponsiveContainer.
4
+ * Each preset defines a specific set of breakpoints optimized for different use cases.
5
+ */
6
+ export type BreakpointPreset = 'fullpage' | 'reduced' | 'jira-issue' | 'jsm-comment' | 'confluence-comment';
2
7
  export type ResponsiveContainerProps = {
3
- children: ReactNode;
4
8
  /**
5
- * This flag changes the breakpoint definitions, which reduces them to cater for smaller editor widths.
9
+ * Selects the breakpoint preset for the responsive container.
10
+ *
11
+ * Available presets:
12
+ * - 'fullpage': (410, 476, 768, 1024) - Editor full-page experiences
13
+ * - 'reduced': (210, 408, 575, 1024) - Default compact toolbars, constrained layouts
14
+ * - 'jira-issue': (210, 408, 575, 1024) - Jira issue view and similar contexts
15
+ * - 'jsm-comment': (210, 408, 550, 1024) - JSM comment editor with canned responses button
16
+ * - 'confluence-comment': (210, 408, 648, 1024) - Confluence comment editor and inline contexts
6
17
  *
18
+ * @default 'fullpage'
19
+ */
20
+ breakpointPreset?: BreakpointPreset;
21
+ children: ReactNode;
22
+ /**
23
+ * Use `preset` prop instead. This flag changes the breakpoint definitions, which reduces them to cater for smaller editor widths.
7
24
  * Usages - for smaller editors such as comments
8
25
  */
9
26
  reducedBreakpoints?: boolean;
@@ -48,10 +65,12 @@ export type ResponsiveContainerProps = {
48
65
  * </ResponsiveContainer>
49
66
  * ```
50
67
  *
51
- * @param children - React nodes to render within the responsive container context
68
+ * @param preset - Selects the breakpoint preset for the responsive container
69
+ *
70
+ * @param reducedBreakpoints - Legacy prop for reduced breakpoints (deprecated, use preset instead)
52
71
  * @returns A Box component with container query styles applied
53
72
  */
54
- export declare const ResponsiveContainer: ({ children, reducedBreakpoints }: ResponsiveContainerProps) => React.JSX.Element;
73
+ export declare const ResponsiveContainer: ({ children, breakpointPreset, reducedBreakpoints, }: ResponsiveContainerProps) => React.JSX.Element;
55
74
  /**
56
75
  * A wrapper that supports responsiveness with media queries. It needs to used together with Show component
57
76
  */
@@ -21,5 +21,5 @@ type PrimaryToolbarProps = ToolbarProps & ResponsiveContainerProps;
21
21
  /**
22
22
  * A simple component representing a toolbar without box shadows - used to represent a primary toolbar
23
23
  */
24
- export declare const PrimaryToolbar: ({ children, label, reducedBreakpoints }: PrimaryToolbarProps) => React.JSX.Element;
24
+ export declare const PrimaryToolbar: ({ children, label, breakpointPreset, reducedBreakpoints, }: PrimaryToolbarProps) => React.JSX.Element;
25
25
  export {};
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "registry": "https://registry.npmjs.org/"
5
5
  },
6
- "version": "0.17.4",
6
+ "version": "0.17.6",
7
7
  "description": "Common UI for Toolbars across the platform",
8
8
  "atlassian": {
9
9
  "team": "Editor: Jenga",
@@ -33,9 +33,9 @@
33
33
  "@atlaskit/platform-feature-flags-react": "^0.4.0",
34
34
  "@atlaskit/popup": "^4.6.0",
35
35
  "@atlaskit/primitives": "^16.1.0",
36
- "@atlaskit/tmp-editor-statsig": "^13.35.0",
36
+ "@atlaskit/tmp-editor-statsig": "^13.38.0",
37
37
  "@atlaskit/tokens": "^8.0.0",
38
- "@atlaskit/tooltip": "^20.8.0",
38
+ "@atlaskit/tooltip": "^20.9.0",
39
39
  "@babel/runtime": "^7.0.0",
40
40
  "@compiled/react": "^0.18.6",
41
41
  "chromatism": "^2.6.0"
@@ -89,6 +89,9 @@
89
89
  "platform-feature-flags": {
90
90
  "platform_editor_toolbar_aifc_patch_7": {
91
91
  "type": "boolean"
92
+ },
93
+ "platform_editor_toolbar_aifc_responsive_improve": {
94
+ "type": "boolean"
92
95
  }
93
96
  }
94
97
  }