@atlaskit/adf-schema 36.18.2 → 37.0.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 (73) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/index.js +0 -24
  3. package/dist/cjs/next-schema/generated/markTypes.js +27 -16
  4. package/dist/cjs/next-schema/generated/nodeTypes.js +36 -4
  5. package/dist/cjs/next-schema/groups/searchQueryMarkGroup.js +2 -1
  6. package/dist/cjs/next-schema/marks/annotation.js +1 -0
  7. package/dist/cjs/next-schema/marks/confluenceInlineComment.js +18 -0
  8. package/dist/cjs/next-schema/marks/fragment.js +2 -0
  9. package/dist/cjs/next-schema/marks/typeAheadQuery.js +17 -0
  10. package/dist/cjs/next-schema/marks/unsupportedMark.js +3 -2
  11. package/dist/cjs/next-schema/marks/unsupportedNodeAttribute.js +4 -6
  12. package/dist/cjs/next-schema/nodes/heading.js +5 -0
  13. package/dist/cjs/next-schema/nodes/paragraph.js +7 -0
  14. package/dist/cjs/next-schema/nodes/text.js +3 -1
  15. package/dist/cjs/schema/create-schema.js +2 -2
  16. package/dist/cjs/schema/default-schema.js +1 -3
  17. package/dist/cjs/schema/index.js +0 -24
  18. package/dist/cjs/schema/nodes/heading.js +2 -51
  19. package/dist/cjs/schema/nodes/index.js +0 -24
  20. package/dist/cjs/schema/nodes/paragraph.js +2 -18
  21. package/dist/es2019/index.js +1 -1
  22. package/dist/es2019/next-schema/generated/markTypes.js +26 -15
  23. package/dist/es2019/next-schema/generated/nodeTypes.js +36 -4
  24. package/dist/es2019/next-schema/groups/searchQueryMarkGroup.js +2 -1
  25. package/dist/es2019/next-schema/marks/annotation.js +2 -1
  26. package/dist/es2019/next-schema/marks/confluenceInlineComment.js +12 -0
  27. package/dist/es2019/next-schema/marks/fragment.js +3 -1
  28. package/dist/es2019/next-schema/marks/typeAheadQuery.js +11 -0
  29. package/dist/es2019/next-schema/marks/unsupportedMark.js +4 -3
  30. package/dist/es2019/next-schema/marks/unsupportedNodeAttribute.js +4 -6
  31. package/dist/es2019/next-schema/nodes/heading.js +5 -0
  32. package/dist/es2019/next-schema/nodes/paragraph.js +7 -0
  33. package/dist/es2019/next-schema/nodes/text.js +3 -1
  34. package/dist/es2019/schema/create-schema.js +3 -3
  35. package/dist/es2019/schema/default-schema.js +2 -4
  36. package/dist/es2019/schema/index.js +1 -1
  37. package/dist/es2019/schema/nodes/heading.js +2 -48
  38. package/dist/es2019/schema/nodes/index.js +2 -2
  39. package/dist/es2019/schema/nodes/paragraph.js +2 -15
  40. package/dist/esm/index.js +1 -1
  41. package/dist/esm/next-schema/generated/markTypes.js +26 -15
  42. package/dist/esm/next-schema/generated/nodeTypes.js +36 -4
  43. package/dist/esm/next-schema/groups/searchQueryMarkGroup.js +2 -1
  44. package/dist/esm/next-schema/marks/annotation.js +2 -1
  45. package/dist/esm/next-schema/marks/confluenceInlineComment.js +12 -0
  46. package/dist/esm/next-schema/marks/fragment.js +3 -1
  47. package/dist/esm/next-schema/marks/typeAheadQuery.js +11 -0
  48. package/dist/esm/next-schema/marks/unsupportedMark.js +4 -3
  49. package/dist/esm/next-schema/marks/unsupportedNodeAttribute.js +4 -6
  50. package/dist/esm/next-schema/nodes/heading.js +5 -0
  51. package/dist/esm/next-schema/nodes/paragraph.js +7 -0
  52. package/dist/esm/next-schema/nodes/text.js +3 -1
  53. package/dist/esm/schema/create-schema.js +3 -3
  54. package/dist/esm/schema/default-schema.js +2 -4
  55. package/dist/esm/schema/index.js +1 -1
  56. package/dist/esm/schema/nodes/heading.js +1 -50
  57. package/dist/esm/schema/nodes/index.js +2 -2
  58. package/dist/esm/schema/nodes/paragraph.js +1 -17
  59. package/dist/json-schema/v1/full.json +12 -0
  60. package/dist/types/index.d.ts +1 -1
  61. package/dist/types/next-schema/generated/markTypes.d.ts +23 -1
  62. package/dist/types/next-schema/generated/nodeTypes.d.ts +18 -2
  63. package/dist/types/next-schema/marks/confluenceInlineComment.d.ts +1 -0
  64. package/dist/types/next-schema/marks/typeAheadQuery.d.ts +1 -0
  65. package/dist/types/schema/index.d.ts +1 -1
  66. package/dist/types/schema/nodes/heading.d.ts +1 -3
  67. package/dist/types/schema/nodes/index.d.ts +2 -2
  68. package/dist/types/schema/nodes/paragraph.d.ts +1 -6
  69. package/json-schema/v1/full.json +12 -0
  70. package/package.json +3 -3
  71. package/schema-generators/__tests__/unit/adfToValidatorSpec.unit.ts +7 -1
  72. package/schema-generators/__tests__/unit/json-full-schema.unit.ts +12 -0
  73. package/schema-generators/__tests__/unit/validate-pm-schema.unit.ts +3 -25
@@ -7,28 +7,19 @@
7
7
  import { createPMMarkSpecFactory } from '@atlaskit/adf-schema-generator';
8
8
  export const unsupportedNodeAttribute = createPMMarkSpecFactory({
9
9
  attrs: {
10
- type: {
11
- default: null
12
- },
13
- unsupported: {
14
- default: {}
15
- }
10
+ unsupported: {},
11
+ type: {}
16
12
  }
17
13
  });
18
14
  export const unsupportedMark = createPMMarkSpecFactory({
19
15
  attrs: {
20
- originalValue: {
21
- default: {}
22
- }
23
- }
16
+ originalValue: {}
17
+ },
18
+ excludes: ''
24
19
  });
25
20
  export const link = createPMMarkSpecFactory({
26
21
  attrs: {
27
22
  href: {},
28
- title: {},
29
- id: {},
30
- collection: {},
31
- occurrenceKey: {},
32
23
  __confluenceMetadata: {
33
24
  default: null
34
25
  }
@@ -79,6 +70,7 @@ export const annotation = createPMMarkSpecFactory({
79
70
  }
80
71
  },
81
72
  inclusive: true,
73
+ excludes: '',
82
74
  group: 'annotation'
83
75
  });
84
76
  export const backgroundColor = createPMMarkSpecFactory({
@@ -89,6 +81,24 @@ export const backgroundColor = createPMMarkSpecFactory({
89
81
  excludes: 'color',
90
82
  group: 'color'
91
83
  });
84
+ export const typeAheadQuery = createPMMarkSpecFactory({
85
+ attrs: {
86
+ trigger: {
87
+ default: ''
88
+ }
89
+ },
90
+ inclusive: true,
91
+ group: 'searchQuery'
92
+ });
93
+ export const confluenceInlineComment = createPMMarkSpecFactory({
94
+ attrs: {
95
+ reference: {
96
+ default: ''
97
+ }
98
+ },
99
+ inclusive: false,
100
+ excludes: ''
101
+ });
92
102
  export const code = createPMMarkSpecFactory({
93
103
  inclusive: true,
94
104
  excludes: 'fontStyle link searchQuery color'
@@ -109,7 +119,8 @@ export const fragment = createPMMarkSpecFactory({
109
119
  default: null
110
120
  }
111
121
  },
112
- inclusive: false
122
+ inclusive: false,
123
+ excludes: ''
113
124
  });
114
125
  export const border = createPMMarkSpecFactory({
115
126
  attrs: {
@@ -282,7 +282,12 @@ export const confluenceUnsupportedInline = createPMNodeSpecFactory({
282
282
  });
283
283
  export const paragraphWithNoMarks = createPMNodeSpecFactory({
284
284
  content: 'inline*',
285
- marks: 'link em strong strike subsup underline textColor annotation backgroundColor unsupportedNodeAttribute unsupportedMark code dataConsumer fragment border',
285
+ marks: 'link em strong strike subsup underline textColor annotation backgroundColor typeAheadQuery confluenceInlineComment unsupportedNodeAttribute unsupportedMark code dataConsumer fragment border',
286
+ attrs: {
287
+ localId: {
288
+ default: null
289
+ }
290
+ },
286
291
  selectable: false
287
292
  });
288
293
  export const media = createPMNodeSpecFactory({
@@ -442,6 +447,9 @@ export const headingWithNoMarks = createPMNodeSpecFactory({
442
447
  attrs: {
443
448
  level: {
444
449
  default: 1
450
+ },
451
+ localId: {
452
+ default: null
445
453
  }
446
454
  },
447
455
  selectable: false,
@@ -507,14 +515,24 @@ export const panel = createPMNodeSpecFactory({
507
515
  });
508
516
  export const paragraph = createPMNodeSpecFactory({
509
517
  content: 'inline*',
510
- marks: 'link em strong strike subsup underline textColor annotation backgroundColor unsupportedNodeAttribute unsupportedMark code dataConsumer fragment border',
518
+ marks: 'link em strong strike subsup underline textColor annotation backgroundColor typeAheadQuery confluenceInlineComment unsupportedNodeAttribute unsupportedMark code dataConsumer fragment border',
511
519
  group: 'block',
520
+ attrs: {
521
+ localId: {
522
+ default: null
523
+ }
524
+ },
512
525
  selectable: false
513
526
  });
514
527
  export const paragraphWithMarks = createPMNodeSpecFactory({
515
528
  content: 'inline*',
516
- marks: 'link em strong strike subsup underline textColor annotation backgroundColor unsupportedNodeAttribute unsupportedMark code dataConsumer fragment border',
529
+ marks: 'link em strong strike subsup underline textColor annotation backgroundColor typeAheadQuery confluenceInlineComment unsupportedNodeAttribute unsupportedMark code dataConsumer fragment border',
517
530
  group: 'block',
531
+ attrs: {
532
+ localId: {
533
+ default: null
534
+ }
535
+ },
518
536
  selectable: false
519
537
  });
520
538
  export const blockquoteWithList = createPMNodeSpecFactory({
@@ -529,6 +547,9 @@ export const headingWithAlignment = createPMNodeSpecFactory({
529
547
  attrs: {
530
548
  level: {
531
549
  default: 1
550
+ },
551
+ localId: {
552
+ default: null
532
553
  }
533
554
  },
534
555
  selectable: false,
@@ -540,6 +561,9 @@ export const headingWithIndentation = createPMNodeSpecFactory({
540
561
  attrs: {
541
562
  level: {
542
563
  default: 1
564
+ },
565
+ localId: {
566
+ default: null
543
567
  }
544
568
  },
545
569
  selectable: false,
@@ -547,7 +571,12 @@ export const headingWithIndentation = createPMNodeSpecFactory({
547
571
  });
548
572
  export const paragraphWithAlignment = createPMNodeSpecFactory({
549
573
  content: 'inline*',
550
- marks: 'link em strong strike subsup underline textColor annotation backgroundColor unsupportedNodeAttribute unsupportedMark code dataConsumer fragment border',
574
+ marks: 'link em strong strike subsup underline textColor annotation backgroundColor typeAheadQuery confluenceInlineComment unsupportedNodeAttribute unsupportedMark code dataConsumer fragment border',
575
+ attrs: {
576
+ localId: {
577
+ default: null
578
+ }
579
+ },
551
580
  selectable: false
552
581
  });
553
582
  export const blockquote = createPMNodeSpecFactory({
@@ -788,6 +817,9 @@ export const heading = createPMNodeSpecFactory({
788
817
  attrs: {
789
818
  level: {
790
819
  default: 1
820
+ },
821
+ localId: {
822
+ default: null
791
823
  }
792
824
  },
793
825
  selectable: false,
@@ -1,2 +1,3 @@
1
1
  import { adfMarkGroup } from '@atlaskit/adf-schema-generator';
2
- export const searchQueryMarkGroup = adfMarkGroup('searchQuery');
2
+ import { typeAheadQuery } from '../marks/typeAheadQuery';
3
+ export const searchQueryMarkGroup = adfMarkGroup('searchQuery', [typeAheadQuery]);
@@ -1,8 +1,9 @@
1
- import { adfMark, adfMarkGroup } from '@atlaskit/adf-schema-generator';
1
+ import { MarkExcludesNone, adfMark, adfMarkGroup } from '@atlaskit/adf-schema-generator';
2
2
  export const annotation = adfMark('annotation');
3
3
  export const annotationGroup = adfMarkGroup('annotation', [annotation]);
4
4
  annotation.define({
5
5
  inclusive: true,
6
+ excludes: MarkExcludesNone,
6
7
  group: annotationGroup,
7
8
  attrs: {
8
9
  id: {
@@ -0,0 +1,12 @@
1
+ import { ValidatorSpecTransformerName, JSONSchemaTransformerName, adfMark, MarkExcludesNone } from '@atlaskit/adf-schema-generator';
2
+ export const confluenceInlineComment = adfMark('confluenceInlineComment').define({
3
+ ignore: [JSONSchemaTransformerName, ValidatorSpecTransformerName],
4
+ inclusive: false,
5
+ excludes: MarkExcludesNone,
6
+ attrs: {
7
+ reference: {
8
+ type: 'string',
9
+ default: ''
10
+ }
11
+ }
12
+ });
@@ -1,6 +1,8 @@
1
- import { adfMark } from '@atlaskit/adf-schema-generator';
1
+ import { MarkExcludesNone, adfMark } from '@atlaskit/adf-schema-generator';
2
2
  export const fragment = adfMark('fragment').define({
3
3
  inclusive: false,
4
+ excludes: MarkExcludesNone,
5
+ allowExcludesEmpty: true,
4
6
  attrs: {
5
7
  localId: {
6
8
  minLength: 1,
@@ -0,0 +1,11 @@
1
+ import { ValidatorSpecTransformerName, JSONSchemaTransformerName, adfMark } from '@atlaskit/adf-schema-generator';
2
+ export const typeAheadQuery = adfMark('typeAheadQuery').define({
3
+ ignore: [JSONSchemaTransformerName, ValidatorSpecTransformerName],
4
+ inclusive: true,
5
+ attrs: {
6
+ trigger: {
7
+ type: 'string',
8
+ default: ''
9
+ }
10
+ }
11
+ });
@@ -1,10 +1,11 @@
1
- import { adfMark, JSONSchemaTransformerName, ValidatorSpecTransformerName } from '@atlaskit/adf-schema-generator';
1
+ import { adfMark, JSONSchemaTransformerName, MarkExcludesNone, ValidatorSpecTransformerName } from '@atlaskit/adf-schema-generator';
2
2
  export const unsupportedMark = adfMark('unsupportedMark').define({
3
3
  ignore: [JSONSchemaTransformerName, ValidatorSpecTransformerName],
4
+ excludes: MarkExcludesNone,
5
+ allowExcludesEmpty: true,
4
6
  attrs: {
5
7
  originalValue: {
6
- type: 'object',
7
- default: {}
8
+ type: 'object'
8
9
  }
9
10
  }
10
11
  });
@@ -2,13 +2,11 @@ import { adfMark, JSONSchemaTransformerName, ValidatorSpecTransformerName } from
2
2
  export const unsupportedNodeAttribute = adfMark('unsupportedNodeAttribute').define({
3
3
  ignore: [JSONSchemaTransformerName, ValidatorSpecTransformerName],
4
4
  attrs: {
5
- type: {
6
- type: 'string',
7
- default: null
8
- },
9
5
  unsupported: {
10
- type: 'object',
11
- default: {}
6
+ type: 'object'
7
+ },
8
+ type: {
9
+ type: 'string'
12
10
  }
13
11
  }
14
12
  });
@@ -13,6 +13,11 @@ export const heading = adfNode('heading').define({
13
13
  default: 1,
14
14
  minimum: 1,
15
15
  maximum: 6
16
+ },
17
+ localId: {
18
+ type: 'string',
19
+ optional: true,
20
+ default: null
16
21
  }
17
22
  },
18
23
  content: [$zeroPlus($or(inlineGroup))]
@@ -4,6 +4,13 @@ import { alignment, indentation } from '../marks/alignmentAndIndentation';
4
4
  import { unsupportedMark } from '../marks/unsupportedMark';
5
5
  import { unsupportedNodeAttribute } from '../marks/unsupportedNodeAttribute';
6
6
  export const paragraph = adfNode('paragraph').define({
7
+ attrs: {
8
+ localId: {
9
+ type: 'string',
10
+ optional: true,
11
+ default: null
12
+ }
13
+ },
7
14
  selectable: false,
8
15
  marks: [unsupportedNodeAttribute, unsupportedMark],
9
16
  content: [$zeroPlus($or(inlineGroup))]
@@ -10,8 +10,10 @@ import { underline } from '../marks/underline';
10
10
  import { backgroundColor, textColor } from '../marks/color';
11
11
  import { unsupportedNodeAttribute } from '../marks/unsupportedNodeAttribute';
12
12
  import { unsupportedMark } from '../marks/unsupportedMark';
13
+ import { typeAheadQuery } from '../marks/typeAheadQuery';
14
+ import { confluenceInlineComment } from '../marks/confluenceInlineComment';
13
15
  export const text = adfNode('text').define({}).variant('formatted', {
14
- marks: [link, em, strong, strike, subsup, underline, textColor, annotation, backgroundColor, unsupportedNodeAttribute, unsupportedMark]
16
+ marks: [link, em, strong, strike, subsup, underline, textColor, annotation, backgroundColor, typeAheadQuery, confluenceInlineComment, unsupportedNodeAttribute, unsupportedMark]
15
17
  }).variant('code_inline', {
16
18
  marks: [code, link, annotation, unsupportedNodeAttribute, unsupportedMark]
17
19
  });
@@ -1,7 +1,7 @@
1
1
  import { Schema } from '@atlaskit/editor-prosemirror/model';
2
2
  import { COLOR, FONT_STYLE, SEARCH_QUERY, LINK } from './groups';
3
3
  import { link, em, strong, textColor, strike, subsup, underline, code, typeAheadQuery, confluenceInlineComment, breakout, alignment, indentation, annotation, unsupportedMark, unsupportedNodeAttribute, dataConsumer, fragment, border, backgroundColor } from './marks';
4
- import { confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, doc, paragraphNodeSpec, text, bulletList, orderedListWithOrder, listItemWithTask, headingNodeSpec, blockquoteWithList, codeBlock, extendedPanel, rule, image, mention, media, mediaInline, mediaSingleFull, mediaGroup, hardBreak, emoji, table, tableCell, tableHeader, tableRow, decisionList, decisionItem, taskList, taskItem, unknownBlock, extension, inlineExtension, bodiedExtension, multiBodiedExtension, extensionFrame, date, placeholder, layoutSection, layoutColumn, inlineCard, blockCard, unsupportedBlock, unsupportedInline, status, expand, nestedExpand, embedCard, caption } from './nodes';
4
+ import { confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, doc, paragraph, text, bulletList, orderedListWithOrder, listItemWithTask, heading, blockquoteWithList, codeBlock, extendedPanel, rule, image, mention, media, mediaInline, mediaSingleFull, mediaGroup, hardBreak, emoji, table, tableCell, tableHeader, tableRow, decisionList, decisionItem, taskList, taskItem, unknownBlock, extension, inlineExtension, bodiedExtension, multiBodiedExtension, extensionFrame, date, placeholder, layoutSection, layoutColumn, inlineCard, blockCard, unsupportedBlock, unsupportedInline, status, expand, nestedExpand, embedCard, caption } from './nodes';
5
5
  function addItems(builtInItems, config, customSpecs = {}) {
6
6
  if (!config) {
7
7
  return {};
@@ -54,7 +54,7 @@ const nodesInOrder = [{
54
54
  spec: doc
55
55
  }, {
56
56
  name: 'paragraph',
57
- spec: paragraphNodeSpec()
57
+ spec: paragraph
58
58
  }, {
59
59
  name: 'text',
60
60
  spec: text
@@ -69,7 +69,7 @@ const nodesInOrder = [{
69
69
  spec: listItemWithTask
70
70
  }, {
71
71
  name: 'heading',
72
- spec: headingNodeSpec()
72
+ spec: heading
73
73
  }, {
74
74
  name: 'blockquote',
75
75
  spec: blockquoteWithList
@@ -1,5 +1,5 @@
1
1
  import memoizeOne from 'memoize-one';
2
- import { extensionFrame, headingNodeSpec, layoutSectionWithSingleColumn, multiBodiedExtension, paragraphNodeSpec } from './nodes';
2
+ import { extensionFrame, layoutSectionWithSingleColumn, multiBodiedExtension } from './nodes';
3
3
  import { createSchema } from './create-schema';
4
4
  const getDefaultSchemaConfig = () => {
5
5
  const defaultSchemaConfig = {
@@ -17,9 +17,7 @@ export const getSchemaBasedOnStage = memoizeOne((stage = 'final') => {
17
17
  defaultSchemaConfig.customNodeSpecs = {
18
18
  layoutSection: layoutSectionWithSingleColumn,
19
19
  multiBodiedExtension: multiBodiedExtension,
20
- extensionFrame: extensionFrame,
21
- heading: headingNodeSpec('stage0'),
22
- paragraph: paragraphNodeSpec('stage0')
20
+ extensionFrame: extensionFrame
23
21
  };
24
22
  }
25
23
  return createSchema(defaultSchemaConfig);
@@ -1,4 +1,4 @@
1
- export { PanelType, blockCard, blockquote, blockquoteWithList, bodiedExtension, bulletList, bulletListSelector, caption, codeBlock, codeBlockToJSON, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, date, decisionItem, decisionList, decisionListSelector, doc, embedCard, emoji, expand, expandToJSON, extension, hardBreak, heading, headingNodeSpec, headingStage0, image, inlineCard, inlineExtension, layoutColumn, layoutSection, layoutSectionWithSingleColumn, listItem, listItemWithTask, media, mediaGroup, mediaSingle, mediaSingleSpec, mediaInline, mediaSingleWithCaption, mediaSingleWithWidthType, mediaSingleFull, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, orderedListWithOrder, panel, extendedPanel, paragraph, paragraphStage0, paragraphNodeSpec, placeholder, rule, getCellAttrs, getCellDomAttrs, status, table, tableStage0, tableWithCustomWidth, tableBackgroundBorderColor, tableBackgroundColorNames, tableBackgroundColorPalette, tableCell, tableCellContentDomSelector, tableCellContentWrapperSelector, tableCellSelector, tableHeader, tableHeaderSelector, tablePrefixSelector, tableRow, tableToJSON, taskItem, taskList, taskListSelector, text, toJSONTableCell, toJSONTableHeader, unknownBlock, unsupportedBlock, unsupportedInline, extensionFrame, multiBodiedExtension } from './nodes';
1
+ export { PanelType, blockCard, blockquote, blockquoteWithList, bodiedExtension, bulletList, bulletListSelector, caption, codeBlock, codeBlockToJSON, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, date, decisionItem, decisionList, decisionListSelector, doc, embedCard, emoji, expand, expandToJSON, extension, hardBreak, heading, image, inlineCard, inlineExtension, layoutColumn, layoutSection, layoutSectionWithSingleColumn, listItem, listItemWithTask, media, mediaGroup, mediaSingle, mediaSingleSpec, mediaInline, mediaSingleWithCaption, mediaSingleWithWidthType, mediaSingleFull, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, orderedListWithOrder, panel, extendedPanel, paragraph, placeholder, rule, getCellAttrs, getCellDomAttrs, status, table, tableStage0, tableWithCustomWidth, tableBackgroundBorderColor, tableBackgroundColorNames, tableBackgroundColorPalette, tableCell, tableCellContentDomSelector, tableCellContentWrapperSelector, tableCellSelector, tableHeader, tableHeaderSelector, tablePrefixSelector, tableRow, tableToJSON, taskItem, taskList, taskListSelector, text, toJSONTableCell, toJSONTableHeader, unknownBlock, unsupportedBlock, unsupportedInline, extensionFrame, multiBodiedExtension } from './nodes';
2
2
  export { AnnotationTypes, alignment, alignmentPositionMap, annotation, breakout, code, colorPalette, /** @deprecated [ED-15849] The extended palette is now rolled into the main one. Use `colorPalette` instead. */
3
3
  colorPaletteExtended, confluenceInlineComment, dataConsumer, dataConsumerToJSON, em, fragment, fragmentToJSON, indentation, link, linkToJSON, strike, strong, subsup, textColor, typeAheadQuery, underline, buildAnnotationMarkDataAttributes, AnnotationMarkStates, unsupportedMark, unsupportedNodeAttribute, border, borderColorPalette, backgroundColor, backgroundColorPalette } from './marks';
4
4
  export { unsupportedNodeTypesForMediaCards } from './unsupported';
@@ -22,7 +22,7 @@ const getAttrs = level => domNode => {
22
22
  localId: domNode.getAttribute('data-local-id') || ((_heading$attrs = heading.attrs) === null || _heading$attrs === void 0 ? void 0 : (_heading$attrs$localI = _heading$attrs.localId) === null || _heading$attrs$localI === void 0 ? void 0 : _heading$attrs$localI.default)
23
23
  };
24
24
  };
25
- export const headingStage0 = {
25
+ export const heading = {
26
26
  attrs: {
27
27
  level: {
28
28
  default: 1
@@ -65,50 +65,4 @@ export const headingStage0 = {
65
65
  }] : [];
66
66
  return [name, ...attrs, 0];
67
67
  }
68
- };
69
- export const heading = {
70
- attrs: {
71
- level: {
72
- default: 1
73
- }
74
- },
75
- content: `inline*`,
76
- group: 'block',
77
- defining: true,
78
- selectable: false,
79
- parseDOM: [{
80
- tag: 'h1',
81
- attrs: {
82
- level: 1
83
- }
84
- }, {
85
- tag: 'h2',
86
- attrs: {
87
- level: 2
88
- }
89
- }, {
90
- tag: 'h3',
91
- attrs: {
92
- level: 3
93
- }
94
- }, {
95
- tag: 'h4',
96
- attrs: {
97
- level: 4
98
- }
99
- }, {
100
- tag: 'h5',
101
- attrs: {
102
- level: 5
103
- }
104
- }, {
105
- tag: 'h6',
106
- attrs: {
107
- level: 6
108
- }
109
- }],
110
- toDOM(node) {
111
- return ['h' + node.attrs['level'], 0];
112
- }
113
- };
114
- export const headingNodeSpec = (adfStage = 'full') => adfStage === 'stage0' ? headingStage0 : heading;
68
+ };
@@ -8,10 +8,10 @@ export { blockquoteWithList } from './blockquote';
8
8
  export { bulletList, bulletListSelector } from './bullet-list';
9
9
  export { codeBlock, toJSON as codeBlockToJSON } from './code-block';
10
10
  export { hardBreak } from './hard-break';
11
- export { headingNodeSpec, heading, headingStage0 } from './heading';
11
+ export { heading } from './heading';
12
12
  export { rule } from './rule';
13
13
  export { orderedList, orderedListSelector, orderedListWithOrder } from './ordered-list';
14
- export { paragraph, paragraphStage0, paragraphNodeSpec } from './paragraph';
14
+ export { paragraph } from './paragraph';
15
15
  export { emoji } from './emoji';
16
16
  export { image } from './image';
17
17
  export { mention, toJSON as mentionToJSON } from './mention';
@@ -23,7 +23,7 @@
23
23
  * @name paragraph_with_indentation_node
24
24
  */
25
25
 
26
- export const paragraphStage0 = {
26
+ export const paragraph = {
27
27
  selectable: false,
28
28
  content: 'inline*',
29
29
  group: 'block',
@@ -54,17 +54,4 @@ export const paragraphStage0 = {
54
54
  }] : [];
55
55
  return [name, ...attrs, 0];
56
56
  }
57
- };
58
- export const paragraph = {
59
- selectable: false,
60
- content: 'inline*',
61
- group: 'block',
62
- marks: 'strong code em link border strike subsup textColor backgroundColor typeAheadQuery underline confluenceInlineComment annotation unsupportedMark unsupportedNodeAttribute dataConsumer fragment',
63
- parseDOM: [{
64
- tag: 'p'
65
- }],
66
- toDOM() {
67
- return ['p', 0];
68
- }
69
- };
70
- export const paragraphNodeSpec = (adfStage = 'full') => adfStage === 'stage0' ? paragraphStage0 : paragraph;
57
+ };
package/dist/esm/index.js CHANGED
@@ -1,3 +1,3 @@
1
1
  export { PanelType, AnnotationTypes, alignment, alignmentPositionMap, annotation, blockCard, blockquote, blockquoteWithList, bodiedExtension, breakout, bulletList, bulletListSelector, caption, code, codeBlock, codeBlockToJSON, colorPalette, /** @deprecated [ED-15849] The extended palette is now rolled into the main one. Use `colorPalette` instead. */
2
- colorPaletteExtended, confluenceInlineComment, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, createSchema, dataConsumer, dataConsumerToJSON, date, decisionItem, decisionList, decisionListSelector, doc, em, embedCard, emoji, expand, expandToJSON, extension, fragment, fragmentToJSON, hardBreak, heading, headingNodeSpec, headingStage0, image, indentation, inlineCard, inlineExtension, inlineNodes, layoutColumn, layoutSection, link, linkToJSON, listItem, listItemWithTask, media, mediaGroup, mediaSingle, mediaSingleWithCaption, mediaSingleWithWidthType, mediaSingleFull, mediaSingleSpec, mediaInline, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, orderedListWithOrder, panel, extendedPanel, paragraph, paragraphStage0, paragraphNodeSpec, placeholder, rule, sanitizeNodes, getCellAttrs, getCellDomAttrs, status, strike, strong, subsup, table, tableStage0, tableWithCustomWidth, tableBackgroundBorderColor, tableBackgroundColorNames, tableBackgroundColorPalette, tableCell, tableCellContentDomSelector, tableCellContentWrapperSelector, tableCellSelector, tableHeader, tableHeaderSelector, tablePrefixSelector, tableRow, tableToJSON, taskItem, taskList, taskListSelector, text, textColor, toJSONTableCell, toJSONTableHeader, typeAheadQuery, underline, unknownBlock, unsupportedBlock, unsupportedInline, unsupportedNodeTypesForMediaCards, buildAnnotationMarkDataAttributes, AnnotationMarkStates, unsupportedMark, unsupportedNodeAttribute, border, borderColorPalette, extensionFrame, multiBodiedExtension, backgroundColor, backgroundColorPalette } from './schema';
2
+ colorPaletteExtended, confluenceInlineComment, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, createSchema, dataConsumer, dataConsumerToJSON, date, decisionItem, decisionList, decisionListSelector, doc, em, embedCard, emoji, expand, expandToJSON, extension, fragment, fragmentToJSON, hardBreak, heading, image, indentation, inlineCard, inlineExtension, inlineNodes, layoutColumn, layoutSection, link, linkToJSON, listItem, listItemWithTask, media, mediaGroup, mediaSingle, mediaSingleWithCaption, mediaSingleWithWidthType, mediaSingleFull, mediaSingleSpec, mediaInline, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, orderedListWithOrder, panel, extendedPanel, paragraph, placeholder, rule, sanitizeNodes, getCellAttrs, getCellDomAttrs, status, strike, strong, subsup, table, tableStage0, tableWithCustomWidth, tableBackgroundBorderColor, tableBackgroundColorNames, tableBackgroundColorPalette, tableCell, tableCellContentDomSelector, tableCellContentWrapperSelector, tableCellSelector, tableHeader, tableHeaderSelector, tablePrefixSelector, tableRow, tableToJSON, taskItem, taskList, taskListSelector, text, textColor, toJSONTableCell, toJSONTableHeader, typeAheadQuery, underline, unknownBlock, unsupportedBlock, unsupportedInline, unsupportedNodeTypesForMediaCards, buildAnnotationMarkDataAttributes, AnnotationMarkStates, unsupportedMark, unsupportedNodeAttribute, border, borderColorPalette, extensionFrame, multiBodiedExtension, backgroundColor, backgroundColorPalette } from './schema';
3
3
  export { B100, B400, B50, B500, B75, G200, G300, G400, G50, G500, G75, N0, N20, N200, N30, N300, N40, N50, N500, N60, N80, N800, N90, P100, P300, P400, P50, P500, P75, R100, R300, R400, R50, R500, R75, T100, T300, T50, T500, T75, Y200, Y400, Y50, Y500, Y75, acNameToEmoji, acShortcutToEmoji, emojiIdToAcName, generateUuid, getEmojiAcName, getLinkMatch, hexToRgb, hexToRgba, isHex, isRgb, isSafeUrl, linkify, linkifyMatch, normalizeHexColor, normalizeUrl, rgbToHex, uuid, getDarkModeLCHColor } from './utils';
@@ -7,28 +7,19 @@
7
7
  import { createPMMarkSpecFactory } from '@atlaskit/adf-schema-generator';
8
8
  export var unsupportedNodeAttribute = createPMMarkSpecFactory({
9
9
  attrs: {
10
- type: {
11
- default: null
12
- },
13
- unsupported: {
14
- default: {}
15
- }
10
+ unsupported: {},
11
+ type: {}
16
12
  }
17
13
  });
18
14
  export var unsupportedMark = createPMMarkSpecFactory({
19
15
  attrs: {
20
- originalValue: {
21
- default: {}
22
- }
23
- }
16
+ originalValue: {}
17
+ },
18
+ excludes: ''
24
19
  });
25
20
  export var link = createPMMarkSpecFactory({
26
21
  attrs: {
27
22
  href: {},
28
- title: {},
29
- id: {},
30
- collection: {},
31
- occurrenceKey: {},
32
23
  __confluenceMetadata: {
33
24
  default: null
34
25
  }
@@ -79,6 +70,7 @@ export var annotation = createPMMarkSpecFactory({
79
70
  }
80
71
  },
81
72
  inclusive: true,
73
+ excludes: '',
82
74
  group: 'annotation'
83
75
  });
84
76
  export var backgroundColor = createPMMarkSpecFactory({
@@ -89,6 +81,24 @@ export var backgroundColor = createPMMarkSpecFactory({
89
81
  excludes: 'color',
90
82
  group: 'color'
91
83
  });
84
+ export var typeAheadQuery = createPMMarkSpecFactory({
85
+ attrs: {
86
+ trigger: {
87
+ default: ''
88
+ }
89
+ },
90
+ inclusive: true,
91
+ group: 'searchQuery'
92
+ });
93
+ export var confluenceInlineComment = createPMMarkSpecFactory({
94
+ attrs: {
95
+ reference: {
96
+ default: ''
97
+ }
98
+ },
99
+ inclusive: false,
100
+ excludes: ''
101
+ });
92
102
  export var code = createPMMarkSpecFactory({
93
103
  inclusive: true,
94
104
  excludes: 'fontStyle link searchQuery color'
@@ -109,7 +119,8 @@ export var fragment = createPMMarkSpecFactory({
109
119
  default: null
110
120
  }
111
121
  },
112
- inclusive: false
122
+ inclusive: false,
123
+ excludes: ''
113
124
  });
114
125
  export var border = createPMMarkSpecFactory({
115
126
  attrs: {
@@ -282,7 +282,12 @@ export var confluenceUnsupportedInline = createPMNodeSpecFactory({
282
282
  });
283
283
  export var paragraphWithNoMarks = createPMNodeSpecFactory({
284
284
  content: 'inline*',
285
- marks: 'link em strong strike subsup underline textColor annotation backgroundColor unsupportedNodeAttribute unsupportedMark code dataConsumer fragment border',
285
+ marks: 'link em strong strike subsup underline textColor annotation backgroundColor typeAheadQuery confluenceInlineComment unsupportedNodeAttribute unsupportedMark code dataConsumer fragment border',
286
+ attrs: {
287
+ localId: {
288
+ default: null
289
+ }
290
+ },
286
291
  selectable: false
287
292
  });
288
293
  export var media = createPMNodeSpecFactory({
@@ -442,6 +447,9 @@ export var headingWithNoMarks = createPMNodeSpecFactory({
442
447
  attrs: {
443
448
  level: {
444
449
  default: 1
450
+ },
451
+ localId: {
452
+ default: null
445
453
  }
446
454
  },
447
455
  selectable: false,
@@ -507,14 +515,24 @@ export var panel = createPMNodeSpecFactory({
507
515
  });
508
516
  export var paragraph = createPMNodeSpecFactory({
509
517
  content: 'inline*',
510
- marks: 'link em strong strike subsup underline textColor annotation backgroundColor unsupportedNodeAttribute unsupportedMark code dataConsumer fragment border',
518
+ marks: 'link em strong strike subsup underline textColor annotation backgroundColor typeAheadQuery confluenceInlineComment unsupportedNodeAttribute unsupportedMark code dataConsumer fragment border',
511
519
  group: 'block',
520
+ attrs: {
521
+ localId: {
522
+ default: null
523
+ }
524
+ },
512
525
  selectable: false
513
526
  });
514
527
  export var paragraphWithMarks = createPMNodeSpecFactory({
515
528
  content: 'inline*',
516
- marks: 'link em strong strike subsup underline textColor annotation backgroundColor unsupportedNodeAttribute unsupportedMark code dataConsumer fragment border',
529
+ marks: 'link em strong strike subsup underline textColor annotation backgroundColor typeAheadQuery confluenceInlineComment unsupportedNodeAttribute unsupportedMark code dataConsumer fragment border',
517
530
  group: 'block',
531
+ attrs: {
532
+ localId: {
533
+ default: null
534
+ }
535
+ },
518
536
  selectable: false
519
537
  });
520
538
  export var blockquoteWithList = createPMNodeSpecFactory({
@@ -529,6 +547,9 @@ export var headingWithAlignment = createPMNodeSpecFactory({
529
547
  attrs: {
530
548
  level: {
531
549
  default: 1
550
+ },
551
+ localId: {
552
+ default: null
532
553
  }
533
554
  },
534
555
  selectable: false,
@@ -540,6 +561,9 @@ export var headingWithIndentation = createPMNodeSpecFactory({
540
561
  attrs: {
541
562
  level: {
542
563
  default: 1
564
+ },
565
+ localId: {
566
+ default: null
543
567
  }
544
568
  },
545
569
  selectable: false,
@@ -547,7 +571,12 @@ export var headingWithIndentation = createPMNodeSpecFactory({
547
571
  });
548
572
  export var paragraphWithAlignment = createPMNodeSpecFactory({
549
573
  content: 'inline*',
550
- marks: 'link em strong strike subsup underline textColor annotation backgroundColor unsupportedNodeAttribute unsupportedMark code dataConsumer fragment border',
574
+ marks: 'link em strong strike subsup underline textColor annotation backgroundColor typeAheadQuery confluenceInlineComment unsupportedNodeAttribute unsupportedMark code dataConsumer fragment border',
575
+ attrs: {
576
+ localId: {
577
+ default: null
578
+ }
579
+ },
551
580
  selectable: false
552
581
  });
553
582
  export var blockquote = createPMNodeSpecFactory({
@@ -788,6 +817,9 @@ export var heading = createPMNodeSpecFactory({
788
817
  attrs: {
789
818
  level: {
790
819
  default: 1
820
+ },
821
+ localId: {
822
+ default: null
791
823
  }
792
824
  },
793
825
  selectable: false,
@@ -1,2 +1,3 @@
1
1
  import { adfMarkGroup } from '@atlaskit/adf-schema-generator';
2
- export var searchQueryMarkGroup = adfMarkGroup('searchQuery');
2
+ import { typeAheadQuery } from '../marks/typeAheadQuery';
3
+ export var searchQueryMarkGroup = adfMarkGroup('searchQuery', [typeAheadQuery]);
@@ -1,8 +1,9 @@
1
- import { adfMark, adfMarkGroup } from '@atlaskit/adf-schema-generator';
1
+ import { MarkExcludesNone, adfMark, adfMarkGroup } from '@atlaskit/adf-schema-generator';
2
2
  export var annotation = adfMark('annotation');
3
3
  export var annotationGroup = adfMarkGroup('annotation', [annotation]);
4
4
  annotation.define({
5
5
  inclusive: true,
6
+ excludes: MarkExcludesNone,
6
7
  group: annotationGroup,
7
8
  attrs: {
8
9
  id: {