@atlaskit/adf-utils 14.1.0 → 14.4.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 (109) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/build/tsconfig.json +6 -2
  3. package/dist/cjs/builders/marks/fragment.js +19 -0
  4. package/dist/cjs/builders/nodes/media-inline.js +15 -0
  5. package/dist/cjs/builders/types.js +5 -1
  6. package/dist/cjs/builders.js +8 -0
  7. package/dist/cjs/types/index.js +5 -1
  8. package/dist/cjs/types/validatorTypes.js +5 -1
  9. package/dist/cjs/validator/entry.js +5 -1
  10. package/dist/cjs/validator/rules.js +13 -0
  11. package/dist/cjs/validator/specs/atomic_inline.js +1 -1
  12. package/dist/cjs/validator/specs/blockCard.js +2 -1
  13. package/dist/cjs/validator/specs/block_content.js +1 -1
  14. package/dist/cjs/validator/specs/{bodiedExtension_with_no_marks.js → bodiedExtension_with_experimental_marks.js} +1 -2
  15. package/dist/cjs/validator/specs/doc.js +1 -1
  16. package/dist/cjs/validator/specs/embedCard.js +2 -1
  17. package/dist/cjs/validator/specs/{extension_with_no_marks.js → extension_with_experimental_marks.js} +1 -2
  18. package/dist/cjs/validator/specs/fragment.js +27 -0
  19. package/dist/cjs/validator/specs/index.js +58 -26
  20. package/dist/cjs/validator/specs/inline.js +1 -1
  21. package/dist/cjs/validator/specs/inlineCard.js +2 -1
  22. package/dist/cjs/validator/specs/{inlineExtension_with_no_marks.js → inlineExtension_with_experimental_marks.js} +1 -2
  23. package/dist/cjs/validator/specs/layoutSection.js +4 -7
  24. package/dist/cjs/validator/specs/layoutSection_full.js +27 -0
  25. package/dist/cjs/validator/specs/layoutSection_with_single_column.js +27 -0
  26. package/dist/cjs/validator/specs/link.js +2 -1
  27. package/dist/cjs/validator/specs/mediaInline.js +52 -0
  28. package/dist/cjs/validator/specs/non_nestable_block_content.js +1 -1
  29. package/dist/cjs/validator/specs/tableCell_content.js +1 -1
  30. package/dist/cjs/validator/validator.js +21 -17
  31. package/dist/cjs/version.json +1 -1
  32. package/dist/es2019/builders/marks/fragment.js +7 -0
  33. package/dist/es2019/builders/nodes/media-inline.js +4 -0
  34. package/dist/es2019/builders/types.js +1 -0
  35. package/dist/es2019/builders.js +2 -1
  36. package/dist/es2019/types/index.js +1 -0
  37. package/dist/es2019/types/validatorTypes.js +1 -0
  38. package/dist/es2019/validator/entry.js +1 -0
  39. package/dist/es2019/validator/rules.js +4 -0
  40. package/dist/es2019/validator/specs/atomic_inline.js +1 -1
  41. package/dist/es2019/validator/specs/blockCard.js +2 -1
  42. package/dist/es2019/validator/specs/block_content.js +1 -1
  43. package/dist/{esm/validator/specs/bodiedExtension_with_no_marks.js → es2019/validator/specs/bodiedExtension_with_experimental_marks.js} +1 -2
  44. package/dist/es2019/validator/specs/doc.js +1 -1
  45. package/dist/es2019/validator/specs/embedCard.js +2 -1
  46. package/dist/es2019/validator/specs/{extension_with_no_marks.js → extension_with_experimental_marks.js} +1 -2
  47. package/dist/es2019/validator/specs/fragment.js +20 -0
  48. package/dist/es2019/validator/specs/index.js +8 -4
  49. package/dist/es2019/validator/specs/inline.js +1 -1
  50. package/dist/es2019/validator/specs/inlineCard.js +2 -1
  51. package/dist/es2019/validator/specs/{inlineExtension_with_no_marks.js → inlineExtension_with_experimental_marks.js} +1 -2
  52. package/dist/es2019/validator/specs/layoutSection.js +4 -7
  53. package/dist/es2019/validator/specs/layoutSection_full.js +20 -0
  54. package/dist/es2019/validator/specs/layoutSection_with_single_column.js +20 -0
  55. package/dist/es2019/validator/specs/link.js +2 -1
  56. package/dist/es2019/validator/specs/mediaInline.js +45 -0
  57. package/dist/es2019/validator/specs/non_nestable_block_content.js +1 -1
  58. package/dist/es2019/validator/specs/tableCell_content.js +1 -1
  59. package/dist/es2019/validator/validator.js +18 -17
  60. package/dist/es2019/version.json +1 -1
  61. package/dist/esm/builders/marks/fragment.js +9 -0
  62. package/dist/esm/builders/nodes/media-inline.js +6 -0
  63. package/dist/esm/builders/types.js +1 -0
  64. package/dist/esm/builders.js +2 -1
  65. package/dist/esm/types/index.js +1 -0
  66. package/dist/esm/types/validatorTypes.js +1 -0
  67. package/dist/esm/validator/entry.js +1 -0
  68. package/dist/esm/validator/rules.js +4 -0
  69. package/dist/esm/validator/specs/atomic_inline.js +1 -1
  70. package/dist/esm/validator/specs/blockCard.js +2 -1
  71. package/dist/esm/validator/specs/block_content.js +1 -1
  72. package/dist/{es2019/validator/specs/bodiedExtension_with_no_marks.js → esm/validator/specs/bodiedExtension_with_experimental_marks.js} +1 -2
  73. package/dist/esm/validator/specs/doc.js +1 -1
  74. package/dist/esm/validator/specs/embedCard.js +2 -1
  75. package/dist/esm/validator/specs/{extension_with_no_marks.js → extension_with_experimental_marks.js} +1 -2
  76. package/dist/esm/validator/specs/fragment.js +20 -0
  77. package/dist/esm/validator/specs/index.js +8 -4
  78. package/dist/esm/validator/specs/inline.js +1 -1
  79. package/dist/esm/validator/specs/inlineCard.js +2 -1
  80. package/dist/esm/validator/specs/{inlineExtension_with_no_marks.js → inlineExtension_with_experimental_marks.js} +1 -2
  81. package/dist/esm/validator/specs/layoutSection.js +4 -7
  82. package/dist/esm/validator/specs/layoutSection_full.js +20 -0
  83. package/dist/esm/validator/specs/layoutSection_with_single_column.js +20 -0
  84. package/dist/esm/validator/specs/link.js +2 -1
  85. package/dist/esm/validator/specs/mediaInline.js +45 -0
  86. package/dist/esm/validator/specs/non_nestable_block_content.js +1 -1
  87. package/dist/esm/validator/specs/tableCell_content.js +1 -1
  88. package/dist/esm/validator/validator.js +20 -17
  89. package/dist/esm/version.json +1 -1
  90. package/dist/types/builders/marks/breakout.d.ts +1 -1
  91. package/dist/types/builders/marks/fragment.d.ts +3 -0
  92. package/dist/types/builders/nodes/media-inline.d.ts +2 -0
  93. package/dist/types/builders.d.ts +1 -0
  94. package/dist/types/types/validatorTypes.d.ts +1 -0
  95. package/dist/types/validator/rules.d.ts +3 -0
  96. package/dist/types/validator/specs/blockCard.d.ts +1 -0
  97. package/dist/types/validator/specs/{bodiedExtension_with_no_marks.d.ts → bodiedExtension_with_experimental_marks.d.ts} +1 -2
  98. package/dist/types/validator/specs/embedCard.d.ts +1 -0
  99. package/dist/types/validator/specs/{extension_with_no_marks.d.ts → extension_with_experimental_marks.d.ts} +1 -2
  100. package/dist/types/validator/specs/fragment.d.ts +21 -0
  101. package/dist/types/validator/specs/index.d.ts +8 -4
  102. package/dist/types/validator/specs/inlineCard.d.ts +1 -0
  103. package/dist/types/validator/specs/{inlineExtension_with_no_marks.d.ts → inlineExtension_with_experimental_marks.d.ts} +1 -2
  104. package/dist/types/validator/specs/layoutSection.d.ts +3 -6
  105. package/dist/types/validator/specs/layoutSection_full.d.ts +21 -0
  106. package/dist/types/validator/specs/layoutSection_with_single_column.d.ts +21 -0
  107. package/dist/types/validator/specs/link.d.ts +1 -0
  108. package/dist/types/validator/specs/mediaInline.d.ts +46 -0
  109. package/package.json +9 -6
@@ -0,0 +1,20 @@
1
+ export default {
2
+ props: {
3
+ type: {
4
+ type: 'enum',
5
+ values: ['fragment']
6
+ },
7
+ attrs: {
8
+ props: {
9
+ localId: {
10
+ type: 'string',
11
+ minLength: 1
12
+ },
13
+ name: {
14
+ type: 'string',
15
+ optional: true
16
+ }
17
+ }
18
+ }
19
+ }
20
+ };
@@ -13,18 +13,21 @@ export { default as alignment } from './alignment';
13
13
  export { default as indentation } from './indentation';
14
14
  export { default as annotation } from './annotation';
15
15
  export { default as dataConsumer } from './dataConsumer';
16
+ export { default as fragment } from './fragment';
16
17
  export { default as hardBreak } from './hardBreak';
17
18
  export { default as mention } from './mention';
18
19
  export { default as emoji } from './emoji';
19
20
  export { default as inlineExtension } from './inlineExtension';
20
- export { default as inlineExtension_with_no_marks } from './inlineExtension_with_no_marks';
21
21
  export { default as inlineExtension_with_marks } from './inlineExtension_with_marks';
22
+ export { default as inlineExtension_with_experimental_marks } from './inlineExtension_with_experimental_marks';
22
23
  export { default as date } from './date';
23
24
  export { default as placeholder } from './placeholder';
24
25
  export { default as blockCard } from './blockCard';
25
26
  export { default as inlineCard } from './inlineCard';
26
27
  export { default as status } from './status';
27
28
  export { default as text } from './text';
29
+ export { default as media } from './media';
30
+ export { default as mediaInline } from './mediaInline';
28
31
  export { default as formatted_text_inline } from './formatted_text_inline';
29
32
  export { default as link_text_inline } from './link_text_inline';
30
33
  export { default as code_inline } from './code_inline';
@@ -35,7 +38,6 @@ export { default as paragraph_with_no_marks } from './paragraph_with_no_marks';
35
38
  export { default as paragraph_with_alignment } from './paragraph_with_alignment';
36
39
  export { default as paragraph_with_indentation } from './paragraph_with_indentation';
37
40
  export { default as bulletList } from './bulletList';
38
- export { default as media } from './media';
39
41
  export { default as caption } from './caption';
40
42
  export { default as mediaSingle } from './mediaSingle';
41
43
  export { default as mediaSingle_full } from './mediaSingle_full';
@@ -58,8 +60,8 @@ export { default as decisionList } from './decisionList';
58
60
  export { default as taskItem } from './taskItem';
59
61
  export { default as taskList } from './taskList';
60
62
  export { default as extension } from './extension';
61
- export { default as extension_with_no_marks } from './extension_with_no_marks';
62
63
  export { default as extension_with_marks } from './extension_with_marks';
64
+ export { default as extension_with_experimental_marks } from './extension_with_experimental_marks';
63
65
  export { default as embedCard } from './embedCard';
64
66
  export { default as nestedExpand_content } from './nestedExpand_content';
65
67
  export { default as nestedExpand } from './nestedExpand';
@@ -74,9 +76,11 @@ export { default as expand } from './expand';
74
76
  export { default as expand_with_no_mark } from './expand_with_no_mark';
75
77
  export { default as expand_with_breakout_mark } from './expand_with_breakout_mark';
76
78
  export { default as bodiedExtension } from './bodiedExtension';
77
- export { default as bodiedExtension_with_no_marks } from './bodiedExtension_with_no_marks';
78
79
  export { default as bodiedExtension_with_marks } from './bodiedExtension_with_marks';
80
+ export { default as bodiedExtension_with_experimental_marks } from './bodiedExtension_with_experimental_marks';
79
81
  export { default as block_content } from './block_content';
80
82
  export { default as layoutColumn } from './layoutColumn';
81
83
  export { default as layoutSection } from './layoutSection';
84
+ export { default as layoutSection_full } from './layoutSection_full';
85
+ export { default as layoutSection_with_single_column } from './layoutSection_with_single_column';
82
86
  export { default as doc } from './doc';
@@ -1 +1 @@
1
- export default ['hardBreak', 'mention', 'emoji', 'inlineExtension_with_no_marks', 'inlineExtension_with_marks', 'date', 'placeholder', 'inlineCard', 'status', 'formatted_text_inline', 'code_inline'];
1
+ export default ['hardBreak', 'mention', 'emoji', 'inlineExtension_with_marks', 'inlineExtension_with_experimental_marks', 'date', 'placeholder', 'inlineCard', 'status', 'mediaInline', 'formatted_text_inline', 'code_inline'];
@@ -7,7 +7,8 @@ export default {
7
7
  attrs: [{
8
8
  props: {
9
9
  url: {
10
- type: 'string'
10
+ type: 'string',
11
+ validatorFn: 'safeUrl'
11
12
  }
12
13
  }
13
14
  }, {
@@ -2,8 +2,7 @@ export default ['inlineExtension', {
2
2
  props: {
3
3
  marks: {
4
4
  type: 'array',
5
- items: [],
6
- maxItems: 0,
5
+ items: ['fragment'],
7
6
  optional: true
8
7
  }
9
8
  }
@@ -4,17 +4,14 @@ export default {
4
4
  type: 'enum',
5
5
  values: ['layoutSection']
6
6
  },
7
- content: {
8
- type: 'array',
9
- items: ['layoutColumn'],
10
- minItems: 2,
11
- maxItems: 3,
12
- allowUnsupportedBlock: true
13
- },
14
7
  marks: {
15
8
  type: 'array',
16
9
  items: ['breakout'],
17
10
  optional: true
11
+ },
12
+ content: {
13
+ type: 'array',
14
+ items: ['layoutColumn']
18
15
  }
19
16
  }
20
17
  };
@@ -0,0 +1,20 @@
1
+ export default ['layoutSection', {
2
+ props: {
3
+ type: {
4
+ type: 'enum',
5
+ values: ['layoutSection']
6
+ },
7
+ marks: {
8
+ type: 'array',
9
+ items: ['breakout'],
10
+ optional: true
11
+ },
12
+ content: {
13
+ type: 'array',
14
+ items: ['layoutColumn'],
15
+ minItems: 2,
16
+ maxItems: 3,
17
+ allowUnsupportedBlock: true
18
+ }
19
+ }
20
+ }];
@@ -0,0 +1,20 @@
1
+ export default ['layoutSection', {
2
+ props: {
3
+ type: {
4
+ type: 'enum',
5
+ values: ['layoutSection']
6
+ },
7
+ marks: {
8
+ type: 'array',
9
+ items: ['breakout'],
10
+ optional: true
11
+ },
12
+ content: {
13
+ type: 'array',
14
+ items: ['layoutColumn'],
15
+ minItems: 1,
16
+ maxItems: 3,
17
+ allowUnsupportedBlock: true
18
+ }
19
+ }
20
+ }];
@@ -7,7 +7,8 @@ export default {
7
7
  attrs: {
8
8
  props: {
9
9
  href: {
10
- type: 'string'
10
+ type: 'string',
11
+ validatorFn: 'safeUrl'
11
12
  },
12
13
  title: {
13
14
  type: 'string',
@@ -0,0 +1,45 @@
1
+ export default {
2
+ props: {
3
+ type: {
4
+ type: 'enum',
5
+ values: ['mediaInline']
6
+ },
7
+ attrs: {
8
+ props: {
9
+ data: {
10
+ type: 'object',
11
+ optional: true
12
+ },
13
+ id: {
14
+ type: 'string',
15
+ minLength: 1
16
+ },
17
+ collection: {
18
+ type: 'string'
19
+ },
20
+ height: {
21
+ type: 'number',
22
+ optional: true
23
+ },
24
+ width: {
25
+ type: 'number',
26
+ optional: true
27
+ },
28
+ occurrenceKey: {
29
+ type: 'string',
30
+ minLength: 1,
31
+ optional: true
32
+ },
33
+ alt: {
34
+ type: 'string',
35
+ optional: true
36
+ }
37
+ }
38
+ },
39
+ marks: {
40
+ type: 'array',
41
+ items: ['link'],
42
+ optional: true
43
+ }
44
+ }
45
+ };
@@ -1 +1 @@
1
- export default ['blockCard', 'paragraph_with_no_marks', 'bulletList', 'mediaSingle_full', 'mediaSingle_caption', 'codeBlock_with_no_marks', 'orderedList', 'heading_with_no_marks', 'panel', 'blockquote', 'rule', 'mediaGroup', 'decisionList', 'taskList', 'extension_with_no_marks', 'extension_with_marks', 'embedCard', 'table'];
1
+ export default ['blockCard', 'paragraph_with_no_marks', 'bulletList', 'mediaSingle_full', 'mediaSingle_caption', 'codeBlock_with_no_marks', 'orderedList', 'heading_with_no_marks', 'panel', 'blockquote', 'rule', 'mediaGroup', 'decisionList', 'taskList', 'extension_with_marks', 'extension_with_experimental_marks', 'embedCard', 'table'];
@@ -1,6 +1,6 @@
1
1
  export default {
2
2
  type: 'array',
3
- items: [['blockCard', 'paragraph_with_no_marks', 'paragraph_with_alignment', 'bulletList', 'mediaSingle_full', 'mediaSingle_caption', 'codeBlock_with_no_marks', 'orderedList', 'heading_with_no_marks', 'heading_with_alignment', 'heading_with_indentation', 'panel', 'blockquote', 'rule', 'mediaGroup', 'decisionList', 'taskList', 'extension_with_no_marks', 'extension_with_marks', 'embedCard', 'nestedExpand_with_no_marks']],
3
+ items: [['blockCard', 'paragraph_with_no_marks', 'paragraph_with_alignment', 'bulletList', 'mediaSingle_full', 'mediaSingle_caption', 'codeBlock_with_no_marks', 'orderedList', 'heading_with_no_marks', 'heading_with_alignment', 'heading_with_indentation', 'panel', 'blockquote', 'rule', 'mediaGroup', 'decisionList', 'taskList', 'extension_with_marks', 'extension_with_experimental_marks', 'embedCard', 'nestedExpand_with_no_marks']],
4
4
  minItems: 1,
5
5
  allowUnsupportedBlock: true
6
6
  };
@@ -8,6 +8,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
8
8
 
9
9
  import * as specs from './specs';
10
10
  import { copy, isBoolean, isDefined, isInteger, isNumber, isPlainObject, isString, makeArray } from './utils';
11
+ import { validatorFnMap } from './rules';
11
12
 
12
13
  function mapMarksItems(spec) {
13
14
  var fn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (x) {
@@ -81,9 +82,7 @@ function createSpec(nodes, marks) {
81
82
  spec.props.content = _objectSpread({}, spec.props.content);
82
83
  }
83
84
 
84
- spec.props.content.items = spec.props.content.items. // ['inline'] => [['emoji', 'hr', ...]]
85
- // ['media'] => [['media']]
86
- map(function (item) {
85
+ spec.props.content.items = spec.props.content.items.map(function (item) {
87
86
  return isString(item) ? Array.isArray(specs[item]) ? specs[item] : [item] : item;
88
87
  }) // [['emoji', 'hr', 'inline_code']] => [['emoji', 'hr', ['text', { marks: {} }]]]
89
88
  .map(function (item) {
@@ -178,7 +177,11 @@ export function validateAttrs(spec, value) {
178
177
  return isInteger(value) && (isDefined(spec.minimum) ? spec.minimum <= value : true) && (isDefined(spec.maximum) ? spec.maximum >= value : true);
179
178
 
180
179
  case 'string':
181
- return isString(value) && (isDefined(spec.minLength) ? spec.minLength <= value.length : true) && (spec.pattern ? new RegExp(spec.pattern).test(value) : true);
180
+ var validatorFnPassed = function validatorFnPassed(rule) {
181
+ return typeof value === 'string' && isDefined(validatorFnMap[rule]) && validatorFnMap[rule](value);
182
+ };
183
+
184
+ return isString(value) && (isDefined(spec.minLength) ? spec.minLength <= value.length : true) && (isDefined(spec.validatorFn) ? validatorFnPassed(spec.validatorFn) : true) && (spec.pattern ? new RegExp(spec.pattern).test(value) : true);
182
185
 
183
186
  case 'object':
184
187
  return isPlainObject(value);
@@ -385,19 +388,19 @@ export function validator(nodes, marks, options) {
385
388
  } // this checks for mark level attribute errors
386
389
  // and propagates error code and message
387
390
  else if (finalResult.marksValidationOutput && finalResult.marksValidationOutput.length) {
388
- return {
389
- valid: false,
390
- originalMark: mark,
391
- errorCode: finalResult.marksValidationOutput[0].errorCode,
392
- message: finalResult.marksValidationOutput[0].message
393
- };
394
- } else {
395
- return {
396
- valid: false,
397
- originalMark: mark,
398
- errorCode: 'INVALID_TYPE'
399
- };
400
- }
391
+ return {
392
+ valid: false,
393
+ originalMark: mark,
394
+ errorCode: finalResult.marksValidationOutput[0].errorCode,
395
+ message: finalResult.marksValidationOutput[0].message
396
+ };
397
+ } else {
398
+ return {
399
+ valid: false,
400
+ originalMark: mark,
401
+ errorCode: 'INVALID_TYPE'
402
+ };
403
+ }
401
404
  } else {
402
405
  return {
403
406
  valid: false,
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-utils",
3
- "version": "14.1.0",
3
+ "version": "14.4.0",
4
4
  "sideEffects": false
5
5
  }
@@ -1,3 +1,3 @@
1
1
  import { BreakoutMarkAttrs, BreakoutMarkDefinition, CodeBlockDefinition, LayoutSectionDefinition } from '@atlaskit/adf-schema';
2
2
  import { WithAppliedMark } from '../types';
3
- export declare const breakout: (attrs: BreakoutMarkAttrs) => (maybeNode: CodeBlockDefinition | LayoutSectionDefinition) => WithAppliedMark<CodeBlockDefinition | LayoutSectionDefinition, BreakoutMarkDefinition>;
3
+ export declare const breakout: (attrs: BreakoutMarkAttrs) => (maybeNode: CodeBlockDefinition | LayoutSectionDefinition) => WithAppliedMark<CodeBlockDefinition | import("@atlaskit/adf-schema").LayoutSectionFullDefinition | import("@atlaskit/adf-schema").LayoutSectionWithSingleColumnDefinition, BreakoutMarkDefinition>;
@@ -0,0 +1,3 @@
1
+ import { ExtensionDefinition, BodiedExtensionDefinition, InlineExtensionDefinition, TableDefinition, FragmentAttributes, FragmentDefinition } from '@atlaskit/adf-schema';
2
+ import { WithAppliedMark } from '../types';
3
+ export declare const fragment: (attrs: FragmentAttributes) => (maybeNode: TableDefinition | ExtensionDefinition | BodiedExtensionDefinition | InlineExtensionDefinition) => WithAppliedMark<ExtensionDefinition | BodiedExtensionDefinition | InlineExtensionDefinition | TableDefinition, FragmentDefinition>;
@@ -0,0 +1,2 @@
1
+ import { MediaInlineDefinition, MediaInlineAttributes } from '@atlaskit/adf-schema';
2
+ export declare const mediaInline: (attrs: MediaInlineAttributes) => MediaInlineDefinition;
@@ -13,6 +13,7 @@ export { underline as u } from './builders/marks/underline';
13
13
  export { alignment } from './builders/marks/alignment';
14
14
  export { indentation } from './builders/marks/indentation';
15
15
  export { dataConsumer } from './builders/marks/data-consumer';
16
+ export { fragment } from './builders/marks/fragment';
16
17
  export { blockQuote } from './builders/nodes/blockquote';
17
18
  export { bodiedExtension } from './builders/nodes/bodied-extension';
18
19
  export { blockCard } from './builders/nodes/block-card';
@@ -43,6 +43,7 @@ export declare type AttributesSpec = {
43
43
  optional?: boolean;
44
44
  minLength?: number;
45
45
  pattern?: RegExp;
46
+ validatorFn?: string;
46
47
  } | {
47
48
  type: 'enum';
48
49
  values: Array<string>;
@@ -0,0 +1,3 @@
1
+ export declare const validatorFnMap: {
2
+ [key: string]: (value: string) => boolean;
3
+ };
@@ -8,6 +8,7 @@ declare const _default: {
8
8
  props: {
9
9
  url: {
10
10
  type: string;
11
+ validatorFn: string;
11
12
  };
12
13
  data?: undefined;
13
14
  };
@@ -2,8 +2,7 @@ declare const _default: (string | {
2
2
  props: {
3
3
  marks: {
4
4
  type: string;
5
- items: never[];
6
- maxItems: number;
5
+ items: string[];
7
6
  optional: boolean;
8
7
  };
9
8
  };
@@ -16,6 +16,7 @@ declare const _default: {
16
16
  };
17
17
  url: {
18
18
  type: string;
19
+ validatorFn: string;
19
20
  };
20
21
  width: {
21
22
  type: string;
@@ -2,8 +2,7 @@ declare const _default: (string | {
2
2
  props: {
3
3
  marks: {
4
4
  type: string;
5
- items: never[];
6
- maxItems: number;
5
+ items: string[];
7
6
  optional: boolean;
8
7
  };
9
8
  };
@@ -0,0 +1,21 @@
1
+ declare const _default: {
2
+ props: {
3
+ type: {
4
+ type: string;
5
+ values: string[];
6
+ };
7
+ attrs: {
8
+ props: {
9
+ localId: {
10
+ type: string;
11
+ minLength: number;
12
+ };
13
+ name: {
14
+ type: string;
15
+ optional: boolean;
16
+ };
17
+ };
18
+ };
19
+ };
20
+ };
21
+ export default _default;
@@ -12,18 +12,21 @@ export { default as alignment } from './alignment';
12
12
  export { default as indentation } from './indentation';
13
13
  export { default as annotation } from './annotation';
14
14
  export { default as dataConsumer } from './dataConsumer';
15
+ export { default as fragment } from './fragment';
15
16
  export { default as hardBreak } from './hardBreak';
16
17
  export { default as mention } from './mention';
17
18
  export { default as emoji } from './emoji';
18
19
  export { default as inlineExtension } from './inlineExtension';
19
- export { default as inlineExtension_with_no_marks } from './inlineExtension_with_no_marks';
20
20
  export { default as inlineExtension_with_marks } from './inlineExtension_with_marks';
21
+ export { default as inlineExtension_with_experimental_marks } from './inlineExtension_with_experimental_marks';
21
22
  export { default as date } from './date';
22
23
  export { default as placeholder } from './placeholder';
23
24
  export { default as blockCard } from './blockCard';
24
25
  export { default as inlineCard } from './inlineCard';
25
26
  export { default as status } from './status';
26
27
  export { default as text } from './text';
28
+ export { default as media } from './media';
29
+ export { default as mediaInline } from './mediaInline';
27
30
  export { default as formatted_text_inline } from './formatted_text_inline';
28
31
  export { default as link_text_inline } from './link_text_inline';
29
32
  export { default as code_inline } from './code_inline';
@@ -34,7 +37,6 @@ export { default as paragraph_with_no_marks } from './paragraph_with_no_marks';
34
37
  export { default as paragraph_with_alignment } from './paragraph_with_alignment';
35
38
  export { default as paragraph_with_indentation } from './paragraph_with_indentation';
36
39
  export { default as bulletList } from './bulletList';
37
- export { default as media } from './media';
38
40
  export { default as caption } from './caption';
39
41
  export { default as mediaSingle } from './mediaSingle';
40
42
  export { default as mediaSingle_full } from './mediaSingle_full';
@@ -57,8 +59,8 @@ export { default as decisionList } from './decisionList';
57
59
  export { default as taskItem } from './taskItem';
58
60
  export { default as taskList } from './taskList';
59
61
  export { default as extension } from './extension';
60
- export { default as extension_with_no_marks } from './extension_with_no_marks';
61
62
  export { default as extension_with_marks } from './extension_with_marks';
63
+ export { default as extension_with_experimental_marks } from './extension_with_experimental_marks';
62
64
  export { default as embedCard } from './embedCard';
63
65
  export { default as nestedExpand_content } from './nestedExpand_content';
64
66
  export { default as nestedExpand } from './nestedExpand';
@@ -73,9 +75,11 @@ export { default as expand } from './expand';
73
75
  export { default as expand_with_no_mark } from './expand_with_no_mark';
74
76
  export { default as expand_with_breakout_mark } from './expand_with_breakout_mark';
75
77
  export { default as bodiedExtension } from './bodiedExtension';
76
- export { default as bodiedExtension_with_no_marks } from './bodiedExtension_with_no_marks';
77
78
  export { default as bodiedExtension_with_marks } from './bodiedExtension_with_marks';
79
+ export { default as bodiedExtension_with_experimental_marks } from './bodiedExtension_with_experimental_marks';
78
80
  export { default as block_content } from './block_content';
79
81
  export { default as layoutColumn } from './layoutColumn';
80
82
  export { default as layoutSection } from './layoutSection';
83
+ export { default as layoutSection_full } from './layoutSection_full';
84
+ export { default as layoutSection_with_single_column } from './layoutSection_with_single_column';
81
85
  export { default as doc } from './doc';
@@ -8,6 +8,7 @@ declare const _default: {
8
8
  props: {
9
9
  url: {
10
10
  type: string;
11
+ validatorFn: string;
11
12
  };
12
13
  data?: undefined;
13
14
  };
@@ -2,8 +2,7 @@ declare const _default: (string | {
2
2
  props: {
3
3
  marks: {
4
4
  type: string;
5
- items: never[];
6
- maxItems: number;
5
+ items: string[];
7
6
  optional: boolean;
8
7
  };
9
8
  };
@@ -4,17 +4,14 @@ declare const _default: {
4
4
  type: string;
5
5
  values: string[];
6
6
  };
7
- content: {
7
+ marks: {
8
8
  type: string;
9
9
  items: string[];
10
- minItems: number;
11
- maxItems: number;
12
- allowUnsupportedBlock: boolean;
10
+ optional: boolean;
13
11
  };
14
- marks: {
12
+ content: {
15
13
  type: string;
16
14
  items: string[];
17
- optional: boolean;
18
15
  };
19
16
  };
20
17
  };
@@ -0,0 +1,21 @@
1
+ declare const _default: (string | {
2
+ props: {
3
+ type: {
4
+ type: string;
5
+ values: string[];
6
+ };
7
+ marks: {
8
+ type: string;
9
+ items: string[];
10
+ optional: boolean;
11
+ };
12
+ content: {
13
+ type: string;
14
+ items: string[];
15
+ minItems: number;
16
+ maxItems: number;
17
+ allowUnsupportedBlock: boolean;
18
+ };
19
+ };
20
+ })[];
21
+ export default _default;
@@ -0,0 +1,21 @@
1
+ declare const _default: (string | {
2
+ props: {
3
+ type: {
4
+ type: string;
5
+ values: string[];
6
+ };
7
+ marks: {
8
+ type: string;
9
+ items: string[];
10
+ optional: boolean;
11
+ };
12
+ content: {
13
+ type: string;
14
+ items: string[];
15
+ minItems: number;
16
+ maxItems: number;
17
+ allowUnsupportedBlock: boolean;
18
+ };
19
+ };
20
+ })[];
21
+ export default _default;
@@ -8,6 +8,7 @@ declare const _default: {
8
8
  props: {
9
9
  href: {
10
10
  type: string;
11
+ validatorFn: string;
11
12
  };
12
13
  title: {
13
14
  type: string;
@@ -0,0 +1,46 @@
1
+ declare const _default: {
2
+ props: {
3
+ type: {
4
+ type: string;
5
+ values: string[];
6
+ };
7
+ attrs: {
8
+ props: {
9
+ data: {
10
+ type: string;
11
+ optional: boolean;
12
+ };
13
+ id: {
14
+ type: string;
15
+ minLength: number;
16
+ };
17
+ collection: {
18
+ type: string;
19
+ };
20
+ height: {
21
+ type: string;
22
+ optional: boolean;
23
+ };
24
+ width: {
25
+ type: string;
26
+ optional: boolean;
27
+ };
28
+ occurrenceKey: {
29
+ type: string;
30
+ minLength: number;
31
+ optional: boolean;
32
+ };
33
+ alt: {
34
+ type: string;
35
+ optional: boolean;
36
+ };
37
+ };
38
+ };
39
+ marks: {
40
+ type: string;
41
+ items: string[];
42
+ optional: boolean;
43
+ };
44
+ };
45
+ };
46
+ export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-utils",
3
- "version": "14.1.0",
3
+ "version": "14.4.0",
4
4
  "description": "Set of utilities to traverse, modify and create ADF documents.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -24,13 +24,13 @@
24
24
  "generate:spec": "rm -rf ./src/validator/specs/ && ../json-schema-generator/bin.js --outDir=./src/validator/specs/ --mode=Spec --stage=0 ./src/validator/entry.ts"
25
25
  },
26
26
  "dependencies": {
27
- "@atlaskit/adf-schema": "^18.1.0",
27
+ "@atlaskit/adf-schema": "^20.0.0",
28
28
  "@babel/runtime": "^7.0.0"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@atlaskit/docs": "*",
32
- "@atlaskit/json-schema-generator": "^3.1.0",
33
- "@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
32
+ "@atlaskit/json-schema-generator": "^3.2.0",
33
+ "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
34
34
  "react": "^16.8.0",
35
35
  "typescript": "3.9.6",
36
36
  "wait-for-expect": "^1.2.0"
@@ -40,7 +40,10 @@
40
40
  "circular-dependencies": [
41
41
  "file-level"
42
42
  ]
43
+ },
44
+ "@repo/internal": {
45
+ "deprecation": "no-deprecated-imports"
43
46
  }
44
47
  },
45
- "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0"
46
- }
48
+ "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
49
+ }