@atlaskit/adf-schema 51.2.0 → 51.3.1

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 (46) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/index.js +6 -0
  3. package/dist/cjs/next-schema/full-schema.adf.js +2 -1
  4. package/dist/cjs/next-schema/generated/nodeTypes.js +15 -2
  5. package/dist/cjs/next-schema/nodes/bodiedSyncBlock.js +46 -0
  6. package/dist/cjs/schema/create-schema.js +3 -0
  7. package/dist/cjs/schema/default-schema.js +2 -1
  8. package/dist/cjs/schema/index.js +6 -0
  9. package/dist/cjs/schema/nodes/bodied-sync-block.js +39 -0
  10. package/dist/cjs/schema/nodes/index.js +8 -1
  11. package/dist/cjs/schema/nodes/sync-block.js +2 -1
  12. package/dist/cjs/validator-schema/generated/validatorSpec.js +31 -2
  13. package/dist/es2019/index.js +1 -1
  14. package/dist/es2019/next-schema/full-schema.adf.js +2 -1
  15. package/dist/es2019/next-schema/generated/nodeTypes.js +14 -1
  16. package/dist/es2019/next-schema/nodes/bodiedSyncBlock.js +40 -0
  17. package/dist/es2019/schema/create-schema.js +4 -1
  18. package/dist/es2019/schema/default-schema.js +3 -2
  19. package/dist/es2019/schema/index.js +1 -1
  20. package/dist/es2019/schema/nodes/bodied-sync-block.js +35 -0
  21. package/dist/es2019/schema/nodes/index.js +2 -1
  22. package/dist/es2019/schema/nodes/sync-block.js +2 -1
  23. package/dist/es2019/validator-schema/generated/validatorSpec.js +30 -1
  24. package/dist/esm/index.js +1 -1
  25. package/dist/esm/next-schema/full-schema.adf.js +2 -1
  26. package/dist/esm/next-schema/generated/nodeTypes.js +14 -1
  27. package/dist/esm/next-schema/nodes/bodiedSyncBlock.js +40 -0
  28. package/dist/esm/schema/create-schema.js +4 -1
  29. package/dist/esm/schema/default-schema.js +3 -2
  30. package/dist/esm/schema/index.js +1 -1
  31. package/dist/esm/schema/nodes/bodied-sync-block.js +34 -0
  32. package/dist/esm/schema/nodes/index.js +2 -1
  33. package/dist/esm/schema/nodes/sync-block.js +2 -1
  34. package/dist/esm/validator-schema/generated/validatorSpec.js +30 -1
  35. package/dist/json-schema/v1/stage-0.json +115 -0
  36. package/dist/types/index.d.ts +2 -2
  37. package/dist/types/next-schema/generated/nodeTypes.d.ts +12 -1
  38. package/dist/types/next-schema/nodes/bodiedSyncBlock.d.ts +1 -0
  39. package/dist/types/schema/default-schema.d.ts +1 -1
  40. package/dist/types/schema/index.d.ts +2 -2
  41. package/dist/types/schema/nodes/bodied-sync-block.d.ts +44 -0
  42. package/dist/types/schema/nodes/doc.d.ts +2 -1
  43. package/dist/types/schema/nodes/index.d.ts +2 -0
  44. package/dist/types/validator-schema/generated/validatorSpec.d.ts +29 -0
  45. package/json-schema/v1/stage-0.json +115 -0
  46. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/adf-schema
2
2
 
3
+ ## 51.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 2c46f94: EDITOR-2443 Fix order of node types under bodied sync block to ensure paragraph is first so empty paragraph is for a default new n
8
+
9
+ ## 51.3.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 1f40219: EDITOR-2332 add bodied sync block node
14
+
3
15
  ## 51.2.0
4
16
 
5
17
  ### Minor Changes
package/dist/cjs/index.js CHANGED
@@ -369,6 +369,12 @@ Object.defineProperty(exports, "bodiedExtension", {
369
369
  return _schema.bodiedExtension;
370
370
  }
371
371
  });
372
+ Object.defineProperty(exports, "bodiedSyncBlock", {
373
+ enumerable: true,
374
+ get: function get() {
375
+ return _schema.bodiedSyncBlock;
376
+ }
377
+ });
372
378
  Object.defineProperty(exports, "border", {
373
379
  enumerable: true,
374
380
  get: function get() {
@@ -12,10 +12,11 @@ var _blockContentGroup = require("./groups/blockContentGroup");
12
12
  var _expand = require("./nodes/expand");
13
13
  var _codeBlock = require("./nodes/codeBlock");
14
14
  var _syncBlock = require("./nodes/syncBlock");
15
+ var _bodiedSyncBlock = require("./nodes/bodiedSyncBlock");
15
16
  var doc = (0, _adfSchemaGenerator.adfNode)('doc').define({
16
17
  root: true,
17
18
  version: 1,
18
- content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(_blockGroup.blockGroup, _blockContentGroup.blockContentGroup, _codeBlock.codeBlock.use('root_only'), _layoutSection.layoutSection, _layoutSection.layoutSection.use('with_single_column'), _layoutSection.layoutSection.use('full'), _blockRootOnlyGroup.blockRootOnlyGroup, _expand.expand.use('root_only'), _syncBlock.syncBlock))],
19
+ content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(_blockGroup.blockGroup, _blockContentGroup.blockContentGroup, _codeBlock.codeBlock.use('root_only'), _layoutSection.layoutSection, _layoutSection.layoutSection.use('with_single_column'), _layoutSection.layoutSection.use('full'), _blockRootOnlyGroup.blockRootOnlyGroup, _expand.expand.use('root_only'), _syncBlock.syncBlock, _bodiedSyncBlock.bodiedSyncBlock))],
19
20
  DANGEROUS_MANUAL_OVERRIDE: {
20
21
  'validator-spec': {
21
22
  'props.content.minItems': {
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.unsupportedInline = exports.unsupportedBlock = exports.textWithNoMarks = exports.textFormatted = exports.textCodeInline = exports.text = exports.taskList = exports.taskItem = exports.tableWithNestedTable = exports.tableRowWithNestedTable = exports.tableRow = exports.tableHeaderWithNestedTable = exports.tableHeader = exports.tableCellWithNestedTable = exports.tableCell = exports.table = exports.syncBlockStage0 = exports.statusStage0 = exports.status = exports.rule = exports.placeholder = exports.paragraphWithNoMarks = exports.paragraphWithIndentation = exports.paragraphWithAlignment = exports.paragraph = exports.panel = exports.orderedList = exports.nestedExpandWithNoMarks = exports.nestedExpand = exports.multiBodiedExtensionStage0 = exports.mentionStage0 = exports.mention = exports.mediaSingleWidthType = exports.mediaSingleFull = exports.mediaSingleCaption = exports.mediaSingle = exports.mediaInline = exports.mediaGroup = exports.media = exports.listItemWithNestedDecisionStage0 = exports.listItem = exports.layoutSectionWithSingleColumnStage0 = exports.layoutSectionFull = exports.layoutSection = exports.layoutColumn = exports.inlineExtensionWithMarks = exports.inlineExtension = exports.inlineCardStage0 = exports.inlineCard = exports.image = exports.headingWithNoMarks = exports.headingWithIndentation = exports.headingWithAlignment = exports.heading = exports.hardBreak = exports.extensionWithMarks = exports.extensionFrameStage0 = exports.extension = exports.expandRootOnly = exports.expand = exports.emojiStage0 = exports.emoji = exports.embedCard = exports.doc = exports.decisionList = exports.decisionItem = exports.dateStage0 = exports.date = exports.confluenceUnsupportedInline = exports.confluenceUnsupportedBlock = exports.confluenceJiraIssue = exports.codeBlockRootOnly = exports.codeBlock = exports.caption = exports.bulletList = exports.bodiedExtensionWithMarks = exports.bodiedExtension = exports.blockquoteLegacy = exports.blockquote = exports.blockTaskItem = exports.blockCard = void 0;
6
+ exports.unsupportedInline = exports.unsupportedBlock = exports.textWithNoMarks = exports.textFormatted = exports.textCodeInline = exports.text = exports.taskList = exports.taskItem = exports.tableWithNestedTable = exports.tableRowWithNestedTable = exports.tableRow = exports.tableHeaderWithNestedTable = exports.tableHeader = exports.tableCellWithNestedTable = exports.tableCell = exports.table = exports.syncBlockStage0 = exports.statusStage0 = exports.status = exports.rule = exports.placeholder = exports.paragraphWithNoMarks = exports.paragraphWithIndentation = exports.paragraphWithAlignment = exports.paragraph = exports.panel = exports.orderedList = exports.nestedExpandWithNoMarks = exports.nestedExpand = exports.multiBodiedExtensionStage0 = exports.mentionStage0 = exports.mention = exports.mediaSingleWidthType = exports.mediaSingleFull = exports.mediaSingleCaption = exports.mediaSingle = exports.mediaInline = exports.mediaGroup = exports.media = exports.listItemWithNestedDecisionStage0 = exports.listItem = exports.layoutSectionWithSingleColumnStage0 = exports.layoutSectionFull = exports.layoutSection = exports.layoutColumn = exports.inlineExtensionWithMarks = exports.inlineExtension = exports.inlineCardStage0 = exports.inlineCard = exports.image = exports.headingWithNoMarks = exports.headingWithIndentation = exports.headingWithAlignment = exports.heading = exports.hardBreak = exports.extensionWithMarks = exports.extensionFrameStage0 = exports.extension = exports.expandRootOnly = exports.expand = exports.emojiStage0 = exports.emoji = exports.embedCard = exports.doc = exports.decisionList = exports.decisionItem = exports.dateStage0 = exports.date = exports.confluenceUnsupportedInline = exports.confluenceUnsupportedBlock = exports.confluenceJiraIssue = exports.codeBlockRootOnly = exports.codeBlock = exports.caption = exports.bulletList = exports.bodiedSyncBlockStage0 = exports.bodiedExtensionWithMarks = exports.bodiedExtension = exports.blockquoteLegacy = exports.blockquote = exports.blockTaskItem = exports.blockCard = void 0;
7
7
  var _createPMSpecFactory = require("../../schema/createPMSpecFactory");
8
8
  /**
9
9
  * This file was automatically generated by @atlaskit/adf-schema-generator
@@ -129,6 +129,19 @@ var bodiedExtensionWithMarks = exports.bodiedExtensionWithMarks = (0, _createPMS
129
129
  defining: true,
130
130
  isolating: true
131
131
  });
132
+ var bodiedSyncBlockStage0 = exports.bodiedSyncBlockStage0 = (0, _createPMSpecFactory.createPMNodeSpecFactory)({
133
+ content: '(blockCard | blockquote | bulletList | codeBlock | confluenceUnsupportedBlock | decisionList | embedCard | expand | heading | layoutSection | mediaGroup | mediaSingle | orderedList | panel | paragraph | rule | table | taskList | unsupportedBlock)+',
134
+ marks: 'unsupportedMark unsupportedNodeAttribute alignment indentation breakout link fragment',
135
+ attrs: {
136
+ resourceId: {
137
+ default: ''
138
+ },
139
+ localId: {
140
+ default: ''
141
+ }
142
+ },
143
+ selectable: true
144
+ });
132
145
  var bulletList = exports.bulletList = (0, _createPMSpecFactory.createPMNodeSpecFactory)({
133
146
  content: 'listItem+',
134
147
  marks: 'unsupportedMark unsupportedNodeAttribute',
@@ -278,7 +291,7 @@ var decisionList = exports.decisionList = (0, _createPMSpecFactory.createPMNodeS
278
291
  defining: true
279
292
  });
280
293
  var doc = exports.doc = (0, _createPMSpecFactory.createPMNodeSpecFactory)({
281
- content: '(block | codeBlock | layoutSection | blockRootOnly | expand | syncBlock)+',
294
+ content: '(block | codeBlock | layoutSection | blockRootOnly | expand | syncBlock | bodiedSyncBlock)+',
282
295
  marks: 'unsupportedMark unsupportedNodeAttribute alignment indentation dataConsumer fragment breakout'
283
296
  });
284
297
  var embedCard = exports.embedCard = (0, _createPMSpecFactory.createPMNodeSpecFactory)({
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.bodiedSyncBlock = void 0;
7
+ var _adfSchemaGenerator = require("@atlaskit/adf-schema-generator");
8
+ var _breakout = require("../marks/breakout");
9
+ var _unsupportedMark = require("../marks/unsupportedMark");
10
+ var _unsupportedNodeAttribute = require("../marks/unsupportedNodeAttribute");
11
+ var _unsupportedBlock = require("../nodes/unsupportedBlock");
12
+ var _blockCard = require("./blockCard");
13
+ var _blockquote = require("./blockquote");
14
+ var _codeBlock = require("./codeBlock");
15
+ var _confluenceUnsupportedBlock = require("./confluenceUnsupportedBlock");
16
+ var _decisionList = require("./decisionList");
17
+ var _embedCard = require("./embedCard");
18
+ var _expand = require("./expand");
19
+ var _list = require("./list");
20
+ var _mediaGroup = require("./mediaGroup");
21
+ var _mediaSingle = require("./mediaSingle");
22
+ var _panel = require("./panel");
23
+ var _paragraph = require("./paragraph");
24
+ var _rule = require("./rule");
25
+ var _heading = require("./heading");
26
+ var _tableNodes = require("./tableNodes");
27
+ var _task = require("./task");
28
+ var _layoutSection = require("./layoutSection");
29
+ var bodiedSyncBlock = exports.bodiedSyncBlock = (0, _adfSchemaGenerator.adfNode)('bodiedSyncBlock').define({
30
+ stage0: true,
31
+ selectable: true,
32
+ marks: [_breakout.breakout, _unsupportedMark.unsupportedMark, _unsupportedNodeAttribute.unsupportedNodeAttribute],
33
+ attrs: {
34
+ resourceId: {
35
+ type: 'string',
36
+ default: ''
37
+ },
38
+ localId: {
39
+ type: 'string',
40
+ default: ''
41
+ }
42
+ },
43
+ content: [(0, _adfSchemaGenerator.$onePlus)((0, _adfSchemaGenerator.$or)(_blockCard.blockCard, _blockquote.blockquote, _blockquote.blockquote.use('legacy'), _list.bulletList, _codeBlock.codeBlock, _confluenceUnsupportedBlock.confluenceUnsupportedBlock, _decisionList.decisionList, _embedCard.embedCard, _expand.expand, _heading.heading, _heading.heading.use('with_alignment'), _heading.heading.use('with_indentation'), _heading.heading.use('with_no_marks'), _layoutSection.layoutSection, _mediaGroup.mediaGroup, _mediaSingle.mediaSingle, _mediaSingle.mediaSingle.use('caption'), _mediaSingle.mediaSingle.use('full'), _mediaSingle.mediaSingle.use('width_type'), _list.orderedList, _panel.panel, _paragraph.paragraph, _paragraph.paragraph.use('with_alignment'), _paragraph.paragraph.use('with_indentation'), _paragraph.paragraph.use('with_no_marks'), _rule.rule, _tableNodes.table,
44
+ // @ts-expect-error - types don't deal well with circular references for the variant
45
+ _tableNodes.table.use('with_nested_table'), _task.taskList, _unsupportedBlock.unsupportedBlock))]
46
+ });
@@ -204,6 +204,9 @@ var nodesInOrder = [{
204
204
  }, {
205
205
  name: 'syncBlock',
206
206
  spec: _nodes.syncBlock
207
+ }, {
208
+ name: 'bodiedSyncBlock',
209
+ spec: _nodes.bodiedSyncBlock
207
210
  }, {
208
211
  name: 'unknownBlock',
209
212
  spec: _nodes.unknownBlock
@@ -32,7 +32,8 @@ var getSchemaBasedOnStage = exports.getSchemaBasedOnStage = (0, _memoizeOne.defa
32
32
  tableRow: _nodes.tableRowWithNestedTable,
33
33
  tableCell: _nodes.tableCellWithNestedTable,
34
34
  tableHeader: _nodes.tableHeaderWithNestedTable,
35
- syncBlock: _nodes.syncBlock
35
+ syncBlock: _nodes.syncBlock,
36
+ bodiedSyncBlock: _nodes.bodiedSyncBlock
36
37
  };
37
38
  }
38
39
  return (0, _createSchema.createSchema)(defaultSchemaConfig);
@@ -87,6 +87,12 @@ Object.defineProperty(exports, "bodiedExtension", {
87
87
  return _nodes.bodiedExtension;
88
88
  }
89
89
  });
90
+ Object.defineProperty(exports, "bodiedSyncBlock", {
91
+ enumerable: true,
92
+ get: function get() {
93
+ return _nodes.bodiedSyncBlock;
94
+ }
95
+ });
90
96
  Object.defineProperty(exports, "border", {
91
97
  enumerable: true,
92
98
  get: function get() {
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.bodiedSyncBlock = void 0;
7
+ var _nodeTypes = require("../../next-schema/generated/nodeTypes");
8
+ var _utils = require("../../utils");
9
+ /**
10
+ * Represents a block node that is designed to be synchronized
11
+ * with an external resource across different products.
12
+ * @name bodiedSyncBlock_node
13
+ */
14
+
15
+ var bodiedSyncBlock = exports.bodiedSyncBlock = (0, _nodeTypes.bodiedSyncBlockStage0)({
16
+ parseDOM: [{
17
+ tag: 'div[data-bodied-sync-block]',
18
+ getAttrs: function getAttrs(domNode) {
19
+ var dom = domNode;
20
+ var attrs = {
21
+ localId: dom.getAttribute('data-local-id') || _utils.uuid.generate(),
22
+ resourceId: dom.getAttribute('data-resource-id') || ''
23
+ };
24
+ return attrs;
25
+ }
26
+ }],
27
+ toDOM: function toDOM(node) {
28
+ var _node$attrs = node.attrs,
29
+ localId = _node$attrs.localId,
30
+ resourceId = _node$attrs.resourceId;
31
+ var name = 'div';
32
+ var attrs = {
33
+ 'data-bodied-sync-block': '',
34
+ 'data-local-id': localId,
35
+ 'data-resource-id': resourceId
36
+ };
37
+ return [name, attrs, 0];
38
+ }
39
+ });
@@ -40,6 +40,12 @@ Object.defineProperty(exports, "bodiedExtension", {
40
40
  return _bodiedExtension.bodiedExtension;
41
41
  }
42
42
  });
43
+ Object.defineProperty(exports, "bodiedSyncBlock", {
44
+ enumerable: true,
45
+ get: function get() {
46
+ return _bodiedSyncBlock.bodiedSyncBlock;
47
+ }
48
+ });
43
49
  Object.defineProperty(exports, "bulletList", {
44
50
  enumerable: true,
45
51
  get: function get() {
@@ -745,4 +751,5 @@ var _extension = require("./extension");
745
751
  var _inlineExtension = require("./inline-extension");
746
752
  var _bodiedExtension = require("./bodied-extension");
747
753
  var _multiBodiedExtension = require("./multi-bodied-extension");
748
- var _syncBlock = require("./sync-block");
754
+ var _syncBlock = require("./sync-block");
755
+ var _bodiedSyncBlock = require("./bodied-sync-block");
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.syncBlock = void 0;
7
7
  var _nodeTypes = require("../../next-schema/generated/nodeTypes");
8
+ var _utils = require("../../utils");
8
9
  /**
9
10
  * Represents a block node that is designed to be synchronized
10
11
  * with an external resource across different products.
@@ -17,7 +18,7 @@ var syncBlock = exports.syncBlock = (0, _nodeTypes.syncBlockStage0)({
17
18
  getAttrs: function getAttrs(domNode) {
18
19
  var dom = domNode;
19
20
  var attrs = {
20
- localId: dom.getAttribute('data-local-id') || '',
21
+ localId: dom.getAttribute('data-local-id') || _utils.uuid.generate(),
21
22
  resourceId: dom.getAttribute('data-resource-id') || ''
22
23
  };
23
24
  return attrs;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.underline = exports.text_with_no_marks = exports.text_link_inline = exports.text_formatted = exports.text_code_inline = exports.textColor = exports.text = exports.taskList = exports.taskItem = exports.tableRow = exports.tableHeader = exports.tableCell = exports.table = exports.syncBlock = exports.subsup = exports.strong = exports.strike = exports.status = exports.rule = exports.placeholder = exports.paragraph_with_no_marks = exports.paragraph_with_indentation = exports.paragraph_with_alignment = exports.paragraph = exports.panel = exports.orderedList = exports.non_nestable_block_content = exports.nestedExpand_with_no_marks = exports.nestedExpand_content = exports.nestedExpand = exports.multiBodiedExtension = exports.mention = exports.mediaSingle_width_type = exports.mediaSingle_full = exports.mediaSingle_caption = exports.mediaSingle = exports.mediaInline = exports.mediaGroup = exports.media = exports.listItem_with_nested_decision = exports.listItem = exports.link = exports.layoutSection_with_single_column = exports.layoutSection_full = exports.layoutSection = exports.layoutColumn = exports.inline_content = exports.inlineExtension_with_marks = exports.inlineExtension = exports.inlineCard = exports.indentation = exports.heading_with_no_marks = exports.heading_with_indentation = exports.heading_with_alignment = exports.heading = exports.hardBreak = exports.fragment = exports.extension_with_marks = exports.extensionFrame = exports.extension = exports.expand_root_only = exports.expand = exports.emoji = exports.embedCard = exports.em = exports.doc = exports.decisionList = exports.decisionItem = exports.date = exports.dataConsumer = exports.confluenceInlineComment = exports.codeBlock_root_only = exports.codeBlock = exports.code = exports.caption = exports.bulletList = exports.breakout = exports.border = exports.bodiedExtension_with_marks = exports.bodiedExtension = exports.blockquote = exports.block_content = exports.blockTaskItem = exports.blockRootOnly = exports.blockCard = exports.backgroundColor = exports.annotation = exports.alignment = void 0;
6
+ exports.underline = exports.text_with_no_marks = exports.text_link_inline = exports.text_formatted = exports.text_code_inline = exports.textColor = exports.text = exports.taskList = exports.taskItem = exports.tableRow = exports.tableHeader = exports.tableCell = exports.table = exports.syncBlock = exports.subsup = exports.strong = exports.strike = exports.status = exports.rule = exports.placeholder = exports.paragraph_with_no_marks = exports.paragraph_with_indentation = exports.paragraph_with_alignment = exports.paragraph = exports.panel = exports.orderedList = exports.non_nestable_block_content = exports.nestedExpand_with_no_marks = exports.nestedExpand_content = exports.nestedExpand = exports.multiBodiedExtension = exports.mention = exports.mediaSingle_width_type = exports.mediaSingle_full = exports.mediaSingle_caption = exports.mediaSingle = exports.mediaInline = exports.mediaGroup = exports.media = exports.listItem_with_nested_decision = exports.listItem = exports.link = exports.layoutSection_with_single_column = exports.layoutSection_full = exports.layoutSection = exports.layoutColumn = exports.inline_content = exports.inlineExtension_with_marks = exports.inlineExtension = exports.inlineCard = exports.indentation = exports.heading_with_no_marks = exports.heading_with_indentation = exports.heading_with_alignment = exports.heading = exports.hardBreak = exports.fragment = exports.extension_with_marks = exports.extensionFrame = exports.extension = exports.expand_root_only = exports.expand = exports.emoji = exports.embedCard = exports.em = exports.doc = exports.decisionList = exports.decisionItem = exports.date = exports.dataConsumer = exports.confluenceInlineComment = exports.codeBlock_root_only = exports.codeBlock = exports.code = exports.caption = exports.bulletList = exports.breakout = exports.border = exports.bodiedSyncBlock = exports.bodiedExtension_with_marks = exports.bodiedExtension = exports.blockquote = exports.block_content = exports.blockTaskItem = exports.blockRootOnly = exports.blockCard = exports.backgroundColor = exports.annotation = exports.alignment = void 0;
7
7
  var alignment = exports.alignment = {
8
8
  props: {
9
9
  type: {
@@ -240,6 +240,35 @@ var bodiedExtension_with_marks = exports.bodiedExtension_with_marks = ['bodiedEx
240
240
  }
241
241
  }
242
242
  }];
243
+ var bodiedSyncBlock = exports.bodiedSyncBlock = {
244
+ props: {
245
+ type: {
246
+ type: 'enum',
247
+ values: ['bodiedSyncBlock']
248
+ },
249
+ attrs: {
250
+ props: {
251
+ resourceId: {
252
+ type: 'string'
253
+ },
254
+ localId: {
255
+ type: 'string'
256
+ }
257
+ }
258
+ },
259
+ content: {
260
+ type: 'array',
261
+ items: [['blockCard', 'blockquote', 'bulletList', 'codeBlock', 'decisionList', 'embedCard', 'expand', 'heading', 'heading_with_alignment', 'heading_with_indentation', 'heading_with_no_marks', 'layoutSection', 'mediaGroup', 'mediaSingle', 'mediaSingle_caption', 'mediaSingle_full', 'mediaSingle_width_type', 'orderedList', 'panel', 'paragraph', 'paragraph_with_alignment', 'paragraph_with_indentation', 'paragraph_with_no_marks', 'rule', 'table', 'taskList']],
262
+ minItems: 1,
263
+ allowUnsupportedBlock: true
264
+ },
265
+ marks: {
266
+ type: 'array',
267
+ optional: true,
268
+ items: ['breakout']
269
+ }
270
+ }
271
+ };
243
272
  var border = exports.border = {
244
273
  props: {
245
274
  type: {
@@ -490,7 +519,7 @@ var doc = exports.doc = {
490
519
  },
491
520
  content: {
492
521
  type: 'array',
493
- items: [['blockCard', 'paragraph_with_no_marks', 'paragraph_with_alignment', 'paragraph_with_indentation', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock', 'taskList', 'bulletList', 'orderedList', 'heading_with_no_marks', 'heading_with_alignment', 'heading_with_indentation', 'mediaGroup', 'decisionList', 'rule', 'panel', 'blockquote', 'extension_with_marks', 'embedCard', 'table', 'expand', 'bodiedExtension_with_marks', 'codeBlock_root_only', 'layoutSection_with_single_column', 'layoutSection_full', 'multiBodiedExtension', 'expand_root_only', 'syncBlock']],
522
+ items: [['blockCard', 'paragraph_with_no_marks', 'paragraph_with_alignment', 'paragraph_with_indentation', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock', 'taskList', 'bulletList', 'orderedList', 'heading_with_no_marks', 'heading_with_alignment', 'heading_with_indentation', 'mediaGroup', 'decisionList', 'rule', 'panel', 'blockquote', 'extension_with_marks', 'embedCard', 'table', 'expand', 'bodiedExtension_with_marks', 'codeBlock_root_only', 'layoutSection_with_single_column', 'layoutSection_full', 'multiBodiedExtension', 'expand_root_only', 'syncBlock', 'bodiedSyncBlock']],
494
523
  allowUnsupportedBlock: true
495
524
  }
496
525
  }
@@ -1,5 +1,5 @@
1
1
  export { PanelType, AnnotationTypes, alignment, alignmentPositionMap, annotation, blockCard, blockCardWithLocalId, blockquote, extendedBlockquote, extendedBlockquoteWithLocalId, bodiedExtension, breakout, bulletList, bulletListSelector, bulletListWithLocalId, caption, captionWithLocalId, code, codeBlock, codeBlockWithLocalId, 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, dateWithLocalId, decisionItem, decisionList, decisionListSelector, doc, em, embedCard, embedCardWithLocalId, emoji, emojiWithLocalId, expandWithNestedExpand, expandWithNestedExpandLocalId, expandToJSON, extension, fragment, fragmentToJSON, hardBreak, heading, image, indentation, inlineCard, inlineCardWithLocalId, inlineExtension, inlineNodes, layoutColumn, layoutColumnWithLocalId, layoutSection, layoutSectionWithLocalId, layoutSectionWithSingleColumn, layoutSectionWithSingleColumnLocalId, link, linkToJSON, listItem, listItemWithLocalId, listItemWithDecisionStage0, media, mediaGroup, mediaSingle, mediaSingleWithCaption, mediaSingleWithWidthType, mediaSingleFull, mediaSingleFullWithLocalId, mediaSingleSpec, mediaInline, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, nestedExpandWithLocalId, orderedList, orderedListSelector, orderedListWithLocalId, orderedListWithOrder, orderedListWithOrderAndLocalId, extendedPanel, extendedPanelWithLocalId, paragraph, placeholder, placeholderWithLocalId, rule, ruleWithLocalId, sanitizeNodes, getCellAttrs, getCellDomAttrs, status, strike, strong, subsup, table, tableStage0, tableWithCustomWidth, tableBackgroundBorderColor, tableBackgroundColorNames, tableBackgroundColorPalette, tableCell, tableCellContentDomSelector, tableCellContentWrapperSelector, tableCellSelector, tableHeader, tableHeaderSelector, tablePrefixSelector, tableRow, tableToJSON, taskItem, blockTaskItem, taskList, taskListSelector, text, textColor, toJSONTableCell, toJSONTableHeader, typeAheadQuery, underline, unknownBlock, unsupportedBlock, unsupportedInline, unsupportedNodeTypesForMediaCards, buildAnnotationMarkDataAttributes, AnnotationMarkStates, unsupportedMark, unsupportedNodeAttribute, border, borderColorPalette, extensionFrame, multiBodiedExtension, backgroundColor, backgroundColorPalette, backgroundColorPaletteNext, syncBlock, tableWithNestedTable, tableRowWithNestedTable, tableCellWithNestedTable, tableHeaderWithNestedTable, tableRowWithLocalId, tableCellWithLocalId, tableHeaderWithLocalId, tableRowWithNestedTableWithLocalId, tableCellWithNestedTableWithLocalId, tableHeaderWithNestedTableWithLocalId } from './schema';
2
+ colorPaletteExtended, confluenceInlineComment, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, createSchema, dataConsumer, dataConsumerToJSON, date, dateWithLocalId, decisionItem, decisionList, decisionListSelector, doc, em, embedCard, embedCardWithLocalId, emoji, emojiWithLocalId, expandWithNestedExpand, expandWithNestedExpandLocalId, expandToJSON, extension, fragment, fragmentToJSON, hardBreak, heading, image, indentation, inlineCard, inlineCardWithLocalId, inlineExtension, inlineNodes, layoutColumn, layoutColumnWithLocalId, layoutSection, layoutSectionWithLocalId, layoutSectionWithSingleColumn, layoutSectionWithSingleColumnLocalId, link, linkToJSON, listItem, listItemWithLocalId, listItemWithDecisionStage0, media, mediaGroup, mediaSingle, mediaSingleWithCaption, mediaSingleWithWidthType, mediaSingleFull, mediaSingleFullWithLocalId, mediaSingleSpec, mediaInline, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, nestedExpandWithLocalId, orderedList, orderedListSelector, orderedListWithLocalId, orderedListWithOrder, orderedListWithOrderAndLocalId, extendedPanel, extendedPanelWithLocalId, paragraph, placeholder, placeholderWithLocalId, rule, ruleWithLocalId, sanitizeNodes, getCellAttrs, getCellDomAttrs, status, strike, strong, subsup, table, tableStage0, tableWithCustomWidth, tableBackgroundBorderColor, tableBackgroundColorNames, tableBackgroundColorPalette, tableCell, tableCellContentDomSelector, tableCellContentWrapperSelector, tableCellSelector, tableHeader, tableHeaderSelector, tablePrefixSelector, tableRow, tableToJSON, taskItem, blockTaskItem, taskList, taskListSelector, text, textColor, toJSONTableCell, toJSONTableHeader, typeAheadQuery, underline, unknownBlock, unsupportedBlock, unsupportedInline, unsupportedNodeTypesForMediaCards, buildAnnotationMarkDataAttributes, AnnotationMarkStates, unsupportedMark, unsupportedNodeAttribute, border, borderColorPalette, extensionFrame, multiBodiedExtension, backgroundColor, backgroundColorPalette, backgroundColorPaletteNext, syncBlock, bodiedSyncBlock, tableWithNestedTable, tableRowWithNestedTable, tableCellWithNestedTable, tableHeaderWithNestedTable, tableRowWithLocalId, tableCellWithLocalId, tableHeaderWithLocalId, tableRowWithNestedTableWithLocalId, tableCellWithNestedTableWithLocalId, tableHeaderWithNestedTableWithLocalId } 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';
4
4
 
5
5
  // ADF createPMSpecFactory
@@ -6,10 +6,11 @@ import { blockContentGroup } from './groups/blockContentGroup';
6
6
  import { expand } from './nodes/expand';
7
7
  import { codeBlock } from './nodes/codeBlock';
8
8
  import { syncBlock } from './nodes/syncBlock';
9
+ import { bodiedSyncBlock } from './nodes/bodiedSyncBlock';
9
10
  const doc = adfNode('doc').define({
10
11
  root: true,
11
12
  version: 1,
12
- content: [$onePlus($or(blockGroup, blockContentGroup, codeBlock.use('root_only'), layoutSection, layoutSection.use('with_single_column'), layoutSection.use('full'), blockRootOnlyGroup, expand.use('root_only'), syncBlock))],
13
+ content: [$onePlus($or(blockGroup, blockContentGroup, codeBlock.use('root_only'), layoutSection, layoutSection.use('with_single_column'), layoutSection.use('full'), blockRootOnlyGroup, expand.use('root_only'), syncBlock, bodiedSyncBlock))],
13
14
  DANGEROUS_MANUAL_OVERRIDE: {
14
15
  'validator-spec': {
15
16
  'props.content.minItems': {
@@ -123,6 +123,19 @@ export const bodiedExtensionWithMarks = createPMNodeSpecFactory({
123
123
  defining: true,
124
124
  isolating: true
125
125
  });
126
+ export const bodiedSyncBlockStage0 = createPMNodeSpecFactory({
127
+ content: '(blockCard | blockquote | bulletList | codeBlock | confluenceUnsupportedBlock | decisionList | embedCard | expand | heading | layoutSection | mediaGroup | mediaSingle | orderedList | panel | paragraph | rule | table | taskList | unsupportedBlock)+',
128
+ marks: 'unsupportedMark unsupportedNodeAttribute alignment indentation breakout link fragment',
129
+ attrs: {
130
+ resourceId: {
131
+ default: ''
132
+ },
133
+ localId: {
134
+ default: ''
135
+ }
136
+ },
137
+ selectable: true
138
+ });
126
139
  export const bulletList = createPMNodeSpecFactory({
127
140
  content: 'listItem+',
128
141
  marks: 'unsupportedMark unsupportedNodeAttribute',
@@ -272,7 +285,7 @@ export const decisionList = createPMNodeSpecFactory({
272
285
  defining: true
273
286
  });
274
287
  export const doc = createPMNodeSpecFactory({
275
- content: '(block | codeBlock | layoutSection | blockRootOnly | expand | syncBlock)+',
288
+ content: '(block | codeBlock | layoutSection | blockRootOnly | expand | syncBlock | bodiedSyncBlock)+',
276
289
  marks: 'unsupportedMark unsupportedNodeAttribute alignment indentation dataConsumer fragment breakout'
277
290
  });
278
291
  export const embedCard = createPMNodeSpecFactory({
@@ -0,0 +1,40 @@
1
+ import { $onePlus, $or, adfNode } from '@atlaskit/adf-schema-generator';
2
+ import { breakout } from '../marks/breakout';
3
+ import { unsupportedMark } from '../marks/unsupportedMark';
4
+ import { unsupportedNodeAttribute } from '../marks/unsupportedNodeAttribute';
5
+ import { unsupportedBlock } from '../nodes/unsupportedBlock';
6
+ import { blockCard } from './blockCard';
7
+ import { blockquote } from './blockquote';
8
+ import { codeBlock } from './codeBlock';
9
+ import { confluenceUnsupportedBlock } from './confluenceUnsupportedBlock';
10
+ import { decisionList } from './decisionList';
11
+ import { embedCard } from './embedCard';
12
+ import { expand } from './expand';
13
+ import { bulletList, orderedList } from './list';
14
+ import { mediaGroup } from './mediaGroup';
15
+ import { mediaSingle } from './mediaSingle';
16
+ import { panel } from './panel';
17
+ import { paragraph } from './paragraph';
18
+ import { rule } from './rule';
19
+ import { heading } from './heading';
20
+ import { table } from './tableNodes';
21
+ import { taskList } from './task';
22
+ import { layoutSection } from './layoutSection';
23
+ export const bodiedSyncBlock = adfNode('bodiedSyncBlock').define({
24
+ stage0: true,
25
+ selectable: true,
26
+ marks: [breakout, unsupportedMark, unsupportedNodeAttribute],
27
+ attrs: {
28
+ resourceId: {
29
+ type: 'string',
30
+ default: ''
31
+ },
32
+ localId: {
33
+ type: 'string',
34
+ default: ''
35
+ }
36
+ },
37
+ content: [$onePlus($or(blockCard, blockquote, blockquote.use('legacy'), bulletList, codeBlock, confluenceUnsupportedBlock, decisionList, embedCard, expand, heading, heading.use('with_alignment'), heading.use('with_indentation'), heading.use('with_no_marks'), layoutSection, mediaGroup, mediaSingle, mediaSingle.use('caption'), mediaSingle.use('full'), mediaSingle.use('width_type'), orderedList, panel, paragraph, paragraph.use('with_alignment'), paragraph.use('with_indentation'), paragraph.use('with_no_marks'), rule, table,
38
+ // @ts-expect-error - types don't deal well with circular references for the variant
39
+ table.use('with_nested_table'), taskList, unsupportedBlock))]
40
+ });
@@ -2,7 +2,7 @@ import { Schema } from '@atlaskit/editor-prosemirror/model';
2
2
  import { COLOR, FONT_STYLE, SEARCH_QUERY, LINK } from './groups';
3
3
  import { sanitizeNodes } from './sanitizeNodes';
4
4
  import { link, em, strong, textColor, strike, subsup, underline, code, typeAheadQuery, confluenceInlineComment, breakout, alignment, indentation, annotation, unsupportedMark, unsupportedNodeAttribute, dataConsumer, fragment, border, backgroundColor } from './marks';
5
- import { confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, doc, paragraph, text, bulletList, orderedListWithOrder, listItem, heading, codeBlock, extendedPanel, rule, image, mention, media, mediaInline, mediaSingleFull, mediaGroup, hardBreak, emoji, table, tableCell, tableHeader, tableRow, decisionList, decisionItem, taskList, taskItem, blockTaskItem, unknownBlock, extension, inlineExtension, bodiedExtension, multiBodiedExtension, extensionFrame, date, placeholder, layoutSection, layoutColumn, inlineCard, blockCard, unsupportedBlock, unsupportedInline, status, expandWithNestedExpand, nestedExpand, embedCard, caption, extendedBlockquote, syncBlock } from './nodes';
5
+ import { confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, doc, paragraph, text, bulletList, orderedListWithOrder, listItem, heading, codeBlock, extendedPanel, rule, image, mention, media, mediaInline, mediaSingleFull, mediaGroup, hardBreak, emoji, table, tableCell, tableHeader, tableRow, decisionList, decisionItem, taskList, taskItem, blockTaskItem, unknownBlock, extension, inlineExtension, bodiedExtension, multiBodiedExtension, extensionFrame, date, placeholder, layoutSection, layoutColumn, inlineCard, blockCard, unsupportedBlock, unsupportedInline, status, expandWithNestedExpand, nestedExpand, embedCard, caption, extendedBlockquote, syncBlock, bodiedSyncBlock } from './nodes';
6
6
  function addItems(builtInItems, config, customSpecs = {}) {
7
7
  if (!config) {
8
8
  return {};
@@ -194,6 +194,9 @@ const nodesInOrder = [{
194
194
  }, {
195
195
  name: 'syncBlock',
196
196
  spec: syncBlock
197
+ }, {
198
+ name: 'bodiedSyncBlock',
199
+ spec: bodiedSyncBlock
197
200
  }, {
198
201
  name: 'unknownBlock',
199
202
  spec: unknownBlock
@@ -1,5 +1,5 @@
1
1
  import memoizeOne from 'memoize-one';
2
- import { extensionFrame, layoutSectionWithSingleColumn, multiBodiedExtension, expandWithNestedExpand, tableWithNestedTable, listItemWithDecisionStage0, tableRowWithNestedTable, tableCellWithNestedTable, tableHeaderWithNestedTable, syncBlock } from './nodes';
2
+ import { extensionFrame, layoutSectionWithSingleColumn, multiBodiedExtension, expandWithNestedExpand, tableWithNestedTable, listItemWithDecisionStage0, tableRowWithNestedTable, tableCellWithNestedTable, tableHeaderWithNestedTable, syncBlock, bodiedSyncBlock } from './nodes';
3
3
  import { createSchema } from './create-schema';
4
4
  const getDefaultSchemaConfig = () => {
5
5
  const defaultSchemaConfig = {
@@ -24,7 +24,8 @@ export const getSchemaBasedOnStage = memoizeOne((stage = 'final') => {
24
24
  tableRow: tableRowWithNestedTable,
25
25
  tableCell: tableCellWithNestedTable,
26
26
  tableHeader: tableHeaderWithNestedTable,
27
- syncBlock
27
+ syncBlock,
28
+ bodiedSyncBlock
28
29
  };
29
30
  }
30
31
  return createSchema(defaultSchemaConfig);
@@ -1,4 +1,4 @@
1
- export { PanelType, blockCard, blockCardWithLocalId, blockquote, extendedBlockquote, extendedBlockquoteWithLocalId, bodiedExtension, bulletList, bulletListSelector, bulletListWithLocalId, caption, captionWithLocalId, codeBlock, codeBlockWithLocalId, codeBlockToJSON, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, date, dateWithLocalId, decisionItem, decisionList, decisionListSelector, doc, embedCard, embedCardWithLocalId, emoji, emojiWithLocalId, expandWithNestedExpand, expandWithNestedExpandLocalId, expandToJSON, extension, hardBreak, heading, image, inlineCard, inlineCardWithLocalId, inlineExtension, layoutColumn, layoutColumnWithLocalId, layoutSection, layoutSectionWithLocalId, layoutSectionWithSingleColumn, layoutSectionWithSingleColumnLocalId, listItem, listItemWithDecisionStage0, listItemWithLocalId, media, mediaGroup, mediaSingle, mediaSingleSpec, mediaInline, mediaSingleWithCaption, mediaSingleWithWidthType, mediaSingleFull, mediaSingleFullWithLocalId, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, nestedExpandWithLocalId, orderedList, orderedListSelector, orderedListWithLocalId, orderedListWithOrder, orderedListWithOrderAndLocalId, extendedPanel, extendedPanelWithLocalId, paragraph, placeholder, placeholderWithLocalId, rule, ruleWithLocalId, getCellAttrs, getCellDomAttrs, status, table, tableStage0, tableWithCustomWidth, tableBackgroundBorderColor, tableBackgroundColorNames, tableBackgroundColorPalette, tableCell, tableCellContentDomSelector, tableCellContentWrapperSelector, tableCellSelector, tableHeader, tableHeaderSelector, tablePrefixSelector, tableRow, tableToJSON, taskItem, blockTaskItem, taskList, taskListSelector, text, toJSONTableCell, toJSONTableHeader, unknownBlock, unsupportedBlock, unsupportedInline, extensionFrame, multiBodiedExtension, syncBlock, tableWithNestedTable, tableRowWithNestedTable, tableCellWithNestedTable, tableHeaderWithNestedTable, tableRowWithLocalId, tableCellWithLocalId, tableHeaderWithLocalId, tableRowWithNestedTableWithLocalId, tableCellWithNestedTableWithLocalId, tableHeaderWithNestedTableWithLocalId } from './nodes';
1
+ export { PanelType, blockCard, blockCardWithLocalId, blockquote, extendedBlockquote, extendedBlockquoteWithLocalId, bodiedExtension, bulletList, bulletListSelector, bulletListWithLocalId, caption, captionWithLocalId, codeBlock, codeBlockWithLocalId, codeBlockToJSON, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, date, dateWithLocalId, decisionItem, decisionList, decisionListSelector, doc, embedCard, embedCardWithLocalId, emoji, emojiWithLocalId, expandWithNestedExpand, expandWithNestedExpandLocalId, expandToJSON, extension, hardBreak, heading, image, inlineCard, inlineCardWithLocalId, inlineExtension, layoutColumn, layoutColumnWithLocalId, layoutSection, layoutSectionWithLocalId, layoutSectionWithSingleColumn, layoutSectionWithSingleColumnLocalId, listItem, listItemWithDecisionStage0, listItemWithLocalId, media, mediaGroup, mediaSingle, mediaSingleSpec, mediaInline, mediaSingleWithCaption, mediaSingleWithWidthType, mediaSingleFull, mediaSingleFullWithLocalId, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, nestedExpandWithLocalId, orderedList, orderedListSelector, orderedListWithLocalId, orderedListWithOrder, orderedListWithOrderAndLocalId, extendedPanel, extendedPanelWithLocalId, paragraph, placeholder, placeholderWithLocalId, rule, ruleWithLocalId, getCellAttrs, getCellDomAttrs, status, table, tableStage0, tableWithCustomWidth, tableBackgroundBorderColor, tableBackgroundColorNames, tableBackgroundColorPalette, tableCell, tableCellContentDomSelector, tableCellContentWrapperSelector, tableCellSelector, tableHeader, tableHeaderSelector, tablePrefixSelector, tableRow, tableToJSON, taskItem, blockTaskItem, taskList, taskListSelector, text, toJSONTableCell, toJSONTableHeader, unknownBlock, unsupportedBlock, unsupportedInline, extensionFrame, multiBodiedExtension, syncBlock, bodiedSyncBlock, tableWithNestedTable, tableRowWithNestedTable, tableCellWithNestedTable, tableHeaderWithNestedTable, tableRowWithLocalId, tableCellWithLocalId, tableHeaderWithLocalId, tableRowWithNestedTableWithLocalId, tableCellWithNestedTableWithLocalId, tableHeaderWithNestedTableWithLocalId } 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, backgroundColorPaletteNext } from './marks';
4
4
  export { unsupportedNodeTypesForMediaCards } from './unsupported';
@@ -0,0 +1,35 @@
1
+ import { bodiedSyncBlockStage0 } from '../../next-schema/generated/nodeTypes';
2
+ import { uuid } from '../../utils';
3
+
4
+ /**
5
+ * Represents a block node that is designed to be synchronized
6
+ * with an external resource across different products.
7
+ * @name bodiedSyncBlock_node
8
+ */
9
+
10
+ export const bodiedSyncBlock = bodiedSyncBlockStage0({
11
+ parseDOM: [{
12
+ tag: 'div[data-bodied-sync-block]',
13
+ getAttrs: domNode => {
14
+ const dom = domNode;
15
+ const attrs = {
16
+ localId: dom.getAttribute('data-local-id') || uuid.generate(),
17
+ resourceId: dom.getAttribute('data-resource-id') || ''
18
+ };
19
+ return attrs;
20
+ }
21
+ }],
22
+ toDOM(node) {
23
+ const {
24
+ localId,
25
+ resourceId
26
+ } = node.attrs;
27
+ const name = 'div';
28
+ const attrs = {
29
+ 'data-bodied-sync-block': '',
30
+ 'data-local-id': localId,
31
+ 'data-resource-id': resourceId
32
+ };
33
+ return [name, attrs, 0];
34
+ }
35
+ });
@@ -44,4 +44,5 @@ export { extension } from './extension';
44
44
  export { inlineExtension } from './inline-extension';
45
45
  export { bodiedExtension } from './bodied-extension';
46
46
  export { extensionFrame, multiBodiedExtension } from './multi-bodied-extension';
47
- export { syncBlock } from './sync-block';
47
+ export { syncBlock } from './sync-block';
48
+ export { bodiedSyncBlock } from './bodied-sync-block';
@@ -1,4 +1,5 @@
1
1
  import { syncBlockStage0 as syncBlockFactory } from '../../next-schema/generated/nodeTypes';
2
+ import { uuid } from '../../utils';
2
3
 
3
4
  /**
4
5
  * Represents a block node that is designed to be synchronized
@@ -12,7 +13,7 @@ export const syncBlock = syncBlockFactory({
12
13
  getAttrs: domNode => {
13
14
  const dom = domNode;
14
15
  const attrs = {
15
- localId: dom.getAttribute('data-local-id') || '',
16
+ localId: dom.getAttribute('data-local-id') || uuid.generate(),
16
17
  resourceId: dom.getAttribute('data-resource-id') || ''
17
18
  };
18
19
  return attrs;
@@ -234,6 +234,35 @@ export const bodiedExtension_with_marks = ['bodiedExtension', {
234
234
  }
235
235
  }
236
236
  }];
237
+ export const bodiedSyncBlock = {
238
+ props: {
239
+ type: {
240
+ type: 'enum',
241
+ values: ['bodiedSyncBlock']
242
+ },
243
+ attrs: {
244
+ props: {
245
+ resourceId: {
246
+ type: 'string'
247
+ },
248
+ localId: {
249
+ type: 'string'
250
+ }
251
+ }
252
+ },
253
+ content: {
254
+ type: 'array',
255
+ items: [['blockCard', 'blockquote', 'bulletList', 'codeBlock', 'decisionList', 'embedCard', 'expand', 'heading', 'heading_with_alignment', 'heading_with_indentation', 'heading_with_no_marks', 'layoutSection', 'mediaGroup', 'mediaSingle', 'mediaSingle_caption', 'mediaSingle_full', 'mediaSingle_width_type', 'orderedList', 'panel', 'paragraph', 'paragraph_with_alignment', 'paragraph_with_indentation', 'paragraph_with_no_marks', 'rule', 'table', 'taskList']],
256
+ minItems: 1,
257
+ allowUnsupportedBlock: true
258
+ },
259
+ marks: {
260
+ type: 'array',
261
+ optional: true,
262
+ items: ['breakout']
263
+ }
264
+ }
265
+ };
237
266
  export const border = {
238
267
  props: {
239
268
  type: {
@@ -484,7 +513,7 @@ export const doc = {
484
513
  },
485
514
  content: {
486
515
  type: 'array',
487
- items: [['blockCard', 'paragraph_with_no_marks', 'paragraph_with_alignment', 'paragraph_with_indentation', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock', 'taskList', 'bulletList', 'orderedList', 'heading_with_no_marks', 'heading_with_alignment', 'heading_with_indentation', 'mediaGroup', 'decisionList', 'rule', 'panel', 'blockquote', 'extension_with_marks', 'embedCard', 'table', 'expand', 'bodiedExtension_with_marks', 'codeBlock_root_only', 'layoutSection_with_single_column', 'layoutSection_full', 'multiBodiedExtension', 'expand_root_only', 'syncBlock']],
516
+ items: [['blockCard', 'paragraph_with_no_marks', 'paragraph_with_alignment', 'paragraph_with_indentation', 'mediaSingle_caption', 'mediaSingle_full', 'codeBlock', 'taskList', 'bulletList', 'orderedList', 'heading_with_no_marks', 'heading_with_alignment', 'heading_with_indentation', 'mediaGroup', 'decisionList', 'rule', 'panel', 'blockquote', 'extension_with_marks', 'embedCard', 'table', 'expand', 'bodiedExtension_with_marks', 'codeBlock_root_only', 'layoutSection_with_single_column', 'layoutSection_full', 'multiBodiedExtension', 'expand_root_only', 'syncBlock', 'bodiedSyncBlock']],
488
517
  allowUnsupportedBlock: true
489
518
  }
490
519
  }
package/dist/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export { PanelType, AnnotationTypes, alignment, alignmentPositionMap, annotation, blockCard, blockCardWithLocalId, blockquote, extendedBlockquote, extendedBlockquoteWithLocalId, bodiedExtension, breakout, bulletList, bulletListSelector, bulletListWithLocalId, caption, captionWithLocalId, code, codeBlock, codeBlockWithLocalId, 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, dateWithLocalId, decisionItem, decisionList, decisionListSelector, doc, em, embedCard, embedCardWithLocalId, emoji, emojiWithLocalId, expandWithNestedExpand, expandWithNestedExpandLocalId, expandToJSON, extension, fragment, fragmentToJSON, hardBreak, heading, image, indentation, inlineCard, inlineCardWithLocalId, inlineExtension, inlineNodes, layoutColumn, layoutColumnWithLocalId, layoutSection, layoutSectionWithLocalId, layoutSectionWithSingleColumn, layoutSectionWithSingleColumnLocalId, link, linkToJSON, listItem, listItemWithLocalId, listItemWithDecisionStage0, media, mediaGroup, mediaSingle, mediaSingleWithCaption, mediaSingleWithWidthType, mediaSingleFull, mediaSingleFullWithLocalId, mediaSingleSpec, mediaInline, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, nestedExpandWithLocalId, orderedList, orderedListSelector, orderedListWithLocalId, orderedListWithOrder, orderedListWithOrderAndLocalId, extendedPanel, extendedPanelWithLocalId, paragraph, placeholder, placeholderWithLocalId, rule, ruleWithLocalId, sanitizeNodes, getCellAttrs, getCellDomAttrs, status, strike, strong, subsup, table, tableStage0, tableWithCustomWidth, tableBackgroundBorderColor, tableBackgroundColorNames, tableBackgroundColorPalette, tableCell, tableCellContentDomSelector, tableCellContentWrapperSelector, tableCellSelector, tableHeader, tableHeaderSelector, tablePrefixSelector, tableRow, tableToJSON, taskItem, blockTaskItem, taskList, taskListSelector, text, textColor, toJSONTableCell, toJSONTableHeader, typeAheadQuery, underline, unknownBlock, unsupportedBlock, unsupportedInline, unsupportedNodeTypesForMediaCards, buildAnnotationMarkDataAttributes, AnnotationMarkStates, unsupportedMark, unsupportedNodeAttribute, border, borderColorPalette, extensionFrame, multiBodiedExtension, backgroundColor, backgroundColorPalette, backgroundColorPaletteNext, syncBlock, tableWithNestedTable, tableRowWithNestedTable, tableCellWithNestedTable, tableHeaderWithNestedTable, tableRowWithLocalId, tableCellWithLocalId, tableHeaderWithLocalId, tableRowWithNestedTableWithLocalId, tableCellWithNestedTableWithLocalId, tableHeaderWithNestedTableWithLocalId } from './schema';
2
+ colorPaletteExtended, confluenceInlineComment, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, createSchema, dataConsumer, dataConsumerToJSON, date, dateWithLocalId, decisionItem, decisionList, decisionListSelector, doc, em, embedCard, embedCardWithLocalId, emoji, emojiWithLocalId, expandWithNestedExpand, expandWithNestedExpandLocalId, expandToJSON, extension, fragment, fragmentToJSON, hardBreak, heading, image, indentation, inlineCard, inlineCardWithLocalId, inlineExtension, inlineNodes, layoutColumn, layoutColumnWithLocalId, layoutSection, layoutSectionWithLocalId, layoutSectionWithSingleColumn, layoutSectionWithSingleColumnLocalId, link, linkToJSON, listItem, listItemWithLocalId, listItemWithDecisionStage0, media, mediaGroup, mediaSingle, mediaSingleWithCaption, mediaSingleWithWidthType, mediaSingleFull, mediaSingleFullWithLocalId, mediaSingleSpec, mediaInline, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, nestedExpandWithLocalId, orderedList, orderedListSelector, orderedListWithLocalId, orderedListWithOrder, orderedListWithOrderAndLocalId, extendedPanel, extendedPanelWithLocalId, paragraph, placeholder, placeholderWithLocalId, rule, ruleWithLocalId, sanitizeNodes, getCellAttrs, getCellDomAttrs, status, strike, strong, subsup, table, tableStage0, tableWithCustomWidth, tableBackgroundBorderColor, tableBackgroundColorNames, tableBackgroundColorPalette, tableCell, tableCellContentDomSelector, tableCellContentWrapperSelector, tableCellSelector, tableHeader, tableHeaderSelector, tablePrefixSelector, tableRow, tableToJSON, taskItem, blockTaskItem, taskList, taskListSelector, text, textColor, toJSONTableCell, toJSONTableHeader, typeAheadQuery, underline, unknownBlock, unsupportedBlock, unsupportedInline, unsupportedNodeTypesForMediaCards, buildAnnotationMarkDataAttributes, AnnotationMarkStates, unsupportedMark, unsupportedNodeAttribute, border, borderColorPalette, extensionFrame, multiBodiedExtension, backgroundColor, backgroundColorPalette, backgroundColorPaletteNext, syncBlock, bodiedSyncBlock, tableWithNestedTable, tableRowWithNestedTable, tableCellWithNestedTable, tableHeaderWithNestedTable, tableRowWithLocalId, tableCellWithLocalId, tableHeaderWithLocalId, tableRowWithNestedTableWithLocalId, tableCellWithNestedTableWithLocalId, tableHeaderWithNestedTableWithLocalId } 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';
4
4
 
5
5
  // ADF createPMSpecFactory
@@ -6,10 +6,11 @@ import { blockContentGroup } from './groups/blockContentGroup';
6
6
  import { expand } from './nodes/expand';
7
7
  import { codeBlock } from './nodes/codeBlock';
8
8
  import { syncBlock } from './nodes/syncBlock';
9
+ import { bodiedSyncBlock } from './nodes/bodiedSyncBlock';
9
10
  var doc = adfNode('doc').define({
10
11
  root: true,
11
12
  version: 1,
12
- content: [$onePlus($or(blockGroup, blockContentGroup, codeBlock.use('root_only'), layoutSection, layoutSection.use('with_single_column'), layoutSection.use('full'), blockRootOnlyGroup, expand.use('root_only'), syncBlock))],
13
+ content: [$onePlus($or(blockGroup, blockContentGroup, codeBlock.use('root_only'), layoutSection, layoutSection.use('with_single_column'), layoutSection.use('full'), blockRootOnlyGroup, expand.use('root_only'), syncBlock, bodiedSyncBlock))],
13
14
  DANGEROUS_MANUAL_OVERRIDE: {
14
15
  'validator-spec': {
15
16
  'props.content.minItems': {