@atlaskit/adf-schema 25.8.2 → 25.9.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @atlaskit/adf-schema
2
2
 
3
+ ## 25.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`6de13a329d4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6de13a329d4) - Move `width` and `layout` out from `datasource` into `attr` root (context blockCard node)
8
+
9
+ ## 25.8.3
10
+
11
+ ### Patch Changes
12
+
13
+ - [`f22911fb9be`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f22911fb9be) - ENGHEALTH-2667: Adjust table cell color logic to enable static analysis of token usages and follow eslint rules
14
+ - Updated dependencies
15
+
3
16
  ## 25.8.2
4
17
 
5
18
  ### Patch Changes
@@ -1,9 +1,13 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports.blockCard = void 0;
8
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
10
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
7
11
  /**
8
12
  * @stage 0
9
13
  */
@@ -12,6 +16,17 @@ exports.blockCard = void 0;
12
16
  * @name blockCard_node
13
17
  */
14
18
 
19
+ var getCommonAttributesFromDom = function getCommonAttributesFromDom(dom) {
20
+ var anchor = dom;
21
+ var data = anchor.getAttribute('data-card-data');
22
+ var datasource = anchor.getAttribute('data-datasource');
23
+ return {
24
+ data: data ? JSON.parse(data) : undefined,
25
+ layout: datasource ? dom.getAttribute('data-layout') || 'center' : undefined,
26
+ width: Number(dom.getAttribute('data-width')) || undefined,
27
+ datasource: datasource ? JSON.parse(datasource) : undefined
28
+ };
29
+ };
15
30
  var blockCard = {
16
31
  inline: false,
17
32
  group: 'block',
@@ -26,6 +41,12 @@ var blockCard = {
26
41
  },
27
42
  datasource: {
28
43
  default: null
44
+ },
45
+ layout: {
46
+ default: null
47
+ },
48
+ width: {
49
+ default: null
29
50
  }
30
51
  },
31
52
  parseDOM: [{
@@ -34,34 +55,36 @@ var blockCard = {
34
55
  priority: 100,
35
56
  getAttrs: function getAttrs(dom) {
36
57
  var anchor = dom;
37
- var data = anchor.getAttribute('data-card-data');
38
- var datasource = anchor.getAttribute('data-datasource');
39
- return {
40
- url: anchor.getAttribute('href') || null,
41
- data: data ? JSON.parse(data) : null,
42
- datasource: datasource ? JSON.parse(datasource) : null
43
- };
58
+ return _objectSpread({
59
+ url: anchor.getAttribute('href') || undefined
60
+ }, getCommonAttributesFromDom(dom));
44
61
  }
45
62
  }, {
46
63
  tag: 'div[data-block-card]',
47
64
  getAttrs: function getAttrs(dom) {
48
65
  var anchor = dom;
49
- var data = anchor.getAttribute('data-card-data');
50
- var datasource = anchor.getAttribute('data-datasource');
51
- return {
52
- url: anchor.getAttribute('data-card-url') || null,
53
- data: data ? JSON.parse(data) : null,
54
- datasource: datasource ? JSON.parse(datasource) : null
55
- };
66
+ return _objectSpread({
67
+ url: anchor.getAttribute('data-card-url') || undefined
68
+ }, getCommonAttributesFromDom(dom));
56
69
  }
57
70
  }],
58
71
  toDOM: function toDOM(node) {
59
72
  var _node$attrs;
73
+ var _ref = node.attrs,
74
+ url = _ref.url;
75
+ var _ref2 = node.attrs,
76
+ data = _ref2.data;
77
+ var _ref3 = node.attrs,
78
+ layout = _ref3.layout,
79
+ width = _ref3.width,
80
+ datasource = _ref3.datasource;
60
81
  var attrs = {
61
82
  'data-block-card': '',
62
- href: node.attrs.url || '',
63
- 'data-card-data': node.attrs.data ? JSON.stringify(node.attrs.data) : '',
64
- 'data-datasource': node.attrs.datasource ? JSON.stringify(node.attrs.datasource) : ''
83
+ href: url || '',
84
+ 'data-card-data': data ? JSON.stringify(data) : '',
85
+ 'data-datasource': datasource ? JSON.stringify(datasource) : '',
86
+ 'data-layout': layout,
87
+ 'data-width': "".concat(width)
65
88
  };
66
89
  return ['a', attrs, (node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.url) || ' '];
67
90
  }
@@ -8,7 +8,6 @@ exports.toJSONTableHeader = exports.toJSONTableCell = exports.tableWithCustomWid
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
9
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
10
  var _editorPalette = require("@atlaskit/editor-palette");
11
- var _tokens = require("@atlaskit/tokens");
12
11
  var _colors = require("../../utils/colors");
13
12
  var _uuid = require("../../utils/uuid");
14
13
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
@@ -91,9 +90,7 @@ var getCellDomAttrs = function getCellDomAttrs(node) {
91
90
  attrs.style = '';
92
91
  } else {
93
92
  var color = (0, _colors.isRgb)(background) && (0, _colors.rgbToHex)(background) ? (0, _colors.rgbToHex)(background) : background;
94
- var tokenName = (0, _editorPalette.hexToEditorBackgroundPaletteColorTokenName)(color);
95
- // eslint-disable-next-line @atlaskit/design-system/no-unsafe-design-token-usage
96
- var tokenColor = tokenName ? (0, _tokens.getTokenValue)(tokenName) : color;
93
+ var tokenColor = (0, _editorPalette.hexToEditorBackgroundPaletteRawValue)(color) || color;
97
94
  attrs.style = "".concat(attrs.style || '', "background-color: ").concat(tokenColor, ";");
98
95
 
99
96
  /**
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-schema",
3
- "version": "25.8.2",
3
+ "version": "25.9.0",
4
4
  "sideEffects": false
5
5
  }
@@ -6,6 +6,17 @@
6
6
  * @name blockCard_node
7
7
  */
8
8
 
9
+ const getCommonAttributesFromDom = dom => {
10
+ const anchor = dom;
11
+ const data = anchor.getAttribute('data-card-data');
12
+ const datasource = anchor.getAttribute('data-datasource');
13
+ return {
14
+ data: data ? JSON.parse(data) : undefined,
15
+ layout: datasource ? dom.getAttribute('data-layout') || 'center' : undefined,
16
+ width: Number(dom.getAttribute('data-width')) || undefined,
17
+ datasource: datasource ? JSON.parse(datasource) : undefined
18
+ };
19
+ };
9
20
  export const blockCard = {
10
21
  inline: false,
11
22
  group: 'block',
@@ -20,6 +31,12 @@ export const blockCard = {
20
31
  },
21
32
  datasource: {
22
33
  default: null
34
+ },
35
+ layout: {
36
+ default: null
37
+ },
38
+ width: {
39
+ default: null
23
40
  }
24
41
  },
25
42
  parseDOM: [{
@@ -28,34 +45,41 @@ export const blockCard = {
28
45
  priority: 100,
29
46
  getAttrs: dom => {
30
47
  const anchor = dom;
31
- const data = anchor.getAttribute('data-card-data');
32
- const datasource = anchor.getAttribute('data-datasource');
33
48
  return {
34
- url: anchor.getAttribute('href') || null,
35
- data: data ? JSON.parse(data) : null,
36
- datasource: datasource ? JSON.parse(datasource) : null
49
+ url: anchor.getAttribute('href') || undefined,
50
+ ...getCommonAttributesFromDom(dom)
37
51
  };
38
52
  }
39
53
  }, {
40
54
  tag: 'div[data-block-card]',
41
55
  getAttrs: dom => {
42
56
  const anchor = dom;
43
- const data = anchor.getAttribute('data-card-data');
44
- const datasource = anchor.getAttribute('data-datasource');
45
57
  return {
46
- url: anchor.getAttribute('data-card-url') || null,
47
- data: data ? JSON.parse(data) : null,
48
- datasource: datasource ? JSON.parse(datasource) : null
58
+ url: anchor.getAttribute('data-card-url') || undefined,
59
+ ...getCommonAttributesFromDom(dom)
49
60
  };
50
61
  }
51
62
  }],
52
63
  toDOM(node) {
53
64
  var _node$attrs;
65
+ const {
66
+ url
67
+ } = node.attrs;
68
+ const {
69
+ data
70
+ } = node.attrs;
71
+ const {
72
+ layout,
73
+ width,
74
+ datasource
75
+ } = node.attrs;
54
76
  const attrs = {
55
77
  'data-block-card': '',
56
- href: node.attrs.url || '',
57
- 'data-card-data': node.attrs.data ? JSON.stringify(node.attrs.data) : '',
58
- 'data-datasource': node.attrs.datasource ? JSON.stringify(node.attrs.datasource) : ''
78
+ href: url || '',
79
+ 'data-card-data': data ? JSON.stringify(data) : '',
80
+ 'data-datasource': datasource ? JSON.stringify(datasource) : '',
81
+ 'data-layout': layout,
82
+ 'data-width': `${width}`
59
83
  };
60
84
  return ['a', attrs, (node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.url) || ' '];
61
85
  }
@@ -1,5 +1,4 @@
1
- import { hexToEditorBackgroundPaletteColorTokenName } from '@atlaskit/editor-palette';
2
- import { getTokenValue } from '@atlaskit/tokens';
1
+ import { hexToEditorBackgroundPaletteRawValue } from '@atlaskit/editor-palette';
3
2
  import { B100, B50, B75, G200, G50, G75, hexToRgba, isHex, isRgb, N0, N20, N60, N800, P100, P50, P75, R100, R50, R75, rgbToHex, T100, T50, T75, Y200, Y50, Y75 } from '../../utils/colors';
4
3
  import { uuid } from '../../utils/uuid';
5
4
  export const tablePrefixSelector = 'pm-table';
@@ -75,9 +74,7 @@ export const getCellDomAttrs = node => {
75
74
  attrs.style = '';
76
75
  } else {
77
76
  const color = isRgb(background) && rgbToHex(background) ? rgbToHex(background) : background;
78
- const tokenName = hexToEditorBackgroundPaletteColorTokenName(color);
79
- // eslint-disable-next-line @atlaskit/design-system/no-unsafe-design-token-usage
80
- const tokenColor = tokenName ? getTokenValue(tokenName) : color;
77
+ const tokenColor = hexToEditorBackgroundPaletteRawValue(color) || color;
81
78
  attrs.style = `${attrs.style || ''}background-color: ${tokenColor};`;
82
79
 
83
80
  /**
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-schema",
3
- "version": "25.8.2",
3
+ "version": "25.9.0",
4
4
  "sideEffects": false
5
5
  }
@@ -1,3 +1,6 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
1
4
  /**
2
5
  * @stage 0
3
6
  */
@@ -6,6 +9,17 @@
6
9
  * @name blockCard_node
7
10
  */
8
11
 
12
+ var getCommonAttributesFromDom = function getCommonAttributesFromDom(dom) {
13
+ var anchor = dom;
14
+ var data = anchor.getAttribute('data-card-data');
15
+ var datasource = anchor.getAttribute('data-datasource');
16
+ return {
17
+ data: data ? JSON.parse(data) : undefined,
18
+ layout: datasource ? dom.getAttribute('data-layout') || 'center' : undefined,
19
+ width: Number(dom.getAttribute('data-width')) || undefined,
20
+ datasource: datasource ? JSON.parse(datasource) : undefined
21
+ };
22
+ };
9
23
  export var blockCard = {
10
24
  inline: false,
11
25
  group: 'block',
@@ -20,6 +34,12 @@ export var blockCard = {
20
34
  },
21
35
  datasource: {
22
36
  default: null
37
+ },
38
+ layout: {
39
+ default: null
40
+ },
41
+ width: {
42
+ default: null
23
43
  }
24
44
  },
25
45
  parseDOM: [{
@@ -28,34 +48,36 @@ export var blockCard = {
28
48
  priority: 100,
29
49
  getAttrs: function getAttrs(dom) {
30
50
  var anchor = dom;
31
- var data = anchor.getAttribute('data-card-data');
32
- var datasource = anchor.getAttribute('data-datasource');
33
- return {
34
- url: anchor.getAttribute('href') || null,
35
- data: data ? JSON.parse(data) : null,
36
- datasource: datasource ? JSON.parse(datasource) : null
37
- };
51
+ return _objectSpread({
52
+ url: anchor.getAttribute('href') || undefined
53
+ }, getCommonAttributesFromDom(dom));
38
54
  }
39
55
  }, {
40
56
  tag: 'div[data-block-card]',
41
57
  getAttrs: function getAttrs(dom) {
42
58
  var anchor = dom;
43
- var data = anchor.getAttribute('data-card-data');
44
- var datasource = anchor.getAttribute('data-datasource');
45
- return {
46
- url: anchor.getAttribute('data-card-url') || null,
47
- data: data ? JSON.parse(data) : null,
48
- datasource: datasource ? JSON.parse(datasource) : null
49
- };
59
+ return _objectSpread({
60
+ url: anchor.getAttribute('data-card-url') || undefined
61
+ }, getCommonAttributesFromDom(dom));
50
62
  }
51
63
  }],
52
64
  toDOM: function toDOM(node) {
53
65
  var _node$attrs;
66
+ var _ref = node.attrs,
67
+ url = _ref.url;
68
+ var _ref2 = node.attrs,
69
+ data = _ref2.data;
70
+ var _ref3 = node.attrs,
71
+ layout = _ref3.layout,
72
+ width = _ref3.width,
73
+ datasource = _ref3.datasource;
54
74
  var attrs = {
55
75
  'data-block-card': '',
56
- href: node.attrs.url || '',
57
- 'data-card-data': node.attrs.data ? JSON.stringify(node.attrs.data) : '',
58
- 'data-datasource': node.attrs.datasource ? JSON.stringify(node.attrs.datasource) : ''
76
+ href: url || '',
77
+ 'data-card-data': data ? JSON.stringify(data) : '',
78
+ 'data-datasource': datasource ? JSON.stringify(datasource) : '',
79
+ 'data-layout': layout,
80
+ 'data-width': "".concat(width)
59
81
  };
60
82
  return ['a', attrs, (node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.url) || ' '];
61
83
  }
@@ -2,8 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
3
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
4
4
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
5
- import { hexToEditorBackgroundPaletteColorTokenName } from '@atlaskit/editor-palette';
6
- import { getTokenValue } from '@atlaskit/tokens';
5
+ import { hexToEditorBackgroundPaletteRawValue } from '@atlaskit/editor-palette';
7
6
  import { B100, B50, B75, G200, G50, G75, hexToRgba, isHex, isRgb, N0, N20, N60, N800, P100, P50, P75, R100, R50, R75, rgbToHex, T100, T50, T75, Y200, Y50, Y75 } from '../../utils/colors';
8
7
  import { uuid } from '../../utils/uuid';
9
8
  export var tablePrefixSelector = 'pm-table';
@@ -78,9 +77,7 @@ export var getCellDomAttrs = function getCellDomAttrs(node) {
78
77
  attrs.style = '';
79
78
  } else {
80
79
  var color = isRgb(background) && rgbToHex(background) ? rgbToHex(background) : background;
81
- var tokenName = hexToEditorBackgroundPaletteColorTokenName(color);
82
- // eslint-disable-next-line @atlaskit/design-system/no-unsafe-design-token-usage
83
- var tokenColor = tokenName ? getTokenValue(tokenName) : color;
80
+ var tokenColor = hexToEditorBackgroundPaletteRawValue(color) || color;
84
81
  attrs.style = "".concat(attrs.style || '', "background-color: ").concat(tokenColor, ";");
85
82
 
86
83
  /**
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-schema",
3
- "version": "25.8.2",
3
+ "version": "25.9.0",
4
4
  "sideEffects": false
5
5
  }
@@ -774,32 +774,30 @@
774
774
  "type"
775
775
  ],
776
776
  "additionalProperties": false
777
- }
778
- },
779
- "width": {
780
- "type": "number",
781
- "minimum": 0,
782
- "maximum": 100
783
- },
784
- "layout": {
785
- "enum": [
786
- "wide",
787
- "full-width",
788
- "center",
789
- "wrap-right",
790
- "wrap-left",
791
- "align-end",
792
- "align-start"
793
- ]
777
+ },
778
+ "minItems": 1
794
779
  }
795
780
  },
796
781
  "required": [
797
782
  "id",
798
783
  "parameters",
799
- "views",
800
- "layout"
784
+ "views"
801
785
  ],
802
786
  "additionalProperties": false
787
+ },
788
+ "width": {
789
+ "type": "number"
790
+ },
791
+ "layout": {
792
+ "enum": [
793
+ "wide",
794
+ "full-width",
795
+ "center",
796
+ "wrap-right",
797
+ "wrap-left",
798
+ "align-end",
799
+ "align-start"
800
+ ]
803
801
  }
804
802
  },
805
803
  "additionalProperties": false,
@@ -1,5 +1,5 @@
1
1
  import { NodeSpec } from 'prosemirror-model';
2
- import { RichMediaAttributes } from './types/rich-media-common';
2
+ import { OptionalRichMediaAttributes } from './types/rich-media-common';
3
3
  export interface UrlType {
4
4
  /**
5
5
  * @validatorFn safeUrl
@@ -12,18 +12,21 @@ export interface DataType {
12
12
  */
13
13
  data: object;
14
14
  }
15
- export interface DatasourceAttributeProperties extends RichMediaAttributes {
15
+ export interface DatasourceAttributeProperties {
16
16
  id: string;
17
17
  parameters: object;
18
- views: [{
18
+ /**
19
+ * @minItems 1
20
+ */
21
+ views: {
19
22
  type: string;
20
23
  properties?: object;
21
- }];
24
+ }[];
22
25
  }
23
26
  /**
24
27
  * @stage 0
25
28
  */
26
- export interface DatasourceAttributes {
29
+ export interface DatasourceAttributes extends OptionalRichMediaAttributes {
27
30
  /**
28
31
  * @validatorFn safeUrl
29
32
  */
@@ -7,3 +7,7 @@ export interface RichMediaAttributes {
7
7
  width?: number;
8
8
  layout: Layout;
9
9
  }
10
+ export interface OptionalRichMediaAttributes {
11
+ width?: number;
12
+ layout?: Layout;
13
+ }
@@ -1,5 +1,5 @@
1
1
  import { NodeSpec } from 'prosemirror-model';
2
- import { RichMediaAttributes } from './types/rich-media-common';
2
+ import { OptionalRichMediaAttributes } from './types/rich-media-common';
3
3
  export interface UrlType {
4
4
  /**
5
5
  * @validatorFn safeUrl
@@ -12,20 +12,21 @@ export interface DataType {
12
12
  */
13
13
  data: object;
14
14
  }
15
- export interface DatasourceAttributeProperties extends RichMediaAttributes {
15
+ export interface DatasourceAttributeProperties {
16
16
  id: string;
17
17
  parameters: object;
18
- views: [
19
- {
20
- type: string;
21
- properties?: object;
22
- }
23
- ];
18
+ /**
19
+ * @minItems 1
20
+ */
21
+ views: {
22
+ type: string;
23
+ properties?: object;
24
+ }[];
24
25
  }
25
26
  /**
26
27
  * @stage 0
27
28
  */
28
- export interface DatasourceAttributes {
29
+ export interface DatasourceAttributes extends OptionalRichMediaAttributes {
29
30
  /**
30
31
  * @validatorFn safeUrl
31
32
  */
@@ -7,3 +7,7 @@ export interface RichMediaAttributes {
7
7
  width?: number;
8
8
  layout: Layout;
9
9
  }
10
+ export interface OptionalRichMediaAttributes {
11
+ width?: number;
12
+ layout?: Layout;
13
+ }
@@ -774,32 +774,30 @@
774
774
  "type"
775
775
  ],
776
776
  "additionalProperties": false
777
- }
778
- },
779
- "width": {
780
- "type": "number",
781
- "minimum": 0,
782
- "maximum": 100
783
- },
784
- "layout": {
785
- "enum": [
786
- "wide",
787
- "full-width",
788
- "center",
789
- "wrap-right",
790
- "wrap-left",
791
- "align-end",
792
- "align-start"
793
- ]
777
+ },
778
+ "minItems": 1
794
779
  }
795
780
  },
796
781
  "required": [
797
782
  "id",
798
783
  "parameters",
799
- "views",
800
- "layout"
784
+ "views"
801
785
  ],
802
786
  "additionalProperties": false
787
+ },
788
+ "width": {
789
+ "type": "number"
790
+ },
791
+ "layout": {
792
+ "enum": [
793
+ "wide",
794
+ "full-width",
795
+ "center",
796
+ "wrap-right",
797
+ "wrap-left",
798
+ "align-end",
799
+ "align-start"
800
+ ]
803
801
  }
804
802
  },
805
803
  "additionalProperties": false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-schema",
3
- "version": "25.8.2",
3
+ "version": "25.9.0",
4
4
  "description": "Shared package that contains the ADF-schema (json) and ProseMirror node/mark specs",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -48,9 +48,8 @@
48
48
  },
49
49
  "dependencies": {
50
50
  "@atlaskit/codemod-utils": "^4.2.0",
51
- "@atlaskit/editor-palette": "1.4.3",
51
+ "@atlaskit/editor-palette": "1.5.0",
52
52
  "@atlaskit/editor-tables": "^2.3.0",
53
- "@atlaskit/tokens": "^1.5.0",
54
53
  "@babel/runtime": "^7.0.0",
55
54
  "css-color-names": "0.0.4",
56
55
  "linkify-it": "^2.0.3",
@@ -59,7 +58,7 @@
59
58
  "prosemirror-transform": "1.3.2"
60
59
  },
61
60
  "devDependencies": {
62
- "@atlaskit/editor-test-helpers": "^18.5.0",
61
+ "@atlaskit/editor-test-helpers": "^18.6.0",
63
62
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
64
63
  "@types/linkify-it": "^2.0.4",
65
64
  "@types/prosemirror-history": "^1.0.1",
package/report.api.md CHANGED
@@ -427,22 +427,20 @@ export const dataConsumerToJSON: (mark: Mark) => {
427
427
  };
428
428
 
429
429
  // @public (undocumented)
430
- interface DatasourceAttributeProperties extends RichMediaAttributes {
430
+ interface DatasourceAttributeProperties {
431
431
  // (undocumented)
432
432
  id: string;
433
433
  // (undocumented)
434
434
  parameters: object;
435
435
  // (undocumented)
436
- views: [
437
- {
438
- type: string;
439
- properties?: object;
440
- },
441
- ];
436
+ views: {
437
+ type: string;
438
+ properties?: object;
439
+ }[];
442
440
  }
443
441
 
444
442
  // @public (undocumented)
445
- export interface DatasourceAttributes {
443
+ export interface DatasourceAttributes extends OptionalRichMediaAttributes {
446
444
  // (undocumented)
447
445
  datasource: DatasourceAttributeProperties;
448
446
  url?: string;
@@ -1290,6 +1288,14 @@ export function normalizeHexColor(
1290
1288
  // @public
1291
1289
  export function normalizeUrl(url?: string): string;
1292
1290
 
1291
+ // @public (undocumented)
1292
+ interface OptionalRichMediaAttributes {
1293
+ // (undocumented)
1294
+ layout?: RichMediaLayout;
1295
+ // (undocumented)
1296
+ width?: number;
1297
+ }
1298
+
1293
1299
  // @public (undocumented)
1294
1300
  export const orderedList: NodeSpec;
1295
1301
 
@@ -373,20 +373,20 @@ export const dataConsumerToJSON: (mark: Mark) => {
373
373
  };
374
374
 
375
375
  // @public (undocumented)
376
- interface DatasourceAttributeProperties extends RichMediaAttributes {
376
+ interface DatasourceAttributeProperties {
377
377
  // (undocumented)
378
378
  id: string;
379
379
  // (undocumented)
380
380
  parameters: object;
381
381
  // (undocumented)
382
- views: [{
382
+ views: {
383
383
  type: string;
384
384
  properties?: object;
385
- }];
385
+ }[];
386
386
  }
387
387
 
388
388
  // @public (undocumented)
389
- export interface DatasourceAttributes {
389
+ export interface DatasourceAttributes extends OptionalRichMediaAttributes {
390
390
  // (undocumented)
391
391
  datasource: DatasourceAttributeProperties;
392
392
  url?: string;
@@ -1157,6 +1157,14 @@ export function normalizeHexColor(color: null | string, defaultColor?: string):
1157
1157
  // @public
1158
1158
  export function normalizeUrl(url?: string): string;
1159
1159
 
1160
+ // @public (undocumented)
1161
+ interface OptionalRichMediaAttributes {
1162
+ // (undocumented)
1163
+ layout?: RichMediaLayout;
1164
+ // (undocumented)
1165
+ width?: number;
1166
+ }
1167
+
1160
1168
  // @public (undocumented)
1161
1169
  export const orderedList: NodeSpec;
1162
1170