@atlaskit/renderer 136.0.5 → 136.0.6
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 +26 -0
- package/dist/cjs/render-document.js +9 -3
- package/dist/cjs/ui/Renderer/index.js +1 -1
- package/dist/es2019/render-document.js +9 -3
- package/dist/es2019/ui/Renderer/index.js +1 -1
- package/dist/esm/render-document.js +9 -3
- package/dist/esm/ui/Renderer/index.js +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 136.0.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`da678c24b2eb7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/da678c24b2eb7) -
|
|
8
|
+
`validateADFEntity` takes an optional trailing `adfStage`, and full-ADF strictness is opt-in: only
|
|
9
|
+
a caller that names `final` is validated against full ADF, while omitting the argument keeps
|
|
10
|
+
stage-0 specs acceptable. Every existing caller behaves exactly as it did before.
|
|
11
|
+
|
|
12
|
+
Strictness is opt-in rather than derived from a default because a document holding a stage-0-only
|
|
13
|
+
construct, such as a `layoutSection` with a single column, otherwise has that content wrapped as
|
|
14
|
+
unsupported. Editors carry such constructs by design, since the editor's own schema enables them,
|
|
15
|
+
and renderers meet them in stored documents as well as in partially streamed ones. The legacy
|
|
16
|
+
`getValidDocument` path never enforced these cardinality rules, so deriving strictness
|
|
17
|
+
automatically would have made the two validation paths disagree on the same document.
|
|
18
|
+
|
|
19
|
+
`renderDocument`'s `adfStage` argument is consequently optional and no longer defaults to `final`
|
|
20
|
+
before reaching validation. It forwards whatever the caller supplied, and the legacy branch keeps
|
|
21
|
+
its own `final` default because it reads the value as a schema selector rather than as a
|
|
22
|
+
strictness request.
|
|
23
|
+
|
|
24
|
+
All of this is a no-op while `platform_editor_adf_validator_stage0` is off, and with the flag on
|
|
25
|
+
it changes nothing for callers that do not name a stage.
|
|
26
|
+
|
|
27
|
+
- Updated dependencies
|
|
28
|
+
|
|
3
29
|
## 136.0.5
|
|
4
30
|
|
|
5
31
|
### 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
|
-
|
|
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
|
|
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.
|
|
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
|
-
|
|
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
|
|
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.
|
|
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
|
-
|
|
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
|
|
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.
|
|
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.
|
|
3
|
+
"version": "136.0.6",
|
|
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.
|
|
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.
|
|
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",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"uuid": "^3.1.0"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
|
-
"@atlaskit/editor-common": "^119.
|
|
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",
|