@atlaskit/renderer 124.16.4 → 124.16.5

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @atlaskit/renderer
2
2
 
3
+ ## 124.16.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [`0eb9453d515b3`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0eb9453d515b3) -
8
+ Added the ability to override the codeBlock and windowedCodeBlock nodes.
9
+ - Updated dependencies
10
+
3
11
  ## 124.16.4
4
12
 
5
13
  ### Patch Changes
@@ -28,6 +28,8 @@ var _Expand = _interopRequireDefault(require("../../ui/Expand"));
28
28
  */
29
29
  var nodeToReact = {
30
30
  codeBlock: _codeBlock.default,
31
+ windowedCodeBlock: _codeBlock.default,
32
+ // CodeBlock is similar to windowedCodeBlock, just with sync loading and without the isInViewport check.
31
33
  date: _date.default,
32
34
  decisionList: _decisionList.default,
33
35
  decisionItem: _decisionItem.default,
@@ -514,15 +514,27 @@ var toReact = exports.toReact = function toReact(node, flags, nodeComponents
514
514
  if (node.type.name === 'doc' && (flags === null || flags === void 0 ? void 0 : flags.allowSelectAllTrap) === true) {
515
515
  return _doc.DocWithSelectAllTrap;
516
516
  }
517
- if (node.type.name === 'codeBlock') {
518
- if ((flags === null || flags === void 0 ? void 0 : flags.allowWindowedCodeBlock) === true) {
519
- return WindowedCodeBlock;
517
+ if (!(0, _platformFeatureFlags.fg)('jfp-magma-ssr-iv-editor-codeblock')) {
518
+ if (node.type.name === 'codeBlock') {
519
+ if ((flags === null || flags === void 0 ? void 0 : flags.allowWindowedCodeBlock) === true) {
520
+ return WindowedCodeBlock;
521
+ }
522
+ return CodeBlock;
520
523
  }
521
- return CodeBlock;
522
524
  }
523
525
 
524
526
  // Allowing custom components to override those provided in nodeToReact
525
527
  var nodes = _objectSpread(_objectSpread({}, nodeToReact), nodeComponents);
528
+ if ((0, _platformFeatureFlags.fg)('jfp-magma-ssr-iv-editor-codeblock')) {
529
+ if (node.type.name === 'codeBlock') {
530
+ var _nodes$codeBlock;
531
+ if ((flags === null || flags === void 0 ? void 0 : flags.allowWindowedCodeBlock) === true) {
532
+ var _nodes$windowedCodeBl;
533
+ return (_nodes$windowedCodeBl = nodes.windowedCodeBlock) !== null && _nodes$windowedCodeBl !== void 0 ? _nodes$windowedCodeBl : WindowedCodeBlock;
534
+ }
535
+ return (_nodes$codeBlock = nodes.codeBlock) !== null && _nodes$codeBlock !== void 0 ? _nodes$codeBlock : CodeBlock;
536
+ }
537
+ }
526
538
  nodes['multiBodiedExtension'] = (0, _platformFeatureFlags.fg)('platform_editor_multi_body_extension_extensibility') ? _multiBodiedExtension.default : _multiBodiedExtensionOld.default;
527
539
  return nodes[node.type.name];
528
540
  };
@@ -22,6 +22,8 @@ import Expand from '../../ui/Expand';
22
22
  */
23
23
  const nodeToReact = {
24
24
  codeBlock: CodeBlock,
25
+ windowedCodeBlock: CodeBlock,
26
+ // CodeBlock is similar to windowedCodeBlock, just with sync loading and without the isInViewport check.
25
27
  date: Date,
26
28
  decisionList: DecisionList,
27
29
  decisionItem: DecisionItem,
@@ -190,11 +190,13 @@ export const toReact = (node, flags, nodeComponents
190
190
  if (node.type.name === 'doc' && (flags === null || flags === void 0 ? void 0 : flags.allowSelectAllTrap) === true) {
191
191
  return DocWithSelectAllTrap;
192
192
  }
193
- if (node.type.name === 'codeBlock') {
194
- if ((flags === null || flags === void 0 ? void 0 : flags.allowWindowedCodeBlock) === true) {
195
- return WindowedCodeBlock;
193
+ if (!fg('jfp-magma-ssr-iv-editor-codeblock')) {
194
+ if (node.type.name === 'codeBlock') {
195
+ if ((flags === null || flags === void 0 ? void 0 : flags.allowWindowedCodeBlock) === true) {
196
+ return WindowedCodeBlock;
197
+ }
198
+ return CodeBlock;
196
199
  }
197
- return CodeBlock;
198
200
  }
199
201
 
200
202
  // Allowing custom components to override those provided in nodeToReact
@@ -202,6 +204,16 @@ export const toReact = (node, flags, nodeComponents
202
204
  ...nodeToReact,
203
205
  ...nodeComponents
204
206
  };
207
+ if (fg('jfp-magma-ssr-iv-editor-codeblock')) {
208
+ if (node.type.name === 'codeBlock') {
209
+ var _nodes$codeBlock;
210
+ if ((flags === null || flags === void 0 ? void 0 : flags.allowWindowedCodeBlock) === true) {
211
+ var _nodes$windowedCodeBl;
212
+ return (_nodes$windowedCodeBl = nodes.windowedCodeBlock) !== null && _nodes$windowedCodeBl !== void 0 ? _nodes$windowedCodeBl : WindowedCodeBlock;
213
+ }
214
+ return (_nodes$codeBlock = nodes.codeBlock) !== null && _nodes$codeBlock !== void 0 ? _nodes$codeBlock : CodeBlock;
215
+ }
216
+ }
205
217
  nodes['multiBodiedExtension'] = fg('platform_editor_multi_body_extension_extensibility') ? MultiBodiedExtension : MultiBodiedExtensionOld;
206
218
  return nodes[node.type.name];
207
219
  };
@@ -22,6 +22,8 @@ import Expand from '../../ui/Expand';
22
22
  */
23
23
  var nodeToReact = {
24
24
  codeBlock: CodeBlock,
25
+ windowedCodeBlock: CodeBlock,
26
+ // CodeBlock is similar to windowedCodeBlock, just with sync loading and without the isInViewport check.
25
27
  date: Date,
26
28
  decisionList: DecisionList,
27
29
  decisionItem: DecisionItem,
@@ -319,15 +319,27 @@ export var toReact = function toReact(node, flags, nodeComponents
319
319
  if (node.type.name === 'doc' && (flags === null || flags === void 0 ? void 0 : flags.allowSelectAllTrap) === true) {
320
320
  return DocWithSelectAllTrap;
321
321
  }
322
- if (node.type.name === 'codeBlock') {
323
- if ((flags === null || flags === void 0 ? void 0 : flags.allowWindowedCodeBlock) === true) {
324
- return WindowedCodeBlock;
322
+ if (!fg('jfp-magma-ssr-iv-editor-codeblock')) {
323
+ if (node.type.name === 'codeBlock') {
324
+ if ((flags === null || flags === void 0 ? void 0 : flags.allowWindowedCodeBlock) === true) {
325
+ return WindowedCodeBlock;
326
+ }
327
+ return CodeBlock;
325
328
  }
326
- return CodeBlock;
327
329
  }
328
330
 
329
331
  // Allowing custom components to override those provided in nodeToReact
330
332
  var nodes = _objectSpread(_objectSpread({}, nodeToReact), nodeComponents);
333
+ if (fg('jfp-magma-ssr-iv-editor-codeblock')) {
334
+ if (node.type.name === 'codeBlock') {
335
+ var _nodes$codeBlock;
336
+ if ((flags === null || flags === void 0 ? void 0 : flags.allowWindowedCodeBlock) === true) {
337
+ var _nodes$windowedCodeBl;
338
+ return (_nodes$windowedCodeBl = nodes.windowedCodeBlock) !== null && _nodes$windowedCodeBl !== void 0 ? _nodes$windowedCodeBl : WindowedCodeBlock;
339
+ }
340
+ return (_nodes$codeBlock = nodes.codeBlock) !== null && _nodes$codeBlock !== void 0 ? _nodes$codeBlock : CodeBlock;
341
+ }
342
+ }
331
343
  nodes['multiBodiedExtension'] = fg('platform_editor_multi_body_extension_extensibility') ? MultiBodiedExtension : MultiBodiedExtensionOld;
332
344
  return nodes[node.type.name];
333
345
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "124.16.4",
3
+ "version": "124.16.5",
4
4
  "description": "Renderer component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -54,11 +54,11 @@
54
54
  "@atlaskit/platform-feature-flags": "^1.1.0",
55
55
  "@atlaskit/platform-feature-flags-react": "^0.4.0",
56
56
  "@atlaskit/react-ufo": "^4.15.0",
57
- "@atlaskit/smart-card": "^43.10.0",
57
+ "@atlaskit/smart-card": "^43.11.0",
58
58
  "@atlaskit/status": "^3.0.0",
59
59
  "@atlaskit/task-decision": "^19.2.0",
60
60
  "@atlaskit/theme": "^21.0.0",
61
- "@atlaskit/tmp-editor-statsig": "^13.42.0",
61
+ "@atlaskit/tmp-editor-statsig": "^13.43.0",
62
62
  "@atlaskit/tokens": "^8.3.0",
63
63
  "@atlaskit/tooltip": "^20.10.0",
64
64
  "@atlaskit/visually-hidden": "^3.0.0",
@@ -72,7 +72,7 @@
72
72
  "uuid": "^3.1.0"
73
73
  },
74
74
  "peerDependencies": {
75
- "@atlaskit/editor-common": "^110.34.0",
75
+ "@atlaskit/editor-common": "^110.35.0",
76
76
  "@atlaskit/link-provider": "^4.0.0",
77
77
  "@atlaskit/media-core": "^37.0.0",
78
78
  "react": "^18.2.0",
@@ -244,6 +244,9 @@
244
244
  },
245
245
  "platform_editor_ai_adf_prompts_in_all_products": {
246
246
  "type": "boolean"
247
+ },
248
+ "jfp-magma-ssr-iv-editor-codeblock": {
249
+ "type": "boolean"
247
250
  }
248
251
  }
249
252
  }