@atlaskit/adf-utils 18.0.3 → 18.1.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 (47) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/cjs/builders/marks/border.js +16 -0
  3. package/dist/cjs/builders.js +7 -0
  4. package/dist/cjs/validator/specs/block_content.js +1 -1
  5. package/dist/cjs/validator/specs/border.js +28 -0
  6. package/dist/cjs/validator/specs/doc.js +1 -1
  7. package/dist/cjs/validator/specs/index.js +9 -2
  8. package/dist/cjs/validator/specs/listItem.js +1 -1
  9. package/dist/cjs/validator/specs/media.js +1 -1
  10. package/dist/cjs/validator/specs/nestedExpand_content.js +1 -1
  11. package/dist/cjs/validator/specs/non_nestable_block_content.js +1 -1
  12. package/dist/cjs/validator/specs/panel.js +3 -3
  13. package/dist/cjs/validator/specs/tableCell_content.js +1 -1
  14. package/dist/cjs/version.json +1 -1
  15. package/dist/es2019/builders/marks/border.js +5 -0
  16. package/dist/es2019/builders.js +1 -0
  17. package/dist/es2019/validator/specs/block_content.js +1 -1
  18. package/dist/es2019/validator/specs/border.js +21 -0
  19. package/dist/es2019/validator/specs/doc.js +1 -1
  20. package/dist/es2019/validator/specs/index.js +3 -2
  21. package/dist/es2019/validator/specs/listItem.js +1 -1
  22. package/dist/es2019/validator/specs/media.js +1 -1
  23. package/dist/es2019/validator/specs/nestedExpand_content.js +1 -1
  24. package/dist/es2019/validator/specs/non_nestable_block_content.js +1 -1
  25. package/dist/es2019/validator/specs/panel.js +3 -3
  26. package/dist/es2019/validator/specs/tableCell_content.js +1 -1
  27. package/dist/es2019/version.json +1 -1
  28. package/dist/esm/builders/marks/border.js +9 -0
  29. package/dist/esm/builders.js +1 -0
  30. package/dist/esm/validator/specs/block_content.js +1 -1
  31. package/dist/esm/validator/specs/border.js +21 -0
  32. package/dist/esm/validator/specs/doc.js +1 -1
  33. package/dist/esm/validator/specs/index.js +3 -2
  34. package/dist/esm/validator/specs/listItem.js +1 -1
  35. package/dist/esm/validator/specs/media.js +1 -1
  36. package/dist/esm/validator/specs/nestedExpand_content.js +1 -1
  37. package/dist/esm/validator/specs/non_nestable_block_content.js +1 -1
  38. package/dist/esm/validator/specs/panel.js +3 -3
  39. package/dist/esm/validator/specs/tableCell_content.js +1 -1
  40. package/dist/esm/version.json +1 -1
  41. package/dist/types/builders/marks/border.d.ts +3 -0
  42. package/dist/types/builders.d.ts +1 -0
  43. package/dist/types/validator/specs/border.d.ts +22 -0
  44. package/dist/types/validator/specs/index.d.ts +3 -2
  45. package/dist/types/validator/specs/media.d.ts +1 -1
  46. package/dist/types/validator/specs/panel.d.ts +3 -3
  47. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @atlaskit/adf-utils
2
2
 
3
+ ## 18.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`bf04c417bfd`](https://bitbucket.org/atlassian/atlassian-frontend/commits/bf04c417bfd) - Add "border" mark to stage0 ADF schema
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+
13
+ ## 18.0.4
14
+
15
+ ### Patch Changes
16
+
17
+ - [`6b52583b688`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6b52583b688) - ED-15974 Currently nodes are validated against single spec.
18
+ When a node has multiple specs, like mediaSingle, the first spec is used to validate the node.
19
+ Therefore, the validation fails with an error `INVALID_CONTENT_LENGTH` when the correct spec is not selected for validation.
20
+
21
+ This fix is to re-arrange the specs so that the less restrictive spec is at the top.
22
+
3
23
  ## 18.0.3
4
24
 
5
25
  ### Patch Changes
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.border = void 0;
7
+ var _applyMark = require("../utils/apply-mark");
8
+ var border = function border(attrs) {
9
+ return function (maybeNode) {
10
+ return (0, _applyMark.applyMark)({
11
+ type: 'border',
12
+ attrs: attrs
13
+ }, maybeNode);
14
+ };
15
+ };
16
+ exports.border = border;
@@ -39,6 +39,12 @@ Object.defineProperty(exports, "bodiedExtension", {
39
39
  return _bodiedExtension.bodiedExtension;
40
40
  }
41
41
  });
42
+ Object.defineProperty(exports, "border", {
43
+ enumerable: true,
44
+ get: function get() {
45
+ return _border.border;
46
+ }
47
+ });
42
48
  Object.defineProperty(exports, "br", {
43
49
  enumerable: true,
44
50
  get: function get() {
@@ -394,6 +400,7 @@ var _alignment = require("./builders/marks/alignment");
394
400
  var _indentation = require("./builders/marks/indentation");
395
401
  var _dataConsumer = require("./builders/marks/data-consumer");
396
402
  var _fragment = require("./builders/marks/fragment");
403
+ var _border = require("./builders/marks/border");
397
404
  var _blockquote = require("./builders/nodes/blockquote");
398
405
  var _bodiedExtension = require("./builders/nodes/bodied-extension");
399
406
  var _blockCard = require("./builders/nodes/block-card");
@@ -4,5 +4,5 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- var _default = ['blockCard', 'paragraph_with_no_marks', 'paragraph_with_alignment', 'paragraph_with_indentation', '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', 'embedCard', 'table', 'expand_with_no_mark', 'bodiedExtension_with_marks'];
7
+ var _default = ['blockCard', 'paragraph_with_no_marks', 'paragraph_with_alignment', 'paragraph_with_indentation', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock_with_no_marks', 'bulletList', 'orderedList', 'heading_with_no_marks', 'heading_with_alignment', 'heading_with_indentation', 'panel', 'blockquote', 'rule', 'mediaGroup', 'decisionList', 'taskList', 'extension_with_marks', 'embedCard', 'table', 'expand_with_no_mark', 'bodiedExtension_with_marks'];
8
8
  exports.default = _default;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _default = {
8
+ props: {
9
+ type: {
10
+ type: 'enum',
11
+ values: ['border']
12
+ },
13
+ attrs: {
14
+ props: {
15
+ size: {
16
+ type: 'number',
17
+ minimum: 1,
18
+ maximum: 3
19
+ },
20
+ color: {
21
+ type: 'string',
22
+ pattern: '^#[0-9a-fA-F]{8}$|^#[0-9a-fA-F]{6}$'
23
+ }
24
+ }
25
+ }
26
+ }
27
+ };
28
+ exports.default = _default;
@@ -16,7 +16,7 @@ var _default = {
16
16
  },
17
17
  content: {
18
18
  type: 'array',
19
- items: [['blockCard', 'paragraph_with_no_marks', 'paragraph_with_alignment', 'paragraph_with_indentation', 'bulletList', 'mediaSingle_full', 'mediaSingle_caption', 'codeBlock_with_no_marks', 'codeBlock_with_marks', 'orderedList', 'heading_with_no_marks', 'heading_with_alignment', 'heading_with_indentation', 'panel', 'blockquote', 'rule', 'mediaGroup', 'decisionList', 'taskList', 'extension_with_marks', 'embedCard', 'table', 'expand_with_no_mark', 'expand_with_breakout_mark', 'bodiedExtension_with_marks', 'layoutSection_full', 'layoutSection_with_single_column']],
19
+ items: [['blockCard', 'paragraph_with_no_marks', 'paragraph_with_alignment', 'paragraph_with_indentation', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock_with_no_marks', 'codeBlock_with_marks', 'bulletList', 'orderedList', 'heading_with_no_marks', 'heading_with_alignment', 'heading_with_indentation', 'panel', 'blockquote', 'rule', 'mediaGroup', 'decisionList', 'taskList', 'extension_with_marks', 'embedCard', 'table', 'expand_with_no_mark', 'expand_with_breakout_mark', 'bodiedExtension_with_marks', 'layoutSection_full', 'layoutSection_with_single_column']],
20
20
  allowUnsupportedBlock: true
21
21
  }
22
22
  }
@@ -52,6 +52,12 @@ Object.defineProperty(exports, "bodiedExtension_with_marks", {
52
52
  return _bodiedExtension_with_marks.default;
53
53
  }
54
54
  });
55
+ Object.defineProperty(exports, "border", {
56
+ enumerable: true,
57
+ get: function get() {
58
+ return _border.default;
59
+ }
60
+ });
55
61
  Object.defineProperty(exports, "breakout", {
56
62
  enumerable: true,
57
63
  get: function get() {
@@ -511,6 +517,7 @@ var _indentation = _interopRequireDefault(require("./indentation"));
511
517
  var _annotation = _interopRequireDefault(require("./annotation"));
512
518
  var _dataConsumer = _interopRequireDefault(require("./dataConsumer"));
513
519
  var _fragment = _interopRequireDefault(require("./fragment"));
520
+ var _border = _interopRequireDefault(require("./border"));
514
521
  var _hardBreak = _interopRequireDefault(require("./hardBreak"));
515
522
  var _mention = _interopRequireDefault(require("./mention"));
516
523
  var _emoji = _interopRequireDefault(require("./emoji"));
@@ -533,15 +540,15 @@ var _paragraph = _interopRequireDefault(require("./paragraph"));
533
540
  var _paragraph_with_no_marks = _interopRequireDefault(require("./paragraph_with_no_marks"));
534
541
  var _paragraph_with_alignment = _interopRequireDefault(require("./paragraph_with_alignment"));
535
542
  var _paragraph_with_indentation = _interopRequireDefault(require("./paragraph_with_indentation"));
536
- var _bulletList = _interopRequireDefault(require("./bulletList"));
537
543
  var _caption = _interopRequireDefault(require("./caption"));
538
544
  var _mediaSingle = _interopRequireDefault(require("./mediaSingle"));
539
- var _mediaSingle_full = _interopRequireDefault(require("./mediaSingle_full"));
540
545
  var _mediaSingle_caption = _interopRequireDefault(require("./mediaSingle_caption"));
546
+ var _mediaSingle_full = _interopRequireDefault(require("./mediaSingle_full"));
541
547
  var _codeBlock = _interopRequireDefault(require("./codeBlock"));
542
548
  var _codeBlock_with_no_marks = _interopRequireDefault(require("./codeBlock_with_no_marks"));
543
549
  var _codeBlock_with_marks = _interopRequireDefault(require("./codeBlock_with_marks"));
544
550
  var _listItem = _interopRequireDefault(require("./listItem"));
551
+ var _bulletList = _interopRequireDefault(require("./bulletList"));
545
552
  var _orderedList = _interopRequireDefault(require("./orderedList"));
546
553
  var _heading = _interopRequireDefault(require("./heading"));
547
554
  var _heading_with_no_marks = _interopRequireDefault(require("./heading_with_no_marks"));
@@ -12,7 +12,7 @@ var _default = {
12
12
  },
13
13
  content: {
14
14
  type: 'array',
15
- items: [['paragraph_with_no_marks', 'mediaSingle_full', 'mediaSingle_caption', 'codeBlock_with_no_marks'], ['paragraph_with_no_marks', 'bulletList', 'mediaSingle_full', 'mediaSingle_caption', 'codeBlock_with_no_marks', 'orderedList']],
15
+ items: [['paragraph_with_no_marks', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock_with_no_marks'], ['paragraph_with_no_marks', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock_with_no_marks', 'bulletList', 'orderedList']],
16
16
  isTupleLike: true,
17
17
  minItems: 1
18
18
  }
@@ -66,7 +66,7 @@ var _default = {
66
66
  }],
67
67
  marks: {
68
68
  type: 'array',
69
- items: ['link'],
69
+ items: [['link', 'border']],
70
70
  optional: true
71
71
  }
72
72
  },
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = void 0;
7
7
  var _default = {
8
8
  type: 'array',
9
- items: [['paragraph_with_no_marks', 'mediaSingle_full', 'mediaSingle_caption', 'heading_with_no_marks', 'mediaGroup']],
9
+ items: [['paragraph_with_no_marks', 'mediaSingle_caption', 'mediaSingle_full', 'heading_with_no_marks', 'mediaGroup']],
10
10
  minItems: 1,
11
11
  allowUnsupportedBlock: true
12
12
  };
@@ -4,5 +4,5 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- var _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', 'embedCard', 'table'];
7
+ var _default = ['blockCard', 'paragraph_with_no_marks', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock_with_no_marks', 'bulletList', 'orderedList', 'heading_with_no_marks', 'panel', 'blockquote', 'rule', 'mediaGroup', 'decisionList', 'taskList', 'extension_with_marks', 'embedCard', 'table'];
8
8
  exports.default = _default;
@@ -20,15 +20,15 @@ var _default = {
20
20
  type: 'string',
21
21
  optional: true
22
22
  },
23
- panelColor: {
23
+ panelIconId: {
24
24
  type: 'string',
25
25
  optional: true
26
26
  },
27
- panelIconId: {
27
+ panelIconText: {
28
28
  type: 'string',
29
29
  optional: true
30
30
  },
31
- panelIconText: {
31
+ panelColor: {
32
32
  type: 'string',
33
33
  optional: true
34
34
  }
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = void 0;
7
7
  var _default = {
8
8
  type: 'array',
9
- 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', 'embedCard', 'nestedExpand_with_no_marks']],
9
+ items: [['blockCard', 'paragraph_with_no_marks', 'paragraph_with_alignment', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock_with_no_marks', 'bulletList', 'orderedList', 'heading_with_no_marks', 'heading_with_alignment', 'heading_with_indentation', 'panel', 'blockquote', 'rule', 'mediaGroup', 'decisionList', 'taskList', 'extension_with_marks', 'embedCard', 'nestedExpand_with_no_marks']],
10
10
  minItems: 1,
11
11
  allowUnsupportedBlock: true
12
12
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-utils",
3
- "version": "18.0.3",
3
+ "version": "18.1.0",
4
4
  "sideEffects": false
5
5
  }
@@ -0,0 +1,5 @@
1
+ import { applyMark } from '../utils/apply-mark';
2
+ export const border = attrs => maybeNode => applyMark({
3
+ type: 'border',
4
+ attrs
5
+ }, maybeNode);
@@ -16,6 +16,7 @@ export { alignment } from './builders/marks/alignment';
16
16
  export { indentation } from './builders/marks/indentation';
17
17
  export { dataConsumer } from './builders/marks/data-consumer';
18
18
  export { fragment } from './builders/marks/fragment';
19
+ export { border } from './builders/marks/border';
19
20
 
20
21
  // Nodes Builders
21
22
 
@@ -1 +1 @@
1
- export default ['blockCard', 'paragraph_with_no_marks', 'paragraph_with_alignment', 'paragraph_with_indentation', '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', 'embedCard', 'table', 'expand_with_no_mark', 'bodiedExtension_with_marks'];
1
+ export default ['blockCard', 'paragraph_with_no_marks', 'paragraph_with_alignment', 'paragraph_with_indentation', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock_with_no_marks', 'bulletList', 'orderedList', 'heading_with_no_marks', 'heading_with_alignment', 'heading_with_indentation', 'panel', 'blockquote', 'rule', 'mediaGroup', 'decisionList', 'taskList', 'extension_with_marks', 'embedCard', 'table', 'expand_with_no_mark', 'bodiedExtension_with_marks'];
@@ -0,0 +1,21 @@
1
+ export default {
2
+ props: {
3
+ type: {
4
+ type: 'enum',
5
+ values: ['border']
6
+ },
7
+ attrs: {
8
+ props: {
9
+ size: {
10
+ type: 'number',
11
+ minimum: 1,
12
+ maximum: 3
13
+ },
14
+ color: {
15
+ type: 'string',
16
+ pattern: '^#[0-9a-fA-F]{8}$|^#[0-9a-fA-F]{6}$'
17
+ }
18
+ }
19
+ }
20
+ }
21
+ };
@@ -10,7 +10,7 @@ export default {
10
10
  },
11
11
  content: {
12
12
  type: 'array',
13
- items: [['blockCard', 'paragraph_with_no_marks', 'paragraph_with_alignment', 'paragraph_with_indentation', 'bulletList', 'mediaSingle_full', 'mediaSingle_caption', 'codeBlock_with_no_marks', 'codeBlock_with_marks', 'orderedList', 'heading_with_no_marks', 'heading_with_alignment', 'heading_with_indentation', 'panel', 'blockquote', 'rule', 'mediaGroup', 'decisionList', 'taskList', 'extension_with_marks', 'embedCard', 'table', 'expand_with_no_mark', 'expand_with_breakout_mark', 'bodiedExtension_with_marks', 'layoutSection_full', 'layoutSection_with_single_column']],
13
+ items: [['blockCard', 'paragraph_with_no_marks', 'paragraph_with_alignment', 'paragraph_with_indentation', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock_with_no_marks', 'codeBlock_with_marks', 'bulletList', 'orderedList', 'heading_with_no_marks', 'heading_with_alignment', 'heading_with_indentation', 'panel', 'blockquote', 'rule', 'mediaGroup', 'decisionList', 'taskList', 'extension_with_marks', 'embedCard', 'table', 'expand_with_no_mark', 'expand_with_breakout_mark', 'bodiedExtension_with_marks', 'layoutSection_full', 'layoutSection_with_single_column']],
14
14
  allowUnsupportedBlock: true
15
15
  }
16
16
  }
@@ -14,6 +14,7 @@ export { default as indentation } from './indentation';
14
14
  export { default as annotation } from './annotation';
15
15
  export { default as dataConsumer } from './dataConsumer';
16
16
  export { default as fragment } from './fragment';
17
+ export { default as border } from './border';
17
18
  export { default as hardBreak } from './hardBreak';
18
19
  export { default as mention } from './mention';
19
20
  export { default as emoji } from './emoji';
@@ -36,15 +37,15 @@ export { default as paragraph } from './paragraph';
36
37
  export { default as paragraph_with_no_marks } from './paragraph_with_no_marks';
37
38
  export { default as paragraph_with_alignment } from './paragraph_with_alignment';
38
39
  export { default as paragraph_with_indentation } from './paragraph_with_indentation';
39
- export { default as bulletList } from './bulletList';
40
40
  export { default as caption } from './caption';
41
41
  export { default as mediaSingle } from './mediaSingle';
42
- export { default as mediaSingle_full } from './mediaSingle_full';
43
42
  export { default as mediaSingle_caption } from './mediaSingle_caption';
43
+ export { default as mediaSingle_full } from './mediaSingle_full';
44
44
  export { default as codeBlock } from './codeBlock';
45
45
  export { default as codeBlock_with_no_marks } from './codeBlock_with_no_marks';
46
46
  export { default as codeBlock_with_marks } from './codeBlock_with_marks';
47
47
  export { default as listItem } from './listItem';
48
+ export { default as bulletList } from './bulletList';
48
49
  export { default as orderedList } from './orderedList';
49
50
  export { default as heading } from './heading';
50
51
  export { default as heading_with_no_marks } from './heading_with_no_marks';
@@ -6,7 +6,7 @@ export default {
6
6
  },
7
7
  content: {
8
8
  type: 'array',
9
- items: [['paragraph_with_no_marks', 'mediaSingle_full', 'mediaSingle_caption', 'codeBlock_with_no_marks'], ['paragraph_with_no_marks', 'bulletList', 'mediaSingle_full', 'mediaSingle_caption', 'codeBlock_with_no_marks', 'orderedList']],
9
+ items: [['paragraph_with_no_marks', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock_with_no_marks'], ['paragraph_with_no_marks', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock_with_no_marks', 'bulletList', 'orderedList']],
10
10
  isTupleLike: true,
11
11
  minItems: 1
12
12
  }
@@ -60,7 +60,7 @@ export default {
60
60
  }],
61
61
  marks: {
62
62
  type: 'array',
63
- items: ['link'],
63
+ items: [['link', 'border']],
64
64
  optional: true
65
65
  }
66
66
  },
@@ -1,6 +1,6 @@
1
1
  export default {
2
2
  type: 'array',
3
- items: [['paragraph_with_no_marks', 'mediaSingle_full', 'mediaSingle_caption', 'heading_with_no_marks', 'mediaGroup']],
3
+ items: [['paragraph_with_no_marks', 'mediaSingle_caption', 'mediaSingle_full', 'heading_with_no_marks', 'mediaGroup']],
4
4
  minItems: 1,
5
5
  allowUnsupportedBlock: true
6
6
  };
@@ -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_marks', 'embedCard', 'table'];
1
+ export default ['blockCard', 'paragraph_with_no_marks', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock_with_no_marks', 'bulletList', 'orderedList', 'heading_with_no_marks', 'panel', 'blockquote', 'rule', 'mediaGroup', 'decisionList', 'taskList', 'extension_with_marks', 'embedCard', 'table'];
@@ -14,15 +14,15 @@ export default {
14
14
  type: 'string',
15
15
  optional: true
16
16
  },
17
- panelColor: {
17
+ panelIconId: {
18
18
  type: 'string',
19
19
  optional: true
20
20
  },
21
- panelIconId: {
21
+ panelIconText: {
22
22
  type: 'string',
23
23
  optional: true
24
24
  },
25
- panelIconText: {
25
+ panelColor: {
26
26
  type: 'string',
27
27
  optional: true
28
28
  }
@@ -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_marks', 'embedCard', 'nestedExpand_with_no_marks']],
3
+ items: [['blockCard', 'paragraph_with_no_marks', 'paragraph_with_alignment', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock_with_no_marks', 'bulletList', 'orderedList', 'heading_with_no_marks', 'heading_with_alignment', 'heading_with_indentation', 'panel', 'blockquote', 'rule', 'mediaGroup', 'decisionList', 'taskList', 'extension_with_marks', 'embedCard', 'nestedExpand_with_no_marks']],
4
4
  minItems: 1,
5
5
  allowUnsupportedBlock: true
6
6
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-utils",
3
- "version": "18.0.3",
3
+ "version": "18.1.0",
4
4
  "sideEffects": false
5
5
  }
@@ -0,0 +1,9 @@
1
+ import { applyMark } from '../utils/apply-mark';
2
+ export var border = function border(attrs) {
3
+ return function (maybeNode) {
4
+ return applyMark({
5
+ type: 'border',
6
+ attrs: attrs
7
+ }, maybeNode);
8
+ };
9
+ };
@@ -16,6 +16,7 @@ export { alignment } from './builders/marks/alignment';
16
16
  export { indentation } from './builders/marks/indentation';
17
17
  export { dataConsumer } from './builders/marks/data-consumer';
18
18
  export { fragment } from './builders/marks/fragment';
19
+ export { border } from './builders/marks/border';
19
20
 
20
21
  // Nodes Builders
21
22
 
@@ -1 +1 @@
1
- export default ['blockCard', 'paragraph_with_no_marks', 'paragraph_with_alignment', 'paragraph_with_indentation', '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', 'embedCard', 'table', 'expand_with_no_mark', 'bodiedExtension_with_marks'];
1
+ export default ['blockCard', 'paragraph_with_no_marks', 'paragraph_with_alignment', 'paragraph_with_indentation', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock_with_no_marks', 'bulletList', 'orderedList', 'heading_with_no_marks', 'heading_with_alignment', 'heading_with_indentation', 'panel', 'blockquote', 'rule', 'mediaGroup', 'decisionList', 'taskList', 'extension_with_marks', 'embedCard', 'table', 'expand_with_no_mark', 'bodiedExtension_with_marks'];
@@ -0,0 +1,21 @@
1
+ export default {
2
+ props: {
3
+ type: {
4
+ type: 'enum',
5
+ values: ['border']
6
+ },
7
+ attrs: {
8
+ props: {
9
+ size: {
10
+ type: 'number',
11
+ minimum: 1,
12
+ maximum: 3
13
+ },
14
+ color: {
15
+ type: 'string',
16
+ pattern: '^#[0-9a-fA-F]{8}$|^#[0-9a-fA-F]{6}$'
17
+ }
18
+ }
19
+ }
20
+ }
21
+ };
@@ -10,7 +10,7 @@ export default {
10
10
  },
11
11
  content: {
12
12
  type: 'array',
13
- items: [['blockCard', 'paragraph_with_no_marks', 'paragraph_with_alignment', 'paragraph_with_indentation', 'bulletList', 'mediaSingle_full', 'mediaSingle_caption', 'codeBlock_with_no_marks', 'codeBlock_with_marks', 'orderedList', 'heading_with_no_marks', 'heading_with_alignment', 'heading_with_indentation', 'panel', 'blockquote', 'rule', 'mediaGroup', 'decisionList', 'taskList', 'extension_with_marks', 'embedCard', 'table', 'expand_with_no_mark', 'expand_with_breakout_mark', 'bodiedExtension_with_marks', 'layoutSection_full', 'layoutSection_with_single_column']],
13
+ items: [['blockCard', 'paragraph_with_no_marks', 'paragraph_with_alignment', 'paragraph_with_indentation', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock_with_no_marks', 'codeBlock_with_marks', 'bulletList', 'orderedList', 'heading_with_no_marks', 'heading_with_alignment', 'heading_with_indentation', 'panel', 'blockquote', 'rule', 'mediaGroup', 'decisionList', 'taskList', 'extension_with_marks', 'embedCard', 'table', 'expand_with_no_mark', 'expand_with_breakout_mark', 'bodiedExtension_with_marks', 'layoutSection_full', 'layoutSection_with_single_column']],
14
14
  allowUnsupportedBlock: true
15
15
  }
16
16
  }
@@ -14,6 +14,7 @@ export { default as indentation } from './indentation';
14
14
  export { default as annotation } from './annotation';
15
15
  export { default as dataConsumer } from './dataConsumer';
16
16
  export { default as fragment } from './fragment';
17
+ export { default as border } from './border';
17
18
  export { default as hardBreak } from './hardBreak';
18
19
  export { default as mention } from './mention';
19
20
  export { default as emoji } from './emoji';
@@ -36,15 +37,15 @@ export { default as paragraph } from './paragraph';
36
37
  export { default as paragraph_with_no_marks } from './paragraph_with_no_marks';
37
38
  export { default as paragraph_with_alignment } from './paragraph_with_alignment';
38
39
  export { default as paragraph_with_indentation } from './paragraph_with_indentation';
39
- export { default as bulletList } from './bulletList';
40
40
  export { default as caption } from './caption';
41
41
  export { default as mediaSingle } from './mediaSingle';
42
- export { default as mediaSingle_full } from './mediaSingle_full';
43
42
  export { default as mediaSingle_caption } from './mediaSingle_caption';
43
+ export { default as mediaSingle_full } from './mediaSingle_full';
44
44
  export { default as codeBlock } from './codeBlock';
45
45
  export { default as codeBlock_with_no_marks } from './codeBlock_with_no_marks';
46
46
  export { default as codeBlock_with_marks } from './codeBlock_with_marks';
47
47
  export { default as listItem } from './listItem';
48
+ export { default as bulletList } from './bulletList';
48
49
  export { default as orderedList } from './orderedList';
49
50
  export { default as heading } from './heading';
50
51
  export { default as heading_with_no_marks } from './heading_with_no_marks';
@@ -6,7 +6,7 @@ export default {
6
6
  },
7
7
  content: {
8
8
  type: 'array',
9
- items: [['paragraph_with_no_marks', 'mediaSingle_full', 'mediaSingle_caption', 'codeBlock_with_no_marks'], ['paragraph_with_no_marks', 'bulletList', 'mediaSingle_full', 'mediaSingle_caption', 'codeBlock_with_no_marks', 'orderedList']],
9
+ items: [['paragraph_with_no_marks', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock_with_no_marks'], ['paragraph_with_no_marks', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock_with_no_marks', 'bulletList', 'orderedList']],
10
10
  isTupleLike: true,
11
11
  minItems: 1
12
12
  }
@@ -60,7 +60,7 @@ export default {
60
60
  }],
61
61
  marks: {
62
62
  type: 'array',
63
- items: ['link'],
63
+ items: [['link', 'border']],
64
64
  optional: true
65
65
  }
66
66
  },
@@ -1,6 +1,6 @@
1
1
  export default {
2
2
  type: 'array',
3
- items: [['paragraph_with_no_marks', 'mediaSingle_full', 'mediaSingle_caption', 'heading_with_no_marks', 'mediaGroup']],
3
+ items: [['paragraph_with_no_marks', 'mediaSingle_caption', 'mediaSingle_full', 'heading_with_no_marks', 'mediaGroup']],
4
4
  minItems: 1,
5
5
  allowUnsupportedBlock: true
6
6
  };
@@ -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_marks', 'embedCard', 'table'];
1
+ export default ['blockCard', 'paragraph_with_no_marks', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock_with_no_marks', 'bulletList', 'orderedList', 'heading_with_no_marks', 'panel', 'blockquote', 'rule', 'mediaGroup', 'decisionList', 'taskList', 'extension_with_marks', 'embedCard', 'table'];
@@ -14,15 +14,15 @@ export default {
14
14
  type: 'string',
15
15
  optional: true
16
16
  },
17
- panelColor: {
17
+ panelIconId: {
18
18
  type: 'string',
19
19
  optional: true
20
20
  },
21
- panelIconId: {
21
+ panelIconText: {
22
22
  type: 'string',
23
23
  optional: true
24
24
  },
25
- panelIconText: {
25
+ panelColor: {
26
26
  type: 'string',
27
27
  optional: true
28
28
  }
@@ -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_marks', 'embedCard', 'nestedExpand_with_no_marks']],
3
+ items: [['blockCard', 'paragraph_with_no_marks', 'paragraph_with_alignment', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock_with_no_marks', 'bulletList', 'orderedList', 'heading_with_no_marks', 'heading_with_alignment', 'heading_with_indentation', 'panel', 'blockquote', 'rule', 'mediaGroup', 'decisionList', 'taskList', 'extension_with_marks', 'embedCard', 'nestedExpand_with_no_marks']],
4
4
  minItems: 1,
5
5
  allowUnsupportedBlock: true
6
6
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-utils",
3
- "version": "18.0.3",
3
+ "version": "18.1.0",
4
4
  "sideEffects": false
5
5
  }
@@ -0,0 +1,3 @@
1
+ import { BorderMarkAttributes } from '@atlaskit/adf-schema';
2
+ import { WithMark } from '../types';
3
+ export declare const border: (attrs: BorderMarkAttributes) => (maybeNode: WithMark | string) => WithMark;
@@ -14,6 +14,7 @@ export { alignment } from './builders/marks/alignment';
14
14
  export { indentation } from './builders/marks/indentation';
15
15
  export { dataConsumer } from './builders/marks/data-consumer';
16
16
  export { fragment } from './builders/marks/fragment';
17
+ export { border } from './builders/marks/border';
17
18
  export { blockQuote } from './builders/nodes/blockquote';
18
19
  export { bodiedExtension } from './builders/nodes/bodied-extension';
19
20
  export { blockCard } from './builders/nodes/block-card';
@@ -0,0 +1,22 @@
1
+ declare const _default: {
2
+ props: {
3
+ type: {
4
+ type: string;
5
+ values: string[];
6
+ };
7
+ attrs: {
8
+ props: {
9
+ size: {
10
+ type: string;
11
+ minimum: number;
12
+ maximum: number;
13
+ };
14
+ color: {
15
+ type: string;
16
+ pattern: string;
17
+ };
18
+ };
19
+ };
20
+ };
21
+ };
22
+ export default _default;
@@ -13,6 +13,7 @@ export { default as indentation } from './indentation';
13
13
  export { default as annotation } from './annotation';
14
14
  export { default as dataConsumer } from './dataConsumer';
15
15
  export { default as fragment } from './fragment';
16
+ export { default as border } from './border';
16
17
  export { default as hardBreak } from './hardBreak';
17
18
  export { default as mention } from './mention';
18
19
  export { default as emoji } from './emoji';
@@ -35,15 +36,15 @@ export { default as paragraph } from './paragraph';
35
36
  export { default as paragraph_with_no_marks } from './paragraph_with_no_marks';
36
37
  export { default as paragraph_with_alignment } from './paragraph_with_alignment';
37
38
  export { default as paragraph_with_indentation } from './paragraph_with_indentation';
38
- export { default as bulletList } from './bulletList';
39
39
  export { default as caption } from './caption';
40
40
  export { default as mediaSingle } from './mediaSingle';
41
- export { default as mediaSingle_full } from './mediaSingle_full';
42
41
  export { default as mediaSingle_caption } from './mediaSingle_caption';
42
+ export { default as mediaSingle_full } from './mediaSingle_full';
43
43
  export { default as codeBlock } from './codeBlock';
44
44
  export { default as codeBlock_with_no_marks } from './codeBlock_with_no_marks';
45
45
  export { default as codeBlock_with_marks } from './codeBlock_with_marks';
46
46
  export { default as listItem } from './listItem';
47
+ export { default as bulletList } from './bulletList';
47
48
  export { default as orderedList } from './orderedList';
48
49
  export { default as heading } from './heading';
49
50
  export { default as heading_with_no_marks } from './heading_with_no_marks';
@@ -64,7 +64,7 @@ declare const _default: {
64
64
  })[];
65
65
  marks: {
66
66
  type: string;
67
- items: string[];
67
+ items: string[][];
68
68
  optional: boolean;
69
69
  };
70
70
  };
@@ -14,15 +14,15 @@ declare const _default: {
14
14
  type: string;
15
15
  optional: boolean;
16
16
  };
17
- panelColor: {
17
+ panelIconId: {
18
18
  type: string;
19
19
  optional: boolean;
20
20
  };
21
- panelIconId: {
21
+ panelIconText: {
22
22
  type: string;
23
23
  optional: boolean;
24
24
  };
25
- panelIconText: {
25
+ panelColor: {
26
26
  type: string;
27
27
  optional: boolean;
28
28
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-utils",
3
- "version": "18.0.3",
3
+ "version": "18.1.0",
4
4
  "description": "Set of utilities to traverse, modify and create ADF documents.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -33,7 +33,7 @@
33
33
  "generate:spec": "rm -rf ./src/validator/specs/ && ../json-schema-generator/bin.js --outDir=./src/validator/specs/ --mode=Spec --stage=0 ./src/validator/entry.ts"
34
34
  },
35
35
  "dependencies": {
36
- "@atlaskit/adf-schema": "^25.2.0",
36
+ "@atlaskit/adf-schema": "^25.4.0",
37
37
  "@atlaskit/codemod-utils": "^4.1.0",
38
38
  "@babel/runtime": "^7.0.0"
39
39
  },