@atlaskit/renderer 130.2.17 → 130.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 (71) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/cjs/react/marks/link-compiled.compiled.css +6 -0
  3. package/dist/cjs/react/marks/link-compiled.js +27 -0
  4. package/dist/cjs/react/marks/link-emotion.js +42 -0
  5. package/dist/cjs/react/marks/link.js +13 -23
  6. package/dist/cjs/react/nodes/bodiedExtension.js +6 -3
  7. package/dist/cjs/react/nodes/extension.js +41 -11
  8. package/dist/cjs/react/nodes/layoutColumn-compiled.compiled.css +10 -0
  9. package/dist/cjs/react/nodes/layoutColumn-compiled.js +37 -0
  10. package/dist/cjs/react/nodes/layoutColumn-emotion.js +59 -0
  11. package/dist/cjs/react/nodes/layoutColumn.js +11 -41
  12. package/dist/cjs/react/nodes/panel-compiled.compiled.css +54 -0
  13. package/dist/cjs/react/nodes/panel-compiled.js +60 -0
  14. package/dist/cjs/react/nodes/panel-emotion.js +185 -0
  15. package/dist/cjs/react/nodes/panel.js +14 -181
  16. package/dist/cjs/ui/Renderer/index.js +1 -1
  17. package/dist/es2019/react/marks/link-compiled.compiled.css +6 -0
  18. package/dist/es2019/react/marks/link-compiled.js +17 -0
  19. package/dist/es2019/react/marks/link-emotion.js +31 -0
  20. package/dist/es2019/react/marks/link.js +13 -23
  21. package/dist/es2019/react/nodes/bodiedExtension.js +6 -3
  22. package/dist/es2019/react/nodes/extension.js +33 -4
  23. package/dist/es2019/react/nodes/layoutColumn-compiled.compiled.css +10 -0
  24. package/dist/es2019/react/nodes/layoutColumn-compiled.js +31 -0
  25. package/dist/es2019/react/nodes/layoutColumn-emotion.js +61 -0
  26. package/dist/es2019/react/nodes/layoutColumn.js +10 -50
  27. package/dist/es2019/react/nodes/panel-compiled.compiled.css +57 -0
  28. package/dist/es2019/react/nodes/panel-compiled.js +44 -0
  29. package/dist/es2019/react/nodes/panel-emotion.js +178 -0
  30. package/dist/es2019/react/nodes/panel.js +12 -180
  31. package/dist/es2019/ui/Renderer/index.js +1 -1
  32. package/dist/esm/react/marks/link-compiled.compiled.css +6 -0
  33. package/dist/esm/react/marks/link-compiled.js +19 -0
  34. package/dist/esm/react/marks/link-emotion.js +34 -0
  35. package/dist/esm/react/marks/link.js +15 -23
  36. package/dist/esm/react/nodes/bodiedExtension.js +6 -3
  37. package/dist/esm/react/nodes/extension.js +39 -11
  38. package/dist/esm/react/nodes/layoutColumn-compiled.compiled.css +10 -0
  39. package/dist/esm/react/nodes/layoutColumn-compiled.js +31 -0
  40. package/dist/esm/react/nodes/layoutColumn-emotion.js +52 -0
  41. package/dist/esm/react/nodes/layoutColumn.js +12 -41
  42. package/dist/esm/react/nodes/panel-compiled.compiled.css +54 -0
  43. package/dist/esm/react/nodes/panel-compiled.js +53 -0
  44. package/dist/esm/react/nodes/panel-emotion.js +179 -0
  45. package/dist/esm/react/nodes/panel.js +14 -181
  46. package/dist/esm/ui/Renderer/index.js +1 -1
  47. package/dist/types/analytics/events.d.ts +6 -2
  48. package/dist/types/react/marks/link-compiled.d.ts +13 -0
  49. package/dist/types/react/marks/link-emotion.d.ts +14 -0
  50. package/dist/types/react/marks/link.d.ts +5 -2
  51. package/dist/types/react/nodes/bodiedExtension.d.ts +2 -0
  52. package/dist/types/react/nodes/extension.d.ts +2 -0
  53. package/dist/types/react/nodes/layoutColumn-compiled.d.ts +14 -0
  54. package/dist/types/react/nodes/layoutColumn-emotion.d.ts +14 -0
  55. package/dist/types/react/nodes/layoutColumn.d.ts +3 -5
  56. package/dist/types/react/nodes/panel-compiled.d.ts +22 -0
  57. package/dist/types/react/nodes/panel-emotion.d.ts +23 -0
  58. package/dist/types/react/nodes/panel.d.ts +1 -6
  59. package/dist/types-ts4.5/analytics/events.d.ts +6 -2
  60. package/dist/types-ts4.5/react/marks/link-compiled.d.ts +13 -0
  61. package/dist/types-ts4.5/react/marks/link-emotion.d.ts +14 -0
  62. package/dist/types-ts4.5/react/marks/link.d.ts +5 -2
  63. package/dist/types-ts4.5/react/nodes/bodiedExtension.d.ts +2 -0
  64. package/dist/types-ts4.5/react/nodes/extension.d.ts +2 -0
  65. package/dist/types-ts4.5/react/nodes/layoutColumn-compiled.d.ts +14 -0
  66. package/dist/types-ts4.5/react/nodes/layoutColumn-emotion.d.ts +14 -0
  67. package/dist/types-ts4.5/react/nodes/layoutColumn.d.ts +3 -5
  68. package/dist/types-ts4.5/react/nodes/panel-compiled.d.ts +22 -0
  69. package/dist/types-ts4.5/react/nodes/panel-emotion.d.ts +23 -0
  70. package/dist/types-ts4.5/react/nodes/panel.d.ts +1 -6
  71. package/package.json +14 -9
@@ -6,7 +6,8 @@ import _extends from "@babel/runtime/helpers/extends";
6
6
 
7
7
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
8
8
  import { jsx, css } from '@emotion/react';
9
- import React from 'react';
9
+ import React, { useEffect, useRef } from 'react';
10
+ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
10
11
  import ExtensionRenderer from '../../ui/ExtensionRenderer';
11
12
  import { overflowShadow, WidthConsumer } from '@atlaskit/editor-common/ui';
12
13
  import { calcBreakoutWidth } from '@atlaskit/editor-common/utils';
@@ -36,13 +37,37 @@ const getViewportSize = (extensionId, extensionViewportSizes) => {
36
37
  const containerStyle = css({
37
38
  containerType: 'inline-size'
38
39
  });
40
+ /**
41
+ * Fires an analytics event once on mount when a bodied extension is rendered as an inline element.
42
+ * The node is stored in a ref to avoid re-firing if the node reference changes.
43
+ */
44
+ const FireExtensionAsInlineAnalytics = ({
45
+ fireAnalyticsEvent,
46
+ node
47
+ }) => {
48
+ const nodeRef = useRef(node);
49
+ useEffect(() => {
50
+ fireAnalyticsEvent({
51
+ action: ACTION.RENDERED,
52
+ actionSubject: ACTION_SUBJECT.EXTENSION_AS_INLINE,
53
+ actionSubjectId: ACTION_SUBJECT_ID.EXTENSION_BODIED,
54
+ attributes: {
55
+ extensionKey: nodeRef.current.extensionKey,
56
+ extensionType: nodeRef.current.extensionType
57
+ },
58
+ eventType: EVENT_TYPE.OPERATIONAL
59
+ });
60
+ }, [fireAnalyticsEvent]);
61
+ return null;
62
+ };
39
63
  export const renderExtension = (content, layout, options = {}, removeOverflow, extensionId, extensionViewportSizes, nodeHeight, localId, shouldDisplayExtensionAsInline, node, isInsideOfInlineExtension) => {
40
64
  const overflowContainerClass = !removeOverflow ? RendererCssClassName.EXTENSION_OVERFLOW_CONTAINER : '';
41
65
 
42
66
  // by default, we assume the extension is at top level, (direct child of doc node)
43
67
  const {
44
68
  isTopLevel = true,
45
- rendererAppearance
69
+ rendererAppearance,
70
+ fireAnalyticsEvent
46
71
  } = options || {};
47
72
  // we should only use custom layout for full-page appearance
48
73
  const canUseCustomLayout = expValEquals('platform_editor_remove_important_in_render_ext', 'isEnabled', true) ? rendererAppearance === 'full-page' : true;
@@ -58,6 +83,10 @@ export const renderExtension = (content, layout, options = {}, removeOverflow, e
58
83
  const extensionHeight = nodeHeight || viewportSize;
59
84
  const isInline = (shouldDisplayExtensionAsInline === null || shouldDisplayExtensionAsInline === void 0 ? void 0 : shouldDisplayExtensionAsInline(node)) && expValEquals('platform_editor_render_bodied_extension_as_inline', 'isEnabled', true);
60
85
  const inlineClassName = isInline ? RendererCssClassName.EXTENSION_AS_INLINE : '';
86
+ const asInlineAnalytics = isInline && fireAnalyticsEvent && node && fg('platform_editor_render_inline_extension_analytics') ? jsx(FireExtensionAsInlineAnalytics, {
87
+ fireAnalyticsEvent: fireAnalyticsEvent,
88
+ node: node
89
+ }) : null;
61
90
  if (expValEquals('platform_editor_renderer_extension_width_fix', 'isEnabled', true)) {
62
91
  const extensionDiv = jsx("div", {
63
92
  ref: options.handleRef
@@ -81,7 +110,7 @@ export const renderExtension = (content, layout, options = {}, removeOverflow, e
81
110
  ,
82
111
  className: `${RendererCssClassName.EXTENSION_INNER_WRAPPER} ${overflowContainerClass}`,
83
112
  css: [!isInsideOfInlineExtension && fg('platform_fix_macro_renders_in_layouts') && containerStyle]
84
- }, content));
113
+ }, asInlineAnalytics, content));
85
114
  return centerAlignClass && expValEquals('platform_editor_flex_based_centering', 'isEnabled', true) ? jsx("div", {
86
115
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
87
116
  className: RendererCssClassName.STICKY_SAFE_CENTER_WRAPPER + ' ' + RendererCssClassName.FLEX_CENTER_WRAPPER
@@ -111,7 +140,7 @@ export const renderExtension = (content, layout, options = {}, removeOverflow, e
111
140
  ,
112
141
  className: `${RendererCssClassName.EXTENSION_INNER_WRAPPER} ${overflowContainerClass}`,
113
142
  css: [!isInsideOfInlineExtension && fg('platform_fix_macro_renders_in_layouts') && containerStyle]
114
- }, content));
143
+ }, asInlineAnalytics, content));
115
144
  return centerAlignClass && expValEquals('platform_editor_flex_based_centering', 'isEnabled', true) ? jsx("div", {
116
145
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
117
146
  className: RendererCssClassName.STICKY_SAFE_CENTER_WRAPPER + ' ' + RendererCssClassName.FLEX_CENTER_WRAPPER
@@ -0,0 +1,10 @@
1
+ ._12kpidpf [class*=image-wrap-]:has(+[class*=image-wrap-]){margin-top:0}
2
+ ._166hgrf3+.fabric-editor-block-mark>h4{margin-top:0!important}
3
+ ._19segrf3+.fabric-editor-block-mark>h1{margin-top:0!important}
4
+ ._1ki1grf3+.fabric-editor-block-mark>h2{margin-top:0!important}
5
+ ._1skbgrf3+*{margin-top:0!important}
6
+ ._1tihidpf [class*=image-wrap-]+[class*=image-wrap-]{margin-top:0}
7
+ ._7g1ogrf3+.fabric-editor-block-mark>h5{margin-top:0!important}
8
+ ._bmdegrf3+.fabric-editor-block-mark>h3{margin-top:0!important}
9
+ ._hgeogrf3+.fabric-editor-block-mark>p{margin-top:0!important}
10
+ ._sk2jgrf3+.fabric-editor-block-mark>h6{margin-top:0!important}
@@ -0,0 +1,31 @@
1
+ /* layoutColumn-compiled.tsx generated by @compiled/babel-plugin v0.39.1 */
2
+ /**
3
+ * Compiled branch of the `platform_editor_static_css` experiment.
4
+ * Used via `componentWithCondition` in `layoutColumn.tsx`.
5
+ *
6
+ * Cleanup: delete this file once the experiment has shipped.
7
+ */
8
+ import "./layoutColumn-compiled.compiled.css";
9
+ import { ax, ix } from "@compiled/react/runtime";
10
+ import React from 'react';
11
+ import { WidthProvider } from '@atlaskit/editor-common/ui';
12
+ import { fg } from '@atlaskit/platform-feature-flags';
13
+
14
+ // localized styles, was from clearNextSiblingMarginTopStyle in @atlaskit/editor-common/ui
15
+ const clearNextSiblingMarginTopStyle = null;
16
+ const multipleWrappedImagesStyle = null;
17
+
18
+ // localized styles, was from clearNextSiblingBlockMarkMarginTopStyle in @atlaskit/editor-common/ui
19
+ const clearNextSiblingBlockMarkMarginTopStyle = null;
20
+ export const LayoutSectionCompiled = props => {
21
+ return /*#__PURE__*/React.createElement("div", {
22
+ "data-layout-column": true,
23
+ "data-column-width": props.width,
24
+ style: {
25
+ flexBasis: `${props.width}%`
26
+ },
27
+ className: ax([fg('platform_editor_fix_media_in_renderer') && "_1tihidpf _12kpidpf"])
28
+ }, /*#__PURE__*/React.createElement(WidthProvider, null, /*#__PURE__*/React.createElement("div", {
29
+ className: ax(["_1skbgrf3", "_19segrf3 _1ki1grf3 _bmdegrf3 _166hgrf3 _7g1ogrf3 _sk2jgrf3 _hgeogrf3"])
30
+ }), props.children));
31
+ };
@@ -0,0 +1,61 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ /**
6
+ * Emotion branch of the `platform_editor_static_css` experiment.
7
+ * Used via `componentWithCondition` in `layoutColumn.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 -- intentional: emotion fallback for compiled migration
14
+ import { jsx, css } from '@emotion/react';
15
+ import { WidthProvider } from '@atlaskit/editor-common/ui';
16
+ import { fg } from '@atlaskit/platform-feature-flags';
17
+
18
+ // localized styles, was from clearNextSiblingMarginTopStyle in @atlaskit/editor-common/ui
19
+ const clearNextSiblingMarginTopStyle = css({
20
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
21
+ '& + *': {
22
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview, @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
23
+ marginTop: '0 !important'
24
+ }
25
+ });
26
+ const multipleWrappedImagesStyle = css({
27
+ // Given the first wrapped mediaSingle has 0 marginTop (see clearNextSiblingMarginTopStyle),
28
+ // update all wrapped mediaSingle inside layout to have 0 margin top unless they don't have sibling wrapped mediaSingle
29
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
30
+ '& [class*="image-wrap-"] + [class*="image-wrap-"], & [class*="image-wrap-"]:has( + [class*="image-wrap-"])': {
31
+ marginTop: '0'
32
+ }
33
+ });
34
+
35
+ // localized styles, was from clearNextSiblingBlockMarkMarginTopStyle in @atlaskit/editor-common/ui
36
+ const clearNextSiblingBlockMarkMarginTopStyle = css({
37
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
38
+ [`+ .fabric-editor-block-mark > p,
39
+ + .fabric-editor-block-mark > h1,
40
+ + .fabric-editor-block-mark > h2,
41
+ + .fabric-editor-block-mark > h3,
42
+ + .fabric-editor-block-mark > h4,
43
+ + .fabric-editor-block-mark > h5,
44
+ + .fabric-editor-block-mark > h6
45
+ `]: {
46
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview, @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
47
+ marginTop: '0 !important'
48
+ }
49
+ });
50
+ export const LayoutSectionEmotion = props => {
51
+ return jsx("div", {
52
+ "data-layout-column": true,
53
+ "data-column-width": props.width,
54
+ style: {
55
+ flexBasis: `${props.width}%`
56
+ },
57
+ css: fg('platform_editor_fix_media_in_renderer') && multipleWrappedImagesStyle
58
+ }, jsx(WidthProvider, null, jsx("div", {
59
+ css: [clearNextSiblingMarginTopStyle, clearNextSiblingBlockMarkMarginTopStyle]
60
+ }), props.children));
61
+ };
@@ -1,54 +1,14 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
1
  import React from 'react';
6
- /* eslint-disable @typescript-eslint/consistent-type-imports, @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766; jsx required at runtime for @jsxRuntime classic */
7
- import { jsx, css } from '@emotion/react';
8
- import { WidthProvider } from '@atlaskit/editor-common/ui';
9
- import { fg } from '@atlaskit/platform-feature-flags';
10
-
11
- // localized styles, was from clearNextSiblingMarginTopStyle in @atlaskit/editor-common/ui
12
- const clearNextSiblingMarginTopStyle = css({
13
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
14
- '& + *': {
15
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview, @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
16
- marginTop: '0 !important'
17
- }
18
- });
19
- const multipleWrappedImagesStyle = css({
20
- // Given the first wrapped mediaSingle has 0 marginTop (see clearNextSiblingMarginTopStyle),
21
- // update all wrapped mediaSingle inside layout to have 0 margin top unless they don't have sibling wrapped mediaSingle
22
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
23
- '& [class*="image-wrap-"] + [class*="image-wrap-"], & [class*="image-wrap-"]:has( + [class*="image-wrap-"])': {
24
- marginTop: '0'
25
- }
26
- });
2
+ import { componentWithCondition } from '@atlaskit/platform-feature-flags-react';
3
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
4
+ import { LayoutSectionCompiled } from './layoutColumn-compiled';
5
+ import { LayoutSectionEmotion } from './layoutColumn-emotion';
6
+ const LayoutSectionMigration = componentWithCondition(() => expValEquals('platform_editor_renderer_static_css', 'isEnabled', true), LayoutSectionCompiled, LayoutSectionEmotion);
27
7
 
28
- // localized styles, was from clearNextSiblingBlockMarkMarginTopStyle in @atlaskit/editor-common/ui
29
- const clearNextSiblingBlockMarkMarginTopStyle = css({
30
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
31
- [`+ .fabric-editor-block-mark > p,
32
- + .fabric-editor-block-mark > h1,
33
- + .fabric-editor-block-mark > h2,
34
- + .fabric-editor-block-mark > h3,
35
- + .fabric-editor-block-mark > h4,
36
- + .fabric-editor-block-mark > h5,
37
- + .fabric-editor-block-mark > h6
38
- `]: {
39
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview, @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
40
- marginTop: '0 !important'
41
- }
42
- });
8
+ /**
9
+ * Render a layout column in renderer.
10
+ */
43
11
  export default function LayoutSection(props) {
44
- return jsx("div", {
45
- "data-layout-column": true,
46
- "data-column-width": props.width,
47
- style: {
48
- flexBasis: `${props.width}%`
49
- },
50
- css: fg('platform_editor_fix_media_in_renderer') && multipleWrappedImagesStyle
51
- }, jsx(WidthProvider, null, jsx("div", {
52
- css: [clearNextSiblingMarginTopStyle, clearNextSiblingBlockMarkMarginTopStyle]
53
- }), props.children));
12
+ // eslint-disable-next-line react/jsx-props-no-spreading
13
+ return /*#__PURE__*/React.createElement(LayoutSectionMigration, props);
54
14
  }
@@ -0,0 +1,57 @@
1
+
2
+ ._1wvnia51 .ak-editor-panel__content .ak-editor-panel{border:var(--ds-border-width,1px) solid var(--ds-border,#0b120e24)}
3
+ ._lklzfajl.ak-editor-panel{border-radius:var(--ds-radius-small,3px)}._11k7idpf.ak-editor-panel .ak-editor-panel__content{margin-right:0}
4
+ ._11wb1ejb.ak-editor-panel .ak-editor-panel__icon{width:var(--ds-space-300,24px)}
5
+ ._122m1aok.ak-editor-panel[data-panel-type=custom]{background-color:var(--ak-renderer-panel-custom-bg-color)}
6
+ ._13n84jg8.ak-editor-panel{align-items:normal}
7
+ ._1554u2gc.ak-editor-panel{padding-top:var(--ds-space-100,8px)}
8
+ ._15sp1vk5.ak-editor-panel[data-panel-type=error]{background-color:var(--ds-background-accent-red-subtlest,#ffeceb)}
9
+ ._18w0h2mm.ak-editor-panel{position:relative}
10
+ ._18y8qm1h.ak-editor-panel[data-panel-type=note] .ak-editor-panel__icon{color:var(--ds-icon-discovery,#af59e1)}
11
+ ._19agidpf.ak-editor-panel .ak-editor-panel__content{flex-shrink:0}
12
+ ._19s71txw.ak-editor-panel{display:flex}
13
+ ._1a3fnkob.ak-editor-panel .ak-editor-panel__icon>span{vertical-align:middle}
14
+ ._1alzoqnp.ak-editor-panel{margin-top:.75rem}
15
+ ._1b0jutpp.ak-editor-panel[data-panel-type=custom]{padding-right:var(--ds-space-150,9pt)}
16
+ ._1bi2v77o.ak-editor-panel .ak-editor-panel__content{margin-bottom:var(--ds-space-025,2px)}
17
+ ._1cgk1h6o.ak-editor-panel .ak-editor-panel__icon{text-align:center}
18
+ ._1eiopxbi.ak-editor-panel{padding-right:var(--ds-space-200,1pc)}
19
+ ._1fe7s4qr.ak-editor-panel[data-panel-type=error] .ak-editor-panel__icon{color:var(--ds-icon-danger,#c9372c)}
20
+ ._1g6dibhp.ak-editor-panel[data-panel-type=warning]{background-color:var(--ds-background-accent-yellow-subtlest,#fef7c8)}
21
+ ._1h33yhbg.ak-editor-panel .ak-editor-panel__icon{color:var(--ds-icon-information,#357de8)}
22
+ ._1hau12gs.ak-editor-panel .ak-editor-panel__icon .emoji-common-emoji-sprite{vertical-align:-2px}
23
+ ._1it3ckbl.ak-editor-panel{min-width:3pc}
24
+ ._1l9midpf.ak-editor-panel .ak-editor-panel__icon{flex-shrink:0}
25
+ ._1m1jidpf.ak-editor-panel{margin-left:0}
26
+ ._1n3wglyw.ak-editor-panel .ak-editor-panel__icon{-ms-user-select:none}
27
+ ._1oah1ntv.ak-editor-panel .ak-editor-panel__icon{box-sizing:content-box}
28
+ ._1pciu2gc.ak-editor-panel .ak-editor-panel__icon{padding-right:var(--ds-space-100,8px)}
29
+ ._1q6xf1ug.ak-editor-panel .ak-editor-panel__content{flex-basis:0%}
30
+ ._1udservl.ak-editor-panel[data-panel-type=warning] .ak-editor-panel__icon{color:var(--ds-icon-warning,#e06c00)}
31
+ ._1uvd116y.ak-editor-panel .ak-editor-panel__icon>span{display:inline-flex}
32
+ ._1v1c1ejb.ak-editor-panel .ak-editor-panel__icon{height:var(--ds-space-300,24px)}
33
+ ._1w22u2gc.ak-editor-panel{padding-bottom:var(--ds-space-100,8px)}
34
+ ._1whxutpp.ak-editor-panel[data-panel-type=custom]{padding-left:var(--ds-space-150,9pt)}
35
+ ._1yw1vq3b.ak-editor-panel .ak-editor-panel__icon{margin-top:.1em}
36
+ ._50vakb7n.ak-editor-panel .ak-editor-panel__content{flex-grow:1}
37
+ ._5zphglyw.ak-editor-panel .ak-editor-panel__icon{-webkit-user-select:none;-ms-user-select:none;user-select:none}
38
+ ._66ohu2gc.ak-editor-panel{padding-left:var(--ds-space-100,8px)}
39
+ ._6qwr1hna.ak-editor-panel{word-break:break-word}
40
+ ._7c6pj39m.ak-editor-panel .ak-editor-panel__icon .emoji-common-emoji-image{vertical-align:-3px}
41
+ ._9dunutpp.ak-editor-panel__no-icon{padding-left:var(--ds-space-150,9pt)}
42
+ ._e5ovn729.ak-editor-panel[data-panel-type=tip]{background-color:var(--ds-background-accent-green-subtlest,#dcfff1)}
43
+ ._fc9iidpf.ak-editor-panel .ak-editor-panel__content{min-width:0}
44
+ ._g8a34pcx.ak-editor-panel[data-panel-type=tip] .ak-editor-panel__icon{color:var(--ds-icon-success,#6a9a23)}
45
+ ._gb1eidpf.ak-editor-panel .ak-editor-panel__content{margin-left:0}
46
+ ._gt7x4pcx.ak-editor-panel[data-panel-type=success] .ak-editor-panel__icon{color:var(--ds-icon-success,#6a9a23)}
47
+ ._iqv91kw7.ak-editor-panel{color:inherit}
48
+ ._jde2v77o.ak-editor-panel .ak-editor-panel__content{margin-top:var(--ds-space-025,2px)}
49
+ ._nlelp2ly.ak-editor-panel[data-panel-type=note]{background-color:var(--ds-background-accent-purple-subtlest,#f8eefe)}
50
+ ._pzbautpp.ak-editor-panel__no-icon{padding-right:var(--ds-space-150,9pt)}
51
+ ._s4ldn729.ak-editor-panel[data-panel-type=success]{background-color:var(--ds-background-accent-green-subtlest,#dcfff1)}
52
+ ._u70eidpf.ak-editor-panel{margin-bottom:0}
53
+ ._ujht1s93.ak-editor-panel{background-color:var(--ds-background-accent-blue-subtlest,#e9f2fe)}
54
+ ._wz94glyw.ak-editor-panel .ak-editor-panel__icon{-moz-user-select:none}
55
+ ._xmo1idpf.ak-editor-panel{margin-right:0}
56
+ ._zs6jglyw.ak-editor-panel .ak-editor-panel__icon{-webkit-user-select:none}
57
+ @-moz-document url-prefix(){._udsa1o8l.ak-editor-panel .ak-editor-panel__icon .emoji-common-emoji-image img{display:inline-block}}
@@ -0,0 +1,44 @@
1
+ /* panel-compiled.tsx generated by @compiled/babel-plugin v0.39.1 */
2
+ import _extends from "@babel/runtime/helpers/extends";
3
+ import "./panel-compiled.compiled.css";
4
+ import { ax, ix } from "@compiled/react/runtime";
5
+ /**
6
+ * Compiled branch of the `platform_editor_static_css` experiment.
7
+ * Used via `componentWithCondition` in `panel.tsx`.
8
+ *
9
+ * Cleanup: delete this file once the experiment has shipped.
10
+ */
11
+ import React from 'react';
12
+ import { PanelType } from '@atlaskit/adf-schema';
13
+ import { akEditorCustomIconSize } from '@atlaskit/editor-shared-styles/consts';
14
+ import { hexToEditorBackgroundPaletteColor } from '@atlaskit/editor-palette';
15
+ import { fg } from '@atlaskit/platform-feature-flags';
16
+ // New custom icons are a little smaller than predefined icons.
17
+ // To fix alignment issues with custom icons, vertical alignment is updated.
18
+ const panelEmojiSpriteVerticalAlignment = -(8 * 3 - akEditorCustomIconSize) / 2;
19
+ const panelEmojiImageVerticalAlignment = panelEmojiSpriteVerticalAlignment - 1;
20
+ const blockNodesVerticalMargin = '0.75rem';
21
+ const akEditorTableCellMinWidth = 48;
22
+ const panelBaseStyles = null;
23
+ const panelHasNoIconStyles = null;
24
+ const panelNestedIconStyles = null;
25
+ const nestedPanelStyles = null;
26
+ const panelCustomBackground = null;
27
+ export const PanelStyledCompiled = ({
28
+ backgroundColor,
29
+ children,
30
+ className,
31
+ hasIcon,
32
+ ...props
33
+ }) => {
34
+ const customBackgroundColor = backgroundColor ? hexToEditorBackgroundPaletteColor(backgroundColor) || backgroundColor : undefined;
35
+ return /*#__PURE__*/React.createElement("div", _extends({}, props, {
36
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- intentional: preserve existing PanelSharedCssClassName.prefix class
37
+ className: ax(["_lklzfajl _1alzoqnp _xmo1idpf _u70eidpf _1m1jidpf _50vakb7n _19agidpf _1q6xf1ug _jde2v77o _1bi2v77o _gb1eidpf _11k7idpf _fc9iidpf _1554u2gc _1eiopxbi _1w22u2gc _66ohu2gc _1it3ckbl _19s71txw _18w0h2mm _13n84jg8 _6qwr1hna _ujht1s93 _iqv91kw7 _1l9midpf _1v1c1ejb _11wb1ejb _1oah1ntv _1pciu2gc _1cgk1h6o _5zphglyw _wz94glyw _zs6jglyw _1n3wglyw _1yw1vq3b _1h33yhbg _1a3fnkob _1uvd116y _1hau12gs _7c6pj39m _udsa1o8l _nlelp2ly _18y8qm1h _e5ovn729 _g8a34pcx _1g6dibhp _1udservl _15sp1vk5 _1fe7s4qr _s4ldn729 _gt7x4pcx", !hasIcon && "_1whxutpp _1b0jutpp", props['data-panel-type'] === PanelType.CUSTOM && backgroundColor && "_122m1aok", fg('platform_editor_nested_dnd_styles_changes') && "_9dunutpp _pzbautpp", "_1wvnia51", className]),
38
+ style: {
39
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- intentional: custom panel background is dynamic via CSS variable
40
+ '--ak-renderer-panel-custom-bg-color': customBackgroundColor
41
+ }
42
+ }), children);
43
+ };
44
+ PanelStyledCompiled.displayName = 'PanelStyledCompiled';
@@ -0,0 +1,178 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ /**
3
+ * @jsxRuntime classic
4
+ * @jsx jsx
5
+ */
6
+ /**
7
+ * Emotion branch of the `platform_editor_static_css` experiment.
8
+ * Used via `componentWithCondition` in `panel.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 -- intentional: emotion fallback for compiled migration
15
+ import { css, jsx } from '@emotion/react';
16
+ import { PanelType } from '@atlaskit/adf-schema';
17
+ import { akEditorCustomIconSize } from '@atlaskit/editor-shared-styles/consts';
18
+ import { hexToEditorBackgroundPaletteColor } from '@atlaskit/editor-palette';
19
+ import { fg } from '@atlaskit/platform-feature-flags';
20
+ // New custom icons are a little smaller than predefined icons.
21
+ // To fix alignment issues with custom icons, vertical alignment is updated.
22
+ const panelEmojiSpriteVerticalAlignment = -(8 * 3 - akEditorCustomIconSize) / 2;
23
+ const panelEmojiImageVerticalAlignment = panelEmojiSpriteVerticalAlignment - 1;
24
+ const blockNodesVerticalMargin = '0.75rem';
25
+ const akEditorTableCellMinWidth = 48;
26
+ const panelBaseStyles = css({
27
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
28
+ '&.ak-editor-panel': {
29
+ borderRadius: "var(--ds-radius-small, 3px)",
30
+ margin: `${blockNodesVerticalMargin} 0 0`,
31
+ paddingTop: "var(--ds-space-100, 8px)",
32
+ paddingRight: "var(--ds-space-200, 16px)",
33
+ paddingBottom: "var(--ds-space-100, 8px)",
34
+ paddingLeft: "var(--ds-space-100, 8px)",
35
+ minWidth: `${akEditorTableCellMinWidth}px`,
36
+ display: 'flex',
37
+ position: 'relative',
38
+ alignItems: 'normal',
39
+ wordBreak: 'break-word',
40
+ backgroundColor: "var(--ds-background-accent-blue-subtlest, #E9F2FE)",
41
+ color: 'inherit',
42
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
43
+ '.ak-editor-panel__icon': {
44
+ flexShrink: 0,
45
+ height: "var(--ds-space-300, 24px)",
46
+ width: "var(--ds-space-300, 24px)",
47
+ boxSizing: 'content-box',
48
+ paddingRight: "var(--ds-space-100, 8px)",
49
+ textAlign: 'center',
50
+ userSelect: 'none',
51
+ MozUserSelect: 'none',
52
+ WebkitUserSelect: 'none',
53
+ MsUserSelect: 'none',
54
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
55
+ marginTop: '0.1em',
56
+ color: "var(--ds-icon-information, #357DE8)",
57
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
58
+ '> span': {
59
+ verticalAlign: 'middle',
60
+ display: 'inline-flex'
61
+ },
62
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
63
+ '.emoji-common-emoji-sprite': {
64
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
65
+ verticalAlign: `${panelEmojiSpriteVerticalAlignment}px`
66
+ },
67
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
68
+ '.emoji-common-emoji-image': {
69
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
70
+ verticalAlign: `${panelEmojiImageVerticalAlignment}px`,
71
+ // Vertical align only works for inline-block elements in Firefox
72
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
73
+ '@-moz-document url-prefix()': {
74
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
75
+ img: {
76
+ display: 'inline-block'
77
+ }
78
+ }
79
+ }
80
+ },
81
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
82
+ '.ak-editor-panel__content': {
83
+ margin: `${"var(--ds-space-025, 2px)"} 0 ${"var(--ds-space-025, 2px)"}`,
84
+ flex: '1 0 0',
85
+ minWidth: 0
86
+ },
87
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
88
+ '&[data-panel-type="note"]': {
89
+ backgroundColor: "var(--ds-background-accent-purple-subtlest, #F8EEFE)",
90
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
91
+ '.ak-editor-panel__icon': {
92
+ color: "var(--ds-icon-discovery, #AF59E1)"
93
+ }
94
+ },
95
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
96
+ '&[data-panel-type="tip"]': {
97
+ backgroundColor: "var(--ds-background-accent-green-subtlest, #DCFFF1)",
98
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
99
+ '.ak-editor-panel__icon': {
100
+ color: "var(--ds-icon-success, #6A9A23)"
101
+ }
102
+ },
103
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
104
+ '&[data-panel-type="warning"]': {
105
+ backgroundColor: "var(--ds-background-accent-yellow-subtlest, #FEF7C8)",
106
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
107
+ '.ak-editor-panel__icon': {
108
+ color: "var(--ds-icon-warning, #E06C00)"
109
+ }
110
+ },
111
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
112
+ '&[data-panel-type="error"]': {
113
+ backgroundColor: "var(--ds-background-accent-red-subtlest, #FFECEB)",
114
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
115
+ '.ak-editor-panel__icon': {
116
+ color: "var(--ds-icon-danger, #C9372C)"
117
+ }
118
+ },
119
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
120
+ '&[data-panel-type="success"]': {
121
+ backgroundColor: "var(--ds-background-accent-green-subtlest, #DCFFF1)",
122
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
123
+ '.ak-editor-panel__icon': {
124
+ color: "var(--ds-icon-success, #6A9A23)"
125
+ }
126
+ }
127
+ }
128
+ });
129
+ const panelHasNoIconStyles = css({
130
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
131
+ '&.ak-editor-panel': {
132
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
133
+ '&[data-panel-type="custom"]': {
134
+ paddingLeft: "var(--ds-space-150, 12px)",
135
+ paddingRight: "var(--ds-space-150, 12px)"
136
+ }
137
+ }
138
+ });
139
+ const panelNestedIconStyles = css({
140
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
141
+ '&.ak-editor-panel__no-icon': {
142
+ paddingLeft: "var(--ds-space-150, 12px)",
143
+ paddingRight: "var(--ds-space-150, 12px)"
144
+ }
145
+ });
146
+ const nestedPanelStyles = css({
147
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
148
+ '.ak-editor-panel__content .ak-editor-panel': {
149
+ border: `${"var(--ds-border-width, 1px)"} solid ${"var(--ds-border, #0B120E24)"}`
150
+ }
151
+ });
152
+ const panelCustomBackground = css({
153
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
154
+ '&.ak-editor-panel': {
155
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
156
+ '&[data-panel-type="custom"]': {
157
+ backgroundColor: 'var(--ak-renderer-panel-custom-bg-color)'
158
+ }
159
+ }
160
+ });
161
+ export const PanelStyledEmotion = ({
162
+ backgroundColor,
163
+ hasIcon,
164
+ ...props
165
+ }) => {
166
+ const customBackgroundColor = backgroundColor ? hexToEditorBackgroundPaletteColor(backgroundColor) || backgroundColor : undefined;
167
+ return jsx("div", _extends({
168
+ style:
169
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
170
+ {
171
+ '--ak-renderer-panel-custom-bg-color': customBackgroundColor
172
+ },
173
+ css: [panelBaseStyles, !hasIcon && panelHasNoIconStyles, props['data-panel-type'] === PanelType.CUSTOM && backgroundColor && panelCustomBackground, fg('platform_editor_nested_dnd_styles_changes') && panelNestedIconStyles, nestedPanelStyles]
174
+ // Ignored via go/ees005
175
+ // eslint-disable-next-line react/jsx-props-no-spreading
176
+ }, props), props.children);
177
+ };
178
+ PanelStyledEmotion.displayName = 'PanelStyledEmotion';