@atlaskit/adf-schema 49.0.6 → 49.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (181) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/cjs/index.js +114 -0
  3. package/dist/cjs/next-schema/generated/nodeTypes.js +118 -1
  4. package/dist/cjs/next-schema/nodes/blockCard.js +15 -0
  5. package/dist/cjs/next-schema/nodes/blockquote.js +16 -2
  6. package/dist/cjs/next-schema/nodes/caption.js +7 -0
  7. package/dist/cjs/next-schema/nodes/codeBlock.js +5 -0
  8. package/dist/cjs/next-schema/nodes/date.js +5 -0
  9. package/dist/cjs/next-schema/nodes/embedCard.js +5 -0
  10. package/dist/cjs/next-schema/nodes/emoji.js +5 -0
  11. package/dist/cjs/next-schema/nodes/expand.js +5 -0
  12. package/dist/cjs/next-schema/nodes/hardBreak.js +5 -0
  13. package/dist/cjs/next-schema/nodes/inlineCard.js +10 -0
  14. package/dist/cjs/next-schema/nodes/layoutColumn.js +5 -0
  15. package/dist/cjs/next-schema/nodes/layoutSection.js +12 -0
  16. package/dist/cjs/next-schema/nodes/list.js +20 -1
  17. package/dist/cjs/next-schema/nodes/media.js +10 -0
  18. package/dist/cjs/next-schema/nodes/mediaInline.js +5 -0
  19. package/dist/cjs/next-schema/nodes/mediaSingle.js +10 -0
  20. package/dist/cjs/next-schema/nodes/nestedExpand.js +5 -0
  21. package/dist/cjs/next-schema/nodes/panel.js +5 -0
  22. package/dist/cjs/next-schema/nodes/placeholder.js +5 -0
  23. package/dist/cjs/next-schema/nodes/rule.js +9 -1
  24. package/dist/cjs/schema/index.js +120 -0
  25. package/dist/cjs/schema/nodes/block-card.js +48 -1
  26. package/dist/cjs/schema/nodes/blockquote.js +20 -2
  27. package/dist/cjs/schema/nodes/bullet-list.js +20 -1
  28. package/dist/cjs/schema/nodes/caption.js +20 -1
  29. package/dist/cjs/schema/nodes/code-block.js +72 -2
  30. package/dist/cjs/schema/nodes/date.js +22 -1
  31. package/dist/cjs/schema/nodes/embed-card.js +36 -1
  32. package/dist/cjs/schema/nodes/emoji.js +73 -1
  33. package/dist/cjs/schema/nodes/expand.js +56 -1
  34. package/dist/cjs/schema/nodes/hard-break.js +18 -1
  35. package/dist/cjs/schema/nodes/index.js +120 -0
  36. package/dist/cjs/schema/nodes/inline-card.js +46 -1
  37. package/dist/cjs/schema/nodes/layout-column.js +37 -1
  38. package/dist/cjs/schema/nodes/layout-section.js +31 -1
  39. package/dist/cjs/schema/nodes/list-item.js +34 -1
  40. package/dist/cjs/schema/nodes/media-inline.js +12 -2
  41. package/dist/cjs/schema/nodes/media-single.js +22 -2
  42. package/dist/cjs/schema/nodes/media.js +21 -4
  43. package/dist/cjs/schema/nodes/nested-expand.js +34 -7
  44. package/dist/cjs/schema/nodes/ordered-list.js +54 -3
  45. package/dist/cjs/schema/nodes/panel.js +13 -5
  46. package/dist/cjs/schema/nodes/placeholder.js +24 -1
  47. package/dist/cjs/schema/nodes/rule.js +18 -1
  48. package/dist/cjs/validator-schema/generated/validatorSpec.js +142 -0
  49. package/dist/es2019/index.js +2 -2
  50. package/dist/es2019/next-schema/generated/nodeTypes.js +118 -1
  51. package/dist/es2019/next-schema/nodes/blockCard.js +15 -0
  52. package/dist/es2019/next-schema/nodes/blockquote.js +16 -2
  53. package/dist/es2019/next-schema/nodes/caption.js +7 -0
  54. package/dist/es2019/next-schema/nodes/codeBlock.js +5 -0
  55. package/dist/es2019/next-schema/nodes/date.js +5 -0
  56. package/dist/es2019/next-schema/nodes/embedCard.js +5 -0
  57. package/dist/es2019/next-schema/nodes/emoji.js +5 -0
  58. package/dist/es2019/next-schema/nodes/expand.js +5 -0
  59. package/dist/es2019/next-schema/nodes/hardBreak.js +5 -0
  60. package/dist/es2019/next-schema/nodes/inlineCard.js +10 -0
  61. package/dist/es2019/next-schema/nodes/layoutColumn.js +5 -0
  62. package/dist/es2019/next-schema/nodes/layoutSection.js +12 -0
  63. package/dist/es2019/next-schema/nodes/list.js +20 -1
  64. package/dist/es2019/next-schema/nodes/media.js +10 -0
  65. package/dist/es2019/next-schema/nodes/mediaInline.js +5 -0
  66. package/dist/es2019/next-schema/nodes/mediaSingle.js +10 -0
  67. package/dist/es2019/next-schema/nodes/nestedExpand.js +5 -0
  68. package/dist/es2019/next-schema/nodes/panel.js +5 -0
  69. package/dist/es2019/next-schema/nodes/placeholder.js +5 -0
  70. package/dist/es2019/next-schema/nodes/rule.js +9 -1
  71. package/dist/es2019/schema/index.js +1 -1
  72. package/dist/es2019/schema/nodes/block-card.js +50 -0
  73. package/dist/es2019/schema/nodes/blockquote.js +19 -1
  74. package/dist/es2019/schema/nodes/bullet-list.js +19 -0
  75. package/dist/es2019/schema/nodes/caption.js +19 -0
  76. package/dist/es2019/schema/nodes/code-block.js +68 -0
  77. package/dist/es2019/schema/nodes/date.js +19 -0
  78. package/dist/es2019/schema/nodes/embed-card.js +34 -0
  79. package/dist/es2019/schema/nodes/emoji.js +71 -0
  80. package/dist/es2019/schema/nodes/expand.js +59 -0
  81. package/dist/es2019/schema/nodes/hard-break.js +15 -0
  82. package/dist/es2019/schema/nodes/index.js +19 -19
  83. package/dist/es2019/schema/nodes/inline-card.js +45 -0
  84. package/dist/es2019/schema/nodes/layout-column.js +38 -0
  85. package/dist/es2019/schema/nodes/layout-section.js +32 -0
  86. package/dist/es2019/schema/nodes/list-item.js +29 -0
  87. package/dist/es2019/schema/nodes/media-inline.js +8 -1
  88. package/dist/es2019/schema/nodes/media-single.js +20 -1
  89. package/dist/es2019/schema/nodes/media.js +17 -4
  90. package/dist/es2019/schema/nodes/nested-expand.js +21 -6
  91. package/dist/es2019/schema/nodes/ordered-list.js +51 -2
  92. package/dist/es2019/schema/nodes/panel.js +11 -5
  93. package/dist/es2019/schema/nodes/placeholder.js +23 -0
  94. package/dist/es2019/schema/nodes/rule.js +15 -0
  95. package/dist/es2019/validator-schema/generated/validatorSpec.js +142 -0
  96. package/dist/esm/index.js +2 -2
  97. package/dist/esm/next-schema/generated/nodeTypes.js +118 -1
  98. package/dist/esm/next-schema/nodes/blockCard.js +15 -0
  99. package/dist/esm/next-schema/nodes/blockquote.js +16 -2
  100. package/dist/esm/next-schema/nodes/caption.js +7 -0
  101. package/dist/esm/next-schema/nodes/codeBlock.js +5 -0
  102. package/dist/esm/next-schema/nodes/date.js +5 -0
  103. package/dist/esm/next-schema/nodes/embedCard.js +5 -0
  104. package/dist/esm/next-schema/nodes/emoji.js +5 -0
  105. package/dist/esm/next-schema/nodes/expand.js +5 -0
  106. package/dist/esm/next-schema/nodes/hardBreak.js +5 -0
  107. package/dist/esm/next-schema/nodes/inlineCard.js +10 -0
  108. package/dist/esm/next-schema/nodes/layoutColumn.js +5 -0
  109. package/dist/esm/next-schema/nodes/layoutSection.js +12 -0
  110. package/dist/esm/next-schema/nodes/list.js +20 -1
  111. package/dist/esm/next-schema/nodes/media.js +10 -0
  112. package/dist/esm/next-schema/nodes/mediaInline.js +5 -0
  113. package/dist/esm/next-schema/nodes/mediaSingle.js +10 -0
  114. package/dist/esm/next-schema/nodes/nestedExpand.js +5 -0
  115. package/dist/esm/next-schema/nodes/panel.js +5 -0
  116. package/dist/esm/next-schema/nodes/placeholder.js +5 -0
  117. package/dist/esm/next-schema/nodes/rule.js +9 -1
  118. package/dist/esm/schema/index.js +1 -1
  119. package/dist/esm/schema/nodes/block-card.js +47 -0
  120. package/dist/esm/schema/nodes/blockquote.js +19 -1
  121. package/dist/esm/schema/nodes/bullet-list.js +19 -0
  122. package/dist/esm/schema/nodes/caption.js +19 -0
  123. package/dist/esm/schema/nodes/code-block.js +71 -1
  124. package/dist/esm/schema/nodes/date.js +21 -0
  125. package/dist/esm/schema/nodes/embed-card.js +35 -0
  126. package/dist/esm/schema/nodes/emoji.js +71 -0
  127. package/dist/esm/schema/nodes/expand.js +55 -0
  128. package/dist/esm/schema/nodes/hard-break.js +17 -0
  129. package/dist/esm/schema/nodes/index.js +19 -19
  130. package/dist/esm/schema/nodes/inline-card.js +45 -0
  131. package/dist/esm/schema/nodes/layout-column.js +36 -0
  132. package/dist/esm/schema/nodes/layout-section.js +30 -0
  133. package/dist/esm/schema/nodes/list-item.js +33 -0
  134. package/dist/esm/schema/nodes/media-inline.js +10 -1
  135. package/dist/esm/schema/nodes/media-single.js +21 -1
  136. package/dist/esm/schema/nodes/media.js +19 -3
  137. package/dist/esm/schema/nodes/nested-expand.js +32 -6
  138. package/dist/esm/schema/nodes/ordered-list.js +53 -2
  139. package/dist/esm/schema/nodes/panel.js +12 -4
  140. package/dist/esm/schema/nodes/placeholder.js +23 -0
  141. package/dist/esm/schema/nodes/rule.js +17 -0
  142. package/dist/esm/validator-schema/generated/validatorSpec.js +142 -0
  143. package/dist/json-schema/v1/full.json +125 -2
  144. package/dist/json-schema/v1/stage-0.json +137 -2
  145. package/dist/types/index.d.ts +2 -2
  146. package/dist/types/next-schema/generated/nodeTypes.d.ts +62 -0
  147. package/dist/types/next-schema/groups/nonNestableBlockContentGroup.d.ts +7 -0
  148. package/dist/types/next-schema/groups/tableCellContentPseudoGroup.d.ts +7 -0
  149. package/dist/types/next-schema/nodes/blockquote.d.ts +7 -0
  150. package/dist/types/next-schema/nodes/layoutSection.d.ts +5 -0
  151. package/dist/types/schema/index.d.ts +1 -1
  152. package/dist/types/schema/nodes/block-card.d.ts +4 -0
  153. package/dist/types/schema/nodes/blockquote.d.ts +4 -0
  154. package/dist/types/schema/nodes/bullet-list.d.ts +1 -0
  155. package/dist/types/schema/nodes/caption.d.ts +4 -0
  156. package/dist/types/schema/nodes/code-block.d.ts +2 -0
  157. package/dist/types/schema/nodes/date.d.ts +2 -0
  158. package/dist/types/schema/nodes/embed-card.d.ts +2 -0
  159. package/dist/types/schema/nodes/emoji.d.ts +2 -0
  160. package/dist/types/schema/nodes/expand.d.ts +2 -0
  161. package/dist/types/schema/nodes/hard-break.d.ts +2 -0
  162. package/dist/types/schema/nodes/index.d.ts +19 -19
  163. package/dist/types/schema/nodes/inline-card.d.ts +1 -0
  164. package/dist/types/schema/nodes/layout-column.d.ts +2 -0
  165. package/dist/types/schema/nodes/layout-section.d.ts +4 -0
  166. package/dist/types/schema/nodes/list-item.d.ts +2 -0
  167. package/dist/types/schema/nodes/media-inline.d.ts +1 -0
  168. package/dist/types/schema/nodes/media-single.d.ts +3 -1
  169. package/dist/types/schema/nodes/media.d.ts +3 -1
  170. package/dist/types/schema/nodes/nested-expand.d.ts +2 -0
  171. package/dist/types/schema/nodes/ordered-list.d.ts +2 -0
  172. package/dist/types/schema/nodes/panel.d.ts +2 -0
  173. package/dist/types/schema/nodes/placeholder.d.ts +2 -0
  174. package/dist/types/schema/nodes/rule.d.ts +4 -0
  175. package/dist/types/schema/nodes/types/list.d.ts +7 -0
  176. package/dist/types/schema/nodes/types/rich-media-common.d.ts +1 -0
  177. package/dist/types/validator-schema/generated/validatorSpec.d.ts +142 -0
  178. package/json-schema/v1/full.json +125 -2
  179. package/json-schema/v1/stage-0.json +137 -2
  180. package/package.json +2 -2
  181. package/schema-generators/__tests__/unit/adfToValidatorSpec.unit.ts +1 -0
@@ -1,4 +1,4 @@
1
- export { PanelType, blockCard, blockquote, extendedBlockquote, bodiedExtension, bulletList, bulletListSelector, caption, codeBlock, codeBlockToJSON, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, date, decisionItem, decisionList, decisionListSelector, doc, embedCard, emoji, expandWithNestedExpand, expandToJSON, extension, hardBreak, heading, image, inlineCard, inlineExtension, layoutColumn, layoutSection, layoutSectionWithSingleColumn, listItem, listItemWithDecisionStage0, media, mediaGroup, mediaSingle, mediaSingleSpec, mediaInline, mediaSingleWithCaption, mediaSingleWithWidthType, mediaSingleFull, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, orderedList, orderedListSelector, orderedListWithOrder, 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, tableWithNestedTable, tableRowWithNestedTable, tableCellWithNestedTable, tableHeaderWithNestedTable } 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, hardBreakWithLocalId, heading, image, inlineCard, inlineCardWithLocalId, inlineExtension, layoutColumn, layoutColumnWithLocalId, layoutSection, layoutSectionWithSingleColumn, layoutSectionWithSingleColumnLocalId, listItem, listItemWithDecisionStage0, 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, taskList, taskListSelector, text, toJSONTableCell, toJSONTableHeader, unknownBlock, unsupportedBlock, unsupportedInline, extensionFrame, multiBodiedExtension, tableWithNestedTable, tableRowWithNestedTable, tableCellWithNestedTable, tableHeaderWithNestedTable } 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';
@@ -2,6 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
3
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
4
  import { blockCard as blockCardFactory } from '../../next-schema/generated/nodeTypes';
5
+ import { uuid } from '../../utils';
5
6
 
6
7
  /**
7
8
  * @name blockCard_node
@@ -58,4 +59,50 @@ export var blockCard = blockCardFactory({
58
59
  };
59
60
  return ['a', attrs, (node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.url) || ' '];
60
61
  }
62
+ });
63
+ export var blockCardWithLocalId = blockCardFactory({
64
+ parseDOM: [{
65
+ tag: 'a[data-block-card]',
66
+ // bump priority higher than hyperlink
67
+ priority: 100,
68
+ getAttrs: function getAttrs(dom) {
69
+ var anchor = dom;
70
+ return _objectSpread(_objectSpread({
71
+ url: anchor.getAttribute('href') || undefined
72
+ }, getCommonAttributesFromDom(dom)), {}, {
73
+ localId: uuid.generate()
74
+ });
75
+ }
76
+ }, {
77
+ tag: 'div[data-block-card]',
78
+ getAttrs: function getAttrs(dom) {
79
+ var anchor = dom;
80
+ return _objectSpread(_objectSpread({
81
+ url: anchor.getAttribute('data-card-url') || undefined
82
+ }, getCommonAttributesFromDom(dom)), {}, {
83
+ localId: uuid.generate()
84
+ });
85
+ }
86
+ }],
87
+ toDOM: function toDOM(node) {
88
+ var _node$attrs2, _node$attrs3;
89
+ var _ref4 = node.attrs,
90
+ url = _ref4.url;
91
+ var _ref5 = node.attrs,
92
+ data = _ref5.data;
93
+ var _ref6 = node.attrs,
94
+ layout = _ref6.layout,
95
+ width = _ref6.width,
96
+ datasource = _ref6.datasource;
97
+ var attrs = {
98
+ 'data-block-card': '',
99
+ href: url || '',
100
+ 'data-card-data': data ? JSON.stringify(data) : '',
101
+ 'data-datasource': datasource ? JSON.stringify(datasource) : '',
102
+ 'data-layout': layout,
103
+ 'data-width': "".concat(width),
104
+ 'data-local-id': (node === null || node === void 0 ? void 0 : (_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.localId) || undefined
105
+ };
106
+ return ['a', attrs, (node === null || node === void 0 ? void 0 : (_node$attrs3 = node.attrs) === null || _node$attrs3 === void 0 ? void 0 : _node$attrs3.url) || ' '];
107
+ }
61
108
  });
@@ -1,5 +1,6 @@
1
1
  import { blockquote as blockquoteFactory } from '../../next-schema/generated/nodeTypes';
2
2
  import { blockquoteLegacy as blockquoteLegacyFactory } from '../../next-schema/generated/nodeTypes';
3
+ import { uuid } from '../../utils';
3
4
 
4
5
  /**
5
6
  * @name blockquote_node
@@ -19,4 +20,21 @@ export var blockquote = blockquoteLegacyFactory(nodeSpecOptions);
19
20
  * @name extentedBlockquote
20
21
  * @description the block quote node with nested code block, media, and extension
21
22
  */
22
- export var extendedBlockquote = blockquoteFactory(nodeSpecOptions);
23
+ export var extendedBlockquote = blockquoteFactory(nodeSpecOptions);
24
+ var nodeSpecOptionsWithLocalId = {
25
+ parseDOM: [{
26
+ tag: 'blockquote',
27
+ getAttrs: function getAttrs() {
28
+ return {
29
+ localId: uuid.generate()
30
+ };
31
+ }
32
+ }],
33
+ toDOM: function toDOM(node) {
34
+ var _node$attrs;
35
+ return ['blockquote', {
36
+ 'data-local-id': (node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.localId) || undefined
37
+ }, 0];
38
+ }
39
+ };
40
+ export var extendedBlockquoteWithLocalId = blockquoteFactory(nodeSpecOptionsWithLocalId);
@@ -1,3 +1,4 @@
1
+ import { uuid } from '../../utils';
1
2
  import { bulletList as bulletListFactory } from '../../next-schema/generated/nodeTypes';
2
3
  export var bulletListSelector = '.ak-ul';
3
4
  export var bulletList = bulletListFactory({
@@ -10,4 +11,22 @@ export var bulletList = bulletListFactory({
10
11
  };
11
12
  return ['ul', attrs, 0];
12
13
  }
14
+ });
15
+ export var bulletListWithLocalId = bulletListFactory({
16
+ parseDOM: [{
17
+ tag: 'ul',
18
+ getAttrs: function getAttrs() {
19
+ return {
20
+ localId: uuid.generate()
21
+ };
22
+ }
23
+ }],
24
+ toDOM: function toDOM(node) {
25
+ var _node$attrs;
26
+ var attrs = {
27
+ class: bulletListSelector.substr(1),
28
+ 'data-local-id': (node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.localId) || undefined
29
+ };
30
+ return ['ul', attrs, 0];
31
+ }
13
32
  });
@@ -1,4 +1,5 @@
1
1
  import { caption as captionFactory } from '../../next-schema/generated/nodeTypes';
2
+ import { uuid } from '../../utils';
2
3
 
3
4
  /**
4
5
  * @name caption_node
@@ -14,4 +15,22 @@ export var caption = captionFactory({
14
15
  };
15
16
  return ['figcaption', attrs, 0];
16
17
  }
18
+ });
19
+ export var captionWithLocalId = captionFactory({
20
+ parseDOM: [{
21
+ tag: 'figcaption[data-caption]',
22
+ getAttrs: function getAttrs() {
23
+ return {
24
+ localId: uuid.generate()
25
+ };
26
+ }
27
+ }],
28
+ toDOM: function toDOM(node) {
29
+ var _node$attrs;
30
+ var attrs = {
31
+ 'data-caption': 'true',
32
+ 'data-local-id': (node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.localId) || undefined
33
+ };
34
+ return ['figcaption', attrs, 0];
35
+ }
17
36
  });
@@ -1,5 +1,6 @@
1
1
  import { Fragment } from '@atlaskit/editor-prosemirror/model';
2
2
  import { codeBlock as codeBlockFactory } from '../../next-schema/generated/nodeTypes';
3
+ import { uuid } from '../../utils';
3
4
 
4
5
  /**
5
6
  * @name codeBlock_with_no_marks_node
@@ -145,4 +146,73 @@ export var toJSON = function toJSON(node) {
145
146
  return memo;
146
147
  }, {})
147
148
  };
148
- };
149
+ };
150
+ export var codeBlockWithLocalId = codeBlockFactory({
151
+ parseDOM: [{
152
+ tag: 'pre',
153
+ preserveWhitespace: 'full',
154
+ getAttrs: function getAttrs(domNode) {
155
+ var dom = domNode;
156
+ var language = getLanguageFromBitbucketStyle(dom.parentElement) || getLanguageFromEditorStyle(dom.parentElement) || getLanguageFromCode(dom) || dom.getAttribute('data-language');
157
+ dom = removeLastNewLine(dom);
158
+ return {
159
+ language: language,
160
+ localId: uuid.generate()
161
+ };
162
+ }
163
+ },
164
+ // Handle VSCode, Android Studio paste
165
+ // Checking `white-space: pre-wrap` is too aggressive @see ED-2627
166
+ {
167
+ tag: 'div[style]',
168
+ preserveWhitespace: 'full',
169
+ getAttrs: function getAttrs(domNode) {
170
+ var dom = domNode;
171
+ if (dom.style.whiteSpace === 'pre' || dom.style.fontFamily && dom.style.fontFamily.toLowerCase().indexOf('monospace') > -1) {
172
+ return {};
173
+ }
174
+ return false;
175
+ },
176
+ getContent: function getContent(domNode, schema) {
177
+ var code = parseCodeFromHtml(domNode);
178
+ return code ? Fragment.from(schema.text(code)) : Fragment.empty;
179
+ }
180
+ },
181
+ // Handle GitHub/Gist paste
182
+ {
183
+ tag: 'table[style]',
184
+ preserveWhitespace: 'full',
185
+ getAttrs: function getAttrs(dom) {
186
+ if (dom.querySelector('td[class*="blob-code"]')) {
187
+ return {};
188
+ }
189
+ return false;
190
+ }
191
+ }, {
192
+ tag: 'div.code-block',
193
+ preserveWhitespace: 'full',
194
+ getAttrs: function getAttrs(domNode) {
195
+ var dom = domNode;
196
+ // TODO: ED-5604 Fix it inside `react-syntax-highlighter`
197
+ // Remove line numbers
198
+ var lineNumber = dom.querySelectorAll('.react-syntax-highlighter-line-number');
199
+ if (lineNumber.length > 0) {
200
+ // It's possible to copy without the line numbers too hence this
201
+ // `react-syntax-highlighter-line-number` check, so that we don't remove real code
202
+ lineNumber.forEach(function (line) {
203
+ return line.remove();
204
+ });
205
+ }
206
+ return {};
207
+ }
208
+ }],
209
+ toDOM: function toDOM(node) {
210
+ var _node$attrs;
211
+ var attrs = {
212
+ 'data-local-id': (node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.localId) || undefined
213
+ };
214
+ return ['pre', attrs, ['code', {
215
+ 'data-language': node.attrs.language
216
+ }, 0]];
217
+ }
218
+ });
@@ -1,4 +1,5 @@
1
1
  import { date as dateFactory } from '../../next-schema/generated/nodeTypes';
2
+ import { uuid } from '../../utils';
2
3
 
3
4
  /**
4
5
  * @name date_node
@@ -20,4 +21,24 @@ export var date = dateFactory({
20
21
  };
21
22
  return ['span', attrs];
22
23
  }
24
+ });
25
+ export var dateWithLocalId = dateFactory({
26
+ parseDOM: [{
27
+ tag: 'span[data-node-type="date"]',
28
+ getAttrs: function getAttrs(dom) {
29
+ return {
30
+ timestamp: dom.getAttribute('data-timestamp'),
31
+ localId: uuid.generate()
32
+ };
33
+ }
34
+ }],
35
+ toDOM: function toDOM(node) {
36
+ var _node$attrs;
37
+ var attrs = {
38
+ 'data-node-type': 'date',
39
+ 'data-timestamp': node.attrs.timestamp,
40
+ 'data-local-id': (node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.localId) || undefined
41
+ };
42
+ return ['span', attrs];
43
+ }
23
44
  });
@@ -1,4 +1,5 @@
1
1
  import { embedCard as embedCardFactory } from '../../next-schema/generated/nodeTypes';
2
+ import { uuid } from '../../utils/uuid';
2
3
 
3
4
  /**
4
5
  * @name embedCard_node
@@ -34,4 +35,38 @@ export var embedCard = embedCardFactory({
34
35
  };
35
36
  return ['div', attrs];
36
37
  }
38
+ });
39
+ export var embedCardWithLocalId = embedCardFactory({
40
+ parseDOM: [{
41
+ tag: 'div[data-embed-card]',
42
+ getAttrs: function getAttrs(dom) {
43
+ return {
44
+ url: dom.getAttribute('data-card-url'),
45
+ layout: dom.getAttribute('data-layout') || 'center',
46
+ width: Number(dom.getAttribute('data-width')) || null,
47
+ originalWidth: Number(dom.getAttribute('data-card-original-width')) || null,
48
+ originalHeight: Number(dom.getAttribute('data-card-original-height')) || null,
49
+ localId: uuid.generate()
50
+ };
51
+ }
52
+ }],
53
+ toDOM: function toDOM(node) {
54
+ var _node$attrs3;
55
+ var _node$attrs2 = node.attrs,
56
+ url = _node$attrs2.url,
57
+ layout = _node$attrs2.layout,
58
+ width = _node$attrs2.width,
59
+ originalWidth = _node$attrs2.originalWidth,
60
+ originalHeight = _node$attrs2.originalHeight;
61
+ var attrs = {
62
+ 'data-embed-card': '',
63
+ 'data-card-url': url,
64
+ 'data-layout': layout,
65
+ 'data-width': width,
66
+ 'data-original-width': originalWidth,
67
+ 'data-original-height': originalHeight,
68
+ 'data-local-id': (node === null || node === void 0 ? void 0 : (_node$attrs3 = node.attrs) === null || _node$attrs3 === void 0 ? void 0 : _node$attrs3.localId) || undefined
69
+ };
70
+ return ['div', attrs];
71
+ }
37
72
  });
@@ -1,5 +1,9 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
1
4
  import { acNameToEmoji, acShortcutToEmoji } from '../../utils/confluence/emoji';
2
5
  import { emoji as emojiFactory } from '../../next-schema/generated/nodeTypes';
6
+ import { uuid } from '../../utils/uuid';
3
7
 
4
8
  /**
5
9
  * @name emoji_node
@@ -61,4 +65,71 @@ export var emoji = emojiFactory({
61
65
  };
62
66
  return ['span', attrs, text];
63
67
  }
68
+ });
69
+ export var emojiWithLocalId = emojiFactory({
70
+ parseDOM: [
71
+ // Handle copy/paste beautiful panel from renderer />
72
+ {
73
+ tag: 'div.ak-editor-panel__icon span',
74
+ ignore: true
75
+ }, {
76
+ tag: 'span[data-emoji-short-name]',
77
+ getAttrs: function getAttrs(domNode) {
78
+ var dom = domNode;
79
+ return {
80
+ shortName: dom.getAttribute('data-emoji-short-name') || emoji.attrs.shortName.default,
81
+ id: dom.getAttribute('data-emoji-id') || emoji.attrs.id.default,
82
+ text: dom.getAttribute('data-emoji-text') || emoji.attrs.text.default,
83
+ localId: uuid.generate()
84
+ };
85
+ }
86
+ },
87
+ // Handle copy/paste from old <ac:emoticon />
88
+ {
89
+ tag: 'img[data-emoticon-name]',
90
+ getAttrs: function getAttrs(dom) {
91
+ var attrs = acNameToEmoji(dom.getAttribute('data-emoticon-name'));
92
+ return _objectSpread(_objectSpread({}, attrs), {}, {
93
+ localId: uuid.generate()
94
+ });
95
+ }
96
+ },
97
+ // Handle copy/paste from old <ac:hipchat-emoticons />
98
+ {
99
+ tag: 'img[data-hipchat-emoticon]',
100
+ getAttrs: function getAttrs(dom) {
101
+ var attrs = acShortcutToEmoji(dom.getAttribute('data-hipchat-emoticon'));
102
+ return _objectSpread(_objectSpread({}, attrs), {}, {
103
+ localId: uuid.generate()
104
+ });
105
+ }
106
+ },
107
+ // Handle copy/paste from bitbucket's <img class="emoji" />
108
+ {
109
+ tag: 'img.emoji[data-emoji-short-name]',
110
+ getAttrs: function getAttrs(domNode) {
111
+ var dom = domNode;
112
+ return {
113
+ shortName: dom.getAttribute('data-emoji-short-name') || emoji.attrs.shortName.default,
114
+ id: dom.getAttribute('data-emoji-id') || emoji.attrs.id.default,
115
+ text: dom.getAttribute('data-emoji-text') || emoji.attrs.text.default,
116
+ localId: uuid.generate()
117
+ };
118
+ }
119
+ }],
120
+ toDOM: function toDOM(node) {
121
+ var _node$attrs3;
122
+ var _node$attrs2 = node.attrs,
123
+ shortName = _node$attrs2.shortName,
124
+ id = _node$attrs2.id,
125
+ text = _node$attrs2.text;
126
+ var attrs = {
127
+ 'data-emoji-short-name': shortName,
128
+ 'data-emoji-id': id,
129
+ 'data-emoji-text': text,
130
+ contenteditable: 'false',
131
+ 'data-local-id': (node === null || node === void 0 ? void 0 : (_node$attrs3 = node.attrs) === null || _node$attrs3 === void 0 ? void 0 : _node$attrs3.localId) || undefined
132
+ };
133
+ return ['span', attrs, text];
134
+ }
64
135
  });
@@ -2,6 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
3
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
4
  import { expand as expandFactory } from '../../next-schema/generated/nodeTypes';
5
+ import { uuid } from '../../utils/uuid';
5
6
 
6
7
  /**
7
8
  * @name expand_node
@@ -55,6 +56,60 @@ var nodeSpecOptions = {
55
56
  }
56
57
  };
57
58
  export var expandWithNestedExpand = expandFactory(nodeSpecOptions);
59
+ export var expandWithNestedExpandLocalId = expandFactory({
60
+ parseDOM: [{
61
+ context: 'table//',
62
+ tag: 'div[data-node-type="expand"]',
63
+ getAttrs: function getAttrs(dom) {
64
+ var attrs = getExpandAttrs(dom);
65
+ return _objectSpread(_objectSpread({}, attrs), {}, {
66
+ localId: uuid.generate()
67
+ });
68
+ }
69
+ }, {
70
+ context: 'expand//',
71
+ tag: '[data-node-type="expand"]',
72
+ getAttrs: function getAttrs(dom) {
73
+ var attrs = getExpandAttrs(dom);
74
+ return _objectSpread(_objectSpread({}, attrs), {}, {
75
+ localId: uuid.generate()
76
+ });
77
+ }
78
+ }, {
79
+ context: 'nestedExpand//',
80
+ tag: '[data-node-type="expand"]',
81
+ getAttrs: function getAttrs(dom) {
82
+ var attrs = getExpandAttrs(dom);
83
+ return _objectSpread(_objectSpread({}, attrs), {}, {
84
+ localId: uuid.generate()
85
+ });
86
+ }
87
+ }, {
88
+ tag: '[data-node-type="nestedExpand"] button',
89
+ ignore: true
90
+ }, {
91
+ tag: '[data-node-type="expand"] button',
92
+ ignore: true
93
+ }, {
94
+ tag: 'div[data-node-type="expand"]',
95
+ getAttrs: function getAttrs(dom) {
96
+ var attrs = getExpandAttrs(dom);
97
+ return _objectSpread(_objectSpread({}, attrs), {}, {
98
+ localId: uuid.generate()
99
+ });
100
+ }
101
+ }],
102
+ toDOM: function toDOM(node) {
103
+ var _node$attrs;
104
+ var attrs = {
105
+ 'data-node-type': 'expand',
106
+ 'data-title': node.attrs.title,
107
+ 'data-expanded': node.attrs.__expanded,
108
+ 'data-local-id': (node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.localId) || undefined
109
+ };
110
+ return ['div', attrs, 0];
111
+ }
112
+ });
58
113
  export var toJSON = function toJSON(node) {
59
114
  return {
60
115
  attrs: Object.keys(node.attrs).filter(function (key) {
@@ -1,3 +1,4 @@
1
+ import { uuid } from '../../utils/uuid';
1
2
  import { hardBreak as hardBreakFactory } from '../../next-schema/generated/nodeTypes';
2
3
 
3
4
  /**
@@ -11,4 +12,20 @@ export var hardBreak = hardBreakFactory({
11
12
  toDOM: function toDOM() {
12
13
  return ['br'];
13
14
  }
15
+ });
16
+ export var hardBreakWithLocalId = hardBreakFactory({
17
+ parseDOM: [{
18
+ tag: 'br',
19
+ getAttrs: function getAttrs() {
20
+ return {
21
+ localId: uuid.generate()
22
+ };
23
+ }
24
+ }],
25
+ toDOM: function toDOM(node) {
26
+ var _node$attrs;
27
+ return ['br', {
28
+ 'data-local-id': (node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.localId) || undefined
29
+ }];
30
+ }
14
31
  });
@@ -1,44 +1,44 @@
1
- export { expandWithNestedExpand, toJSON as expandToJSON } from './expand';
1
+ export { expandWithNestedExpand, expandWithNestedExpandLocalId, toJSON as expandToJSON } from './expand';
2
2
  export { confluenceJiraIssue } from './confluence-jira-issue';
3
3
  export { confluenceUnsupportedBlock } from './confluence-unsupported-block';
4
4
  export { confluenceUnsupportedInline } from './confluence-unsupported-inline';
5
5
  export { doc } from './doc';
6
- export { blockquote, extendedBlockquote } from './blockquote';
7
- export { bulletList, bulletListSelector } from './bullet-list';
8
- export { codeBlock, toJSON as codeBlockToJSON } from './code-block';
9
- export { hardBreak } from './hard-break';
6
+ export { blockquote, extendedBlockquote, extendedBlockquoteWithLocalId } from './blockquote';
7
+ export { bulletList, bulletListSelector, bulletListWithLocalId } from './bullet-list';
8
+ export { codeBlock, codeBlockWithLocalId, toJSON as codeBlockToJSON } from './code-block';
9
+ export { hardBreak, hardBreakWithLocalId } from './hard-break';
10
10
  export { heading } from './heading';
11
- export { rule } from './rule';
12
- export { orderedList, orderedListSelector, orderedListWithOrder } from './ordered-list';
11
+ export { rule, ruleWithLocalId } from './rule';
12
+ export { orderedList, orderedListSelector, orderedListWithLocalId, orderedListWithOrder, orderedListWithOrderAndLocalId } from './ordered-list';
13
13
  export { paragraph } from './paragraph';
14
- export { emoji } from './emoji';
14
+ export { emoji, emojiWithLocalId } from './emoji';
15
15
  export { image } from './image';
16
16
  export { mention, toJSON as mentionToJSON } from './mention';
17
17
  export { listItem, listItemWithDecisionStage0 } from './list-item';
18
- export { extendedPanel, PanelType } from './panel';
18
+ export { extendedPanel, extendedPanelWithLocalId, PanelType } from './panel';
19
19
  export { text } from './text';
20
20
  export { default as unknownBlock } from './unknown-block';
21
- export { caption } from './caption';
21
+ export { caption, captionWithLocalId } from './caption';
22
22
  export { media, copyPrivateAttributes as copyPrivateMediaAttributes, toJSON as mediaToJSON } from './media';
23
23
  export { mediaGroup } from './media-group';
24
24
  export { mediaInline } from './media-inline';
25
- export { mediaSingle, mediaSingleSpec, mediaSingleWithCaption, mediaSingleWithWidthType, mediaSingleFull, toJSON as mediaSingleToJSON } from './media-single';
25
+ export { mediaSingle, mediaSingleSpec, mediaSingleWithCaption, mediaSingleWithWidthType, mediaSingleFull, mediaSingleFullWithLocalId, toJSON as mediaSingleToJSON } from './media-single';
26
26
  export { table, tableWithNestedTable, tableRowWithNestedTable, tableCellWithNestedTable, tableHeaderWithNestedTable, tableStage0, tableWithCustomWidth, tableToJSON, tableCell, toJSONTableCell, tableHeader, toJSONTableHeader, tableRow, tableBackgroundColorPalette, tableBackgroundBorderColor, tableBackgroundColorNames, getCellAttrs, getCellDomAttrs, tablePrefixSelector, tableCellSelector, tableHeaderSelector, tableCellContentWrapperSelector, tableCellContentDomSelector } from './tableNodes';
27
27
  export { decisionList, decisionListSelector } from './decision-list';
28
28
  export { decisionItem } from './decision-item';
29
29
  export { taskList, taskListSelector } from './task-list';
30
30
  export { taskItem } from './task-item';
31
- export { date } from './date';
32
- export { placeholder } from './placeholder';
33
- export { layoutSection, layoutSectionWithSingleColumn } from './layout-section';
34
- export { layoutColumn } from './layout-column';
35
- export { inlineCard } from './inline-card';
36
- export { blockCard } from './block-card';
31
+ export { date, dateWithLocalId } from './date';
32
+ export { placeholder, placeholderWithLocalId } from './placeholder';
33
+ export { layoutSection, layoutSectionWithSingleColumn, layoutSectionWithSingleColumnLocalId } from './layout-section';
34
+ export { layoutColumn, layoutColumnWithLocalId } from './layout-column';
35
+ export { inlineCard, inlineCardWithLocalId } from './inline-card';
36
+ export { blockCard, blockCardWithLocalId } from './block-card';
37
37
  export { unsupportedBlock } from './unsupported-block';
38
38
  export { unsupportedInline } from './unsupported-inline';
39
39
  export { status } from './status';
40
- export { nestedExpand } from './nested-expand';
41
- export { embedCard } from './embed-card';
40
+ export { nestedExpand, nestedExpandWithLocalId } from './nested-expand';
41
+ export { embedCard, embedCardWithLocalId } from './embed-card';
42
42
  // Extensions
43
43
  export { extension } from './extension';
44
44
  export { inlineExtension } from './inline-extension';
@@ -1,4 +1,5 @@
1
1
  import { inlineCard as inlineCardFactory } from '../../next-schema/generated/nodeTypes';
2
+ import { uuid } from '../../utils/uuid';
2
3
 
3
4
  /**
4
5
  * @name inlineCard_node
@@ -44,4 +45,48 @@ export var inlineCard = inlineCardFactory({
44
45
  return ['a', attrs];
45
46
  }
46
47
  }
48
+ });
49
+ export var inlineCardWithLocalId = inlineCardFactory({
50
+ parseDOM: [{
51
+ tag: 'a[data-inline-card], span[data-inline-card]',
52
+ // bump priority higher than hyperlink
53
+ priority: 100,
54
+ getAttrs: function getAttrs(dom) {
55
+ var anchor = dom;
56
+ var data = anchor.getAttribute('data-card-data');
57
+
58
+ /* Support attrs from Editor and Renderer */
59
+ return {
60
+ url: anchor.getAttribute('href') || anchor.getAttribute('data-card-url') || null,
61
+ data: data ? JSON.parse(data) : null
62
+ };
63
+ }
64
+ },
65
+ // for renderer
66
+ {
67
+ tag: 'div[data-inline-card]',
68
+ getAttrs: function getAttrs(dom) {
69
+ var anchor = dom;
70
+ var data = anchor.getAttribute('data-card-data');
71
+ return {
72
+ url: anchor.getAttribute('data-card-url'),
73
+ data: data ? JSON.parse(data) : null,
74
+ localId: uuid.generate()
75
+ };
76
+ }
77
+ }],
78
+ toDOM: function toDOM(node) {
79
+ var _node$attrs;
80
+ var attrs = {
81
+ 'data-inline-card': '',
82
+ href: node.attrs.url || '',
83
+ 'data-card-data': node.attrs.data ? JSON.stringify(node.attrs.data) : '',
84
+ 'data-local-id': (node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.localId) || undefined
85
+ };
86
+ if (node.attrs.url) {
87
+ return ['a', attrs, node.attrs.url];
88
+ } else {
89
+ return ['a', attrs];
90
+ }
91
+ }
47
92
  });
@@ -1,4 +1,5 @@
1
1
  import { layoutColumn as layoutColumnFactory } from '../../next-schema/generated/nodeTypes';
2
+ import { uuid } from '../../utils/uuid';
2
3
 
3
4
  /**
4
5
  * @name layoutColumn_node
@@ -28,6 +29,41 @@ export var layoutColumn = layoutColumnFactory({
28
29
  attrs['data-column-width'] = "".concat(width);
29
30
  }
30
31
 
32
+ // We need to apply a attribute to the inner most child to help
33
+ // ProseMirror identify its boundaries better.
34
+ var contentAttrs = {
35
+ 'data-layout-content': 'true'
36
+ };
37
+ return ['div', attrs, ['div', contentAttrs, 0]];
38
+ }
39
+ });
40
+ export var layoutColumnWithLocalId = layoutColumnFactory({
41
+ parseDOM: [{
42
+ context: 'layoutColumn//',
43
+ tag: 'div[data-layout-column]',
44
+ skip: true
45
+ }, {
46
+ tag: 'div[data-layout-column]',
47
+ getAttrs: function getAttrs(domNode) {
48
+ var dom = domNode;
49
+ return {
50
+ width: Number(dom.getAttribute('data-column-width')) || undefined,
51
+ localId: uuid.generate()
52
+ };
53
+ }
54
+ }],
55
+ toDOM: function toDOM(node) {
56
+ var _node$attrs;
57
+ var attrs = {
58
+ 'data-layout-column': 'true',
59
+ 'data-local-id': (node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.localId) || undefined
60
+ };
61
+ var width = node.attrs.width;
62
+ if (width) {
63
+ attrs['style'] = "flex-basis: ".concat(width, "%");
64
+ attrs['data-column-width'] = "".concat(width);
65
+ }
66
+
31
67
  // We need to apply a attribute to the inner most child to help
32
68
  // ProseMirror identify its boundaries better.
33
69
  var contentAttrs = {