@atlaskit/renderer 82.2.0 → 83.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 (44) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/dist/cjs/react/index.js +7 -4
  3. package/dist/cjs/react/marks/fragment.js +21 -0
  4. package/dist/cjs/react/marks/index.js +10 -1
  5. package/dist/cjs/react/nodes/heading.js +2 -4
  6. package/dist/cjs/react/nodes/media.js +4 -2
  7. package/dist/cjs/react/nodes/panel.js +4 -6
  8. package/dist/cjs/ui/MediaCard.js +11 -5
  9. package/dist/cjs/ui/Renderer/index.js +4 -4
  10. package/dist/cjs/ui/Renderer/style.js +1 -1
  11. package/dist/cjs/ui/SortingIcon.js +1 -1
  12. package/dist/cjs/ui/annotations/hooks/use-events.js +3 -1
  13. package/dist/cjs/version.json +1 -1
  14. package/dist/es2019/react/index.js +7 -3
  15. package/dist/es2019/react/marks/fragment.js +10 -0
  16. package/dist/es2019/react/marks/index.js +4 -2
  17. package/dist/es2019/react/nodes/heading.js +2 -3
  18. package/dist/es2019/react/nodes/media.js +4 -2
  19. package/dist/es2019/react/nodes/panel.js +5 -6
  20. package/dist/es2019/ui/MediaCard.js +11 -5
  21. package/dist/es2019/ui/Renderer/index.js +4 -4
  22. package/dist/es2019/ui/Renderer/style.js +1 -1
  23. package/dist/es2019/ui/SortingIcon.js +1 -1
  24. package/dist/es2019/ui/annotations/hooks/use-events.js +3 -1
  25. package/dist/es2019/version.json +1 -1
  26. package/dist/esm/react/index.js +7 -4
  27. package/dist/esm/react/marks/fragment.js +10 -0
  28. package/dist/esm/react/marks/index.js +4 -2
  29. package/dist/esm/react/nodes/heading.js +2 -3
  30. package/dist/esm/react/nodes/media.js +4 -2
  31. package/dist/esm/react/nodes/panel.js +5 -6
  32. package/dist/esm/ui/MediaCard.js +11 -5
  33. package/dist/esm/ui/Renderer/index.js +4 -4
  34. package/dist/esm/ui/Renderer/style.js +1 -1
  35. package/dist/esm/ui/SortingIcon.js +1 -1
  36. package/dist/esm/ui/annotations/hooks/use-events.js +3 -1
  37. package/dist/esm/version.json +1 -1
  38. package/dist/types/index.d.ts +1 -0
  39. package/dist/types/react/marks/fragment.d.ts +3 -0
  40. package/dist/types/react/marks/index.d.ts +2 -1
  41. package/dist/types/types/mediaOptions.d.ts +7 -1
  42. package/dist/types/ui/MediaCard.d.ts +2 -0
  43. package/dist/types/ui/renderer-props.d.ts +1 -1
  44. package/package.json +19 -20
package/CHANGELOG.md CHANGED
@@ -1,5 +1,39 @@
1
1
  # @atlaskit/renderer
2
2
 
3
+ ## 83.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [`0cf5fa82add`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0cf5fa82add) - CETI-20 Rename custom panel FF from `UNSAFE_allowCustomPanel` to `allowCustomPanel`
8
+
9
+ ### Minor Changes
10
+
11
+ - [`c890a025f6c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c890a025f6c) - Fix annotations state from being set to null when adding a new inline comment
12
+ - [`23514411f27`](https://bitbucket.org/atlassian/atlassian-frontend/commits/23514411f27) - CETI-134 added support to render dark colors for the custom panels in the dark mode
13
+ - [`8bbb96540ea`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8bbb96540ea) - Add "fragment" mark to stage0 ADF schema
14
+ - [`a3737a9b3aa`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a3737a9b3aa) - CETI-64 Updating the dark mode colors for the standard panels
15
+ - [`d4643be4f2d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d4643be4f2d) - [ux] AK-551 Add focus outline on code block copy button
16
+
17
+ ### Patch Changes
18
+
19
+ - [`c6feed82071`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c6feed82071) - ED-11632: Bump prosemirror packages;
20
+
21
+ - prosmirror-commands 1.1.4 -> 1.1.11,
22
+ - prosemirror-model 1.11.0 -> 1.14.3,
23
+ - prosemirror-state 1.3.3 -> 1.3.4,
24
+ - prosemirror-transform 1.2.8 -> 1.3.2,
25
+ - prosemirror-view 1.15.4 + 1.18.8 -> 1.20.2.
26
+
27
+ - [`fc70978492a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/fc70978492a) - Using type for SSR prop to reduce dependency on media-common
28
+ - [`e741804b52a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e741804b52a) - Fixed media nodes not being built synchronously on SSR
29
+ - [`dd7db18ab6a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/dd7db18ab6a) - ED-13854 Replace url-parser library with native function
30
+ - [`f461edcfd05`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f461edcfd05) - Update CardLoader to use react-loadable
31
+ Add SSR feature prop to be passed in renderer and media card
32
+ - [`577302c5331`](https://bitbucket.org/atlassian/atlassian-frontend/commits/577302c5331) - Column sorting button meets the minimum contrast requirement
33
+ - [`a82305310db`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a82305310db) - [ux] ED-7449: Sort cells in a given table column based on case sensitivity of same letter then on alphabet+ascii code values
34
+ - [`9d43feb1f6a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d43feb1f6a) - CETI-167 Remove opacity for panels in dark mode.
35
+ - Updated dependencies
36
+
3
37
  ## 82.2.0
4
38
 
5
39
  ### Minor Changes
@@ -439,7 +439,8 @@ var ReactSerializer = /*#__PURE__*/function () {
439
439
  }, {
440
440
  key: "getMediaProps",
441
441
  value: function getMediaProps(node) {
442
- var _this6 = this;
442
+ var _this6 = this,
443
+ _this$media;
443
444
 
444
445
  var path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
445
446
  var link = node.type.schema.marks.link;
@@ -455,7 +456,8 @@ var ReactSerializer = /*#__PURE__*/function () {
455
456
  isLinkMark: isLinkMark,
456
457
  allowAltTextOnImages: this.allowAltTextOnImages,
457
458
  featureFlags: this.media && this.media.featureFlags,
458
- shouldOpenMediaViewer: this.shouldOpenMediaViewer
459
+ shouldOpenMediaViewer: this.shouldOpenMediaViewer,
460
+ ssr: (_this$media = this.media) === null || _this$media === void 0 ? void 0 : _this$media.ssr
459
461
  });
460
462
  }
461
463
  }, {
@@ -482,13 +484,14 @@ var ReactSerializer = /*#__PURE__*/function () {
482
484
  }, {
483
485
  key: "getMediaGroupProps",
484
486
  value: function getMediaGroupProps(node) {
485
- var _this$media;
487
+ var _this$media2, _this$media3;
486
488
 
487
489
  return _objectSpread(_objectSpread({}, this.getProps(node)), {}, {
488
490
  shouldOpenMediaViewer: this.shouldOpenMediaViewer,
489
491
  allowAltTextOnImages: this.allowAltTextOnImages,
490
492
  featureFlags: this.media && this.media.featureFlags,
491
- enableDownloadButton: (_this$media = this.media) === null || _this$media === void 0 ? void 0 : _this$media.enableDownloadButton
493
+ enableDownloadButton: (_this$media2 = this.media) === null || _this$media2 === void 0 ? void 0 : _this$media2.enableDownloadButton,
494
+ ssr: (_this$media3 = this.media) === null || _this$media3 === void 0 ? void 0 : _this$media3.ssr
492
495
  });
493
496
  }
494
497
  }, {
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = FragmentMark;
9
+
10
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
+
12
+ var _react = _interopRequireDefault(require("react"));
13
+
14
+ function FragmentMark(props) {
15
+ var WrapperElement = props.isInline ? 'span' : 'div';
16
+ return /*#__PURE__*/_react.default.createElement(WrapperElement, (0, _extends2.default)({
17
+ "data-localId": props.localId,
18
+ "data-name": props.name,
19
+ "data-mark-type": "fragment"
20
+ }, props.dataAttributes), props.children);
21
+ }
@@ -79,6 +79,12 @@ Object.defineProperty(exports, "DataConsumer", {
79
79
  return _dataConsumer.default;
80
80
  }
81
81
  });
82
+ Object.defineProperty(exports, "FragmentMark", {
83
+ enumerable: true,
84
+ get: function get() {
85
+ return _fragment.default;
86
+ }
87
+ });
82
88
  Object.defineProperty(exports, "Annotation", {
83
89
  enumerable: true,
84
90
  get: function get() {
@@ -121,6 +127,8 @@ var _unsupportedNodeAttribute = _interopRequireDefault(require("./unsupportedNod
121
127
 
122
128
  var _dataConsumer = _interopRequireDefault(require("./data-consumer"));
123
129
 
130
+ var _fragment = _interopRequireDefault(require("./fragment"));
131
+
124
132
  var _annotation = _interopRequireWildcard(require("./annotation"));
125
133
 
126
134
  var _confluenceInlineComment = _interopRequireDefault(require("./confluence-inline-comment"));
@@ -147,7 +155,8 @@ var markToReact = {
147
155
  indentation: _indentation.default,
148
156
  unsupportedMark: _unsupportedMark.default,
149
157
  unsupportedNodeAttribute: _unsupportedNodeAttribute.default,
150
- dataConsumer: _dataConsumer.default
158
+ dataConsumer: _dataConsumer.default,
159
+ fragment: _fragment.default
151
160
  };
152
161
  exports.markToReact = markToReact;
153
162
 
@@ -13,8 +13,6 @@ var _react = _interopRequireDefault(require("react"));
13
13
 
14
14
  var _headingAnchor = _interopRequireDefault(require("./heading-anchor"));
15
15
 
16
- var _urlParse = _interopRequireDefault(require("url-parse"));
17
-
18
16
  var _enums = require("../../analytics/enums");
19
17
 
20
18
  var _analyticsContext = _interopRequireDefault(require("../../analytics/analyticsContext"));
@@ -23,8 +21,8 @@ var _copyTextProvider = require("./copy-text-provider");
23
21
 
24
22
  var getCurrentUrlWithHash = function getCurrentUrlWithHash() {
25
23
  var hash = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
26
- var url = new _urlParse.default(window.location.href);
27
- url.set('hash', encodeURIComponent(hash));
24
+ var url = new URL(window.location.href);
25
+ url.hash = encodeURIComponent(hash);
28
26
  return url.href;
29
27
  };
30
28
 
@@ -69,7 +69,8 @@ var Media = /*#__PURE__*/function (_PureComponent) {
69
69
  alt = _this$props.alt,
70
70
  featureFlags = _this$props.featureFlags,
71
71
  allowMediaViewer = _this$props.shouldOpenMediaViewer,
72
- enableDownloadButton = _this$props.enableDownloadButton;
72
+ enableDownloadButton = _this$props.enableDownloadButton,
73
+ ssr = _this$props.ssr;
73
74
 
74
75
  var linkMark = _this.props.marks.find(_this.props.isLinkMark);
75
76
 
@@ -85,7 +86,8 @@ var Media = /*#__PURE__*/function (_PureComponent) {
85
86
  eventHandlers: eventHandlers,
86
87
  alt: allowAltTextOnImages ? alt : undefined,
87
88
  featureFlags: featureFlags,
88
- shouldEnableDownloadButton: enableDownloadButton
89
+ shouldEnableDownloadButton: enableDownloadButton,
90
+ ssr: ssr
89
91
  }));
90
92
 
91
93
  return linkHref ? /*#__PURE__*/_react.default.createElement(_editorCommon.MediaLink, {
@@ -40,14 +40,12 @@ var _templateObject;
40
40
  var PanelStyled = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n ", "\n"])), function (props) {
41
41
  if (props['data-panel-type'] !== _adfSchema.PanelType.CUSTOM || !props.backgroundColor) {
42
42
  return '';
43
- }
43
+ } // Similar to mainDynamicStyles()
44
44
 
45
- var border = (0, _theme.themed)({
46
- light: 'none',
47
- dark: "1px solid rgba(255, 255, 255, 0.4)"
48
- })(props); // Similar to mainDynamicStyles()
49
45
 
50
- return "\n &[data-panel-type=".concat(_adfSchema.PanelType.CUSTOM, "] {\n background-color: ").concat(props.backgroundColor, ";\n border: ").concat(border, ";\n }\n ");
46
+ return "\n &[data-panel-type=".concat(_adfSchema.PanelType.CUSTOM, "] {\n background-color: ").concat(props.backgroundColor, ";\n ").concat((0, _theme.themed)({
47
+ dark: _editorCommon.getPanelBackgroundDarkModeColors
48
+ }), ";\n }\n ");
51
49
  });
52
50
 
53
51
  var panelIcons = {
@@ -290,7 +290,8 @@ var MediaCardInternal = /*#__PURE__*/function (_Component) {
290
290
  imageStatus = _this$props4.imageStatus,
291
291
  disableOverlay = _this$props4.disableOverlay,
292
292
  alt = _this$props4.alt,
293
- featureFlags = _this$props4.featureFlags;
293
+ featureFlags = _this$props4.featureFlags,
294
+ ssr = _this$props4.ssr;
294
295
 
295
296
  if (imageStatus === 'loading' || !url) {
296
297
  return this.renderLoadingCard();
@@ -315,7 +316,8 @@ var MediaCardInternal = /*#__PURE__*/function (_Component) {
315
316
  mediaViewerDataSource: {
316
317
  list: Array.from(mediaIdentifierMap.values())
317
318
  },
318
- featureFlags: featureFlags
319
+ featureFlags: featureFlags,
320
+ ssr: ssr === null || ssr === void 0 ? void 0 : ssr.mode
319
321
  });
320
322
  }
321
323
  /**
@@ -330,7 +332,7 @@ var MediaCardInternal = /*#__PURE__*/function (_Component) {
330
332
  value: function render() {
331
333
  var _this$state = this.state,
332
334
  contextIdentifierProvider = _this$state.contextIdentifierProvider,
333
- mediaClientConfig = _this$state.mediaClientConfig,
335
+ mediaClientConfigInState = _this$state.mediaClientConfig,
334
336
  fileState = _this$state.fileState;
335
337
  var _this$props5 = this.props,
336
338
  id = _this$props5.id,
@@ -346,7 +348,8 @@ var MediaCardInternal = /*#__PURE__*/function (_Component) {
346
348
  originalDimensions = _this$props5.originalDimensions,
347
349
  forceOpenMediaViewer = _this$props5.shouldOpenMediaViewer,
348
350
  featureFlags = _this$props5.featureFlags,
349
- shouldEnableDownloadButton = _this$props5.shouldEnableDownloadButton;
351
+ shouldEnableDownloadButton = _this$props5.shouldEnableDownloadButton,
352
+ ssr = _this$props5.ssr;
350
353
  var isMobile = rendererAppearance === 'mobile';
351
354
  var shouldPlayInline = useInlinePlayer !== undefined ? useInlinePlayer : true;
352
355
  var isInlinePlayer = isMobile ? false : shouldPlayInline;
@@ -361,6 +364,8 @@ var MediaCardInternal = /*#__PURE__*/function (_Component) {
361
364
  return null;
362
365
  }
363
366
 
367
+ var mediaClientConfig = !!ssr ? ssr.config : mediaClientConfigInState;
368
+
364
369
  if (!mediaClientConfig || !id) {
365
370
  return this.renderLoadingCard();
366
371
  }
@@ -402,7 +407,8 @@ var MediaCardInternal = /*#__PURE__*/function (_Component) {
402
407
  list: Array.from(mediaIdentifierMap.values())
403
408
  },
404
409
  featureFlags: featureFlags,
405
- shouldEnableDownloadButton: shouldEnableDownloadButton
410
+ shouldEnableDownloadButton: shouldEnableDownloadButton,
411
+ ssr: ssr === null || ssr === void 0 ? void 0 : ssr.mode
406
412
  }));
407
413
  }
408
414
  }]);
@@ -223,7 +223,7 @@ var Renderer = /*#__PURE__*/function (_PureComponent) {
223
223
  var nextMedia = nextProps.media || {};
224
224
  var media = this.props.media || {};
225
225
 
226
- if (nextProps.portal !== this.props.portal || nextProps.appearance !== this.props.appearance || nextProps.stickyHeaders !== this.props.stickyHeaders || nextProps.disableActions !== this.props.disableActions || nextProps.UNSAFE_allowCustomPanels !== this.props.UNSAFE_allowCustomPanels || nextProps.allowHeadingAnchorLinks !== this.props.allowHeadingAnchorLinks || nextMedia.allowLinking !== media.allowLinking) {
226
+ if (nextProps.portal !== this.props.portal || nextProps.appearance !== this.props.appearance || nextProps.stickyHeaders !== this.props.stickyHeaders || nextProps.disableActions !== this.props.disableActions || nextProps.allowCustomPanels !== this.props.allowCustomPanels || nextProps.allowHeadingAnchorLinks !== this.props.allowHeadingAnchorLinks || nextMedia.allowLinking !== media.allowLinking) {
227
227
  this.serializer = new _.ReactSerializer(this.deriveSerializerProps(nextProps));
228
228
  }
229
229
  }
@@ -257,7 +257,7 @@ var Renderer = /*#__PURE__*/function (_PureComponent) {
257
257
  surroundTextNodesWithTextWrapper: allowAnnotationsDraftMode,
258
258
  media: props.media,
259
259
  allowCopyToClipboard: props.allowCopyToClipboard,
260
- allowCustomPanels: props.UNSAFE_allowCustomPanels,
260
+ allowCustomPanels: props.allowCustomPanels,
261
261
  allowAnnotations: props.allowAnnotations,
262
262
  allowSelectAllTrap: props.allowSelectAllTrap,
263
263
  allowPlaceholderText: props.allowPlaceholderText
@@ -283,7 +283,7 @@ var Renderer = /*#__PURE__*/function (_PureComponent) {
283
283
  allowPlaceholderText = _this$props2.allowPlaceholderText,
284
284
  allowColumnSorting = _this$props2.allowColumnSorting,
285
285
  allowCopyToClipboard = _this$props2.allowCopyToClipboard,
286
- UNSAFE_allowCustomPanels = _this$props2.UNSAFE_allowCustomPanels;
286
+ allowCustomPanels = _this$props2.allowCustomPanels;
287
287
  var allowNestedHeaderLinks = (0, _links.isNestedHeaderLinksEnabled)(allowHeadingAnchorLinks);
288
288
  /**
289
289
  * Handle clicks inside renderer. If the click isn't on media, in the media picker, or on a
@@ -358,7 +358,7 @@ var Renderer = /*#__PURE__*/function (_PureComponent) {
358
358
  allowNestedHeaderLinks: allowNestedHeaderLinks,
359
359
  allowColumnSorting: allowColumnSorting,
360
360
  allowCopyToClipboard: allowCopyToClipboard,
361
- allowCustomPanels: UNSAFE_allowCustomPanels,
361
+ allowCustomPanels: allowCustomPanels,
362
362
  allowPlaceholderText: allowPlaceholderText,
363
363
  innerRef: this.editorRef,
364
364
  onClick: handleWrapperOnClick,
@@ -117,7 +117,7 @@ var fullWidthStyles = function fullWidthStyles(_ref4) {
117
117
  }; // prettier-ignore
118
118
 
119
119
 
120
- var Wrapper = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\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 & .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{\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"])), _editorSharedStyles.editorFontSize, (0, _components.themed)({
120
+ var Wrapper = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\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 & .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"])), _editorSharedStyles.editorFontSize, (0, _components.themed)({
121
121
  light: colors.N800,
122
122
  dark: '#B8C7E0'
123
123
  }), fullPageStyles, fullWidthStyles, headingAnchorStyle('h1'), headingAnchorStyle('h2'), headingAnchorStyle('h3'), headingAnchorStyle('h4'), headingAnchorStyle('h5'), headingAnchorStyle('h6'), colors.B400, colors.B300, colors.placeholderText, _editorCommon.whitespaceSharedStyles, _editorCommon.blockquoteSharedStyles, _editorCommon.headingsSharedStyles, _editorCommon.panelSharedStyles, _editorCommon.ruleSharedStyles, _editorCommon.paragraphSharedStyles, _editorCommon.listsSharedStyles, _editorCommon.indentationSharedStyles, _editorCommon.blockMarksSharedStyles, _editorCommon.codeMarkSharedStyles, _editorCommon.shadowSharedStyle, _editorCommon.dateSharedStyle, _editorCommon.tasksAndDecisionsStyles, _editorCommon.smartCardSharedStyles, (0, _constants.fontFamily)(), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), (0, _components.themed)({
@@ -41,7 +41,7 @@ exports.StatusClassNames = StatusClassNames;
41
41
 
42
42
  var Wrapper = _styledComponents.default.figure(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\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"])), (0, _constants.gridSize)() / 2, _colors.N20, _colors.N30, StatusClassNames.SORTING_NOT_ALLOWED);
43
43
 
44
- var TableSortingIcon = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\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.5;\n }\n"])), TableSortIconDataUrl, StatusClassNames.DESC, TABLE_SORTING_ICON_CLASS);
44
+ var TableSortingIcon = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\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);
45
45
 
46
46
  var getClassName = function getClassName(status) {
47
47
  switch (status) {
@@ -46,7 +46,9 @@ var useAnnotationStateByTypeEvent = function useAnnotationStateByTypeEvent(_ref)
46
46
 
47
47
  var nextStates = Object.values(payload).reduce(function (acc, curr) {
48
48
  if (curr.annotationType === type) {
49
- return _objectSpread(_objectSpread({}, acc), {}, (0, _defineProperty2.default)({}, curr.id, curr.state));
49
+ // Check for empty state to prevent additional renders
50
+ var isEmpty = curr.state === null || curr.state === undefined;
51
+ return _objectSpread(_objectSpread({}, acc), {}, (0, _defineProperty2.default)({}, curr.id, !isEmpty ? curr.state : states[curr.id]));
50
52
  }
51
53
 
52
54
  return acc;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "82.2.0",
3
+ "version": "83.0.0",
4
4
  "sideEffects": false
5
5
  }
@@ -379,6 +379,8 @@ export default class ReactSerializer {
379
379
  }
380
380
 
381
381
  getMediaProps(node, path = []) {
382
+ var _this$media;
383
+
382
384
  const {
383
385
  marks: {
384
386
  link
@@ -392,7 +394,8 @@ export default class ReactSerializer {
392
394
  isLinkMark,
393
395
  allowAltTextOnImages: this.allowAltTextOnImages,
394
396
  featureFlags: this.media && this.media.featureFlags,
395
- shouldOpenMediaViewer: this.shouldOpenMediaViewer
397
+ shouldOpenMediaViewer: this.shouldOpenMediaViewer,
398
+ ssr: (_this$media = this.media) === null || _this$media === void 0 ? void 0 : _this$media.ssr
396
399
  };
397
400
  }
398
401
 
@@ -413,13 +416,14 @@ export default class ReactSerializer {
413
416
  }
414
417
 
415
418
  getMediaGroupProps(node) {
416
- var _this$media;
419
+ var _this$media2, _this$media3;
417
420
 
418
421
  return { ...this.getProps(node),
419
422
  shouldOpenMediaViewer: this.shouldOpenMediaViewer,
420
423
  allowAltTextOnImages: this.allowAltTextOnImages,
421
424
  featureFlags: this.media && this.media.featureFlags,
422
- enableDownloadButton: (_this$media = this.media) === null || _this$media === void 0 ? void 0 : _this$media.enableDownloadButton
425
+ enableDownloadButton: (_this$media2 = this.media) === null || _this$media2 === void 0 ? void 0 : _this$media2.enableDownloadButton,
426
+ ssr: (_this$media3 = this.media) === null || _this$media3 === void 0 ? void 0 : _this$media3.ssr
423
427
  };
424
428
  }
425
429
 
@@ -0,0 +1,10 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import React from 'react';
3
+ export default function FragmentMark(props) {
4
+ const WrapperElement = props.isInline ? 'span' : 'div';
5
+ return /*#__PURE__*/React.createElement(WrapperElement, _extends({
6
+ "data-localId": props.localId,
7
+ "data-name": props.name,
8
+ "data-mark-type": "fragment"
9
+ }, props.dataAttributes), props.children);
10
+ }
@@ -12,6 +12,7 @@ import Indentation from './indentation';
12
12
  import UnsupportedMark from './unsupportedMark';
13
13
  import UnsupportedNodeAttribute from './unsupportedNodeAttribute';
14
14
  import DataConsumer from './data-consumer';
15
+ import FragmentMark from './fragment';
15
16
  import Annotation, { isAnnotationMark } from './annotation'; // Stage0
16
17
 
17
18
  import ConfluenceInlineComment from './confluence-inline-comment';
@@ -32,9 +33,10 @@ export const markToReact = {
32
33
  indentation: Indentation,
33
34
  unsupportedMark: UnsupportedMark,
34
35
  unsupportedNodeAttribute: UnsupportedNodeAttribute,
35
- dataConsumer: DataConsumer
36
+ dataConsumer: DataConsumer,
37
+ fragment: FragmentMark
36
38
  };
37
39
  export const toReact = mark => {
38
40
  return markToReact[mark.type.name];
39
41
  };
40
- export { Code, Em, Link, Strike, Strong, Subsup, TextColor, Underline, Breakout, Annotation, UnsupportedMark, isAnnotationMark, UnsupportedNodeAttribute, DataConsumer };
42
+ export { Code, Em, Link, Strike, Strong, Subsup, TextColor, Underline, Breakout, Annotation, UnsupportedMark, isAnnotationMark, UnsupportedNodeAttribute, DataConsumer, FragmentMark };
@@ -1,14 +1,13 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React from 'react';
3
3
  import HeadingAnchor from './heading-anchor';
4
- import Url from 'url-parse';
5
4
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '../../analytics/enums';
6
5
  import AnalyticsContext from '../../analytics/analyticsContext';
7
6
  import { CopyTextConsumer } from './copy-text-provider';
8
7
 
9
8
  const getCurrentUrlWithHash = (hash = '') => {
10
- const url = new Url(window.location.href);
11
- url.set('hash', encodeURIComponent(hash));
9
+ const url = new URL(window.location.href);
10
+ url.hash = encodeURIComponent(hash);
12
11
  return url.href;
13
12
  };
14
13
 
@@ -21,7 +21,8 @@ export default class Media extends PureComponent {
21
21
  alt,
22
22
  featureFlags,
23
23
  shouldOpenMediaViewer: allowMediaViewer,
24
- enableDownloadButton
24
+ enableDownloadButton,
25
+ ssr
25
26
  } = this.props;
26
27
  const linkMark = this.props.marks.find(this.props.isLinkMark);
27
28
  const linkHref = linkMark === null || linkMark === void 0 ? void 0 : linkMark.attrs.href;
@@ -35,7 +36,8 @@ export default class Media extends PureComponent {
35
36
  eventHandlers: eventHandlers,
36
37
  alt: allowAltTextOnImages ? alt : undefined,
37
38
  featureFlags: featureFlags,
38
- shouldEnableDownloadButton: enableDownloadButton
39
+ shouldEnableDownloadButton: enableDownloadButton,
40
+ ssr: ssr
39
41
  }));
40
42
  return linkHref ? /*#__PURE__*/React.createElement(MediaLink, {
41
43
  href: linkHref,
@@ -13,21 +13,20 @@ import EmojiItem from './emoji'; // AFP-2532 TODO: Fix automatic suppressions be
13
13
  // eslint-disable-next-line @atlassian/tangerine/import/entry-points
14
14
 
15
15
  import { themed } from '@atlaskit/theme';
16
+ import { getPanelBackgroundDarkModeColors } from '@atlaskit/editor-common';
16
17
  const PanelStyled = styled.div`
17
18
  ${props => {
18
19
  if (props['data-panel-type'] !== PanelType.CUSTOM || !props.backgroundColor) {
19
20
  return '';
20
- }
21
+ } // Similar to mainDynamicStyles()
21
22
 
22
- const border = themed({
23
- light: 'none',
24
- dark: `1px solid rgba(255, 255, 255, 0.4)`
25
- })(props); // Similar to mainDynamicStyles()
26
23
 
27
24
  return `
28
25
  &[data-panel-type=${PanelType.CUSTOM}] {
29
26
  background-color: ${props.backgroundColor};
30
- border: ${border};
27
+ ${themed({
28
+ dark: getPanelBackgroundDarkModeColors
29
+ })};
31
30
  }
32
31
  `;
33
32
  }}
@@ -174,7 +174,8 @@ export class MediaCardInternal extends Component {
174
174
  imageStatus,
175
175
  disableOverlay,
176
176
  alt,
177
- featureFlags
177
+ featureFlags,
178
+ ssr
178
179
  } = this.props;
179
180
 
180
181
  if (imageStatus === 'loading' || !url) {
@@ -200,7 +201,8 @@ export class MediaCardInternal extends Component {
200
201
  mediaViewerDataSource: {
201
202
  list: Array.from(mediaIdentifierMap.values())
202
203
  },
203
- featureFlags: featureFlags
204
+ featureFlags: featureFlags,
205
+ ssr: ssr === null || ssr === void 0 ? void 0 : ssr.mode
204
206
  });
205
207
  }
206
208
  /**
@@ -214,7 +216,7 @@ export class MediaCardInternal extends Component {
214
216
  render() {
215
217
  const {
216
218
  contextIdentifierProvider,
217
- mediaClientConfig,
219
+ mediaClientConfig: mediaClientConfigInState,
218
220
  fileState
219
221
  } = this.state;
220
222
  const {
@@ -231,7 +233,8 @@ export class MediaCardInternal extends Component {
231
233
  originalDimensions,
232
234
  shouldOpenMediaViewer: forceOpenMediaViewer,
233
235
  featureFlags,
234
- shouldEnableDownloadButton
236
+ shouldEnableDownloadButton,
237
+ ssr
235
238
  } = this.props;
236
239
  const isMobile = rendererAppearance === 'mobile';
237
240
  const shouldPlayInline = useInlinePlayer !== undefined ? useInlinePlayer : true;
@@ -247,6 +250,8 @@ export class MediaCardInternal extends Component {
247
250
  return null;
248
251
  }
249
252
 
253
+ const mediaClientConfig = !!ssr ? ssr.config : mediaClientConfigInState;
254
+
250
255
  if (!mediaClientConfig || !id) {
251
256
  return this.renderLoadingCard();
252
257
  }
@@ -288,7 +293,8 @@ export class MediaCardInternal extends Component {
288
293
  list: Array.from(mediaIdentifierMap.values())
289
294
  },
290
295
  featureFlags: featureFlags,
291
- shouldEnableDownloadButton: shouldEnableDownloadButton
296
+ shouldEnableDownloadButton: shouldEnableDownloadButton,
297
+ ssr: ssr === null || ssr === void 0 ? void 0 : ssr.mode
292
298
  }));
293
299
  }
294
300
 
@@ -147,7 +147,7 @@ export class Renderer extends PureComponent {
147
147
  const nextMedia = nextProps.media || {};
148
148
  const media = this.props.media || {};
149
149
 
150
- if (nextProps.portal !== this.props.portal || nextProps.appearance !== this.props.appearance || nextProps.stickyHeaders !== this.props.stickyHeaders || nextProps.disableActions !== this.props.disableActions || nextProps.UNSAFE_allowCustomPanels !== this.props.UNSAFE_allowCustomPanels || nextProps.allowHeadingAnchorLinks !== this.props.allowHeadingAnchorLinks || nextMedia.allowLinking !== media.allowLinking) {
150
+ if (nextProps.portal !== this.props.portal || nextProps.appearance !== this.props.appearance || nextProps.stickyHeaders !== this.props.stickyHeaders || nextProps.disableActions !== this.props.disableActions || nextProps.allowCustomPanels !== this.props.allowCustomPanels || nextProps.allowHeadingAnchorLinks !== this.props.allowHeadingAnchorLinks || nextMedia.allowLinking !== media.allowLinking) {
151
151
  this.serializer = new ReactSerializer(this.deriveSerializerProps(nextProps));
152
152
  }
153
153
  }
@@ -183,7 +183,7 @@ export class Renderer extends PureComponent {
183
183
  surroundTextNodesWithTextWrapper: allowAnnotationsDraftMode,
184
184
  media: props.media,
185
185
  allowCopyToClipboard: props.allowCopyToClipboard,
186
- allowCustomPanels: props.UNSAFE_allowCustomPanels,
186
+ allowCustomPanels: props.allowCustomPanels,
187
187
  allowAnnotations: props.allowAnnotations,
188
188
  allowSelectAllTrap: props.allowSelectAllTrap,
189
189
  allowPlaceholderText: props.allowPlaceholderText
@@ -206,7 +206,7 @@ export class Renderer extends PureComponent {
206
206
  allowPlaceholderText,
207
207
  allowColumnSorting,
208
208
  allowCopyToClipboard,
209
- UNSAFE_allowCustomPanels
209
+ allowCustomPanels
210
210
  } = this.props;
211
211
  const allowNestedHeaderLinks = isNestedHeaderLinksEnabled(allowHeadingAnchorLinks);
212
212
  /**
@@ -280,7 +280,7 @@ export class Renderer extends PureComponent {
280
280
  allowNestedHeaderLinks: allowNestedHeaderLinks,
281
281
  allowColumnSorting: allowColumnSorting,
282
282
  allowCopyToClipboard: allowCopyToClipboard,
283
- allowCustomPanels: UNSAFE_allowCustomPanels,
283
+ allowCustomPanels: allowCustomPanels,
284
284
  allowPlaceholderText: allowPlaceholderText,
285
285
  innerRef: this.editorRef,
286
286
  onClick: handleWrapperOnClick,
@@ -589,7 +589,7 @@ export const Wrapper = styled.div`
589
589
  margin-top: 0;
590
590
  }
591
591
 
592
- &:hover button.copy-to-clipboard{
592
+ &:hover button.copy-to-clipboard, .copy-to-clipboard:focus{
593
593
  opacity: 1;
594
594
  position: absolute;
595
595
  height: 32px;
@@ -52,7 +52,7 @@ const TableSortingIcon = styled.div`
52
52
  }
53
53
 
54
54
  &.${TABLE_SORTING_ICON_CLASS}-inactive {
55
- opacity: 0.5;
55
+ opacity: 0.7;
56
56
  }
57
57
  `;
58
58
 
@@ -20,8 +20,10 @@ export const useAnnotationStateByTypeEvent = ({
20
20
 
21
21
  const nextStates = Object.values(payload).reduce((acc, curr) => {
22
22
  if (curr.annotationType === type) {
23
+ // Check for empty state to prevent additional renders
24
+ const isEmpty = curr.state === null || curr.state === undefined;
23
25
  return { ...acc,
24
- [curr.id]: curr.state
26
+ [curr.id]: !isEmpty ? curr.state : states[curr.id]
25
27
  };
26
28
  }
27
29
 
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "82.2.0",
3
+ "version": "83.0.0",
4
4
  "sideEffects": false
5
5
  }
@@ -430,7 +430,8 @@ var ReactSerializer = /*#__PURE__*/function () {
430
430
  }, {
431
431
  key: "getMediaProps",
432
432
  value: function getMediaProps(node) {
433
- var _this6 = this;
433
+ var _this6 = this,
434
+ _this$media;
434
435
 
435
436
  var path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
436
437
  var link = node.type.schema.marks.link;
@@ -446,7 +447,8 @@ var ReactSerializer = /*#__PURE__*/function () {
446
447
  isLinkMark: isLinkMark,
447
448
  allowAltTextOnImages: this.allowAltTextOnImages,
448
449
  featureFlags: this.media && this.media.featureFlags,
449
- shouldOpenMediaViewer: this.shouldOpenMediaViewer
450
+ shouldOpenMediaViewer: this.shouldOpenMediaViewer,
451
+ ssr: (_this$media = this.media) === null || _this$media === void 0 ? void 0 : _this$media.ssr
450
452
  });
451
453
  }
452
454
  }, {
@@ -473,13 +475,14 @@ var ReactSerializer = /*#__PURE__*/function () {
473
475
  }, {
474
476
  key: "getMediaGroupProps",
475
477
  value: function getMediaGroupProps(node) {
476
- var _this$media;
478
+ var _this$media2, _this$media3;
477
479
 
478
480
  return _objectSpread(_objectSpread({}, this.getProps(node)), {}, {
479
481
  shouldOpenMediaViewer: this.shouldOpenMediaViewer,
480
482
  allowAltTextOnImages: this.allowAltTextOnImages,
481
483
  featureFlags: this.media && this.media.featureFlags,
482
- enableDownloadButton: (_this$media = this.media) === null || _this$media === void 0 ? void 0 : _this$media.enableDownloadButton
484
+ enableDownloadButton: (_this$media2 = this.media) === null || _this$media2 === void 0 ? void 0 : _this$media2.enableDownloadButton,
485
+ ssr: (_this$media3 = this.media) === null || _this$media3 === void 0 ? void 0 : _this$media3.ssr
483
486
  });
484
487
  }
485
488
  }, {
@@ -0,0 +1,10 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import React from 'react';
3
+ export default function FragmentMark(props) {
4
+ var WrapperElement = props.isInline ? 'span' : 'div';
5
+ return /*#__PURE__*/React.createElement(WrapperElement, _extends({
6
+ "data-localId": props.localId,
7
+ "data-name": props.name,
8
+ "data-mark-type": "fragment"
9
+ }, props.dataAttributes), props.children);
10
+ }
@@ -12,6 +12,7 @@ import Indentation from './indentation';
12
12
  import UnsupportedMark from './unsupportedMark';
13
13
  import UnsupportedNodeAttribute from './unsupportedNodeAttribute';
14
14
  import DataConsumer from './data-consumer';
15
+ import FragmentMark from './fragment';
15
16
  import Annotation, { isAnnotationMark } from './annotation'; // Stage0
16
17
 
17
18
  import ConfluenceInlineComment from './confluence-inline-comment';
@@ -32,9 +33,10 @@ export var markToReact = {
32
33
  indentation: Indentation,
33
34
  unsupportedMark: UnsupportedMark,
34
35
  unsupportedNodeAttribute: UnsupportedNodeAttribute,
35
- dataConsumer: DataConsumer
36
+ dataConsumer: DataConsumer,
37
+ fragment: FragmentMark
36
38
  };
37
39
  export var toReact = function toReact(mark) {
38
40
  return markToReact[mark.type.name];
39
41
  };
40
- export { Code, Em, Link, Strike, Strong, Subsup, TextColor, Underline, Breakout, Annotation, UnsupportedMark, isAnnotationMark, UnsupportedNodeAttribute, DataConsumer };
42
+ export { Code, Em, Link, Strike, Strong, Subsup, TextColor, Underline, Breakout, Annotation, UnsupportedMark, isAnnotationMark, UnsupportedNodeAttribute, DataConsumer, FragmentMark };
@@ -1,15 +1,14 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React from 'react';
3
3
  import HeadingAnchor from './heading-anchor';
4
- import Url from 'url-parse';
5
4
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '../../analytics/enums';
6
5
  import AnalyticsContext from '../../analytics/analyticsContext';
7
6
  import { CopyTextConsumer } from './copy-text-provider';
8
7
 
9
8
  var getCurrentUrlWithHash = function getCurrentUrlWithHash() {
10
9
  var hash = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
11
- var url = new Url(window.location.href);
12
- url.set('hash', encodeURIComponent(hash));
10
+ var url = new URL(window.location.href);
11
+ url.hash = encodeURIComponent(hash);
13
12
  return url.href;
14
13
  };
15
14
 
@@ -44,7 +44,8 @@ var Media = /*#__PURE__*/function (_PureComponent) {
44
44
  alt = _this$props.alt,
45
45
  featureFlags = _this$props.featureFlags,
46
46
  allowMediaViewer = _this$props.shouldOpenMediaViewer,
47
- enableDownloadButton = _this$props.enableDownloadButton;
47
+ enableDownloadButton = _this$props.enableDownloadButton,
48
+ ssr = _this$props.ssr;
48
49
 
49
50
  var linkMark = _this.props.marks.find(_this.props.isLinkMark);
50
51
 
@@ -59,7 +60,8 @@ var Media = /*#__PURE__*/function (_PureComponent) {
59
60
  eventHandlers: eventHandlers,
60
61
  alt: allowAltTextOnImages ? alt : undefined,
61
62
  featureFlags: featureFlags,
62
- shouldEnableDownloadButton: enableDownloadButton
63
+ shouldEnableDownloadButton: enableDownloadButton,
64
+ ssr: ssr
63
65
  }));
64
66
  return linkHref ? /*#__PURE__*/React.createElement(MediaLink, {
65
67
  href: linkHref,
@@ -17,17 +17,16 @@ import EmojiItem from './emoji'; // AFP-2532 TODO: Fix automatic suppressions be
17
17
  // eslint-disable-next-line @atlassian/tangerine/import/entry-points
18
18
 
19
19
  import { themed } from '@atlaskit/theme';
20
+ import { getPanelBackgroundDarkModeColors } from '@atlaskit/editor-common';
20
21
  var PanelStyled = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n"])), function (props) {
21
22
  if (props['data-panel-type'] !== PanelType.CUSTOM || !props.backgroundColor) {
22
23
  return '';
23
- }
24
+ } // Similar to mainDynamicStyles()
24
25
 
25
- var border = themed({
26
- light: 'none',
27
- dark: "1px solid rgba(255, 255, 255, 0.4)"
28
- })(props); // Similar to mainDynamicStyles()
29
26
 
30
- return "\n &[data-panel-type=".concat(PanelType.CUSTOM, "] {\n background-color: ").concat(props.backgroundColor, ";\n border: ").concat(border, ";\n }\n ");
27
+ return "\n &[data-panel-type=".concat(PanelType.CUSTOM, "] {\n background-color: ").concat(props.backgroundColor, ";\n ").concat(themed({
28
+ dark: getPanelBackgroundDarkModeColors
29
+ }), ";\n }\n ");
31
30
  });
32
31
  var panelIcons = {
33
32
  info: InfoIcon,
@@ -262,7 +262,8 @@ export var MediaCardInternal = /*#__PURE__*/function (_Component) {
262
262
  imageStatus = _this$props4.imageStatus,
263
263
  disableOverlay = _this$props4.disableOverlay,
264
264
  alt = _this$props4.alt,
265
- featureFlags = _this$props4.featureFlags;
265
+ featureFlags = _this$props4.featureFlags,
266
+ ssr = _this$props4.ssr;
266
267
 
267
268
  if (imageStatus === 'loading' || !url) {
268
269
  return this.renderLoadingCard();
@@ -287,7 +288,8 @@ export var MediaCardInternal = /*#__PURE__*/function (_Component) {
287
288
  mediaViewerDataSource: {
288
289
  list: Array.from(mediaIdentifierMap.values())
289
290
  },
290
- featureFlags: featureFlags
291
+ featureFlags: featureFlags,
292
+ ssr: ssr === null || ssr === void 0 ? void 0 : ssr.mode
291
293
  });
292
294
  }
293
295
  /**
@@ -302,7 +304,7 @@ export var MediaCardInternal = /*#__PURE__*/function (_Component) {
302
304
  value: function render() {
303
305
  var _this$state = this.state,
304
306
  contextIdentifierProvider = _this$state.contextIdentifierProvider,
305
- mediaClientConfig = _this$state.mediaClientConfig,
307
+ mediaClientConfigInState = _this$state.mediaClientConfig,
306
308
  fileState = _this$state.fileState;
307
309
  var _this$props5 = this.props,
308
310
  id = _this$props5.id,
@@ -318,7 +320,8 @@ export var MediaCardInternal = /*#__PURE__*/function (_Component) {
318
320
  originalDimensions = _this$props5.originalDimensions,
319
321
  forceOpenMediaViewer = _this$props5.shouldOpenMediaViewer,
320
322
  featureFlags = _this$props5.featureFlags,
321
- shouldEnableDownloadButton = _this$props5.shouldEnableDownloadButton;
323
+ shouldEnableDownloadButton = _this$props5.shouldEnableDownloadButton,
324
+ ssr = _this$props5.ssr;
322
325
  var isMobile = rendererAppearance === 'mobile';
323
326
  var shouldPlayInline = useInlinePlayer !== undefined ? useInlinePlayer : true;
324
327
  var isInlinePlayer = isMobile ? false : shouldPlayInline;
@@ -333,6 +336,8 @@ export var MediaCardInternal = /*#__PURE__*/function (_Component) {
333
336
  return null;
334
337
  }
335
338
 
339
+ var mediaClientConfig = !!ssr ? ssr.config : mediaClientConfigInState;
340
+
336
341
  if (!mediaClientConfig || !id) {
337
342
  return this.renderLoadingCard();
338
343
  }
@@ -374,7 +379,8 @@ export var MediaCardInternal = /*#__PURE__*/function (_Component) {
374
379
  list: Array.from(mediaIdentifierMap.values())
375
380
  },
376
381
  featureFlags: featureFlags,
377
- shouldEnableDownloadButton: shouldEnableDownloadButton
382
+ shouldEnableDownloadButton: shouldEnableDownloadButton,
383
+ ssr: ssr === null || ssr === void 0 ? void 0 : ssr.mode
378
384
  }));
379
385
  }
380
386
  }]);
@@ -174,7 +174,7 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
174
174
  var nextMedia = nextProps.media || {};
175
175
  var media = this.props.media || {};
176
176
 
177
- if (nextProps.portal !== this.props.portal || nextProps.appearance !== this.props.appearance || nextProps.stickyHeaders !== this.props.stickyHeaders || nextProps.disableActions !== this.props.disableActions || nextProps.UNSAFE_allowCustomPanels !== this.props.UNSAFE_allowCustomPanels || nextProps.allowHeadingAnchorLinks !== this.props.allowHeadingAnchorLinks || nextMedia.allowLinking !== media.allowLinking) {
177
+ if (nextProps.portal !== this.props.portal || nextProps.appearance !== this.props.appearance || nextProps.stickyHeaders !== this.props.stickyHeaders || nextProps.disableActions !== this.props.disableActions || nextProps.allowCustomPanels !== this.props.allowCustomPanels || nextProps.allowHeadingAnchorLinks !== this.props.allowHeadingAnchorLinks || nextMedia.allowLinking !== media.allowLinking) {
178
178
  this.serializer = new ReactSerializer(this.deriveSerializerProps(nextProps));
179
179
  }
180
180
  }
@@ -208,7 +208,7 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
208
208
  surroundTextNodesWithTextWrapper: allowAnnotationsDraftMode,
209
209
  media: props.media,
210
210
  allowCopyToClipboard: props.allowCopyToClipboard,
211
- allowCustomPanels: props.UNSAFE_allowCustomPanels,
211
+ allowCustomPanels: props.allowCustomPanels,
212
212
  allowAnnotations: props.allowAnnotations,
213
213
  allowSelectAllTrap: props.allowSelectAllTrap,
214
214
  allowPlaceholderText: props.allowPlaceholderText
@@ -234,7 +234,7 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
234
234
  allowPlaceholderText = _this$props2.allowPlaceholderText,
235
235
  allowColumnSorting = _this$props2.allowColumnSorting,
236
236
  allowCopyToClipboard = _this$props2.allowCopyToClipboard,
237
- UNSAFE_allowCustomPanels = _this$props2.UNSAFE_allowCustomPanels;
237
+ allowCustomPanels = _this$props2.allowCustomPanels;
238
238
  var allowNestedHeaderLinks = isNestedHeaderLinksEnabled(allowHeadingAnchorLinks);
239
239
  /**
240
240
  * Handle clicks inside renderer. If the click isn't on media, in the media picker, or on a
@@ -309,7 +309,7 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
309
309
  allowNestedHeaderLinks: allowNestedHeaderLinks,
310
310
  allowColumnSorting: allowColumnSorting,
311
311
  allowCopyToClipboard: allowCopyToClipboard,
312
- allowCustomPanels: UNSAFE_allowCustomPanels,
312
+ allowCustomPanels: allowCustomPanels,
313
313
  allowPlaceholderText: allowPlaceholderText,
314
314
  innerRef: this.editorRef,
315
315
  onClick: handleWrapperOnClick,
@@ -91,7 +91,7 @@ var fullWidthStyles = function fullWidthStyles(_ref4) {
91
91
  }; // prettier-ignore
92
92
 
93
93
 
94
- 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 & .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{\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({
94
+ 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 & .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({
95
95
  light: colors.N800,
96
96
  dark: '#B8C7E0'
97
97
  }), 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, tasksAndDecisionsStyles, smartCardSharedStyles, fontFamily(), relativeFontSizeToBase16(fontSize()), themed({
@@ -23,7 +23,7 @@ export var StatusClassNames;
23
23
  })(StatusClassNames || (StatusClassNames = {}));
24
24
 
25
25
  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);
26
- 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.5;\n }\n"])), TableSortIconDataUrl, StatusClassNames.DESC, TABLE_SORTING_ICON_CLASS);
26
+ 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
27
 
28
28
  var getClassName = function getClassName(status) {
29
29
  switch (status) {
@@ -31,7 +31,9 @@ export var useAnnotationStateByTypeEvent = function useAnnotationStateByTypeEven
31
31
 
32
32
  var nextStates = Object.values(payload).reduce(function (acc, curr) {
33
33
  if (curr.annotationType === type) {
34
- return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, curr.id, curr.state));
34
+ // Check for empty state to prevent additional renders
35
+ var isEmpty = curr.state === null || curr.state === undefined;
36
+ return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, curr.id, !isEmpty ? curr.state : states[curr.id]));
35
37
  }
36
38
 
37
39
  return acc;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "82.2.0",
3
+ "version": "83.0.0",
4
4
  "sideEffects": false
5
5
  }
@@ -8,3 +8,4 @@ export type { RendererContext } from './react/types';
8
8
  export { ADFEncoder } from './utils';
9
9
  export { renderDocument } from './render-document';
10
10
  export type { RenderOutputStat } from './render-document';
11
+ export type { MediaSSR } from './types/mediaOptions';
@@ -0,0 +1,3 @@
1
+ import { FragmentAttributes } from '@atlaskit/adf-schema';
2
+ import { MarkProps } from '../types';
3
+ export default function FragmentMark(props: MarkProps<FragmentAttributes>): JSX.Element;
@@ -12,9 +12,10 @@ import Breakout from './breakout';
12
12
  import UnsupportedMark from './unsupportedMark';
13
13
  import UnsupportedNodeAttribute from './unsupportedNodeAttribute';
14
14
  import DataConsumer from './data-consumer';
15
+ import FragmentMark from './fragment';
15
16
  import Annotation, { isAnnotationMark } from './annotation';
16
17
  export declare const markToReact: {
17
18
  [key: string]: ComponentType<any>;
18
19
  };
19
20
  export declare const toReact: (mark: Mark) => ComponentType<any>;
20
- export { Code, Em, Link, Strike, Strong, Subsup, TextColor, Underline, Breakout, Annotation, UnsupportedMark, isAnnotationMark, UnsupportedNodeAttribute, DataConsumer, };
21
+ export { Code, Em, Link, Strike, Strong, Subsup, TextColor, Underline, Breakout, Annotation, UnsupportedMark, isAnnotationMark, UnsupportedNodeAttribute, DataConsumer, FragmentMark, };
@@ -1,6 +1,12 @@
1
- import { MediaFeatureFlags } from '@atlaskit/media-common';
1
+ import { MediaClientConfig } from '@atlaskit/media-core';
2
+ import { MediaFeatureFlags, SSR } from '@atlaskit/media-common';
3
+ export declare type MediaSSR = {
4
+ mode: SSR;
5
+ config: MediaClientConfig;
6
+ };
2
7
  export interface MediaOptions {
3
8
  allowLinking?: boolean;
4
9
  enableDownloadButton?: boolean;
5
10
  featureFlags?: MediaFeatureFlags;
11
+ ssr?: MediaSSR;
6
12
  }
@@ -9,6 +9,7 @@ import { ImageStatus, ContextIdentifierProvider } from '@atlaskit/editor-common'
9
9
  import { MediaFeatureFlags } from '@atlaskit/media-common';
10
10
  import { RendererAppearance } from './Renderer/types';
11
11
  import { RendererContext } from '../react/types';
12
+ import { MediaSSR } from '../types/mediaOptions';
12
13
  export declare type MediaProvider = {
13
14
  viewMediaClientConfig: MediaClientConfig;
14
15
  };
@@ -38,6 +39,7 @@ export interface MediaCardProps {
38
39
  alt?: string;
39
40
  featureFlags?: MediaFeatureFlags;
40
41
  shouldEnableDownloadButton?: boolean;
42
+ ssr?: MediaSSR;
41
43
  }
42
44
  export interface State {
43
45
  mediaClientConfig?: MediaClientConfig;
@@ -38,7 +38,7 @@ export interface RendererProps {
38
38
  innerRef?: React.RefObject<HTMLDivElement>;
39
39
  useSpecBasedValidator?: boolean;
40
40
  allowCopyToClipboard?: boolean;
41
- UNSAFE_allowCustomPanels?: boolean;
41
+ allowCustomPanels?: boolean;
42
42
  analyticsEventSeverityTracking?: {
43
43
  enabled: boolean;
44
44
  severityNormalThreshold: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "82.2.0",
3
+ "version": "83.0.0",
4
4
  "description": "Renderer component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -24,23 +24,23 @@
24
24
  }
25
25
  },
26
26
  "dependencies": {
27
- "@atlaskit/adf-schema": "^19.3.0",
28
- "@atlaskit/adf-utils": "^14.3.0",
27
+ "@atlaskit/adf-schema": "^20.0.0",
28
+ "@atlaskit/adf-utils": "^14.4.0",
29
29
  "@atlaskit/analytics-listeners": "^8.0.0",
30
30
  "@atlaskit/analytics-namespaced-context": "^6.3.0",
31
31
  "@atlaskit/analytics-next": "^8.2.0",
32
32
  "@atlaskit/button": "^16.1.0",
33
33
  "@atlaskit/code": "^14.3.0",
34
- "@atlaskit/editor-common": "^60.3.0",
35
- "@atlaskit/editor-json-transformer": "^8.6.0",
34
+ "@atlaskit/editor-common": "^61.0.0",
35
+ "@atlaskit/editor-json-transformer": "^8.7.0",
36
36
  "@atlaskit/editor-shared-styles": "^1.6.0",
37
37
  "@atlaskit/icon": "^21.9.0",
38
- "@atlaskit/media-card": "^72.0.0",
38
+ "@atlaskit/media-card": "^72.1.0",
39
39
  "@atlaskit/media-client": "^14.3.0",
40
- "@atlaskit/media-common": "^2.9.0",
40
+ "@atlaskit/media-common": "^2.10.0",
41
41
  "@atlaskit/media-filmstrip": "^42.1.0",
42
42
  "@atlaskit/media-viewer": "^45.8.0",
43
- "@atlaskit/status": "^0.11.0",
43
+ "@atlaskit/status": "^0.12.0",
44
44
  "@atlaskit/task-decision": "^17.2.0",
45
45
  "@atlaskit/theme": "^12.0.0",
46
46
  "@atlaskit/tooltip": "^17.5.0",
@@ -48,17 +48,16 @@
48
48
  "@babel/runtime": "^7.0.0",
49
49
  "lodash": "^4.17.15",
50
50
  "memoize-one": "^6.0.0",
51
- "prosemirror-model": "1.11.0",
52
- "prosemirror-transform": "1.2.8",
51
+ "prosemirror-model": "1.14.3",
52
+ "prosemirror-transform": "1.3.2",
53
53
  "prosemirror-utils": "^1.0.0-0",
54
54
  "react-intl": "^2.6.0",
55
55
  "react-loadable": "^5.1.0",
56
- "url-parse": "^1.4.5",
57
56
  "uuid": "^3.1.0"
58
57
  },
59
58
  "peerDependencies": {
60
59
  "@atlaskit/media-core": "^32.2.0",
61
- "@atlaskit/smart-card": "^16.2.0",
60
+ "@atlaskit/smart-card": "^16.3.0",
62
61
  "react": "^16.8.0",
63
62
  "react-dom": "^16.8.0",
64
63
  "styled-components": "^3.2.6"
@@ -67,22 +66,22 @@
67
66
  "@atlaskit/analytics-gas-types": "^5.0.5",
68
67
  "@atlaskit/avatar": "^20.5.0",
69
68
  "@atlaskit/build-utils": "^2.6.2",
70
- "@atlaskit/css-reset": "^6.2.0",
69
+ "@atlaskit/css-reset": "^6.3.0",
71
70
  "@atlaskit/docs": "*",
72
- "@atlaskit/editor-core": "^151.2.0",
73
- "@atlaskit/editor-test-helpers": "^15.5.0",
74
- "@atlaskit/field-range": "^9.0.0",
71
+ "@atlaskit/editor-core": "^152.0.0",
72
+ "@atlaskit/editor-test-helpers": "^15.6.0",
75
73
  "@atlaskit/logo": "^13.5.0",
76
74
  "@atlaskit/media-core": "^32.2.0",
77
75
  "@atlaskit/media-integration-test-helpers": "^2.5.0",
78
- "@atlaskit/media-test-helpers": "^28.8.0",
76
+ "@atlaskit/media-test-helpers": "^28.9.0",
79
77
  "@atlaskit/mention": "^19.7.0",
80
78
  "@atlaskit/navigation-next": "^9.0.0",
81
79
  "@atlaskit/profilecard": "^15.8.0",
82
80
  "@atlaskit/radio": "^5.3.0",
83
- "@atlaskit/smart-card": "^16.2.0",
84
- "@atlaskit/ssr": "^0.2.0",
85
- "@atlaskit/util-data-test": "^16.0.0",
81
+ "@atlaskit/range": "^5.0.11",
82
+ "@atlaskit/smart-card": "^16.3.0",
83
+ "@atlaskit/ssr": "*",
84
+ "@atlaskit/util-data-test": "^17.0.0",
86
85
  "@atlaskit/visual-regression": "*",
87
86
  "@atlaskit/webdriver-runner": "*",
88
87
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",