@atlaskit/editor-core 219.9.16 → 219.9.17

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 (68) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/cjs/composable-editor/core-editor.js +7 -10
  3. package/dist/cjs/composable-editor/editor-internal-compiled.compiled.css +3 -0
  4. package/dist/cjs/composable-editor/editor-internal-compiled.js +27 -0
  5. package/dist/cjs/composable-editor/editor-internal-emotion.js +31 -0
  6. package/dist/cjs/composable-editor/editor-internal.js +17 -20
  7. package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +2 -15
  8. package/dist/cjs/ui/Appearance/FullPage/MainToolbar-compiled.js +46 -0
  9. package/dist/cjs/ui/Appearance/FullPage/{FullPageToolbar-emotion.js → MainToolbar-emotion.js} +25 -24
  10. package/dist/cjs/ui/Appearance/FullPage/MainToolbar.js +14 -68
  11. package/dist/cjs/ui/Appearance/FullPage/MainToolbarWrapper-compiled.compiled.css +14 -0
  12. package/dist/cjs/ui/Appearance/FullPage/MainToolbarWrapper-compiled.js +35 -0
  13. package/dist/cjs/ui/Appearance/FullPage/MainToolbarWrapper-emotion.js +70 -0
  14. package/dist/cjs/ui/Appearance/FullPage/MainToolbarWrapper.js +7 -61
  15. package/dist/cjs/version-wrapper.js +1 -1
  16. package/dist/es2019/composable-editor/core-editor.js +4 -11
  17. package/dist/es2019/composable-editor/editor-internal-compiled.compiled.css +3 -0
  18. package/dist/es2019/composable-editor/editor-internal-compiled.js +18 -0
  19. package/dist/es2019/composable-editor/editor-internal-emotion.js +23 -0
  20. package/dist/es2019/composable-editor/editor-internal.js +12 -21
  21. package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +1 -8
  22. package/dist/es2019/ui/Appearance/FullPage/{FullPageToolbar-compiled.js → MainToolbar-compiled.js} +19 -16
  23. package/dist/es2019/ui/Appearance/FullPage/{FullPageToolbar-emotion.js → MainToolbar-emotion.js} +20 -19
  24. package/dist/es2019/ui/Appearance/FullPage/MainToolbar.js +7 -70
  25. package/dist/es2019/ui/Appearance/FullPage/MainToolbarWrapper-compiled.compiled.css +14 -0
  26. package/dist/es2019/ui/Appearance/FullPage/MainToolbarWrapper-compiled.js +30 -0
  27. package/dist/es2019/ui/Appearance/FullPage/MainToolbarWrapper-emotion.js +65 -0
  28. package/dist/es2019/ui/Appearance/FullPage/MainToolbarWrapper.js +5 -63
  29. package/dist/es2019/version-wrapper.js +1 -1
  30. package/dist/esm/composable-editor/core-editor.js +4 -11
  31. package/dist/esm/composable-editor/editor-internal-compiled.compiled.css +3 -0
  32. package/dist/esm/composable-editor/editor-internal-compiled.js +19 -0
  33. package/dist/esm/composable-editor/editor-internal-emotion.js +24 -0
  34. package/dist/esm/composable-editor/editor-internal.js +14 -21
  35. package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +1 -14
  36. package/dist/esm/ui/Appearance/FullPage/{FullPageToolbar-compiled.js → MainToolbar-compiled.js} +19 -16
  37. package/dist/esm/ui/Appearance/FullPage/{FullPageToolbar-emotion.js → MainToolbar-emotion.js} +21 -20
  38. package/dist/esm/ui/Appearance/FullPage/MainToolbar.js +13 -65
  39. package/dist/esm/ui/Appearance/FullPage/MainToolbarWrapper-compiled.compiled.css +14 -0
  40. package/dist/esm/ui/Appearance/FullPage/MainToolbarWrapper-compiled.js +29 -0
  41. package/dist/esm/ui/Appearance/FullPage/MainToolbarWrapper-emotion.js +62 -0
  42. package/dist/esm/ui/Appearance/FullPage/MainToolbarWrapper.js +7 -60
  43. package/dist/esm/version-wrapper.js +1 -1
  44. package/dist/types/composable-editor/core-editor.d.ts +2 -2
  45. package/dist/types/composable-editor/editor-internal-compiled.d.ts +14 -0
  46. package/dist/types/composable-editor/editor-internal-emotion.d.ts +14 -0
  47. package/dist/types/composable-editor/editor-internal.d.ts +1 -0
  48. package/dist/types/ui/Appearance/FullPage/{FullPageToolbar-compiled.d.ts → MainToolbar-compiled.d.ts} +10 -9
  49. package/dist/{types-ts4.5/ui/Appearance/FullPage/FullPageToolbar-emotion.d.ts → types/ui/Appearance/FullPage/MainToolbar-emotion.d.ts} +10 -9
  50. package/dist/types/ui/Appearance/FullPage/MainToolbar.d.ts +10 -6
  51. package/dist/types/ui/Appearance/FullPage/MainToolbarWrapper-compiled.d.ts +19 -0
  52. package/dist/types/ui/Appearance/FullPage/MainToolbarWrapper-emotion.d.ts +19 -0
  53. package/dist/types/ui/Appearance/FullPage/MainToolbarWrapper.d.ts +3 -14
  54. package/dist/types-ts4.5/composable-editor/core-editor.d.ts +2 -2
  55. package/dist/types-ts4.5/composable-editor/editor-internal-compiled.d.ts +14 -0
  56. package/dist/types-ts4.5/composable-editor/editor-internal-emotion.d.ts +14 -0
  57. package/dist/types-ts4.5/composable-editor/editor-internal.d.ts +1 -0
  58. package/dist/types-ts4.5/ui/Appearance/FullPage/{FullPageToolbar-compiled.d.ts → MainToolbar-compiled.d.ts} +10 -9
  59. package/dist/{types/ui/Appearance/FullPage/FullPageToolbar-emotion.d.ts → types-ts4.5/ui/Appearance/FullPage/MainToolbar-emotion.d.ts} +10 -9
  60. package/dist/types-ts4.5/ui/Appearance/FullPage/MainToolbar.d.ts +10 -6
  61. package/dist/types-ts4.5/ui/Appearance/FullPage/MainToolbarWrapper-compiled.d.ts +19 -0
  62. package/dist/types-ts4.5/ui/Appearance/FullPage/MainToolbarWrapper-emotion.d.ts +19 -0
  63. package/dist/types-ts4.5/ui/Appearance/FullPage/MainToolbarWrapper.d.ts +3 -14
  64. package/package.json +1 -1
  65. package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar-compiled.js +0 -45
  66. /package/dist/cjs/ui/Appearance/FullPage/{FullPageToolbar-compiled.compiled.css → MainToolbar-compiled.compiled.css} +0 -0
  67. /package/dist/es2019/ui/Appearance/FullPage/{FullPageToolbar-compiled.compiled.css → MainToolbar-compiled.compiled.css} +0 -0
  68. /package/dist/esm/ui/Appearance/FullPage/{FullPageToolbar-compiled.compiled.css → MainToolbar-compiled.compiled.css} +0 -0
@@ -1,67 +1,13 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.MainToolbarWrapper = void 0;
8
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
- var _react = _interopRequireDefault(require("react"));
10
- var _react2 = require("@emotion/react");
11
- var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
12
- var _MainToolbar = require("./MainToolbar");
13
- /**
14
- * @jsxRuntime classic
15
- * @jsx jsx
16
- */
17
-
18
- // 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
19
-
20
- // Base styles that don't depend on feature flags
21
- var baseToolbarStyles = (0, _react2.css)({
22
- position: 'relative',
23
- alignItems: 'center',
24
- boxShadow: 'none',
25
- borderBottom: "var(--ds-border-width, 1px)".concat(" solid ", "var(--ds-border, #0B120E24)"),
26
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values
27
- transition: "box-shadow 200ms ".concat(_editorSharedStyles.akEditorSwoopCubicBezier),
28
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
29
- zIndex: _editorSharedStyles.akEditorFloatingDialogZIndex,
30
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
31
- display: 'flex',
32
- height: 'var(--ak-editor-fullpage-toolbar-height)',
33
- flexShrink: 0,
34
- backgroundColor: "var(--ds-surface, #FFFFFF)",
35
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
36
- '& object': {
37
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
38
- height: '0 !important'
39
- }
40
- });
41
- var flexibleIconSize = (0, _react2.css)({
42
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
43
- '& span svg': {
44
- maxWidth: '100%'
45
- }
46
- });
47
- // box-shadow is overriden by the mainToolbar
48
- var mainToolbarWithKeyline = (0, _react2.css)({
49
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
50
- boxShadow: "var(--ds-shadow-overflow, 0px 0px 8px #1E1F2128, 0px 0px 1px #1E1F211e)"
51
- });
52
- var mainToolbarTwoLineStyle = (0, _react2.css)((0, _defineProperty2.default)({}, "@media (max-width: ".concat(_MainToolbar.MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT, "px)"), {
53
- flexWrap: 'wrap',
54
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
55
- height: "calc(var(--ak-editor-fullpage-toolbar-height) * 2)"
56
- }));
57
- var MainToolbarWrapper = exports.MainToolbarWrapper = function MainToolbarWrapper(_ref) {
58
- var showKeyline = _ref.showKeyline,
59
- twoLineEditorToolbar = _ref.twoLineEditorToolbar,
60
- children = _ref.children,
61
- testId = _ref['data-testid'];
62
- return (0, _react2.jsx)("div", {
63
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
64
- css: [baseToolbarStyles, flexibleIconSize, showKeyline && mainToolbarWithKeyline, twoLineEditorToolbar && mainToolbarTwoLineStyle],
65
- "data-testid": testId
66
- }, children);
67
- };
7
+ var _platformFeatureFlagsReact = require("@atlaskit/platform-feature-flags-react");
8
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
9
+ var _MainToolbarWrapperCompiled = require("./MainToolbarWrapper-compiled");
10
+ var _MainToolbarWrapperEmotion = require("./MainToolbarWrapper-emotion");
11
+ var MainToolbarWrapper = exports.MainToolbarWrapper = (0, _platformFeatureFlagsReact.componentWithCondition)(function () {
12
+ return (0, _expValEquals.expValEquals)('platform_editor_core_non_ecc_static_css', 'isEnabled', true);
13
+ }, _MainToolbarWrapperCompiled.MainToolbarWrapperCompiled, _MainToolbarWrapperEmotion.MainToolbarWrapperEmotion);
@@ -5,4 +5,4 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.version = exports.name = void 0;
7
7
  var name = exports.name = "@atlaskit/editor-core";
8
- var version = exports.version = "219.9.15";
8
+ var version = exports.version = "219.9.16";
@@ -1,12 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- /**
3
- * @jsxRuntime classic
4
- * @jsx jsx
5
- */
6
- import { useCallback, useMemo, useRef, Fragment } 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 { jsx } from '@emotion/react';
2
+ import React, { useCallback, useMemo, useRef, Fragment } from 'react';
10
3
  import isEqual from 'lodash/isEqual';
11
4
  // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
12
5
  import uuid from 'uuid/v4';
@@ -93,7 +86,7 @@ function Editor(passedProps) {
93
86
  }
94
87
  }, [onSaveFromProps]);
95
88
  const isFullPageAppearance = Boolean(props.appearance && ['full-page', 'full-width', ...(editorExperiment('platform_synced_block', true) ? ['max'] : [])].includes(props.appearance));
96
- return jsx(Fragment, null, isFullPageAppearance ? jsx(EditorINPMetrics, null) : null, jsx(EditorInternal, {
89
+ return /*#__PURE__*/React.createElement(Fragment, null, isFullPageAppearance ? /*#__PURE__*/React.createElement(EditorINPMetrics, null) : null, /*#__PURE__*/React.createElement(EditorInternal, {
97
90
  props: props,
98
91
  handleAnalyticsEvent: handleAnalyticsEvent,
99
92
  createAnalyticsEvent: createAnalyticsEvent,
@@ -132,11 +125,11 @@ export function CoreEditor(props) {
132
125
  };
133
126
  }, [props.appearance]);
134
127
  const memodEditorFeatureFlags = useMemoEditorFeatureFlags(props.featureFlags);
135
- return jsx(FabricEditorAnalyticsContext
128
+ return /*#__PURE__*/React.createElement(FabricEditorAnalyticsContext
136
129
  // @ts-expect-error Type 'string' is not assignable to type '"editorCore" | "renderer"'.
137
130
  , {
138
131
  data: data
139
- }, jsx(Editor
132
+ }, /*#__PURE__*/React.createElement(Editor
140
133
  // Ignored via go/ees005
141
134
  // eslint-disable-next-line react/jsx-props-no-spreading
142
135
  , _extends({}, props, {
@@ -0,0 +1,3 @@
1
+ ._1bsb1osq{width:100%}
2
+ ._4t3i1osq{height:100%}
3
+ ._kqswh2mm{position:relative}
@@ -0,0 +1,18 @@
1
+ /* editor-internal-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 `editor-internal.tsx`.
5
+ *
6
+ * Cleanup: delete this file once the experiment has shipped.
7
+ */
8
+ import "./editor-internal-compiled.compiled.css";
9
+ import * as React from 'react';
10
+ import { ax, ix } from "@compiled/react/runtime";
11
+ const editorContainerCompiledStyles = {
12
+ root: "_kqswh2mm _1bsb1osq _4t3i1osq"
13
+ };
14
+ export const EditorInternalContainerCompiled = ({
15
+ children
16
+ }) => /*#__PURE__*/React.createElement("div", {
17
+ className: ax([editorContainerCompiledStyles.root])
18
+ }, children);
@@ -0,0 +1,23 @@
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 `editor-internal.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 -- intentional: emotion fallback for compiled migration
13
+ import { css, jsx } from '@emotion/react';
14
+ const editorContainerEmotionStyles = css({
15
+ position: 'relative',
16
+ width: '100%',
17
+ height: '100%'
18
+ });
19
+ export const EditorInternalContainerEmotion = ({
20
+ children
21
+ }) => jsx("div", {
22
+ css: editorContainerEmotionStyles
23
+ }, children);
@@ -1,13 +1,8 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- import { Fragment, memo } from 'react';
6
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
7
- import { css, jsx } from '@emotion/react';
1
+ import React, { Fragment, memo } from 'react';
8
2
  import { ACTION, ACTION_SUBJECT } from '@atlaskit/editor-common/analytics';
9
3
  import { usePortalProvider } from '@atlaskit/editor-common/portal';
10
4
  import { fg } from '@atlaskit/platform-feature-flags';
5
+ import { componentWithCondition } from '@atlaskit/platform-feature-flags-react';
11
6
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
12
7
  import ErrorBoundary from '../create-editor/ErrorBoundary';
13
8
  import ReactEditorViewNext from '../create-editor/ReactEditorView';
@@ -16,12 +11,10 @@ import { IntlProviderIfMissingWrapper } from '../ui/IntlProviderIfMissingWrapper
16
11
  import { createFeatureFlagsFromProps } from '../utils/feature-flags-from-props';
17
12
  import { RenderTracking } from '../utils/performance/components/RenderTracking';
18
13
  import { BaseThemeWrapper } from './BaseThemeWrapper';
14
+ import { EditorInternalContainerCompiled } from './editor-internal-compiled';
15
+ import { EditorInternalContainerEmotion } from './editor-internal-emotion';
19
16
  import { getBaseFontSize } from './utils/getBaseFontSize';
20
- const editorContainerStyles = css({
21
- position: 'relative',
22
- width: '100%',
23
- height: '100%'
24
- });
17
+ const EditorInternalContainerMigration = componentWithCondition(() => expValEquals('platform_editor_core_non_ecc_static_css', 'isEnabled', true), EditorInternalContainerCompiled, EditorInternalContainerEmotion);
25
18
  const DEFAULT_VALUE_PROP_TO_IGNORE = ['defaultValue'];
26
19
 
27
20
  /**
@@ -55,23 +48,21 @@ export const EditorInternal = /*#__PURE__*/memo(({
55
48
  const [portalProviderAPI, PortalRenderer] = usePortalProvider();
56
49
  const [nodeViewPortalProviderAPI, NodeViewPortalRenderer] = usePortalProvider();
57
50
  const propsToIgnore = expValEquals('platform_editor_perf_lint_cleanup', 'isEnabled', true) ? DEFAULT_VALUE_PROP_TO_IGNORE : ['defaultValue'];
58
- return jsx(Fragment, null, renderTrackingEnabled && jsx(RenderTracking, {
51
+ return /*#__PURE__*/React.createElement(Fragment, null, renderTrackingEnabled && /*#__PURE__*/React.createElement(RenderTracking, {
59
52
  componentProps: props,
60
53
  action: ACTION.RE_RENDERED,
61
54
  actionSubject: ACTION_SUBJECT.EDITOR,
62
55
  handleAnalyticsEvent: handleAnalyticsEvent,
63
56
  propsToIgnore: propsToIgnore,
64
57
  useShallow: useShallow
65
- }), jsx(ErrorBoundary, {
58
+ }), /*#__PURE__*/React.createElement(ErrorBoundary, {
66
59
  errorTracking: true,
67
60
  createAnalyticsEvent: createAnalyticsEvent,
68
61
  contextIdentifierProvider: props.contextIdentifierProvider,
69
62
  featureFlags: featureFlags
70
- }, jsx("div", {
71
- css: editorContainerStyles
72
- }, jsx(EditorContext, {
63
+ }, /*#__PURE__*/React.createElement(EditorInternalContainerMigration, null, /*#__PURE__*/React.createElement(EditorContext, {
73
64
  editorActions: editorActions
74
- }, jsx(IntlProviderIfMissingWrapper, null, jsx(Fragment, null, jsx(ReactEditorViewNext, {
65
+ }, /*#__PURE__*/React.createElement(IntlProviderIfMissingWrapper, null, /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(ReactEditorViewNext, {
75
66
  editorProps: overriddenEditorProps,
76
67
  createAnalyticsEvent: createAnalyticsEvent,
77
68
  portalProviderAPI: portalProviderAPI,
@@ -93,9 +84,9 @@ export const EditorInternal = /*#__PURE__*/memo(({
93
84
  editorAPI
94
85
  }) => {
95
86
  var _props$featureFlags, _props$featureFlags2;
96
- return jsx(BaseThemeWrapper, {
87
+ return /*#__PURE__*/React.createElement(BaseThemeWrapper, {
97
88
  baseFontSize: getBaseFontSize(props.appearance, props.contentMode)
98
- }, jsx(AppearanceComponent, {
89
+ }, /*#__PURE__*/React.createElement(AppearanceComponent, {
99
90
  innerRef: editorRef,
100
91
  editorAPI: editorAPI
101
92
  // Ignored via go/ees005
@@ -136,5 +127,5 @@ export const EditorInternal = /*#__PURE__*/memo(({
136
127
  preset: preset
137
128
  }));
138
129
  }
139
- }), jsx(PortalRenderer, null), jsx(NodeViewPortalRenderer, null)))))));
130
+ }), /*#__PURE__*/React.createElement(PortalRenderer, null), /*#__PURE__*/React.createElement(NodeViewPortalRenderer, null)))))));
140
131
  });
@@ -3,20 +3,13 @@ import { injectIntl } from 'react-intl';
3
3
  import { ContextPanelConsumer } from '@atlaskit/editor-common/context-panel';
4
4
  import { fullPageMessages as messages } from '@atlaskit/editor-common/messages';
5
5
  import { ToolbarArrowKeyNavigationProvider } from '@atlaskit/editor-common/ui-menu';
6
- import { componentWithCondition } from '@atlaskit/platform-feature-flags-react';
7
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
8
6
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
9
7
  import { ToolbarPortalMountPoint, useToolbarPortal } from '../../Toolbar/ToolbarPortal';
10
8
  import { ToolbarWithSizeDetector as Toolbar } from '../../Toolbar/ToolbarWithSizeDetector';
11
9
  import { BeforePrimaryToolbarWrapper } from './BeforeWrapper';
12
10
  import { MainToolbarForFirstChildWrapper, MainToolbarForSecondChildWrapper } from './CustomToolbarWrapper';
13
- import { CustomToolbarWrapperCompiled, MainToolbarIconBeforeCompiled, NonCustomToolbarWrapperCompiled } from './FullPageToolbar-compiled';
14
- import { CustomToolbarWrapperEmotion, MainToolbarIconBeforeEmotion, NonCustomToolbarWrapperEmotion } from './FullPageToolbar-emotion';
15
- import { MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT } from './MainToolbar';
11
+ import { CustomToolbarWrapperMigration, MainToolbarIconBeforeMigration, MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT, NonCustomToolbarWrapperMigration } from './MainToolbar';
16
12
  import { MainToolbarWrapper } from './MainToolbarWrapper';
17
- const NonCustomToolbarWrapperMigration = componentWithCondition(() => expValEquals('platform_editor_core_non_ecc_static_css', 'isEnabled', true), NonCustomToolbarWrapperCompiled, NonCustomToolbarWrapperEmotion);
18
- const MainToolbarIconBeforeMigration = componentWithCondition(() => expValEquals('platform_editor_core_non_ecc_static_css', 'isEnabled', true), MainToolbarIconBeforeCompiled, MainToolbarIconBeforeEmotion);
19
- const CustomToolbarWrapperMigration = componentWithCondition(() => expValEquals('platform_editor_core_non_ecc_static_css', 'isEnabled', true), CustomToolbarWrapperCompiled, CustomToolbarWrapperEmotion);
20
13
  export const EditorToolbar = /*#__PURE__*/React.memo(props => {
21
14
  var _props$primaryToolbar, _useToolbarPortal, _props$customPrimaryT;
22
15
  const [shouldSplitToolbar, setShouldSplitToolbar] = useState(false);
@@ -1,34 +1,37 @@
1
- /* FullPageToolbar-compiled.tsx generated by @compiled/babel-plugin v0.39.1 */
1
+ /* MainToolbar-compiled.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  /**
3
3
  * Compiled branch of the `platform_editor_core_non_ecc_static_css` experiment.
4
- * Used via `componentWithCondition` in `FullPageToolbar.tsx`.
4
+ * Used via `componentWithCondition` in `MainToolbar.tsx`.
5
5
  *
6
6
  * Cleanup: delete this file once the experiment has shipped.
7
7
  */
8
- import "./FullPageToolbar-compiled.compiled.css";
9
- import * as React from 'react';
8
+ import "./MainToolbar-compiled.compiled.css";
10
9
  import { ax, ix } from "@compiled/react/runtime";
11
- const nonCustomToolbarCompiledStyles = {
10
+ import React from 'react';
11
+
12
+ // eslint-disable-next-line @typescript-eslint/consistent-type-imports
13
+
14
+ const nonCustomToolbarWrapperCompiledStyles = {
12
15
  root: "_4cvr1h6o _1e0c1txw _16jlkb7n"
13
16
  };
14
- const mainToolbarIconBeforeCompiledStyles = {
15
- root: "_19pkpxbi _2hwxpxbi _otyrpxbi _18u0pxbi _4t3ixy5q _1bsbxy5q _mlgzkb7n _tuuhkb7n"
16
- };
17
- const customToolbarCompiledStyles = {
18
- root: "_4cvr1h6o _1e0c1txw"
19
- };
20
17
  export const NonCustomToolbarWrapperCompiled = ({
21
18
  children
22
19
  }) => /*#__PURE__*/React.createElement("div", {
23
- className: ax([nonCustomToolbarCompiledStyles.root])
20
+ className: ax([nonCustomToolbarWrapperCompiledStyles.root])
24
21
  }, children);
25
- export const MainToolbarIconBeforeCompiled = ({
22
+ const customToolbarWrapperCompiledStyles = {
23
+ root: "_4cvr1h6o _1e0c1txw"
24
+ };
25
+ export const CustomToolbarWrapperCompiled = ({
26
26
  children
27
27
  }) => /*#__PURE__*/React.createElement("div", {
28
- className: ax([mainToolbarIconBeforeCompiledStyles.root])
28
+ className: ax([customToolbarWrapperCompiledStyles.root])
29
29
  }, children);
30
- export const CustomToolbarWrapperCompiled = ({
30
+ const mainToolbarIconBeforeCompiledStyles = {
31
+ root: "_19pkpxbi _2hwxpxbi _otyrpxbi _18u0pxbi _4t3ixy5q _1bsbxy5q _mlgzkb7n _tuuhkb7n"
32
+ };
33
+ export const MainToolbarIconBeforeCompiled = ({
31
34
  children
32
35
  }) => /*#__PURE__*/React.createElement("div", {
33
- className: ax([customToolbarCompiledStyles.root])
36
+ className: ax([mainToolbarIconBeforeCompiledStyles.root])
34
37
  }, children);
@@ -4,20 +4,35 @@
4
4
  */
5
5
  /**
6
6
  * Emotion fallback branch of the `platform_editor_core_non_ecc_static_css` experiment.
7
- * Used via `componentWithCondition` in `FullPageToolbar.tsx`.
7
+ * Used via `componentWithCondition` in `MainToolbar.tsx`.
8
8
  *
9
9
  * Cleanup: delete this file once the experiment has shipped.
10
10
  */
11
+ import React from 'react';
11
12
 
12
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports -- intentional: emotion fallback; jsx required at runtime for @jsxRuntime classic
13
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports -- intentional: emotion fallback for compiled migration
13
14
  import { css, jsx } from '@emotion/react';
14
15
  import { akEditorMobileMaxWidth } from '@atlaskit/editor-shared-styles';
15
- const nonCustomToolbarWrapperStyle = css({
16
+ const nonCustomToolbarWrapperEmotionStyles = css({
16
17
  alignItems: 'center',
17
18
  display: 'flex',
18
19
  flexGrow: 1
19
20
  });
20
- const mainToolbarIconBeforeStyle = css({
21
+ export const NonCustomToolbarWrapperEmotion = ({
22
+ children
23
+ }) => jsx("div", {
24
+ css: nonCustomToolbarWrapperEmotionStyles
25
+ }, children);
26
+ const customToolbarWrapperEmotionStyles = css({
27
+ alignItems: 'center',
28
+ display: 'flex'
29
+ });
30
+ export const CustomToolbarWrapperEmotion = ({
31
+ children
32
+ }) => jsx("div", {
33
+ css: customToolbarWrapperEmotionStyles
34
+ }, children);
35
+ const mainToolbarIconBeforeEmotionStyles = css({
21
36
  margin: "var(--ds-space-200, 16px)",
22
37
  height: "var(--ds-space-400, 32px)",
23
38
  width: "var(--ds-space-400, 32px)",
@@ -27,22 +42,8 @@ const mainToolbarIconBeforeStyle = css({
27
42
  gridRow: 1
28
43
  }
29
44
  });
30
- const customToolbarWrapperStyle = css({
31
- alignItems: 'center',
32
- display: 'flex'
33
- });
34
- export const NonCustomToolbarWrapperEmotion = ({
35
- children
36
- }) => jsx("div", {
37
- css: nonCustomToolbarWrapperStyle
38
- }, children);
39
45
  export const MainToolbarIconBeforeEmotion = ({
40
46
  children
41
47
  }) => jsx("div", {
42
- css: mainToolbarIconBeforeStyle
43
- }, children);
44
- export const CustomToolbarWrapperEmotion = ({
45
- children
46
- }) => jsx("div", {
47
- css: customToolbarWrapperStyle
48
+ css: mainToolbarIconBeforeEmotionStyles
48
49
  }, children);
@@ -1,71 +1,8 @@
1
- /* eslint-disable @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766 */
2
- import { css } from '@emotion/react';
3
- import { akEditorMobileMaxWidth, FULL_PAGE_EDITOR_TOOLBAR_HEIGHT } from '@atlaskit/editor-shared-styles';
1
+ import { componentWithCondition } from '@atlaskit/platform-feature-flags-react';
2
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
3
+ import { CustomToolbarWrapperCompiled, MainToolbarIconBeforeCompiled, NonCustomToolbarWrapperCompiled } from './MainToolbar-compiled';
4
+ import { CustomToolbarWrapperEmotion, MainToolbarIconBeforeEmotion, NonCustomToolbarWrapperEmotion } from './MainToolbar-emotion';
4
5
  export const MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT = 868;
5
-
6
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
7
- export const mainToolbarIconBeforeStyle = css({
8
- margin: "var(--ds-space-200, 16px)",
9
- height: "var(--ds-space-400, 32px)",
10
- width: "var(--ds-space-400, 32px)",
11
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
12
- [`@media (max-width: ${akEditorMobileMaxWidth}px)`]: {
13
- gridColumn: 1,
14
- gridRow: 1
15
- }
16
- });
17
- const mainToolbarFirstChild = css({
18
- display: 'flex',
19
- flexGrow: 1,
20
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
21
- [`@media (max-width: ${akEditorMobileMaxWidth}px)`]: {
22
- gridColumn: 1,
23
- gridRow: 1
24
- }
25
- });
26
- const mainToolbarFirstChildTowLine = () => {
27
- const editorToolbarHeight = FULL_PAGE_EDITOR_TOOLBAR_HEIGHT();
28
- return css({
29
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
30
- [`@media (max-width: ${MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT}px)`]: {
31
- flex: '1 1 100%',
32
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
33
- height: editorToolbarHeight,
34
- justifyContent: 'flex-end',
35
- minWidth: 'fit-content'
36
- }
37
- });
38
- };
39
- export const mainToolbarFirstChildStyle = twoLineEditorToolbar => [mainToolbarFirstChild, twoLineEditorToolbar && mainToolbarFirstChildTowLine];
40
- const mainToolbarSecondChild = css({
41
- minWidth: 'fit-content'
42
- });
43
- const mainToolbarSecondChildTwoLine = () => {
44
- const editorToolbarHeight = FULL_PAGE_EDITOR_TOOLBAR_HEIGHT();
45
- return css({
46
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
47
- [`@media (max-width: ${MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT}px)`]: {
48
- display: 'flex',
49
- flexGrow: 1,
50
- flex: '1 1 100%',
51
- margin: 'auto',
52
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
53
- height: editorToolbarHeight,
54
- minWidth: 0
55
- }
56
- });
57
- };
58
- export const mainToolbarSecondChildStyle = twoLineEditorToolbar => [mainToolbarSecondChild, twoLineEditorToolbar && mainToolbarSecondChildTwoLine];
59
-
60
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
61
- export const nonCustomToolbarWrapperStyle = css({
62
- alignItems: 'center',
63
- display: 'flex',
64
- flexGrow: 1
65
- });
66
-
67
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
68
- export const customToolbarWrapperStyle = css({
69
- alignItems: 'center',
70
- display: 'flex'
71
- });
6
+ export const NonCustomToolbarWrapperMigration = componentWithCondition(() => expValEquals('platform_editor_core_non_ecc_static_css', 'isEnabled', true), NonCustomToolbarWrapperCompiled, NonCustomToolbarWrapperEmotion);
7
+ export const CustomToolbarWrapperMigration = componentWithCondition(() => expValEquals('platform_editor_core_non_ecc_static_css', 'isEnabled', true), CustomToolbarWrapperCompiled, CustomToolbarWrapperEmotion);
8
+ export const MainToolbarIconBeforeMigration = componentWithCondition(() => expValEquals('platform_editor_core_non_ecc_static_css', 'isEnabled', true), MainToolbarIconBeforeCompiled, MainToolbarIconBeforeEmotion);
@@ -0,0 +1,14 @@
1
+
2
+ ._v56419ab{transition:box-shadow .2s cubic-bezier(.15,1,.3,1)}
3
+ ._n7zlia51{border-bottom:var(--ds-border-width,1px) solid var(--ds-border,#0b120e24)}._16qs1nax{box-shadow:var(--ds-shadow-overflow,0 0 8px #1e1f2128,0 0 1px #1e1f211e)}
4
+ ._16qsglyw{box-shadow:none}
5
+ ._1e0c1txw{display:flex}
6
+ ._1krdgrf3 object{height:0!important}
7
+ ._1o9zidpf{flex-shrink:0}
8
+ ._1pby16oo{z-index:510}
9
+ ._3pwj1osq span svg{max-width:100%}
10
+ ._4cvr1h6o{align-items:center}
11
+ ._4t3i17qo{height:var(--ak-editor-fullpage-toolbar-height)}
12
+ ._bfhkvuon{background-color:var(--ds-surface,#fff)}
13
+ ._kqswh2mm{position:relative}
14
+ @media (max-width:868px){._1s5v1g80{flex-wrap:wrap}._8o38zpre{height:calc(var(--ak-editor-fullpage-toolbar-height)*2)}}
@@ -0,0 +1,30 @@
1
+ /* MainToolbarWrapper-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 `MainToolbarWrapper.tsx`.
5
+ *
6
+ * Cleanup: delete this file once the experiment has shipped.
7
+ */
8
+ import "./MainToolbarWrapper-compiled.compiled.css";
9
+ import { ax, ix } from "@compiled/react/runtime";
10
+ import React from 'react';
11
+
12
+ // eslint-disable-next-line @typescript-eslint/consistent-type-imports
13
+
14
+ const styles = {
15
+ base: "_v56419ab _n7zlia51 _kqswh2mm _4cvr1h6o _16qsglyw _1pby16oo _1e0c1txw _4t3i17qo _1o9zidpf _bfhkvuon _1krdgrf3",
16
+ flexibleIconSize: "_3pwj1osq",
17
+ keyline: "_16qs1nax",
18
+ twoLine: "_1s5v1g80 _8o38zpre"
19
+ };
20
+ export const MainToolbarWrapperCompiled = ({
21
+ showKeyline,
22
+ twoLineEditorToolbar,
23
+ children,
24
+ 'data-testid': testId
25
+ }) => {
26
+ return /*#__PURE__*/React.createElement("div", {
27
+ "data-testid": testId,
28
+ className: ax([styles.base, styles.flexibleIconSize, showKeyline && styles.keyline, twoLineEditorToolbar && styles.twoLine])
29
+ }, children);
30
+ };
@@ -0,0 +1,65 @@
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 `MainToolbarWrapper.tsx`.
8
+ *
9
+ * Cleanup: delete this file once the experiment has shipped.
10
+ */
11
+ import React from 'react';
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 { akEditorFloatingDialogZIndex, akEditorSwoopCubicBezier } from '@atlaskit/editor-shared-styles';
16
+ import { MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT } from './MainToolbar';
17
+ const baseToolbarStyles = css({
18
+ position: 'relative',
19
+ alignItems: 'center',
20
+ boxShadow: 'none',
21
+ borderBottom: `${"var(--ds-border-width, 1px)"} solid ${"var(--ds-border, #0B120E24)"}`,
22
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
23
+ transition: `box-shadow 200ms ${akEditorSwoopCubicBezier}`,
24
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
25
+ zIndex: akEditorFloatingDialogZIndex,
26
+ display: 'flex',
27
+ height: 'var(--ak-editor-fullpage-toolbar-height)',
28
+ flexShrink: 0,
29
+ backgroundColor: "var(--ds-surface, #FFFFFF)",
30
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
31
+ '& object': {
32
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
33
+ height: '0 !important'
34
+ }
35
+ });
36
+ const flexibleIconSize = css({
37
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
38
+ '& span svg': {
39
+ maxWidth: '100%'
40
+ }
41
+ });
42
+ const mainToolbarWithKeyline = css({
43
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
44
+ boxShadow: `${"var(--ds-shadow-overflow, 0px 0px 8px #1E1F2128, 0px 0px 1px #1E1F211e)"}`
45
+ });
46
+ const mainToolbarTwoLineStyle = css({
47
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
48
+ [`@media (max-width: ${MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT}px)`]: {
49
+ flexWrap: 'wrap',
50
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
51
+ height: `calc(var(--ak-editor-fullpage-toolbar-height) * 2)`
52
+ }
53
+ });
54
+ export const MainToolbarWrapperEmotion = ({
55
+ showKeyline,
56
+ twoLineEditorToolbar,
57
+ children,
58
+ 'data-testid': testId
59
+ }) => {
60
+ return jsx("div", {
61
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
62
+ css: [baseToolbarStyles, flexibleIconSize, showKeyline && mainToolbarWithKeyline, twoLineEditorToolbar && mainToolbarTwoLineStyle],
63
+ "data-testid": testId
64
+ }, children);
65
+ };