@atlaskit/renderer 114.11.1 → 114.12.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 (72) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/afm-cc/tsconfig.json +3 -0
  3. package/dist/cjs/react/marks/alignment.js +3 -15
  4. package/dist/cjs/react/nodes/blockCard.js +24 -8
  5. package/dist/cjs/react/nodes/codeBlock/components/codeBlockContainer.js +3 -10
  6. package/dist/cjs/react/nodes/codeBlock/components/lightWeightCodeBlock.js +8 -53
  7. package/dist/cjs/react/nodes/layoutColumn.js +3 -11
  8. package/dist/cjs/react/nodes/media/index.js +28 -58
  9. package/dist/cjs/react/nodes/panel.js +2 -26
  10. package/dist/cjs/react/nodes/table/colgroup.js +5 -2
  11. package/dist/cjs/react/nodes/table/sticky.js +3 -57
  12. package/dist/cjs/react/nodes/table/table.js +6 -1
  13. package/dist/cjs/react/nodes/table.js +51 -23
  14. package/dist/cjs/react/nodes/tableNew.js +550 -0
  15. package/dist/cjs/ui/Expand.js +12 -62
  16. package/dist/cjs/ui/Renderer/RendererStyleContainer.js +19 -42
  17. package/dist/cjs/ui/Renderer/breakout-ssr.js +22 -22
  18. package/dist/cjs/ui/Renderer/index.js +4 -2
  19. package/dist/cjs/ui/Renderer/style.js +2 -208
  20. package/dist/cjs/ui/annotations/draft/component.js +2 -17
  21. package/dist/cjs/ui/annotations/element/mark.js +12 -61
  22. package/dist/es2019/react/marks/alignment.js +2 -17
  23. package/dist/es2019/react/nodes/blockCard.js +24 -8
  24. package/dist/es2019/react/nodes/codeBlock/components/codeBlockContainer.js +2 -39
  25. package/dist/es2019/react/nodes/codeBlock/components/lightWeightCodeBlock.js +5 -50
  26. package/dist/es2019/react/nodes/layoutColumn.js +4 -12
  27. package/dist/es2019/react/nodes/media/index.js +3 -36
  28. package/dist/es2019/react/nodes/panel.js +2 -41
  29. package/dist/es2019/react/nodes/table/colgroup.js +5 -2
  30. package/dist/es2019/react/nodes/table/sticky.js +3 -70
  31. package/dist/es2019/react/nodes/table/table.js +6 -1
  32. package/dist/es2019/react/nodes/table.js +50 -22
  33. package/dist/es2019/react/nodes/tableNew.js +501 -0
  34. package/dist/es2019/ui/Expand.js +11 -67
  35. package/dist/es2019/ui/Renderer/RendererStyleContainer.js +20 -43
  36. package/dist/es2019/ui/Renderer/breakout-ssr.js +22 -22
  37. package/dist/es2019/ui/Renderer/index.js +4 -2
  38. package/dist/es2019/ui/Renderer/style.js +1 -889
  39. package/dist/es2019/ui/annotations/draft/component.js +2 -15
  40. package/dist/es2019/ui/annotations/element/mark.js +9 -71
  41. package/dist/esm/react/marks/alignment.js +2 -16
  42. package/dist/esm/react/nodes/blockCard.js +24 -8
  43. package/dist/esm/react/nodes/codeBlock/components/codeBlockContainer.js +2 -11
  44. package/dist/esm/react/nodes/codeBlock/components/lightWeightCodeBlock.js +7 -52
  45. package/dist/esm/react/nodes/layoutColumn.js +4 -12
  46. package/dist/esm/react/nodes/media/index.js +28 -58
  47. package/dist/esm/react/nodes/panel.js +3 -27
  48. package/dist/esm/react/nodes/table/colgroup.js +5 -2
  49. package/dist/esm/react/nodes/table/sticky.js +3 -57
  50. package/dist/esm/react/nodes/table/table.js +6 -1
  51. package/dist/esm/react/nodes/table.js +51 -21
  52. package/dist/esm/react/nodes/tableNew.js +544 -0
  53. package/dist/esm/ui/Expand.js +12 -62
  54. package/dist/esm/ui/Renderer/RendererStyleContainer.js +20 -43
  55. package/dist/esm/ui/Renderer/breakout-ssr.js +22 -22
  56. package/dist/esm/ui/Renderer/index.js +4 -2
  57. package/dist/esm/ui/Renderer/style.js +1 -203
  58. package/dist/esm/ui/annotations/draft/component.js +2 -17
  59. package/dist/esm/ui/annotations/element/mark.js +9 -56
  60. package/dist/types/react/nodes/codeBlock/components/lightWeightCodeBlock.d.ts +1 -1
  61. package/dist/types/react/nodes/table.d.ts +35 -254
  62. package/dist/types/react/nodes/tableNew.d.ts +83 -0
  63. package/dist/types/ui/Renderer/breakout-ssr.d.ts +1 -2
  64. package/dist/types/ui/Renderer/style.d.ts +0 -11
  65. package/dist/types/ui/annotations/element/mark.d.ts +30 -6
  66. package/dist/types-ts4.5/react/nodes/codeBlock/components/lightWeightCodeBlock.d.ts +1 -1
  67. package/dist/types-ts4.5/react/nodes/table.d.ts +35 -254
  68. package/dist/types-ts4.5/react/nodes/tableNew.d.ts +83 -0
  69. package/dist/types-ts4.5/ui/Renderer/breakout-ssr.d.ts +1 -2
  70. package/dist/types-ts4.5/ui/Renderer/style.d.ts +0 -11
  71. package/dist/types-ts4.5/ui/annotations/element/mark.d.ts +30 -6
  72. package/package.json +14 -7
@@ -12,24 +12,11 @@ import { AnnotationsDraftContext } from '../context';
12
12
  import { splitText, calcTextSplitOffset, findTextString } from './text';
13
13
  import { calcInsertDraftPositionOnText } from './position';
14
14
  import { dataAttributes } from './dom';
15
- import { AnnotationSharedCSSByState } from '@atlaskit/editor-common/styles';
16
15
  import { segmentText } from '../../../react/utils/segment-text';
17
16
  import { renderTextSegments } from '../../../react/utils/render-text-segments';
18
- import { fg } from '@atlaskit/platform-feature-flags';
19
-
20
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
21
- const markStyles = () => css({
22
- color: 'inherit',
23
- backgroundColor: 'unset',
24
- WebkitTapHighlightColor: 'transparent'
25
- },
26
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
27
- AnnotationSharedCSSByState().common,
28
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
29
- AnnotationSharedCSSByState().focus);
30
17
 
31
18
  // Localized AnnotationSharedCSSByState().common and AnnotationSharedCSSByState().focus
32
- const markStylesNew = css({
19
+ const markStyles = css({
33
20
  color: 'inherit',
34
21
  backgroundColor: 'unset',
35
22
  WebkitTapHighlightColor: 'transparent',
@@ -57,7 +44,7 @@ export const AnnotationDraft = ({
57
44
  // Ignored via go/ees005
58
45
  // eslint-disable-next-line react/jsx-props-no-spreading
59
46
  }, dataAttributes(draftPosition), {
60
- css: fg('platform_editor_emotion_refactor_renderer') ? markStylesNew : markStyles
47
+ css: markStyles
61
48
  }), children);
62
49
  };
63
50
  export const getAnnotationIndex = (annotationPosition, fragmentCount) => {
@@ -6,31 +6,11 @@
6
6
  import { useMemo, useCallback } from 'react';
7
7
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
8
8
  import { css, jsx } from '@emotion/react';
9
- import { AnnotationSharedCSSByState } from '@atlaskit/editor-common/styles';
10
9
  import { AnnotationMarkStates } from '@atlaskit/adf-schema';
11
10
  import { fg } from '@atlaskit/platform-feature-flags';
12
11
  import { useIntl } from 'react-intl-next';
13
12
  import { inlineCommentMessages } from '../../../messages';
14
- // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- `AnnotationSharedCSSByState` is not object-safe
15
- const markStylesOld = () => css`
16
- color: inherit;
17
- background-color: unset;
18
- -webkit-tap-highlight-color: transparent;
19
-
20
- &[data-mark-annotation-state='${AnnotationMarkStates.ACTIVE}'] {
21
- ${fg('editor_inline_comments_on_inline_nodes') ? AnnotationSharedCSSByState().common : ''}
22
- ${AnnotationSharedCSSByState().blur}
23
-
24
- &:focus,
25
- &[data-has-focus='true'] {
26
- ${AnnotationSharedCSSByState().focus}
27
- }
28
- &[data-is-hovered='true']:not([data-has-focus='true']) {
29
- ${fg('confluence-frontend-comments-panel') ? AnnotationSharedCSSByState().hover : ''}
30
- }
31
- }
32
- `;
33
- const markStylesNew = css({
13
+ const markStyles = css({
34
14
  color: 'inherit',
35
15
  backgroundColor: 'unset',
36
16
  WebkitTapHighlightColor: 'transparent',
@@ -76,7 +56,7 @@ const markStylesWithUpdatedShadow = css({
76
56
  }
77
57
  }
78
58
  });
79
- const markStylesNewWithInlineComments = css({
59
+ const markStylesWithInlineComments = css({
80
60
  // 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
81
61
  [`&[data-mark-annotation-state='${AnnotationMarkStates.ACTIVE}']`]: {
82
62
  // was from common in AnnotationSharedCSSByState().common
@@ -103,7 +83,7 @@ const markStylesNewWithInlineComments = css({
103
83
  }
104
84
  }
105
85
  });
106
- const markStylesNewWithCommentsPanel = css({
86
+ const markStylesWithCommentsPanel = css({
107
87
  // 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
108
88
  [`&[data-mark-annotation-state='${AnnotationMarkStates.ACTIVE}']`]: {
109
89
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
@@ -119,26 +99,7 @@ const isMobile = () => {
119
99
  // eslint-disable-next-line require-unicode-regexp
120
100
  return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
121
101
  };
122
- const accessibilityStylesOld = (startMarker, endMarker) => css({
123
- '&::before, &::after': {
124
- clipPath: 'inset(100%)',
125
- clip: 'rect(1px, 1px, 1px, 1px)',
126
- height: '1px',
127
- overflow: 'hidden',
128
- position: 'absolute',
129
- whiteSpace: 'nowrap',
130
- width: '1px'
131
- },
132
- '&::before': {
133
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
134
- content: `' [${startMarker}] '`
135
- },
136
- '&::after': {
137
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
138
- content: `' [${endMarker}] '`
139
- }
140
- });
141
- const accessibilityStylesNew = css({
102
+ const accessibilityStyles = css({
142
103
  '&::before, &::after': {
143
104
  clipPath: 'inset(100%)',
144
105
  clip: 'rect(1px, 1px, 1px, 1px)',
@@ -229,40 +190,17 @@ export const MarkComponent = ({
229
190
  'aria-details': annotationIds.join(', '),
230
191
  ...desktopAccessibilityAttributes
231
192
  };
232
- const getAccessibilityStylesOld = () => {
233
- if (isMobile()) {
234
- return {};
235
- }
236
- if (state !== AnnotationMarkStates.RESOLVED) {
237
- const startMarker = intl.formatMessage(inlineCommentMessages.contentRendererInlineCommentMarkerStart);
238
- const endMarker = intl.formatMessage(inlineCommentMessages.contentRendererInlineCommentMarkerEnd);
239
- return accessibilityStylesOld(startMarker, endMarker);
240
- } else {
241
- return {};
242
- }
243
- };
244
- if (fg('platform_editor_emotion_refactor_renderer')) {
245
- return jsx(useBlockLevel ? 'div' : 'mark', {
246
- id,
247
- [fg('editor_inline_comments_on_inline_nodes') ? 'onClickCapture' : 'onClick']: onMarkClick,
248
- ...accessibility,
249
- ...overriddenData,
250
- ...(!useBlockLevel && {
251
- css: [markStylesNew, fg('platform_renderer_nested_annotation_styling') && markStylesLayeringFix, fg('editor_inline_comments_on_inline_nodes') && markStylesNewWithInlineComments, fg('confluence-frontend-comments-panel') && markStylesNewWithCommentsPanel, !isMobile() && accessibilityStylesNew, markStylesWithUpdatedShadow],
252
- style: {
253
- '--ak-renderer-annotation-startmarker': intl.formatMessage(inlineCommentMessages.contentRendererInlineCommentMarkerStart),
254
- '--ak-renderer-annotation-endmarker': intl.formatMessage(inlineCommentMessages.contentRendererInlineCommentMarkerEnd)
255
- }
256
- })
257
- }, children);
258
- }
259
193
  return jsx(useBlockLevel ? 'div' : 'mark', {
260
194
  id,
261
195
  [fg('editor_inline_comments_on_inline_nodes') ? 'onClickCapture' : 'onClick']: onMarkClick,
262
196
  ...accessibility,
263
197
  ...overriddenData,
264
198
  ...(!useBlockLevel && {
265
- css: [markStylesOld, getAccessibilityStylesOld()]
199
+ css: [markStyles, fg('platform_renderer_nested_annotation_styling') && markStylesLayeringFix, fg('editor_inline_comments_on_inline_nodes') && markStylesWithInlineComments, fg('confluence-frontend-comments-panel') && markStylesWithCommentsPanel, !isMobile() && accessibilityStyles, markStylesWithUpdatedShadow],
200
+ style: {
201
+ '--ak-renderer-annotation-startmarker': intl.formatMessage(inlineCommentMessages.contentRendererInlineCommentMarkerStart),
202
+ '--ak-renderer-annotation-endmarker': intl.formatMessage(inlineCommentMessages.contentRendererInlineCommentMarkerEnd)
203
+ }
266
204
  })
267
205
  }, children);
268
206
  };
@@ -1,26 +1,13 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
3
- var _templateObject;
4
2
  /**
5
3
  * @jsxRuntime classic
6
4
  * @jsx jsx
7
5
  */
8
6
  import React from 'react';
9
7
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
10
- import { css, jsx } from '@emotion/react';
8
+ import { jsx } from '@emotion/react';
11
9
  import { alignmentPositionMap } from '@atlaskit/adf-schema';
12
- import { componentWithFG } from '@atlaskit/platform-feature-flags-react';
13
- var MarkWrapperOld = function MarkWrapperOld(props) {
14
- var styles = props['data-align'] ? // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
15
- css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\t\t\t\ttext-align: ", ";\n\t\t\t"])), alignmentPositionMap[props['data-align']]) : '';
16
- return jsx("div", _extends({
17
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
18
- css: styles
19
- // Ignored via go/ees005
20
- // eslint-disable-next-line react/jsx-props-no-spreading
21
- }, props), props.children);
22
- };
23
- var MarkWrapperNew = function MarkWrapperNew(props) {
10
+ var MarkWrapper = function MarkWrapper(props) {
24
11
  var dataAlign = props['data-align'] ? alignmentPositionMap[props['data-align']] : undefined;
25
12
  return jsx("div", _extends({
26
13
  style: {
@@ -30,7 +17,6 @@ var MarkWrapperNew = function MarkWrapperNew(props) {
30
17
  // eslint-disable-next-line react/jsx-props-no-spreading
31
18
  }, props), props.children);
32
19
  };
33
- var MarkWrapper = componentWithFG('platform_editor_emotion_refactor_renderer', MarkWrapperNew, MarkWrapperOld);
34
20
  export default function Alignment(props) {
35
21
  return jsx(MarkWrapper
36
22
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
@@ -12,6 +12,8 @@ import { getCardClickHandler } from '../utils/getCardClickHandler';
12
12
  import InlineCard from './inlineCard';
13
13
  import { AnalyticsContext } from '@atlaskit/analytics-next';
14
14
  import { DatasourceTableView } from '@atlaskit/link-datasource';
15
+ import { CardSSR } from '@atlaskit/smart-card/ssr';
16
+ import { fg } from '@atlaskit/platform-feature-flags';
15
17
  import { N40 } from '@atlaskit/theme/colors';
16
18
  import { calcBreakoutWidth, canRenderDatasource } from '@atlaskit/editor-common/utils';
17
19
  var datasourceContainerStyle = css({
@@ -114,6 +116,27 @@ export default function BlockCard(props) {
114
116
  url: url
115
117
  });
116
118
  }
119
+ var cardComponent;
120
+ if (smartLinks !== null && smartLinks !== void 0 && smartLinks.ssr && url && fg('platform_ssr_smartlink_cards')) {
121
+ cardComponent = jsx(CardSSR, _extends({
122
+ appearance: "block",
123
+ platform: platform
124
+ // Ignored via go/ees005
125
+ // eslint-disable-next-line react/jsx-props-no-spreading
126
+ }, cardProps, {
127
+ url: url,
128
+ onError: onError
129
+ }));
130
+ } else {
131
+ cardComponent = jsx(Card, _extends({
132
+ appearance: "block",
133
+ platform: platform
134
+ // Ignored via go/ees005
135
+ // eslint-disable-next-line react/jsx-props-no-spreading
136
+ }, cardProps, {
137
+ onError: onError
138
+ }));
139
+ }
117
140
  return jsx(AnalyticsContext, {
118
141
  data: analyticsData
119
142
  }, jsx("div", {
@@ -126,12 +149,5 @@ export default function BlockCard(props) {
126
149
  unsupportedComponent: UnsupportedBlock
127
150
  // Ignored via go/ees005
128
151
  // eslint-disable-next-line react/jsx-props-no-spreading
129
- }, cardProps), jsx(Card, _extends({
130
- appearance: "block",
131
- platform: platform
132
- // Ignored via go/ees005
133
- // eslint-disable-next-line react/jsx-props-no-spreading
134
- }, cardProps, {
135
- onError: onError
136
- })))));
152
+ }, cardProps), cardComponent)));
137
153
  }
@@ -1,23 +1,14 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
3
- var _templateObject;
4
2
  /**
5
3
  * @jsxRuntime classic
6
4
  * @jsx jsx
7
5
  */
8
6
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
9
7
  import { jsx, css } from '@emotion/react';
10
- import { overflowShadow, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
11
8
  import { N20 } from '@atlaskit/theme/colors';
12
9
  import { CodeBlockSharedCssClassName } from '@atlaskit/editor-common/styles';
13
10
  import CodeBlockButtonContainer from './codeBlockButtonContainer';
14
- import { fg } from '@atlaskit/platform-feature-flags';
15
-
16
- // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
17
- var codeBlockStyleOverridesOld = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\ttab-size: 4;\n\tbackground-color: ", ";\n\n\t&:hover {\n\t\tbutton {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\n\tbutton {\n\t\topacity: 0;\n\t\ttransition: opacity 0.2s ease 0s;\n\t}\n\n\t", " {\n\t\tfont-size: ", ";\n\t\tline-height: 1.5rem;\n\t\tbackground-image: ", ";\n\t\tbackground-attachment: local, local, local, local, scroll, scroll, scroll, scroll;\n\t\tbackground-position:\n\t\t\t0 0,\n\t\t\t0 0,\n\t\t\t100% 0,\n\t\t\t100% 0,\n\t\t\t100% 0,\n\t\t\t100% 0,\n\t\t\t0 0,\n\t\t\t0 0;\n\t}\n"])), "var(--ds-surface-raised, ".concat(N20, ")"), CodeBlockSharedCssClassName.DS_CODEBLOCK, relativeFontSizeToBase16(14), overflowShadow({
18
- leftCoverWidth: "var(--ds-space-300, 24px)"
19
- }));
20
- var codeBlockStyleOverridesNew = css(_defineProperty({
11
+ var codeBlockStyleOverrides = css(_defineProperty({
21
12
  tabSize: 4,
22
13
  backgroundColor: "var(--ds-surface-raised, ".concat(N20, ")"),
23
14
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
@@ -51,7 +42,7 @@ var CodeBlockContainer = function CodeBlockContainer(_ref) {
51
42
  return jsx("div", {
52
43
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
53
44
  className: className,
54
- css: fg('platform_editor_emotion_refactor_renderer') ? codeBlockStyleOverridesNew : codeBlockStyleOverridesOld
45
+ css: codeBlockStyleOverrides
55
46
  }, jsx(CodeBlockButtonContainer, {
56
47
  allowCopyToClipboard: allowCopyToClipboard,
57
48
  allowWrapCodeBlock: allowWrapCodeBlock,
@@ -1,6 +1,6 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
- var _templateObject, _templateObject2;
3
+ var _templateObject;
4
4
  /* eslint-disable @atlaskit/ui-styling-standard/no-imported-style-values */
5
5
  /* eslint-disable @atlaskit/ui-styling-standard/no-unsafe-values */
6
6
  /* eslint-disable @atlaskit/ui-styling-standard/no-nested-selectors */
@@ -12,11 +12,10 @@ import React, { forwardRef, useMemo } from 'react';
12
12
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
13
13
  import { css, jsx } from '@emotion/react';
14
14
  import { akEditorTableCellMinWidth, blockNodesVerticalMargin, overflowShadow } from '@atlaskit/editor-shared-styles';
15
- import { codeBlockSharedStyles, CodeBlockSharedCssClassName } from '@atlaskit/editor-common/styles';
15
+ import { CodeBlockSharedCssClassName } from '@atlaskit/editor-common/styles';
16
16
  import { useBidiWarnings } from '../../../hooks/use-bidi-warnings';
17
17
  import { RendererCssClassName } from '../../../../consts';
18
- import { componentWithFG } from '@atlaskit/platform-feature-flags-react';
19
- var codeBlockSharedStylesNew = css(_defineProperty(_defineProperty(_defineProperty({}, ".".concat(CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPED, "\n\t\t> .").concat(CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER, "\n\t\t> .").concat(CodeBlockSharedCssClassName.CODEBLOCK_CONTENT), {
18
+ var codeBlockSharedStyles = css(_defineProperty(_defineProperty(_defineProperty({}, ".".concat(CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPED, "\n\t\t> .").concat(CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER, "\n\t\t> .").concat(CodeBlockSharedCssClassName.CODEBLOCK_CONTENT), {
20
19
  marginRight: "var(--ds-space-100, 8px)",
21
20
  code: {
22
21
  display: 'block',
@@ -115,10 +114,7 @@ var codeBlockSharedStylesNew = css(_defineProperty(_defineProperty(_defineProper
115
114
  color: "var(--ds-text-subtlest, #505F79)",
116
115
  boxSizing: 'content-box'
117
116
  })));
118
-
119
- // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
120
- var lightWeightCodeBlockStylesOld = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\t.", " {\n\t\tcursor: text;\n\t}\n"])), CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER);
121
- var lightWeightCodeBlockStylesNew = css(_defineProperty({}, ".".concat(CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER), {
117
+ var lightWeightCodeBlockStyles = css(_defineProperty({}, ".".concat(CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER), {
122
118
  cursor: 'text'
123
119
  }));
124
120
  export var LightWeightCodeBlockCssClassName = {
@@ -137,9 +133,9 @@ export var getLightWeightCodeBlockStylesForRootRendererStyleSheet = function get
137
133
  // NOTE: This must be added after other .code-block styles in the root
138
134
  // Renderer stylesheet.
139
135
  // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
140
- return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n\t\t.", "\n\t\t\t> .", "\n\t\t\t.", " {\n\t\t\tmargin-top: ", ";\n\t\t}\n\t"])), RendererCssClassName.DOCUMENT, LightWeightCodeBlockCssClassName.CONTAINER, CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER, blockNodesVerticalMargin);
136
+ return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\t\t.", "\n\t\t\t> .", "\n\t\t\t.", " {\n\t\t\tmargin-top: ", ";\n\t\t}\n\t"])), RendererCssClassName.DOCUMENT, LightWeightCodeBlockCssClassName.CONTAINER, CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER, blockNodesVerticalMargin);
141
137
  };
142
- var LightWeightCodeBlockOld = /*#__PURE__*/forwardRef(function (_ref, ref) {
138
+ var LightWeightCodeBlock = /*#__PURE__*/forwardRef(function (_ref, ref) {
143
139
  var text = _ref.text,
144
140
  _ref$codeBidiWarningT = _ref.codeBidiWarningTooltipEnabled,
145
141
  codeBidiWarningTooltipEnabled = _ref$codeBidiWarningT === void 0 ? true : _ref$codeBidiWarningT,
@@ -152,46 +148,6 @@ var LightWeightCodeBlockOld = /*#__PURE__*/forwardRef(function (_ref, ref) {
152
148
  }),
153
149
  renderBidiWarnings = _useBidiWarnings.renderBidiWarnings;
154
150
  var classNames = [LightWeightCodeBlockCssClassName.CONTAINER, className].join(' ');
155
- return jsx("div", {
156
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
157
- className: classNames,
158
- ref: ref
159
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
160
- ,
161
- css: [codeBlockSharedStyles(), lightWeightCodeBlockStylesOld]
162
- }, jsx("div", {
163
- className: CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER
164
- }, jsx("div", {
165
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
166
- className: CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER
167
- }, jsx("div", {
168
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
169
- className: CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER
170
- }, textRows.map(function (_, index) {
171
- return (
172
- // Ignored via go/ees005
173
- // eslint-disable-next-line react/no-array-index-key
174
- jsx("span", {
175
- key: index
176
- })
177
- );
178
- })), jsx("div", {
179
- className: CodeBlockSharedCssClassName.CODEBLOCK_CONTENT
180
- }, jsx("code", null, renderBidiWarnings(text))))));
181
- });
182
- var LightWeightCodeBlockNew = /*#__PURE__*/forwardRef(function (_ref2, ref) {
183
- var text = _ref2.text,
184
- _ref2$codeBidiWarning = _ref2.codeBidiWarningTooltipEnabled,
185
- codeBidiWarningTooltipEnabled = _ref2$codeBidiWarning === void 0 ? true : _ref2$codeBidiWarning,
186
- className = _ref2.className;
187
- var textRows = useMemo(function () {
188
- return (text !== null && text !== void 0 ? text : '').split('\n');
189
- }, [text]);
190
- var _useBidiWarnings2 = useBidiWarnings({
191
- enableWarningTooltip: codeBidiWarningTooltipEnabled
192
- }),
193
- renderBidiWarnings = _useBidiWarnings2.renderBidiWarnings;
194
- var classNames = [LightWeightCodeBlockCssClassName.CONTAINER, className].join(' ');
195
151
  var codeBlockBackgroundImage = overflowShadow({
196
152
  leftCoverWidth: "var(--ds-space-300, 24px)"
197
153
  });
@@ -201,7 +157,7 @@ var LightWeightCodeBlockNew = /*#__PURE__*/forwardRef(function (_ref2, ref) {
201
157
  ref: ref
202
158
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
203
159
  ,
204
- css: [codeBlockSharedStylesNew, lightWeightCodeBlockStylesNew],
160
+ css: [codeBlockSharedStyles, lightWeightCodeBlockStyles],
205
161
  style: {
206
162
  '--ak-renderer-codeblock-content-wrapper-bg-img': codeBlockBackgroundImage
207
163
  }
@@ -225,5 +181,4 @@ var LightWeightCodeBlockNew = /*#__PURE__*/forwardRef(function (_ref2, ref) {
225
181
  className: CodeBlockSharedCssClassName.CODEBLOCK_CONTENT
226
182
  }, jsx("code", null, renderBidiWarnings(text))))));
227
183
  });
228
- var LightWeightCodeBlock = componentWithFG('platform_editor_emotion_refactor_renderer', LightWeightCodeBlockNew, LightWeightCodeBlockOld);
229
184
  export default LightWeightCodeBlock;
@@ -6,11 +6,10 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
6
6
  import React from 'react';
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 { WidthProvider, clearNextSiblingMarginTopStyle, clearNextSiblingBlockMarkMarginTopStyle } from '@atlaskit/editor-common/ui';
10
- import { fg } from '@atlaskit/platform-feature-flags';
9
+ import { WidthProvider } from '@atlaskit/editor-common/ui';
11
10
 
12
11
  // localized styles, was from clearNextSiblingMarginTopStyle in @atlaskit/editor-common/ui
13
- var clearNextSiblingMarginTopStyleNew = css({
12
+ var clearNextSiblingMarginTopStyle = css({
14
13
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
15
14
  '& + *': {
16
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
@@ -19,17 +18,10 @@ var clearNextSiblingMarginTopStyleNew = css({
19
18
  });
20
19
 
21
20
  // localized styles, was from clearNextSiblingBlockMarkMarginTopStyle in @atlaskit/editor-common/ui
22
- var clearNextSiblingBlockMarkMarginTopStyleNew = css(_defineProperty({}, "+ .fabric-editor-block-mark > p,\n\t + .fabric-editor-block-mark > h1,\n\t + .fabric-editor-block-mark > h2,\n\t + .fabric-editor-block-mark > h3,\n\t + .fabric-editor-block-mark > h4,\n\t + .fabric-editor-block-mark > h5,\n\t + .fabric-editor-block-mark > h6\n\t", {
21
+ var clearNextSiblingBlockMarkMarginTopStyle = css(_defineProperty({}, "+ .fabric-editor-block-mark > p,\n\t + .fabric-editor-block-mark > h1,\n\t + .fabric-editor-block-mark > h2,\n\t + .fabric-editor-block-mark > h3,\n\t + .fabric-editor-block-mark > h4,\n\t + .fabric-editor-block-mark > h5,\n\t + .fabric-editor-block-mark > h6\n\t", {
23
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
24
23
  marginTop: '0 !important'
25
24
  }));
26
-
27
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
28
- var layoutColumnClearMarginTopStyles = css(
29
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
30
- clearNextSiblingMarginTopStyle,
31
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
32
- clearNextSiblingBlockMarkMarginTopStyle);
33
25
  export default function LayoutSection(props) {
34
26
  return jsx("div", {
35
27
  "data-layout-column": true,
@@ -38,6 +30,6 @@ export default function LayoutSection(props) {
38
30
  flexBasis: "".concat(props.width, "%")
39
31
  }
40
32
  }, jsx(WidthProvider, null, jsx("div", {
41
- css: fg('platform_editor_emotion_refactor_renderer') ? [clearNextSiblingMarginTopStyleNew, clearNextSiblingBlockMarkMarginTopStyleNew] : layoutColumnClearMarginTopStyles
33
+ css: [clearNextSiblingMarginTopStyle, clearNextSiblingBlockMarkMarginTopStyle]
42
34
  }), props.children));
43
35
  }
@@ -7,10 +7,8 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
7
7
  import _extends from "@babel/runtime/helpers/extends";
8
8
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
9
9
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
10
- import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
11
10
  var _excluded = ["marks", "mediaSingleElement", "isDrafting"],
12
11
  _excluded2 = ["marks", "mediaSingleElement", "isDrafting"];
13
- var _templateObject;
14
12
  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
13
  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
14
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
@@ -42,7 +40,6 @@ import { injectIntl } from 'react-intl-next';
42
40
  import { useInlineCommentsFilter } from '../../../ui/annotations/hooks/use-inline-comments-filter';
43
41
  import { useInlineCommentSubscriberContext } from '../../../ui/annotations/hooks/use-inline-comment-subscriber';
44
42
  import { AnnotationUpdateEvent } from '@atlaskit/editor-common/types';
45
- import { componentWithFG } from '@atlaskit/platform-feature-flags-react';
46
43
  var linkStyle = css({
47
44
  position: 'absolute',
48
45
  background: 'transparent',
@@ -56,19 +53,14 @@ var linkStyle = css({
56
53
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
57
54
  height: '100% !important'
58
55
  });
59
-
60
- // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Ignored via go/DSP-18766
61
- var borderStyleOld = function borderStyleOld(color, width) {
62
- 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);
63
- };
64
- var borderStyleNew = css({
56
+ var borderStyle = css({
65
57
  position: 'absolute',
66
58
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
67
59
  width: '100% !important',
68
60
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
69
61
  height: '100% !important'
70
62
  });
71
- var MediaBorderOld = function MediaBorderOld(_ref) {
63
+ var MediaBorder = function MediaBorder(_ref) {
72
64
  var _mark$attrs$color, _mark$attrs$size;
73
65
  var mark = _ref.mark,
74
66
  children = _ref.children;
@@ -78,32 +70,11 @@ var MediaBorderOld = function MediaBorderOld(_ref) {
78
70
  var borderColor = (_mark$attrs$color = mark === null || mark === void 0 ? void 0 : mark.attrs.color) !== null && _mark$attrs$color !== void 0 ? _mark$attrs$color : '';
79
71
  var borderWidth = (_mark$attrs$size = mark === null || mark === void 0 ? void 0 : mark.attrs.size) !== null && _mark$attrs$size !== void 0 ? _mark$attrs$size : 0;
80
72
  var paletteColorValue = hexToEditorBorderPaletteColor(borderColor) || borderColor;
81
- return jsx("div", {
82
- "data-mark-type": "border",
83
- "data-color": borderColor,
84
- "data-size": borderWidth
85
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
86
- ,
87
- css: borderStyleOld(paletteColorValue, borderWidth)
88
- }, jsx(MediaBorderGapFiller, {
89
- borderColor: borderColor
90
- }), children);
91
- };
92
- var MediaBorderNew = function MediaBorderNew(_ref2) {
93
- var _mark$attrs$color2, _mark$attrs$size2;
94
- var mark = _ref2.mark,
95
- children = _ref2.children;
96
- if (!mark) {
97
- return jsx(Fragment, null, children);
98
- }
99
- var borderColor = (_mark$attrs$color2 = mark === null || mark === void 0 ? void 0 : mark.attrs.color) !== null && _mark$attrs$color2 !== void 0 ? _mark$attrs$color2 : '';
100
- 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;
101
- var paletteColorValue = hexToEditorBorderPaletteColor(borderColor) || borderColor;
102
73
  return jsx("div", {
103
74
  "data-mark-type": "border",
104
75
  "data-color": borderColor,
105
76
  "data-size": borderWidth,
106
- css: borderStyleNew,
77
+ css: borderStyle,
107
78
  style: {
108
79
  borderRadius: "".concat(borderWidth, "px"),
109
80
  boxShadow: "0 0 0 ".concat(borderWidth, "px ").concat(paletteColorValue)
@@ -112,11 +83,10 @@ var MediaBorderNew = function MediaBorderNew(_ref2) {
112
83
  borderColor: borderColor
113
84
  }), children);
114
85
  };
115
- var MediaBorder = componentWithFG('platform_editor_emotion_refactor_renderer', MediaBorderNew, MediaBorderOld);
116
- var MediaLink = function MediaLink(_ref3) {
117
- var mark = _ref3.mark,
118
- children = _ref3.children,
119
- onClick = _ref3.onClick;
86
+ var MediaLink = function MediaLink(_ref2) {
87
+ var mark = _ref2.mark,
88
+ children = _ref2.children,
89
+ onClick = _ref2.onClick;
120
90
  if (!mark) {
121
91
  return jsx(Fragment, null, children);
122
92
  }
@@ -129,9 +99,9 @@ var MediaLink = function MediaLink(_ref3) {
129
99
  css: linkStyle
130
100
  }, children);
131
101
  };
132
- var MediaAnnotation = function MediaAnnotation(_ref4) {
133
- var mark = _ref4.mark,
134
- children = _ref4.children;
102
+ var MediaAnnotation = function MediaAnnotation(_ref3) {
103
+ var mark = _ref3.mark,
104
+ children = _ref3.children;
135
105
  if (!mark) {
136
106
  return jsx(Fragment, null, children);
137
107
  }
@@ -149,10 +119,10 @@ var MediaAnnotation = function MediaAnnotation(_ref4) {
149
119
  useBlockLevel: true
150
120
  }, children);
151
121
  };
152
- var _MediaAnnotations = function MediaAnnotations(_ref5) {
153
- var _ref5$marks = _ref5.marks,
154
- marks = _ref5$marks === void 0 ? [] : _ref5$marks,
155
- children = _ref5.children;
122
+ var _MediaAnnotations = function MediaAnnotations(_ref4) {
123
+ var _ref4$marks = _ref4.marks,
124
+ marks = _ref4$marks === void 0 ? [] : _ref4$marks,
125
+ children = _ref4.children;
156
126
  // Early Exit
157
127
  if (marks.length === 0) {
158
128
  return jsx(Fragment, null, children);
@@ -169,13 +139,13 @@ var _MediaAnnotations = function MediaAnnotations(_ref5) {
169
139
  }, children) : jsx(Fragment, null, children)));
170
140
  };
171
141
  var CommentBadge = injectIntl(CommentBadgeComponent);
172
- var CommentBadgeWrapper = function CommentBadgeWrapper(_ref6) {
142
+ var CommentBadgeWrapper = function CommentBadgeWrapper(_ref5) {
173
143
  var _marks$map;
174
- var marks = _ref6.marks,
175
- mediaSingleElement = _ref6.mediaSingleElement,
176
- _ref6$isDrafting = _ref6.isDrafting,
177
- isDrafting = _ref6$isDrafting === void 0 ? false : _ref6$isDrafting,
178
- rest = _objectWithoutProperties(_ref6, _excluded);
144
+ var marks = _ref5.marks,
145
+ mediaSingleElement = _ref5.mediaSingleElement,
146
+ _ref5$isDrafting = _ref5.isDrafting,
147
+ isDrafting = _ref5$isDrafting === void 0 ? false : _ref5$isDrafting,
148
+ rest = _objectWithoutProperties(_ref5, _excluded);
179
149
  var _useState = useState('default'),
180
150
  _useState2 = _slicedToArray(_useState, 2),
181
151
  status = _useState2[0],
@@ -252,13 +222,13 @@ var CommentBadgeWrapper = function CommentBadgeWrapper(_ref6) {
252
222
  * when clean up platform_editor_add_media_from_url feature flag
253
223
  */
254
224
 
255
- var CommentBadgeNextWrapper = function CommentBadgeNextWrapper(_ref7) {
225
+ var CommentBadgeNextWrapper = function CommentBadgeNextWrapper(_ref6) {
256
226
  var _marks$map2;
257
- var marks = _ref7.marks,
258
- mediaSingleElement = _ref7.mediaSingleElement,
259
- _ref7$isDrafting = _ref7.isDrafting,
260
- isDrafting = _ref7$isDrafting === void 0 ? false : _ref7$isDrafting,
261
- rest = _objectWithoutProperties(_ref7, _excluded2);
227
+ var marks = _ref6.marks,
228
+ mediaSingleElement = _ref6.mediaSingleElement,
229
+ _ref6$isDrafting = _ref6.isDrafting,
230
+ isDrafting = _ref6$isDrafting === void 0 ? false : _ref6$isDrafting,
231
+ rest = _objectWithoutProperties(_ref6, _excluded2);
262
232
  var _useState5 = useState('default'),
263
233
  _useState6 = _slicedToArray(_useState5, 2),
264
234
  status = _useState6[0],
@@ -377,8 +347,8 @@ var Media = /*#__PURE__*/function (_PureComponent) {
377
347
  mediaWidth: width,
378
348
  mediaHeight: height,
379
349
  useMinimumZIndex: true
380
- }, function (_ref9) {
381
- var visible = _ref9.visible;
350
+ }, function (_ref8) {
351
+ var visible = _ref8.visible;
382
352
  return jsx(React.Fragment, null, visible && jsx(ExternalImageBadge, {
383
353
  type: _this.props.type,
384
354
  url: _this.props.type === 'external' ? _this.props.url : undefined