@atlaskit/renderer 136.0.5 → 136.0.7

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,37 @@
1
1
  # @atlaskit/renderer
2
2
 
3
+ ## 136.0.7
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 136.0.6
10
+
11
+ ### Patch Changes
12
+
13
+ - [`da678c24b2eb7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/da678c24b2eb7) -
14
+ `validateADFEntity` takes an optional trailing `adfStage`, and full-ADF strictness is opt-in: only
15
+ a caller that names `final` is validated against full ADF, while omitting the argument keeps
16
+ stage-0 specs acceptable. Every existing caller behaves exactly as it did before.
17
+
18
+ Strictness is opt-in rather than derived from a default because a document holding a stage-0-only
19
+ construct, such as a `layoutSection` with a single column, otherwise has that content wrapped as
20
+ unsupported. Editors carry such constructs by design, since the editor's own schema enables them,
21
+ and renderers meet them in stored documents as well as in partially streamed ones. The legacy
22
+ `getValidDocument` path never enforced these cardinality rules, so deriving strictness
23
+ automatically would have made the two validation paths disagree on the same document.
24
+
25
+ `renderDocument`'s `adfStage` argument is consequently optional and no longer defaults to `final`
26
+ before reaching validation. It forwards whatever the caller supplied, and the legacy branch keeps
27
+ its own `final` default because it reads the value as a schema selector rather than as a
28
+ strictness request.
29
+
30
+ All of this is a no-op while `platform_editor_adf_validator_stage0` is off, and with the flag on
31
+ it changes nothing for callers that do not name a stage.
32
+
33
+ - Updated dependencies
34
+
3
35
  ## 136.0.5
4
36
 
5
37
  ### Patch Changes
@@ -46,9 +46,15 @@ var _validation = function _validation(doc, schema, adfStage, useSpecBasedValida
46
46
  eventType: _analytics.EVENT_TYPE.OPERATIONAL
47
47
  });
48
48
  }
49
- result = skipValidation ? transformedAdf || doc : (0, _utils.validateADFEntity)(schema, transformedAdf || doc, dispatchAnalyticsEvent, validationOverrides);
49
+
50
+ // Forward `adfStage` only when a caller names one. Omitting it keeps stage-0 specs acceptable,
51
+ // which is what a renderer wants: stored documents can contain them, and wrapping such content
52
+ // as unsupported is worse than rendering it. A caller that declares `final` asks for full-ADF
53
+ // strictness and gets it. The legacy branch below reads the same value as a schema selector and
54
+ // so keeps its own `final` default.
55
+ result = skipValidation ? transformedAdf || doc : (0, _utils.validateADFEntity)(schema, transformedAdf || doc, dispatchAnalyticsEvent, validationOverrides, adfStage);
50
56
  } else {
51
- result = (0, _validator.getValidDocument)(doc, schema, adfStage);
57
+ result = (0, _validator.getValidDocument)(doc, schema, adfStage !== null && adfStage !== void 0 ? adfStage : 'final');
52
58
  }
53
59
  if (!result) {
54
60
  return result;
@@ -218,7 +224,7 @@ var memoCreateNodeAndCheck = (0, _memoizeOne.default)(_createNodeAndCheck, funct
218
224
  });
219
225
  var renderDocument = exports.renderDocument = function renderDocument(doc, serializer) {
220
226
  var schema = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _schemaDefault.defaultSchema;
221
- var adfStage = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'final';
227
+ var adfStage = arguments.length > 3 ? arguments[3] : undefined;
222
228
  var useSpecBasedValidator = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
223
229
  var rendererId = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 'noid';
224
230
  var dispatchAnalyticsEvent = arguments.length > 6 ? arguments[6] : undefined;
@@ -73,7 +73,7 @@ var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
73
73
  var TABLE_INFO_TIMEOUT = 10000;
74
74
  var RENDER_EVENT_SAMPLE_RATE = 0.1;
75
75
  var packageName = "@atlaskit/renderer";
76
- var packageVersion = "136.0.4";
76
+ var packageVersion = "136.0.6";
77
77
  var setAsQueryContainerStyles = (0, _react2.css)({
78
78
  containerName: 'ak-renderer-wrapper',
79
79
  containerType: 'inline-size'
@@ -39,9 +39,15 @@ const _validation = (doc, schema, adfStage, useSpecBasedValidator, dispatchAnaly
39
39
  eventType: EVENT_TYPE.OPERATIONAL
40
40
  });
41
41
  }
42
- result = skipValidation ? transformedAdf || doc : validateADFEntity(schema, transformedAdf || doc, dispatchAnalyticsEvent, validationOverrides);
42
+
43
+ // Forward `adfStage` only when a caller names one. Omitting it keeps stage-0 specs acceptable,
44
+ // which is what a renderer wants: stored documents can contain them, and wrapping such content
45
+ // as unsupported is worse than rendering it. A caller that declares `final` asks for full-ADF
46
+ // strictness and gets it. The legacy branch below reads the same value as a schema selector and
47
+ // so keeps its own `final` default.
48
+ result = skipValidation ? transformedAdf || doc : validateADFEntity(schema, transformedAdf || doc, dispatchAnalyticsEvent, validationOverrides, adfStage);
43
49
  } else {
44
- result = getValidDocument(doc, schema, adfStage);
50
+ result = getValidDocument(doc, schema, adfStage !== null && adfStage !== void 0 ? adfStage : 'final');
45
51
  }
46
52
  if (!result) {
47
53
  return result;
@@ -192,7 +198,7 @@ const memoCreateNodeAndCheck = memoizeOne(_createNodeAndCheck, (newArgs, lastArg
192
198
  const [oldSchema, oldDoc] = lastArgs;
193
199
  return newSchema === oldSchema && areDocsEqual(newDoc, oldDoc);
194
200
  });
195
- export const renderDocument = (doc, serializer, schema = defaultSchema, adfStage = 'final', useSpecBasedValidator = false, rendererId = 'noid', dispatchAnalyticsEvent, unsupportedContentLevelsTracking, appearance, includeNodesCountInStats, skipValidation, validationOverrides) => {
201
+ export const renderDocument = (doc, serializer, schema = defaultSchema, adfStage, useSpecBasedValidator = false, rendererId = 'noid', dispatchAnalyticsEvent, unsupportedContentLevelsTracking, appearance, includeNodesCountInStats, skipValidation, validationOverrides) => {
196
202
  const stat = {
197
203
  sanitizeTime: 0
198
204
  };
@@ -59,7 +59,7 @@ export const DEGRADED_SEVERITY_THRESHOLD = 3000;
59
59
  const TABLE_INFO_TIMEOUT = 10000;
60
60
  const RENDER_EVENT_SAMPLE_RATE = 0.1;
61
61
  const packageName = "@atlaskit/renderer";
62
- const packageVersion = "136.0.4";
62
+ const packageVersion = "136.0.6";
63
63
  const setAsQueryContainerStyles = css({
64
64
  containerName: 'ak-renderer-wrapper',
65
65
  containerType: 'inline-size'
@@ -39,9 +39,15 @@ var _validation = function _validation(doc, schema, adfStage, useSpecBasedValida
39
39
  eventType: EVENT_TYPE.OPERATIONAL
40
40
  });
41
41
  }
42
- result = skipValidation ? transformedAdf || doc : validateADFEntity(schema, transformedAdf || doc, dispatchAnalyticsEvent, validationOverrides);
42
+
43
+ // Forward `adfStage` only when a caller names one. Omitting it keeps stage-0 specs acceptable,
44
+ // which is what a renderer wants: stored documents can contain them, and wrapping such content
45
+ // as unsupported is worse than rendering it. A caller that declares `final` asks for full-ADF
46
+ // strictness and gets it. The legacy branch below reads the same value as a schema selector and
47
+ // so keeps its own `final` default.
48
+ result = skipValidation ? transformedAdf || doc : validateADFEntity(schema, transformedAdf || doc, dispatchAnalyticsEvent, validationOverrides, adfStage);
43
49
  } else {
44
- result = getValidDocument(doc, schema, adfStage);
50
+ result = getValidDocument(doc, schema, adfStage !== null && adfStage !== void 0 ? adfStage : 'final');
45
51
  }
46
52
  if (!result) {
47
53
  return result;
@@ -211,7 +217,7 @@ var memoCreateNodeAndCheck = memoizeOne(_createNodeAndCheck, function (newArgs,
211
217
  });
212
218
  export var renderDocument = function renderDocument(doc, serializer) {
213
219
  var schema = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultSchema;
214
- var adfStage = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'final';
220
+ var adfStage = arguments.length > 3 ? arguments[3] : undefined;
215
221
  var useSpecBasedValidator = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
216
222
  var rendererId = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 'noid';
217
223
  var dispatchAnalyticsEvent = arguments.length > 6 ? arguments[6] : undefined;
@@ -64,7 +64,7 @@ export var DEGRADED_SEVERITY_THRESHOLD = 3000;
64
64
  var TABLE_INFO_TIMEOUT = 10000;
65
65
  var RENDER_EVENT_SAMPLE_RATE = 0.1;
66
66
  var packageName = "@atlaskit/renderer";
67
- var packageVersion = "136.0.4";
67
+ var packageVersion = "136.0.6";
68
68
  var setAsQueryContainerStyles = css({
69
69
  containerName: 'ak-renderer-wrapper',
70
70
  containerType: 'inline-size'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "136.0.5",
3
+ "version": "136.0.7",
4
4
  "description": "Renderer component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -31,13 +31,13 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "@atlaskit/adf-schema": "^57.0.0",
34
- "@atlaskit/adf-utils": "^20.6.0",
34
+ "@atlaskit/adf-utils": "^20.7.0",
35
35
  "@atlaskit/afm-i18n-platform-editor-renderer": "2.200.0",
36
36
  "@atlaskit/analytics-listeners": "^11.1.0",
37
37
  "@atlaskit/analytics-namespaced-context": "^8.1.0",
38
38
  "@atlaskit/analytics-next": "^12.3.0",
39
39
  "@atlaskit/browser-apis": "^1.2.0",
40
- "@atlaskit/button": "^25.0.0",
40
+ "@atlaskit/button": "^25.1.0",
41
41
  "@atlaskit/code": "^19.0.0",
42
42
  "@atlaskit/css": "^1.0.0",
43
43
  "@atlaskit/editor-json-transformer": "^9.4.0",
@@ -69,7 +69,7 @@
69
69
  "@atlaskit/status": "^5.8.0",
70
70
  "@atlaskit/task-decision": "^21.8.0",
71
71
  "@atlaskit/theme": "^28.0.0",
72
- "@atlaskit/tmp-editor-statsig": "^149.0.0",
72
+ "@atlaskit/tmp-editor-statsig": "^150.0.0",
73
73
  "@atlaskit/tokens": "^16.7.0",
74
74
  "@atlaskit/tooltip": "^24.0.0",
75
75
  "@atlaskit/visually-hidden": "^4.2.0",
@@ -84,7 +84,7 @@
84
84
  "uuid": "^3.1.0"
85
85
  },
86
86
  "peerDependencies": {
87
- "@atlaskit/editor-common": "^119.7.0",
87
+ "@atlaskit/editor-common": "^119.9.0",
88
88
  "@atlaskit/link-provider": "^5.3.0",
89
89
  "@atlaskit/media-core": "^38.0.0",
90
90
  "react": "^18.2.0",
@@ -108,8 +108,8 @@
108
108
  "@atlaskit/profilecard": "^26.18.0",
109
109
  "@atlaskit/side-nav-items": "^2.3.0",
110
110
  "@atlaskit/util-data-test": "^19.1.0",
111
- "@atlassian/a11y-jest-testing": "^0.15.0",
112
- "@atlassian/a11y-playwright-testing": "^0.10.0",
111
+ "@atlassian/a11y-jest-testing": "^0.16.0",
112
+ "@atlassian/a11y-playwright-testing": "^0.11.0",
113
113
  "@atlassian/experiment-test-utils": "^0.2.0",
114
114
  "@atlassian/feature-flags-test-utils": "^1.2.0",
115
115
  "@atlassian/structured-docs-types": "workspace:^",