@atlaskit/renderer 91.0.0 → 93.0.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 (113) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/dist/cjs/analytics/enums.js +2 -0
  3. package/dist/cjs/react/marks/alignment.js +11 -12
  4. package/dist/cjs/react/marks/breakout.js +7 -9
  5. package/dist/cjs/react/marks/link.js +13 -6
  6. package/dist/cjs/react/nodes/codeBlock.js +17 -16
  7. package/dist/cjs/react/nodes/codeBlockCopyButton.js +13 -11
  8. package/dist/cjs/react/nodes/embedCard.js +25 -33
  9. package/dist/cjs/react/nodes/heading-anchor.js +7 -6
  10. package/dist/cjs/react/nodes/heading.js +4 -2
  11. package/dist/cjs/react/nodes/layoutColumn.js +7 -2
  12. package/dist/cjs/react/nodes/media.js +7 -6
  13. package/dist/cjs/react/nodes/mediaSingle/index.js +15 -4
  14. package/dist/cjs/react/nodes/mediaSingle/styles.js +7 -10
  15. package/dist/cjs/react/nodes/panel.js +26 -16
  16. package/dist/cjs/react/nodes/table/sticky.js +63 -55
  17. package/dist/cjs/react/nodes/table.js +2 -10
  18. package/dist/cjs/react/utils/inject-props.js +33 -0
  19. package/dist/cjs/react/utils/performance/RenderTracking.js +52 -0
  20. package/dist/cjs/ui/Expand.js +52 -28
  21. package/dist/cjs/ui/MediaCard.js +4 -14
  22. package/dist/cjs/ui/Renderer/index.js +72 -64
  23. package/dist/cjs/ui/Renderer/style.js +62 -55
  24. package/dist/cjs/ui/Renderer/truncated-wrapper.js +19 -21
  25. package/dist/cjs/ui/SortingIcon.js +8 -9
  26. package/dist/cjs/ui/annotations/draft/component.js +22 -12
  27. package/dist/cjs/ui/annotations/element/mark.js +9 -5
  28. package/dist/cjs/ui/renderer-props.js +1 -3
  29. package/dist/cjs/version.json +1 -1
  30. package/dist/es2019/analytics/enums.js +2 -0
  31. package/dist/es2019/react/marks/alignment.js +15 -7
  32. package/dist/es2019/react/marks/breakout.js +6 -5
  33. package/dist/es2019/react/marks/link.js +8 -5
  34. package/dist/es2019/react/nodes/codeBlock.js +25 -23
  35. package/dist/es2019/react/nodes/codeBlockCopyButton.js +12 -9
  36. package/dist/es2019/react/nodes/embedCard.js +16 -16
  37. package/dist/es2019/react/nodes/heading-anchor.js +9 -6
  38. package/dist/es2019/react/nodes/heading.js +4 -2
  39. package/dist/es2019/react/nodes/layoutColumn.js +7 -3
  40. package/dist/es2019/react/nodes/media.js +9 -5
  41. package/dist/es2019/react/nodes/mediaSingle/index.js +10 -6
  42. package/dist/es2019/react/nodes/mediaSingle/styles.js +6 -7
  43. package/dist/es2019/react/nodes/panel.js +23 -16
  44. package/dist/es2019/react/nodes/table/sticky.js +55 -37
  45. package/dist/es2019/react/nodes/table.js +2 -5
  46. package/dist/es2019/react/utils/inject-props.js +24 -0
  47. package/dist/es2019/react/utils/performance/RenderTracking.js +37 -0
  48. package/dist/es2019/ui/Expand.js +65 -36
  49. package/dist/es2019/ui/MediaCard.js +3 -6
  50. package/dist/es2019/ui/Renderer/index.js +72 -57
  51. package/dist/es2019/ui/Renderer/style.js +370 -327
  52. package/dist/es2019/ui/Renderer/truncated-wrapper.js +26 -15
  53. package/dist/es2019/ui/SortingIcon.js +9 -7
  54. package/dist/es2019/ui/annotations/draft/component.js +18 -12
  55. package/dist/es2019/ui/annotations/element/mark.js +12 -6
  56. package/dist/es2019/ui/renderer-props.js +1 -1
  57. package/dist/es2019/version.json +1 -1
  58. package/dist/esm/analytics/enums.js +2 -0
  59. package/dist/esm/react/marks/alignment.js +13 -6
  60. package/dist/esm/react/marks/breakout.js +6 -5
  61. package/dist/esm/react/marks/link.js +7 -5
  62. package/dist/esm/react/nodes/codeBlock.js +18 -14
  63. package/dist/esm/react/nodes/codeBlockCopyButton.js +10 -7
  64. package/dist/esm/react/nodes/embedCard.js +19 -19
  65. package/dist/esm/react/nodes/heading-anchor.js +8 -6
  66. package/dist/esm/react/nodes/heading.js +4 -2
  67. package/dist/esm/react/nodes/layoutColumn.js +7 -3
  68. package/dist/esm/react/nodes/media.js +8 -5
  69. package/dist/esm/react/nodes/mediaSingle/index.js +11 -6
  70. package/dist/esm/react/nodes/mediaSingle/styles.js +5 -7
  71. package/dist/esm/react/nodes/panel.js +27 -15
  72. package/dist/esm/react/nodes/table/sticky.js +64 -53
  73. package/dist/esm/react/nodes/table.js +2 -8
  74. package/dist/esm/react/utils/inject-props.js +24 -0
  75. package/dist/esm/react/utils/performance/RenderTracking.js +39 -0
  76. package/dist/esm/ui/Expand.js +57 -29
  77. package/dist/esm/ui/MediaCard.js +3 -9
  78. package/dist/esm/ui/Renderer/index.js +74 -61
  79. package/dist/esm/ui/Renderer/style.js +58 -51
  80. package/dist/esm/ui/Renderer/truncated-wrapper.js +20 -14
  81. package/dist/esm/ui/SortingIcon.js +9 -7
  82. package/dist/esm/ui/annotations/draft/component.js +18 -11
  83. package/dist/esm/ui/annotations/element/mark.js +11 -4
  84. package/dist/esm/ui/renderer-props.js +1 -1
  85. package/dist/esm/version.json +1 -1
  86. package/dist/types/analytics/enums.d.ts +2 -0
  87. package/dist/types/analytics/events.d.ts +12 -2
  88. package/dist/types/react/marks/alignment.d.ts +2 -2
  89. package/dist/types/react/marks/breakout.d.ts +4 -3
  90. package/dist/types/react/marks/link.d.ts +2 -2
  91. package/dist/types/react/nodes/codeBlock.d.ts +4 -14
  92. package/dist/types/react/nodes/embedCard.d.ts +3 -2
  93. package/dist/types/react/nodes/heading-anchor.d.ts +1 -0
  94. package/dist/types/react/nodes/heading.d.ts +1 -0
  95. package/dist/types/react/nodes/index.d.ts +1 -13
  96. package/dist/types/react/nodes/layoutColumn.d.ts +3 -1
  97. package/dist/types/react/nodes/media.d.ts +3 -1
  98. package/dist/types/react/nodes/mediaSingle/index.d.ts +1 -0
  99. package/dist/types/react/nodes/mediaSingle/styles.d.ts +2 -3
  100. package/dist/types/react/nodes/panel.d.ts +3 -1
  101. package/dist/types/react/nodes/table/sticky.d.ts +4 -2
  102. package/dist/types/react/utils/inject-props.d.ts +6 -0
  103. package/dist/types/react/utils/performance/RenderTracking.d.ts +15 -0
  104. package/dist/types/ui/Expand.d.ts +3 -2
  105. package/dist/types/ui/MediaCard.d.ts +1 -3
  106. package/dist/types/ui/Renderer/index.d.ts +3 -26
  107. package/dist/types/ui/Renderer/style.d.ts +2 -3
  108. package/dist/types/ui/Renderer/truncated-wrapper.d.ts +3 -1
  109. package/dist/types/ui/SortingIcon.d.ts +3 -3
  110. package/dist/types/ui/annotations/draft/component.d.ts +1 -0
  111. package/dist/types/ui/annotations/element/mark.d.ts +1 -0
  112. package/dist/types/ui/renderer-props.d.ts +14 -2
  113. package/package.json +22 -23
@@ -15,21 +15,22 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
15
15
 
16
16
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
17
17
 
18
- import React, { useContext, useLayoutEffect, useRef } from 'react';
18
+ /** @jsx jsx */
19
+ import React, { Fragment, useContext, useLayoutEffect, useRef } from 'react';
20
+ import { jsx } from '@emotion/react';
19
21
  import { PureComponent } from 'react';
20
22
  import { getSchemaBasedOnStage } from '@atlaskit/adf-schema';
21
23
  import { reduce } from '@atlaskit/adf-utils';
22
24
  import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
23
- import { UnsupportedBlock, BaseTheme, WidthProvider, WithCreateAnalyticsEvent, LegacyToNextIntlProvider, IntlLegacyFallbackProvider, IntlNextErrorBoundary } from '@atlaskit/editor-common/ui';
24
- import { getAnalyticsAppearance, getAnalyticsEventSeverity, getResponseEndTime, startMeasure, stopMeasure, shouldForceTracking } from '@atlaskit/editor-common/utils';
25
+ import { UnsupportedBlock, BaseTheme, WidthProvider, WithCreateAnalyticsEvent, IntlErrorBoundary } from '@atlaskit/editor-common/ui';
26
+ import { getAnalyticsAppearance, getAnalyticsEventSeverity, getResponseEndTime, startMeasure, stopMeasure, shouldForceTracking, measureTTI } from '@atlaskit/editor-common/utils';
25
27
  import { normalizeFeatureFlags } from '@atlaskit/editor-common/normalize-feature-flags';
26
28
  import { akEditorFullPageDefaultFontSize } from '@atlaskit/editor-shared-styles';
27
- import { IframeWidthObserverFallbackWrapper, IframeWrapperConsumer } from '@atlaskit/width-detector';
28
29
  import { FabricChannel } from '@atlaskit/analytics-listeners';
29
30
  import { FabricEditorAnalyticsContext } from '@atlaskit/analytics-namespaced-context';
30
31
  import uuid from 'uuid/v4';
31
32
  import { ReactSerializer, renderDocument } from '../../';
32
- import { Wrapper } from './style';
33
+ import { rendererStyles } from './style';
33
34
  import { TruncatedWrapper } from './truncated-wrapper';
34
35
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../../analytics/enums';
35
36
  import { PLATFORM, MODE } from '../../analytics/events';
@@ -47,6 +48,7 @@ import { isInteractiveElement } from './click-to-edit';
47
48
  import { RendererContextProvider } from '../../renderer-context';
48
49
  import memoizeOne from 'memoize-one';
49
50
  import { ErrorBoundary } from './ErrorBoundary';
51
+ import { RenderTracking } from '../../react/utils/performance/RenderTracking';
50
52
  export var NORMAL_SEVERITY_THRESHOLD = 2000;
51
53
  export var DEGRADED_SEVERITY_THRESHOLD = 3000;
52
54
  export var Renderer = /*#__PURE__*/function (_PureComponent) {
@@ -62,8 +64,11 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
62
64
  _this = _super.call(this, props);
63
65
 
64
66
  _defineProperty(_assertThisInitialized(_this), "featureFlags", memoizeOne(function (featureFlags) {
67
+ var normalizedFeatureFlags = normalizeFeatureFlags(featureFlags, {
68
+ objectFlagKeys: ['rendererRenderTracking']
69
+ });
65
70
  return {
66
- featureFlags: normalizeFeatureFlags(featureFlags)
71
+ featureFlags: normalizedFeatureFlags
67
72
  };
68
73
  }));
69
74
 
@@ -102,6 +107,24 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
102
107
  _this.editorRef = props.innerRef || /*#__PURE__*/React.createRef();
103
108
  _this.id = uuid();
104
109
  startMeasure("Renderer Render Time: ".concat(_this.id));
110
+
111
+ var _featureFlags = _this.featureFlags(_this.props.featureFlags).featureFlags;
112
+
113
+ if (_featureFlags !== null && _featureFlags !== void 0 && _featureFlags.rendererTtiTracking) {
114
+ measureTTI(function (tti, ttiFromInvocation, canceled) {
115
+ _this.fireAnalyticsEvent({
116
+ action: ACTION.RENDERER_TTI,
117
+ actionSubject: ACTION_SUBJECT.RENDERER,
118
+ attributes: {
119
+ tti: tti,
120
+ ttiFromInvocation: ttiFromInvocation,
121
+ canceled: canceled
122
+ },
123
+ eventType: EVENT_TYPE.OPERATIONAL
124
+ });
125
+ });
126
+ }
127
+
105
128
  return _this;
106
129
  }
107
130
 
@@ -284,6 +307,8 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
284
307
  };
285
308
 
286
309
  try {
310
+ var _this$featureFlags, _this$featureFlags$fe, _this$featureFlags$fe2;
311
+
287
312
  var schema = this.getSchema();
288
313
 
289
314
  var _renderDocument = renderDocument(document, this.serializer, schema, adfStage, this.props.useSpecBasedValidator, this.id, this.fireAnalyticsEvent, this.props.unsupportedContentLevelsTracking, this.props.appearance),
@@ -295,17 +320,17 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
295
320
  onComplete(stat);
296
321
  }
297
322
 
298
- var rendererOutput = /*#__PURE__*/React.createElement(RendererContextProvider, {
323
+ var rendererOutput = jsx(RendererContextProvider, {
299
324
  value: this.featureFlags(this.props.featureFlags)
300
- }, /*#__PURE__*/React.createElement(CopyTextProvider, null, /*#__PURE__*/React.createElement(ActiveHeaderIdProvider, {
325
+ }, jsx(CopyTextProvider, null, jsx(ActiveHeaderIdProvider, {
301
326
  value: getActiveHeadingId(allowHeadingAnchorLinks)
302
- }, /*#__PURE__*/React.createElement(LegacyToNextIntlProvider, null, /*#__PURE__*/React.createElement(IntlLegacyFallbackProvider, null, /*#__PURE__*/React.createElement(AnalyticsContext.Provider, {
327
+ }, jsx(AnalyticsContext.Provider, {
303
328
  value: {
304
329
  fireAnalyticsEvent: function fireAnalyticsEvent(event) {
305
330
  return _this3.fireAnalyticsEvent(event);
306
331
  }
307
332
  }
308
- }, /*#__PURE__*/React.createElement(SmartCardStorageProvider, null, /*#__PURE__*/React.createElement(RendererWrapper, {
333
+ }, jsx(SmartCardStorageProvider, null, jsx(RendererWrapper, {
309
334
  appearance: appearance,
310
335
  dynamicTextSizing: !!allowDynamicTextSizing,
311
336
  allowNestedHeaderLinks: allowNestedHeaderLinks,
@@ -316,23 +341,32 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
316
341
  innerRef: this.editorRef,
317
342
  onClick: handleWrapperOnClick,
318
343
  onMouseDown: this.onMouseDownEditView
319
- }, enableSsrInlineScripts ? /*#__PURE__*/React.createElement(BreakoutSSRInlineScript, {
344
+ }, enableSsrInlineScripts ? jsx(BreakoutSSRInlineScript, {
320
345
  allowDynamicTextSizing: !!allowDynamicTextSizing
321
- }) : null, /*#__PURE__*/React.createElement(RendererActionsInternalUpdater, {
346
+ }) : null, jsx(RendererActionsInternalUpdater, {
322
347
  doc: pmDoc,
323
348
  schema: schema,
324
349
  onAnalyticsEvent: this.fireAnalyticsEvent
325
- }, result)))))))));
326
- return truncated ? /*#__PURE__*/React.createElement(TruncatedWrapper, {
350
+ }, result)))))));
351
+ var rendererResult = truncated ? jsx(TruncatedWrapper, {
327
352
  height: maxHeight,
328
353
  fadeHeight: fadeOutHeight
329
354
  }, rendererOutput) : rendererOutput;
355
+ var rendererRenderTracking = (_this$featureFlags = this.featureFlags(this.props.featureFlags)) === null || _this$featureFlags === void 0 ? void 0 : (_this$featureFlags$fe = _this$featureFlags.featureFlags) === null || _this$featureFlags$fe === void 0 ? void 0 : (_this$featureFlags$fe2 = _this$featureFlags$fe.rendererRenderTracking) === null || _this$featureFlags$fe2 === void 0 ? void 0 : _this$featureFlags$fe2[ACTION_SUBJECT.RENDERER];
356
+ var reRenderTracking = (rendererRenderTracking === null || rendererRenderTracking === void 0 ? void 0 : rendererRenderTracking.enabled) && jsx(RenderTracking, {
357
+ componentProps: this.props,
358
+ action: ACTION.RE_RENDERED,
359
+ actionSubject: ACTION_SUBJECT.RENDERER,
360
+ handleAnalyticsEvent: this.fireAnalyticsEvent,
361
+ useShallow: rendererRenderTracking.useShallow
362
+ });
363
+ return jsx(Fragment, null, reRenderTracking, rendererResult);
330
364
  } catch (e) {
331
365
  if (onError) {
332
366
  onError(e);
333
367
  }
334
368
 
335
- return /*#__PURE__*/React.createElement(RendererWrapper, {
369
+ return jsx(RendererWrapper, {
336
370
  appearance: appearance,
337
371
  dynamicTextSizing: !!allowDynamicTextSizing,
338
372
  allowCopyToClipboard: allowCopyToClipboard,
@@ -340,7 +374,7 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
340
374
  allowColumnSorting: allowColumnSorting,
341
375
  allowNestedHeaderLinks: allowNestedHeaderLinks,
342
376
  onClick: handleWrapperOnClick
343
- }, /*#__PURE__*/React.createElement(UnsupportedBlock, null));
377
+ }, jsx(UnsupportedBlock, null));
344
378
  }
345
379
  }
346
380
  }, {
@@ -363,7 +397,7 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
363
397
  return Renderer;
364
398
  }(PureComponent);
365
399
  var RendererWithAnalytics = /*#__PURE__*/React.memo(function (props) {
366
- return /*#__PURE__*/React.createElement(FabricEditorAnalyticsContext, {
400
+ return jsx(FabricEditorAnalyticsContext, {
367
401
  data: {
368
402
  appearance: getAnalyticsAppearance(props.appearance),
369
403
  packageName: name,
@@ -371,72 +405,51 @@ var RendererWithAnalytics = /*#__PURE__*/React.memo(function (props) {
371
405
  componentName: 'renderer',
372
406
  editorSessionId: uuid()
373
407
  }
374
- }, /*#__PURE__*/React.createElement(WithCreateAnalyticsEvent, {
408
+ }, jsx(WithCreateAnalyticsEvent, {
375
409
  render: function render(createAnalyticsEvent) {
376
- // `IntlNextErrorBoundary` only captures Internationalisation errors, leaving others for `ErrorBoundary`.
377
- return /*#__PURE__*/React.createElement(ErrorBoundary, {
410
+ // `IntlErrorBoundary` only captures Internationalisation errors, leaving others for `ErrorBoundary`.
411
+ return jsx(ErrorBoundary, {
378
412
  component: ACTION_SUBJECT.RENDERER,
379
413
  rethrowError: true,
380
414
  fallbackComponent: null,
381
415
  createAnalyticsEvent: createAnalyticsEvent
382
- }, /*#__PURE__*/React.createElement(IntlNextErrorBoundary, null, /*#__PURE__*/React.createElement(Renderer, _extends({}, props, {
416
+ }, jsx(IntlErrorBoundary, null, jsx(Renderer, _extends({}, props, {
383
417
  createAnalyticsEvent: createAnalyticsEvent
384
418
  }))));
385
419
  }
386
420
  }));
387
421
  });
388
- var RendererWithIframeFallbackWrapper = /*#__PURE__*/React.memo(function (props) {
422
+ var RendererWrapper = /*#__PURE__*/React.memo(function (props) {
389
423
  var allowColumnSorting = props.allowColumnSorting,
390
424
  dynamicTextSizing = props.dynamicTextSizing,
391
425
  allowNestedHeaderLinks = props.allowNestedHeaderLinks,
392
426
  innerRef = props.innerRef,
393
427
  appearance = props.appearance,
394
428
  children = props.children,
395
- subscribe = props.subscribe,
396
429
  onClick = props.onClick,
397
430
  onMouseDown = props.onMouseDown;
398
- var renderer = /*#__PURE__*/React.createElement(WidthProvider, {
431
+ return jsx(WidthProvider, {
399
432
  className: "ak-renderer-wrapper"
400
- }, /*#__PURE__*/React.createElement(BaseTheme, {
433
+ }, jsx(BaseTheme, {
401
434
  dynamicTextSizing: dynamicTextSizing,
402
435
  baseFontSize: !dynamicTextSizing && appearance && appearance !== 'comment' ? akEditorFullPageDefaultFontSize : undefined
403
- }, /*#__PURE__*/React.createElement(Wrapper, {
404
- innerRef: innerRef,
405
- appearance: appearance,
406
- allowNestedHeaderLinks: allowNestedHeaderLinks,
407
- allowColumnSorting: !!allowColumnSorting,
436
+ }, jsx("div", {
437
+ ref: innerRef,
408
438
  onClick: onClick,
409
- onMouseDown: onMouseDown
439
+ onMouseDown: onMouseDown,
440
+ css: rendererStyles({
441
+ appearance: appearance,
442
+ allowNestedHeaderLinks: allowNestedHeaderLinks,
443
+ allowColumnSorting: !!allowColumnSorting
444
+ })
410
445
  }, children)));
411
-
412
- if (!subscribe) {
413
- return /*#__PURE__*/React.createElement(IframeWidthObserverFallbackWrapper, null, renderer);
414
- }
415
-
416
- return renderer;
417
446
  });
418
- /**
419
- * When the product doesn't provide a IframeWidthObserverFallbackWrapper,
420
- * we will give one to the renderer,
421
- *
422
- * so if we have more than one `WidthProvider` on the content,
423
- * only one iframe will be created on the older browsers.
424
- */
425
-
426
- export function RendererWrapper(props) {
427
- return /*#__PURE__*/React.createElement(IframeWrapperConsumer, null, function (_ref) {
428
- var subscribe = _ref.subscribe;
429
- return /*#__PURE__*/React.createElement(RendererWithIframeFallbackWrapper, _extends({}, props, {
430
- subscribe: subscribe
431
- }));
432
- });
433
- }
434
447
 
435
- function RendererActionsInternalUpdater(_ref2) {
436
- var children = _ref2.children,
437
- doc = _ref2.doc,
438
- schema = _ref2.schema,
439
- onAnalyticsEvent = _ref2.onAnalyticsEvent;
448
+ function RendererActionsInternalUpdater(_ref) {
449
+ var children = _ref.children,
450
+ doc = _ref.doc,
451
+ schema = _ref.schema,
452
+ onAnalyticsEvent = _ref.onAnalyticsEvent;
440
453
  var actions = useContext(ActionsContext);
441
454
  var rendererRef = useRef(null);
442
455
  useLayoutEffect(function () {
@@ -460,16 +473,16 @@ var RendererWithAnnotationSelection = function RendererWithAnnotationSelection(p
460
473
  var innerRef = props.innerRef || localRef;
461
474
 
462
475
  if (!allowAnnotations) {
463
- return /*#__PURE__*/React.createElement(RendererWithAnalytics, _extends({
476
+ return jsx(RendererWithAnalytics, _extends({
464
477
  innerRef: innerRef
465
478
  }, props));
466
479
  }
467
480
 
468
- return /*#__PURE__*/React.createElement(RendererActionsContext, null, /*#__PURE__*/React.createElement(AnnotationsWrapper, {
481
+ return jsx(RendererActionsContext, null, jsx(AnnotationsWrapper, {
469
482
  rendererRef: innerRef,
470
483
  adfDocument: adfDocument,
471
484
  annotationProvider: props.annotationProvider
472
- }, /*#__PURE__*/React.createElement(RendererWithAnalytics, _extends({
485
+ }, jsx(RendererWithAnalytics, _extends({
473
486
  innerRef: innerRef
474
487
  }, props))));
475
488
  };
@@ -1,8 +1,8 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
2
 
3
- var _templateObject, _templateObject2;
3
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
4
4
 
5
- import styled, { css } from 'styled-components';
5
+ import { css } from '@emotion/react';
6
6
  import { themed } from '@atlaskit/theme/components';
7
7
  import { gridSize, fontFamily, fontSize, borderRadius } from '@atlaskit/theme/constants';
8
8
  import * as colors from '@atlaskit/theme/colors';
@@ -50,7 +50,7 @@ var alignedHeadingAnchorStyle = function alignedHeadingAnchorStyle(_ref) {
50
50
  return '';
51
51
  }
52
52
 
53
- return "\n .fabric-editor-block-mark[data-align] > {\n h1, h2, h3, h4, h5, h6 {\n position: relative;\n }\n }\n\n /**\n * For right-alignment we flip the link to be before the heading\n * text so that the text is flush up against the edge of the editor's\n * container edge.\n */\n .fabric-editor-block-mark:not([data-align='center'])[data-align] {\n > {\n h1, h2, h3, h4, h5, h6 {\n // Using right to left text to achieve the inverse effect\n // of where the copy link button icon sits for left/center\n // alignment.\n // Although this is unorthodox it's the only approach which\n // allows the button to sit flush against the left edge of\n // bottom line of text.\n direction: rtl;\n\n // By default RTL will negatively impact the layout of special\n // characters within the heading text, and potentially other\n // nested inline nodes. To prevent this we insert pseudo elements\n // containing HTML entities to retain LTR for all heading content\n // except for the copy link button.\n > *:not(.".concat(HeadingAnchorWrapperClassName, "):not(br) {\n ::before {\n // Open LTR: https://www.fileformat.info/info/unicode/char/202a/index.htm\n content: '\u202A';\n }\n ::after {\n // Close LTR: https://www.fileformat.info/info/unicode/char/202c/index.htm\n content: '\u202C';\n }\n }\n }\n }\n .").concat(HeadingAnchorWrapperClassName, " {\n margin: 0 6px 0 0;\n }\n\n @media (hover: hover) and (pointer: fine) {\n .").concat(HeadingAnchorWrapperClassName, " > button {\n transform: translate(8px, 0px);\n }\n }\n }\n }\n ");
53
+ return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .fabric-editor-block-mark[data-align] > {\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n position: relative;\n }\n }\n\n /**\n * For right-alignment we flip the link to be before the heading\n * text so that the text is flush up against the edge of the editor's\n * container edge.\n */\n .fabric-editor-block-mark:not([data-align='center'])[data-align] {\n > {\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n // Using right to left text to achieve the inverse effect\n // of where the copy link button icon sits for left/center\n // alignment.\n // Although this is unorthodox it's the only approach which\n // allows the button to sit flush against the left edge of\n // bottom line of text.\n direction: rtl;\n\n // By default RTL will negatively impact the layout of special\n // characters within the heading text, and potentially other\n // nested inline nodes. To prevent this we insert pseudo elements\n // containing HTML entities to retain LTR for all heading content\n // except for the copy link button.\n > *:not(.", "):not(br) {\n ::before {\n // Open LTR: https://www.fileformat.info/info/unicode/char/202a/index.htm\n content: '\u202A';\n }\n ::after {\n // Close LTR: https://www.fileformat.info/info/unicode/char/202c/index.htm\n content: '\u202C';\n }\n }\n }\n }\n .", " {\n margin: 0 6px 0 0;\n }\n\n @media (hover: hover) and (pointer: fine) {\n .", " > button {\n transform: translate(8px, 0px);\n }\n }\n }\n "], ["\n .fabric-editor-block-mark[data-align] > {\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n position: relative;\n }\n }\n\n /**\n * For right-alignment we flip the link to be before the heading\n * text so that the text is flush up against the edge of the editor's\n * container edge.\n */\n .fabric-editor-block-mark:not([data-align='center'])[data-align] {\n > {\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n // Using right to left text to achieve the inverse effect\n // of where the copy link button icon sits for left/center\n // alignment.\n // Although this is unorthodox it's the only approach which\n // allows the button to sit flush against the left edge of\n // bottom line of text.\n direction: rtl;\n\n // By default RTL will negatively impact the layout of special\n // characters within the heading text, and potentially other\n // nested inline nodes. To prevent this we insert pseudo elements\n // containing HTML entities to retain LTR for all heading content\n // except for the copy link button.\n > *:not(.", "):not(br) {\n ::before {\n // Open LTR: https://www.fileformat.info/info/unicode/char/202a/index.htm\n content: '\\u202A';\n }\n ::after {\n // Close LTR: https://www.fileformat.info/info/unicode/char/202c/index.htm\n content: '\\u202C';\n }\n }\n }\n }\n .", " {\n margin: 0 6px 0 0;\n }\n\n @media (hover: hover) and (pointer: fine) {\n .", " > button {\n transform: translate(8px, 0px);\n }\n }\n }\n "])), HeadingAnchorWrapperClassName, HeadingAnchorWrapperClassName, HeadingAnchorWrapperClassName);
54
54
  };
55
55
 
56
56
  var tableSortableColumnStyle = function tableSortableColumnStyle(_ref2) {
@@ -67,65 +67,72 @@ var tableSortableColumnStyle = function tableSortableColumnStyle(_ref2) {
67
67
  headingsCss = "\n /**\n * When the sort button is enabled we want the heading's copy link button\n * to reserve space so that it can prematurely wrap to avoid the button\n * being displayed underneath the sort button (hidden or obscured).\n *\n * The two buttons fight each other since the sort button is displayed\n * on hover of the <th /> and the copy link button is displayed on hover\n * of the heading.\n *\n * Note that this can break the WYSIWYG experience in the case where\n * a heading fills the width of the table cell and the only thing which\n * wraps is the copy link button. This is hopefully a rare fringe case.\n */\n .".concat(HeadingAnchorWrapperClassName, " {\n position: unset;\n }\n > {\n h1, h2, h3, h4, h5, h6 {\n margin-right: 30px;\n }\n }\n ");
68
68
  }
69
69
 
70
- return "\n .".concat(RendererCssClassName.SORTABLE_COLUMN, " {\n padding: 0;\n\n .").concat(RendererCssClassName.SORTABLE_COLUMN_BUTTON, " {\n width: 100%;\n height: 100%;\n cursor: pointer;\n padding: ").concat(tableCellPadding, "px;\n border-width: 1.5px;\n border-style: solid;\n border-color: transparent;\n\n > *:first-child {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor.-right:first-child + * {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-child + span + * {\n margin-top: 0;\n }\n\n @supports selector(:focus-visible) {\n &:focus {\n outline: unset;\n }\n &:focus-visible {\n border-color: ").concat(colors.B300, ";\n }\n }\n\n ").concat(headingsCss, "\n }\n\n &.").concat(RendererCssClassName.SORTABLE_COLUMN_NOT_ALLOWED, " .").concat(RendererCssClassName.SORTABLE_COLUMN_BUTTON, " {\n cursor: default;\n }\n\n .").concat(RendererCssClassName.SORTABLE_COLUMN_ICON, " {\n margin: 0;\n opacity: 1;\n transition: opacity 0.2s ease-in-out;\n }\n\n .").concat(RendererCssClassName.SORTABLE_COLUMN_NO_ORDER, " {\n opacity: 0;\n }\n\n &:hover {\n .").concat(RendererCssClassName.SORTABLE_COLUMN_NO_ORDER, " {\n opacity: 1;\n }\n }\n }\n ");
70
+ return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n .", " {\n padding: 0;\n\n .", " {\n width: 100%;\n height: 100%;\n cursor: pointer;\n padding: ", "px;\n border-width: 1.5px;\n border-style: solid;\n border-color: transparent;\n\n > *:first-child {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor.-right:first-child + * {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-child + span + * {\n margin-top: 0;\n }\n\n @supports selector(:focus-visible) {\n &:focus {\n outline: unset;\n }\n &:focus-visible {\n border-color: ", ";\n }\n }\n\n ", "\n }\n\n &.", "\n .", " {\n cursor: default;\n }\n\n .", " {\n margin: 0;\n opacity: 1;\n transition: opacity 0.2s ease-in-out;\n }\n\n .", " {\n opacity: 0;\n }\n\n &:hover {\n .", " {\n opacity: 1;\n }\n }\n }\n "])), RendererCssClassName.SORTABLE_COLUMN, RendererCssClassName.SORTABLE_COLUMN_BUTTON, tableCellPadding, colors.B300, headingsCss, RendererCssClassName.SORTABLE_COLUMN_NOT_ALLOWED, RendererCssClassName.SORTABLE_COLUMN_BUTTON, RendererCssClassName.SORTABLE_COLUMN_ICON, RendererCssClassName.SORTABLE_COLUMN_NO_ORDER, RendererCssClassName.SORTABLE_COLUMN_NO_ORDER);
71
71
  };
72
72
 
73
- var fullPageStyles = function fullPageStyles(_ref3) {
74
- var theme = _ref3.theme,
75
- appearance = _ref3.appearance;
73
+ var fullPageStyles = function fullPageStyles(_ref3, _ref4) {
74
+ var appearance = _ref3.appearance;
75
+ var theme = _ref4.theme;
76
76
 
77
77
  if (appearance !== 'full-page' && appearance !== 'mobile') {
78
78
  return '';
79
79
  }
80
80
 
81
- return "\n max-width: ".concat(theme && theme.layoutMaxWidth ? "".concat(theme.layoutMaxWidth, "px") : 'none', ";\n margin: 0 auto;\n padding: 0 ").concat(appearance === 'full-page' ? FullPagePadding : 0, "px;\n ");
81
+ return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n max-width: ", ";\n margin: 0 auto;\n padding: 0 ", "px;\n "])), theme && theme.layoutMaxWidth ? "".concat(theme.layoutMaxWidth, "px") : 'none', appearance === 'full-page' ? FullPagePadding : 0);
82
82
  };
83
83
 
84
- var fullWidthStyles = function fullWidthStyles(_ref4) {
85
- var appearance = _ref4.appearance;
84
+ var fullWidthStyles = function fullWidthStyles(_ref5) {
85
+ var appearance = _ref5.appearance;
86
86
 
87
87
  if (appearance !== 'full-width') {
88
88
  return '';
89
89
  }
90
90
 
91
- return "\n max-width: ".concat(akEditorFullWidthLayoutWidth, "px;\n margin: 0 auto;\n\n .fabric-editor-breakout-mark,\n .pm-table-container,\n .ak-renderer-extension {\n width: 100% !important;\n }\n ");
92
- }; // prettier-ignore
93
-
94
-
95
- export var Wrapper = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n font-size: ", "px;\n line-height: 1.5rem;\n color: ", ";\n\n ", "\n ", "\n\n & h1 {\n ", "\n }\n\n & h2 {\n ", "\n }\n\n & h3 {\n ", "\n }\n\n & h4 {\n ", "\n }\n\n & h5 {\n ", "\n }\n\n & h6 {\n ", "\n }\n\n & span.akActionMark {\n color: ", ";\n text-decoration: none;\n\n &:hover {\n color: ", ";\n text-decoration: underline;\n }\n }\n\n & span.akActionMark {\n cursor: pointer;\n }\n\n & span[data-placeholder] {\n color: ", ";\n }\n\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", "\n\n & .UnknownBlock {\n font-family: ", ";\n font-size: ", ";\n font-weight: 400;\n white-space: pre-wrap;\n word-wrap: break-word;\n }\n\n & span.date-node {\n background: ", ";\n border-radius: ", "px;\n color: ", ";\n padding: 2px 4px;\n margin: 0 1px;\n transition: background 0.3s;\n }\n\n & span.date-node-highlighted {\n background: ", ";\n color: ", ";\n }\n\n & .renderer-image {\n max-width: 100%;\n display: block;\n margin: ", "px 0;\n }\n\n .", ".rich-media-wrapped + .", ":not(.rich-media-wrapped) {\n clear: both;\n }\n\n & .code-block,\n & blockquote,\n & hr,\n & > div > div:not(.rich-media-wrapped),\n .", ".rich-media-wrapped + .rich-media-wrapped + *:not(.rich-media-wrapped),\n .", ".rich-media-wrapped + div:not(.rich-media-wrapped),\n .", ".image-align-start,\n .", ".image-center,\n .", ".image-align-end {\n clear: both;\n }\n\n & .rich-media-wrapped {\n & + h1,\n & + h2,\n & + h3,\n & + h4,\n & + h5,\n & + h6 {\n margin-top: 8px;\n }\n }\n\n ", "\n\n ", " &\n div[class^='image-wrap-'] + div[class^='image-wrap-'] {\n margin-left: 0;\n margin-right: 0;\n }\n\n /* Breakout for tables and extensions */\n .", " > {\n * .", " {\n width: 100% !important;\n left: 0 !important;\n }\n\n * .", " {\n overflow-x: auto;\n }\n\n & .", ":first-child {\n margin-top: 0;\n }\n }\n\n .", " {\n margin-top: ", ";\n }\n\n .", " {\n margin-left: 50%;\n transform: translateX(-50%);\n }\n\n .", " {\n overflow-x: auto;\n }\n\n ", "\n\n .", " {\n z-index: 0;\n transition: all 0.1s linear;\n display: flex; /* needed to avoid position: fixed jumpiness in Chrome */\n\n /** Shadow overrides */\n &.", "::after, &.", "::before {\n top: ", "px;\n height: calc(100% - ", "px);\n z-index: ", ";\n }\n\n /**\n * A hack for making all the <th /> heights equal in case some have shorter\n * content than others.\n *\n * This is done to make sort buttons fill entire <th />.\n */\n table {\n height: 1px; /* will be ignored */\n ", ";\n margin-left: 0;\n margin-right: 0;\n }\n\n table tr:first-child {\n height: 100%;\n\n td, th {\n position: relative;\n }\n }\n\n table[data-number-column='true'] {\n .", " {\n background-color: ", ";\n border-right: 1px solid ", ";\n width: ", "px;\n text-align: center;\n color: ", ";\n font-size: ", ";\n }\n\n .fixed .", " {\n border-right: 0px none;\n }\n }\n }\n\n tr[data-header-row].fixed {\n position: fixed !important;\n display: flex;\n overflow: hidden;\n z-index: ", ";\n\n border-right: 1px solid ", ";\n border-bottom: 1px solid ", ";\n\n /* this is to compensate for the table border */\n transform: translateX(-1px);\n }\n\n .sticky > th {\n z-index: ", ";\n position: sticky !important;\n top: 0;\n }\n\n /* Make the number column header sticky */\n .sticky > td {\n position: sticky !important;\n top: 0;\n }\n\n /* add border for position: sticky\n and work around background-clip: padding-box\n bug for FF causing box-shadow bug in Chrome */\n .sticky th, .sticky td {\n box-shadow: 0px 1px ", ", 0px -0.5px ", ", inset -1px 0px ", ", 0px -1px ", ";\n }\n\n /* this will remove jumpiness caused in Chrome for sticky headers */\n .fixed + tr {\n min-height: 0px;\n }\n\n /*\n * We wrap CodeBlock in a grid to prevent it from overflowing the container of the renderer.\n * See ED-4159.\n */\n & .code-block {\n max-width: 100%;\n /* -ms- properties are necessary until MS supports the latest version of the grid spec */\n /* stylelint-disable value-no-vendor-prefix, declaration-block-no-duplicate-properties */\n display: -ms-grid;\n display: grid;\n -ms-grid-columns: auto 1fr;\n /* stylelint-enable */\n\n grid-template-columns: minmax(0, 1fr);\n position: relative;\n border-radius: ", "px;\n\n /*\n * The overall renderer has word-wrap: break; which causes issues with\n * code block line numbers in Safari / iOS.\n */\n word-wrap: normal;\n\n & > span {\n /* stylelint-disable value-no-vendor-prefix */\n -ms-grid-row: 1;\n -ms-grid-column: 2;\n /* stylelint-enable */\n grid-column: 1;\n }\n }\n\n & .MediaGroup,\n & .code-block {\n margin-top: ", ";\n\n &:first-child {\n margin-top: 0;\n }\n\n &:hover button.copy-to-clipboard, .copy-to-clipboard:focus{\n opacity: 1;\n position: absolute;\n height: 32px;\n width: 32px;\n right: 6px;\n top: 4px;\n padding: 2px;\n }\n }\n\n ", ";\n & [data-layout-section] {\n margin-top: ", "px;\n & > div + div {\n margin-left: ", "px;\n }\n\n @media screen and (max-width: ", "px) {\n & > div + div {\n margin-left: 0;\n }\n }\n }\n"])), editorFontSize, themed({
96
- light: colors.N800,
97
- dark: '#B8C7E0'
98
- }), fullPageStyles, fullWidthStyles, headingAnchorStyle('h1'), headingAnchorStyle('h2'), headingAnchorStyle('h3'), headingAnchorStyle('h4'), headingAnchorStyle('h5'), headingAnchorStyle('h6'), colors.B400, colors.B300, colors.placeholderText, whitespaceSharedStyles, blockquoteSharedStyles, headingsSharedStyles, panelSharedStyles, ruleSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, blockMarksSharedStyles, codeMarkSharedStyles, shadowSharedStyle, dateSharedStyle, textColorStyles, tasksAndDecisionsStyles, smartCardSharedStyles, fontFamily(), relativeFontSizeToBase16(fontSize()), themed({
99
- light: colors.N30A,
100
- dark: colors.DN70
101
- }), borderRadius(), themed({
102
- light: colors.N800,
103
- dark: colors.DN600
104
- }), colors.R50, colors.R500, gridSize() * 3, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, alignedHeadingAnchorStyle, mediaSingleSharedStyle, RendererCssClassName.DOCUMENT, TableSharedCssClassName.TABLE_CONTAINER, RendererCssClassName.EXTENSION_OVERFLOW_CONTAINER, RendererCssClassName.EXTENSION, RendererCssClassName.EXTENSION, blockNodesVerticalMargin, RendererCssClassName.EXTENSION_CENTER_ALIGN, TableSharedCssClassName.TABLE_NODE_WRAPPER, tableSharedStyle, TableSharedCssClassName.TABLE_CONTAINER, shadowClassNames.RIGHT_SHADOW, shadowClassNames.LEFT_SHADOW, tableMarginTop - 1, tableMarginTop, akEditorStickyHeaderZIndex, tableSortableColumnStyle, RendererCssClassName.NUMBER_COLUMN, themed({
105
- light: akEditorTableToolbar,
106
- dark: akEditorTableToolbarDark
107
- }), themed({
108
- light: akEditorTableBorder,
109
- dark: akEditorTableBorderDark
110
- }), akEditorTableNumberColumnWidth, themed({
111
- light: colors.N200,
112
- dark: colors.DN400
113
- }), relativeFontSizeToBase16(fontSize()), RendererCssClassName.NUMBER_COLUMN, akEditorStickyHeaderZIndex, themed({
114
- light: akEditorTableBorder,
115
- dark: akEditorTableBorderDark
116
- }), themed({
117
- light: akEditorTableBorder,
118
- dark: akEditorTableBorderDark
119
- }), akEditorStickyHeaderZIndex, themed({
120
- light: akEditorTableBorder,
121
- dark: akEditorTableBorderDark
122
- }), themed({
123
- light: akEditorTableBorder,
124
- dark: akEditorTableBorderDark
125
- }), themed({
126
- light: akEditorTableToolbar,
127
- dark: akEditorTableToolbarDark
128
- }), themed({
129
- light: akEditorTableToolbar,
130
- dark: akEditorTableToolbarDark
131
- }), borderRadius(), blockNodesVerticalMargin, columnLayoutSharedStyle, gridSize() * 2.5, gridSize() * 4, gridMediumMaxWidth);
91
+ return css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n max-width: ", "px;\n margin: 0 auto;\n\n .fabric-editor-breakout-mark,\n .pm-table-container,\n .ak-renderer-extension {\n width: 100% !important;\n }\n "])), akEditorFullWidthLayoutWidth);
92
+ };
93
+
94
+ export var rendererStyles = function rendererStyles(wrapperProps) {
95
+ return function (theme) {
96
+ // This is required to be compatible with styled-components prop structure.
97
+ var themeProps = {
98
+ theme: theme
99
+ };
100
+ return css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n font-size: ", "px;\n line-height: 1.5rem;\n color: ", ";\n\n .", "::after {\n // we add a clearfix after ak-renderer-document in order to\n // contain internal floats (such as media images that are \"wrap-left\")\n // to just the renderer (and not spill outside of it)\n content: '';\n visibility: hidden;\n display: block;\n height: 0;\n clear: both;\n }\n\n ", "\n ", "\n\n & h1 {\n ", "\n }\n\n & h2 {\n ", "\n }\n\n & h3 {\n ", "\n }\n\n & h4 {\n ", "\n }\n\n & h5 {\n ", "\n }\n\n & h6 {\n ", "\n }\n\n & span.akActionMark {\n color: ", ";\n text-decoration: none;\n\n &:hover {\n color: ", ";\n text-decoration: underline;\n }\n }\n\n & span.akActionMark {\n cursor: pointer;\n }\n\n & span[data-placeholder] {\n color: ", ";\n }\n\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", "\n\n & .UnknownBlock {\n font-family: ", ";\n font-size: ", ";\n font-weight: 400;\n white-space: pre-wrap;\n word-wrap: break-word;\n }\n\n & span.date-node {\n background: ", ";\n border-radius: ", "px;\n color: ", ";\n padding: 2px 4px;\n margin: 0 1px;\n transition: background 0.3s;\n }\n\n & span.date-node-highlighted {\n background: ", ";\n color: ", ";\n }\n\n & .renderer-image {\n max-width: 100%;\n display: block;\n margin: ", "px 0;\n }\n\n .", ".rich-media-wrapped\n + .", ":not(.rich-media-wrapped) {\n clear: both;\n }\n\n & .code-block,\n & blockquote,\n & hr,\n & > div > div:not(.rich-media-wrapped),\n .", ".rich-media-wrapped\n + .rich-media-wrapped\n + *:not(.rich-media-wrapped),\n .", ".rich-media-wrapped + div:not(.rich-media-wrapped),\n .", ".image-align-start,\n .", ".image-center,\n .", ".image-align-end {\n clear: both;\n }\n\n & .rich-media-wrapped {\n & + h1,\n & + h2,\n & + h3,\n & + h4,\n & + h5,\n & + h6 {\n margin-top: 8px;\n }\n }\n\n ", "\n /* plugin styles */\n ", " &\n div[class^='image-wrap-'] + div[class^='image-wrap-'] {\n margin-left: 0;\n margin-right: 0;\n }\n\n /* Breakout for tables and extensions */\n .", " > {\n * .", " {\n width: 100% !important;\n left: 0 !important;\n }\n\n * .", " {\n overflow-x: auto;\n }\n\n & .", ":first-child {\n margin-top: 0;\n }\n }\n\n .", " {\n .", " {\n margin-top: ", ";\n }\n\n .", " {\n margin-left: 50%;\n transform: translateX(-50%);\n }\n\n .", " {\n overflow-x: auto;\n }\n }\n\n ", "\n\n .", " .", " {\n z-index: 0;\n transition: all 0.1s linear;\n display: flex; /* needed to avoid position: fixed jumpiness in Chrome */\n\n /** Shadow overrides */\n &.", "::after,\n &.", "::before {\n top: ", "px;\n height: calc(100% - ", "px);\n z-index: ", ";\n }\n\n /**\n * A hack for making all the <th /> heights equal in case some have shorter\n * content than others.\n *\n * This is done to make sort buttons fill entire <th />.\n */\n table {\n height: 1px; /* will be ignored */\n ", ";\n margin-left: 0;\n margin-right: 0;\n }\n\n table tr:first-child {\n height: 100%;\n\n td,\n th {\n position: relative;\n }\n }\n\n table[data-number-column='true'] {\n .", " {\n background-color: ", ";\n border-right: 1px solid\n ", ";\n width: ", "px;\n text-align: center;\n color: ", ";\n font-size: ", ";\n }\n\n .fixed .", " {\n border-right: 0px none;\n }\n }\n }\n\n tr[data-header-row].fixed {\n position: fixed !important;\n display: flex;\n overflow: hidden;\n z-index: ", ";\n\n border-right: 1px solid\n ", ";\n border-bottom: 1px solid\n ", ";\n\n /* this is to compensate for the table border */\n transform: translateX(-1px);\n }\n\n .sticky > th {\n z-index: ", ";\n position: sticky !important;\n top: 0;\n }\n\n /* Make the number column header sticky */\n .sticky > td {\n position: sticky !important;\n top: 0;\n }\n\n /* add border for position: sticky\n and work around background-clip: padding-box\n bug for FF causing box-shadow bug in Chrome */\n .sticky th,\n .sticky td {\n box-shadow: 0px 1px\n ", ",\n 0px -0.5px ", ",\n inset -1px 0px ", ",\n 0px -1px ", ";\n }\n\n /* this will remove jumpiness caused in Chrome for sticky headers */\n .fixed + tr {\n min-height: 0px;\n }\n\n /*\n * We wrap CodeBlock in a grid to prevent it from overflowing the container of the renderer.\n * See ED-4159.\n */\n & .code-block {\n max-width: 100%;\n /* -ms- properties are necessary until MS supports the latest version of the grid spec */\n /* stylelint-disable value-no-vendor-prefix, declaration-block-no-duplicate-properties */\n display: -ms-grid;\n display: grid;\n -ms-grid-columns: auto 1fr;\n /* stylelint-enable */\n\n grid-template-columns: minmax(0, 1fr);\n position: relative;\n border-radius: ", "px;\n\n /*\n * The overall renderer has word-wrap: break; which causes issues with\n * code block line numbers in Safari / iOS.\n */\n word-wrap: normal;\n\n & > span {\n /* stylelint-disable value-no-vendor-prefix */\n -ms-grid-row: 1;\n -ms-grid-column: 2;\n /* stylelint-enable */\n grid-column: 1;\n }\n }\n\n & .MediaGroup,\n & .code-block {\n margin-top: ", ";\n\n &:first-child {\n margin-top: 0;\n }\n\n &:hover button.copy-to-clipboard,\n .copy-to-clipboard:focus {\n opacity: 1;\n position: absolute;\n height: 32px;\n width: 32px;\n right: 6px;\n top: 4px;\n padding: 2px;\n }\n }\n\n ", ";\n & [data-layout-section] {\n margin-top: ", "px;\n & > div + div {\n margin-left: ", "px;\n }\n\n @media screen and (max-width: ", "px) {\n & > div + div {\n margin-left: 0;\n }\n }\n }\n "])), editorFontSize(themeProps), themed({
101
+ light: colors.N800,
102
+ dark: '#B8C7E0'
103
+ })(themeProps), RendererCssClassName.DOCUMENT, fullPageStyles(wrapperProps, themeProps), fullWidthStyles(wrapperProps), headingAnchorStyle('h1'), headingAnchorStyle('h2'), headingAnchorStyle('h3'), headingAnchorStyle('h4'), headingAnchorStyle('h5'), headingAnchorStyle('h6'), colors.B400, colors.B300, colors.placeholderText(themeProps), whitespaceSharedStyles, blockquoteSharedStyles, headingsSharedStyles(themeProps), panelSharedStyles(themeProps), ruleSharedStyles(themeProps), paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, blockMarksSharedStyles, codeMarkSharedStyles(themeProps), shadowSharedStyle, dateSharedStyle, textColorStyles, tasksAndDecisionsStyles, smartCardSharedStyles, fontFamily(), relativeFontSizeToBase16(fontSize()), themed({
104
+ light: colors.N30A,
105
+ dark: colors.DN70
106
+ })(themeProps), borderRadius(), themed({
107
+ light: colors.N800,
108
+ dark: colors.DN600
109
+ })(themeProps), colors.R50, colors.R500, gridSize() * 3, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, alignedHeadingAnchorStyle(wrapperProps), mediaSingleSharedStyle, RendererCssClassName.DOCUMENT, TableSharedCssClassName.TABLE_CONTAINER, RendererCssClassName.EXTENSION_OVERFLOW_CONTAINER, RendererCssClassName.EXTENSION, RendererCssClassName.DOCUMENT, RendererCssClassName.EXTENSION, blockNodesVerticalMargin, RendererCssClassName.EXTENSION_CENTER_ALIGN, TableSharedCssClassName.TABLE_NODE_WRAPPER, tableSharedStyle(themeProps), RendererCssClassName.DOCUMENT, TableSharedCssClassName.TABLE_CONTAINER, shadowClassNames.RIGHT_SHADOW, shadowClassNames.LEFT_SHADOW, tableMarginTop - 1, tableMarginTop, akEditorStickyHeaderZIndex, tableSortableColumnStyle(wrapperProps), RendererCssClassName.NUMBER_COLUMN, themed({
110
+ light: akEditorTableToolbar,
111
+ dark: akEditorTableToolbarDark
112
+ })(themeProps), themed({
113
+ light: akEditorTableBorder,
114
+ dark: akEditorTableBorderDark
115
+ })(themeProps), akEditorTableNumberColumnWidth, themed({
116
+ light: colors.N200,
117
+ dark: colors.DN400
118
+ })(themeProps), relativeFontSizeToBase16(fontSize()), RendererCssClassName.NUMBER_COLUMN, akEditorStickyHeaderZIndex, themed({
119
+ light: akEditorTableBorder,
120
+ dark: akEditorTableBorderDark
121
+ })(themeProps), themed({
122
+ light: akEditorTableBorder,
123
+ dark: akEditorTableBorderDark
124
+ })(themeProps), akEditorStickyHeaderZIndex, themed({
125
+ light: akEditorTableBorder,
126
+ dark: akEditorTableBorderDark
127
+ })(themeProps), themed({
128
+ light: akEditorTableBorder,
129
+ dark: akEditorTableBorderDark
130
+ })(themeProps), themed({
131
+ light: akEditorTableToolbar,
132
+ dark: akEditorTableToolbarDark
133
+ })(themeProps), themed({
134
+ light: akEditorTableToolbar,
135
+ dark: akEditorTableToolbarDark
136
+ })(themeProps), borderRadius(), blockNodesVerticalMargin, columnLayoutSharedStyle, gridSize() * 2.5, gridSize() * 4, gridMediumMaxWidth);
137
+ };
138
+ };
@@ -11,20 +11,26 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
11
11
 
12
12
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
13
13
 
14
- import React from 'react';
14
+ /** @jsx jsx */
15
+ import { css, jsx } from '@emotion/react';
15
16
  import { Component } from 'react';
16
- import styled from 'styled-components';
17
- var FadeOut = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n overflow-y: hidden;\n max-height: ", "px;\n &::after {\n content: '';\n position: absolute;\n top: ", "px;\n bottom: 0;\n left: 0;\n right: 0;\n /* Using 'rgba(255, 255, 255, 0)' because 'transparent' breaks the gradient in Safari 11 */\n background-image: ", ";\n }\n"])), function (_ref) {
18
- var height = _ref.height;
19
- return height;
20
- }, function (_ref2) {
21
- var height = _ref2.height,
22
- fadeHeight = _ref2.fadeHeight;
23
- return height - fadeHeight;
24
- }, function (_ref3) {
25
- var backgroundColor = _ref3.backgroundColor;
26
- return "linear-gradient(rgba(255, 255, 255, 0), ".concat(backgroundColor, ")");
27
- });
17
+
18
+ var fadeOutStyles = function fadeOutStyles(maxHeight, top, backgroundColor) {
19
+ return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n overflow-y: hidden;\n max-height: ", "px;\n &::after {\n content: '';\n position: absolute;\n top: ", "px;\n bottom: 0;\n left: 0;\n right: 0;\n background-image: linear-gradient(\n rgba(255, 255, 255, 0),\n ", "\n );\n }\n"])), maxHeight, top, backgroundColor);
20
+ };
21
+
22
+ var FadeOut = function FadeOut(props) {
23
+ var children = props.children,
24
+ backgroundColor = props.backgroundColor,
25
+ fadeHeight = props.fadeHeight,
26
+ height = props.height;
27
+ var top = height - fadeHeight;
28
+ var styles = fadeOutStyles(height, top, backgroundColor);
29
+ return jsx("div", {
30
+ css: styles
31
+ }, children);
32
+ };
33
+
28
34
  export var TruncatedWrapper = /*#__PURE__*/function (_Component) {
29
35
  _inherits(TruncatedWrapper, _Component);
30
36
 
@@ -47,7 +53,7 @@ export var TruncatedWrapper = /*#__PURE__*/function (_Component) {
47
53
  _this$props$backgroun = _this$props.backgroundColor,
48
54
  backgroundColor = _this$props$backgroun === void 0 ? 'white' : _this$props$backgroun,
49
55
  children = _this$props.children;
50
- return /*#__PURE__*/React.createElement(FadeOut, {
56
+ return jsx(FadeOut, {
51
57
  height: height,
52
58
  fadeHeight: fadeHeight,
53
59
  backgroundColor: backgroundColor
@@ -2,8 +2,8 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
2
2
 
3
3
  var _templateObject, _templateObject2;
4
4
 
5
- import React from 'react';
6
- import styled from 'styled-components';
5
+ /** @jsx jsx */
6
+ import { css, jsx } from '@emotion/react';
7
7
  import Tooltip from '@atlaskit/tooltip';
8
8
  import { gridSize } from '@atlaskit/theme/constants';
9
9
  import { N20, N30 } from '@atlaskit/theme/colors';
@@ -24,8 +24,8 @@ export var StatusClassNames;
24
24
  StatusClassNames["SORTING_NOT_ALLOWED"] = "sorting-icon-svg__not-allowed";
25
25
  })(StatusClassNames || (StatusClassNames = {}));
26
26
 
27
- var Wrapper = styled.figure(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n display: flex;\n height: 28px;\n width: 28px;\n margin: 6px;\n right: 0;\n top: 0;\n border: 2px solid #fff;\n border-radius: ", "px;\n background-color: ", ";\n justify-content: center;\n align-items: center;\n\n &:hover {\n background-color: ", ";\n }\n\n &.", " {\n cursor: not-allowed;\n }\n"])), gridSize() / 2, N20, N30, StatusClassNames.SORTING_NOT_ALLOWED);
28
- var TableSortingIcon = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: 8px;\n height: 12px;\n transition: transform 0.3s cubic-bezier(0.15, 1, 0.3, 1);\n transform-origin: 50% 50%;\n background-image: url(", ");\n\n &.", " {\n transform: rotate(-180deg);\n }\n\n &.", "-inactive {\n opacity: 0.7;\n }\n"])), TableSortIconDataUrl, StatusClassNames.DESC, TABLE_SORTING_ICON_CLASS);
27
+ var wrapperStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n display: flex;\n height: 28px;\n width: 28px;\n margin: 6px;\n right: 0;\n top: 0;\n border: 2px solid #fff;\n border-radius: ", "px;\n background-color: ", ";\n justify-content: center;\n align-items: center;\n\n &:hover {\n background-color: ", ";\n }\n\n &.", " {\n cursor: not-allowed;\n }\n"])), gridSize() / 2, N20, N30, StatusClassNames.SORTING_NOT_ALLOWED);
28
+ var tableSortingIconStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: 8px;\n height: 12px;\n transition: transform 0.3s cubic-bezier(0.15, 1, 0.3, 1);\n transform-origin: 50% 50%;\n background-image: url(", ");\n\n &.", " {\n transform: rotate(-180deg);\n }\n\n &.", "-inactive {\n opacity: 0.7;\n }\n"])), TableSortIconDataUrl, StatusClassNames.DESC, TABLE_SORTING_ICON_CLASS);
29
29
 
30
30
  var getClassName = function getClassName(status) {
31
31
  switch (status) {
@@ -71,13 +71,15 @@ var SortingIcon = function SortingIcon(_ref) {
71
71
  var activated = sortOrdered !== SortOrder.NO_ORDER;
72
72
  var wrapperClassName = !isSortingAllowed ? StatusClassNames.SORTING_NOT_ALLOWED : '';
73
73
  var content = getTooltipTitle(intl, isSortingAllowed, sortOrdered);
74
- return /*#__PURE__*/React.createElement(Tooltip, {
74
+ return jsx(Tooltip, {
75
75
  delay: 0,
76
76
  content: content,
77
77
  position: "top"
78
- }, /*#__PURE__*/React.createElement(Wrapper, {
78
+ }, jsx("figure", {
79
+ css: wrapperStyles,
79
80
  className: wrapperClassName
80
- }, /*#__PURE__*/React.createElement(TableSortingIcon, {
81
+ }, jsx("div", {
82
+ css: tableSortingIconStyles,
81
83
  className: "".concat(getClassName(sortOrdered), " ").concat(TABLE_SORTING_ICON_CLASS, "-").concat(activated ? 'active' : 'inactive')
82
84
  })));
83
85
  };