@atlaskit/adf-schema 37.2.1 → 38.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (361) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/cjs/index.js +12 -0
  3. package/dist/cjs/next-schema/generated/markTypes.js +21 -21
  4. package/dist/cjs/next-schema/generated/nodeTypes.js +114 -114
  5. package/dist/cjs/next-schema/groups/nonNestableBlockContentGroup.js +1 -1
  6. package/dist/cjs/next-schema/groups/tableCellContentPseudoGroup.js +1 -1
  7. package/dist/cjs/next-schema/nodes/blockCard.js +1 -1
  8. package/dist/cjs/next-schema/nodes/blockquote.js +2 -2
  9. package/dist/cjs/next-schema/nodes/bodiedExtension.js +2 -2
  10. package/dist/cjs/next-schema/nodes/caption.js +1 -1
  11. package/dist/cjs/next-schema/nodes/codeBlock.js +2 -2
  12. package/dist/cjs/next-schema/nodes/decisionItem.js +1 -1
  13. package/dist/cjs/next-schema/nodes/decisionList.js +1 -1
  14. package/dist/cjs/next-schema/nodes/embedCard.js +1 -1
  15. package/dist/cjs/next-schema/nodes/expand.js +2 -2
  16. package/dist/cjs/next-schema/nodes/extension.js +2 -2
  17. package/dist/cjs/next-schema/nodes/extensionFrame.js +2 -2
  18. package/dist/cjs/next-schema/nodes/hardBreak.js +1 -1
  19. package/dist/cjs/next-schema/nodes/heading.js +3 -3
  20. package/dist/cjs/next-schema/nodes/inlineCard.js +2 -2
  21. package/dist/cjs/next-schema/nodes/inlineExtension.js +2 -2
  22. package/dist/cjs/next-schema/nodes/layoutColumn.js +1 -1
  23. package/dist/cjs/next-schema/nodes/layoutSection.js +2 -2
  24. package/dist/cjs/next-schema/nodes/list.js +5 -5
  25. package/dist/cjs/next-schema/nodes/media.js +1 -1
  26. package/dist/cjs/next-schema/nodes/mediaGroup.js +1 -1
  27. package/dist/cjs/next-schema/nodes/mediaInline.js +1 -1
  28. package/dist/cjs/next-schema/nodes/mediaSingle.js +5 -5
  29. package/dist/cjs/next-schema/nodes/nestedExpand.js +2 -2
  30. package/dist/cjs/next-schema/nodes/panel.js +3 -3
  31. package/dist/cjs/next-schema/nodes/paragraph.js +4 -4
  32. package/dist/cjs/next-schema/nodes/placeholder.js +1 -1
  33. package/dist/cjs/next-schema/nodes/table.js +1 -1
  34. package/dist/cjs/next-schema/nodes/tableCell.js +1 -1
  35. package/dist/cjs/next-schema/nodes/tableHeader.js +1 -1
  36. package/dist/cjs/next-schema/nodes/tableRow.js +1 -1
  37. package/dist/cjs/next-schema/nodes/task.js +2 -2
  38. package/dist/cjs/next-schema/nodes/text.js +1 -1
  39. package/dist/cjs/schema/createPMSpecFactory.js +57 -0
  40. package/dist/cjs/schema/index.js +14 -1
  41. package/dist/cjs/schema/marks/alignment.js +3 -8
  42. package/dist/cjs/schema/marks/annotation.js +3 -13
  43. package/dist/cjs/schema/marks/background-color.js +3 -9
  44. package/dist/cjs/schema/marks/border.js +3 -7
  45. package/dist/cjs/schema/marks/breakout.js +3 -9
  46. package/dist/cjs/schema/marks/code.js +3 -5
  47. package/dist/cjs/schema/marks/confluence-inline-comment.js +3 -9
  48. package/dist/cjs/schema/marks/data-consumer.js +3 -7
  49. package/dist/cjs/schema/marks/em.js +3 -5
  50. package/dist/cjs/schema/marks/fragment.js +3 -12
  51. package/dist/cjs/schema/marks/indentation.js +3 -8
  52. package/dist/cjs/schema/marks/link.js +3 -13
  53. package/dist/cjs/schema/marks/strike.js +3 -5
  54. package/dist/cjs/schema/marks/strong.js +3 -5
  55. package/dist/cjs/schema/marks/subsup.js +3 -10
  56. package/dist/cjs/schema/marks/text-color.js +3 -8
  57. package/dist/cjs/schema/marks/type-ahead-query.js +3 -10
  58. package/dist/cjs/schema/marks/underline.js +3 -5
  59. package/dist/cjs/schema/marks/unsupported-mark.js +3 -6
  60. package/dist/cjs/schema/marks/unsupported-node-attributes.js +3 -6
  61. package/dist/cjs/schema/nodes/block-card.js +3 -23
  62. package/dist/cjs/schema/nodes/blockquote.js +17 -20
  63. package/dist/cjs/schema/nodes/bodied-extension.js +24 -54
  64. package/dist/cjs/schema/nodes/bullet-list.js +3 -6
  65. package/dist/cjs/schema/nodes/caption.js +3 -6
  66. package/dist/cjs/schema/nodes/code-block.js +3 -15
  67. package/dist/cjs/schema/nodes/confluence-jira-issue.js +3 -22
  68. package/dist/cjs/schema/nodes/confluence-unsupported-block.js +3 -8
  69. package/dist/cjs/schema/nodes/confluence-unsupported-inline.js +3 -10
  70. package/dist/cjs/schema/nodes/date.js +3 -10
  71. package/dist/cjs/schema/nodes/decision-item.js +3 -13
  72. package/dist/cjs/schema/nodes/decision-list.js +3 -12
  73. package/dist/cjs/schema/nodes/doc.js +2 -4
  74. package/dist/cjs/schema/nodes/embed-card.js +3 -22
  75. package/dist/cjs/schema/nodes/emoji.js +3 -16
  76. package/dist/cjs/schema/nodes/expand.js +3 -16
  77. package/dist/cjs/schema/nodes/extension.js +20 -47
  78. package/dist/cjs/schema/nodes/hard-break.js +3 -5
  79. package/dist/cjs/schema/nodes/heading.js +3 -14
  80. package/dist/cjs/schema/nodes/image.js +3 -16
  81. package/dist/cjs/schema/nodes/inline-card.js +3 -14
  82. package/dist/cjs/schema/nodes/inline-extension.js +19 -42
  83. package/dist/cjs/schema/nodes/layout-column.js +4 -12
  84. package/dist/cjs/schema/nodes/layout-section.js +23 -11
  85. package/dist/cjs/schema/nodes/list-item.js +5 -12
  86. package/dist/cjs/schema/nodes/media-group.js +3 -8
  87. package/dist/cjs/schema/nodes/media-inline.js +2 -1
  88. package/dist/cjs/schema/nodes/media-single.js +35 -14
  89. package/dist/cjs/schema/nodes/media.js +35 -83
  90. package/dist/cjs/schema/nodes/mention.js +3 -22
  91. package/dist/cjs/schema/nodes/multi-bodied-extension.js +26 -64
  92. package/dist/cjs/schema/nodes/nested-expand.js +31 -48
  93. package/dist/cjs/schema/nodes/ordered-list.js +4 -16
  94. package/dist/cjs/schema/nodes/panel.js +5 -34
  95. package/dist/cjs/schema/nodes/paragraph.js +3 -11
  96. package/dist/cjs/schema/nodes/placeholder.js +3 -11
  97. package/dist/cjs/schema/nodes/rule.js +3 -3
  98. package/dist/cjs/schema/nodes/status.js +3 -19
  99. package/dist/cjs/schema/nodes/tableNodes.js +9 -52
  100. package/dist/cjs/schema/nodes/task-item.js +3 -14
  101. package/dist/cjs/schema/nodes/task-list.js +3 -12
  102. package/dist/cjs/schema/nodes/text.js +3 -4
  103. package/dist/cjs/schema/nodes/unsupported-block.js +3 -11
  104. package/dist/cjs/schema/nodes/unsupported-inline.js +3 -10
  105. package/dist/es2019/index.js +5 -1
  106. package/dist/es2019/next-schema/generated/markTypes.js +1 -1
  107. package/dist/es2019/next-schema/generated/nodeTypes.js +39 -39
  108. package/dist/es2019/next-schema/groups/nonNestableBlockContentGroup.js +1 -1
  109. package/dist/es2019/next-schema/groups/tableCellContentPseudoGroup.js +1 -1
  110. package/dist/es2019/next-schema/nodes/blockCard.js +1 -1
  111. package/dist/es2019/next-schema/nodes/blockquote.js +2 -2
  112. package/dist/es2019/next-schema/nodes/bodiedExtension.js +2 -2
  113. package/dist/es2019/next-schema/nodes/caption.js +1 -1
  114. package/dist/es2019/next-schema/nodes/codeBlock.js +2 -2
  115. package/dist/es2019/next-schema/nodes/decisionItem.js +1 -1
  116. package/dist/es2019/next-schema/nodes/decisionList.js +1 -1
  117. package/dist/es2019/next-schema/nodes/embedCard.js +1 -1
  118. package/dist/es2019/next-schema/nodes/expand.js +2 -2
  119. package/dist/es2019/next-schema/nodes/extension.js +2 -2
  120. package/dist/es2019/next-schema/nodes/extensionFrame.js +2 -2
  121. package/dist/es2019/next-schema/nodes/hardBreak.js +1 -1
  122. package/dist/es2019/next-schema/nodes/heading.js +3 -3
  123. package/dist/es2019/next-schema/nodes/inlineCard.js +2 -2
  124. package/dist/es2019/next-schema/nodes/inlineExtension.js +2 -2
  125. package/dist/es2019/next-schema/nodes/layoutColumn.js +1 -1
  126. package/dist/es2019/next-schema/nodes/layoutSection.js +2 -2
  127. package/dist/es2019/next-schema/nodes/list.js +5 -5
  128. package/dist/es2019/next-schema/nodes/media.js +1 -1
  129. package/dist/es2019/next-schema/nodes/mediaGroup.js +1 -1
  130. package/dist/es2019/next-schema/nodes/mediaInline.js +1 -1
  131. package/dist/es2019/next-schema/nodes/mediaSingle.js +5 -5
  132. package/dist/es2019/next-schema/nodes/nestedExpand.js +2 -2
  133. package/dist/es2019/next-schema/nodes/panel.js +3 -3
  134. package/dist/es2019/next-schema/nodes/paragraph.js +4 -4
  135. package/dist/es2019/next-schema/nodes/placeholder.js +1 -1
  136. package/dist/es2019/next-schema/nodes/table.js +1 -1
  137. package/dist/es2019/next-schema/nodes/tableCell.js +1 -1
  138. package/dist/es2019/next-schema/nodes/tableHeader.js +1 -1
  139. package/dist/es2019/next-schema/nodes/tableRow.js +1 -1
  140. package/dist/es2019/next-schema/nodes/task.js +2 -2
  141. package/dist/es2019/next-schema/nodes/text.js +1 -1
  142. package/dist/es2019/schema/createPMSpecFactory.js +55 -0
  143. package/dist/es2019/schema/index.js +5 -1
  144. package/dist/es2019/schema/marks/alignment.js +3 -8
  145. package/dist/es2019/schema/marks/annotation.js +4 -13
  146. package/dist/es2019/schema/marks/background-color.js +3 -9
  147. package/dist/es2019/schema/marks/border.js +3 -7
  148. package/dist/es2019/schema/marks/breakout.js +3 -9
  149. package/dist/es2019/schema/marks/code.js +3 -5
  150. package/dist/es2019/schema/marks/confluence-inline-comment.js +4 -9
  151. package/dist/es2019/schema/marks/data-consumer.js +3 -7
  152. package/dist/es2019/schema/marks/em.js +3 -5
  153. package/dist/es2019/schema/marks/fragment.js +3 -12
  154. package/dist/es2019/schema/marks/indentation.js +3 -8
  155. package/dist/es2019/schema/marks/link.js +3 -13
  156. package/dist/es2019/schema/marks/strike.js +3 -5
  157. package/dist/es2019/schema/marks/strong.js +3 -5
  158. package/dist/es2019/schema/marks/subsup.js +3 -10
  159. package/dist/es2019/schema/marks/text-color.js +3 -8
  160. package/dist/es2019/schema/marks/type-ahead-query.js +3 -10
  161. package/dist/es2019/schema/marks/underline.js +3 -5
  162. package/dist/es2019/schema/marks/unsupported-mark.js +3 -6
  163. package/dist/es2019/schema/marks/unsupported-node-attributes.js +3 -6
  164. package/dist/es2019/schema/nodes/block-card.js +4 -23
  165. package/dist/es2019/schema/nodes/blockquote.js +19 -20
  166. package/dist/es2019/schema/nodes/bodied-extension.js +23 -53
  167. package/dist/es2019/schema/nodes/bullet-list.js +3 -6
  168. package/dist/es2019/schema/nodes/caption.js +4 -6
  169. package/dist/es2019/schema/nodes/code-block.js +3 -15
  170. package/dist/es2019/schema/nodes/confluence-jira-issue.js +3 -22
  171. package/dist/es2019/schema/nodes/confluence-unsupported-block.js +3 -8
  172. package/dist/es2019/schema/nodes/confluence-unsupported-inline.js +3 -10
  173. package/dist/es2019/schema/nodes/date.js +4 -10
  174. package/dist/es2019/schema/nodes/decision-item.js +3 -13
  175. package/dist/es2019/schema/nodes/decision-list.js +3 -12
  176. package/dist/es2019/schema/nodes/doc.js +3 -4
  177. package/dist/es2019/schema/nodes/embed-card.js +4 -22
  178. package/dist/es2019/schema/nodes/emoji.js +3 -16
  179. package/dist/es2019/schema/nodes/expand.js +4 -16
  180. package/dist/es2019/schema/nodes/extension.js +19 -46
  181. package/dist/es2019/schema/nodes/hard-break.js +4 -5
  182. package/dist/es2019/schema/nodes/heading.js +4 -14
  183. package/dist/es2019/schema/nodes/image.js +3 -16
  184. package/dist/es2019/schema/nodes/inline-card.js +4 -14
  185. package/dist/es2019/schema/nodes/inline-extension.js +18 -41
  186. package/dist/es2019/schema/nodes/layout-column.js +5 -12
  187. package/dist/es2019/schema/nodes/layout-section.js +24 -10
  188. package/dist/es2019/schema/nodes/list-item.js +6 -12
  189. package/dist/es2019/schema/nodes/media-group.js +4 -8
  190. package/dist/es2019/schema/nodes/media-inline.js +3 -2
  191. package/dist/es2019/schema/nodes/media-single.js +35 -15
  192. package/dist/es2019/schema/nodes/media.js +35 -78
  193. package/dist/es2019/schema/nodes/mention.js +3 -22
  194. package/dist/es2019/schema/nodes/multi-bodied-extension.js +26 -63
  195. package/dist/es2019/schema/nodes/nested-expand.js +32 -48
  196. package/dist/es2019/schema/nodes/ordered-list.js +5 -14
  197. package/dist/es2019/schema/nodes/panel.js +5 -34
  198. package/dist/es2019/schema/nodes/paragraph.js +4 -11
  199. package/dist/es2019/schema/nodes/placeholder.js +4 -11
  200. package/dist/es2019/schema/nodes/rule.js +4 -3
  201. package/dist/es2019/schema/nodes/status.js +3 -19
  202. package/dist/es2019/schema/nodes/tableNodes.js +40 -82
  203. package/dist/es2019/schema/nodes/task-item.js +3 -14
  204. package/dist/es2019/schema/nodes/task-list.js +3 -12
  205. package/dist/es2019/schema/nodes/text.js +4 -4
  206. package/dist/es2019/schema/nodes/unsupported-block.js +3 -11
  207. package/dist/es2019/schema/nodes/unsupported-inline.js +3 -10
  208. package/dist/esm/index.js +5 -1
  209. package/dist/esm/next-schema/generated/markTypes.js +1 -1
  210. package/dist/esm/next-schema/generated/nodeTypes.js +39 -39
  211. package/dist/esm/next-schema/groups/nonNestableBlockContentGroup.js +1 -1
  212. package/dist/esm/next-schema/groups/tableCellContentPseudoGroup.js +1 -1
  213. package/dist/esm/next-schema/nodes/blockCard.js +1 -1
  214. package/dist/esm/next-schema/nodes/blockquote.js +2 -2
  215. package/dist/esm/next-schema/nodes/bodiedExtension.js +2 -2
  216. package/dist/esm/next-schema/nodes/caption.js +1 -1
  217. package/dist/esm/next-schema/nodes/codeBlock.js +2 -2
  218. package/dist/esm/next-schema/nodes/decisionItem.js +1 -1
  219. package/dist/esm/next-schema/nodes/decisionList.js +1 -1
  220. package/dist/esm/next-schema/nodes/embedCard.js +1 -1
  221. package/dist/esm/next-schema/nodes/expand.js +2 -2
  222. package/dist/esm/next-schema/nodes/extension.js +2 -2
  223. package/dist/esm/next-schema/nodes/extensionFrame.js +2 -2
  224. package/dist/esm/next-schema/nodes/hardBreak.js +1 -1
  225. package/dist/esm/next-schema/nodes/heading.js +3 -3
  226. package/dist/esm/next-schema/nodes/inlineCard.js +2 -2
  227. package/dist/esm/next-schema/nodes/inlineExtension.js +2 -2
  228. package/dist/esm/next-schema/nodes/layoutColumn.js +1 -1
  229. package/dist/esm/next-schema/nodes/layoutSection.js +2 -2
  230. package/dist/esm/next-schema/nodes/list.js +5 -5
  231. package/dist/esm/next-schema/nodes/media.js +1 -1
  232. package/dist/esm/next-schema/nodes/mediaGroup.js +1 -1
  233. package/dist/esm/next-schema/nodes/mediaInline.js +1 -1
  234. package/dist/esm/next-schema/nodes/mediaSingle.js +5 -5
  235. package/dist/esm/next-schema/nodes/nestedExpand.js +2 -2
  236. package/dist/esm/next-schema/nodes/panel.js +3 -3
  237. package/dist/esm/next-schema/nodes/paragraph.js +4 -4
  238. package/dist/esm/next-schema/nodes/placeholder.js +1 -1
  239. package/dist/esm/next-schema/nodes/table.js +1 -1
  240. package/dist/esm/next-schema/nodes/tableCell.js +1 -1
  241. package/dist/esm/next-schema/nodes/tableHeader.js +1 -1
  242. package/dist/esm/next-schema/nodes/tableRow.js +1 -1
  243. package/dist/esm/next-schema/nodes/task.js +2 -2
  244. package/dist/esm/next-schema/nodes/text.js +1 -1
  245. package/dist/esm/schema/createPMSpecFactory.js +50 -0
  246. package/dist/esm/schema/index.js +5 -1
  247. package/dist/esm/schema/marks/alignment.js +3 -8
  248. package/dist/esm/schema/marks/annotation.js +4 -13
  249. package/dist/esm/schema/marks/background-color.js +3 -9
  250. package/dist/esm/schema/marks/border.js +3 -7
  251. package/dist/esm/schema/marks/breakout.js +3 -9
  252. package/dist/esm/schema/marks/code.js +3 -5
  253. package/dist/esm/schema/marks/confluence-inline-comment.js +4 -9
  254. package/dist/esm/schema/marks/data-consumer.js +3 -7
  255. package/dist/esm/schema/marks/em.js +3 -5
  256. package/dist/esm/schema/marks/fragment.js +3 -12
  257. package/dist/esm/schema/marks/indentation.js +3 -8
  258. package/dist/esm/schema/marks/link.js +3 -13
  259. package/dist/esm/schema/marks/strike.js +3 -5
  260. package/dist/esm/schema/marks/strong.js +3 -5
  261. package/dist/esm/schema/marks/subsup.js +3 -10
  262. package/dist/esm/schema/marks/text-color.js +3 -8
  263. package/dist/esm/schema/marks/type-ahead-query.js +3 -10
  264. package/dist/esm/schema/marks/underline.js +3 -5
  265. package/dist/esm/schema/marks/unsupported-mark.js +3 -6
  266. package/dist/esm/schema/marks/unsupported-node-attributes.js +3 -6
  267. package/dist/esm/schema/nodes/block-card.js +4 -23
  268. package/dist/esm/schema/nodes/blockquote.js +19 -20
  269. package/dist/esm/schema/nodes/bodied-extension.js +24 -54
  270. package/dist/esm/schema/nodes/bullet-list.js +3 -6
  271. package/dist/esm/schema/nodes/caption.js +4 -6
  272. package/dist/esm/schema/nodes/code-block.js +3 -15
  273. package/dist/esm/schema/nodes/confluence-jira-issue.js +3 -22
  274. package/dist/esm/schema/nodes/confluence-unsupported-block.js +3 -8
  275. package/dist/esm/schema/nodes/confluence-unsupported-inline.js +3 -10
  276. package/dist/esm/schema/nodes/date.js +4 -10
  277. package/dist/esm/schema/nodes/decision-item.js +3 -13
  278. package/dist/esm/schema/nodes/decision-list.js +3 -12
  279. package/dist/esm/schema/nodes/doc.js +3 -4
  280. package/dist/esm/schema/nodes/embed-card.js +4 -22
  281. package/dist/esm/schema/nodes/emoji.js +3 -16
  282. package/dist/esm/schema/nodes/expand.js +4 -16
  283. package/dist/esm/schema/nodes/extension.js +20 -47
  284. package/dist/esm/schema/nodes/hard-break.js +4 -5
  285. package/dist/esm/schema/nodes/heading.js +4 -14
  286. package/dist/esm/schema/nodes/image.js +3 -16
  287. package/dist/esm/schema/nodes/inline-card.js +4 -14
  288. package/dist/esm/schema/nodes/inline-extension.js +19 -42
  289. package/dist/esm/schema/nodes/layout-column.js +5 -12
  290. package/dist/esm/schema/nodes/layout-section.js +24 -10
  291. package/dist/esm/schema/nodes/list-item.js +6 -12
  292. package/dist/esm/schema/nodes/media-group.js +4 -8
  293. package/dist/esm/schema/nodes/media-inline.js +3 -2
  294. package/dist/esm/schema/nodes/media-single.js +35 -14
  295. package/dist/esm/schema/nodes/media.js +36 -82
  296. package/dist/esm/schema/nodes/mention.js +3 -22
  297. package/dist/esm/schema/nodes/multi-bodied-extension.js +27 -64
  298. package/dist/esm/schema/nodes/nested-expand.js +32 -48
  299. package/dist/esm/schema/nodes/ordered-list.js +4 -15
  300. package/dist/esm/schema/nodes/panel.js +5 -34
  301. package/dist/esm/schema/nodes/paragraph.js +4 -11
  302. package/dist/esm/schema/nodes/placeholder.js +4 -11
  303. package/dist/esm/schema/nodes/rule.js +4 -3
  304. package/dist/esm/schema/nodes/status.js +3 -19
  305. package/dist/esm/schema/nodes/tableNodes.js +12 -52
  306. package/dist/esm/schema/nodes/task-item.js +3 -14
  307. package/dist/esm/schema/nodes/task-list.js +3 -12
  308. package/dist/esm/schema/nodes/text.js +4 -4
  309. package/dist/esm/schema/nodes/unsupported-block.js +3 -11
  310. package/dist/esm/schema/nodes/unsupported-inline.js +3 -10
  311. package/dist/types/index.d.ts +2 -0
  312. package/dist/types/next-schema/generated/markTypes.d.ts +20 -20
  313. package/dist/types/next-schema/generated/nodeGroupTypes.d.ts +1 -1
  314. package/dist/types/next-schema/generated/nodeTypes.d.ts +75 -75
  315. package/dist/types/schema/createPMSpecFactory.d.ts +33 -0
  316. package/dist/types/schema/index.d.ts +2 -0
  317. package/dist/types/schema/nodes/block-card.d.ts +1 -2
  318. package/dist/types/schema/nodes/blockquote.d.ts +2 -3
  319. package/dist/types/schema/nodes/bodied-extension.d.ts +1 -2
  320. package/dist/types/schema/nodes/bullet-list.d.ts +1 -2
  321. package/dist/types/schema/nodes/caption.d.ts +1 -2
  322. package/dist/types/schema/nodes/code-block.d.ts +2 -2
  323. package/dist/types/schema/nodes/confluence-jira-issue.d.ts +1 -2
  324. package/dist/types/schema/nodes/confluence-unsupported-block.d.ts +1 -2
  325. package/dist/types/schema/nodes/confluence-unsupported-inline.d.ts +1 -2
  326. package/dist/types/schema/nodes/date.d.ts +1 -2
  327. package/dist/types/schema/nodes/decision-item.d.ts +1 -2
  328. package/dist/types/schema/nodes/decision-list.d.ts +1 -2
  329. package/dist/types/schema/nodes/doc.d.ts +1 -2
  330. package/dist/types/schema/nodes/embed-card.d.ts +1 -2
  331. package/dist/types/schema/nodes/emoji.d.ts +1 -2
  332. package/dist/types/schema/nodes/expand.d.ts +2 -2
  333. package/dist/types/schema/nodes/extension.d.ts +1 -2
  334. package/dist/types/schema/nodes/hard-break.d.ts +1 -2
  335. package/dist/types/schema/nodes/heading.d.ts +1 -2
  336. package/dist/types/schema/nodes/image.d.ts +1 -2
  337. package/dist/types/schema/nodes/inline-card.d.ts +1 -2
  338. package/dist/types/schema/nodes/inline-extension.d.ts +1 -2
  339. package/dist/types/schema/nodes/layout-column.d.ts +1 -2
  340. package/dist/types/schema/nodes/layout-section.d.ts +3 -3
  341. package/dist/types/schema/nodes/list-item.d.ts +2 -3
  342. package/dist/types/schema/nodes/media-group.d.ts +1 -2
  343. package/dist/types/schema/nodes/media.d.ts +3 -1
  344. package/dist/types/schema/nodes/mention.d.ts +2 -2
  345. package/dist/types/schema/nodes/multi-bodied-extension.d.ts +2 -3
  346. package/dist/types/schema/nodes/nested-expand.d.ts +1 -2
  347. package/dist/types/schema/nodes/ordered-list.d.ts +2 -3
  348. package/dist/types/schema/nodes/panel.d.ts +2 -3
  349. package/dist/types/schema/nodes/paragraph.d.ts +1 -2
  350. package/dist/types/schema/nodes/placeholder.d.ts +1 -2
  351. package/dist/types/schema/nodes/rule.d.ts +1 -2
  352. package/dist/types/schema/nodes/status.d.ts +1 -2
  353. package/dist/types/schema/nodes/tableNodes.d.ts +7 -7
  354. package/dist/types/schema/nodes/task-item.d.ts +1 -2
  355. package/dist/types/schema/nodes/task-list.d.ts +1 -2
  356. package/dist/types/schema/nodes/text.d.ts +1 -4
  357. package/dist/types/schema/nodes/unsupported-block.d.ts +1 -2
  358. package/dist/types/schema/nodes/unsupported-inline.d.ts +1 -2
  359. package/package.json +2 -2
  360. package/schema-generators/__tests__/unit/adfToValidatorSpec.unit.ts +7 -7
  361. package/schema-generators/__tests__/unit/validate-pm-schema.unit.ts +4 -4
@@ -8,7 +8,7 @@ import { unsupportedBlock } from './unsupportedBlock';
8
8
  export const mediaSingle = adfNode('mediaSingle').define({
9
9
  atom: true,
10
10
  selectable: true,
11
- marks: [link, unsupportedNodeAttribute, unsupportedMark],
11
+ marks: [link, unsupportedMark, unsupportedNodeAttribute],
12
12
  attrs: {
13
13
  anyOf: [{
14
14
  width: {
@@ -50,7 +50,7 @@ export const mediaSingle = adfNode('mediaSingle').define({
50
50
  DANGEROUS_MANUAL_OVERRIDE: {
51
51
  'pm-spec': {
52
52
  content: {
53
- value: 'media|media|unsupportedBlock+ unsupportedBlock+',
53
+ value: 'media|unsupportedBlock+|media unsupportedBlock+',
54
54
  reason: 'The content expression is not correct or redundant around `media|media|unsupportedBlock+`. This case is not supported by the DSL.'
55
55
  },
56
56
  attrs: {
@@ -86,7 +86,7 @@ export const mediaSingle = adfNode('mediaSingle').define({
86
86
  DANGEROUS_MANUAL_OVERRIDE: {
87
87
  'pm-spec': {
88
88
  content: {
89
- value: 'media|media|unsupportedBlock+ (caption|unsupportedBlock) unsupportedBlock*',
89
+ value: 'media|unsupportedBlock+|media (caption|unsupportedBlock) unsupportedBlock*',
90
90
  reason: 'The content expression is not correct or redundant around `media|media|unsupportedBlock+`. This case is not supported by the DSL.'
91
91
  },
92
92
  attrs: {
@@ -110,7 +110,7 @@ export const mediaSingle = adfNode('mediaSingle').define({
110
110
  DANGEROUS_MANUAL_OVERRIDE: {
111
111
  'pm-spec': {
112
112
  content: {
113
- value: 'media|media|unsupportedBlock+ (caption|unsupportedBlock) unsupportedBlock*',
113
+ value: 'media|unsupportedBlock+|media (caption|unsupportedBlock) unsupportedBlock*',
114
114
  reason: 'The content expression is not correct or redundant around `media|media|unsupportedBlock+`. This case is not supported by the DSL.'
115
115
  }
116
116
  }
@@ -124,7 +124,7 @@ export const mediaSingle = adfNode('mediaSingle').define({
124
124
  DANGEROUS_MANUAL_OVERRIDE: {
125
125
  'pm-spec': {
126
126
  content: {
127
- value: 'media|media|unsupportedBlock+ unsupportedBlock+',
127
+ value: 'media|unsupportedBlock+|media unsupportedBlock+',
128
128
  reason: 'The content expression is not correct or redundant around `media|media|unsupportedBlock+`. This case is not supported by the DSL.'
129
129
  }
130
130
  }
@@ -16,7 +16,7 @@ import { unsupportedBlock } from './unsupportedBlock';
16
16
  export const nestedExpand = adfNode('nestedExpand').define({
17
17
  isolating: true,
18
18
  selectable: true,
19
- marks: [unsupportedNodeAttribute, unsupportedMark],
19
+ marks: [unsupportedMark, unsupportedNodeAttribute],
20
20
  attrs: {
21
21
  title: {
22
22
  type: 'string',
@@ -29,7 +29,7 @@ export const nestedExpand = adfNode('nestedExpand').define({
29
29
  optional: true
30
30
  }
31
31
  },
32
- content: [$onePlus($or(codeBlock.use('with_no_marks'), paragraph.use('with_no_marks'), mediaSingle.use('caption'), mediaSingle.use('full'), taskList, bulletList, orderedList, heading.use('with_no_marks'), mediaGroup, decisionList, rule, panel, blockquote, unsupportedBlock))],
32
+ content: [$onePlus($or(paragraph.use('with_no_marks'), heading.use('with_no_marks'), mediaSingle.use('caption'), mediaSingle.use('full'), mediaGroup, codeBlock.use('with_no_marks'), bulletList, orderedList, taskList, decisionList, rule, panel, blockquote, unsupportedBlock))],
33
33
  DANGEROUS_MANUAL_OVERRIDE: {
34
34
  'validator-spec': {
35
35
  'props.attrs.optional': {
@@ -14,7 +14,7 @@ import { taskList } from './task';
14
14
  import { unsupportedBlock } from './unsupportedBlock';
15
15
  export const panel = adfNode('panel').define({
16
16
  selectable: true,
17
- marks: [unsupportedNodeAttribute, unsupportedMark],
17
+ marks: [unsupportedMark, unsupportedNodeAttribute],
18
18
  attrs: {
19
19
  panelType: {
20
20
  type: 'enum',
@@ -42,8 +42,8 @@ export const panel = adfNode('panel').define({
42
42
  optional: true
43
43
  }
44
44
  },
45
- content: [$onePlus($or(codeBlock.use('with_no_marks'), blockCard, paragraph.use('with_no_marks'), mediaSingle.use('caption'), mediaSingle.use('full'), taskList, bulletList, orderedList, heading.use('with_no_marks'), mediaGroup, decisionList, rule, unsupportedBlock))]
45
+ content: [$onePlus($or(paragraph.use('with_no_marks'), heading.use('with_no_marks'), bulletList, orderedList, blockCard, mediaGroup, mediaSingle.use('caption'), mediaSingle.use('full'), codeBlock.use('with_no_marks'), taskList, rule, decisionList, unsupportedBlock))]
46
46
  }).variant('legacy', {
47
- content: [$onePlus($or(blockCard, paragraph.use('with_no_marks'), bulletList, orderedList, heading.use('with_no_marks'), unsupportedBlock))],
47
+ content: [$onePlus($or(paragraph.use('with_no_marks'), heading.use('with_no_marks'), bulletList, orderedList, blockCard, unsupportedBlock))],
48
48
  ignore: ['json-schema', 'validator-spec']
49
49
  });
@@ -14,7 +14,7 @@ export const paragraph = adfNode('paragraph').define({
14
14
  }
15
15
  },
16
16
  selectable: false,
17
- marks: [unsupportedNodeAttribute, unsupportedMark],
17
+ marks: [unsupportedMark, unsupportedNodeAttribute],
18
18
  hasEmptyMarks: true,
19
19
  content: [$zeroPlus($or(inlineGroup, atomicInlineGroup, inlineContentGroup))],
20
20
  DANGEROUS_MANUAL_OVERRIDE: {
@@ -30,15 +30,15 @@ export const paragraph = adfNode('paragraph').define({
30
30
  }
31
31
  }
32
32
  }).variant('with_alignment', {
33
- marks: [alignment, unsupportedNodeAttribute, unsupportedMark],
33
+ marks: [alignment, unsupportedMark, unsupportedNodeAttribute],
34
34
  content: [],
35
35
  ignore: []
36
36
  }).variant('with_indentation', {
37
- marks: [indentation, unsupportedNodeAttribute, unsupportedMark],
37
+ marks: [indentation, unsupportedMark, unsupportedNodeAttribute],
38
38
  content: [],
39
39
  ignore: []
40
40
  }).variant('with_marks', {
41
- marks: [alignment, unsupportedNodeAttribute, unsupportedMark],
41
+ marks: [alignment, unsupportedMark, unsupportedNodeAttribute],
42
42
  content: [],
43
43
  ignore: []
44
44
  }).variant('with_no_marks', {
@@ -4,7 +4,7 @@ import { unsupportedNodeAttribute } from '../marks/unsupportedNodeAttribute';
4
4
  export const placeholder = adfNode('placeholder').define({
5
5
  selectable: false,
6
6
  inline: true,
7
- marks: [unsupportedNodeAttribute, unsupportedMark],
7
+ marks: [unsupportedMark, unsupportedNodeAttribute],
8
8
  allowNoChildMark: true,
9
9
  attrs: {
10
10
  text: {
@@ -7,7 +7,7 @@ export const table = adfNode('table').define({
7
7
  isolating: true,
8
8
  selectable: true,
9
9
  tableRole: 'table',
10
- marks: [fragment, unsupportedNodeAttribute, unsupportedMark],
10
+ marks: [fragment, unsupportedMark, unsupportedNodeAttribute],
11
11
  attrs: {
12
12
  displayMode: {
13
13
  type: 'enum',
@@ -6,7 +6,7 @@ export const tableCell = adfNode('tableCell').define({
6
6
  isolating: true,
7
7
  selectable: false,
8
8
  tableRole: 'cell',
9
- marks: [unsupportedNodeAttribute, unsupportedMark],
9
+ marks: [unsupportedMark, unsupportedNodeAttribute],
10
10
  attrs: {
11
11
  colspan: {
12
12
  type: 'number',
@@ -6,7 +6,7 @@ export const tableHeader = adfNode('tableHeader').define({
6
6
  isolating: true,
7
7
  selectable: false,
8
8
  tableRole: 'header_cell',
9
- marks: [unsupportedNodeAttribute, unsupportedMark],
9
+ marks: [unsupportedMark, unsupportedNodeAttribute],
10
10
  attrs: {
11
11
  colspan: {
12
12
  type: 'number',
@@ -6,7 +6,7 @@ import { tableHeader } from './tableHeader';
6
6
  import { tableCellContent } from './tableCellContent';
7
7
  export const tableRow = adfNode('tableRow').define({
8
8
  selectable: false,
9
- marks: [unsupportedNodeAttribute, unsupportedMark],
9
+ marks: [unsupportedMark, unsupportedNodeAttribute],
10
10
  content: [$onePlus($or(tableCell, tableHeader, tableCellContent))],
11
11
  tableRole: 'row',
12
12
  DANGEROUS_MANUAL_OVERRIDE: {
@@ -9,7 +9,7 @@ export const taskList = adfNode('taskList');
9
9
  taskItem.define({
10
10
  defining: true,
11
11
  selectable: false,
12
- marks: [unsupportedNodeAttribute, unsupportedMark],
12
+ marks: [unsupportedMark, unsupportedNodeAttribute],
13
13
  allowAnyChildMark: true,
14
14
  attrs: {
15
15
  localId: {
@@ -27,7 +27,7 @@ taskItem.define({
27
27
  taskList.define({
28
28
  defining: true,
29
29
  selectable: false,
30
- marks: [unsupportedNodeAttribute, unsupportedMark],
30
+ marks: [unsupportedMark, unsupportedNodeAttribute],
31
31
  attrs: {
32
32
  localId: {
33
33
  type: 'string',
@@ -30,5 +30,5 @@ export const text = adfNode('text').define({
30
30
  }
31
31
  }
32
32
  }).variant('code_inline', {
33
- marks: [code, link, annotation, unsupportedNodeAttribute, unsupportedMark]
33
+ marks: [code, link, annotation, unsupportedMark, unsupportedNodeAttribute]
34
34
  });
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Factory method to attach custom parseDOM and/or toDOM for nodeSpec
3
+ *
4
+ * @example
5
+ * createPMNodeSpecFactory<SomeNode>(node)({parseDOM: {}, toDOM: (node) => {} });
6
+ *
7
+ * @param nodeSpec - NodeSpec without toDom and parseDom
8
+ * @returns A function for a node which allows the consumer to define toDom and parseDom
9
+ */
10
+ export const createPMNodeSpecFactory = nodeSpec => ({
11
+ parseDOM,
12
+ toDOM,
13
+ toDebugString
14
+ }) => {
15
+ return {
16
+ ...nodeSpec,
17
+ ...(parseDOM && {
18
+ parseDOM
19
+ }),
20
+ ...(toDOM && {
21
+ toDOM
22
+ }),
23
+ ...(toDebugString && {
24
+ toDebugString
25
+ })
26
+ };
27
+ };
28
+
29
+ /**
30
+ * Factory method to attach custom parseDOM and/or toDOM for markSpec
31
+ *
32
+ * @example
33
+ * createPMMarkSpecFactory<SomeMark>(mark)({parseDOM: {}, toDOM: (mark, inline) => {} });
34
+ *
35
+ * @param markSpec - Markspec without toDom and parseDom
36
+ * @returns A function for a mark which allows the consumer to define toDom and parseDom
37
+ */
38
+ export const createPMMarkSpecFactory = markSpec => ({
39
+ parseDOM,
40
+ toDOM,
41
+ toDebugString
42
+ }) => {
43
+ return {
44
+ ...markSpec,
45
+ ...(parseDOM && {
46
+ parseDOM
47
+ }),
48
+ ...(toDOM && {
49
+ toDOM
50
+ }),
51
+ ...(toDebugString && {
52
+ toDebugString
53
+ })
54
+ };
55
+ };
@@ -3,4 +3,8 @@ export { AnnotationTypes, alignment, alignmentPositionMap, annotation, breakout,
3
3
  colorPaletteExtended, confluenceInlineComment, dataConsumer, dataConsumerToJSON, em, fragment, fragmentToJSON, indentation, link, linkToJSON, strike, strong, subsup, textColor, typeAheadQuery, underline, buildAnnotationMarkDataAttributes, AnnotationMarkStates, unsupportedMark, unsupportedNodeAttribute, border, borderColorPalette, backgroundColor, backgroundColorPalette } from './marks';
4
4
  export { unsupportedNodeTypesForMediaCards } from './unsupported';
5
5
  export { inlineNodes } from './inline-nodes';
6
- export { sanitizeNodes, createSchema } from './create-schema';
6
+ export { sanitizeNodes, createSchema } from './create-schema';
7
+
8
+ // ADF createPMSpecFactory
9
+
10
+ export { createPMNodeSpecFactory, createPMMarkSpecFactory } from './createPMSpecFactory';
@@ -1,4 +1,4 @@
1
- import { ALIGNMENT, INDENTATION } from '../groups';
1
+ import { alignment as alignmentFactory } from '../../next-schema/generated/markTypes';
2
2
 
3
3
  /** TODO: Flip these positions for RTL */
4
4
  export const alignmentPositionMap = {
@@ -11,12 +11,7 @@ export const alignmentPositionMap = {
11
11
  * @name alignment_mark
12
12
  */
13
13
 
14
- export const alignment = {
15
- excludes: `alignment ${INDENTATION}`,
16
- group: ALIGNMENT,
17
- attrs: {
18
- align: {}
19
- },
14
+ export const alignment = alignmentFactory({
20
15
  parseDOM: [{
21
16
  tag: 'div.fabric-editor-block-mark',
22
17
  getAttrs: dom => {
@@ -32,4 +27,4 @@ export const alignment = {
32
27
  'data-align': mark.attrs.align
33
28
  }, 0];
34
29
  }
35
- };
30
+ });
@@ -1,3 +1,5 @@
1
+ import { annotation as annotationFactory } from '../../next-schema/generated/markTypes';
2
+
1
3
  /**
2
4
  * @name annotation_mark
3
5
  */
@@ -29,18 +31,7 @@ export function buildDataAttributes({
29
31
  }
30
32
  return data;
31
33
  }
32
- export const annotation = {
33
- inclusive: true,
34
- group: 'annotation',
35
- excludes: '',
36
- attrs: {
37
- id: {
38
- default: ''
39
- },
40
- annotationType: {
41
- default: AnnotationTypes.INLINE_COMMENT
42
- }
43
- },
34
+ export const annotation = annotationFactory({
44
35
  parseDOM: [{
45
36
  tag: 'span[data-mark-type="annotation"]',
46
37
  mark: 'annotation',
@@ -71,4 +62,4 @@ export const annotation = {
71
62
  })
72
63
  }, 0];
73
64
  }
74
- };
65
+ });
@@ -1,5 +1,5 @@
1
+ import { backgroundColor as backgroundColorFactory } from '../../next-schema/generated/markTypes';
1
2
  import { hexToEditorTextBackgroundPaletteColor } from '../../utils/editor-palette';
2
- import { COLOR } from '../groups';
3
3
  import { rgbToHex, L200, T200, P200, M200, Neutral300, O200 } from '../../utils/colors';
4
4
  import { getGlobalTheme } from './text-color';
5
5
  import { getDarkModeLCHColor } from '../../utils/lch-color-inversion';
@@ -24,13 +24,7 @@ const colorArrayPalette = [[Neutral300, 'Gray'],
24
24
  // @see https://product-fabric.atlassian.net/wiki/spaces/E/pages/55979455/Colour+picker+decisions#Colourpickerdecisions-Visualdesigndecisions
25
25
  export const backgroundColorPalette = new Map();
26
26
  colorArrayPalette.forEach(([color, label]) => backgroundColorPalette.set(color.toLowerCase(), label));
27
- export const backgroundColor = {
28
- attrs: {
29
- color: {}
30
- },
31
- inclusive: true,
32
- group: COLOR,
33
- excludes: `${COLOR}`,
27
+ export const backgroundColor = backgroundColorFactory({
34
28
  parseDOM: [{
35
29
  style: 'background-color',
36
30
  getAttrs: maybeValue => {
@@ -103,4 +97,4 @@ export const backgroundColor = {
103
97
  ['data-background-custom-color']: mark.attrs.color
104
98
  }];
105
99
  }
106
- };
100
+ });
@@ -1,3 +1,4 @@
1
+ import { border as borderFactory } from '../../next-schema/generated/markTypes';
1
2
  import { hexToEditorBorderPaletteColor } from '../../utils/editor-palette';
2
3
  import { N300A, N600, N1000 } from '../../utils/colors';
3
4
 
@@ -9,8 +10,7 @@ import { N300A, N600, N1000 } from '../../utils/colors';
9
10
  const borderColorArrayPalette = [[N300A, 'Subtle gray'], [N600, 'Gray'], [N1000, 'Bold gray']];
10
11
  export const borderColorPalette = new Map();
11
12
  borderColorArrayPalette.forEach(([color, label]) => borderColorPalette.set(color.toLowerCase(), label));
12
- export const border = {
13
- inclusive: false,
13
+ export const border = borderFactory({
14
14
  parseDOM: [{
15
15
  tag: '[data-mark-type="border"]',
16
16
  getAttrs: domNode => {
@@ -24,10 +24,6 @@ export const border = {
24
24
  };
25
25
  }
26
26
  }],
27
- attrs: {
28
- color: {},
29
- size: {}
30
- },
31
27
  toDOM(mark, isInline) {
32
28
  const wrapperStyle = isInline ? 'span' : 'div';
33
29
 
@@ -42,4 +38,4 @@ export const border = {
42
38
  style: `--custom-palette-color: ${paletteColorValue}`
43
39
  }];
44
40
  }
45
- };
41
+ });
@@ -1,12 +1,11 @@
1
+ import { breakout as breakoutFactory } from '../../next-schema/generated/markTypes';
1
2
  const allowedTypes = ['wide', 'full-width'];
2
3
 
3
4
  /**
4
5
  * @name breakout_mark
5
6
  */
6
7
 
7
- export const breakout = {
8
- spanning: false,
9
- inclusive: false,
8
+ export const breakout = breakoutFactory({
10
9
  parseDOM: [{
11
10
  tag: 'div.fabric-editor-breakout-mark',
12
11
  getAttrs(dom) {
@@ -16,15 +15,10 @@ export const breakout = {
16
15
  };
17
16
  }
18
17
  }],
19
- attrs: {
20
- mode: {
21
- default: 'wide'
22
- }
23
- },
24
18
  toDOM(mark) {
25
19
  return ['div', {
26
20
  class: 'fabric-editor-breakout-mark',
27
21
  'data-mode': mark.attrs.mode
28
22
  }, 0];
29
23
  }
30
- };
24
+ });
@@ -1,12 +1,10 @@
1
- import { COLOR, FONT_STYLE, LINK, SEARCH_QUERY } from '../groups';
1
+ import { code as codeFactory } from '../../next-schema/generated/markTypes';
2
2
 
3
3
  /**
4
4
  * @name code_mark
5
5
  */
6
6
 
7
- export const code = {
8
- excludes: `${FONT_STYLE} ${LINK} ${SEARCH_QUERY} ${COLOR}`,
9
- inclusive: true,
7
+ export const code = codeFactory({
10
8
  parseDOM: [{
11
9
  tag: 'span.code',
12
10
  preserveWhitespace: true
@@ -36,4 +34,4 @@ export const code = {
36
34
  spellcheck: 'false'
37
35
  }];
38
36
  }
39
- };
37
+ });
@@ -1,16 +1,11 @@
1
+ import { confluenceInlineComment as confluenceInlineCommentFactory } from '../../next-schema/generated/markTypes';
2
+
1
3
  /**
2
4
  * @name inline_comment_marker
3
5
  * @description This temporary mark represents a Confluence-backed inline comment that wraps a piece of text. It will be replaced with a cross-product inline comment solution at later date.
4
6
  */
5
7
 
6
- export const confluenceInlineComment = {
7
- inclusive: false,
8
- excludes: '',
9
- attrs: {
10
- reference: {
11
- default: ''
12
- }
13
- },
8
+ export const confluenceInlineComment = confluenceInlineCommentFactory({
14
9
  parseDOM: [{
15
10
  tag: 'span[data-mark-type="confluenceInlineComment"]'
16
11
  }],
@@ -20,4 +15,4 @@ export const confluenceInlineComment = {
20
15
  'data-reference': node.attrs.reference
21
16
  }];
22
17
  }
23
- };
18
+ });
@@ -1,3 +1,4 @@
1
+ import { dataConsumer as dataConsumerFactory } from '../../next-schema/generated/markTypes';
1
2
  import { isDOMElement } from '../../utils/parseDOM';
2
3
 
3
4
  /**
@@ -27,12 +28,7 @@ const parseDataConsumer = maybeValue => {
27
28
  return false;
28
29
  }
29
30
  };
30
- export const dataConsumer = {
31
- attrs: {
32
- sources: {
33
- default: []
34
- }
35
- },
31
+ export const dataConsumer = dataConsumerFactory({
36
32
  parseDOM: [{
37
33
  tag: '[data-mark-type="dataConsumer"]',
38
34
  getAttrs: maybeValue => parseDataConsumer(maybeValue)
@@ -44,7 +40,7 @@ export const dataConsumer = {
44
40
  'data-sources': JSON.stringify(mark.attrs.sources)
45
41
  }];
46
42
  }
47
- };
43
+ });
48
44
 
49
45
  /**
50
46
  * We want to ensure any "invalid ADF" doesn't get serialised, but the entire
@@ -1,13 +1,11 @@
1
- import { FONT_STYLE } from '../groups';
1
+ import { em as emFactory } from '../../next-schema/generated/markTypes';
2
2
 
3
3
  /**
4
4
  * @name em_mark
5
5
  */
6
6
 
7
7
  const emDOM = ['em'];
8
- export const em = {
9
- inclusive: true,
10
- group: FONT_STYLE,
8
+ export const em = emFactory({
11
9
  parseDOM: [{
12
10
  tag: 'i'
13
11
  }, {
@@ -18,4 +16,4 @@ export const em = {
18
16
  toDOM() {
19
17
  return emDOM;
20
18
  }
21
- };
19
+ });
@@ -1,3 +1,4 @@
1
+ import { fragment as fragmentFactory } from '../../next-schema/generated/markTypes';
1
2
  import { isDOMElement } from '../../utils/parseDOM';
2
3
 
3
4
  /**
@@ -21,17 +22,7 @@ const parseFragment = maybeValue => {
21
22
  name
22
23
  };
23
24
  };
24
- export const fragment = {
25
- inclusive: false,
26
- excludes: '',
27
- attrs: {
28
- localId: {
29
- default: ''
30
- },
31
- name: {
32
- default: null
33
- }
34
- },
25
+ export const fragment = fragmentFactory({
35
26
  parseDOM: [{
36
27
  tag: '[data-mark-type="fragment"]',
37
28
  getAttrs: maybeValue => parseFragment(maybeValue)
@@ -44,7 +35,7 @@ export const fragment = {
44
35
  'data-localId': mark.attrs.localId
45
36
  }];
46
37
  }
47
- };
38
+ });
48
39
  export const toJSON = mark => {
49
40
  return {
50
41
  type: mark.type.name,
@@ -1,15 +1,10 @@
1
- import { ALIGNMENT, INDENTATION } from '../groups';
1
+ import { indentation as indentationFactory } from '../../next-schema/generated/markTypes';
2
2
 
3
3
  /**
4
4
  * @name indentation_mark
5
5
  */
6
6
 
7
- export const indentation = {
8
- excludes: `indentation ${ALIGNMENT}`,
9
- group: INDENTATION,
10
- attrs: {
11
- level: {}
12
- },
7
+ export const indentation = indentationFactory({
13
8
  parseDOM: [{
14
9
  tag: 'div.fabric-editor-indentation-mark',
15
10
  getAttrs(dom) {
@@ -25,4 +20,4 @@ export const indentation = {
25
20
  'data-level': mark.attrs.level
26
21
  }, 0];
27
22
  }
28
- };
23
+ });
@@ -1,4 +1,4 @@
1
- import { LINK } from '../groups';
1
+ import { link as linkFactory } from '../../next-schema/generated/markTypes';
2
2
  import { isRootRelative, isSafeUrl, normalizeUrl } from '../../utils/url';
3
3
 
4
4
  /**
@@ -21,17 +21,7 @@ const getLinkAttrs = attribute => domNode => {
21
21
  attrs.href = normalizeUrl(href);
22
22
  return attrs;
23
23
  };
24
- export const link = {
25
- excludes: `${LINK}`,
26
- // ED-5844 No multiple links in media node
27
- group: LINK,
28
- attrs: {
29
- href: {},
30
- __confluenceMetadata: {
31
- default: null
32
- }
33
- },
34
- inclusive: false,
24
+ export const link = linkFactory({
35
25
  parseDOM: [{
36
26
  tag: '[data-block-link]',
37
27
  getAttrs: getLinkAttrs('data-block-link'),
@@ -69,7 +59,7 @@ export const link = {
69
59
  class: 'blockLink'
70
60
  }, 0];
71
61
  }
72
- };
62
+ });
73
63
  const OPTIONAL_ATTRS = ['title', 'id', 'collection', 'occurrenceKey', '__confluenceMetadata'];
74
64
  export const toJSON = mark => ({
75
65
  type: mark.type.name,
@@ -1,12 +1,10 @@
1
- import { FONT_STYLE } from '../groups';
1
+ import { strike as strikeFactory } from '../../next-schema/generated/markTypes';
2
2
 
3
3
  /**
4
4
  * @name strike_mark
5
5
  */
6
6
 
7
- export const strike = {
8
- inclusive: true,
9
- group: FONT_STYLE,
7
+ export const strike = strikeFactory({
10
8
  parseDOM: [{
11
9
  tag: 'strike'
12
10
  }, {
@@ -20,4 +18,4 @@ export const strike = {
20
18
  toDOM() {
21
19
  return ['s'];
22
20
  }
23
- };
21
+ });
@@ -1,13 +1,11 @@
1
- import { FONT_STYLE } from '../groups';
1
+ import { strong as strongFactory } from '../../next-schema/generated/markTypes';
2
2
 
3
3
  /**
4
4
  * @name strong_mark
5
5
  */
6
6
 
7
7
  const strongDOM = ['strong'];
8
- export const strong = {
9
- inclusive: true,
10
- group: FONT_STYLE,
8
+ export const strong = strongFactory({
11
9
  parseDOM: [{
12
10
  tag: 'strong'
13
11
  },
@@ -33,4 +31,4 @@ export const strong = {
33
31
  toDOM() {
34
32
  return strongDOM;
35
33
  }
36
- };
34
+ });
@@ -1,4 +1,4 @@
1
- import { FONT_STYLE } from '../groups';
1
+ import { subsup as subsupFactory } from '../../next-schema/generated/markTypes';
2
2
 
3
3
  /**
4
4
  * @name subsup_mark
@@ -15,14 +15,7 @@ function getAttrFromVerticalAlign(node) {
15
15
  }
16
16
  return false;
17
17
  }
18
- export const subsup = {
19
- inclusive: true,
20
- group: FONT_STYLE,
21
- attrs: {
22
- type: {
23
- default: 'sub'
24
- }
25
- },
18
+ export const subsup = subsupFactory({
26
19
  parseDOM: [{
27
20
  tag: 'sub',
28
21
  attrs: {
@@ -47,4 +40,4 @@ export const subsup = {
47
40
  toDOM(mark) {
48
41
  return [mark.attrs.type];
49
42
  }
50
- };
43
+ });