@atlaskit/adf-schema 42.1.0 → 42.2.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
+ ## 42.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 767b124: Added columnRuleStyle to layoutSection_with_single_column, and add layoutSectionAdvLayouts nodespec export
8
+
3
9
  ## 42.1.0
4
10
 
5
11
  ### Minor Changes
@@ -563,8 +563,13 @@ var layoutSectionFull = exports.layoutSectionFull = (0, _createPMSpecFactory.cre
563
563
  isolating: true
564
564
  });
565
565
  var layoutSectionWithSingleColumnStage0 = exports.layoutSectionWithSingleColumnStage0 = (0, _createPMSpecFactory.createPMNodeSpecFactory)({
566
- content: '(layoutColumn | unsupportedBlock){1,3}',
566
+ content: '(layoutColumn | unsupportedBlock){1,5}',
567
567
  marks: 'unsupportedMark unsupportedNodeAttribute',
568
+ attrs: {
569
+ columnRuleStyle: {
570
+ default: null
571
+ }
572
+ },
568
573
  isolating: true
569
574
  });
570
575
  var listItem = exports.listItem = (0, _createPMSpecFactory.createPMNodeSpecFactory)({
@@ -30,8 +30,16 @@ var layoutSection = exports.layoutSection = (0, _adfSchemaGenerator.adfNode)('la
30
30
  }
31
31
  }).variant('with_single_column', {
32
32
  stage0: true,
33
- content: [(0, _adfSchemaGenerator.$range)(1, 3, (0, _adfSchemaGenerator.$or)(_layoutColumn.layoutColumn, _unsupportedBlock.unsupportedBlock))],
33
+ content: [(0, _adfSchemaGenerator.$range)(1, 5, (0, _adfSchemaGenerator.$or)(_layoutColumn.layoutColumn, _unsupportedBlock.unsupportedBlock))],
34
34
  ignore: [],
35
+ attrs: {
36
+ columnRuleStyle: {
37
+ type: 'enum',
38
+ values: ['solid'],
39
+ default: null,
40
+ optional: true
41
+ }
42
+ },
35
43
  DANGEROUS_MANUAL_OVERRIDE: {
36
44
  'validator-spec': {
37
45
  'props.type': {
@@ -53,18 +53,26 @@ var layoutSectionFull = exports.layoutSectionFull = (0, _nodeTypes.layoutSection
53
53
  }
54
54
  });
55
55
 
56
- // it's same as layoutSection
57
- var layoutSectionWithSingleColumn = exports.layoutSectionWithSingleColumn = (0, _nodeTypes.layoutSection)({
56
+ // stage-0 support for columnRuleStyle attribute and 1-5 columns
57
+ var layoutSectionWithSingleColumn = exports.layoutSectionWithSingleColumn = (0, _nodeTypes.layoutSectionWithSingleColumnStage0)({
58
58
  parseDOM: [{
59
59
  context: 'layoutSection//|layoutColumn//',
60
60
  tag: 'div[data-layout-section]',
61
61
  skip: true
62
62
  }, {
63
- tag: 'div[data-layout-section]'
63
+ tag: 'div[data-layout-section]',
64
+ getAttrs: function getAttrs(dom) {
65
+ var columnRuleStyle = dom.getAttribute('data-column-rule-style');
66
+ return columnRuleStyle ? {
67
+ columnRuleStyle: columnRuleStyle
68
+ } : {};
69
+ }
64
70
  }],
65
- toDOM: function toDOM() {
71
+ toDOM: function toDOM(node) {
72
+ var columnRuleStyle = node.attrs.columnRuleStyle;
66
73
  var attrs = {
67
- 'data-layout-section': 'true'
74
+ 'data-layout-section': 'true',
75
+ 'data-column-rule-style': columnRuleStyle || undefined
68
76
  };
69
77
  return ['div', attrs, 0];
70
78
  }
@@ -1803,11 +1803,21 @@ var layoutSection_full = exports.layoutSection_full = ['layoutSection', {
1803
1803
  }];
1804
1804
  var layoutSection_with_single_column = exports.layoutSection_with_single_column = ['layoutSection', {
1805
1805
  props: {
1806
+ attrs: {
1807
+ props: {
1808
+ columnRuleStyle: {
1809
+ type: 'enum',
1810
+ values: ['solid'],
1811
+ optional: true
1812
+ }
1813
+ },
1814
+ optional: true
1815
+ },
1806
1816
  content: {
1807
1817
  type: 'array',
1808
1818
  items: ['layoutColumn'],
1809
1819
  minItems: 1,
1810
- maxItems: 3,
1820
+ maxItems: 5,
1811
1821
  allowUnsupportedBlock: true
1812
1822
  },
1813
1823
  type: {
@@ -557,8 +557,13 @@ export const layoutSectionFull = createPMNodeSpecFactory({
557
557
  isolating: true
558
558
  });
559
559
  export const layoutSectionWithSingleColumnStage0 = createPMNodeSpecFactory({
560
- content: '(layoutColumn | unsupportedBlock){1,3}',
560
+ content: '(layoutColumn | unsupportedBlock){1,5}',
561
561
  marks: 'unsupportedMark unsupportedNodeAttribute',
562
+ attrs: {
563
+ columnRuleStyle: {
564
+ default: null
565
+ }
566
+ },
562
567
  isolating: true
563
568
  });
564
569
  export const listItem = createPMNodeSpecFactory({
@@ -24,8 +24,16 @@ export const layoutSection = adfNode('layoutSection').define({
24
24
  }
25
25
  }).variant('with_single_column', {
26
26
  stage0: true,
27
- content: [$range(1, 3, $or(layoutColumn, unsupportedBlock))],
27
+ content: [$range(1, 5, $or(layoutColumn, unsupportedBlock))],
28
28
  ignore: [],
29
+ attrs: {
30
+ columnRuleStyle: {
31
+ type: 'enum',
32
+ values: ['solid'],
33
+ default: null,
34
+ optional: true
35
+ }
36
+ },
29
37
  DANGEROUS_MANUAL_OVERRIDE: {
30
38
  'validator-spec': {
31
39
  'props.type': {
@@ -1,4 +1,4 @@
1
- import { layoutSection as layoutSectionFactory } from '../../next-schema/generated/nodeTypes';
1
+ import { layoutSection as layoutSectionFactory, layoutSectionWithSingleColumnStage0 as layoutSectionWithSingleColumnStage0Factory } from '../../next-schema/generated/nodeTypes';
2
2
  import { layoutSectionFull as layoutSectionFullFactory } from '../../next-schema/generated/nodeTypes';
3
3
 
4
4
  /**
@@ -49,18 +49,28 @@ export const layoutSectionFull = layoutSectionFullFactory({
49
49
  }
50
50
  });
51
51
 
52
- // it's same as layoutSection
53
- export const layoutSectionWithSingleColumn = layoutSectionFactory({
52
+ // stage-0 support for columnRuleStyle attribute and 1-5 columns
53
+ export const layoutSectionWithSingleColumn = layoutSectionWithSingleColumnStage0Factory({
54
54
  parseDOM: [{
55
55
  context: 'layoutSection//|layoutColumn//',
56
56
  tag: 'div[data-layout-section]',
57
57
  skip: true
58
58
  }, {
59
- tag: 'div[data-layout-section]'
59
+ tag: 'div[data-layout-section]',
60
+ getAttrs: dom => {
61
+ const columnRuleStyle = dom.getAttribute('data-column-rule-style');
62
+ return columnRuleStyle ? {
63
+ columnRuleStyle
64
+ } : {};
65
+ }
60
66
  }],
61
- toDOM() {
67
+ toDOM(node) {
68
+ const {
69
+ columnRuleStyle
70
+ } = node.attrs;
62
71
  const attrs = {
63
- 'data-layout-section': 'true'
72
+ 'data-layout-section': 'true',
73
+ 'data-column-rule-style': columnRuleStyle || undefined
64
74
  };
65
75
  return ['div', attrs, 0];
66
76
  }
@@ -1797,11 +1797,21 @@ export const layoutSection_full = ['layoutSection', {
1797
1797
  }];
1798
1798
  export const layoutSection_with_single_column = ['layoutSection', {
1799
1799
  props: {
1800
+ attrs: {
1801
+ props: {
1802
+ columnRuleStyle: {
1803
+ type: 'enum',
1804
+ values: ['solid'],
1805
+ optional: true
1806
+ }
1807
+ },
1808
+ optional: true
1809
+ },
1800
1810
  content: {
1801
1811
  type: 'array',
1802
1812
  items: ['layoutColumn'],
1803
1813
  minItems: 1,
1804
- maxItems: 3,
1814
+ maxItems: 5,
1805
1815
  allowUnsupportedBlock: true
1806
1816
  },
1807
1817
  type: {
@@ -557,8 +557,13 @@ export var layoutSectionFull = createPMNodeSpecFactory({
557
557
  isolating: true
558
558
  });
559
559
  export var layoutSectionWithSingleColumnStage0 = createPMNodeSpecFactory({
560
- content: '(layoutColumn | unsupportedBlock){1,3}',
560
+ content: '(layoutColumn | unsupportedBlock){1,5}',
561
561
  marks: 'unsupportedMark unsupportedNodeAttribute',
562
+ attrs: {
563
+ columnRuleStyle: {
564
+ default: null
565
+ }
566
+ },
562
567
  isolating: true
563
568
  });
564
569
  export var listItem = createPMNodeSpecFactory({
@@ -24,8 +24,16 @@ export var layoutSection = adfNode('layoutSection').define({
24
24
  }
25
25
  }).variant('with_single_column', {
26
26
  stage0: true,
27
- content: [$range(1, 3, $or(layoutColumn, unsupportedBlock))],
27
+ content: [$range(1, 5, $or(layoutColumn, unsupportedBlock))],
28
28
  ignore: [],
29
+ attrs: {
30
+ columnRuleStyle: {
31
+ type: 'enum',
32
+ values: ['solid'],
33
+ default: null,
34
+ optional: true
35
+ }
36
+ },
29
37
  DANGEROUS_MANUAL_OVERRIDE: {
30
38
  'validator-spec': {
31
39
  'props.type': {
@@ -1,4 +1,4 @@
1
- import { layoutSection as layoutSectionFactory } from '../../next-schema/generated/nodeTypes';
1
+ import { layoutSection as layoutSectionFactory, layoutSectionWithSingleColumnStage0 as layoutSectionWithSingleColumnStage0Factory } from '../../next-schema/generated/nodeTypes';
2
2
  import { layoutSectionFull as layoutSectionFullFactory } from '../../next-schema/generated/nodeTypes';
3
3
 
4
4
  /**
@@ -49,18 +49,26 @@ export var layoutSectionFull = layoutSectionFullFactory({
49
49
  }
50
50
  });
51
51
 
52
- // it's same as layoutSection
53
- export var layoutSectionWithSingleColumn = layoutSectionFactory({
52
+ // stage-0 support for columnRuleStyle attribute and 1-5 columns
53
+ export var layoutSectionWithSingleColumn = layoutSectionWithSingleColumnStage0Factory({
54
54
  parseDOM: [{
55
55
  context: 'layoutSection//|layoutColumn//',
56
56
  tag: 'div[data-layout-section]',
57
57
  skip: true
58
58
  }, {
59
- tag: 'div[data-layout-section]'
59
+ tag: 'div[data-layout-section]',
60
+ getAttrs: function getAttrs(dom) {
61
+ var columnRuleStyle = dom.getAttribute('data-column-rule-style');
62
+ return columnRuleStyle ? {
63
+ columnRuleStyle: columnRuleStyle
64
+ } : {};
65
+ }
60
66
  }],
61
- toDOM: function toDOM() {
67
+ toDOM: function toDOM(node) {
68
+ var columnRuleStyle = node.attrs.columnRuleStyle;
62
69
  var attrs = {
63
- 'data-layout-section': 'true'
70
+ 'data-layout-section': 'true',
71
+ 'data-column-rule-style': columnRuleStyle || undefined
64
72
  };
65
73
  return ['div', attrs, 0];
66
74
  }
@@ -1797,11 +1797,21 @@ export var layoutSection_full = ['layoutSection', {
1797
1797
  }];
1798
1798
  export var layoutSection_with_single_column = ['layoutSection', {
1799
1799
  props: {
1800
+ attrs: {
1801
+ props: {
1802
+ columnRuleStyle: {
1803
+ type: 'enum',
1804
+ values: ['solid'],
1805
+ optional: true
1806
+ }
1807
+ },
1808
+ optional: true
1809
+ },
1800
1810
  content: {
1801
1811
  type: 'array',
1802
1812
  items: ['layoutColumn'],
1803
1813
  minItems: 1,
1804
- maxItems: 3,
1814
+ maxItems: 5,
1805
1815
  allowUnsupportedBlock: true
1806
1816
  },
1807
1817
  type: {
@@ -2645,35 +2645,37 @@
2645
2645
  ]
2646
2646
  },
2647
2647
  "layoutSection_with_single_column_node": {
2648
- "allOf": [
2649
- {
2650
- "$ref": "#/definitions/layoutSection_node"
2648
+ "type": "object",
2649
+ "properties": {
2650
+ "type": {
2651
+ "enum": ["layoutSection"]
2651
2652
  },
2652
- {
2653
+ "marks": {
2654
+ "type": "array",
2655
+ "items": {
2656
+ "$ref": "#/definitions/breakout_mark"
2657
+ }
2658
+ },
2659
+ "attrs": {
2653
2660
  "type": "object",
2654
2661
  "properties": {
2655
- "marks": {
2656
- "type": "array",
2657
- "items": {
2658
- "$ref": "#/definitions/breakout_mark"
2659
- }
2660
- },
2661
- "content": {
2662
- "type": "array",
2663
- "items": {
2664
- "$ref": "#/definitions/layoutColumn_node"
2665
- },
2666
- "minItems": 1,
2667
- "maxItems": 3
2668
- },
2669
- "type": {
2670
- "enum": ["layoutSection"]
2662
+ "columnRuleStyle": {
2663
+ "enum": ["solid"]
2671
2664
  }
2672
2665
  },
2673
- "required": ["type", "content"],
2674
2666
  "additionalProperties": false
2667
+ },
2668
+ "content": {
2669
+ "type": "array",
2670
+ "items": {
2671
+ "$ref": "#/definitions/layoutColumn_node"
2672
+ },
2673
+ "minItems": 1,
2674
+ "maxItems": 5
2675
2675
  }
2676
- ]
2676
+ },
2677
+ "additionalProperties": false,
2678
+ "required": ["type", "content"]
2677
2679
  },
2678
2680
  "extensionFrame_node": {
2679
2681
  "type": "object",
@@ -421,6 +421,9 @@ export interface LayoutSectionWithSingleColumnStage0Definition {
421
421
  type: 'layoutSection';
422
422
  content: Array<LayoutColumnDefinition | UnsupportedBlockDefinition>;
423
423
  marks: Array<BreakoutMark | UnsupportedMarkMark | UnsupportedNodeAttributeMark>;
424
+ attrs: {
425
+ columnRuleStyle?: 'solid';
426
+ };
424
427
  }
425
428
  export type LayoutSectionWithSingleColumnStage0Node = PMNode & LayoutSectionWithSingleColumnStage0Definition;
426
429
  export declare const layoutSectionWithSingleColumnStage0: ({ parseDOM, toDOM, toDebugString }: import("../../schema/createPMSpecFactory").NodeSpecOptions<LayoutSectionWithSingleColumnStage0Node>) => import("prosemirror-model").NodeSpec;
@@ -2,6 +2,14 @@ export declare const layoutSection: import("@atlaskit/adf-schema-generator/dist/
2
2
  stage0: true;
3
3
  content: import("@atlaskit/adf-schema-generator/dist/types/types/ADFNodeSpec").ADFNodeContentRangeSpec[];
4
4
  ignore: any[];
5
+ attrs: {
6
+ columnRuleStyle: {
7
+ type: "enum";
8
+ values: string[];
9
+ default: any;
10
+ optional: true;
11
+ };
12
+ };
5
13
  DANGEROUS_MANUAL_OVERRIDE: {
6
14
  'validator-spec': {
7
15
  'props.type': {
@@ -1816,6 +1816,16 @@ export declare const layoutSection_full: (string | {
1816
1816
  })[];
1817
1817
  export declare const layoutSection_with_single_column: (string | {
1818
1818
  props: {
1819
+ attrs: {
1820
+ props: {
1821
+ columnRuleStyle: {
1822
+ type: string;
1823
+ values: string[];
1824
+ optional: boolean;
1825
+ };
1826
+ };
1827
+ optional: boolean;
1828
+ };
1819
1829
  content: {
1820
1830
  type: string;
1821
1831
  items: string[];
@@ -2645,35 +2645,37 @@
2645
2645
  ]
2646
2646
  },
2647
2647
  "layoutSection_with_single_column_node": {
2648
- "allOf": [
2649
- {
2650
- "$ref": "#/definitions/layoutSection_node"
2648
+ "type": "object",
2649
+ "properties": {
2650
+ "type": {
2651
+ "enum": ["layoutSection"]
2651
2652
  },
2652
- {
2653
+ "marks": {
2654
+ "type": "array",
2655
+ "items": {
2656
+ "$ref": "#/definitions/breakout_mark"
2657
+ }
2658
+ },
2659
+ "attrs": {
2653
2660
  "type": "object",
2654
2661
  "properties": {
2655
- "marks": {
2656
- "type": "array",
2657
- "items": {
2658
- "$ref": "#/definitions/breakout_mark"
2659
- }
2660
- },
2661
- "content": {
2662
- "type": "array",
2663
- "items": {
2664
- "$ref": "#/definitions/layoutColumn_node"
2665
- },
2666
- "minItems": 1,
2667
- "maxItems": 3
2668
- },
2669
- "type": {
2670
- "enum": ["layoutSection"]
2662
+ "columnRuleStyle": {
2663
+ "enum": ["solid"]
2671
2664
  }
2672
2665
  },
2673
- "required": ["type", "content"],
2674
2666
  "additionalProperties": false
2667
+ },
2668
+ "content": {
2669
+ "type": "array",
2670
+ "items": {
2671
+ "$ref": "#/definitions/layoutColumn_node"
2672
+ },
2673
+ "minItems": 1,
2674
+ "maxItems": 5
2675
2675
  }
2676
- ]
2676
+ },
2677
+ "additionalProperties": false,
2678
+ "required": ["type", "content"]
2677
2679
  },
2678
2680
  "extensionFrame_node": {
2679
2681
  "type": "object",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-schema",
3
- "version": "42.1.0",
3
+ "version": "42.2.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/"