@atlaskit/adf-schema 36.15.0 → 36.16.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
+ ## 36.16.0
4
+
5
+ ### Minor Changes
6
+
7
+ - bd85ab9: Fix handling of anyOf in PM Spec
8
+
3
9
  ## 36.15.0
4
10
 
5
11
  ### Minor Changes
@@ -64,6 +64,7 @@ var blockCard = exports.blockCard = (0, _adfSchemaGenerator.adfNode)('blockCard'
64
64
  }
65
65
  }, {
66
66
  data: {
67
+ type: 'object',
67
68
  default: null
68
69
  }
69
70
  }]
@@ -29,6 +29,7 @@ var bodiedExtension = exports.bodiedExtension = (0, _adfSchemaGenerator.adfNode)
29
29
  default: ''
30
30
  },
31
31
  parameters: {
32
+ type: 'object',
32
33
  optional: true,
33
34
  default: null
34
35
  },
@@ -25,6 +25,7 @@ var extension = exports.extension = (0, _adfSchemaGenerator.adfNode)('extension'
25
25
  default: ''
26
26
  },
27
27
  parameters: {
28
+ type: 'object',
28
29
  optional: true,
29
30
  default: null
30
31
  },
@@ -21,6 +21,7 @@ var inlineCard = exports.inlineCard = (0, _adfSchemaGenerator.adfNode)('inlineCa
21
21
  }
22
22
  }, {
23
23
  data: {
24
+ type: 'object',
24
25
  default: null
25
26
  }
26
27
  }]
@@ -25,6 +25,7 @@ var inlineExtension = exports.inlineExtension = (0, _adfSchemaGenerator.adfNode)
25
25
  default: ''
26
26
  },
27
27
  parameters: {
28
+ type: 'object',
28
29
  optional: true,
29
30
  default: null
30
31
  },
@@ -17,6 +17,7 @@ var mediaInline = exports.mediaInline = (0, _adfSchemaGenerator.adfNode)('mediaI
17
17
  marks: [_link.link, _annotation.annotation, _border.border, _unsupportedNodeAttribute.unsupportedNodeAttribute, _unsupportedMark.unsupportedMark],
18
18
  attrs: {
19
19
  data: {
20
+ type: 'object',
20
21
  optional: true
21
22
  },
22
23
  type: {
@@ -24,6 +24,7 @@ var multiBodiedExtension = exports.multiBodiedExtension = (0, _adfSchemaGenerato
24
24
  default: ''
25
25
  },
26
26
  parameters: {
27
+ type: 'object',
27
28
  optional: true,
28
29
  default: null
29
30
  },
@@ -58,6 +58,7 @@ export const blockCard = adfNode('blockCard').define({
58
58
  }
59
59
  }, {
60
60
  data: {
61
+ type: 'object',
61
62
  default: null
62
63
  }
63
64
  }]
@@ -21,6 +21,7 @@ export const bodiedExtension = adfNode('bodiedExtension').define({
21
21
  default: ''
22
22
  },
23
23
  parameters: {
24
+ type: 'object',
24
25
  optional: true,
25
26
  default: null
26
27
  },
@@ -19,6 +19,7 @@ export const extension = adfNode('extension').define({
19
19
  default: ''
20
20
  },
21
21
  parameters: {
22
+ type: 'object',
22
23
  optional: true,
23
24
  default: null
24
25
  },
@@ -15,6 +15,7 @@ export const inlineCard = adfNode('inlineCard').define({
15
15
  }
16
16
  }, {
17
17
  data: {
18
+ type: 'object',
18
19
  default: null
19
20
  }
20
21
  }]
@@ -19,6 +19,7 @@ export const inlineExtension = adfNode('inlineExtension').define({
19
19
  default: ''
20
20
  },
21
21
  parameters: {
22
+ type: 'object',
22
23
  optional: true,
23
24
  default: null
24
25
  },
@@ -11,6 +11,7 @@ export const mediaInline = adfNode('mediaInline').define({
11
11
  marks: [link, annotation, border, unsupportedNodeAttribute, unsupportedMark],
12
12
  attrs: {
13
13
  data: {
14
+ type: 'object',
14
15
  optional: true
15
16
  },
16
17
  type: {
@@ -18,6 +18,7 @@ export const multiBodiedExtension = adfNode('multiBodiedExtension').define({
18
18
  default: ''
19
19
  },
20
20
  parameters: {
21
+ type: 'object',
21
22
  optional: true,
22
23
  default: null
23
24
  },
@@ -58,6 +58,7 @@ export var blockCard = adfNode('blockCard').define({
58
58
  }
59
59
  }, {
60
60
  data: {
61
+ type: 'object',
61
62
  default: null
62
63
  }
63
64
  }]
@@ -22,6 +22,7 @@ export var bodiedExtension = adfNode('bodiedExtension').define({
22
22
  default: ''
23
23
  },
24
24
  parameters: {
25
+ type: 'object',
25
26
  optional: true,
26
27
  default: null
27
28
  },
@@ -19,6 +19,7 @@ export var extension = adfNode('extension').define({
19
19
  default: ''
20
20
  },
21
21
  parameters: {
22
+ type: 'object',
22
23
  optional: true,
23
24
  default: null
24
25
  },
@@ -15,6 +15,7 @@ export var inlineCard = adfNode('inlineCard').define({
15
15
  }
16
16
  }, {
17
17
  data: {
18
+ type: 'object',
18
19
  default: null
19
20
  }
20
21
  }]
@@ -19,6 +19,7 @@ export var inlineExtension = adfNode('inlineExtension').define({
19
19
  default: ''
20
20
  },
21
21
  parameters: {
22
+ type: 'object',
22
23
  optional: true,
23
24
  default: null
24
25
  },
@@ -11,6 +11,7 @@ export var mediaInline = adfNode('mediaInline').define({
11
11
  marks: [link, annotation, border, unsupportedNodeAttribute, unsupportedMark],
12
12
  attrs: {
13
13
  data: {
14
+ type: 'object',
14
15
  optional: true
15
16
  },
16
17
  type: {
@@ -18,6 +18,7 @@ export var multiBodiedExtension = adfNode('multiBodiedExtension').define({
18
18
  default: ''
19
19
  },
20
20
  parameters: {
21
+ type: 'object',
21
22
  optional: true,
22
23
  default: null
23
24
  },
@@ -1,15 +1,22 @@
1
1
  import { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
2
  import { InlineDefinition, BlockDefinition } from './nodeGroupTypes';
3
3
  import { UnsupportedNodeAttributeMark, UnsupportedMarkMark, LinkMark, AnnotationMark, BorderMark, EmMark, StrongMark, StrikeMark, SubsupMark, UnderlineMark, TextColorMark, BackgroundColorMark, CodeMark, DataConsumerMark, FragmentMark, AlignmentMark, IndentationMark, BreakoutMark } from './markTypes';
4
+ export interface BlockCardNodeAttributes0 {
5
+ url?: string;
6
+ datasource: Record<string, unknown>;
7
+ width?: number;
8
+ layout?: 'wide' | 'full-width' | 'center' | 'wrap-right' | 'wrap-left' | 'align-end' | 'align-start';
9
+ }
10
+ export interface BlockCardNodeAttributes1 {
11
+ url: string;
12
+ }
13
+ export interface BlockCardNodeAttributes2 {
14
+ data: Record<string, unknown>;
15
+ }
4
16
  export interface BlockCardDefinition {
5
17
  type: 'blockCard';
6
18
  marks: Array<UnsupportedNodeAttributeMark | UnsupportedMarkMark>;
7
- attrs: {
8
- url?: string;
9
- datasource: Record<string, unknown>;
10
- width?: number;
11
- layout?: 'wide' | 'full-width' | 'center' | 'wrap-right' | 'wrap-left' | 'align-end' | 'align-start';
12
- };
19
+ attrs: BlockCardNodeAttributes0 | BlockCardNodeAttributes1 | BlockCardNodeAttributes2;
13
20
  }
14
21
  export type BlockCardNode = PMNode & BlockCardDefinition;
15
22
  export declare const blockCard: ({ parseDOM, toDOM }: import("@atlaskit/adf-schema-generator").NodeSpecOptions<BlockCardNode>) => import("prosemirror-model").NodeSpec;
@@ -36,38 +43,51 @@ export interface CodeBlockWithNoMarksDefinition {
36
43
  }
37
44
  export type CodeBlockWithNoMarksNode = PMNode & CodeBlockWithNoMarksDefinition;
38
45
  export declare const codeBlockWithNoMarks: ({ parseDOM, toDOM }: import("@atlaskit/adf-schema-generator").NodeSpecOptions<CodeBlockWithNoMarksNode>) => import("prosemirror-model").NodeSpec;
46
+ export interface MediaNodeAttributes0 {
47
+ type: 'link' | 'file';
48
+ id: string;
49
+ alt?: string;
50
+ collection: string;
51
+ height?: number;
52
+ occurrenceKey?: string;
53
+ width?: number;
54
+ __contextId?: string;
55
+ __displayType?: string;
56
+ __external?: boolean;
57
+ __fileMimeType?: string;
58
+ __fileName?: string;
59
+ __fileSize?: string;
60
+ __mediaTraceId?: string;
61
+ }
62
+ export interface MediaNodeAttributes1 {
63
+ type: 'external';
64
+ alt?: string;
65
+ height?: number;
66
+ width?: number;
67
+ url: string;
68
+ }
39
69
  export interface MediaDefinition {
40
70
  type: 'media';
41
71
  marks: Array<LinkMark | AnnotationMark | BorderMark | UnsupportedNodeAttributeMark | UnsupportedMarkMark>;
42
- attrs: {
43
- type: 'external' | 'file';
44
- id: string;
45
- alt?: string;
46
- collection: string;
47
- height?: number;
48
- occurrenceKey?: string;
49
- width?: number;
50
- __contextId?: string;
51
- __displayType?: string;
52
- __external?: boolean;
53
- __fileMimeType?: string;
54
- __fileName?: string;
55
- __fileSize?: string;
56
- __mediaTraceId?: string;
57
- url: string;
58
- };
72
+ attrs: MediaNodeAttributes0 | MediaNodeAttributes1;
59
73
  }
60
74
  export type MediaNode = PMNode & MediaDefinition;
61
75
  export declare const media: ({ parseDOM, toDOM }: import("@atlaskit/adf-schema-generator").NodeSpecOptions<MediaNode>) => import("prosemirror-model").NodeSpec;
76
+ export interface MediaSingleNodeAttributes0 {
77
+ width?: number;
78
+ layout: 'wide' | 'full-width' | 'center' | 'wrap-right' | 'wrap-left' | 'align-end' | 'align-start';
79
+ widthType?: 'percentage';
80
+ }
81
+ export interface MediaSingleNodeAttributes1 {
82
+ width: number;
83
+ widthType: 'pixel';
84
+ layout: 'wide' | 'full-width' | 'center' | 'wrap-right' | 'wrap-left' | 'align-end' | 'align-start';
85
+ }
62
86
  export interface MediaSingleDefinition {
63
87
  type: 'mediaSingle';
64
88
  content: Array<MediaDefinition>;
65
89
  marks: Array<LinkMark | UnsupportedNodeAttributeMark | UnsupportedMarkMark>;
66
- attrs: {
67
- width?: number;
68
- layout: 'wide' | 'full-width' | 'center' | 'wrap-right' | 'wrap-left' | 'align-end' | 'align-start';
69
- widthType?: 'pixel';
70
- };
90
+ attrs: MediaSingleNodeAttributes0 | MediaSingleNodeAttributes1;
71
91
  }
72
92
  export type MediaSingleNode = PMNode & MediaSingleDefinition;
73
93
  export declare const mediaSingle: ({ parseDOM, toDOM }: import("@atlaskit/adf-schema-generator").NodeSpecOptions<MediaSingleNode>) => import("prosemirror-model").NodeSpec;
@@ -130,12 +150,16 @@ export interface PlaceholderDefinition {
130
150
  }
131
151
  export type PlaceholderNode = PMNode & PlaceholderDefinition;
132
152
  export declare const placeholder: ({ parseDOM, toDOM }: import("@atlaskit/adf-schema-generator").NodeSpecOptions<PlaceholderNode>) => import("prosemirror-model").NodeSpec;
153
+ export interface InlineCardNodeAttributes0 {
154
+ url: string;
155
+ }
156
+ export interface InlineCardNodeAttributes1 {
157
+ data: Record<string, unknown>;
158
+ }
133
159
  export interface InlineCardDefinition {
134
160
  type: 'inlineCard';
135
161
  marks: Array<UnsupportedNodeAttributeMark | UnsupportedMarkMark>;
136
- attrs: {
137
- url: string;
138
- };
162
+ attrs: InlineCardNodeAttributes0 | InlineCardNodeAttributes1;
139
163
  }
140
164
  export type InlineCardNode = PMNode & InlineCardDefinition;
141
165
  export declare const inlineCard: ({ parseDOM, toDOM }: import("@atlaskit/adf-schema-generator").NodeSpecOptions<InlineCardNode>) => import("prosemirror-model").NodeSpec;
@@ -170,27 +194,39 @@ export interface CaptionDefinition {
170
194
  }
171
195
  export type CaptionNode = PMNode & CaptionDefinition;
172
196
  export declare const caption: ({ parseDOM, toDOM }: import("@atlaskit/adf-schema-generator").NodeSpecOptions<CaptionNode>) => import("prosemirror-model").NodeSpec;
197
+ export interface MediaSingleCaptionNodeAttributes0 {
198
+ width?: number;
199
+ layout: 'wide' | 'full-width' | 'center' | 'wrap-right' | 'wrap-left' | 'align-end' | 'align-start';
200
+ widthType?: 'percentage';
201
+ }
202
+ export interface MediaSingleCaptionNodeAttributes1 {
203
+ width: number;
204
+ widthType: 'pixel';
205
+ layout: 'wide' | 'full-width' | 'center' | 'wrap-right' | 'wrap-left' | 'align-end' | 'align-start';
206
+ }
173
207
  export interface MediaSingleCaptionDefinition {
174
208
  type: 'mediaSingle';
175
209
  content: Array<MediaDefinition | UnsupportedBlockDefinition | CaptionDefinition | UnsupportedBlockDefinition>;
176
210
  marks: Array<LinkMark | UnsupportedNodeAttributeMark | UnsupportedMarkMark>;
177
- attrs: {
178
- width?: number;
179
- layout: 'wide' | 'full-width' | 'center' | 'wrap-right' | 'wrap-left' | 'align-end' | 'align-start';
180
- widthType?: 'pixel';
181
- };
211
+ attrs: MediaSingleCaptionNodeAttributes0 | MediaSingleCaptionNodeAttributes1;
182
212
  }
183
213
  export type MediaSingleCaptionNode = PMNode & MediaSingleCaptionDefinition;
184
214
  export declare const mediaSingleCaption: ({ parseDOM, toDOM }: import("@atlaskit/adf-schema-generator").NodeSpecOptions<MediaSingleCaptionNode>) => import("prosemirror-model").NodeSpec;
215
+ export interface MediaSingleFullNodeAttributes0 {
216
+ width?: number;
217
+ layout: 'wide' | 'full-width' | 'center' | 'wrap-right' | 'wrap-left' | 'align-end' | 'align-start';
218
+ widthType?: 'percentage';
219
+ }
220
+ export interface MediaSingleFullNodeAttributes1 {
221
+ width: number;
222
+ widthType: 'pixel';
223
+ layout: 'wide' | 'full-width' | 'center' | 'wrap-right' | 'wrap-left' | 'align-end' | 'align-start';
224
+ }
185
225
  export interface MediaSingleFullDefinition {
186
226
  type: 'mediaSingle';
187
227
  content: Array<MediaDefinition>;
188
228
  marks: Array<LinkMark | UnsupportedNodeAttributeMark | UnsupportedMarkMark>;
189
- attrs: {
190
- width?: number;
191
- layout: 'wide' | 'full-width' | 'center' | 'wrap-right' | 'wrap-left' | 'align-end' | 'align-start';
192
- widthType?: 'pixel';
193
- };
229
+ attrs: MediaSingleFullNodeAttributes0 | MediaSingleFullNodeAttributes1;
194
230
  }
195
231
  export type MediaSingleFullNode = PMNode & MediaSingleFullDefinition;
196
232
  export declare const mediaSingleFull: ({ parseDOM, toDOM }: import("@atlaskit/adf-schema-generator").NodeSpecOptions<MediaSingleFullNode>) => import("prosemirror-model").NodeSpec;
@@ -200,6 +236,7 @@ export interface InlineExtensionWithMarksDefinition {
200
236
  attrs: {
201
237
  extensionKey: string;
202
238
  extensionType: string;
239
+ parameters?: Record<string, unknown>;
203
240
  text?: string;
204
241
  localId?: string;
205
242
  };
@@ -210,6 +247,7 @@ export interface MediaInlineDefinition {
210
247
  type: 'mediaInline';
211
248
  marks: Array<LinkMark | AnnotationMark | BorderMark | UnsupportedNodeAttributeMark | UnsupportedMarkMark>;
212
249
  attrs: {
250
+ data?: Record<string, unknown>;
213
251
  type?: 'link' | 'file' | 'image';
214
252
  url: string;
215
253
  id: string;
@@ -357,6 +395,7 @@ export interface ExtensionWithMarksDefinition {
357
395
  attrs: {
358
396
  extensionKey: string;
359
397
  extensionType: string;
398
+ parameters?: Record<string, unknown>;
360
399
  text?: string;
361
400
  layout?: 'wide' | 'full-width' | 'default';
362
401
  localId?: string;
@@ -503,6 +542,7 @@ export interface BodiedExtensionWithMarksDefinition {
503
542
  attrs: {
504
543
  extensionKey: string;
505
544
  extensionType: string;
545
+ parameters?: Record<string, unknown>;
506
546
  text?: string;
507
547
  layout?: 'wide' | 'full-width' | 'default';
508
548
  localId?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-schema",
3
- "version": "36.15.0",
3
+ "version": "36.16.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/"
@@ -44,7 +44,7 @@
44
44
  },
45
45
  "devDependencies": {
46
46
  "@atlassian/adf-schema-json": "^1.15.0",
47
- "@atlaskit/adf-schema-generator": "^1.14.0",
47
+ "@atlaskit/adf-schema-generator": "^1.15.0",
48
48
  "@atlaskit/codemod-utils": "^4.2.4",
49
49
  "@atlaskit/json-schema-generator": "^3.3.9",
50
50
  "@babel/cli": "^7.22.9",
@@ -144,7 +144,9 @@ const jsonWithTypes = {
144
144
  {
145
145
  additionalProperties: false,
146
146
  properties: {
147
- data: {},
147
+ data: {
148
+ type: 'object',
149
+ },
148
150
  },
149
151
  required: ['data'],
150
152
  type: 'object',
@@ -646,7 +648,9 @@ const jsonWithTypes = {
646
648
  {
647
649
  additionalProperties: false,
648
650
  properties: {
649
- data: {},
651
+ data: {
652
+ type: 'object',
653
+ },
650
654
  },
651
655
  required: ['data'],
652
656
  type: 'object',
@@ -831,7 +835,9 @@ const jsonWithTypes = {
831
835
  collection: {
832
836
  type: 'string',
833
837
  },
834
- data: {},
838
+ data: {
839
+ type: 'object',
840
+ },
835
841
  height: {
836
842
  type: 'number',
837
843
  },