@atlaskit/editor-core 221.2.0 → 221.2.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.
Files changed (61) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/cjs/ui/Appearance/Comment/FixedToolbar-compiled.compiled.css +20 -0
  3. package/dist/cjs/ui/Appearance/Comment/FixedToolbar-compiled.js +35 -0
  4. package/dist/cjs/ui/Appearance/Comment/FixedToolbar-emotion.js +94 -0
  5. package/dist/cjs/ui/Appearance/Comment/StickyToolbar-compiled.compiled.css +25 -0
  6. package/dist/cjs/ui/Appearance/Comment/StickyToolbar-compiled.js +66 -0
  7. package/dist/cjs/ui/Appearance/Comment/StickyToolbar-emotion.js +131 -0
  8. package/dist/cjs/ui/Appearance/Comment/Toolbar.js +14 -134
  9. package/dist/cjs/ui/Toolbar/ToolbarComponentsWrapper-compiled.compiled.css +2 -0
  10. package/dist/cjs/ui/Toolbar/ToolbarComponentsWrapper-compiled.js +29 -0
  11. package/dist/cjs/ui/Toolbar/ToolbarComponentsWrapper-emotion.js +36 -0
  12. package/dist/cjs/ui/Toolbar/ToolbarInner.js +9 -14
  13. package/dist/cjs/ui/Toolbar/ToolbarSizeDetectorWrapper-compiled.compiled.css +2 -0
  14. package/dist/cjs/ui/Toolbar/ToolbarSizeDetectorWrapper-compiled.js +29 -0
  15. package/dist/cjs/ui/Toolbar/ToolbarSizeDetectorWrapper-emotion.js +32 -0
  16. package/dist/cjs/ui/Toolbar/ToolbarWithSizeDetector.js +21 -19
  17. package/dist/cjs/version-wrapper.js +1 -1
  18. package/dist/es2019/ui/Appearance/Comment/FixedToolbar-compiled.compiled.css +20 -0
  19. package/dist/es2019/ui/Appearance/Comment/FixedToolbar-compiled.js +26 -0
  20. package/dist/es2019/ui/Appearance/Comment/FixedToolbar-emotion.js +91 -0
  21. package/dist/es2019/ui/Appearance/Comment/StickyToolbar-compiled.compiled.css +25 -0
  22. package/dist/es2019/ui/Appearance/Comment/StickyToolbar-compiled.js +51 -0
  23. package/dist/es2019/ui/Appearance/Comment/StickyToolbar-emotion.js +128 -0
  24. package/dist/es2019/ui/Appearance/Comment/Toolbar.js +10 -133
  25. package/dist/es2019/ui/Toolbar/ToolbarComponentsWrapper-compiled.compiled.css +2 -0
  26. package/dist/es2019/ui/Toolbar/ToolbarComponentsWrapper-compiled.js +20 -0
  27. package/dist/es2019/ui/Toolbar/ToolbarComponentsWrapper-emotion.js +28 -0
  28. package/dist/es2019/ui/Toolbar/ToolbarInner.js +6 -17
  29. package/dist/es2019/ui/Toolbar/ToolbarSizeDetectorWrapper-compiled.compiled.css +2 -0
  30. package/dist/es2019/ui/Toolbar/ToolbarSizeDetectorWrapper-compiled.js +20 -0
  31. package/dist/es2019/ui/Toolbar/ToolbarSizeDetectorWrapper-emotion.js +24 -0
  32. package/dist/es2019/ui/Toolbar/ToolbarWithSizeDetector.js +18 -19
  33. package/dist/es2019/version-wrapper.js +1 -1
  34. package/dist/esm/ui/Appearance/Comment/FixedToolbar-compiled.compiled.css +20 -0
  35. package/dist/esm/ui/Appearance/Comment/FixedToolbar-compiled.js +28 -0
  36. package/dist/esm/ui/Appearance/Comment/FixedToolbar-emotion.js +86 -0
  37. package/dist/esm/ui/Appearance/Comment/StickyToolbar-compiled.compiled.css +25 -0
  38. package/dist/esm/ui/Appearance/Comment/StickyToolbar-compiled.js +58 -0
  39. package/dist/esm/ui/Appearance/Comment/StickyToolbar-emotion.js +124 -0
  40. package/dist/esm/ui/Appearance/Comment/Toolbar.js +14 -132
  41. package/dist/esm/ui/Toolbar/ToolbarComponentsWrapper-compiled.compiled.css +2 -0
  42. package/dist/esm/ui/Toolbar/ToolbarComponentsWrapper-compiled.js +21 -0
  43. package/dist/esm/ui/Toolbar/ToolbarComponentsWrapper-emotion.js +28 -0
  44. package/dist/esm/ui/Toolbar/ToolbarInner.js +8 -16
  45. package/dist/esm/ui/Toolbar/ToolbarSizeDetectorWrapper-compiled.compiled.css +2 -0
  46. package/dist/esm/ui/Toolbar/ToolbarSizeDetectorWrapper-compiled.js +21 -0
  47. package/dist/esm/ui/Toolbar/ToolbarSizeDetectorWrapper-emotion.js +25 -0
  48. package/dist/esm/ui/Toolbar/ToolbarWithSizeDetector.js +21 -18
  49. package/dist/esm/version-wrapper.js +1 -1
  50. package/dist/types/ui/Appearance/Comment/FixedToolbar-compiled.d.ts +20 -0
  51. package/dist/types/ui/Appearance/Comment/FixedToolbar-emotion.d.ts +19 -0
  52. package/dist/types/ui/Appearance/Comment/StickyToolbar-compiled.d.ts +22 -0
  53. package/dist/types/ui/Appearance/Comment/StickyToolbar-emotion.d.ts +21 -0
  54. package/dist/types/ui/Appearance/Comment/Toolbar.d.ts +1 -2
  55. package/dist/types/ui/Toolbar/ToolbarComponentsWrapper-compiled.d.ts +17 -0
  56. package/dist/types/ui/Toolbar/ToolbarComponentsWrapper-emotion.d.ts +17 -0
  57. package/dist/types/ui/Toolbar/ToolbarInner.d.ts +1 -6
  58. package/dist/types/ui/Toolbar/ToolbarSizeDetectorWrapper-compiled.d.ts +17 -0
  59. package/dist/types/ui/Toolbar/ToolbarSizeDetectorWrapper-emotion.d.ts +17 -0
  60. package/dist/types/ui/Toolbar/ToolbarWithSizeDetector.d.ts +2 -2
  61. package/package.json +6 -6
@@ -0,0 +1,124 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
+ /**
4
+ * @jsxRuntime classic
5
+ * @jsx jsx
6
+ */
7
+ /**
8
+ * Emotion fallback branch of the `platform_editor_core_non_ecc_static_css` experiment.
9
+ * Used via `componentWithCondition` in `Toolbar.tsx`.
10
+ *
11
+ * Cleanup: delete this file once the experiment has shipped.
12
+ */
13
+
14
+ import { useEffect, useState } from 'react';
15
+
16
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports -- intentional: emotion fallback for compiled migration
17
+ import { css, jsx } from '@emotion/react';
18
+ import { fg } from '@atlaskit/platform-feature-flags';
19
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
20
+ var MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT = 490;
21
+ var akEditorMenuZIndex = 500;
22
+ var akEditorToolbarKeylineHeight = 2;
23
+ var mainToolbarWrapperStyleNew = css({
24
+ position: 'relative',
25
+ alignItems: 'center',
26
+ padding: "var(--ds-space-100, 8px)".concat(" ", "var(--ds-space-100, 8px)", " 0"),
27
+ display: 'flex',
28
+ height: 'auto',
29
+ backgroundColor: "var(--ds-surface, #FFFFFF)",
30
+ boxShadow: 'none',
31
+ paddingLeft: "var(--ds-space-250, 20px)",
32
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
33
+ '> div': {
34
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
35
+ '> div:first-of-type:not(style), > style:first-of-type + *': {
36
+ marginLeft: 0
37
+ }
38
+ },
39
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
40
+ '.block-type-btn': {
41
+ paddingLeft: 0
42
+ }
43
+ });
44
+ var mainToolbarWithPadding = css({
45
+ padding: "var(--ds-space-100, 8px)"
46
+ });
47
+ var mainToolbarTwoLineStylesNew = css({
48
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
49
+ '& > div': _defineProperty(_defineProperty({}, "@media (max-width: ".concat(MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT, "px)"), {
50
+ flexDirection: 'column-reverse',
51
+ alignItems: 'end',
52
+ display: 'flex',
53
+ justifyContent: 'flex-end'
54
+ }), '> div:first-of-type', _defineProperty({}, "@media (max-width: ".concat(MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT, "px)"), {
55
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
56
+ '> div:nth-of-type(2)': {
57
+ justifyContent: 'flex-end',
58
+ display: 'flex'
59
+ }
60
+ }))
61
+ });
62
+ var mainToolbarWrapperStylesVisualRefresh = css({
63
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
64
+ 'span svg': {
65
+ maxWidth: '100%'
66
+ }
67
+ });
68
+ var mainToolbarWithRadiusStyle = css({
69
+ borderRadius: "var(--ds-radius-small, 3px)".concat(" ", "var(--ds-radius-small, 3px)", " 0 0")
70
+ });
71
+ var mainToolbarRadius = css({
72
+ borderRadius: "var(--ds-radius-medium, 6px)".concat(" ", "var(--ds-radius-medium, 6px)", " 0 0")
73
+ });
74
+ var editorModernisationToolbarStyle = css({
75
+ borderRadius: "var(--ds-radius-xlarge, 12px)".concat(" ", "var(--ds-radius-xlarge, 12px)", " 0 0"),
76
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
77
+ '&.show-keyline': {
78
+ boxShadow: 'none'
79
+ }
80
+ });
81
+ var stickyToolbarWrapperStyleNew = css({
82
+ position: 'sticky',
83
+ paddingBottom: "var(--ds-space-100, 8px)",
84
+ zIndex: akEditorMenuZIndex,
85
+ transition: 'box-shadow ease-in-out 0.2s',
86
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
87
+ '&.show-keyline': {
88
+ boxShadow: "0 ".concat(akEditorToolbarKeylineHeight, "px 0 0 ", "var(--ds-background-accent-gray-subtlest, #F0F1F2)")
89
+ }
90
+ });
91
+ export var StickyToolbarEmotion = function StickyToolbarEmotion(props) {
92
+ var _useState = useState(0),
93
+ _useState2 = _slicedToArray(_useState, 2),
94
+ top = _useState2[0],
95
+ setTop = _useState2[1];
96
+
97
+ // ED-15802: if externalToolbarRef is passed in, set top to externalToolbarRef?.current?.clientHeight
98
+ // else if offsetTop is a number set top to offsetTop
99
+ // otherwise top is 0 as initial state
100
+ useEffect(function () {
101
+ var _props$externalToolba;
102
+ if ((_props$externalToolba = props.externalToolbarRef) !== null && _props$externalToolba !== void 0 && (_props$externalToolba = _props$externalToolba.current) !== null && _props$externalToolba !== void 0 && _props$externalToolba.clientHeight) {
103
+ setTop(props.externalToolbarRef.current.clientHeight);
104
+ } else {
105
+ setTop(props.offsetTop || 0);
106
+ }
107
+ }, [props.externalToolbarRef, props.offsetTop]);
108
+ var wrapperStyle = {
109
+ top: "".concat(top, "px")
110
+ };
111
+ return (
112
+ // eslint-disable-next-line @atlaskit/design-system/prefer-primitives
113
+ jsx("div", {
114
+ css: [mainToolbarWrapperStyleNew, props.twoLineEditorToolbar && mainToolbarTwoLineStylesNew, mainToolbarWrapperStylesVisualRefresh, stickyToolbarWrapperStyleNew, props.isNewToolbarEnabled && mainToolbarWithPadding, expValEquals('platform_editor_comment_editor_border_radius', 'isEnabled', true) && mainToolbarRadius, !expValEquals('platform_editor_comment_editor_border_radius', 'isEnabled', true) && fg('platform_editor_comments_border_radius') && mainToolbarWithRadiusStyle, props.isEditorModernisationEnabled && editorModernisationToolbarStyle]
115
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview, @atlaskit/ui-styling-standard/enforce-style-prop -- top is computed dynamically from externalToolbarRef height / offsetTop and cannot be a static css value
116
+ ,
117
+ style: wrapperStyle,
118
+ "data-testid": "ak-editor-main-toolbar"
119
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
120
+ ,
121
+ className: 'show-keyline'
122
+ }, props.children)
123
+ );
124
+ };
@@ -1,136 +1,18 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _typeof from "@babel/runtime/helpers/typeof";
3
- import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
5
- /**
6
- * @jsxRuntime classic
7
- * @jsx jsx
8
- */
9
-
10
- import React, { useEffect, useState } from 'react';
11
-
12
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports -- Ignored via go/DSP-18766; jsx required at runtime for @jsxRuntime classic
13
- import { css, jsx } from '@emotion/react';
14
- import { fg } from '@atlaskit/platform-feature-flags';
3
+ import React from 'react';
4
+ import { componentWithCondition } from '@atlaskit/platform-feature-flags-react';
15
5
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
16
- var MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT = 490;
17
- var akEditorMenuZIndex = 500;
18
- var akEditorToolbarKeylineHeight = 2;
19
- var mainToolbarWrapperStyleNew = css({
20
- position: 'relative',
21
- alignItems: 'center',
22
- padding: "var(--ds-space-100, 8px)".concat(" ", "var(--ds-space-100, 8px)", " 0"),
23
- display: 'flex',
24
- height: 'auto',
25
- backgroundColor: "var(--ds-surface, #FFFFFF)",
26
- boxShadow: 'none',
27
- paddingLeft: "var(--ds-space-250, 20px)",
28
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
29
- '> div': {
30
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
31
- '> div:first-of-type:not(style), > style:first-of-type + *': {
32
- marginLeft: 0
33
- }
34
- },
35
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
36
- '.block-type-btn': {
37
- paddingLeft: 0
38
- }
39
- });
40
-
41
- /** keep default padding for entire toolbar */
42
- var mainToolbarWithoutLeftPadding = css({
43
- padding: "var(--ds-space-100, 8px)".concat(" ", "var(--ds-space-100, 8px)", " 0")
44
- });
45
- var mainToolbarWithPadding = css({
46
- padding: "var(--ds-space-100, 8px)"
47
- });
48
- var mainToolbarTwoLineStylesNew = css({
49
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
50
- '& > div': _defineProperty(_defineProperty({}, "@media (max-width: ".concat(MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT, "px)"), {
51
- flexDirection: 'column-reverse',
52
- alignItems: 'end',
53
- display: 'flex',
54
- justifyContent: 'flex-end'
55
- }), '> div:first-of-type', _defineProperty({}, "@media (max-width: ".concat(MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT, "px)"), {
56
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
57
- '> div:nth-of-type(2)': {
58
- justifyContent: 'flex-end',
59
- display: 'flex'
60
- }
61
- }))
62
- });
63
- var mainToolbarWrapperStylesVisualRefresh = css({
64
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
65
- 'span svg': {
66
- maxWidth: '100%'
67
- }
68
- });
69
- var mainToolbarWithRadiusStyle = css({
70
- borderRadius: "var(--ds-radius-small, 3px)".concat(" ", "var(--ds-radius-small, 3px)", " 0 0")
71
- });
72
- var mainToolbarRadius = css({
73
- borderRadius: "var(--ds-radius-medium, 6px)".concat(" ", "var(--ds-radius-medium, 6px)", " 0 0")
74
- });
75
- var editorModernisationToolbarStyle = css({
76
- borderRadius: "var(--ds-radius-xlarge, 12px)".concat(" ", "var(--ds-radius-xlarge, 12px)", " 0 0"),
77
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
78
- '&.show-keyline': {
79
- boxShadow: 'none'
80
- }
81
- });
82
- var stickyToolbarWrapperStyleNew = css({
83
- position: 'sticky',
84
- paddingBottom: "var(--ds-space-100, 8px)",
85
- zIndex: akEditorMenuZIndex,
86
- transition: 'box-shadow ease-in-out 0.2s',
87
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
88
- '&.show-keyline': {
89
- boxShadow: "0 ".concat(akEditorToolbarKeylineHeight, "px 0 0 ", "var(--ds-background-accent-gray-subtlest, #F0F1F2)")
90
- }
91
- });
92
- var StickyToolbar = function StickyToolbar(props) {
93
- var _useState = useState(0),
94
- _useState2 = _slicedToArray(_useState, 2),
95
- top = _useState2[0],
96
- setTop = _useState2[1];
97
-
98
- // ED-15802: if externalToolbarRef is passed in, set top to externalToolbarRef?.current?.clientHeight
99
- // else if offsetTop is a number set top to offsetTop
100
- // otherwise top is 0 as initial state
101
- useEffect(function () {
102
- var _props$externalToolba;
103
- if ((_props$externalToolba = props.externalToolbarRef) !== null && _props$externalToolba !== void 0 && (_props$externalToolba = _props$externalToolba.current) !== null && _props$externalToolba !== void 0 && _props$externalToolba.clientHeight) {
104
- setTop(props.externalToolbarRef.current.clientHeight);
105
- } else {
106
- setTop(props.offsetTop || 0);
107
- }
108
- }, [props.externalToolbarRef, props.offsetTop]);
109
- return (
110
- // eslint-disable-next-line @atlaskit/design-system/prefer-primitives
111
- jsx("div", {
112
- css: [mainToolbarWrapperStyleNew, props.twoLineEditorToolbar && mainToolbarTwoLineStylesNew, mainToolbarWrapperStylesVisualRefresh, stickyToolbarWrapperStyleNew, props.isNewToolbarEnabled && mainToolbarWithPadding, expValEquals('platform_editor_comment_editor_border_radius', 'isEnabled', true) && mainToolbarRadius, !expValEquals('platform_editor_comment_editor_border_radius', 'isEnabled', true) && fg('platform_editor_comments_border_radius') && mainToolbarWithRadiusStyle, props.isEditorModernisationEnabled && editorModernisationToolbarStyle]
113
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
114
- ,
115
- style: {
116
- top: "".concat(top, "px")
117
- },
118
- "data-testid": "ak-editor-main-toolbar"
119
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
120
- ,
121
- className: 'show-keyline'
122
- }, props.children)
123
- );
124
- };
125
- var FixedToolbar = function FixedToolbar(props) {
126
- return (
127
- // eslint-disable-next-line @atlaskit/design-system/prefer-primitives
128
- jsx("div", {
129
- css: [mainToolbarWrapperStyleNew, props.twoLineEditorToolbar && mainToolbarTwoLineStylesNew, mainToolbarWrapperStylesVisualRefresh, props.isNewToolbarEnabled && mainToolbarWithoutLeftPadding, !expValEquals('platform_editor_comment_editor_border_radius', 'isEnabled', true) && fg('platform_editor_comments_border_radius') && mainToolbarWithRadiusStyle, expValEquals('platform_editor_comment_editor_border_radius', 'isEnabled', true) && mainToolbarRadius, props.isEditorModernisationEnabled && editorModernisationToolbarStyle],
130
- "data-testid": "ak-editor-main-toolbar"
131
- }, props.children)
132
- );
133
- };
6
+ import { FixedToolbarCompiled } from './FixedToolbar-compiled';
7
+ import { FixedToolbarEmotion } from './FixedToolbar-emotion';
8
+ import { StickyToolbarCompiled } from './StickyToolbar-compiled';
9
+ import { StickyToolbarEmotion } from './StickyToolbar-emotion';
10
+ var StickyToolbarMigration = componentWithCondition(function () {
11
+ return expValEquals('platform_editor_core_non_ecc_static_css', 'isEnabled', true);
12
+ }, StickyToolbarCompiled, StickyToolbarEmotion);
13
+ var FixedToolbarMigration = componentWithCondition(function () {
14
+ return expValEquals('platform_editor_core_non_ecc_static_css', 'isEnabled', true);
15
+ }, FixedToolbarCompiled, FixedToolbarEmotion);
134
16
 
135
17
  /**
136
18
  * ED-15802: Scenarios when a sticky bar is used:
@@ -166,7 +48,7 @@ export var MainToolbar = function MainToolbar(_ref) {
166
48
  isEditorModernisationEnabled = _ref.isEditorModernisationEnabled,
167
49
  isNewToolbarEnabled = _ref.isNewToolbarEnabled;
168
50
  if (useStickyToolbar) {
169
- return jsx(StickyToolbar
51
+ return /*#__PURE__*/React.createElement(StickyToolbarMigration
170
52
  // Ignored via go/ees005
171
53
  // eslint-disable-next-line react/jsx-props-no-spreading
172
54
  , _extends({}, getStickyParameters(useStickyToolbar), {
@@ -175,7 +57,7 @@ export var MainToolbar = function MainToolbar(_ref) {
175
57
  isNewToolbarEnabled: isNewToolbarEnabled
176
58
  }), children);
177
59
  }
178
- return jsx(FixedToolbar, {
60
+ return /*#__PURE__*/React.createElement(FixedToolbarMigration, {
179
61
  isEditorModernisationEnabled: isEditorModernisationEnabled,
180
62
  twoLineEditorToolbar: twoLineEditorToolbar,
181
63
  isNewToolbarEnabled: isNewToolbarEnabled
@@ -0,0 +1,2 @@
1
+ ._1e0c1txw{display:flex}
2
+ @media (max-width:0px){._1hm21yb4{justify-content:space-between}}
@@ -0,0 +1,21 @@
1
+ /* ToolbarComponentsWrapper-compiled.tsx generated by @compiled/babel-plugin v0.39.1 */
2
+ /**
3
+ * Compiled branch of the `platform_editor_core_non_ecc_static_css` experiment.
4
+ * Used via `componentWithCondition` in `ToolbarInner.tsx`.
5
+ *
6
+ * Cleanup: delete this file once the experiment has shipped.
7
+ */
8
+ import "./ToolbarComponentsWrapper-compiled.compiled.css";
9
+ import * as React from 'react';
10
+ import { ax, ix } from "@compiled/react/runtime";
11
+ var toolbarComponentsWrapperCompiledStyles = {
12
+ root: "_1e0c1txw _1hm21yb4"
13
+ };
14
+ export var ToolbarComponentsWrapperCompiled = function ToolbarComponentsWrapperCompiled(_ref) {
15
+ var children = _ref.children,
16
+ dataVc = _ref['data-vc'];
17
+ return /*#__PURE__*/React.createElement("div", {
18
+ "data-vc": dataVc,
19
+ className: ax([toolbarComponentsWrapperCompiledStyles.root])
20
+ }, children);
21
+ };
@@ -0,0 +1,28 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ /**
3
+ * @jsxRuntime classic
4
+ * @jsx jsx
5
+ */
6
+ /**
7
+ * Emotion fallback branch of the `platform_editor_core_non_ecc_static_css` experiment.
8
+ * Used via `componentWithCondition` in `ToolbarInner.tsx`.
9
+ *
10
+ * Cleanup: delete this file once the experiment has shipped.
11
+ */
12
+
13
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports -- intentional: emotion fallback for compiled migration
14
+ import { css, jsx } from '@emotion/react';
15
+ import { akEditorMobileMaxWidth } from '@atlaskit/editor-shared-styles';
16
+ var toolbarComponentsWrapperEmotionStyles = css(_defineProperty({
17
+ display: 'flex'
18
+ }, "@media (max-width: ".concat(akEditorMobileMaxWidth, "px)"), {
19
+ justifyContent: 'space-between'
20
+ }));
21
+ export var ToolbarComponentsWrapperEmotion = function ToolbarComponentsWrapperEmotion(_ref) {
22
+ var children = _ref.children,
23
+ dataVc = _ref['data-vc'];
24
+ return jsx("div", {
25
+ css: toolbarComponentsWrapperEmotionStyles,
26
+ "data-vc": dataVc
27
+ }, children);
28
+ };
@@ -3,25 +3,18 @@ import _createClass from "@babel/runtime/helpers/createClass";
3
3
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
4
4
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
5
5
  import _inherits from "@babel/runtime/helpers/inherits";
6
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
7
6
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
8
7
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
9
- /**
10
- * @jsxRuntime classic
11
- * @jsx jsx
12
- */
13
8
  import React from 'react';
14
-
15
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports -- Ignored via go/DSP-18766; jsx required at runtime for @jsxRuntime classic
16
- import { css, jsx } from '@emotion/react';
17
9
  import isEqual from 'lodash/isEqual';
18
10
  import { isSSR } from '@atlaskit/editor-common/core-utils';
19
- import { akEditorMobileMaxWidth } from '@atlaskit/editor-shared-styles';
20
- var toolbarComponentsWrapper = css(_defineProperty({
21
- display: 'flex'
22
- }, "@media (max-width: ".concat(akEditorMobileMaxWidth, "px)"), {
23
- justifyContent: 'space-between'
24
- }));
11
+ import { componentWithCondition } from '@atlaskit/platform-feature-flags-react';
12
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
13
+ import { ToolbarComponentsWrapperCompiled } from './ToolbarComponentsWrapper-compiled';
14
+ import { ToolbarComponentsWrapperEmotion } from './ToolbarComponentsWrapper-emotion';
15
+ var ToolbarComponentsWrapperMigration = componentWithCondition(function () {
16
+ return expValEquals('platform_editor_core_non_ecc_static_css', 'isEnabled', true);
17
+ }, ToolbarComponentsWrapperCompiled, ToolbarComponentsWrapperEmotion);
25
18
 
26
19
  // Ignored via go/ees005
27
20
  // eslint-disable-next-line @repo/internal/react/no-class-components
@@ -62,8 +55,7 @@ export var ToolbarInner = /*#__PURE__*/function (_React$Component) {
62
55
  // Hiding toolbar in SSR until the dependency of screen width is resolved in SSR environment.
63
56
  return null;
64
57
  }
65
- return jsx("div", {
66
- css: toolbarComponentsWrapper,
58
+ return /*#__PURE__*/React.createElement(ToolbarComponentsWrapperMigration, {
67
59
  "data-vc": "toolbar-inner"
68
60
  }, items.map(function (component, key) {
69
61
  var element = component({
@@ -0,0 +1,2 @@
1
+ ._1bsb1osq{width:100%}
2
+ ._kqswh2mm{position:relative}
@@ -0,0 +1,21 @@
1
+ /* ToolbarSizeDetectorWrapper-compiled.tsx generated by @compiled/babel-plugin v0.39.1 */
2
+ /**
3
+ * Compiled branch of the `platform_editor_core_non_ecc_static_css` experiment.
4
+ * Used via `componentWithCondition` in `ToolbarWithSizeDetector.tsx`.
5
+ *
6
+ * Cleanup: delete this file once the experiment has shipped.
7
+ */
8
+ import "./ToolbarSizeDetectorWrapper-compiled.compiled.css";
9
+ import * as React from 'react';
10
+ import { ax, ix } from "@compiled/react/runtime";
11
+ var toolbarSizeDetectorWrapperCompiledStyles = {
12
+ root: "_1bsb1osq _kqswh2mm"
13
+ };
14
+ export var ToolbarSizeDetectorWrapperCompiled = function ToolbarSizeDetectorWrapperCompiled(_ref) {
15
+ var children = _ref.children,
16
+ style = _ref.style;
17
+ return /*#__PURE__*/React.createElement("div", {
18
+ style: style,
19
+ className: ax([toolbarSizeDetectorWrapperCompiledStyles.root])
20
+ }, children);
21
+ };
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ /**
6
+ * Emotion fallback branch of the `platform_editor_core_non_ecc_static_css` experiment.
7
+ * Used via `componentWithCondition` in `ToolbarWithSizeDetector.tsx`.
8
+ *
9
+ * Cleanup: delete this file once the experiment has shipped.
10
+ */
11
+
12
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports -- intentional: emotion fallback for compiled migration
13
+ import { css, jsx } from '@emotion/react';
14
+ var toolbarSizeDetectorWrapperEmotionStyles = css({
15
+ width: '100%',
16
+ position: 'relative'
17
+ });
18
+ export var ToolbarSizeDetectorWrapperEmotion = function ToolbarSizeDetectorWrapperEmotion(_ref) {
19
+ var children = _ref.children,
20
+ style = _ref.style;
21
+ return jsx("div", {
22
+ css: toolbarSizeDetectorWrapperEmotionStyles,
23
+ style: style
24
+ }, children);
25
+ };
@@ -1,24 +1,20 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
- /**
3
- * @jsxRuntime classic
4
- * @jsx jsx
5
- */
6
2
  import React, { useMemo } from 'react';
7
-
8
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports -- Ignored via go/DSP-18766; jsx required at runtime for @jsxRuntime classic
9
- import { css, jsx } from '@emotion/react';
10
3
  import { isSSR } from '@atlaskit/editor-common/core-utils';
11
4
  import { ToolbarSize } from '@atlaskit/editor-common/types';
5
+ import { componentWithCondition } from '@atlaskit/platform-feature-flags-react';
6
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
12
7
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
13
8
  import { WidthObserver } from '@atlaskit/width-detector';
14
9
  import { isFullPage } from '../../utils/is-full-page';
15
10
  import { useElementWidth } from './hooks';
16
11
  import { Toolbar } from './Toolbar';
17
12
  import { toolbarSizeToWidth, widthToToolbarSize } from './toolbar-size';
18
- var toolbar = css({
19
- width: '100%',
20
- position: 'relative'
21
- });
13
+ import { ToolbarSizeDetectorWrapperCompiled } from './ToolbarSizeDetectorWrapper-compiled';
14
+ import { ToolbarSizeDetectorWrapperEmotion } from './ToolbarSizeDetectorWrapper-emotion';
15
+ var ToolbarSizeDetectorWrapperMigration = componentWithCondition(function () {
16
+ return expValEquals('platform_editor_core_non_ecc_static_css', 'isEnabled', true);
17
+ }, ToolbarSizeDetectorWrapperCompiled, ToolbarSizeDetectorWrapperEmotion);
22
18
  export var ToolbarWithSizeDetector = function ToolbarWithSizeDetector(props) {
23
19
  var ref = React.useRef(null);
24
20
  var _React$useState = React.useState(undefined),
@@ -44,14 +40,21 @@ export var ToolbarWithSizeDetector = function ToolbarWithSizeDetector(props) {
44
40
  return isPreviewPanelResponsivenessEnabled ? 'fit-content' : '254px';
45
41
  }
46
42
  }, [props.appearance, props.hasMinWidth, props.twoLineEditorToolbar]);
47
- return jsx("div", {
48
- css: toolbar,
49
- style: {
43
+ var memoizedWrapperStyle = useMemo(function () {
44
+ return {
50
45
  minWidth: minWidthValue
51
- }
52
- }, jsx(WidthObserver, {
46
+ };
47
+ }, [minWidthValue]);
48
+ var wrapperStyle = expValEquals('platform_editor_core_non_ecc_static_css', 'isEnabled', true) ? memoizedWrapperStyle : {
49
+ minWidth: minWidthValue
50
+ };
51
+ return /*#__PURE__*/React.createElement(ToolbarSizeDetectorWrapperMigration
52
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- minWidth is computed dynamically from props.hasMinWidth, props.appearance, props.twoLineEditorToolbar, and the platform_editor_preview_panel_responsiveness experiment, so it cannot be expressed as a static css value.
53
+ , {
54
+ style: wrapperStyle
55
+ }, /*#__PURE__*/React.createElement(WidthObserver, {
53
56
  setWidth: setWidth
54
- }), props.editorView && toolbarSize ? jsx(Toolbar, {
57
+ }), props.editorView && toolbarSize ? /*#__PURE__*/React.createElement(Toolbar, {
55
58
  toolbarSize: toolbarSize,
56
59
  items: props.items,
57
60
  editorView: props.editorView,
@@ -67,7 +70,7 @@ export var ToolbarWithSizeDetector = function ToolbarWithSizeDetector(props) {
67
70
  containerElement: props.containerElement,
68
71
  hasMinWidth: props.hasMinWidth,
69
72
  twoLineEditorToolbar: props.twoLineEditorToolbar
70
- }) : jsx("div", {
73
+ }) : /*#__PURE__*/React.createElement("div", {
71
74
  ref: ref
72
75
  }));
73
76
  };
@@ -1,3 +1,3 @@
1
1
  export var name = "@atlaskit/editor-core";
2
2
  // eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
3
- export var version = "221.1.3";
3
+ export var version = "221.2.0";
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ /**
6
+ * Compiled branch of the `platform_editor_core_non_ecc_static_css` experiment.
7
+ * Used via `componentWithCondition` in `Toolbar.tsx`.
8
+ *
9
+ * Cleanup: delete this file once the experiment has shipped.
10
+ */
11
+ import type { ReactNode } from 'react';
12
+ import React from 'react';
13
+ type FixedToolbarCompiledProps = {
14
+ children?: ReactNode;
15
+ isEditorModernisationEnabled?: boolean;
16
+ isNewToolbarEnabled?: boolean;
17
+ twoLineEditorToolbar?: boolean;
18
+ };
19
+ export declare const FixedToolbarCompiled: (props: FixedToolbarCompiledProps) => React.JSX.Element;
20
+ export {};
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ /**
6
+ * Emotion fallback branch of the `platform_editor_core_non_ecc_static_css` experiment.
7
+ * Used via `componentWithCondition` in `Toolbar.tsx`.
8
+ *
9
+ * Cleanup: delete this file once the experiment has shipped.
10
+ */
11
+ import type { ReactNode } from 'react';
12
+ type FixedToolbarEmotionProps = {
13
+ children?: ReactNode;
14
+ isEditorModernisationEnabled?: boolean;
15
+ isNewToolbarEnabled?: boolean;
16
+ twoLineEditorToolbar?: boolean;
17
+ };
18
+ export declare const FixedToolbarEmotion: (props: FixedToolbarEmotionProps) => JSX.Element;
19
+ export {};
@@ -0,0 +1,22 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ /**
6
+ * Compiled branch of the `platform_editor_core_non_ecc_static_css` experiment.
7
+ * Used via `componentWithCondition` in `Toolbar.tsx`.
8
+ *
9
+ * Cleanup: delete this file once the experiment has shipped.
10
+ */
11
+ import type { ReactNode, RefObject } from 'react';
12
+ import React from 'react';
13
+ type StickyToolbarCompiledProps = {
14
+ children?: ReactNode;
15
+ externalToolbarRef?: RefObject<HTMLElement>;
16
+ isEditorModernisationEnabled?: boolean;
17
+ isNewToolbarEnabled?: boolean;
18
+ offsetTop?: number;
19
+ twoLineEditorToolbar?: boolean;
20
+ };
21
+ export declare const StickyToolbarCompiled: (props: StickyToolbarCompiledProps) => React.JSX.Element;
22
+ export {};
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ /**
6
+ * Emotion fallback branch of the `platform_editor_core_non_ecc_static_css` experiment.
7
+ * Used via `componentWithCondition` in `Toolbar.tsx`.
8
+ *
9
+ * Cleanup: delete this file once the experiment has shipped.
10
+ */
11
+ import type { ReactNode, RefObject } from 'react';
12
+ type StickyToolbarEmotionProps = {
13
+ children?: ReactNode;
14
+ externalToolbarRef?: RefObject<HTMLElement>;
15
+ isEditorModernisationEnabled?: boolean;
16
+ isNewToolbarEnabled?: boolean;
17
+ offsetTop?: number;
18
+ twoLineEditorToolbar?: boolean;
19
+ };
20
+ export declare const StickyToolbarEmotion: (props: StickyToolbarEmotionProps) => JSX.Element;
21
+ export {};
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import { jsx } from '@emotion/react';
3
2
  import type { UseStickyToolbarType } from '@atlaskit/editor-common/ui';
4
3
  type MainToolbarProps = {
5
4
  children?: React.ReactNode;
@@ -8,5 +7,5 @@ type MainToolbarProps = {
8
7
  twoLineEditorToolbar?: boolean;
9
8
  useStickyToolbar?: UseStickyToolbarType;
10
9
  };
11
- export declare const MainToolbar: ({ useStickyToolbar, twoLineEditorToolbar, children, isEditorModernisationEnabled, isNewToolbarEnabled, }: MainToolbarProps) => jsx.JSX.Element;
10
+ export declare const MainToolbar: ({ useStickyToolbar, twoLineEditorToolbar, children, isEditorModernisationEnabled, isNewToolbarEnabled, }: MainToolbarProps) => React.JSX.Element;
12
11
  export {};
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ /**
6
+ * Compiled branch of the `platform_editor_core_non_ecc_static_css` experiment.
7
+ * Used via `componentWithCondition` in `ToolbarInner.tsx`.
8
+ *
9
+ * Cleanup: delete this file once the experiment has shipped.
10
+ */
11
+ import type { ReactNode } from 'react';
12
+ interface ToolbarComponentsWrapperCompiledProps {
13
+ children?: ReactNode;
14
+ 'data-vc'?: string;
15
+ }
16
+ export declare const ToolbarComponentsWrapperCompiled: ({ children, "data-vc": dataVc, }: ToolbarComponentsWrapperCompiledProps) => JSX.Element;
17
+ export {};