@atlaskit/adf-schema 37.1.39 → 37.1.41

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.
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.sortNestedArrays = sortNestedArrays;
8
+ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
9
+ function sortNestedArrays(obj) {
10
+ if (obj === null || obj === undefined) {
11
+ return obj;
12
+ }
13
+ if (Array.isArray(obj) && typeof obj[0] === 'string' && (0, _typeof2.default)(obj[1]) === 'object') {
14
+ // 1. tuple of object + string
15
+ obj[1] = sortNestedArrays(obj[1]);
16
+ } else if (Array.isArray(obj) && Array.isArray(obj[0])) {
17
+ // 2. array of arrays
18
+ for (var i = 0; i < obj.length; i++) {
19
+ obj[i] = sortNestedArrays(obj[i]);
20
+ }
21
+ } else if (Array.isArray(obj) && !Array.isArray(obj[0]) && (0, _typeof2.default)(obj[0]) !== 'object') {
22
+ // 3. simple array
23
+ obj.sort();
24
+ }
25
+ if ((0, _typeof2.default)(obj) === 'object') {
26
+ // 4. object
27
+ for (var _i = 0, _Object$keys = Object.keys(obj); _i < _Object$keys.length; _i++) {
28
+ var key = _Object$keys[_i];
29
+ obj[key] = sortNestedArrays(obj[key]);
30
+ }
31
+ }
32
+ return obj;
33
+ }
@@ -24,7 +24,26 @@ export const layoutSection = adfNode('layoutSection').define({
24
24
  }
25
25
  }).variant('with_single_column', {
26
26
  content: [$range(1, 3, $or(layoutColumn, unsupportedBlock))],
27
- ignore: ['json-schema']
27
+ ignore: ['json-schema'],
28
+ DANGEROUS_MANUAL_OVERRIDE: {
29
+ 'validator-spec': {
30
+ 'props.type': {
31
+ value: {
32
+ type: 'enum',
33
+ values: ['layoutSection']
34
+ },
35
+ reason: '@DSLCompatibilityException - mismatch for layoutSection_with_single_column'
36
+ },
37
+ 'props.marks': {
38
+ value: {
39
+ items: ['breakout'],
40
+ optional: true,
41
+ type: 'array'
42
+ },
43
+ reason: '@DSLCompatibilityException - mismatch for layoutSection_with_single_column'
44
+ }
45
+ }
46
+ }
28
47
  }).variant('full', {
29
48
  marks: [breakout, unsupportedNodeAttribute, unsupportedMark],
30
49
  content: [$range(2, 3, $or(layoutColumn, unsupportedBlock))],
@@ -36,7 +55,7 @@ export const layoutSection = adfNode('layoutSection').define({
36
55
  type: 'enum',
37
56
  values: ['layoutSection']
38
57
  },
39
- reason: '@DSLCompatibilityException - mismatch for layoutSection'
58
+ reason: '@DSLCompatibilityException - mismatch for layoutSection_full'
40
59
  }
41
60
  }
42
61
  }
@@ -29,7 +29,23 @@ export const nestedExpand = adfNode('nestedExpand').define({
29
29
  optional: true
30
30
  }
31
31
  },
32
- content: [$onePlus($or(codeBlock.use('with_no_marks'), paragraph.use('with_no_marks'), mediaSingle.use('caption'), mediaSingle.use('full'), taskList, bulletList, orderedList, heading.use('with_no_marks'), mediaGroup, decisionList, rule, panel, blockquote, unsupportedBlock))]
32
+ content: [$onePlus($or(codeBlock.use('with_no_marks'), paragraph.use('with_no_marks'), mediaSingle.use('caption'), mediaSingle.use('full'), taskList, bulletList, orderedList, heading.use('with_no_marks'), mediaGroup, decisionList, rule, panel, blockquote, unsupportedBlock))],
33
+ DANGEROUS_MANUAL_OVERRIDE: {
34
+ 'validator-spec': {
35
+ 'props.attrs.optional': {
36
+ remove: true,
37
+ reason: '@DSLCompatibilityException - mismatch with DSL'
38
+ },
39
+ 'props.content': {
40
+ value: 'nestedExpand_content',
41
+ reason: '@DSLCompatibilityException - mismatch with DSL'
42
+ },
43
+ required: {
44
+ reason: '@DSLCompatibilityException - required for nestedExpand validator spec',
45
+ value: ['content']
46
+ }
47
+ }
48
+ }
33
49
  }).variant('content', {
34
50
  ignore: ['pm-spec', 'validator-spec']
35
51
  }).variant('with_no_marks', {