@atlaskit/renderer 114.3.0 → 114.3.2

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 (51) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/afm-cc/tsconfig.json +3 -0
  3. package/dist/cjs/react/marks/alignment.js +13 -1
  4. package/dist/cjs/react/nodes/codeBlock/components/codeBlockContainer.js +36 -13
  5. package/dist/cjs/react/nodes/codeBlock/components/lightWeightCodeBlock.js +165 -5
  6. package/dist/cjs/react/nodes/layoutColumn.js +18 -1
  7. package/dist/cjs/react/nodes/media/index.js +75 -32
  8. package/dist/cjs/react/nodes/mediaSingle/index.js +9 -2
  9. package/dist/cjs/react/nodes/multiBodiedExtension.js +83 -4
  10. package/dist/cjs/react/nodes/panel.js +162 -2
  11. package/dist/cjs/react/nodes/table/sticky.js +51 -1
  12. package/dist/cjs/ui/Expand.js +124 -8
  13. package/dist/cjs/ui/Renderer/index.js +1 -1
  14. package/dist/cjs/ui/annotations/draft/component.js +27 -7
  15. package/dist/cjs/ui/annotations/element/mark.js +85 -6
  16. package/dist/es2019/react/marks/alignment.js +13 -1
  17. package/dist/es2019/react/nodes/codeBlock/components/codeBlockContainer.js +69 -13
  18. package/dist/es2019/react/nodes/codeBlock/components/lightWeightCodeBlock.js +194 -4
  19. package/dist/es2019/react/nodes/layoutColumn.js +27 -1
  20. package/dist/es2019/react/nodes/media/index.js +49 -15
  21. package/dist/es2019/react/nodes/mediaSingle/index.js +9 -2
  22. package/dist/es2019/react/nodes/multiBodiedExtension.js +83 -4
  23. package/dist/es2019/react/nodes/panel.js +162 -2
  24. package/dist/es2019/react/nodes/table/sticky.js +64 -1
  25. package/dist/es2019/ui/Expand.js +125 -8
  26. package/dist/es2019/ui/Renderer/index.js +1 -1
  27. package/dist/es2019/ui/annotations/draft/component.js +28 -7
  28. package/dist/es2019/ui/annotations/element/mark.js +96 -6
  29. package/dist/esm/react/marks/alignment.js +13 -1
  30. package/dist/esm/react/nodes/codeBlock/components/codeBlockContainer.js +36 -13
  31. package/dist/esm/react/nodes/codeBlock/components/lightWeightCodeBlock.js +164 -4
  32. package/dist/esm/react/nodes/layoutColumn.js +18 -1
  33. package/dist/esm/react/nodes/media/index.js +75 -32
  34. package/dist/esm/react/nodes/mediaSingle/index.js +9 -2
  35. package/dist/esm/react/nodes/multiBodiedExtension.js +83 -4
  36. package/dist/esm/react/nodes/panel.js +163 -3
  37. package/dist/esm/react/nodes/table/sticky.js +51 -1
  38. package/dist/esm/ui/Expand.js +125 -9
  39. package/dist/esm/ui/Renderer/index.js +1 -1
  40. package/dist/esm/ui/annotations/draft/component.js +28 -7
  41. package/dist/esm/ui/annotations/element/mark.js +85 -7
  42. package/dist/types/react/nodes/codeBlock/components/lightWeightCodeBlock.d.ts +5 -1
  43. package/dist/types/ui/annotations/draft/component.d.ts +0 -4
  44. package/dist/types-ts4.5/react/nodes/codeBlock/components/lightWeightCodeBlock.d.ts +5 -1
  45. package/dist/types-ts4.5/ui/annotations/draft/component.d.ts +0 -4
  46. package/package.json +5 -4
  47. package/dist/cjs/react/nodes/mediaSingle/styles.js +0 -24
  48. package/dist/es2019/react/nodes/mediaSingle/styles.js +0 -18
  49. package/dist/esm/react/nodes/mediaSingle/styles.js +0 -18
  50. package/dist/types/react/nodes/mediaSingle/styles.d.ts +0 -2
  51. package/dist/types-ts4.5/react/nodes/mediaSingle/styles.d.ts +0 -2
@@ -10,7 +10,7 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
10
10
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
11
11
  var _excluded = ["marks", "mediaSingleElement", "isDrafting"],
12
12
  _excluded2 = ["marks", "mediaSingleElement", "isDrafting"];
13
- var _templateObject, _templateObject2;
13
+ var _templateObject;
14
14
  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; }
15
15
  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; }
16
16
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
@@ -43,14 +43,33 @@ import { useInlineCommentsFilter } from '../../../ui/annotations/hooks/use-inlin
43
43
  import { useInlineCommentSubscriberContext } from '../../../ui/annotations/hooks/use-inline-comment-subscriber';
44
44
  import { AnnotationUpdateEvent } from '@atlaskit/editor-common/types';
45
45
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
46
- // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
47
- var linkStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\tposition: absolute;\n\tbackground: transparent;\n\ttop: 0;\n\tright: 0;\n\tbottom: 0;\n\tleft: 0;\n\tcursor: pointer;\n\twidth: 100% !important;\n\theight: 100% !important;\n"])));
46
+ import { componentWithFG } from '@atlaskit/platform-feature-flags-react';
47
+ var linkStyle = css({
48
+ position: 'absolute',
49
+ background: 'transparent',
50
+ top: 0,
51
+ right: 0,
52
+ bottom: 0,
53
+ left: 0,
54
+ cursor: 'pointer',
55
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
56
+ width: '100% !important',
57
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
58
+ height: '100% !important'
59
+ });
48
60
 
49
61
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Ignored via go/DSP-18766
50
- var borderStyle = function borderStyle(color, width) {
51
- return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n\tposition: absolute;\n\twidth: 100% !important;\n\theight: 100% !important;\n\tborder-radius: ", "px;\n\tbox-shadow: 0 0 0 ", "px ", ";\n"])), width, width, color);
62
+ var borderStyleOld = function borderStyleOld(color, width) {
63
+ return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\tposition: absolute;\n\twidth: 100% !important;\n\theight: 100% !important;\n\tborder-radius: ", "px;\n\tbox-shadow: 0 0 0 ", "px ", ";\n"])), width, width, color);
52
64
  };
53
- var MediaBorder = function MediaBorder(_ref) {
65
+ var borderStyleNew = css({
66
+ position: 'absolute',
67
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
68
+ width: '100% !important',
69
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
70
+ height: '100% !important'
71
+ });
72
+ var MediaBorderOld = function MediaBorderOld(_ref) {
54
73
  var _mark$attrs$color, _mark$attrs$size;
55
74
  var mark = _ref.mark,
56
75
  children = _ref.children;
@@ -66,15 +85,39 @@ var MediaBorder = function MediaBorder(_ref) {
66
85
  "data-size": borderWidth
67
86
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
68
87
  ,
69
- css: borderStyle(paletteColorValue, borderWidth)
88
+ css: borderStyleOld(paletteColorValue, borderWidth)
70
89
  }, jsx(MediaBorderGapFiller, {
71
90
  borderColor: borderColor
72
91
  }), children);
73
92
  };
74
- var MediaLink = function MediaLink(_ref2) {
93
+ var MediaBorderNew = function MediaBorderNew(_ref2) {
94
+ var _mark$attrs$color2, _mark$attrs$size2;
75
95
  var mark = _ref2.mark,
76
- children = _ref2.children,
77
- onClick = _ref2.onClick;
96
+ children = _ref2.children;
97
+ if (!mark) {
98
+ return jsx(Fragment, null, children);
99
+ }
100
+ var borderColor = (_mark$attrs$color2 = mark === null || mark === void 0 ? void 0 : mark.attrs.color) !== null && _mark$attrs$color2 !== void 0 ? _mark$attrs$color2 : '';
101
+ var borderWidth = (_mark$attrs$size2 = mark === null || mark === void 0 ? void 0 : mark.attrs.size) !== null && _mark$attrs$size2 !== void 0 ? _mark$attrs$size2 : 0;
102
+ var paletteColorValue = hexToEditorBorderPaletteColor(borderColor) || borderColor;
103
+ return jsx("div", {
104
+ "data-mark-type": "border",
105
+ "data-color": borderColor,
106
+ "data-size": borderWidth,
107
+ css: borderStyleNew,
108
+ style: {
109
+ borderRadius: "".concat(borderWidth, "px"),
110
+ boxShadow: "0 0 0 ".concat(borderWidth, "px ").concat(paletteColorValue)
111
+ }
112
+ }, jsx(MediaBorderGapFiller, {
113
+ borderColor: borderColor
114
+ }), children);
115
+ };
116
+ var MediaBorder = componentWithFG('platform_editor_emotion_refactor_renderer', MediaBorderNew, MediaBorderOld);
117
+ var MediaLink = function MediaLink(_ref3) {
118
+ var mark = _ref3.mark,
119
+ children = _ref3.children,
120
+ onClick = _ref3.onClick;
78
121
  if (!mark) {
79
122
  return jsx(Fragment, null, children);
80
123
  }
@@ -87,9 +130,9 @@ var MediaLink = function MediaLink(_ref2) {
87
130
  css: linkStyle
88
131
  }, children);
89
132
  };
90
- var MediaAnnotation = function MediaAnnotation(_ref3) {
91
- var mark = _ref3.mark,
92
- children = _ref3.children;
133
+ var MediaAnnotation = function MediaAnnotation(_ref4) {
134
+ var mark = _ref4.mark,
135
+ children = _ref4.children;
93
136
  if (!mark) {
94
137
  return jsx(Fragment, null, children);
95
138
  }
@@ -107,10 +150,10 @@ var MediaAnnotation = function MediaAnnotation(_ref3) {
107
150
  useBlockLevel: true
108
151
  }, children);
109
152
  };
110
- var _MediaAnnotations = function MediaAnnotations(_ref4) {
111
- var _ref4$marks = _ref4.marks,
112
- marks = _ref4$marks === void 0 ? [] : _ref4$marks,
113
- children = _ref4.children;
153
+ var _MediaAnnotations = function MediaAnnotations(_ref5) {
154
+ var _ref5$marks = _ref5.marks,
155
+ marks = _ref5$marks === void 0 ? [] : _ref5$marks,
156
+ children = _ref5.children;
114
157
  // Early Exit
115
158
  if (marks.length === 0) {
116
159
  return jsx(Fragment, null, children);
@@ -127,13 +170,13 @@ var _MediaAnnotations = function MediaAnnotations(_ref4) {
127
170
  }, children) : jsx(Fragment, null, children)));
128
171
  };
129
172
  var CommentBadge = injectIntl(CommentBadgeComponent);
130
- var CommentBadgeWrapper = function CommentBadgeWrapper(_ref5) {
173
+ var CommentBadgeWrapper = function CommentBadgeWrapper(_ref6) {
131
174
  var _marks$map;
132
- var marks = _ref5.marks,
133
- mediaSingleElement = _ref5.mediaSingleElement,
134
- _ref5$isDrafting = _ref5.isDrafting,
135
- isDrafting = _ref5$isDrafting === void 0 ? false : _ref5$isDrafting,
136
- rest = _objectWithoutProperties(_ref5, _excluded);
175
+ var marks = _ref6.marks,
176
+ mediaSingleElement = _ref6.mediaSingleElement,
177
+ _ref6$isDrafting = _ref6.isDrafting,
178
+ isDrafting = _ref6$isDrafting === void 0 ? false : _ref6$isDrafting,
179
+ rest = _objectWithoutProperties(_ref6, _excluded);
137
180
  var _useState = useState('default'),
138
181
  _useState2 = _slicedToArray(_useState, 2),
139
182
  status = _useState2[0],
@@ -210,13 +253,13 @@ var CommentBadgeWrapper = function CommentBadgeWrapper(_ref5) {
210
253
  * when clean up platform_editor_add_media_from_url feature flag
211
254
  */
212
255
 
213
- var CommentBadgeNextWrapper = function CommentBadgeNextWrapper(_ref6) {
256
+ var CommentBadgeNextWrapper = function CommentBadgeNextWrapper(_ref7) {
214
257
  var _marks$map2;
215
- var marks = _ref6.marks,
216
- mediaSingleElement = _ref6.mediaSingleElement,
217
- _ref6$isDrafting = _ref6.isDrafting,
218
- isDrafting = _ref6$isDrafting === void 0 ? false : _ref6$isDrafting,
219
- rest = _objectWithoutProperties(_ref6, _excluded2);
258
+ var marks = _ref7.marks,
259
+ mediaSingleElement = _ref7.mediaSingleElement,
260
+ _ref7$isDrafting = _ref7.isDrafting,
261
+ isDrafting = _ref7$isDrafting === void 0 ? false : _ref7$isDrafting,
262
+ rest = _objectWithoutProperties(_ref7, _excluded2);
220
263
  var _useState5 = useState('default'),
221
264
  _useState6 = _slicedToArray(_useState5, 2),
222
265
  status = _useState6[0],
@@ -336,9 +379,9 @@ var Media = /*#__PURE__*/function (_PureComponent) {
336
379
  mediaWidth: width,
337
380
  mediaHeight: height,
338
381
  useMinimumZIndex: true
339
- }, function (_ref8) {
340
- var badgeSize = _ref8.badgeSize,
341
- visible = _ref8.visible;
382
+ }, function (_ref9) {
383
+ var badgeSize = _ref9.badgeSize,
384
+ visible = _ref9.visible;
342
385
  return jsx(React.Fragment, null, fg('platform_editor_hide_external_media_badge') ? visible && jsx(ExternalImageBadge, {
343
386
  badgeSize: badgeSize,
344
387
  type: _this.props.type,
@@ -7,16 +7,23 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
7
7
 
8
8
  import { default as React, Fragment, useCallback, useContext, useMemo, useEffect } from 'react';
9
9
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
10
- import { jsx } from '@emotion/react';
10
+ import { css, jsx } from '@emotion/react';
11
11
  import { injectIntl } from 'react-intl-next';
12
12
  import { MediaSingle as UIMediaSingle, WidthContext } from '@atlaskit/editor-common/ui';
13
13
  import { akEditorFullWidthLayoutWidth, akEditorDefaultLayoutWidth, akEditorWideLayoutWidth } from '@atlaskit/editor-shared-styles';
14
14
  import { FullPagePadding } from '../../../ui/Renderer/style';
15
- import { uiMediaSingleBaseStyles, uiMediaSingleLayoutStyles } from './styles';
16
15
  import { useAnnotationRangeDispatch } from '../../../ui/annotations/contexts/AnnotationRangeContext';
17
16
  import { useAnnotationHoverDispatch } from '../../../ui/annotations/contexts/AnnotationHoverContext';
18
17
  var DEFAULT_WIDTH = 250;
19
18
  var DEFAULT_HEIGHT = 200;
19
+ var uiMediaSingleBaseStyles = css({
20
+ transition: 'all 0.1s linear'
21
+ });
22
+ var uiMediaSingleLayoutStyles = css({
23
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
24
+ marginLeft: '50%',
25
+ transform: 'translateX(-50%)'
26
+ });
20
27
  var isMediaElement = function isMediaElement(media) {
21
28
  if (!media) {
22
29
  return false;
@@ -18,11 +18,90 @@ import { RendererCssClassName } from '../../consts';
18
18
  import { calcBreakoutWidth } from '@atlaskit/editor-common/utils';
19
19
  import { useMultiBodiedExtensionActions } from './multiBodiedExtension/actions';
20
20
  import { useMultiBodiedExtensionContext } from './multiBodiedExtension/context';
21
+ import { fg } from '@atlaskit/platform-feature-flags';
21
22
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Ignored via go/DSP-18766
22
- var navigationStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\t", ";\n\tmargin-left: 0 !important;\n\tmargin-right: 0 !important;\n\t.mbe-add-tab-button,\n\t.mbe-remove-tab {\n\t\tdisplay: none;\n\t}\n"])), sharedMultiBodiedExtensionStyles.mbeNavigation);
23
+ var navigationStylesOld = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\t", ";\n\tmargin-left: 0 !important;\n\tmargin-right: 0 !important;\n\t.mbe-add-tab-button,\n\t.mbe-remove-tab {\n\t\tdisplay: none;\n\t}\n"])), sharedMultiBodiedExtensionStyles.mbeNavigation);
23
24
 
25
+ // localized sharedMultiBodiedExtensionStyles.mbeNavigation in navigationCssExtendedNew
26
+ var navigationStylesNew = css({
27
+ borderTopLeftRadius: "var(--ds-border-radius, 3px)",
28
+ borderTopRightRadius: "var(--ds-border-radius, 3px)",
29
+ userSelect: 'none',
30
+ WebkitUserModify: 'read-only',
31
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
32
+ borderBottom: 'none !important',
33
+ background: "var(--ds-surface, white)",
34
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
35
+ '&.remove-margins': {
36
+ margin: "var(--ds-space-negative-100, -8px)"
37
+ },
38
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
39
+ '&.remove-border': {
40
+ border: 'none'
41
+ },
42
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
43
+ marginLeft: '0 !important',
44
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
45
+ marginRight: '0 !important',
46
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
47
+ '.mbe-add-tab-button, .mbe-remove-tab': {
48
+ display: 'none'
49
+ }
50
+ });
51
+
52
+ // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
53
+ var containerStylesOld = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n\t", ";\n\t.ak-renderer-extension {\n\t\tmargin-top: 0 !important;\n\t}\n\n\t[data-layout='full-width'],\n\t[data-layout='wide'] {\n\t\t.multiBodiedExtension-navigation {\n\t\t\tborder-right: 3px solid ", " !important;\n\t\t}\n\t}\n"])), sharedMultiBodiedExtensionStyles.mbeExtensionContainer, "var(--ds-border, ".concat(N40, ")"));
54
+
55
+ // localized sharedMultiBodiedExtensionStyles.mbeExtensionContainer in containerStylesNew
24
56
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
25
- var containerStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n\t", ";\n\t.ak-renderer-extension {\n\t\tmargin-top: 0 !important;\n\t}\n\n\t[data-layout='full-width'],\n\t[data-layout='wide'] {\n\t\t.multiBodiedExtension-navigation {\n\t\t\tborder-right: 3px solid ", " !important;\n\t\t}\n\t}\n"])), sharedMultiBodiedExtensionStyles.mbeExtensionContainer, "var(--ds-border, ".concat(N40, ")"));
57
+ var containerStylesNew = css({
58
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
59
+ background: 'transparent !important',
60
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
61
+ 'padding:': {
62
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
63
+ left: "var(--ds-space-100, 8px)".concat(" !important"),
64
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
65
+ right: "var(--ds-space-100, 8px)".concat(" !important")
66
+ },
67
+ paddingBottom: "var(--ds-space-100, 8px)",
68
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
69
+ '&.remove-padding': {
70
+ paddingBottom: 0
71
+ },
72
+ position: 'relative',
73
+ verticalAlign: 'middle',
74
+ cursor: 'pointer',
75
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
76
+ '.multiBodiedExtension-handler-result': {
77
+ marginLeft: "var(--ds-space-100, 8px)"
78
+ },
79
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
80
+ ".multiBodiedExtension-content-dom-wrapper > [data-extension-frame='true'], .multiBodiedExtension--frames > [data-extension-frame='true']": {
81
+ display: 'none',
82
+ background: "var(--ds-surface, white)"
83
+ },
84
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
85
+ '.multiBodiedExtension-content-dom-wrapper, .multiBodiedExtension--frames': {
86
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
87
+ "[data-extension-frame='true'] > :not(style):first-child, [data-extension-frame='true'] > style:first-child + *": {
88
+ marginTop: 0
89
+ }
90
+ },
91
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
92
+ '.ak-renderer-extension': {
93
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
94
+ marginTop: '0 !important'
95
+ },
96
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
97
+ '[data-layout="full-width"], [data-layout="wide"]': {
98
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
99
+ '.multiBodiedExtension-navigation': {
100
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
101
+ borderRight: "3px solid ".concat("var(--ds-border, ".concat(N40, ")"), " !important")
102
+ }
103
+ }
104
+ });
26
105
  var MultiBodiedExtensionChildrenContainer = function MultiBodiedExtensionChildrenContainer(_ref) {
27
106
  var children = _ref.children;
28
107
  return jsx("article", {
@@ -37,7 +116,7 @@ var MultiBodiedExtensionNavigation = function MultiBodiedExtensionNavigation(_re
37
116
  return jsx("nav", {
38
117
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
39
118
  className: "multiBodiedExtension-navigation",
40
- css: navigationStyles,
119
+ css: fg('platform_editor_emotion_refactor_renderer') ? navigationStylesNew : navigationStylesOld,
41
120
  "data-testid": "multiBodiedExtension-navigation"
42
121
  }, children);
43
122
  };
@@ -141,7 +220,7 @@ var MultiBodiedExtension = function MultiBodiedExtension(props) {
141
220
  return jsx("section", {
142
221
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
143
222
  className: "multiBodiedExtension--container",
144
- css: [containerStyles, containerActiveFrameStyles],
223
+ css: [fg('platform_editor_emotion_refactor_renderer') ? containerStylesNew : containerStylesOld, containerActiveFrameStyles],
145
224
  "data-testid": "multiBodiedExtension--container",
146
225
  "data-active-child-index": activeChildIndex,
147
226
  "data-layout": layout
@@ -2,7 +2,8 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
4
  var _templateObject, _templateObject2;
5
- var _excluded = ["backgroundColor", "hasIcon"];
5
+ var _excluded = ["backgroundColor", "hasIcon"],
6
+ _excluded2 = ["backgroundColor", "hasIcon"];
6
7
  /**
7
8
  * @jsxRuntime classic
8
9
  * @jsx jsx
@@ -12,13 +13,155 @@ import React from 'react';
12
13
  import { css, jsx } from '@emotion/react';
13
14
  import TipIcon from '@atlaskit/icon/glyph/editor/hint';
14
15
  import { PanelType } from '@atlaskit/adf-schema';
15
- import { panelSharedStylesWithoutPrefix, PanelSharedCssClassName } from '@atlaskit/editor-common/panel';
16
+ import { PanelSharedCssClassName, panelSharedStylesWithoutPrefix } from '@atlaskit/editor-common/panel';
16
17
  import { hexToEditorBackgroundPaletteColor } from '@atlaskit/editor-palette';
17
18
  import EmojiIcon from '@atlaskit/icon/glyph/editor/emoji';
18
19
  import { fg } from '@atlaskit/platform-feature-flags';
19
20
  import EmojiItem from './emoji';
20
21
  import { PanelInfoIcon, PanelSuccessIcon, PanelNoteIcon, PanelWarningIcon, PanelErrorIcon } from '@atlaskit/editor-common/icons';
21
- var PanelStyled = function PanelStyled(_ref) {
22
+ import { akEditorCustomIconSize } from '@atlaskit/editor-shared-styles/consts';
23
+ import { componentWithFG } from '@atlaskit/platform-feature-flags-react';
24
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
25
+ // New custom icons are a little smaller than predefined icons.
26
+ // To fix alignment issues with custom icons, vertical alignment is updated.
27
+ var panelEmojiSpriteVerticalAlignment = -(8 * 3 - akEditorCustomIconSize) / 2;
28
+ var panelEmojiImageVerticalAlignment = panelEmojiSpriteVerticalAlignment - 1;
29
+ var blockNodesVerticalMargin = '0.75rem';
30
+ var akEditorTableCellMinWidth = 48;
31
+ var panelBaseStyles = css({
32
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
33
+ '&.ak-editor-panel': {
34
+ borderRadius: "var(--ds-border-radius, 3px)",
35
+ margin: "".concat(blockNodesVerticalMargin, " 0 0"),
36
+ paddingTop: "var(--ds-space-100, 8px)",
37
+ paddingRight: "var(--ds-space-200, 16px)",
38
+ paddingBottom: "var(--ds-space-100, 8px)",
39
+ paddingLeft: "var(--ds-space-100, 8px)",
40
+ minWidth: "".concat(akEditorTableCellMinWidth, "px"),
41
+ display: 'flex',
42
+ position: 'relative',
43
+ alignItems: 'normal',
44
+ wordBreak: 'break-word',
45
+ backgroundColor: "var(--ds-background-accent-blue-subtlest, #DEEBFF)",
46
+ color: 'inherit',
47
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
48
+ '.ak-editor-panel__icon': {
49
+ flexShrink: 0,
50
+ height: "var(--ds-space-300, 24px)",
51
+ width: "var(--ds-space-300, 24px)",
52
+ boxSizing: 'content-box',
53
+ paddingRight: "var(--ds-space-100, 8px)",
54
+ textAlign: 'center',
55
+ userSelect: 'none',
56
+ MozUserSelect: 'none',
57
+ WebkitUserSelect: 'none',
58
+ MsUserSelect: 'none',
59
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-space
60
+ marginTop: '0.1em',
61
+ color: "var(--ds-icon-information, #1D7AFC)",
62
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
63
+ '> span': {
64
+ verticalAlign: 'middle',
65
+ display: 'inline-flex'
66
+ },
67
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
68
+ '.emoji-common-emoji-sprite': {
69
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
70
+ verticalAlign: "".concat(panelEmojiSpriteVerticalAlignment, "px")
71
+ },
72
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
73
+ '.emoji-common-emoji-image': {
74
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
75
+ verticalAlign: "".concat(panelEmojiImageVerticalAlignment, "px"),
76
+ // Vertical align only works for inline-block elements in Firefox
77
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors
78
+ '@-moz-document url-prefix()': {
79
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
80
+ img: {
81
+ display: 'inline-block'
82
+ }
83
+ }
84
+ }
85
+ },
86
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
87
+ '.ak-editor-panel__content': {
88
+ margin: "var(--ds-space-025, 2px)".concat(" 0 ", "var(--ds-space-025, 2px)"),
89
+ flex: '1 0 0',
90
+ /*
91
+ https://ishadeed.com/article/min-max-css/#setting-min-width-to-zero-with-flexbox
92
+ The default value for min-width is auto, which is computed to zero. When an element is a flex item, the value of min-width doesn’t compute to zero. The minimum size of a flex item is equal to the size of its contents.
93
+ */
94
+ minWidth: 0
95
+ },
96
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
97
+ '&[data-panel-type="note"]': {
98
+ backgroundColor: "var(--ds-background-accent-purple-subtlest, #EAE6FF)",
99
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
100
+ '.ak-editor-panel__icon': {
101
+ color: "var(--ds-icon-discovery, #8270DB)"
102
+ }
103
+ },
104
+ // 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
105
+ '&[data-panel-type="tip"]': {
106
+ backgroundColor: "var(--ds-background-accent-green-subtlest, #E3FCEF)",
107
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
108
+ '.ak-editor-panel__icon': {
109
+ color: "var(--ds-icon-success, #22A06B)"
110
+ }
111
+ },
112
+ // 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
113
+ '&[data-panel-type="warning"]': {
114
+ backgroundColor: "var(--ds-background-accent-yellow-subtlest, #FFFAE6)",
115
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
116
+ '.ak-editor-panel__icon': {
117
+ color: "var(--ds-icon-warning, #E56910)"
118
+ }
119
+ },
120
+ // 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
121
+ '&[data-panel-type="error"]': {
122
+ backgroundColor: "var(--ds-background-accent-red-subtlest, #FFEBE6)",
123
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
124
+ '.ak-editor-panel__icon': {
125
+ color: "var(--ds-icon-danger, #C9372C)"
126
+ }
127
+ },
128
+ // 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
129
+ '&[data-panel-type="success"]': {
130
+ backgroundColor: "var(--ds-background-accent-green-subtlest, #E3FCEF)",
131
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
132
+ '.ak-editor-panel__icon': {
133
+ color: "var(--ds-icon-success, #22A06B)"
134
+ }
135
+ }
136
+ }
137
+ });
138
+ var panelHasNoIconStyles = css({
139
+ // 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
140
+ '&.ak-editor-panel': {
141
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
142
+ '&[data-panel-type="custom"]': {
143
+ paddingLeft: "var(--ds-space-150, 12px)",
144
+ paddingRight: "var(--ds-space-150, 12px)"
145
+ }
146
+ }
147
+ });
148
+ var panelNestedIconStyles = css({
149
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
150
+ '&.ak-editor-panel__no-icon': {
151
+ paddingLeft: "var(--ds-space-150, 12px)",
152
+ paddingRight: "var(--ds-space-150, 12px)"
153
+ }
154
+ });
155
+ var panelCustomBackground = css({
156
+ // 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
157
+ '&.ak-editor-panel': {
158
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
159
+ '&[data-panel-type="custom"]': {
160
+ backgroundColor: 'var(--ak-renderer-panel-custom-bg-color)'
161
+ }
162
+ }
163
+ });
164
+ var PanelStyledOld = function PanelStyledOld(_ref) {
22
165
  var backgroundColor = _ref.backgroundColor,
23
166
  hasIcon = _ref.hasIcon,
24
167
  props = _objectWithoutProperties(_ref, _excluded);
@@ -37,6 +180,23 @@ var PanelStyled = function PanelStyled(_ref) {
37
180
  }, props), props.children)
38
181
  );
39
182
  };
183
+ var PanelStyledNew = function PanelStyledNew(_ref2) {
184
+ var backgroundColor = _ref2.backgroundColor,
185
+ hasIcon = _ref2.hasIcon,
186
+ props = _objectWithoutProperties(_ref2, _excluded2);
187
+ var customBackgroundColor = backgroundColor ? hexToEditorBackgroundPaletteColor(backgroundColor) : backgroundColor;
188
+ return jsx("div", _extends({
189
+ style:
190
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
191
+ {
192
+ '--ak-renderer-panel-custom-bg-color': customBackgroundColor
193
+ },
194
+ css: [panelBaseStyles, !hasIcon && panelHasNoIconStyles, props['data-panel-type'] === PanelType.CUSTOM && backgroundColor && panelCustomBackground, editorExperiment('nested-dnd', true) && panelNestedIconStyles]
195
+ // Ignored via go/ees005
196
+ // eslint-disable-next-line react/jsx-props-no-spreading
197
+ }, props), props.children);
198
+ };
199
+ var PanelStyled = componentWithFG('platform_editor_emotion_refactor_renderer', PanelStyledNew, PanelStyledOld);
40
200
  PanelStyled.displayName = 'PanelStyled';
41
201
  var panelIcons = {
42
202
  info: PanelInfoIcon,
@@ -16,6 +16,7 @@ import { akEditorStickyHeaderZIndex } from '@atlaskit/editor-shared-styles';
16
16
  import { N40A } from '@atlaskit/theme/colors';
17
17
  import { Table } from './table';
18
18
  import { recursivelyInjectProps } from '../../utils/inject-props';
19
+ import { componentWithFG } from '@atlaskit/platform-feature-flags-react';
19
20
  export var tableStickyPadding = 8;
20
21
  var modeSpecficStyles = {
21
22
  none: css({
@@ -29,6 +30,27 @@ var modeSpecficStyles = {
29
30
  })
30
31
  };
31
32
 
33
+ // refactored based on fixedTableDivStaticStyles
34
+ // TODO: DSP-4123 - Quality ticket
35
+ var fixedTableDivStaticStylesNew = css(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
36
+ zIndex: 'var(--ak-renderer-sticky-header-zindex)'
37
+ }, "& .".concat(TableSharedCssClassName.TABLE_CONTAINER, ", & .").concat(TableSharedCssClassName.TABLE_STICKY_WRAPPER, " > table"), {
38
+ marginTop: 0,
39
+ marginBottom: 0,
40
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
41
+ tr: {
42
+ background: "var(--ds-surface, white)"
43
+ }
44
+ }), "borderTop", "".concat(tableStickyPadding, "px solid ", "var(--ds-surface, white)")), "background", "var(--ds-surface-overlay, white)"), "boxShadow", "0 6px 4px -4px ".concat("var(--ds-shadow-overflow-perimeter, ".concat(N40A, ")"))), "div[data-expanded='false'] &", {
45
+ display: 'none'
46
+ }), "& .".concat(TableSharedCssClassName.TABLE_CONTAINER, ".is-sticky.right-shadow::after, & .").concat(TableSharedCssClassName.TABLE_CONTAINER, ".is-sticky.left-shadow::before"), {
47
+ top: '0px',
48
+ height: '100%'
49
+ }), "&.fixed-table-div-custom-table-resizing[mode='stick']", {
50
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
51
+ zIndex: 'var(--ak-renderer-sticky-header-zindex)'
52
+ }));
53
+
32
54
  // TODO: DSP-4123 - Quality ticket
33
55
  var fixedTableDivStaticStyles = function fixedTableDivStaticStyles(top, width, allowTableResizing) {
34
56
  var stickyHeaderZIndex;
@@ -61,7 +83,7 @@ var fixedTableDivStaticStyles = function fixedTableDivStaticStyles(top, width, a
61
83
  zIndex: stickyHeaderZIndex
62
84
  }));
63
85
  };
64
- var FixedTableDiv = function FixedTableDiv(props) {
86
+ var FixedTableDivOld = function FixedTableDivOld(props) {
65
87
  var top = props.top,
66
88
  wrapperWidth = props.wrapperWidth,
67
89
  mode = props.mode,
@@ -80,6 +102,34 @@ var FixedTableDiv = function FixedTableDiv(props) {
80
102
  css: fixedTableCss
81
103
  }), props.children);
82
104
  };
105
+ var FixedTableDivNew = function FixedTableDivNew(props) {
106
+ var top = props.top,
107
+ wrapperWidth = props.wrapperWidth,
108
+ mode = props.mode,
109
+ allowTableResizing = props.allowTableResizing;
110
+ var stickyHeaderZIndex;
111
+ if (allowTableResizing) {
112
+ stickyHeaderZIndex = 13;
113
+ } else {
114
+ stickyHeaderZIndex = akEditorStickyHeaderZIndex;
115
+ }
116
+ var attrs = {
117
+ mode: mode
118
+ };
119
+ return jsx("div", _extends({}, attrs, {
120
+ "data-testid": "sticky-table-fixed"
121
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
122
+ ,
123
+ className: allowTableResizing ? 'fixed-table-div-custom-table-resizing' : '',
124
+ css: [fixedTableDivStaticStylesNew, modeSpecficStyles === null || modeSpecficStyles === void 0 ? void 0 : modeSpecficStyles[mode]],
125
+ style: {
126
+ '--ak-renderer-sticky-header-zindex': stickyHeaderZIndex,
127
+ width: "".concat(wrapperWidth, "px"),
128
+ top: top ? "".concat(top, "px") : undefined
129
+ }
130
+ }), props.children);
131
+ };
132
+ var FixedTableDiv = componentWithFG('platform_editor_emotion_refactor_renderer', FixedTableDivNew, FixedTableDivOld);
83
133
  export var StickyTable = function StickyTable(_ref) {
84
134
  var top = _ref.top,
85
135
  left = _ref.left,