@atlaskit/adf-schema 44.0.0 → 44.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/adf-schema
2
2
 
3
+ ## 44.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 2aebf23: Add optional attribute 'width' to Breakout Mark, approved in adf change 84
8
+
3
9
  ## 44.0.0
4
10
 
5
11
  ### Major Changes
@@ -50,6 +50,9 @@ var breakout = exports.breakout = (0, _createPMSpecFactory.createPMMarkSpecFacto
50
50
  attrs: {
51
51
  mode: {
52
52
  default: 'wide'
53
+ },
54
+ width: {
55
+ default: null
53
56
  }
54
57
  },
55
58
  inclusive: false,
@@ -13,6 +13,11 @@ var breakout = exports.breakout = (0, _adfSchemaGenerator.adfMark)('breakout').d
13
13
  type: 'enum',
14
14
  values: ['wide', 'full-width'],
15
15
  default: 'wide'
16
+ },
17
+ width: {
18
+ type: 'number',
19
+ default: null,
20
+ optional: true
16
21
  }
17
22
  }
18
23
  });
@@ -16,15 +16,19 @@ var breakout = exports.breakout = (0, _markTypes.breakout)({
16
16
  tag: 'div.fabric-editor-breakout-mark',
17
17
  getAttrs: function getAttrs(dom) {
18
18
  var mode = dom.getAttribute('data-mode');
19
+ var width = dom.getAttribute('data-width');
19
20
  return {
20
- mode: allowedTypes.indexOf(mode || '') === -1 ? 'wide' : mode
21
+ mode: allowedTypes.indexOf(mode || '') === -1 ? 'wide' : mode,
22
+ width: width ? parseInt(width) : null
21
23
  };
22
24
  }
23
25
  }],
24
26
  toDOM: function toDOM(mark) {
27
+ var _mark$attrs;
25
28
  return ['div', {
26
29
  class: 'fabric-editor-breakout-mark',
27
- 'data-mode': mark.attrs.mode
30
+ 'data-mode': mark.attrs.mode,
31
+ 'data-width': (_mark$attrs = mark.attrs) === null || _mark$attrs === void 0 ? void 0 : _mark$attrs.width
28
32
  }, 0];
29
33
  }
30
34
  });
@@ -1739,6 +1739,10 @@ var breakout = exports.breakout = {
1739
1739
  mode: {
1740
1740
  type: 'enum',
1741
1741
  values: ['wide', 'full-width']
1742
+ },
1743
+ width: {
1744
+ type: 'number',
1745
+ optional: true
1742
1746
  }
1743
1747
  }
1744
1748
  }
@@ -44,6 +44,9 @@ export const breakout = createPMMarkSpecFactory({
44
44
  attrs: {
45
45
  mode: {
46
46
  default: 'wide'
47
+ },
48
+ width: {
49
+ default: null
47
50
  }
48
51
  },
49
52
  inclusive: false,
@@ -7,6 +7,11 @@ export const breakout = adfMark('breakout').define({
7
7
  type: 'enum',
8
8
  values: ['wide', 'full-width'],
9
9
  default: 'wide'
10
+ },
11
+ width: {
12
+ type: 'number',
13
+ default: null,
14
+ optional: true
10
15
  }
11
16
  }
12
17
  });
@@ -10,15 +10,19 @@ export const breakout = breakoutFactory({
10
10
  tag: 'div.fabric-editor-breakout-mark',
11
11
  getAttrs(dom) {
12
12
  const mode = dom.getAttribute('data-mode');
13
+ const width = dom.getAttribute('data-width');
13
14
  return {
14
- mode: allowedTypes.indexOf(mode || '') === -1 ? 'wide' : mode
15
+ mode: allowedTypes.indexOf(mode || '') === -1 ? 'wide' : mode,
16
+ width: width ? parseInt(width) : null
15
17
  };
16
18
  }
17
19
  }],
18
20
  toDOM(mark) {
21
+ var _mark$attrs;
19
22
  return ['div', {
20
23
  class: 'fabric-editor-breakout-mark',
21
- 'data-mode': mark.attrs.mode
24
+ 'data-mode': mark.attrs.mode,
25
+ 'data-width': (_mark$attrs = mark.attrs) === null || _mark$attrs === void 0 ? void 0 : _mark$attrs.width
22
26
  }, 0];
23
27
  }
24
28
  });
@@ -1733,6 +1733,10 @@ export const breakout = {
1733
1733
  mode: {
1734
1734
  type: 'enum',
1735
1735
  values: ['wide', 'full-width']
1736
+ },
1737
+ width: {
1738
+ type: 'number',
1739
+ optional: true
1736
1740
  }
1737
1741
  }
1738
1742
  }
@@ -44,6 +44,9 @@ export var breakout = createPMMarkSpecFactory({
44
44
  attrs: {
45
45
  mode: {
46
46
  default: 'wide'
47
+ },
48
+ width: {
49
+ default: null
47
50
  }
48
51
  },
49
52
  inclusive: false,
@@ -7,6 +7,11 @@ export var breakout = adfMark('breakout').define({
7
7
  type: 'enum',
8
8
  values: ['wide', 'full-width'],
9
9
  default: 'wide'
10
+ },
11
+ width: {
12
+ type: 'number',
13
+ default: null,
14
+ optional: true
10
15
  }
11
16
  }
12
17
  });
@@ -10,15 +10,19 @@ export var breakout = breakoutFactory({
10
10
  tag: 'div.fabric-editor-breakout-mark',
11
11
  getAttrs: function getAttrs(dom) {
12
12
  var mode = dom.getAttribute('data-mode');
13
+ var width = dom.getAttribute('data-width');
13
14
  return {
14
- mode: allowedTypes.indexOf(mode || '') === -1 ? 'wide' : mode
15
+ mode: allowedTypes.indexOf(mode || '') === -1 ? 'wide' : mode,
16
+ width: width ? parseInt(width) : null
15
17
  };
16
18
  }
17
19
  }],
18
20
  toDOM: function toDOM(mark) {
21
+ var _mark$attrs;
19
22
  return ['div', {
20
23
  class: 'fabric-editor-breakout-mark',
21
- 'data-mode': mark.attrs.mode
24
+ 'data-mode': mark.attrs.mode,
25
+ 'data-width': (_mark$attrs = mark.attrs) === null || _mark$attrs === void 0 ? void 0 : _mark$attrs.width
22
26
  }, 0];
23
27
  }
24
28
  });
@@ -1733,6 +1733,10 @@ export var breakout = {
1733
1733
  mode: {
1734
1734
  type: 'enum',
1735
1735
  values: ['wide', 'full-width']
1736
+ },
1737
+ width: {
1738
+ type: 'number',
1739
+ optional: true
1736
1740
  }
1737
1741
  }
1738
1742
  }
@@ -174,6 +174,9 @@
174
174
  "properties": {
175
175
  "mode": {
176
176
  "enum": ["wide", "full-width"]
177
+ },
178
+ "width": {
179
+ "type": "number"
177
180
  }
178
181
  },
179
182
  "required": ["mode"],
@@ -174,6 +174,9 @@
174
174
  "properties": {
175
175
  "mode": {
176
176
  "enum": ["wide", "full-width"]
177
+ },
178
+ "width": {
179
+ "type": "number"
177
180
  }
178
181
  },
179
182
  "required": ["mode"],
@@ -52,6 +52,7 @@ export interface BorderMark extends Mark {
52
52
  export declare const border: ({ parseDOM, toDOM, toDebugString }: import("../../schema/createPMSpecFactory").MarkSpecOptions<BorderMark>) => import("prosemirror-model").MarkSpec;
53
53
  export interface BreakoutMarkAttributes {
54
54
  mode: 'wide' | 'full-width';
55
+ width?: number;
55
56
  }
56
57
  export interface BreakoutDefinition {
57
58
  type: 'breakout';
@@ -1753,6 +1753,10 @@ export declare const breakout: {
1753
1753
  type: string;
1754
1754
  values: string[];
1755
1755
  };
1756
+ width: {
1757
+ type: string;
1758
+ optional: boolean;
1759
+ };
1756
1760
  };
1757
1761
  };
1758
1762
  };
@@ -174,6 +174,9 @@
174
174
  "properties": {
175
175
  "mode": {
176
176
  "enum": ["wide", "full-width"]
177
+ },
178
+ "width": {
179
+ "type": "number"
177
180
  }
178
181
  },
179
182
  "required": ["mode"],
@@ -174,6 +174,9 @@
174
174
  "properties": {
175
175
  "mode": {
176
176
  "enum": ["wide", "full-width"]
177
+ },
178
+ "width": {
179
+ "type": "number"
177
180
  }
178
181
  },
179
182
  "required": ["mode"],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-schema",
3
- "version": "44.0.0",
3
+ "version": "44.1.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/"
@@ -45,7 +45,7 @@
45
45
  "memoize-one": "^6.0.0"
46
46
  },
47
47
  "devDependencies": {
48
- "@atlassian/adf-schema-json": "^1.22.0",
48
+ "@atlassian/adf-schema-json": "^1.23.0",
49
49
  "@atlaskit/adf-schema-generator": "^1.36.0",
50
50
  "@atlaskit/codemod-utils": "^4.2.4",
51
51
  "@babel/cli": "^7.22.9",