@atlaskit/editor-core 221.2.0 → 221.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/afm-cc/tsconfig.json +3 -0
  3. package/afm-products/tsconfig.json +3 -0
  4. package/dist/cjs/ui/Appearance/Comment/FixedToolbar-compiled.compiled.css +20 -0
  5. package/dist/cjs/ui/Appearance/Comment/FixedToolbar-compiled.js +35 -0
  6. package/dist/cjs/ui/Appearance/Comment/FixedToolbar-emotion.js +94 -0
  7. package/dist/cjs/ui/Appearance/Comment/StickyToolbar-compiled.compiled.css +25 -0
  8. package/dist/cjs/ui/Appearance/Comment/StickyToolbar-compiled.js +66 -0
  9. package/dist/cjs/ui/Appearance/Comment/StickyToolbar-emotion.js +131 -0
  10. package/dist/cjs/ui/Appearance/Comment/Toolbar.js +14 -134
  11. package/dist/cjs/ui/Appearance/FullPage/FullPageContentArea.js +50 -3
  12. package/dist/cjs/ui/Toolbar/ToolbarComponentsWrapper-compiled.compiled.css +2 -0
  13. package/dist/cjs/ui/Toolbar/ToolbarComponentsWrapper-compiled.js +29 -0
  14. package/dist/cjs/ui/Toolbar/ToolbarComponentsWrapper-emotion.js +36 -0
  15. package/dist/cjs/ui/Toolbar/ToolbarInner.js +9 -14
  16. package/dist/cjs/ui/Toolbar/ToolbarSizeDetectorWrapper-compiled.compiled.css +2 -0
  17. package/dist/cjs/ui/Toolbar/ToolbarSizeDetectorWrapper-compiled.js +29 -0
  18. package/dist/cjs/ui/Toolbar/ToolbarSizeDetectorWrapper-emotion.js +32 -0
  19. package/dist/cjs/ui/Toolbar/ToolbarWithSizeDetector.js +21 -19
  20. package/dist/cjs/version-wrapper.js +1 -1
  21. package/dist/es2019/ui/Appearance/Comment/FixedToolbar-compiled.compiled.css +20 -0
  22. package/dist/es2019/ui/Appearance/Comment/FixedToolbar-compiled.js +26 -0
  23. package/dist/es2019/ui/Appearance/Comment/FixedToolbar-emotion.js +91 -0
  24. package/dist/es2019/ui/Appearance/Comment/StickyToolbar-compiled.compiled.css +25 -0
  25. package/dist/es2019/ui/Appearance/Comment/StickyToolbar-compiled.js +51 -0
  26. package/dist/es2019/ui/Appearance/Comment/StickyToolbar-emotion.js +128 -0
  27. package/dist/es2019/ui/Appearance/Comment/Toolbar.js +10 -133
  28. package/dist/es2019/ui/Appearance/FullPage/FullPageContentArea.js +50 -3
  29. package/dist/es2019/ui/Toolbar/ToolbarComponentsWrapper-compiled.compiled.css +2 -0
  30. package/dist/es2019/ui/Toolbar/ToolbarComponentsWrapper-compiled.js +20 -0
  31. package/dist/es2019/ui/Toolbar/ToolbarComponentsWrapper-emotion.js +28 -0
  32. package/dist/es2019/ui/Toolbar/ToolbarInner.js +6 -17
  33. package/dist/es2019/ui/Toolbar/ToolbarSizeDetectorWrapper-compiled.compiled.css +2 -0
  34. package/dist/es2019/ui/Toolbar/ToolbarSizeDetectorWrapper-compiled.js +20 -0
  35. package/dist/es2019/ui/Toolbar/ToolbarSizeDetectorWrapper-emotion.js +24 -0
  36. package/dist/es2019/ui/Toolbar/ToolbarWithSizeDetector.js +18 -19
  37. package/dist/es2019/version-wrapper.js +1 -1
  38. package/dist/esm/ui/Appearance/Comment/FixedToolbar-compiled.compiled.css +20 -0
  39. package/dist/esm/ui/Appearance/Comment/FixedToolbar-compiled.js +28 -0
  40. package/dist/esm/ui/Appearance/Comment/FixedToolbar-emotion.js +86 -0
  41. package/dist/esm/ui/Appearance/Comment/StickyToolbar-compiled.compiled.css +25 -0
  42. package/dist/esm/ui/Appearance/Comment/StickyToolbar-compiled.js +58 -0
  43. package/dist/esm/ui/Appearance/Comment/StickyToolbar-emotion.js +124 -0
  44. package/dist/esm/ui/Appearance/Comment/Toolbar.js +14 -132
  45. package/dist/esm/ui/Appearance/FullPage/FullPageContentArea.js +50 -3
  46. package/dist/esm/ui/Toolbar/ToolbarComponentsWrapper-compiled.compiled.css +2 -0
  47. package/dist/esm/ui/Toolbar/ToolbarComponentsWrapper-compiled.js +21 -0
  48. package/dist/esm/ui/Toolbar/ToolbarComponentsWrapper-emotion.js +28 -0
  49. package/dist/esm/ui/Toolbar/ToolbarInner.js +8 -16
  50. package/dist/esm/ui/Toolbar/ToolbarSizeDetectorWrapper-compiled.compiled.css +2 -0
  51. package/dist/esm/ui/Toolbar/ToolbarSizeDetectorWrapper-compiled.js +21 -0
  52. package/dist/esm/ui/Toolbar/ToolbarSizeDetectorWrapper-emotion.js +25 -0
  53. package/dist/esm/ui/Toolbar/ToolbarWithSizeDetector.js +21 -18
  54. package/dist/esm/version-wrapper.js +1 -1
  55. package/dist/types/ui/Appearance/Comment/FixedToolbar-compiled.d.ts +20 -0
  56. package/dist/types/ui/Appearance/Comment/FixedToolbar-emotion.d.ts +19 -0
  57. package/dist/types/ui/Appearance/Comment/StickyToolbar-compiled.d.ts +22 -0
  58. package/dist/types/ui/Appearance/Comment/StickyToolbar-emotion.d.ts +21 -0
  59. package/dist/types/ui/Appearance/Comment/Toolbar.d.ts +1 -2
  60. package/dist/types/ui/Toolbar/ToolbarComponentsWrapper-compiled.d.ts +17 -0
  61. package/dist/types/ui/Toolbar/ToolbarComponentsWrapper-emotion.d.ts +17 -0
  62. package/dist/types/ui/Toolbar/ToolbarInner.d.ts +1 -6
  63. package/dist/types/ui/Toolbar/ToolbarSizeDetectorWrapper-compiled.d.ts +17 -0
  64. package/dist/types/ui/Toolbar/ToolbarSizeDetectorWrapper-emotion.d.ts +17 -0
  65. package/dist/types/ui/Toolbar/ToolbarWithSizeDetector.d.ts +2 -2
  66. package/package.json +10 -10
@@ -72,6 +72,15 @@ var hideEditorContentAreaProsemirrorWithAttributeStyle = (0, _react2.css)({
72
72
  display: 'none'
73
73
  }
74
74
  });
75
+ var hideEditorContentAreaScrollGutterWithAttributeStyle = (0, _react2.css)({
76
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
77
+ '&[data-markdown-mode-hide-scroll-gutter="true"] > .ak-editor-content-area > [data-vc="scroll-gutter"]': {
78
+ display: 'none'
79
+ }
80
+ });
81
+ var hideEditorScrollGutterStyle = (0, _react2.css)({
82
+ display: 'none'
83
+ });
75
84
  var fullWidthNonChromelessBreakoutBlockTableStyle = (0, _react2.css)({
76
85
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-1
77
86
  '.fabric-editor--full-width-mode:not(:has(#chromeless-editor))': {
@@ -228,6 +237,38 @@ var contentAreaHeightNoToolbar = (0, _react2.css)({
228
237
  var markdownModeContainerBackgroundStyle = (0, _react2.css)({
229
238
  backgroundColor: "var(--ds-surface-sunken, #F8F8F8)"
230
239
  });
240
+ var markdownModeContentAreaStyle = (0, _react2.css)({
241
+ boxSizing: 'border-box',
242
+ height: '100%',
243
+ margin: 0,
244
+ maxWidth: 'none',
245
+ minWidth: 0,
246
+ paddingBottom: 0,
247
+ paddingTop: 0,
248
+ width: '100%',
249
+ // The markdown source view is rendered through PluginSlot. Stretch those
250
+ // intermediate wrappers so its in-flow footer can sit at the bottom without
251
+ // overlaying the CodeMirror scrollbar.
252
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
253
+ '> .ak-editor-content-area': {
254
+ boxSizing: 'border-box',
255
+ display: 'flex',
256
+ flexDirection: 'column',
257
+ height: '100%',
258
+ minHeight: 0,
259
+ minWidth: 0,
260
+ padding: 0,
261
+ width: '100%'
262
+ },
263
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
264
+ '> .ak-editor-content-area > [data-testid="plugins-components-wrapper"]': {
265
+ display: 'flex',
266
+ flex: '1 1 auto',
267
+ minHeight: 0,
268
+ minWidth: 0,
269
+ width: '100%'
270
+ }
271
+ });
231
272
  var CONTENT_AREA_TEST_ID = exports.CONTENT_AREA_TEST_ID = 'ak-editor-fp-content-area';
232
273
  // eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
233
274
  var EDITOR_CONTAINER = exports.EDITOR_CONTAINER = 'ak-editor-container';
@@ -266,7 +307,10 @@ var Content = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
266
307
  var _states$markdownModeS2;
267
308
  return (_states$markdownModeS2 = states.markdownModeState) === null || _states$markdownModeS2 === void 0 ? void 0 : _states$markdownModeS2.isMarkdownMode;
268
309
  });
269
- var shouldHideProseMirrorForMarkdownMode = (0, _expValEqualsNoExposure.expValEqualsNoExposure)('cc-markdown-mode', 'isEnabled', true) && markdownPluginCurrentView !== 'preview' && markdownPluginCurrentIsMarkdownMode;
310
+ var isMarkdownModeExperimentEnabled = (0, _expValEqualsNoExposure.expValEqualsNoExposure)('cc-markdown-mode', 'isEnabled', true);
311
+ var shouldHideProseMirrorForMarkdownMode = isMarkdownModeExperimentEnabled && markdownPluginCurrentView !== 'preview' && markdownPluginCurrentIsMarkdownMode;
312
+ var shouldHideScrollGutterForMarkdownMode = isMarkdownModeExperimentEnabled && markdownPluginCurrentIsMarkdownMode;
313
+ var shouldUseMarkdownModeMvpLayout = shouldHideProseMirrorForMarkdownMode && (0, _platformFeatureFlags.fg)('platform_editor_md_mvp_layout');
270
314
  return (0, _react2.jsx)("div", {
271
315
  css: [contentAreaNew, props.isEditorToolbarHidden && contentAreaHeightNoToolbar],
272
316
  "data-testid": CONTENT_AREA_TEST_ID,
@@ -274,7 +318,7 @@ var Content = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
274
318
  }, (0, _react2.jsx)("div", {
275
319
  css: [
276
320
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values
277
- _StyledComponents.contentAreaWrapper, shouldHideProseMirrorForMarkdownMode && (0, _platformFeatureFlags.fg)('platform_editor_md_mvp_layout') && markdownModeContainerBackgroundStyle],
321
+ _StyledComponents.contentAreaWrapper, shouldUseMarkdownModeMvpLayout && markdownModeContainerBackgroundStyle],
278
322
  "data-testid": EDITOR_CONTAINER,
279
323
  "data-editor-container": 'true'
280
324
  }, (0, _react2.jsx)(_EditorContentContainer.default
@@ -293,10 +337,11 @@ var Content = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
293
337
  editorDisabled: props.disabled
294
338
  }, (0, _react2.jsx)("div", {
295
339
  "data-markdown-mode-hide-prosemirror": shouldHideProseMirrorForMarkdownMode ? 'true' : undefined,
340
+ "data-markdown-mode-hide-scroll-gutter": shouldHideScrollGutterForMarkdownMode ? 'true' : undefined,
296
341
  css: [editorContentAreaNew, editorContentAreaProsemirrorStyle,
297
342
  // EDITOR-6558: hide ProseMirror when the markdown-mode plugin
298
343
  // reports a non-WYSIWYG view.
299
- shouldHideProseMirrorForMarkdownMode && hideEditorContentAreaProsemirrorWithAttributeStyle, tableFullPageEditorStylesNew, fullWidthNonChromelessBreakoutBlockTableStyle,
344
+ shouldHideProseMirrorForMarkdownMode && hideEditorContentAreaProsemirrorWithAttributeStyle, shouldHideScrollGutterForMarkdownMode && hideEditorContentAreaScrollGutterWithAttributeStyle, shouldUseMarkdownModeMvpLayout && markdownModeContentAreaStyle, tableFullPageEditorStylesNew, fullWidthNonChromelessBreakoutBlockTableStyle,
300
345
  // for breakout resizing, there's no need to restrict the width of codeblocks as they're always wrapped in a breakout mark
301
346
  (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_breakout_resizing', 'isEnabled', true) ? editorContentAreaContainerStyleExcludeCodeBlockNew : editorContentAreaContainerStyleNew, (0, _platformFeatureFlags.fg)('platform_editor_nested_dnd_styles_changes') && editorContentAreaContainerNestedDndStyle, !(0, _platformFeatureFlags.fg)('platform_editor_controls_no_toolbar_space') && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && contentAreaReducedHeaderSpace, !(0, _platformFeatureFlags.fg)('platform_editor_controls_no_toolbar_space') && props.isEditorToolbarHidden && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && contentAreaReservedPrimaryToolbarSpace],
302
347
  style: {
@@ -341,6 +386,7 @@ var Content = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
341
386
  wrapperElement: props.wrapperElement
342
387
  }), props.editorDOMElement, !!props.customContentComponents && 'after' in props.customContentComponents ? (0, _contentComponentWrapper.contentComponentClickWrapper)(props.customContentComponents.after) : null, allowScrollGutter && ((0, _experiments.editorExperiment)('platform_editor_blocks', true) ? (0, _react2.jsx)("div", {
343
388
  id: "editor-scroll-gutter",
389
+ css: shouldHideScrollGutterForMarkdownMode && hideEditorScrollGutterStyle,
344
390
  style: {
345
391
  paddingBottom: "".concat((_allowScrollGutter$gu = allowScrollGutter.gutterSize) !== null && _allowScrollGutter$gu !== void 0 ? _allowScrollGutter$gu : '120', "px")
346
392
  },
@@ -348,6 +394,7 @@ var Content = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
348
394
  "data-editor-scroll-gutter": "true"
349
395
  }) : (0, _react2.jsx)("div", {
350
396
  id: "editor-scroll-gutter",
397
+ css: shouldHideScrollGutterForMarkdownMode && hideEditorScrollGutterStyle,
351
398
  style: {
352
399
  paddingBottom: "".concat((_allowScrollGutter$gu2 = allowScrollGutter.gutterSize) !== null && _allowScrollGutter$gu2 !== void 0 ? _allowScrollGutter$gu2 : '120', "px")
353
400
  },
@@ -0,0 +1,2 @@
1
+ ._1e0c1txw{display:flex}
2
+ @media (max-width:0px){._1hm21yb4{justify-content:space-between}}
@@ -0,0 +1,29 @@
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
+ "use strict";
9
+
10
+ var _typeof = require("@babel/runtime/helpers/typeof");
11
+ Object.defineProperty(exports, "__esModule", {
12
+ value: true
13
+ });
14
+ exports.ToolbarComponentsWrapperCompiled = void 0;
15
+ require("./ToolbarComponentsWrapper-compiled.compiled.css");
16
+ var React = _interopRequireWildcard(require("react"));
17
+ var _runtime = require("@compiled/react/runtime");
18
+ 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); }
19
+ var toolbarComponentsWrapperCompiledStyles = {
20
+ root: "_1e0c1txw _1hm21yb4"
21
+ };
22
+ var ToolbarComponentsWrapperCompiled = exports.ToolbarComponentsWrapperCompiled = function ToolbarComponentsWrapperCompiled(_ref) {
23
+ var children = _ref.children,
24
+ dataVc = _ref['data-vc'];
25
+ return /*#__PURE__*/React.createElement("div", {
26
+ "data-vc": dataVc,
27
+ className: (0, _runtime.ax)([toolbarComponentsWrapperCompiledStyles.root])
28
+ }, children);
29
+ };
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.ToolbarComponentsWrapperEmotion = void 0;
8
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
+ var _react = require("@emotion/react");
10
+ var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
11
+ /**
12
+ * @jsxRuntime classic
13
+ * @jsx jsx
14
+ */
15
+ /**
16
+ * Emotion fallback branch of the `platform_editor_core_non_ecc_static_css` experiment.
17
+ * Used via `componentWithCondition` in `ToolbarInner.tsx`.
18
+ *
19
+ * Cleanup: delete this file once the experiment has shipped.
20
+ */
21
+
22
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports -- intentional: emotion fallback for compiled migration
23
+
24
+ var toolbarComponentsWrapperEmotionStyles = (0, _react.css)((0, _defineProperty2.default)({
25
+ display: 'flex'
26
+ }, "@media (max-width: ".concat(_editorSharedStyles.akEditorMobileMaxWidth, "px)"), {
27
+ justifyContent: 'space-between'
28
+ }));
29
+ var ToolbarComponentsWrapperEmotion = exports.ToolbarComponentsWrapperEmotion = function ToolbarComponentsWrapperEmotion(_ref) {
30
+ var children = _ref.children,
31
+ dataVc = _ref['data-vc'];
32
+ return (0, _react.jsx)("div", {
33
+ css: toolbarComponentsWrapperEmotionStyles,
34
+ "data-vc": dataVc
35
+ }, children);
36
+ };
@@ -10,22 +10,18 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
10
10
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
11
11
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
12
12
  var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
13
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
14
13
  var _react = _interopRequireDefault(require("react"));
15
- var _react2 = require("@emotion/react");
16
14
  var _isEqual = _interopRequireDefault(require("lodash/isEqual"));
17
15
  var _coreUtils = require("@atlaskit/editor-common/core-utils");
18
- var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
16
+ var _platformFeatureFlagsReact = require("@atlaskit/platform-feature-flags-react");
17
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
18
+ var _ToolbarComponentsWrapperCompiled = require("./ToolbarComponentsWrapper-compiled");
19
+ var _ToolbarComponentsWrapperEmotion = require("./ToolbarComponentsWrapper-emotion");
19
20
  function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
20
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /**
21
- * @jsxRuntime classic
22
- * @jsx jsx
23
- */ // 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
24
- var toolbarComponentsWrapper = (0, _react2.css)((0, _defineProperty2.default)({
25
- display: 'flex'
26
- }, "@media (max-width: ".concat(_editorSharedStyles.akEditorMobileMaxWidth, "px)"), {
27
- justifyContent: 'space-between'
28
- }));
21
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
22
+ var ToolbarComponentsWrapperMigration = (0, _platformFeatureFlagsReact.componentWithCondition)(function () {
23
+ return (0, _expValEquals.expValEquals)('platform_editor_core_non_ecc_static_css', 'isEnabled', true);
24
+ }, _ToolbarComponentsWrapperCompiled.ToolbarComponentsWrapperCompiled, _ToolbarComponentsWrapperEmotion.ToolbarComponentsWrapperEmotion);
29
25
 
30
26
  // Ignored via go/ees005
31
27
  // eslint-disable-next-line @repo/internal/react/no-class-components
@@ -66,8 +62,7 @@ var ToolbarInner = exports.ToolbarInner = /*#__PURE__*/function (_React$Componen
66
62
  // Hiding toolbar in SSR until the dependency of screen width is resolved in SSR environment.
67
63
  return null;
68
64
  }
69
- return (0, _react2.jsx)("div", {
70
- css: toolbarComponentsWrapper,
65
+ return /*#__PURE__*/_react.default.createElement(ToolbarComponentsWrapperMigration, {
71
66
  "data-vc": "toolbar-inner"
72
67
  }, items.map(function (component, key) {
73
68
  var element = component({
@@ -0,0 +1,2 @@
1
+ ._1bsb1osq{width:100%}
2
+ ._kqswh2mm{position:relative}
@@ -0,0 +1,29 @@
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
+ "use strict";
9
+
10
+ var _typeof = require("@babel/runtime/helpers/typeof");
11
+ Object.defineProperty(exports, "__esModule", {
12
+ value: true
13
+ });
14
+ exports.ToolbarSizeDetectorWrapperCompiled = void 0;
15
+ require("./ToolbarSizeDetectorWrapper-compiled.compiled.css");
16
+ var React = _interopRequireWildcard(require("react"));
17
+ var _runtime = require("@compiled/react/runtime");
18
+ 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); }
19
+ var toolbarSizeDetectorWrapperCompiledStyles = {
20
+ root: "_1bsb1osq _kqswh2mm"
21
+ };
22
+ var ToolbarSizeDetectorWrapperCompiled = exports.ToolbarSizeDetectorWrapperCompiled = function ToolbarSizeDetectorWrapperCompiled(_ref) {
23
+ var children = _ref.children,
24
+ style = _ref.style;
25
+ return /*#__PURE__*/React.createElement("div", {
26
+ style: style,
27
+ className: (0, _runtime.ax)([toolbarSizeDetectorWrapperCompiledStyles.root])
28
+ }, children);
29
+ };
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ToolbarSizeDetectorWrapperEmotion = void 0;
7
+ var _react = require("@emotion/react");
8
+ /**
9
+ * @jsxRuntime classic
10
+ * @jsx jsx
11
+ */
12
+ /**
13
+ * Emotion fallback branch of the `platform_editor_core_non_ecc_static_css` experiment.
14
+ * Used via `componentWithCondition` in `ToolbarWithSizeDetector.tsx`.
15
+ *
16
+ * Cleanup: delete this file once the experiment has shipped.
17
+ */
18
+
19
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports -- intentional: emotion fallback for compiled migration
20
+
21
+ var toolbarSizeDetectorWrapperEmotionStyles = (0, _react.css)({
22
+ width: '100%',
23
+ position: 'relative'
24
+ });
25
+ var ToolbarSizeDetectorWrapperEmotion = exports.ToolbarSizeDetectorWrapperEmotion = function ToolbarSizeDetectorWrapperEmotion(_ref) {
26
+ var children = _ref.children,
27
+ style = _ref.style;
28
+ return (0, _react.jsx)("div", {
29
+ css: toolbarSizeDetectorWrapperEmotionStyles,
30
+ style: style
31
+ }, children);
32
+ };
@@ -8,27 +8,22 @@ Object.defineProperty(exports, "__esModule", {
8
8
  exports.ToolbarWithSizeDetector = void 0;
9
9
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
10
  var _react = _interopRequireWildcard(require("react"));
11
- var _react2 = require("@emotion/react");
12
11
  var _coreUtils = require("@atlaskit/editor-common/core-utils");
13
12
  var _types = require("@atlaskit/editor-common/types");
13
+ var _platformFeatureFlagsReact = require("@atlaskit/platform-feature-flags-react");
14
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
14
15
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
15
16
  var _widthDetector = require("@atlaskit/width-detector");
16
17
  var _isFullPage = require("../../utils/is-full-page");
17
18
  var _hooks = require("./hooks");
18
19
  var _Toolbar = require("./Toolbar");
19
20
  var _toolbarSize = require("./toolbar-size");
21
+ var _ToolbarSizeDetectorWrapperCompiled = require("./ToolbarSizeDetectorWrapper-compiled");
22
+ var _ToolbarSizeDetectorWrapperEmotion = require("./ToolbarSizeDetectorWrapper-emotion");
20
23
  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); }
21
- /**
22
- * @jsxRuntime classic
23
- * @jsx jsx
24
- */
25
-
26
- // 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
27
-
28
- var toolbar = (0, _react2.css)({
29
- width: '100%',
30
- position: 'relative'
31
- });
24
+ var ToolbarSizeDetectorWrapperMigration = (0, _platformFeatureFlagsReact.componentWithCondition)(function () {
25
+ return (0, _expValEquals.expValEquals)('platform_editor_core_non_ecc_static_css', 'isEnabled', true);
26
+ }, _ToolbarSizeDetectorWrapperCompiled.ToolbarSizeDetectorWrapperCompiled, _ToolbarSizeDetectorWrapperEmotion.ToolbarSizeDetectorWrapperEmotion);
32
27
  var ToolbarWithSizeDetector = exports.ToolbarWithSizeDetector = function ToolbarWithSizeDetector(props) {
33
28
  var ref = _react.default.useRef(null);
34
29
  var _React$useState = _react.default.useState(undefined),
@@ -54,14 +49,21 @@ var ToolbarWithSizeDetector = exports.ToolbarWithSizeDetector = function Toolbar
54
49
  return isPreviewPanelResponsivenessEnabled ? 'fit-content' : '254px';
55
50
  }
56
51
  }, [props.appearance, props.hasMinWidth, props.twoLineEditorToolbar]);
57
- return (0, _react2.jsx)("div", {
58
- css: toolbar,
59
- style: {
52
+ var memoizedWrapperStyle = (0, _react.useMemo)(function () {
53
+ return {
60
54
  minWidth: minWidthValue
61
- }
62
- }, (0, _react2.jsx)(_widthDetector.WidthObserver, {
55
+ };
56
+ }, [minWidthValue]);
57
+ var wrapperStyle = (0, _expValEquals.expValEquals)('platform_editor_core_non_ecc_static_css', 'isEnabled', true) ? memoizedWrapperStyle : {
58
+ minWidth: minWidthValue
59
+ };
60
+ return /*#__PURE__*/_react.default.createElement(ToolbarSizeDetectorWrapperMigration
61
+ // 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.
62
+ , {
63
+ style: wrapperStyle
64
+ }, /*#__PURE__*/_react.default.createElement(_widthDetector.WidthObserver, {
63
65
  setWidth: setWidth
64
- }), props.editorView && toolbarSize ? (0, _react2.jsx)(_Toolbar.Toolbar, {
66
+ }), props.editorView && toolbarSize ? /*#__PURE__*/_react.default.createElement(_Toolbar.Toolbar, {
65
67
  toolbarSize: toolbarSize,
66
68
  items: props.items,
67
69
  editorView: props.editorView,
@@ -77,7 +79,7 @@ var ToolbarWithSizeDetector = exports.ToolbarWithSizeDetector = function Toolbar
77
79
  containerElement: props.containerElement,
78
80
  hasMinWidth: props.hasMinWidth,
79
81
  twoLineEditorToolbar: props.twoLineEditorToolbar
80
- }) : (0, _react2.jsx)("div", {
82
+ }) : /*#__PURE__*/_react.default.createElement("div", {
81
83
  ref: ref
82
84
  }));
83
85
  };
@@ -6,4 +6,4 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.version = exports.name = void 0;
7
7
  var name = exports.name = "@atlaskit/editor-core";
8
8
  // eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
9
- var version = exports.version = "221.1.3";
9
+ var version = exports.version = "221.2.1";
@@ -0,0 +1,20 @@
1
+
2
+ ._2rko12c2{border-radius:var(--ds-radius-medium,6px) var(--ds-radius-medium,6px) 0 0}
3
+ ._2rko15b0{border-radius:var(--ds-radius-xlarge,9pt) var(--ds-radius-xlarge,9pt) 0 0}
4
+ ._2rko1cku{border-radius:var(--ds-radius-small,3px) var(--ds-radius-small,3px) 0 0}._10ytglyw.show-keyline{box-shadow:none}
5
+ ._16qsglyw{box-shadow:none}
6
+ ._19bvu2gc{padding-left:var(--ds-space-100,8px)}
7
+ ._19bvv47k{padding-left:var(--ds-space-250,20px)}
8
+ ._1cuzidpf .block-type-btn{padding-left:0}
9
+ ._1e0c1txw{display:flex}
10
+ ._1khpidpf >div>div:first-of-type:not(style){margin-left:0}
11
+ ._3pwj1osq span svg{max-width:100%}
12
+ ._4cvr1h6o{align-items:center}
13
+ ._4t3i1wug{height:auto}
14
+ ._bfhkvuon{background-color:var(--ds-surface,#fff)}
15
+ ._ca0qu2gc{padding-top:var(--ds-space-100,8px)}
16
+ ._kqswh2mm{position:relative}
17
+ ._lg5oidpf >div>style:first-of-type+*{margin-left:0}
18
+ ._n3tdidpf{padding-bottom:0}
19
+ ._u5f3u2gc{padding-right:var(--ds-space-100,8px)}
20
+ @media (max-width:490px){._1q27esu3>div>div:first-of-type>div:nth-of-type(2){justify-content:flex-end}._16ec1txw>div>div:first-of-type>div:nth-of-type(2){display:flex}._1uq61sxn>div{flex-direction:column-reverse}._cnpmh9n0>div{align-items:end}._1djy1txw>div{display:flex}._17mgesu3>div{justify-content:flex-end}}
@@ -0,0 +1,26 @@
1
+ /* FixedToolbar-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 `Toolbar.tsx`.
5
+ *
6
+ * Cleanup: delete this file once the experiment has shipped.
7
+ */
8
+ import "./FixedToolbar-compiled.compiled.css";
9
+ import { ax, ix } from "@compiled/react/runtime";
10
+ import React from 'react';
11
+ import { fg } from '@atlaskit/platform-feature-flags';
12
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
13
+ const MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT = 490;
14
+ const fixedToolbarCompiledStyles = {
15
+ mainToolbarWrapper: "_kqswh2mm _4cvr1h6o _ca0qu2gc _u5f3u2gc _n3tdidpf _19bvv47k _1e0c1txw _4t3i1wug _bfhkvuon _16qsglyw _1khpidpf _lg5oidpf _1cuzidpf",
16
+ mainToolbarWithoutLeftPadding: "_ca0qu2gc _u5f3u2gc _n3tdidpf _19bvu2gc",
17
+ mainToolbarTwoLine: "_1uq61sxn _cnpmh9n0 _1djy1txw _17mgesu3 _1q27esu3 _16ec1txw",
18
+ mainToolbarWrapperVisualRefresh: "_3pwj1osq",
19
+ mainToolbarWithRadius: "_2rko1cku",
20
+ mainToolbarRadius: "_2rko12c2",
21
+ editorModernisationToolbar: "_2rko15b0 _10ytglyw"
22
+ };
23
+ export const FixedToolbarCompiled = props => /*#__PURE__*/React.createElement("div", {
24
+ "data-testid": "ak-editor-main-toolbar",
25
+ className: ax([fixedToolbarCompiledStyles.mainToolbarWrapper, props.twoLineEditorToolbar && fixedToolbarCompiledStyles.mainToolbarTwoLine, fixedToolbarCompiledStyles.mainToolbarWrapperVisualRefresh, props.isNewToolbarEnabled && fixedToolbarCompiledStyles.mainToolbarWithoutLeftPadding, !expValEquals('platform_editor_comment_editor_border_radius', 'isEnabled', true) && fg('platform_editor_comments_border_radius') && fixedToolbarCompiledStyles.mainToolbarWithRadius, expValEquals('platform_editor_comment_editor_border_radius', 'isEnabled', true) && fixedToolbarCompiledStyles.mainToolbarRadius, props.isEditorModernisationEnabled && fixedToolbarCompiledStyles.editorModernisationToolbar])
26
+ }, props.children);
@@ -0,0 +1,91 @@
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
+
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
+ import { fg } from '@atlaskit/platform-feature-flags';
15
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
16
+ const MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT = 490;
17
+ const mainToolbarWrapperStyleNew = css({
18
+ position: 'relative',
19
+ alignItems: 'center',
20
+ padding: `${"var(--ds-space-100, 8px)"} ${"var(--ds-space-100, 8px)"} 0`,
21
+ display: 'flex',
22
+ height: 'auto',
23
+ backgroundColor: "var(--ds-surface, #FFFFFF)",
24
+ boxShadow: 'none',
25
+ paddingLeft: "var(--ds-space-250, 20px)",
26
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
27
+ '> div': {
28
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
29
+ '> div:first-of-type:not(style), > style:first-of-type + *': {
30
+ marginLeft: 0
31
+ }
32
+ },
33
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
34
+ '.block-type-btn': {
35
+ paddingLeft: 0
36
+ }
37
+ });
38
+
39
+ /** keep default padding for entire toolbar */
40
+ const mainToolbarWithoutLeftPadding = css({
41
+ padding: `${"var(--ds-space-100, 8px)"} ${"var(--ds-space-100, 8px)"} 0`
42
+ });
43
+ const mainToolbarTwoLineStylesNew = css({
44
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
45
+ '& > div': {
46
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
47
+ [`@media (max-width: ${MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT}px)`]: {
48
+ flexDirection: 'column-reverse',
49
+ alignItems: 'end',
50
+ display: 'flex',
51
+ justifyContent: 'flex-end'
52
+ },
53
+ /* make this more explicit for a toolbar */
54
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
55
+ '> div:first-of-type': {
56
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
57
+ [`@media (max-width: ${MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT}px)`]: {
58
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
59
+ '> div:nth-of-type(2)': {
60
+ justifyContent: 'flex-end',
61
+ display: 'flex'
62
+ }
63
+ }
64
+ }
65
+ }
66
+ });
67
+ const mainToolbarWrapperStylesVisualRefresh = css({
68
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
69
+ 'span svg': {
70
+ maxWidth: '100%'
71
+ }
72
+ });
73
+ const mainToolbarWithRadiusStyle = css({
74
+ borderRadius: `${"var(--ds-radius-small, 3px)"} ${"var(--ds-radius-small, 3px)"} 0 0`
75
+ });
76
+ const mainToolbarRadius = css({
77
+ borderRadius: `${"var(--ds-radius-medium, 6px)"} ${"var(--ds-radius-medium, 6px)"} 0 0`
78
+ });
79
+ const editorModernisationToolbarStyle = css({
80
+ borderRadius: `${"var(--ds-radius-xlarge, 12px)"} ${"var(--ds-radius-xlarge, 12px)"} 0 0`,
81
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
82
+ '&.show-keyline': {
83
+ boxShadow: 'none'
84
+ }
85
+ });
86
+ export const FixedToolbarEmotion = props =>
87
+ // eslint-disable-next-line @atlaskit/design-system/prefer-primitives
88
+ jsx("div", {
89
+ 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],
90
+ "data-testid": "ak-editor-main-toolbar"
91
+ }, props.children);
@@ -0,0 +1,25 @@
1
+
2
+ ._2rko12c2{border-radius:var(--ds-radius-medium,6px) var(--ds-radius-medium,6px) 0 0}
3
+ ._2rko15b0{border-radius:var(--ds-radius-xlarge,9pt) var(--ds-radius-xlarge,9pt) 0 0}
4
+ ._2rko1cku{border-radius:var(--ds-radius-small,3px) var(--ds-radius-small,3px) 0 0}
5
+ ._v56416gf{transition:box-shadow .2s ease-in-out}._10ytglyw.show-keyline{box-shadow:none}
6
+ ._10ytl2q5.show-keyline{box-shadow:0 2px 0 0 var(--ds-background-accent-gray-subtlest,#f0f1f2)}
7
+ ._16qsglyw{box-shadow:none}
8
+ ._19bvu2gc{padding-left:var(--ds-space-100,8px)}
9
+ ._19bvv47k{padding-left:var(--ds-space-250,20px)}
10
+ ._1cuzidpf .block-type-btn{padding-left:0}
11
+ ._1e0c1txw{display:flex}
12
+ ._1khpidpf >div>div:first-of-type:not(style){margin-left:0}
13
+ ._1pbybfng{z-index:500}
14
+ ._3pwj1osq span svg{max-width:100%}
15
+ ._4cvr1h6o{align-items:center}
16
+ ._4t3i1wug{height:auto}
17
+ ._bfhkvuon{background-color:var(--ds-surface,#fff)}
18
+ ._ca0qu2gc{padding-top:var(--ds-space-100,8px)}
19
+ ._kqsw1if8{position:sticky}
20
+ ._kqswh2mm{position:relative}
21
+ ._lg5oidpf >div>style:first-of-type+*{margin-left:0}
22
+ ._n3tdidpf{padding-bottom:0}
23
+ ._n3tdu2gc{padding-bottom:var(--ds-space-100,8px)}
24
+ ._u5f3u2gc{padding-right:var(--ds-space-100,8px)}
25
+ @media (max-width:490px){._1q27esu3>div>div:first-of-type>div:nth-of-type(2){justify-content:flex-end}._16ec1txw>div>div:first-of-type>div:nth-of-type(2){display:flex}._1uq61sxn>div{flex-direction:column-reverse}._cnpmh9n0>div{align-items:end}._1djy1txw>div{display:flex}._17mgesu3>div{justify-content:flex-end}}
@@ -0,0 +1,51 @@
1
+ /* StickyToolbar-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 `Toolbar.tsx`.
5
+ *
6
+ * Cleanup: delete this file once the experiment has shipped.
7
+ */
8
+ import "./StickyToolbar-compiled.compiled.css";
9
+ import { ax, ix } from "@compiled/react/runtime";
10
+ import React, { useEffect, useMemo, useState } from 'react';
11
+ import { fg } from '@atlaskit/platform-feature-flags';
12
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
13
+ const MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT = 490;
14
+ const akEditorMenuZIndex = 500;
15
+ const akEditorToolbarKeylineHeight = 2;
16
+ const stickyToolbarCompiledStyles = {
17
+ mainToolbarWrapper: "_kqswh2mm _4cvr1h6o _ca0qu2gc _u5f3u2gc _n3tdidpf _19bvv47k _1e0c1txw _4t3i1wug _bfhkvuon _16qsglyw _1khpidpf _lg5oidpf _1cuzidpf",
18
+ mainToolbarWithPadding: "_ca0qu2gc _u5f3u2gc _n3tdu2gc _19bvu2gc",
19
+ mainToolbarTwoLine: "_1uq61sxn _cnpmh9n0 _1djy1txw _17mgesu3 _1q27esu3 _16ec1txw",
20
+ mainToolbarWrapperVisualRefresh: "_3pwj1osq",
21
+ mainToolbarWithRadius: "_2rko1cku",
22
+ mainToolbarRadius: "_2rko12c2",
23
+ editorModernisationToolbar: "_2rko15b0 _10ytglyw",
24
+ stickyToolbarWrapper: "_v56416gf _kqsw1if8 _n3tdu2gc _1pbybfng _10ytl2q5"
25
+ };
26
+ export const StickyToolbarCompiled = props => {
27
+ const [top, setTop] = useState(0);
28
+
29
+ // ED-15802: if externalToolbarRef is passed in, set top to externalToolbarRef?.current?.clientHeight
30
+ // else if offsetTop is a number set top to offsetTop
31
+ // otherwise top is 0 as initial state
32
+ useEffect(() => {
33
+ var _props$externalToolba, _props$externalToolba2;
34
+ if ((_props$externalToolba = props.externalToolbarRef) !== null && _props$externalToolba !== void 0 && (_props$externalToolba2 = _props$externalToolba.current) !== null && _props$externalToolba2 !== void 0 && _props$externalToolba2.clientHeight) {
35
+ setTop(props.externalToolbarRef.current.clientHeight);
36
+ } else {
37
+ setTop(props.offsetTop || 0);
38
+ }
39
+ }, [props.externalToolbarRef, props.offsetTop]);
40
+ const wrapperStyle = useMemo(() => ({
41
+ top: `${top}px`
42
+ }), [top]);
43
+ return /*#__PURE__*/React.createElement("div", {
44
+ // 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
45
+ style: wrapperStyle,
46
+ "data-testid": "ak-editor-main-toolbar"
47
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
48
+ ,
49
+ className: ax([stickyToolbarCompiledStyles.mainToolbarWrapper, props.twoLineEditorToolbar && stickyToolbarCompiledStyles.mainToolbarTwoLine, stickyToolbarCompiledStyles.mainToolbarWrapperVisualRefresh, stickyToolbarCompiledStyles.stickyToolbarWrapper, props.isNewToolbarEnabled && stickyToolbarCompiledStyles.mainToolbarWithPadding, expValEquals('platform_editor_comment_editor_border_radius', 'isEnabled', true) && stickyToolbarCompiledStyles.mainToolbarRadius, !expValEquals('platform_editor_comment_editor_border_radius', 'isEnabled', true) && fg('platform_editor_comments_border_radius') && stickyToolbarCompiledStyles.mainToolbarWithRadius, props.isEditorModernisationEnabled && stickyToolbarCompiledStyles.editorModernisationToolbar, 'show-keyline'])
50
+ }, props.children);
51
+ };