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