@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
@@ -1,6 +1,8 @@
1
1
  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
+ import { expand as expandFactory } from '../../next-schema/generated/nodeTypes';
5
+
4
6
  /**
5
7
  * @name expand_node
6
8
  */
@@ -20,21 +22,7 @@ function getExpandAttrs(domNode) {
20
22
  __expanded: true
21
23
  };
22
24
  }
23
- export var expand = {
24
- inline: false,
25
- group: 'block',
26
- marks: 'dataConsumer fragment unsupportedMark unsupportedNodeAttribute',
27
- content: '(paragraph | panel | blockquote | orderedList | bulletList | rule | heading | codeBlock | mediaGroup | mediaSingle | decisionList | taskList | table | blockCard | embedCard | extension | unsupportedBlock)+',
28
- isolating: true,
29
- selectable: true,
30
- attrs: {
31
- title: {
32
- default: ''
33
- },
34
- __expanded: {
35
- default: true
36
- }
37
- },
25
+ export var expand = expandFactory({
38
26
  parseDOM: [{
39
27
  context: 'table//',
40
28
  tag: 'div[data-node-type="expand"]',
@@ -65,7 +53,7 @@ export var expand = {
65
53
  };
66
54
  return ['div', attrs, 0];
67
55
  }
68
- };
56
+ });
69
57
  export var toJSON = function toJSON(node) {
70
58
  return {
71
59
  attrs: Object.keys(node.attrs).filter(function (key) {
@@ -1,4 +1,5 @@
1
1
  import { getExtensionAttrs } from '../../utils/extensions';
2
+ import { extension as extensionFactory } from '../../next-schema/generated/nodeTypes';
2
3
 
3
4
  /**
4
5
  * @name extension_node
@@ -8,51 +9,23 @@ import { getExtensionAttrs } from '../../utils/extensions';
8
9
  * @name extension_with_marks_node
9
10
  */
10
11
 
11
- var createExtensionNodeSpec = function createExtensionNodeSpec() {
12
- var nodeSpec = {
13
- inline: false,
14
- group: 'block',
15
- atom: true,
16
- selectable: true,
17
- attrs: {
18
- extensionType: {
19
- default: ''
20
- },
21
- extensionKey: {
22
- default: ''
23
- },
24
- parameters: {
25
- default: null
26
- },
27
- text: {
28
- default: null
29
- },
30
- layout: {
31
- default: 'default'
32
- },
33
- localId: {
34
- default: null
35
- }
36
- },
37
- parseDOM: [{
38
- tag: '[data-node-type="extension"]',
39
- getAttrs: function getAttrs(domNode) {
40
- return getExtensionAttrs(domNode);
41
- }
42
- }],
43
- toDOM: function toDOM(node) {
44
- var attrs = {
45
- 'data-node-type': 'extension',
46
- 'data-extension-type': node.attrs.extensionType,
47
- 'data-extension-key': node.attrs.extensionKey,
48
- 'data-text': node.attrs.text,
49
- 'data-parameters': JSON.stringify(node.attrs.parameters),
50
- 'data-layout': node.attrs.layout,
51
- 'data-local-id:': node.attrs.localId
52
- };
53
- return ['div', attrs];
12
+ export var extension = extensionFactory({
13
+ parseDOM: [{
14
+ tag: '[data-node-type="extension"]',
15
+ getAttrs: function getAttrs(domNode) {
16
+ return getExtensionAttrs(domNode);
54
17
  }
55
- };
56
- return nodeSpec;
57
- };
58
- export var extension = createExtensionNodeSpec();
18
+ }],
19
+ toDOM: function toDOM(node) {
20
+ var attrs = {
21
+ 'data-node-type': 'extension',
22
+ 'data-extension-type': node.attrs.extensionType,
23
+ 'data-extension-key': node.attrs.extensionKey,
24
+ 'data-text': node.attrs.text,
25
+ 'data-parameters': JSON.stringify(node.attrs.parameters),
26
+ 'data-layout': node.attrs.layout,
27
+ 'data-local-id:': node.attrs.localId
28
+ };
29
+ return ['div', attrs];
30
+ }
31
+ });
@@ -1,15 +1,14 @@
1
+ import { hardBreak as hardBreakFactory } from '../../next-schema/generated/nodeTypes';
2
+
1
3
  /**
2
4
  * @name hardBreak_node
3
5
  */
4
6
 
5
- export var hardBreak = {
6
- inline: true,
7
- group: 'inline',
8
- selectable: false,
7
+ export var hardBreak = hardBreakFactory({
9
8
  parseDOM: [{
10
9
  tag: 'br'
11
10
  }],
12
11
  toDOM: function toDOM() {
13
12
  return ['br'];
14
13
  }
15
- };
14
+ });
@@ -1,3 +1,5 @@
1
+ import { heading as headingFactory } from '../../next-schema/generated/nodeTypes';
2
+
1
3
  /**
2
4
  * @name heading_node
3
5
  */
@@ -24,19 +26,7 @@ var getAttrs = function getAttrs(level) {
24
26
  };
25
27
  };
26
28
  };
27
- export var heading = {
28
- attrs: {
29
- level: {
30
- default: 1
31
- },
32
- localId: {
33
- default: null
34
- }
35
- },
36
- content: "inline*",
37
- group: 'block',
38
- defining: true,
39
- selectable: false,
29
+ export var heading = headingFactory({
40
30
  parseDOM: [{
41
31
  tag: 'h1',
42
32
  getAttrs: getAttrs(1)
@@ -66,4 +56,4 @@ export var heading = {
66
56
  }] : [];
67
57
  return [name].concat(attrs, [0]);
68
58
  }
69
- };
59
+ });
@@ -1,18 +1,5 @@
1
- export var image = {
2
- group: 'inline',
3
- inline: true,
4
- attrs: {
5
- src: {
6
- default: ''
7
- },
8
- alt: {
9
- default: ''
10
- },
11
- title: {
12
- default: null
13
- }
14
- },
15
- draggable: true,
1
+ import { image as imageFactory } from '../../next-schema/generated/nodeTypes';
2
+ export var image = imageFactory({
16
3
  parseDOM: [{
17
4
  tag: 'img[src^="data:image/"]',
18
5
  ignore: true
@@ -30,4 +17,4 @@ export var image = {
30
17
  toDOM: function toDOM(node) {
31
18
  return ['img', node.attrs];
32
19
  }
33
- };
20
+ });
@@ -1,20 +1,10 @@
1
+ import { inlineCard as inlineCardFactory } from '../../next-schema/generated/nodeTypes';
2
+
1
3
  /**
2
4
  * @name inlineCard_node
3
5
  */
4
6
 
5
- export var inlineCard = {
6
- inline: true,
7
- group: 'inline',
8
- selectable: true,
9
- draggable: true,
10
- attrs: {
11
- url: {
12
- default: null
13
- },
14
- data: {
15
- default: null
16
- }
17
- },
7
+ export var inlineCard = inlineCardFactory({
18
8
  parseDOM: [{
19
9
  tag: 'a[data-inline-card], span[data-inline-card]',
20
10
  // bump priority higher than hyperlink
@@ -54,4 +44,4 @@ export var inlineCard = {
54
44
  return ['a', attrs];
55
45
  }
56
46
  }
57
- };
47
+ });
@@ -1,4 +1,5 @@
1
1
  import { getExtensionAttrs } from '../../utils/extensions';
2
+ import { inlineExtensionWithMarks as inlineExtensionWithMarksFactory } from '../../next-schema/generated/nodeTypes';
2
3
 
3
4
  /**
4
5
  * @name inlineExtension_node
@@ -8,46 +9,22 @@ import { getExtensionAttrs } from '../../utils/extensions';
8
9
  * @name inlineExtension_with_marks_node
9
10
  */
10
11
 
11
- var createInlineExtensionNodeSpec = function createInlineExtensionNodeSpec() {
12
- var nodeSpec = {
13
- inline: true,
14
- group: 'inline',
15
- selectable: true,
16
- attrs: {
17
- extensionType: {
18
- default: ''
19
- },
20
- extensionKey: {
21
- default: ''
22
- },
23
- parameters: {
24
- default: null
25
- },
26
- text: {
27
- default: null
28
- },
29
- localId: {
30
- default: null
31
- }
32
- },
33
- parseDOM: [{
34
- tag: 'span[data-extension-type]',
35
- getAttrs: function getAttrs(domNode) {
36
- return getExtensionAttrs(domNode, true);
37
- }
38
- }],
39
- toDOM: function toDOM(node) {
40
- var attrs = {
41
- 'data-extension-type': node.attrs.extensionType,
42
- 'data-extension-key': node.attrs.extensionKey,
43
- 'data-text': node.attrs.text,
44
- 'data-parameters': JSON.stringify(node.attrs.parameters),
45
- 'data-local-id:': node.attrs.localId,
46
- contenteditable: 'false'
47
- };
48
- return ['span', attrs];
12
+ export var inlineExtension = inlineExtensionWithMarksFactory({
13
+ parseDOM: [{
14
+ tag: 'span[data-extension-type]',
15
+ getAttrs: function getAttrs(domNode) {
16
+ return getExtensionAttrs(domNode, true);
49
17
  }
50
- };
51
- return nodeSpec;
52
- };
53
- export var inlineExtension = createInlineExtensionNodeSpec();
18
+ }],
19
+ toDOM: function toDOM(node) {
20
+ var attrs = {
21
+ 'data-extension-type': node.attrs.extensionType,
22
+ 'data-extension-key': node.attrs.extensionKey,
23
+ 'data-text': node.attrs.text,
24
+ 'data-parameters': JSON.stringify(node.attrs.parameters),
25
+ 'data-local-id:': node.attrs.localId,
26
+ contenteditable: 'false'
27
+ };
28
+ return ['span', attrs];
29
+ }
30
+ });
@@ -1,17 +1,10 @@
1
+ import { layoutColumn as layoutColumnFactory } from '../../next-schema/generated/nodeTypes';
2
+
1
3
  /**
2
4
  * @name layoutColumn_node
3
5
  */
4
6
 
5
- export var layoutColumn = {
6
- content: '(block|unsupportedBlock)+',
7
- isolating: true,
8
- marks: 'alignment indentation dataConsumer fragment unsupportedMark unsupportedNodeAttribute',
9
- selectable: false,
10
- attrs: {
11
- width: {
12
- default: undefined
13
- }
14
- },
7
+ export var layoutColumn = layoutColumnFactory({
15
8
  parseDOM: [{
16
9
  context: 'layoutColumn//',
17
10
  tag: 'div[data-layout-column]',
@@ -32,7 +25,7 @@ export var layoutColumn = {
32
25
  var width = node.attrs.width;
33
26
  if (width) {
34
27
  attrs['style'] = "flex-basis: ".concat(width, "%");
35
- attrs['data-column-width'] = width;
28
+ attrs['data-column-width'] = "".concat(width);
36
29
  }
37
30
 
38
31
  // We need to apply a attribute to the inner most child to help
@@ -42,4 +35,4 @@ export var layoutColumn = {
42
35
  };
43
36
  return ['div', attrs, ['div', contentAttrs, 0]];
44
37
  }
45
- };
38
+ });
@@ -1,3 +1,6 @@
1
+ import { layoutSection as layoutSectionFactory } from '../../next-schema/generated/nodeTypes';
2
+ import { layoutSectionFull as layoutSectionFullFactory } from '../../next-schema/generated/nodeTypes';
3
+
1
4
  /**
2
5
  * @name layoutSection_node
3
6
  */
@@ -15,10 +18,7 @@
15
18
  * @name layoutSection_with_single_column_node
16
19
  */
17
20
 
18
- export var layoutSection = {
19
- content: '(layoutColumn | unsupportedBlock){1,3} unsupportedBlock* | unsupportedBlock+',
20
- marks: 'unsupportedMark unsupportedNodeAttribute',
21
- isolating: true,
21
+ export var layoutSection = layoutSectionFactory({
22
22
  parseDOM: [{
23
23
  context: 'layoutSection//|layoutColumn//',
24
24
  tag: 'div[data-layout-section]',
@@ -32,11 +32,25 @@ export var layoutSection = {
32
32
  };
33
33
  return ['div', attrs, 0];
34
34
  }
35
- };
36
- export var layoutSectionWithSingleColumn = {
37
- content: '(layoutColumn | unsupportedBlock){1,3} unsupportedBlock* | unsupportedBlock+',
38
- marks: 'unsupportedMark unsupportedNodeAttribute',
39
- isolating: true,
35
+ });
36
+ export var layoutSectionFull = layoutSectionFullFactory({
37
+ parseDOM: [{
38
+ context: 'layoutSection//|layoutColumn//',
39
+ tag: 'div[data-layout-section]',
40
+ skip: true
41
+ }, {
42
+ tag: 'div[data-layout-section]'
43
+ }],
44
+ toDOM: function toDOM() {
45
+ var attrs = {
46
+ 'data-layout-section': 'true'
47
+ };
48
+ return ['div', attrs, 0];
49
+ }
50
+ });
51
+
52
+ // it's same as layoutSection
53
+ export var layoutSectionWithSingleColumn = layoutSectionFactory({
40
54
  parseDOM: [{
41
55
  context: 'layoutSection//|layoutColumn//',
42
56
  tag: 'div[data-layout-section]',
@@ -50,4 +64,4 @@ export var layoutSectionWithSingleColumn = {
50
64
  };
51
65
  return ['div', attrs, 0];
52
66
  }
53
- };
67
+ });
@@ -1,29 +1,23 @@
1
- export var listItem = {
2
- content: '(paragraph | mediaSingle | codeBlock | unsupportedBlock) (paragraph | bulletList | orderedList | mediaSingle | codeBlock | unsupportedBlock)*',
3
- marks: 'unsupportedMark unsupportedNodeAttribute',
4
- defining: true,
5
- selectable: false,
1
+ import { listItem as listItemFactory } from '../../next-schema/generated/nodeTypes';
2
+ import { listItemLegacy as listItemLegacyFactory } from '../../next-schema/generated/nodeTypes';
3
+ export var listItem = listItemLegacyFactory({
6
4
  parseDOM: [{
7
5
  tag: 'li'
8
6
  }],
9
7
  toDOM: function toDOM() {
10
8
  return ['li', 0];
11
9
  }
12
- };
10
+ });
13
11
 
14
12
  /**
15
13
  * @name list_item_with_task
16
14
  * @description this node allows task-list to be nested inside list-item
17
15
  */
18
- export var listItemWithTask = {
19
- content: '(paragraph | mediaSingle | codeBlock | unsupportedBlock) (paragraph | bulletList | orderedList | taskList | mediaSingle | codeBlock | unsupportedBlock)*',
20
- marks: 'unsupportedMark unsupportedNodeAttribute',
21
- defining: true,
22
- selectable: false,
16
+ export var listItemWithTask = listItemFactory({
23
17
  parseDOM: [{
24
18
  tag: 'li'
25
19
  }],
26
20
  toDOM: function toDOM() {
27
21
  return ['li', 0];
28
22
  }
29
- };
23
+ });
@@ -1,3 +1,5 @@
1
+ import { mediaGroup as mediaGroupFactory } from '../../next-schema/generated/nodeTypes';
2
+
1
3
  /**
2
4
  * @name mediaGroup_node
3
5
  */
@@ -5,13 +7,7 @@
5
7
  // Temporary due to an existing issue in validator below:
6
8
  // https://product-fabric.atlassian.net/jira/servicedesk/projects/DTR/queues/issue/DTR-1429
7
9
  // TODO: Remove border and link marks from white list
8
- export var mediaGroup = {
9
- inline: false,
10
- group: 'block',
11
- content: '(media|unsupportedBlock)+',
12
- attrs: {},
13
- marks: 'unsupportedMark unsupportedNodeAttribute annotation border link',
14
- selectable: false,
10
+ export var mediaGroup = mediaGroupFactory({
15
11
  parseDOM: [{
16
12
  tag: 'div[data-node-type="mediaGroup"]'
17
13
  }, {
@@ -22,4 +18,4 @@ export var mediaGroup = {
22
18
  'data-node-type': 'mediaGroup'
23
19
  }, 0];
24
20
  }
25
- };
21
+ });
@@ -1,7 +1,8 @@
1
- import { createMediaSpec, defaultAttrs } from './media';
1
+ import { createMediaSpec } from './media';
2
+ import { mediaInline as mediaInlineFactory } from '../../next-schema/generated/nodeTypes';
2
3
 
3
4
  /**
4
5
  * @name mediaInline_node
5
6
  */
6
7
 
7
- export var mediaInline = createMediaSpec(defaultAttrs, true);
8
+ export var mediaInline = createMediaSpec(mediaInlineFactory({}).attrs, true);
@@ -3,6 +3,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
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 { WidthType } from './types/rich-media-common';
5
5
  import { isDOMElement } from '../../utils/parseDOM';
6
+ import { mediaSingle as mediaSingleFactory, mediaSingleCaption as mediaSingleCaptionFactory, mediaSingleFull as mediaSingleFullFactory, mediaSingleWidthType as mediaSingleWidthTypeFactory } from '../../next-schema/generated/nodeTypes';
6
7
 
7
8
  /**
8
9
  * @name mediaSingle_node
@@ -39,8 +40,6 @@ export var mediaSingleSpec = function mediaSingleSpec(_ref) {
39
40
  withCaption = _ref$withCaption === void 0 ? false : _ref$withCaption,
40
41
  _ref$withExtendedWidt = _ref.withExtendedWidthTypes,
41
42
  withExtendedWidthTypes = _ref$withExtendedWidt === void 0 ? false : _ref$withExtendedWidt;
42
- var content = withCaption ? 'media|unsupportedBlock+|media (caption|unsupportedBlock) unsupportedBlock*' : 'media|unsupportedBlock+|media unsupportedBlock+';
43
- var atom = !withCaption;
44
43
  var getAttrs = function getAttrs(dom) {
45
44
  if (!isDOMElement(dom)) {
46
45
  // this should never happen
@@ -90,18 +89,40 @@ export var mediaSingleSpec = function mediaSingleSpec(_ref) {
90
89
  }
91
90
  return attrs;
92
91
  };
93
- return {
94
- inline: false,
95
- group: 'block',
96
- selectable: true,
97
- atom: atom,
98
- content: content,
99
- attrs: withExtendedWidthTypes ? _objectSpread(_objectSpread({}, defaultAttrs), {}, {
100
- widthType: {
101
- default: null
92
+ if (withExtendedWidthTypes && withCaption) {
93
+ return mediaSingleFullFactory({
94
+ parseDOM: [{
95
+ tag: 'div[data-node-type="mediaSingle"]',
96
+ getAttrs: getAttrs
97
+ }],
98
+ toDOM: function toDOM(node) {
99
+ return ['div', getAttrsFromNode(node), 0];
100
+ }
101
+ });
102
+ }
103
+ if (withExtendedWidthTypes && !withCaption) {
104
+ return mediaSingleWidthTypeFactory({
105
+ parseDOM: [{
106
+ tag: 'div[data-node-type="mediaSingle"]',
107
+ getAttrs: getAttrs
108
+ }],
109
+ toDOM: function toDOM(node) {
110
+ return ['div', getAttrsFromNode(node), 0];
102
111
  }
103
- }) : defaultAttrs,
104
- marks: 'unsupportedMark unsupportedNodeAttribute annotation border link',
112
+ });
113
+ }
114
+ if (!withExtendedWidthTypes && withCaption) {
115
+ return mediaSingleCaptionFactory({
116
+ parseDOM: [{
117
+ tag: 'div[data-node-type="mediaSingle"]',
118
+ getAttrs: getAttrs
119
+ }],
120
+ toDOM: function toDOM(node) {
121
+ return ['div', getAttrsFromNode(node), 0];
122
+ }
123
+ });
124
+ }
125
+ return mediaSingleFactory({
105
126
  parseDOM: [{
106
127
  tag: 'div[data-node-type="mediaSingle"]',
107
128
  getAttrs: getAttrs
@@ -109,7 +130,7 @@ export var mediaSingleSpec = function mediaSingleSpec(_ref) {
109
130
  toDOM: function toDOM(node) {
110
131
  return ['div', getAttrsFromNode(node), 0];
111
132
  }
112
- };
133
+ });
113
134
  };
114
135
  export var mediaSingle = mediaSingleSpec({
115
136
  withCaption: false,
@@ -1,59 +1,12 @@
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; }
4
1
  import { N30 } from '../../utils/colors';
2
+ import { media as mediaFactory } from '../../next-schema/generated/nodeTypes';
3
+ import { mediaInline as mediaInlineFactory } from '../../next-schema/generated/nodeTypes';
5
4
 
6
5
  /**
7
6
  * @name media_node
8
7
  */
9
8
 
10
- export var defaultAttrs = {
11
- id: {
12
- default: ''
13
- },
14
- type: {
15
- default: 'file'
16
- },
17
- collection: {
18
- default: ''
19
- },
20
- occurrenceKey: {
21
- default: null
22
- },
23
- alt: {
24
- default: ''
25
- },
26
- width: {
27
- default: null
28
- },
29
- height: {
30
- default: null
31
- },
32
- url: {
33
- default: null
34
- },
35
- __fileName: {
36
- default: null
37
- },
38
- __fileSize: {
39
- default: null
40
- },
41
- __fileMimeType: {
42
- default: null
43
- },
44
- __displayType: {
45
- default: null
46
- },
47
- __contextId: {
48
- default: null
49
- },
50
- __mediaTraceId: {
51
- default: null
52
- },
53
- __external: {
54
- default: false
55
- }
56
- };
9
+ export var defaultAttrs = mediaFactory({}).attrs;
57
10
  export var createMediaSpec = function createMediaSpec(attributes) {
58
11
  var inline = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
59
12
  var domNodeType = inline ? 'span' : 'div';
@@ -108,41 +61,42 @@ export var createMediaSpec = function createMediaSpec(attributes) {
108
61
  }
109
62
  });
110
63
  }
111
- return _objectSpread(_objectSpread({
112
- selectable: true,
113
- inline: inline
114
- }, inline && {
115
- group: 'inline'
116
- }), {}, {
117
- attrs: attributes,
64
+ var toDOM = function toDOM(node) {
65
+ var attrs = {
66
+ 'data-id': node.attrs.id,
67
+ 'data-node-type': "".concat(nodeName),
68
+ 'data-type': node.attrs.type,
69
+ 'data-collection': node.attrs.collection,
70
+ 'data-occurrence-key': node.attrs.occurrenceKey,
71
+ 'data-width': node.attrs.width,
72
+ 'data-height': node.attrs.height,
73
+ 'data-url': node.attrs.url,
74
+ 'data-alt': node.attrs.alt,
75
+ // toDOM is used for static rendering as well as editor rendering. This comes into play for
76
+ // emails, copy/paste, etc, so the title and styling here *is* useful (despite a React-based
77
+ // node view being used for editing).
78
+ title: 'Attachment',
79
+ // Manually kept in sync with the style of media cards. The goal is to render a plain gray
80
+ // rectangle that provides an affordance for media.
81
+ style: "display: inline-block; border-radius: 3px; background: ".concat(N30, "; box-shadow: 0 1px 1px rgba(9, 30, 66, 0.2), 0 0 1px 0 rgba(9, 30, 66, 0.24);")
82
+ };
83
+ copyPrivateAttributes(node.attrs, attrs, function (key) {
84
+ return "data-".concat(camelCaseToKebabCase(key.slice(2)));
85
+ });
86
+ return ["".concat(domNodeType), attrs];
87
+ };
88
+ if (inline) {
89
+ return mediaInlineFactory({
90
+ parseDOM: parseDOM,
91
+ toDOM: toDOM
92
+ });
93
+ }
94
+ return mediaFactory({
118
95
  parseDOM: parseDOM,
119
- toDOM: function toDOM(node) {
120
- var attrs = {
121
- 'data-id': node.attrs.id,
122
- 'data-node-type': "".concat(nodeName),
123
- 'data-type': node.attrs.type,
124
- 'data-collection': node.attrs.collection,
125
- 'data-occurrence-key': node.attrs.occurrenceKey,
126
- 'data-width': node.attrs.width,
127
- 'data-height': node.attrs.height,
128
- 'data-url': node.attrs.url,
129
- 'data-alt': node.attrs.alt,
130
- // toDOM is used for static rendering as well as editor rendering. This comes into play for
131
- // emails, copy/paste, etc, so the title and styling here *is* useful (despite a React-based
132
- // node view being used for editing).
133
- title: 'Attachment',
134
- // Manually kept in sync with the style of media cards. The goal is to render a plain gray
135
- // rectangle that provides an affordance for media.
136
- style: "display: inline-block; border-radius: 3px; background: ".concat(N30, "; box-shadow: 0 1px 1px rgba(9, 30, 66, 0.2), 0 0 1px 0 rgba(9, 30, 66, 0.24);")
137
- };
138
- copyPrivateAttributes(node.attrs, attrs, function (key) {
139
- return "data-".concat(camelCaseToKebabCase(key.slice(2)));
140
- });
141
- return ["".concat(domNodeType), attrs];
142
- }
96
+ toDOM: toDOM
143
97
  });
144
98
  };
145
- export var media = createMediaSpec(defaultAttrs);
99
+ export var media = createMediaSpec(defaultAttrs, false);
146
100
  export var camelCaseToKebabCase = function camelCaseToKebabCase(str) {
147
101
  return str.replace(/([^A-Z]+)([A-Z])/g, function (_, x, y) {
148
102
  return "".concat(x, "-").concat(y.toLowerCase());