@atlaskit/renderer 92.0.0 → 93.0.1

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 (115) hide show
  1. package/CHANGELOG.md +75 -0
  2. package/dist/cjs/analytics/enums.js +1 -0
  3. package/dist/cjs/i18n/en.js +28 -0
  4. package/dist/cjs/i18n/en_GB.js +28 -0
  5. package/dist/cjs/i18n/pl.js +7 -1
  6. package/dist/cjs/i18n/pt_BR.js +1 -1
  7. package/dist/cjs/react/marks/alignment.js +11 -12
  8. package/dist/cjs/react/marks/breakout.js +7 -9
  9. package/dist/cjs/react/marks/link.js +13 -6
  10. package/dist/cjs/react/nodes/codeBlock.js +1 -1
  11. package/dist/cjs/react/nodes/codeBlockCopyButton.js +13 -11
  12. package/dist/cjs/react/nodes/embedCard.js +25 -33
  13. package/dist/cjs/react/nodes/heading-anchor.js +7 -6
  14. package/dist/cjs/react/nodes/mediaSingle/index.js +15 -4
  15. package/dist/cjs/react/nodes/mediaSingle/styles.js +7 -10
  16. package/dist/cjs/react/nodes/panel.js +36 -20
  17. package/dist/cjs/react/nodes/table/sticky.js +51 -54
  18. package/dist/cjs/react/nodes/table.js +2 -10
  19. package/dist/cjs/react/utils/performance/RenderTracking.js +52 -0
  20. package/dist/cjs/render-document.js +2 -2
  21. package/dist/cjs/text/index.js +2 -2
  22. package/dist/cjs/ui/Expand.js +40 -20
  23. package/dist/cjs/ui/MediaCard.js +4 -14
  24. package/dist/cjs/ui/Renderer/click-to-edit.js +4 -4
  25. package/dist/cjs/ui/Renderer/index.js +39 -50
  26. package/dist/cjs/ui/Renderer/style.js +58 -63
  27. package/dist/cjs/ui/Renderer/truncated-wrapper.js +19 -21
  28. package/dist/cjs/ui/SortingIcon.js +8 -9
  29. package/dist/cjs/ui/renderer-props.js +1 -3
  30. package/dist/cjs/utils.js +2 -2
  31. package/dist/cjs/version.json +1 -1
  32. package/dist/es2019/analytics/enums.js +1 -0
  33. package/dist/es2019/i18n/en.js +20 -0
  34. package/dist/es2019/i18n/en_GB.js +20 -0
  35. package/dist/es2019/i18n/pl.js +7 -1
  36. package/dist/es2019/i18n/pt_BR.js +1 -1
  37. package/dist/es2019/react/marks/alignment.js +15 -7
  38. package/dist/es2019/react/marks/breakout.js +6 -5
  39. package/dist/es2019/react/marks/link.js +8 -5
  40. package/dist/es2019/react/nodes/codeBlock.js +1 -1
  41. package/dist/es2019/react/nodes/codeBlockCopyButton.js +12 -9
  42. package/dist/es2019/react/nodes/embedCard.js +16 -16
  43. package/dist/es2019/react/nodes/heading-anchor.js +9 -6
  44. package/dist/es2019/react/nodes/mediaSingle/index.js +10 -6
  45. package/dist/es2019/react/nodes/mediaSingle/styles.js +6 -7
  46. package/dist/es2019/react/nodes/panel.js +38 -18
  47. package/dist/es2019/react/nodes/table/sticky.js +48 -41
  48. package/dist/es2019/react/nodes/table.js +2 -5
  49. package/dist/es2019/react/utils/performance/RenderTracking.js +37 -0
  50. package/dist/es2019/render-document.js +1 -1
  51. package/dist/es2019/text/index.js +1 -1
  52. package/dist/es2019/ui/Expand.js +52 -28
  53. package/dist/es2019/ui/MediaCard.js +3 -6
  54. package/dist/es2019/ui/Renderer/click-to-edit.js +1 -1
  55. package/dist/es2019/ui/Renderer/index.js +38 -43
  56. package/dist/es2019/ui/Renderer/style.js +363 -337
  57. package/dist/es2019/ui/Renderer/truncated-wrapper.js +26 -15
  58. package/dist/es2019/ui/SortingIcon.js +9 -7
  59. package/dist/es2019/ui/renderer-props.js +1 -1
  60. package/dist/es2019/utils.js +1 -1
  61. package/dist/es2019/version.json +1 -1
  62. package/dist/esm/analytics/enums.js +1 -0
  63. package/dist/esm/i18n/en.js +20 -0
  64. package/dist/esm/i18n/en_GB.js +20 -0
  65. package/dist/esm/i18n/pl.js +7 -1
  66. package/dist/esm/i18n/pt_BR.js +1 -1
  67. package/dist/esm/react/marks/alignment.js +13 -6
  68. package/dist/esm/react/marks/breakout.js +6 -5
  69. package/dist/esm/react/marks/link.js +7 -5
  70. package/dist/esm/react/nodes/codeBlock.js +1 -1
  71. package/dist/esm/react/nodes/codeBlockCopyButton.js +10 -7
  72. package/dist/esm/react/nodes/embedCard.js +19 -19
  73. package/dist/esm/react/nodes/heading-anchor.js +8 -6
  74. package/dist/esm/react/nodes/mediaSingle/index.js +11 -6
  75. package/dist/esm/react/nodes/mediaSingle/styles.js +5 -7
  76. package/dist/esm/react/nodes/panel.js +34 -17
  77. package/dist/esm/react/nodes/table/sticky.js +53 -52
  78. package/dist/esm/react/nodes/table.js +2 -8
  79. package/dist/esm/react/utils/performance/RenderTracking.js +39 -0
  80. package/dist/esm/render-document.js +1 -1
  81. package/dist/esm/text/index.js +1 -1
  82. package/dist/esm/ui/Expand.js +45 -21
  83. package/dist/esm/ui/MediaCard.js +3 -9
  84. package/dist/esm/ui/Renderer/click-to-edit.js +1 -1
  85. package/dist/esm/ui/Renderer/index.js +39 -47
  86. package/dist/esm/ui/Renderer/style.js +56 -57
  87. package/dist/esm/ui/Renderer/truncated-wrapper.js +20 -14
  88. package/dist/esm/ui/SortingIcon.js +9 -7
  89. package/dist/esm/ui/renderer-props.js +1 -1
  90. package/dist/esm/utils.js +1 -1
  91. package/dist/esm/version.json +1 -1
  92. package/dist/types/analytics/enums.d.ts +1 -0
  93. package/dist/types/analytics/events.d.ts +7 -2
  94. package/dist/types/i18n/en.d.ts +20 -0
  95. package/dist/types/i18n/en_GB.d.ts +20 -0
  96. package/dist/types/i18n/pl.d.ts +6 -0
  97. package/dist/types/react/marks/alignment.d.ts +2 -2
  98. package/dist/types/react/marks/breakout.d.ts +4 -3
  99. package/dist/types/react/marks/link.d.ts +2 -2
  100. package/dist/types/react/nodes/embedCard.d.ts +3 -2
  101. package/dist/types/react/nodes/heading-anchor.d.ts +1 -0
  102. package/dist/types/react/nodes/media.d.ts +1 -1
  103. package/dist/types/react/nodes/mediaSingle/index.d.ts +1 -0
  104. package/dist/types/react/nodes/mediaSingle/styles.d.ts +2 -3
  105. package/dist/types/react/nodes/panel.d.ts +3 -1
  106. package/dist/types/react/nodes/table/sticky.d.ts +4 -2
  107. package/dist/types/react/utils/performance/RenderTracking.d.ts +15 -0
  108. package/dist/types/ui/Expand.d.ts +2 -2
  109. package/dist/types/ui/MediaCard.d.ts +1 -3
  110. package/dist/types/ui/Renderer/index.d.ts +0 -25
  111. package/dist/types/ui/Renderer/style.d.ts +1 -4
  112. package/dist/types/ui/Renderer/truncated-wrapper.d.ts +3 -1
  113. package/dist/types/ui/SortingIcon.d.ts +3 -3
  114. package/dist/types/ui/renderer-props.d.ts +14 -2
  115. package/package.json +22 -24
@@ -16,22 +16,21 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
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
18
  /** @jsx jsx */
19
- import React, { useContext, useLayoutEffect, useRef } from 'react';
19
+ import React, { Fragment, useContext, useLayoutEffect, useRef } from 'react';
20
20
  import { jsx } from '@emotion/react';
21
21
  import { PureComponent } from 'react';
22
- import { getSchemaBasedOnStage } from '@atlaskit/adf-schema';
22
+ import { getSchemaBasedOnStage } from '@atlaskit/adf-schema/schema-default';
23
23
  import { reduce } from '@atlaskit/adf-utils';
24
24
  import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
25
- import { UnsupportedBlock, BaseTheme, WidthProvider, WithCreateAnalyticsEvent, LegacyToNextIntlProvider, IntlLegacyFallbackProvider, IntlNextErrorBoundary } from '@atlaskit/editor-common/ui';
25
+ import { UnsupportedBlock, BaseTheme, WidthProvider, WithCreateAnalyticsEvent, IntlErrorBoundary } from '@atlaskit/editor-common/ui';
26
26
  import { getAnalyticsAppearance, getAnalyticsEventSeverity, getResponseEndTime, startMeasure, stopMeasure, shouldForceTracking, measureTTI } from '@atlaskit/editor-common/utils';
27
27
  import { normalizeFeatureFlags } from '@atlaskit/editor-common/normalize-feature-flags';
28
28
  import { akEditorFullPageDefaultFontSize } from '@atlaskit/editor-shared-styles';
29
- import { IframeWidthObserverFallbackWrapper, IframeWrapperConsumer } from '@atlaskit/width-detector';
30
29
  import { FabricChannel } from '@atlaskit/analytics-listeners';
31
30
  import { FabricEditorAnalyticsContext } from '@atlaskit/analytics-namespaced-context';
32
31
  import uuid from 'uuid/v4';
33
32
  import { ReactSerializer, renderDocument } from '../../';
34
- import { DeprecatedWrapper, rendererStyles } from './style';
33
+ import { rendererStyles } from './style';
35
34
  import { TruncatedWrapper } from './truncated-wrapper';
36
35
  import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../../analytics/enums';
37
36
  import { PLATFORM, MODE } from '../../analytics/events';
@@ -49,6 +48,7 @@ import { isInteractiveElement } from './click-to-edit';
49
48
  import { RendererContextProvider } from '../../renderer-context';
50
49
  import memoizeOne from 'memoize-one';
51
50
  import { ErrorBoundary } from './ErrorBoundary';
51
+ import { RenderTracking } from '../../react/utils/performance/RenderTracking';
52
52
  export var NORMAL_SEVERITY_THRESHOLD = 2000;
53
53
  export var DEGRADED_SEVERITY_THRESHOLD = 3000;
54
54
  export var Renderer = /*#__PURE__*/function (_PureComponent) {
@@ -64,8 +64,11 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
64
64
  _this = _super.call(this, props);
65
65
 
66
66
  _defineProperty(_assertThisInitialized(_this), "featureFlags", memoizeOne(function (featureFlags) {
67
+ var normalizedFeatureFlags = normalizeFeatureFlags(featureFlags, {
68
+ objectFlagKeys: ['rendererRenderTracking']
69
+ });
67
70
  return {
68
- featureFlags: normalizeFeatureFlags(featureFlags)
71
+ featureFlags: normalizedFeatureFlags
69
72
  };
70
73
  }));
71
74
 
@@ -304,6 +307,8 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
304
307
  };
305
308
 
306
309
  try {
310
+ var _this$featureFlags, _this$featureFlags$fe, _this$featureFlags$fe2;
311
+
307
312
  var schema = this.getSchema();
308
313
 
309
314
  var _renderDocument = renderDocument(document, this.serializer, schema, adfStage, this.props.useSpecBasedValidator, this.id, this.fireAnalyticsEvent, this.props.unsupportedContentLevelsTracking, this.props.appearance),
@@ -319,7 +324,7 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
319
324
  value: this.featureFlags(this.props.featureFlags)
320
325
  }, jsx(CopyTextProvider, null, jsx(ActiveHeaderIdProvider, {
321
326
  value: getActiveHeadingId(allowHeadingAnchorLinks)
322
- }, jsx(LegacyToNextIntlProvider, null, jsx(IntlLegacyFallbackProvider, null, jsx(AnalyticsContext.Provider, {
327
+ }, jsx(AnalyticsContext.Provider, {
323
328
  value: {
324
329
  fireAnalyticsEvent: function fireAnalyticsEvent(event) {
325
330
  return _this3.fireAnalyticsEvent(event);
@@ -342,11 +347,20 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
342
347
  doc: pmDoc,
343
348
  schema: schema,
344
349
  onAnalyticsEvent: this.fireAnalyticsEvent
345
- }, result)))))))));
346
- return truncated ? jsx(TruncatedWrapper, {
350
+ }, result)))))));
351
+ var rendererResult = truncated ? jsx(TruncatedWrapper, {
347
352
  height: maxHeight,
348
353
  fadeHeight: fadeOutHeight
349
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);
350
364
  } catch (e) {
351
365
  if (onError) {
352
366
  onError(e);
@@ -393,71 +407,49 @@ var RendererWithAnalytics = /*#__PURE__*/React.memo(function (props) {
393
407
  }
394
408
  }, jsx(WithCreateAnalyticsEvent, {
395
409
  render: function render(createAnalyticsEvent) {
396
- // `IntlNextErrorBoundary` only captures Internationalisation errors, leaving others for `ErrorBoundary`.
410
+ // `IntlErrorBoundary` only captures Internationalisation errors, leaving others for `ErrorBoundary`.
397
411
  return jsx(ErrorBoundary, {
398
412
  component: ACTION_SUBJECT.RENDERER,
399
413
  rethrowError: true,
400
414
  fallbackComponent: null,
401
415
  createAnalyticsEvent: createAnalyticsEvent
402
- }, jsx(IntlNextErrorBoundary, null, jsx(Renderer, _extends({}, props, {
416
+ }, jsx(IntlErrorBoundary, null, jsx(Renderer, _extends({}, props, {
403
417
  createAnalyticsEvent: createAnalyticsEvent
404
418
  }))));
405
419
  }
406
420
  }));
407
421
  });
408
- var RendererWithIframeFallbackWrapper = /*#__PURE__*/React.memo(function (props) {
422
+ var RendererWrapper = /*#__PURE__*/React.memo(function (props) {
409
423
  var allowColumnSorting = props.allowColumnSorting,
410
424
  dynamicTextSizing = props.dynamicTextSizing,
411
425
  allowNestedHeaderLinks = props.allowNestedHeaderLinks,
412
426
  innerRef = props.innerRef,
413
427
  appearance = props.appearance,
414
428
  children = props.children,
415
- subscribe = props.subscribe,
416
429
  onClick = props.onClick,
417
430
  onMouseDown = props.onMouseDown;
418
- var renderer = jsx(WidthProvider, {
431
+ return jsx(WidthProvider, {
419
432
  className: "ak-renderer-wrapper"
420
433
  }, jsx(BaseTheme, {
421
434
  dynamicTextSizing: dynamicTextSizing,
422
435
  baseFontSize: !dynamicTextSizing && appearance && appearance !== 'comment' ? akEditorFullPageDefaultFontSize : undefined
423
- }, jsx(DeprecatedWrapper, {
424
- innerRef: innerRef,
425
- appearance: appearance,
426
- allowNestedHeaderLinks: allowNestedHeaderLinks,
427
- allowColumnSorting: !!allowColumnSorting,
436
+ }, jsx("div", {
437
+ ref: innerRef,
428
438
  onClick: onClick,
429
439
  onMouseDown: onMouseDown,
430
- css: rendererStyles
440
+ css: rendererStyles({
441
+ appearance: appearance,
442
+ allowNestedHeaderLinks: allowNestedHeaderLinks,
443
+ allowColumnSorting: !!allowColumnSorting
444
+ })
431
445
  }, children)));
432
-
433
- if (!subscribe) {
434
- return jsx(IframeWidthObserverFallbackWrapper, null, renderer);
435
- }
436
-
437
- return renderer;
438
446
  });
439
- /**
440
- * When the product doesn't provide a IframeWidthObserverFallbackWrapper,
441
- * we will give one to the renderer,
442
- *
443
- * so if we have more than one `WidthProvider` on the content,
444
- * only one iframe will be created on the older browsers.
445
- */
446
-
447
- export function RendererWrapper(props) {
448
- return jsx(IframeWrapperConsumer, null, function (_ref) {
449
- var subscribe = _ref.subscribe;
450
- return jsx(RendererWithIframeFallbackWrapper, _extends({}, props, {
451
- subscribe: subscribe
452
- }));
453
- });
454
- }
455
447
 
456
- function RendererActionsInternalUpdater(_ref2) {
457
- var children = _ref2.children,
458
- doc = _ref2.doc,
459
- schema = _ref2.schema,
460
- onAnalyticsEvent = _ref2.onAnalyticsEvent;
448
+ function RendererActionsInternalUpdater(_ref) {
449
+ var children = _ref.children,
450
+ doc = _ref.doc,
451
+ schema = _ref.schema,
452
+ onAnalyticsEvent = _ref.onAnalyticsEvent;
461
453
  var actions = useContext(ActionsContext);
462
454
  var rendererRef = useRef(null);
463
455
  useLayoutEffect(function () {
@@ -1,14 +1,13 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
2
 
3
- var _templateObject, _templateObject2, _templateObject3;
3
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
4
4
 
5
- import styled, { css as deprecatedCss } from 'styled-components';
6
5
  import { css } from '@emotion/react';
7
6
  import { themed } from '@atlaskit/theme/components';
8
7
  import { gridSize, fontFamily, fontSize, borderRadius } from '@atlaskit/theme/constants';
9
8
  import * as colors from '@atlaskit/theme/colors';
10
9
  import { headingSizes as headingSizesImport } from '@atlaskit/theme/typography';
11
- import { tableSharedStyle, columnLayoutSharedStyle, blockquoteSharedStyles, headingsSharedStyles, panelSharedStyles, ruleSharedStyles, whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, blockMarksSharedStyles, mediaSingleSharedStyle, TableSharedCssClassName, tableMarginTop, codeMarkSharedStyles, shadowSharedStyle, dateSharedStyle, richMediaClassName, tasksAndDecisionsStyles, smartCardSharedStyles, tableCellPadding, textColorStyles } from '@atlaskit/editor-common/styles';
10
+ import { tableSharedStyle, columnLayoutSharedStyle, blockquoteSharedStyles, headingsSharedStyles, ruleSharedStyles, whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, blockMarksSharedStyles, mediaSingleSharedStyle, TableSharedCssClassName, tableMarginTop, codeMarkSharedStyles, shadowSharedStyle, dateSharedStyle, richMediaClassName, tasksAndDecisionsStyles, smartCardSharedStyles, tableCellPadding, textColorStyles } from '@atlaskit/editor-common/styles';
12
11
  import { shadowClassNames } from '@atlaskit/editor-common/ui';
13
12
  import { editorFontSize, blockNodesVerticalMargin, akEditorTableToolbar, akEditorTableToolbarDark, akEditorTableBorder, akEditorTableBorderDark, akEditorTableNumberColumnWidth, gridMediumMaxWidth, akEditorFullWidthLayoutWidth, akEditorStickyHeaderZIndex, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
14
13
  import { RendererCssClassName } from '../../consts';
@@ -41,7 +40,7 @@ export var headingSizes = {
41
40
  };
42
41
 
43
42
  var headingAnchorStyle = function headingAnchorStyle(headingTag) {
44
- return deprecatedCss(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n /**\n * The copy link button doesn't reserve space in the DOM so that\n * the text alignment isn't impacted by the button/icon's space.\n */\n .", " {\n position: absolute;\n height: ", "em;\n\n margin-left: 6px;\n\n button {\n padding-left: 0;\n padding-right: 0;\n }\n }\n\n /**\n * Applies hover effects to the heading anchor link button\n * to fade in when the user rolls over the heading.\n *\n * The link is persistent on mobile, so we use feature detection\n * to enable hover effects for systems that support it (desktop).\n *\n * @see https://caniuse.com/mdn-css_at-rules_media_hover\n */\n @media (hover: hover) and (pointer: fine) {\n .", " {\n > button {\n opacity: 0;\n transform: translate(-8px, 0px);\n transition: opacity 0.2s ease 0s, transform 0.2s ease 0s;\n }\n }\n\n &:hover {\n .", " > button {\n opacity: 1;\n transform: none !important;\n }\n }\n }\n "])), HeadingAnchorWrapperClassName, headingSizes[headingTag].lineHeight, HeadingAnchorWrapperClassName, HeadingAnchorWrapperClassName);
43
+ return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n /**\n * The copy link button doesn't reserve space in the DOM so that\n * the text alignment isn't impacted by the button/icon's space.\n */\n .", " {\n position: absolute;\n height: ", "em;\n\n margin-left: 6px;\n\n button {\n padding-left: 0;\n padding-right: 0;\n }\n }\n\n /**\n * Applies hover effects to the heading anchor link button\n * to fade in when the user rolls over the heading.\n *\n * The link is persistent on mobile, so we use feature detection\n * to enable hover effects for systems that support it (desktop).\n *\n * @see https://caniuse.com/mdn-css_at-rules_media_hover\n */\n @media (hover: hover) and (pointer: fine) {\n .", " {\n > button {\n opacity: 0;\n transform: translate(-8px, 0px);\n transition: opacity 0.2s ease 0s, transform 0.2s ease 0s;\n }\n }\n\n &:hover {\n .", " > button {\n opacity: 1;\n transform: none !important;\n }\n }\n }\n "])), HeadingAnchorWrapperClassName, headingSizes[headingTag].lineHeight, HeadingAnchorWrapperClassName, HeadingAnchorWrapperClassName);
45
44
  };
46
45
 
47
46
  var alignedHeadingAnchorStyle = function alignedHeadingAnchorStyle(_ref) {
@@ -51,7 +50,7 @@ var alignedHeadingAnchorStyle = function alignedHeadingAnchorStyle(_ref) {
51
50
  return '';
52
51
  }
53
52
 
54
- 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);
55
54
  };
56
55
 
57
56
  var tableSortableColumnStyle = function tableSortableColumnStyle(_ref2) {
@@ -68,72 +67,72 @@ var tableSortableColumnStyle = function tableSortableColumnStyle(_ref2) {
68
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 ");
69
68
  }
70
69
 
71
- 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);
72
71
  };
73
72
 
74
- var fullPageStyles = function fullPageStyles(_ref3) {
75
- var theme = _ref3.theme,
76
- appearance = _ref3.appearance;
73
+ var fullPageStyles = function fullPageStyles(_ref3, _ref4) {
74
+ var appearance = _ref3.appearance;
75
+ var theme = _ref4.theme;
77
76
 
78
77
  if (appearance !== 'full-page' && appearance !== 'mobile') {
79
78
  return '';
80
79
  }
81
80
 
82
- 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);
83
82
  };
84
83
 
85
- var fullWidthStyles = function fullWidthStyles(_ref4) {
86
- var appearance = _ref4.appearance;
84
+ var fullWidthStyles = function fullWidthStyles(_ref5) {
85
+ var appearance = _ref5.appearance;
87
86
 
88
87
  if (appearance !== 'full-width') {
89
88
  return '';
90
89
  }
91
90
 
92
- 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 ");
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);
93
92
  };
94
93
 
95
- export var rendererStyles = function rendererStyles(theme) {
96
- // This is required to be compatible with styled-components prop structure.
97
- var props = {
98
- theme: theme
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 & .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), 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);
99
137
  };
100
- return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", "\n\n ", ";\n ", ";\n ", ";\n\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\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 ", ";\n "])), tableSharedStyle(props), whitespaceSharedStyles, blockquoteSharedStyles, headingsSharedStyles(props), paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, blockMarksSharedStyles, codeMarkSharedStyles(props), shadowSharedStyle, dateSharedStyle, textColorStyles, tasksAndDecisionsStyles, smartCardSharedStyles, mediaSingleSharedStyle, columnLayoutSharedStyle);
101
- }; // prettier-ignore
102
-
103
- export var DeprecatedWrapper = styled.div(_templateObject3 || (_templateObject3 = _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 & .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\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 & [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({
104
- light: colors.N800,
105
- dark: '#B8C7E0'
106
- }), fullPageStyles, fullWidthStyles, headingAnchorStyle('h1'), headingAnchorStyle('h2'), headingAnchorStyle('h3'), headingAnchorStyle('h4'), headingAnchorStyle('h5'), headingAnchorStyle('h6'), colors.B400, colors.B300, colors.placeholderText, panelSharedStyles, ruleSharedStyles, fontFamily(), relativeFontSizeToBase16(fontSize()), themed({
107
- light: colors.N30A,
108
- dark: colors.DN70
109
- }), borderRadius(), themed({
110
- light: colors.N800,
111
- dark: colors.DN600
112
- }), colors.R50, colors.R500, gridSize() * 3, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, richMediaClassName, alignedHeadingAnchorStyle, RendererCssClassName.DOCUMENT, TableSharedCssClassName.TABLE_CONTAINER, RendererCssClassName.EXTENSION_OVERFLOW_CONTAINER, RendererCssClassName.EXTENSION, RendererCssClassName.EXTENSION, blockNodesVerticalMargin, RendererCssClassName.EXTENSION_CENTER_ALIGN, TableSharedCssClassName.TABLE_NODE_WRAPPER, TableSharedCssClassName.TABLE_CONTAINER, shadowClassNames.RIGHT_SHADOW, shadowClassNames.LEFT_SHADOW, tableMarginTop - 1, tableMarginTop, akEditorStickyHeaderZIndex, tableSortableColumnStyle, RendererCssClassName.NUMBER_COLUMN, themed({
113
- light: akEditorTableToolbar,
114
- dark: akEditorTableToolbarDark
115
- }), themed({
116
- light: akEditorTableBorder,
117
- dark: akEditorTableBorderDark
118
- }), akEditorTableNumberColumnWidth, themed({
119
- light: colors.N200,
120
- dark: colors.DN400
121
- }), relativeFontSizeToBase16(fontSize()), RendererCssClassName.NUMBER_COLUMN, akEditorStickyHeaderZIndex, themed({
122
- light: akEditorTableBorder,
123
- dark: akEditorTableBorderDark
124
- }), themed({
125
- light: akEditorTableBorder,
126
- dark: akEditorTableBorderDark
127
- }), akEditorStickyHeaderZIndex, themed({
128
- light: akEditorTableBorder,
129
- dark: akEditorTableBorderDark
130
- }), themed({
131
- light: akEditorTableBorder,
132
- dark: akEditorTableBorderDark
133
- }), themed({
134
- light: akEditorTableToolbar,
135
- dark: akEditorTableToolbarDark
136
- }), themed({
137
- light: akEditorTableToolbar,
138
- dark: akEditorTableToolbarDark
139
- }), borderRadius(), blockNodesVerticalMargin, gridSize() * 2.5, gridSize() * 4, gridMediumMaxWidth);
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
  };
@@ -1 +1 @@
1
- export {};
1
+ import { ACTION_SUBJECT } from '../analytics/enums';
package/dist/esm/utils.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import _createClass from "@babel/runtime/helpers/createClass";
2
2
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
- import { defaultSchema } from '@atlaskit/adf-schema';
3
+ import { defaultSchema } from '@atlaskit/adf-schema/schema-default';
4
4
  import { JSONTransformer } from '@atlaskit/editor-json-transformer';
5
5
 
6
6
  function createEncoder(parser, encoder) {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "92.0.0",
3
+ "version": "93.0.1",
4
4
  "sideEffects": false
5
5
  }
@@ -7,6 +7,7 @@ export declare enum EVENT_TYPE {
7
7
  export declare enum ACTION {
8
8
  STARTED = "started",
9
9
  RENDERED = "rendered",
10
+ RE_RENDERED = "reRendered",
10
11
  RENDERER_TTI = "tti",
11
12
  CRASHED = "unhandledErrorCaught",
12
13
  INVALID_PROSEMIRROR_DOCUMENT = "invalidProsemirrorDocument",
@@ -1,5 +1,5 @@
1
1
  import { ACTION, ACTION_SUBJECT, AEP, EVENT_TYPE, ACTION_SUBJECT_ID } from './enums';
2
- import { SEVERITY, UNSUPPORTED_CONTENT_LEVEL_SEVERITY } from '@atlaskit/editor-common/utils';
2
+ import { PropsDifference, SEVERITY, ShallowPropsDifference, UNSUPPORTED_CONTENT_LEVEL_SEVERITY } from '@atlaskit/editor-common/utils';
3
3
  import type { UnsupportedContentPayload } from '@atlaskit/editor-common/utils';
4
4
  import { SortOrder } from '@atlaskit/editor-common/types';
5
5
  import { UnsupportedContentTooltipPayload } from '@atlaskit/editor-common/src/utils/analytics';
@@ -22,6 +22,11 @@ declare type RendererRenderedAEP = AEP<ACTION.RENDERED, ACTION_SUBJECT.RENDERER,
22
22
  nodes: Record<string, number>;
23
23
  severity?: SEVERITY;
24
24
  }, EVENT_TYPE.OPERATIONAL>;
25
+ declare type RendererReRenderedAEP<Props> = AEP<ACTION.RE_RENDERED, ACTION_SUBJECT.RENDERER, undefined, {
26
+ propsDifference: PropsDifference<Props> | ShallowPropsDifference<Props>;
27
+ count: number;
28
+ componentId?: string;
29
+ }, EVENT_TYPE.OPERATIONAL>;
25
30
  export declare type ComponentCrashErrorAEP = AEP<ACTION.CRASHED, ACTION_SUBJECT.RENDERER, ACTION_SUBJECT_ID, {
26
31
  platform: PLATFORM.WEB;
27
32
  errorMessage?: string;
@@ -102,5 +107,5 @@ declare type RendererTTIAEP = AEP<ACTION.RENDERER_TTI, ACTION_SUBJECT.RENDERER,
102
107
  ttiFromInvocation: number;
103
108
  canceled: boolean;
104
109
  }, EVENT_TYPE.OPERATIONAL>;
105
- export declare type AnalyticsEventPayload = RendererStartAEP | RendererRenderedAEP | ComponentCrashErrorAEP | RendererUnsupportedContentLevelsTrackingSucceeded | RendererUnsupportedContentLevelsTrackingErrored | RendererSelectAllCaughtAEP | RendererSelectAllEscapedAEP | HeadingAnchorLinkButtonAEP | AnchorLinkAEP | TableSortColumnNotAllowedAEP | TableSortColumnAEP | VisitLinkAEP | VisitMediaLinkAEP | ExpandAEP | UnsupportedContentPayload | UnsupportedContentTooltipPayload | AnnotationAEP | AnnotationDeleteAEP | MediaLnkTransformedAEP | InvalidProsemirrorDocumentErrorAEP | RendererTTIAEP;
110
+ export declare type AnalyticsEventPayload<T = void> = RendererStartAEP | RendererRenderedAEP | RendererReRenderedAEP<T> | ComponentCrashErrorAEP | RendererUnsupportedContentLevelsTrackingSucceeded | RendererUnsupportedContentLevelsTrackingErrored | RendererSelectAllCaughtAEP | RendererSelectAllEscapedAEP | HeadingAnchorLinkButtonAEP | AnchorLinkAEP | TableSortColumnNotAllowedAEP | TableSortColumnAEP | VisitLinkAEP | VisitMediaLinkAEP | ExpandAEP | UnsupportedContentPayload | UnsupportedContentTooltipPayload | AnnotationAEP | AnnotationDeleteAEP | MediaLnkTransformedAEP | InvalidProsemirrorDocumentErrorAEP | RendererTTIAEP;
106
111
  export {};
@@ -0,0 +1,20 @@
1
+ declare const _default: {
2
+ 'fabric.editor.codeBlockCopyButton.copiedToClipboard': string;
3
+ 'fabric.editor.codeBlockCopyButton.copyToClipboard': string;
4
+ 'fabric.editor.headingLink.ascOrderLabel': string;
5
+ 'fabric.editor.headingLink.ascSortingLabel': string;
6
+ 'fabric.editor.headingLink.copied': string;
7
+ 'fabric.editor.headingLink.copyAnchorLink': string;
8
+ 'fabric.editor.headingLink.copyAriaLabel': string;
9
+ 'fabric.editor.headingLink.descOrderLabel': string;
10
+ 'fabric.editor.headingLink.failedToCopy': string;
11
+ 'fabric.editor.headingLink.noOrderLabel': string;
12
+ 'fabric.editor.headingLink.noneSortingLabel': string;
13
+ };
14
+ /**
15
+ * NOTE:
16
+ *
17
+ * This file is automatically generated by Traduki 2.0.
18
+ * DO NOT CHANGE IT BY HAND or your changes will be lost.
19
+ */
20
+ export default _default;
@@ -0,0 +1,20 @@
1
+ declare const _default: {
2
+ 'fabric.editor.codeBlockCopyButton.copiedToClipboard': string;
3
+ 'fabric.editor.codeBlockCopyButton.copyToClipboard': string;
4
+ 'fabric.editor.headingLink.ascOrderLabel': string;
5
+ 'fabric.editor.headingLink.ascSortingLabel': string;
6
+ 'fabric.editor.headingLink.copied': string;
7
+ 'fabric.editor.headingLink.copyAnchorLink': string;
8
+ 'fabric.editor.headingLink.copyAriaLabel': string;
9
+ 'fabric.editor.headingLink.descOrderLabel': string;
10
+ 'fabric.editor.headingLink.failedToCopy': string;
11
+ 'fabric.editor.headingLink.noOrderLabel': string;
12
+ 'fabric.editor.headingLink.noneSortingLabel': string;
13
+ };
14
+ /**
15
+ * NOTE:
16
+ *
17
+ * This file is automatically generated by Traduki 2.0.
18
+ * DO NOT CHANGE IT BY HAND or your changes will be lost.
19
+ */
20
+ export default _default;
@@ -1,9 +1,15 @@
1
1
  declare const _default: {
2
2
  'fabric.editor.codeBlockCopyButton.copiedToClipboard': string;
3
3
  'fabric.editor.codeBlockCopyButton.copyToClipboard': string;
4
+ 'fabric.editor.headingLink.ascOrderLabel': string;
5
+ 'fabric.editor.headingLink.ascSortingLabel': string;
4
6
  'fabric.editor.headingLink.copied': string;
5
7
  'fabric.editor.headingLink.copyAnchorLink': string;
8
+ 'fabric.editor.headingLink.copyAriaLabel': string;
9
+ 'fabric.editor.headingLink.descOrderLabel': string;
6
10
  'fabric.editor.headingLink.failedToCopy': string;
11
+ 'fabric.editor.headingLink.noOrderLabel': string;
12
+ 'fabric.editor.headingLink.noneSortingLabel': string;
7
13
  };
8
14
  /**
9
15
  * NOTE:
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import { jsx } from '@emotion/react';
2
2
  import { AlignmentAttributes } from '@atlaskit/adf-schema';
3
3
  import { MarkProps } from '../types';
4
- export default function Alignment(props: MarkProps<AlignmentAttributes>): JSX.Element;
4
+ export default function Alignment(props: MarkProps<AlignmentAttributes>): jsx.JSX.Element;