@atlaskit/adf-schema 28.1.6 → 28.1.8

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 (535) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/types/schema/default-schema.d.ts +2 -2
  3. package/dist/types/schema/jira-schema.d.ts +1 -1
  4. package/dist/types/schema/marks/data-consumer.d.ts +2 -2
  5. package/dist/types/schema/marks/fragment.d.ts +1 -1
  6. package/dist/types/schema/marks/link.d.ts +2 -2
  7. package/dist/types/schema/nodes/bodied-extension.d.ts +0 -1
  8. package/dist/types/schema/nodes/code-block.d.ts +1 -1
  9. package/dist/types/schema/nodes/expand.d.ts +2 -2
  10. package/dist/types/schema/nodes/extension.d.ts +0 -1
  11. package/dist/types/schema/nodes/inline-extension.d.ts +0 -1
  12. package/dist/types/schema/nodes/media-single.d.ts +1 -1
  13. package/dist/types/schema/nodes/media.d.ts +2 -2
  14. package/dist/types/schema/nodes/mention.d.ts +2 -2
  15. package/dist/types/schema/nodes/panel.d.ts +0 -1
  16. package/dist/types/schema/nodes/tableNodes.d.ts +2 -2
  17. package/dist/types/schema/nodes/unknown-block.d.ts +0 -1
  18. package/dist/types/steps/analytics.d.ts +4 -4
  19. package/dist/types/steps/link-meta-step.d.ts +4 -4
  20. package/dist/types/steps/set-attrs.d.ts +2 -2
  21. package/dist/types/steps/table/sort-column.d.ts +4 -4
  22. package/dist/types/steps/type-ahead.d.ts +4 -4
  23. package/index.ts +275 -0
  24. package/package.json +5 -5
  25. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/blockQuote-with-attrs.json +17 -0
  26. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/blockQuote-with-empty-content.json +10 -0
  27. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/blockQuote-with-marks.json +17 -0
  28. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/blockQuote-without-content.json +9 -0
  29. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/blockquote-with-list-inside.json +24 -0
  30. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/bodied-extension-with-nested-bodiedExtension.json +28 -0
  31. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/bodied-extension-without-content.json +13 -0
  32. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/bodied-extension-without-extensionKey.json +18 -0
  33. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/bodied-extension-without-extensionType.json +18 -0
  34. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/bulletList-with-attrs.json +17 -0
  35. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/bulletList-with-empty-content.json +10 -0
  36. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/bulletList-with-marks.json +24 -0
  37. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/bulletList-with-not-listItem-content.json +18 -0
  38. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/bulletList-without-content.json +9 -0
  39. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/code-and-em.json +23 -0
  40. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/code-and-strike.json +23 -0
  41. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/code-and-strong.json +23 -0
  42. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/code-and-subsup.json +23 -0
  43. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/code-and-underline.json +23 -0
  44. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/code-with-attrs.json +21 -0
  45. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/codeBlock-with-non-text.json +14 -0
  46. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/codeBlock-with-strong.json +20 -0
  47. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/codeBlock-with-unknown-attribute.json +13 -0
  48. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/codeBlock-with-unsupported-marks.json +14 -0
  49. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/decision-with-blockquote.json +31 -0
  50. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/decisionList-with-empty-decision.json +23 -0
  51. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/decisionList-with-no-decision.json +13 -0
  52. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/doc-with-attrs.json +10 -0
  53. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/doc-with-marks.json +10 -0
  54. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/doc-without-content.json +4 -0
  55. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/doc-without-version.json +4 -0
  56. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/em-with-attrs.json +21 -0
  57. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/emoji-as-top-level-node.json +12 -0
  58. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/emoji-with-content.json +23 -0
  59. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/emoji-with-empty-attrs.json +15 -0
  60. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/emoji-with-marks.json +18 -0
  61. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/emoji-with-unknown-attr.json +18 -0
  62. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/emoji-without-attrs.json +14 -0
  63. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/expand-nested-with-marks.json +60 -0
  64. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/expand-with-breakout-inside-of-layout.json +50 -0
  65. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/extension-with-content.json +19 -0
  66. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/extension-with-empty-local-id.json +16 -0
  67. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/extension-without-extensionKey.json +12 -0
  68. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/extension-without-extensionType.json +12 -0
  69. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/hardBreak-with-marks.json +18 -0
  70. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/hardBreak-with-wrong-text.json +17 -0
  71. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/heading-with-invalid-level-attr.json +18 -0
  72. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/heading-with-non-text-block.json +14 -0
  73. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/heading-with-non-text-inline.json +18 -0
  74. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/heading-with-unknown-attrs.json +19 -0
  75. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/heading-with-unsupported-mark.json +23 -0
  76. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/heading-without-attrs.json +10 -0
  77. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/inlineExtension-with-content.json +24 -0
  78. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/inlineExtension-without-extensionKey.json +17 -0
  79. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/inlineExtension-without-extensionType.json +17 -0
  80. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/layoutSection-with-missing-layoutColumn.json +10 -0
  81. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/layoutSection-with-one-column.json +24 -0
  82. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/layoutSection-with-overflow-width.json +37 -0
  83. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/layoutSection-with-two-columns-and-breakout-code-block.json +38 -0
  84. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/link-with-empty-attrs.json +21 -0
  85. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/link-with-unknown-attr.json +21 -0
  86. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/link-without-attrs.json +20 -0
  87. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/list-with-blockquote.json +27 -0
  88. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/listItem-with-attrs.json +24 -0
  89. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/listItem-with-empty-content.json +15 -0
  90. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/listItem-with-list-as-first-child.json +30 -0
  91. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/listItem-with-marks.json +24 -0
  92. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/media-as-top-level-node.json +13 -0
  93. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/media-with-empty-attrs.json +15 -0
  94. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/media-with-invalid-alt-text.json +29 -0
  95. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/media-with-invalid-occurrence-key-attr.json +20 -0
  96. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/media-with-marks.json +19 -0
  97. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/media-with-unknown-attr.json +19 -0
  98. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/media-without-attrs.json +14 -0
  99. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/media-without-id-attr.json +17 -0
  100. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/media-without-type-attr.json +17 -0
  101. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/mediaGroup-with-attrs.json +19 -0
  102. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/mediaGroup-with-empty-content.json +10 -0
  103. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/mediaGroup-with-marks.json +19 -0
  104. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/mediaGroup-without-content.json +9 -0
  105. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/mediaInline-with-subsup-mark.json +30 -0
  106. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/mediaSingle-with-empty-attrs.json +11 -0
  107. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/mediaSingle-with-empty-content.json +10 -0
  108. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/mediaSingle-with-invalid-caption.json +46 -0
  109. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/mediaSingle-with-invalid-layout-attr.json +38 -0
  110. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/mediaSingle-with-negative-width.json +22 -0
  111. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/mediaSingle-with-overflow-width.json +22 -0
  112. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/mediaSingle-with-zero-width.json +22 -0
  113. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/mention-with-extra-attrs.json +19 -0
  114. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/mention-with-invalid-user-type.json +19 -0
  115. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/mention-with-marks.json +19 -0
  116. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/mention-without-attrs.json +14 -0
  117. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/mono-with-attrs.json +21 -0
  118. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/orderedList-with-extra-attrs.json +34 -0
  119. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/orderedList-with-marks.json +34 -0
  120. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/orderedList-without-content.json +15 -0
  121. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/panel-with-blockquote.json +25 -0
  122. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/panel-with-codeBlock.json +22 -0
  123. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/panel-with-empty-attrs.json +19 -0
  124. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/panel-with-marks.json +22 -0
  125. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/panel-with-panel.json +25 -0
  126. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/panel-with-unknown-attr.json +22 -0
  127. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/panel-without-attrs.json +18 -0
  128. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/paragraph-with-text-with-unknown-mark.json +20 -0
  129. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/paragraph-with-top-level-content.json +14 -0
  130. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/paragraph-with-unsupported-marks.json +20 -0
  131. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/placeholder-with-content.json +23 -0
  132. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/placeholder-with-empty-attrs.json +15 -0
  133. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/rule-with-attrs.json +10 -0
  134. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/rule-with-content.json +10 -0
  135. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/rule-with-marks.json +10 -0
  136. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/status-with-extra-attr.json +24 -0
  137. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/status-without-attrs.json +18 -0
  138. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/status-without-color-attr.json +22 -0
  139. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/status-without-text-attr.json +22 -0
  140. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/strike-with-attrs.json +21 -0
  141. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/strong-with-attrs.json +21 -0
  142. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/subsup-with-extra-attrs.json +24 -0
  143. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/subsup-with-invalid-type-attr.json +23 -0
  144. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/subsup-without-attrs.json +20 -0
  145. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/subsup-without-type-attr.json +21 -0
  146. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/table-with-breakout-code-block.json +33 -0
  147. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/table-with-fragment-mark-with-empty-local-id.json +41 -0
  148. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/table-with-fragment-mark-without-local-id.json +40 -0
  149. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/table-with-nested-table.json +50 -0
  150. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/table-without-cells.json +15 -0
  151. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/table-without-rows.json +10 -0
  152. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/task-with-blockquote.json +31 -0
  153. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/task-with-invalid-state.json +27 -0
  154. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/taskItem-with-nested-taskItem.json +70 -0
  155. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/taskList-with-empty-task.json +23 -0
  156. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/taskList-with-no-task.json +13 -0
  157. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/taskList-with-taskList-as-first-child.json +48 -0
  158. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/text-empty.json +15 -0
  159. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/textColor-with-extra-attrs.json +24 -0
  160. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/textColor-with-invalid-color-attr.json +23 -0
  161. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/textColor-without-attrs.json +20 -0
  162. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/textColor-without-color-attr.json +21 -0
  163. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/underline-with-attrs.json +21 -0
  164. package/src/__tests__/unit/json-schema/v1-reference/full/valid/annotation.json +28 -0
  165. package/src/__tests__/unit/json-schema/v1-reference/full/valid/blockQuote-with-content.json +16 -0
  166. package/src/__tests__/unit/json-schema/v1-reference/full/valid/bodied-Extension-with-rich-body.json +27 -0
  167. package/src/__tests__/unit/json-schema/v1-reference/full/valid/bodied-extension-with-empty-content.json +19 -0
  168. package/src/__tests__/unit/json-schema/v1-reference/full/valid/bodied-extension-with-media-link.json +41 -0
  169. package/src/__tests__/unit/json-schema/v1-reference/full/valid/bodied-extension-with-nested-extension.json +33 -0
  170. package/src/__tests__/unit/json-schema/v1-reference/full/valid/bodied-extension-with-parameters.json +30 -0
  171. package/src/__tests__/unit/json-schema/v1-reference/full/valid/bodiedExtension-with-data-consumer-mark.json +47 -0
  172. package/src/__tests__/unit/json-schema/v1-reference/full/valid/bulletList-with-content.json +23 -0
  173. package/src/__tests__/unit/json-schema/v1-reference/full/valid/codeBlock-empty-attrs.json +11 -0
  174. package/src/__tests__/unit/json-schema/v1-reference/full/valid/codeBlock-empty-content.json +10 -0
  175. package/src/__tests__/unit/json-schema/v1-reference/full/valid/codeBlock-with-breakout-mark.json +14 -0
  176. package/src/__tests__/unit/json-schema/v1-reference/full/valid/codeBlock-with-empty-marks.json +13 -0
  177. package/src/__tests__/unit/json-schema/v1-reference/full/valid/codeBlock-with-language.json +482 -0
  178. package/src/__tests__/unit/json-schema/v1-reference/full/valid/codeBlock-with-multiple-text.json +19 -0
  179. package/src/__tests__/unit/json-schema/v1-reference/full/valid/codeBlock-with-text.json +15 -0
  180. package/src/__tests__/unit/json-schema/v1-reference/full/valid/codeBlock-with-unknown-language.json +13 -0
  181. package/src/__tests__/unit/json-schema/v1-reference/full/valid/decision-with-mention.json +34 -0
  182. package/src/__tests__/unit/json-schema/v1-reference/full/valid/decisionList-with-decision.json +27 -0
  183. package/src/__tests__/unit/json-schema/v1-reference/full/valid/doc-with-all-content.json +32 -0
  184. package/src/__tests__/unit/json-schema/v1-reference/full/valid/doc-with-content.json +9 -0
  185. package/src/__tests__/unit/json-schema/v1-reference/full/valid/doc-with-empty-content.json +5 -0
  186. package/src/__tests__/unit/json-schema/v1-reference/full/valid/embed-card.json +17 -0
  187. package/src/__tests__/unit/json-schema/v1-reference/full/valid/emoji-with-fallback.json +19 -0
  188. package/src/__tests__/unit/json-schema/v1-reference/full/valid/emoji-with-variation.json +18 -0
  189. package/src/__tests__/unit/json-schema/v1-reference/full/valid/emoji.json +17 -0
  190. package/src/__tests__/unit/json-schema/v1-reference/full/valid/expand-with-embed-card.json +34 -0
  191. package/src/__tests__/unit/json-schema/v1-reference/full/valid/expand-with-marks.json +26 -0
  192. package/src/__tests__/unit/json-schema/v1-reference/full/valid/expand-with-nestedExpand.json +136 -0
  193. package/src/__tests__/unit/json-schema/v1-reference/full/valid/expand.json +18 -0
  194. package/src/__tests__/unit/json-schema/v1-reference/full/valid/extension-with-data-consumer-mark.json +23 -0
  195. package/src/__tests__/unit/json-schema/v1-reference/full/valid/extension-with-empty-marks.json +17 -0
  196. package/src/__tests__/unit/json-schema/v1-reference/full/valid/extension-with-local-id.json +16 -0
  197. package/src/__tests__/unit/json-schema/v1-reference/full/valid/extension-with-named-fragment-mark.json +25 -0
  198. package/src/__tests__/unit/json-schema/v1-reference/full/valid/extension-with-parameters.json +24 -0
  199. package/src/__tests__/unit/json-schema/v1-reference/full/valid/hardBreak-empty-attrs.json +15 -0
  200. package/src/__tests__/unit/json-schema/v1-reference/full/valid/hardBreak-with-text.json +17 -0
  201. package/src/__tests__/unit/json-schema/v1-reference/full/valid/hardBreak.json +14 -0
  202. package/src/__tests__/unit/json-schema/v1-reference/full/valid/heading-with-code-text.json +23 -0
  203. package/src/__tests__/unit/json-schema/v1-reference/full/valid/heading-with-content.json +78 -0
  204. package/src/__tests__/unit/json-schema/v1-reference/full/valid/heading-with-em-text.json +23 -0
  205. package/src/__tests__/unit/json-schema/v1-reference/full/valid/heading-with-empty-content.json +78 -0
  206. package/src/__tests__/unit/json-schema/v1-reference/full/valid/heading-with-empty-marks.json +14 -0
  207. package/src/__tests__/unit/json-schema/v1-reference/full/valid/heading-with-link-text.json +26 -0
  208. package/src/__tests__/unit/json-schema/v1-reference/full/valid/heading-with-strike-text.json +23 -0
  209. package/src/__tests__/unit/json-schema/v1-reference/full/valid/heading-with-strong-text.json +23 -0
  210. package/src/__tests__/unit/json-schema/v1-reference/full/valid/heading-with-subsup-text.json +26 -0
  211. package/src/__tests__/unit/json-schema/v1-reference/full/valid/heading-with-supported-mark.json +26 -0
  212. package/src/__tests__/unit/json-schema/v1-reference/full/valid/heading-with-underline-text.json +23 -0
  213. package/src/__tests__/unit/json-schema/v1-reference/full/valid/inlineExtension-with-data-consumer-mark.json +48 -0
  214. package/src/__tests__/unit/json-schema/v1-reference/full/valid/inlineExtension-with-fragment-mark.json +27 -0
  215. package/src/__tests__/unit/json-schema/v1-reference/full/valid/inlineExtension-with-parameters.json +29 -0
  216. package/src/__tests__/unit/json-schema/v1-reference/full/valid/inlineExtension-without-parameters.json +18 -0
  217. package/src/__tests__/unit/json-schema/v1-reference/full/valid/layout-with-embed.json +51 -0
  218. package/src/__tests__/unit/json-schema/v1-reference/full/valid/layoutSection-with-three-columns.json +50 -0
  219. package/src/__tests__/unit/json-schema/v1-reference/full/valid/layoutSection-with-two-columns-and-breakout.json +40 -0
  220. package/src/__tests__/unit/json-schema/v1-reference/full/valid/layoutSection-with-two-columns.json +37 -0
  221. package/src/__tests__/unit/json-schema/v1-reference/full/valid/link-with-href-title.json +24 -0
  222. package/src/__tests__/unit/json-schema/v1-reference/full/valid/link-with-href.json +23 -0
  223. package/src/__tests__/unit/json-schema/v1-reference/full/valid/list-item-with-bullet-list-and-media-single.json +47 -0
  224. package/src/__tests__/unit/json-schema/v1-reference/full/valid/list-item-with-media-single-and-bullet-list.json +57 -0
  225. package/src/__tests__/unit/json-schema/v1-reference/full/valid/list-item-with-ordered-list.json +37 -0
  226. package/src/__tests__/unit/json-schema/v1-reference/full/valid/list-item-with-paragraph.json +23 -0
  227. package/src/__tests__/unit/json-schema/v1-reference/full/valid/list-with-codeBlock.json +23 -0
  228. package/src/__tests__/unit/json-schema/v1-reference/full/valid/listItem-with-content.json +23 -0
  229. package/src/__tests__/unit/json-schema/v1-reference/full/valid/media-external-with-alt-text-value.json +26 -0
  230. package/src/__tests__/unit/json-schema/v1-reference/full/valid/media-single-with-a-link-mark-in-a-layout-column.json +57 -0
  231. package/src/__tests__/unit/json-schema/v1-reference/full/valid/media-single-with-a-link-mark-in-a-list-item.json +88 -0
  232. package/src/__tests__/unit/json-schema/v1-reference/full/valid/media-single-with-a-link-mark-in-a-nested-expand.json +64 -0
  233. package/src/__tests__/unit/json-schema/v1-reference/full/valid/media-single-with-a-link-mark-in-a-table.json +56 -0
  234. package/src/__tests__/unit/json-schema/v1-reference/full/valid/media-single-with-a-link-mark-in-an-expand.json +44 -0
  235. package/src/__tests__/unit/json-schema/v1-reference/full/valid/media-with-alt-text-value.json +29 -0
  236. package/src/__tests__/unit/json-schema/v1-reference/full/valid/media-with-alt-text.json +29 -0
  237. package/src/__tests__/unit/json-schema/v1-reference/full/valid/media-with-link-mark.json +36 -0
  238. package/src/__tests__/unit/json-schema/v1-reference/full/valid/media-with-occurrence-key.json +20 -0
  239. package/src/__tests__/unit/json-schema/v1-reference/full/valid/media-with-type-link.json +19 -0
  240. package/src/__tests__/unit/json-schema/v1-reference/full/valid/media.json +19 -0
  241. package/src/__tests__/unit/json-schema/v1-reference/full/valid/mediaGroup-with-multiple-media.json +27 -0
  242. package/src/__tests__/unit/json-schema/v1-reference/full/valid/mediaInline-with-file-type-attr.json +23 -0
  243. package/src/__tests__/unit/json-schema/v1-reference/full/valid/mediaInline-with-link-mark.json +30 -0
  244. package/src/__tests__/unit/json-schema/v1-reference/full/valid/mediaInline-with-link-type-attr.json +23 -0
  245. package/src/__tests__/unit/json-schema/v1-reference/full/valid/mediaInline.json +22 -0
  246. package/src/__tests__/unit/json-schema/v1-reference/full/valid/mediaSingle-with-caption-inside-list-item.json +38 -0
  247. package/src/__tests__/unit/json-schema/v1-reference/full/valid/mediaSingle-with-caption.json +28 -0
  248. package/src/__tests__/unit/json-schema/v1-reference/full/valid/mediaSingle-with-link-mark.json +32 -0
  249. package/src/__tests__/unit/json-schema/v1-reference/full/valid/mediaSingle-with-parameters.json +86 -0
  250. package/src/__tests__/unit/json-schema/v1-reference/full/valid/mediaSingle-with-width.json +74 -0
  251. package/src/__tests__/unit/json-schema/v1-reference/full/valid/mediaSingle-without-parameters.json +19 -0
  252. package/src/__tests__/unit/json-schema/v1-reference/full/valid/mention-with-attrs.json +18 -0
  253. package/src/__tests__/unit/json-schema/v1-reference/full/valid/mention-with-user-type.json +35 -0
  254. package/src/__tests__/unit/json-schema/v1-reference/full/valid/nested-extensions-with-data-consumer-mark.json +226 -0
  255. package/src/__tests__/unit/json-schema/v1-reference/full/valid/nested-extensions-without-mark.json +176 -0
  256. package/src/__tests__/unit/json-schema/v1-reference/full/valid/nestedExpand.json +128 -0
  257. package/src/__tests__/unit/json-schema/v1-reference/full/valid/orderedList-with-content.json +30 -0
  258. package/src/__tests__/unit/json-schema/v1-reference/full/valid/orderedList-with-order.json +33 -0
  259. package/src/__tests__/unit/json-schema/v1-reference/full/valid/panel-info.json +21 -0
  260. package/src/__tests__/unit/json-schema/v1-reference/full/valid/panel-note.json +21 -0
  261. package/src/__tests__/unit/json-schema/v1-reference/full/valid/panel-tip.json +21 -0
  262. package/src/__tests__/unit/json-schema/v1-reference/full/valid/panel-warning.json +21 -0
  263. package/src/__tests__/unit/json-schema/v1-reference/full/valid/panel-with-blockCard.json +20 -0
  264. package/src/__tests__/unit/json-schema/v1-reference/full/valid/panel-with-list.json +31 -0
  265. package/src/__tests__/unit/json-schema/v1-reference/full/valid/panel-with-paragraph.json +21 -0
  266. package/src/__tests__/unit/json-schema/v1-reference/full/valid/paragraph-with-content.json +15 -0
  267. package/src/__tests__/unit/json-schema/v1-reference/full/valid/paragraph-with-empty-content.json +10 -0
  268. package/src/__tests__/unit/json-schema/v1-reference/full/valid/paragraph-with-empty-marks.json +11 -0
  269. package/src/__tests__/unit/json-schema/v1-reference/full/valid/paragraph-with-supported-mark.json +23 -0
  270. package/src/__tests__/unit/json-schema/v1-reference/full/valid/paragraph-without-content.json +9 -0
  271. package/src/__tests__/unit/json-schema/v1-reference/full/valid/placeholder.json +17 -0
  272. package/src/__tests__/unit/json-schema/v1-reference/full/valid/rule.json +9 -0
  273. package/src/__tests__/unit/json-schema/v1-reference/full/valid/status-nested-in-list.json +43 -0
  274. package/src/__tests__/unit/json-schema/v1-reference/full/valid/status-with-all-attrs.json +23 -0
  275. package/src/__tests__/unit/json-schema/v1-reference/full/valid/status-with-default-attrs.json +23 -0
  276. package/src/__tests__/unit/json-schema/v1-reference/full/valid/subsup-as-sub.json +23 -0
  277. package/src/__tests__/unit/json-schema/v1-reference/full/valid/subsup-as-sup.json +23 -0
  278. package/src/__tests__/unit/json-schema/v1-reference/full/valid/table-with-empty-cell.json +29 -0
  279. package/src/__tests__/unit/json-schema/v1-reference/full/valid/table-with-fragment-mark.json +41 -0
  280. package/src/__tests__/unit/json-schema/v1-reference/full/valid/table-with-header-row.json +34 -0
  281. package/src/__tests__/unit/json-schema/v1-reference/full/valid/table-with-layout.json +50 -0
  282. package/src/__tests__/unit/json-schema/v1-reference/full/valid/table-with-local-id.json +32 -0
  283. package/src/__tests__/unit/json-schema/v1-reference/full/valid/table-with-nested-nodes.json +32 -0
  284. package/src/__tests__/unit/json-schema/v1-reference/full/valid/task-with-mention.json +34 -0
  285. package/src/__tests__/unit/json-schema/v1-reference/full/valid/taskList-with-nested-taskLists.json +74 -0
  286. package/src/__tests__/unit/json-schema/v1-reference/full/valid/taskList-with-tasks.json +40 -0
  287. package/src/__tests__/unit/json-schema/v1-reference/full/valid/text-code-and-link.json +26 -0
  288. package/src/__tests__/unit/json-schema/v1-reference/full/valid/text-code.json +20 -0
  289. package/src/__tests__/unit/json-schema/v1-reference/full/valid/text-em.json +20 -0
  290. package/src/__tests__/unit/json-schema/v1-reference/full/valid/text-link.json +23 -0
  291. package/src/__tests__/unit/json-schema/v1-reference/full/valid/text-strong.json +20 -0
  292. package/src/__tests__/unit/json-schema/v1-reference/full/valid/text-subsup.json +23 -0
  293. package/src/__tests__/unit/json-schema/v1-reference/full/valid/text-textColor.json +23 -0
  294. package/src/__tests__/unit/json-schema/v1-reference/full/valid/text-underline.json +20 -0
  295. package/src/__tests__/unit/json-schema/v1-reference/full/valid/text.json +15 -0
  296. package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/.gitkeep +0 -0
  297. package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/blockcard-with-empty-attrs.json +10 -0
  298. package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/blockcard-with-empty-datasource.json +12 -0
  299. package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/blockcard-with-invalid-datasource-empty-views.json +21 -0
  300. package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/blockcard-with-invalid-datasource-id.json +32 -0
  301. package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/blockcard-with-invalid-datasource-layout.json +32 -0
  302. package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/blockcard-with-invalid-datasource-views-type.json +32 -0
  303. package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/blockcard-with-invalid-datasource-width.json +32 -0
  304. package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/bodiedExtension-with-source-as-string-data-consumer-mark.json +46 -0
  305. package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/extension-with-invalid-local-id.json +16 -0
  306. package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/extension-with-nonsense-marks.json +21 -0
  307. package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/inlineExtension-with-source-as-string-data-consumer-mark.json +48 -0
  308. package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/mediaSingle-with-invalid-percentage-width.json +23 -0
  309. package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/mediaSingle-with-invalid-pixel-width.json +24 -0
  310. package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/nested-extensions-with-link-mark.json +216 -0
  311. package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/table-with-empty-local-id.json +32 -0
  312. package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/table-with-invalid-local-id.json +32 -0
  313. package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/table-with-invalid-width.json +32 -0
  314. package/src/__tests__/unit/json-schema/v1-reference/stage-0/valid/.gitkeep +0 -0
  315. package/src/__tests__/unit/json-schema/v1-reference/stage-0/valid/blockcard-with-datasources.json +38 -0
  316. package/src/__tests__/unit/json-schema/v1-reference/stage-0/valid/blockcard-with-empty-datasource-parameters.json +29 -0
  317. package/src/__tests__/unit/json-schema/v1-reference/stage-0/valid/blockcard-without-optional-fields.json +23 -0
  318. package/src/__tests__/unit/json-schema/v1-reference/stage-0/valid/layoutSection-with-one-column.json +24 -0
  319. package/src/__tests__/unit/json-schema/v1-reference/stage-0/valid/mediaSingle-with-percentage-width.json +24 -0
  320. package/src/__tests__/unit/json-schema/v1-reference/stage-0/valid/mediaSingle-with-pixel-width.json +24 -0
  321. package/src/__tests__/unit/json-schema/v1-reference/stage-0/valid/table-with-width.json +32 -0
  322. package/src/__tests__/unit/json-schema/v1.ts +53 -0
  323. package/src/__tests__/unit/schema/create-schema.ts +214 -0
  324. package/src/__tests__/unit/schema/default-schema.ts +192 -0
  325. package/src/__tests__/unit/schema/marks/annotation.ts +46 -0
  326. package/src/__tests__/unit/schema/marks/border.ts +76 -0
  327. package/src/__tests__/unit/schema/marks/breakout.ts +24 -0
  328. package/src/__tests__/unit/schema/marks/code.ts +44 -0
  329. package/src/__tests__/unit/schema/marks/confluence-inline-comment.ts +25 -0
  330. package/src/__tests__/unit/schema/marks/data-consumer.ts +52 -0
  331. package/src/__tests__/unit/schema/marks/em.ts +37 -0
  332. package/src/__tests__/unit/schema/marks/link.ts +188 -0
  333. package/src/__tests__/unit/schema/marks/strike.ts +37 -0
  334. package/src/__tests__/unit/schema/marks/strong.ts +43 -0
  335. package/src/__tests__/unit/schema/marks/subsup.ts +50 -0
  336. package/src/__tests__/unit/schema/marks/text-color.ts +61 -0
  337. package/src/__tests__/unit/schema/marks/underline.ts +36 -0
  338. package/src/__tests__/unit/schema/nodes/_consts.ts +964 -0
  339. package/src/__tests__/unit/schema/nodes/block-card.ts +184 -0
  340. package/src/__tests__/unit/schema/nodes/blockquote.ts +44 -0
  341. package/src/__tests__/unit/schema/nodes/bodied-extension.ts +101 -0
  342. package/src/__tests__/unit/schema/nodes/code-block.ts +221 -0
  343. package/src/__tests__/unit/schema/nodes/confluence-unsupported-block.ts +36 -0
  344. package/src/__tests__/unit/schema/nodes/confluence-unsupported-inline.ts +35 -0
  345. package/src/__tests__/unit/schema/nodes/date.ts +51 -0
  346. package/src/__tests__/unit/schema/nodes/decision-item.ts +46 -0
  347. package/src/__tests__/unit/schema/nodes/decision-list.ts +52 -0
  348. package/src/__tests__/unit/schema/nodes/embed-card.ts +60 -0
  349. package/src/__tests__/unit/schema/nodes/emoji.ts +71 -0
  350. package/src/__tests__/unit/schema/nodes/expand.ts +51 -0
  351. package/src/__tests__/unit/schema/nodes/extension.ts +101 -0
  352. package/src/__tests__/unit/schema/nodes/hard-break.ts +24 -0
  353. package/src/__tests__/unit/schema/nodes/heading.ts +56 -0
  354. package/src/__tests__/unit/schema/nodes/image.ts +32 -0
  355. package/src/__tests__/unit/schema/nodes/inline-card.ts +106 -0
  356. package/src/__tests__/unit/schema/nodes/inline-extension.ts +79 -0
  357. package/src/__tests__/unit/schema/nodes/layout-column.ts +54 -0
  358. package/src/__tests__/unit/schema/nodes/layout-section.ts +95 -0
  359. package/src/__tests__/unit/schema/nodes/list-item.ts +49 -0
  360. package/src/__tests__/unit/schema/nodes/media-group.ts +67 -0
  361. package/src/__tests__/unit/schema/nodes/media-single.ts +171 -0
  362. package/src/__tests__/unit/schema/nodes/media.ts +388 -0
  363. package/src/__tests__/unit/schema/nodes/mention.ts +115 -0
  364. package/src/__tests__/unit/schema/nodes/nestedExpand.ts +72 -0
  365. package/src/__tests__/unit/schema/nodes/ordered-list.ts +49 -0
  366. package/src/__tests__/unit/schema/nodes/panel.ts +180 -0
  367. package/src/__tests__/unit/schema/nodes/paragraph.ts +25 -0
  368. package/src/__tests__/unit/schema/nodes/placeholder.ts +46 -0
  369. package/src/__tests__/unit/schema/nodes/rule.ts +24 -0
  370. package/src/__tests__/unit/schema/nodes/status.ts +120 -0
  371. package/src/__tests__/unit/schema/nodes/tableNodes.ts +555 -0
  372. package/src/__tests__/unit/schema/nodes/task-item.ts +39 -0
  373. package/src/__tests__/unit/schema/nodes/task-list.ts +45 -0
  374. package/src/__tests__/unit/schema/nodes/unknown-block.ts +42 -0
  375. package/src/__tests__/unit/schema/nodes/unsupported-block.ts +42 -0
  376. package/src/__tests__/unit/schema/nodes/unsupported-inline.ts +38 -0
  377. package/src/__tests__/unit/utils/colors.ts +42 -0
  378. package/src/__tests__/unit/utils/url.ts +209 -0
  379. package/src/index.ts +297 -0
  380. package/src/json-schema/index.ts +2 -0
  381. package/src/schema/bitbucket-schema.ts +43 -0
  382. package/src/schema/confluence-schema.ts +76 -0
  383. package/src/schema/create-schema.ts +337 -0
  384. package/src/schema/default-schema.ts +180 -0
  385. package/src/schema/groups.ts +30 -0
  386. package/src/schema/index.ts +238 -0
  387. package/src/schema/inline-nodes.ts +9 -0
  388. package/src/schema/jira-schema.ts +158 -0
  389. package/src/schema/marks/__tests__/unit/annotation.ts +18 -0
  390. package/src/schema/marks/alignment.ts +48 -0
  391. package/src/schema/marks/annotation.ts +107 -0
  392. package/src/schema/marks/border.ts +74 -0
  393. package/src/schema/marks/breakout.ts +42 -0
  394. package/src/schema/marks/code.ts +45 -0
  395. package/src/schema/marks/confluence-inline-comment.ts +32 -0
  396. package/src/schema/marks/data-consumer.ts +100 -0
  397. package/src/schema/marks/em.ts +19 -0
  398. package/src/schema/marks/fragment.ts +77 -0
  399. package/src/schema/marks/indentation.ts +47 -0
  400. package/src/schema/marks/index.ts +61 -0
  401. package/src/schema/marks/link.ts +139 -0
  402. package/src/schema/marks/strike.ts +26 -0
  403. package/src/schema/marks/strong.ts +45 -0
  404. package/src/schema/marks/subsup.ts +53 -0
  405. package/src/schema/marks/text-color.ts +172 -0
  406. package/src/schema/marks/type-ahead-query.ts +22 -0
  407. package/src/schema/marks/underline.ts +24 -0
  408. package/src/schema/marks/unsupported-mark.ts +9 -0
  409. package/src/schema/marks/unsupported-node-attributes.ts +8 -0
  410. package/src/schema/nodes/block-card.ts +121 -0
  411. package/src/schema/nodes/blockquote.ts +25 -0
  412. package/src/schema/nodes/bodied-extension.ts +75 -0
  413. package/src/schema/nodes/bullet-list.ts +17 -0
  414. package/src/schema/nodes/caption.ts +51 -0
  415. package/src/schema/nodes/code-block.ts +176 -0
  416. package/src/schema/nodes/confluence-jira-issue.ts +43 -0
  417. package/src/schema/nodes/confluence-unsupported-block.ts +29 -0
  418. package/src/schema/nodes/confluence-unsupported-inline.ts +30 -0
  419. package/src/schema/nodes/date.ts +38 -0
  420. package/src/schema/nodes/decision-item.ts +50 -0
  421. package/src/schema/nodes/decision-list.ts +56 -0
  422. package/src/schema/nodes/doc.ts +30 -0
  423. package/src/schema/nodes/embed-card.ts +62 -0
  424. package/src/schema/nodes/emoji.ts +89 -0
  425. package/src/schema/nodes/expand.ts +101 -0
  426. package/src/schema/nodes/extension.ts +60 -0
  427. package/src/schema/nodes/hard-break.ts +21 -0
  428. package/src/schema/nodes/heading.ts +64 -0
  429. package/src/schema/nodes/image.ts +32 -0
  430. package/src/schema/nodes/index.ts +184 -0
  431. package/src/schema/nodes/inline-card.ts +70 -0
  432. package/src/schema/nodes/inline-extension.ts +57 -0
  433. package/src/schema/nodes/layout-column.ts +68 -0
  434. package/src/schema/nodes/layout-section.ts +93 -0
  435. package/src/schema/nodes/list-item.ts +13 -0
  436. package/src/schema/nodes/media-group.ts +44 -0
  437. package/src/schema/nodes/media-inline.ts +19 -0
  438. package/src/schema/nodes/media-single.ts +179 -0
  439. package/src/schema/nodes/media.ts +249 -0
  440. package/src/schema/nodes/mention.ts +86 -0
  441. package/src/schema/nodes/nested-expand.ts +77 -0
  442. package/src/schema/nodes/ordered-list.ts +62 -0
  443. package/src/schema/nodes/panel.ts +133 -0
  444. package/src/schema/nodes/paragraph.ts +79 -0
  445. package/src/schema/nodes/placeholder.ts +40 -0
  446. package/src/schema/nodes/rule.ts +17 -0
  447. package/src/schema/nodes/status.ts +58 -0
  448. package/src/schema/nodes/tableNodes.ts +480 -0
  449. package/src/schema/nodes/task-item.ts +51 -0
  450. package/src/schema/nodes/task-list.ts +61 -0
  451. package/src/schema/nodes/text.ts +19 -0
  452. package/src/schema/nodes/types/block-content.ts +51 -0
  453. package/src/schema/nodes/types/extensions.ts +36 -0
  454. package/src/schema/nodes/types/inline-content.ts +56 -0
  455. package/src/schema/nodes/types/list.ts +54 -0
  456. package/src/schema/nodes/types/mark.ts +16 -0
  457. package/src/schema/nodes/types/non-nestable-block-content.ts +39 -0
  458. package/src/schema/nodes/types/rich-media-common.ts +51 -0
  459. package/src/schema/nodes/unknown-block.ts +13 -0
  460. package/src/schema/nodes/unsupported-block.ts +28 -0
  461. package/src/schema/nodes/unsupported-inline.ts +27 -0
  462. package/src/schema/unsupported.ts +4 -0
  463. package/src/steps/__tests__/unit/analytics.ts +72 -0
  464. package/src/steps/__tests__/unit/link-meta-step.ts +64 -0
  465. package/src/steps/__tests__/unit/override-document-step.ts +174 -0
  466. package/src/steps/__tests__/unit/set-attrs.ts +71 -0
  467. package/src/steps/analytics.ts +189 -0
  468. package/src/steps/link-meta-step.ts +105 -0
  469. package/src/steps/override-document-step.ts +97 -0
  470. package/src/steps/set-attrs.tsx +74 -0
  471. package/src/steps/table/__tests__/__fixtures__/basic/add-column-at-0.json +15 -0
  472. package/src/steps/table/__tests__/__fixtures__/basic/add-column-at-1.json +15 -0
  473. package/src/steps/table/__tests__/__fixtures__/basic/add-column-at-2.json +15 -0
  474. package/src/steps/table/__tests__/__fixtures__/basic/add-column-at-3.json +15 -0
  475. package/src/steps/table/__tests__/__fixtures__/basic/remove-column-at-0.json +9 -0
  476. package/src/steps/table/__tests__/__fixtures__/basic/remove-column-at-1.json +9 -0
  477. package/src/steps/table/__tests__/__fixtures__/basic/remove-column-at-2.json +9 -0
  478. package/src/steps/table/__tests__/__fixtures__/basic/remove-table/remove-last-row-inverted.json +98 -0
  479. package/src/steps/table/__tests__/__fixtures__/basic/remove-table/remove-last-row.json +71 -0
  480. package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/add-column-at-0-inverted.json +19 -0
  481. package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/add-column-at-0.json +19 -0
  482. package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/add-column-at-1-inverted.json +21 -0
  483. package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/add-column-at-1.json +21 -0
  484. package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/add-column-at-2-inverted.json +21 -0
  485. package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/add-column-at-2.json +21 -0
  486. package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/add-column-at-3-inverted.json +19 -0
  487. package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/add-column-at-3.json +19 -0
  488. package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/remove-column-at-0-inverted.json +63 -0
  489. package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/remove-column-at-0.json +21 -0
  490. package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/remove-column-at-1-inverted.json +64 -0
  491. package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/remove-column-at-1.json +22 -0
  492. package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/remove-column-at-2-inverted.json +63 -0
  493. package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/remove-column-at-2.json +21 -0
  494. package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/add-column-at-0-inverted.json +19 -0
  495. package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/add-column-at-0.json +19 -0
  496. package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/add-column-at-1-inverted.json +19 -0
  497. package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/add-column-at-1.json +19 -0
  498. package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/add-column-at-2-inverted.json +19 -0
  499. package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/add-column-at-2.json +19 -0
  500. package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/add-column-at-3-inverted.json +19 -0
  501. package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/add-column-at-3.json +19 -0
  502. package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/remove-column-at-0-inverted.json +52 -0
  503. package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/remove-column-at-0.json +38 -0
  504. package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/remove-column-at-1-inverted.json +52 -0
  505. package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/remove-column-at-1.json +38 -0
  506. package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/remove-column-at-2-inverted.json +25 -0
  507. package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/remove-column-at-2.json +11 -0
  508. package/src/steps/table/__tests__/_utils.ts +103 -0
  509. package/src/steps/table/__tests__/add-column-merge-columns.ts +491 -0
  510. package/src/steps/table/__tests__/add-column-merge-rows.ts +450 -0
  511. package/src/steps/table/__tests__/add-column.ts +610 -0
  512. package/src/steps/table/add-column.ts +440 -0
  513. package/src/steps/table/constants.ts +4 -0
  514. package/src/steps/table/sort-column.ts +57 -0
  515. package/src/steps/table/types.ts +48 -0
  516. package/src/steps/table/utils/cell-step.ts +239 -0
  517. package/src/steps/table/utils/cells-at-column.ts +72 -0
  518. package/src/steps/table/utils/find-column.ts +90 -0
  519. package/src/steps/table/utils/get-table-rect-from-doc.ts +37 -0
  520. package/src/steps/table/utils/side-effects/rows.ts +327 -0
  521. package/src/steps/table/utils/side-effects/side-effects.ts +90 -0
  522. package/src/steps/table/utils/side-effects/table.ts +112 -0
  523. package/src/steps/table/utils/side-effects/types.ts +34 -0
  524. package/src/steps/table/utils/table-map.ts +28 -0
  525. package/src/steps/type-ahead.ts +100 -0
  526. package/src/steps.ts +16 -0
  527. package/src/utils/colors.ts +171 -0
  528. package/src/utils/confluence/emoji.ts +99 -0
  529. package/src/utils/extensions.ts +32 -0
  530. package/src/utils/index.ts +69 -0
  531. package/src/utils/parseDOM.ts +2 -0
  532. package/src/utils/url.ts +173 -0
  533. package/src/utils/uuid.ts +19 -0
  534. package/src/version.json +6 -0
  535. package/babel.config.js +0 -156
@@ -0,0 +1,46 @@
1
+ import { createSchema } from '../../../../schema/create-schema';
2
+ import { toHTML, fromHTML } from 'adf-test-helpers/src/adf-schema/html-helpers';
3
+ import { Schema } from '@atlaskit/editor-prosemirror/model';
4
+
5
+ const packageName = process.env._PACKAGE_NAME_ as string;
6
+
7
+ describe(`${packageName}/schema confluence-inline-comment mark`, () => {
8
+ let schema: Schema;
9
+ beforeEach(() => {
10
+ schema = makeSchema();
11
+ });
12
+
13
+ it('serializes to the correct HTML', () => {
14
+ const node = schema.text('foo', [
15
+ schema.marks.annotation.create({
16
+ id: 'hash-ref-goes-here',
17
+ }),
18
+ ]);
19
+
20
+ const html = toHTML(node, schema);
21
+ expect(html).toContain('data-id="hash-ref-goes-here"');
22
+ expect(html).toContain('data-mark-type="annotation"');
23
+ expect(html).toContain('data-mark-annotation-type="inlineComment"');
24
+ });
25
+
26
+ it('parses annotation correctly from html', () => {
27
+ const doc = fromHTML(
28
+ `<p><span data-mark-type="annotation" data-mark-annotation-type="inlineComment" data-id="comment-id" >annotated text</span></p>`,
29
+ schema,
30
+ );
31
+ const annotationNode = doc.firstChild!.firstChild!;
32
+ expect(annotationNode.marks).toHaveLength(1);
33
+ expect(annotationNode.marks[0].type.name).toBe('annotation');
34
+ expect(annotationNode.marks[0].attrs).toEqual({
35
+ id: 'comment-id',
36
+ annotationType: 'inlineComment',
37
+ });
38
+ });
39
+ });
40
+
41
+ function makeSchema() {
42
+ return createSchema({
43
+ nodes: ['doc', 'paragraph', 'text'],
44
+ marks: ['annotation'],
45
+ });
46
+ }
@@ -0,0 +1,76 @@
1
+ import { createSchema } from '../../../../schema/create-schema';
2
+ import { fromHTML, toHTML } from 'adf-test-helpers/src/adf-schema/html-helpers';
3
+
4
+ const testAttr = { color: '#172B4D', size: 1 };
5
+ const testAttrFalse = { color: '#12345', size: 0 };
6
+ const packageName = process.env._PACKAGE_NAME_ as string;
7
+
8
+ describe(`${packageName}/schema border mark`, () => {
9
+ it('serializes to the correct HTML', () => {
10
+ const schema = makeSchema();
11
+ const node = schema.nodes.media.create(
12
+ {},
13
+ [],
14
+ [schema.marks.border.create(testAttr)],
15
+ );
16
+ const html = toHTML(node, schema);
17
+ expect(html).toContain(
18
+ `data-mark-type="border" data-color="#172B4D" data-size="1" style="--custom-palette-color: var(--ds-text, #172B4D)"`,
19
+ );
20
+ });
21
+ });
22
+
23
+ it('should parse border with color in lower case', () => {
24
+ const schema = makeSchema();
25
+ const doc = fromHTML(
26
+ `<div data-mark-type="border" data-color="${testAttr.color}" data-size="${testAttr.size}"><div data-node-type="media" data-type="file" data-id="dummy-id"></div></div>`,
27
+ schema,
28
+ );
29
+ const dataConsumerNode = doc.firstChild!.firstChild!;
30
+
31
+ expect(dataConsumerNode.marks).toHaveLength(1);
32
+ expect(dataConsumerNode.marks[0].type.name).toBe('border');
33
+ expect(dataConsumerNode.marks[0].attrs).toEqual({
34
+ size: testAttr.size,
35
+ color: '#172b4d',
36
+ });
37
+ });
38
+
39
+ it('should parse border with attributes as false if size and color are not expected values', () => {
40
+ const schema = makeSchema();
41
+ const doc = fromHTML(
42
+ `<div data-mark-type="border" data-color="${testAttrFalse.color}" data-size="${testAttrFalse.size}"><div data-node-type="media" data-type="file" data-id="dummy-id"></div></div>`,
43
+ schema,
44
+ );
45
+ const dataConsumerNode = doc.firstChild!.firstChild!;
46
+
47
+ expect(dataConsumerNode.marks).toHaveLength(1);
48
+ expect(dataConsumerNode.marks[0].type.name).toBe('border');
49
+ expect(dataConsumerNode.marks[0].attrs).toEqual({
50
+ size: false,
51
+ color: false,
52
+ });
53
+ });
54
+
55
+ it('should parse maximum size as 3', () => {
56
+ const schema = makeSchema();
57
+ const doc = fromHTML(
58
+ `<div data-mark-type="border" data-color="${testAttr.color}" data-size=5><div data-node-type="media" data-type="file" data-id="dummy-id"></div></div>`,
59
+ schema,
60
+ );
61
+ const dataConsumerNode = doc.firstChild!.firstChild!;
62
+
63
+ expect(dataConsumerNode.marks).toHaveLength(1);
64
+ expect(dataConsumerNode.marks[0].type.name).toBe('border');
65
+ expect(dataConsumerNode.marks[0].attrs).toEqual({
66
+ size: 3,
67
+ color: '#172b4d',
68
+ });
69
+ });
70
+
71
+ function makeSchema() {
72
+ return createSchema({
73
+ nodes: ['doc', 'paragraph', 'text', 'mediaSingle', 'media', 'caption'],
74
+ marks: ['border'],
75
+ });
76
+ }
@@ -0,0 +1,24 @@
1
+ import { createSchema } from '../../../../schema/create-schema';
2
+ import { toHTML } from 'adf-test-helpers/src/adf-schema/html-helpers';
3
+
4
+ const packageName = process.env._PACKAGE_NAME_ as string;
5
+
6
+ describe(`${packageName}/schema breakout mark`, () => {
7
+ it('serializes to the correct HTML', () => {
8
+ const schema = makeSchema();
9
+ const node = schema.nodes.codeBlock.create(
10
+ {},
11
+ [],
12
+ [schema.marks.breakout.create({ mode: 'wide' })],
13
+ );
14
+ const html = toHTML(node, schema);
15
+ expect(html).toContain('data-mode="wide"');
16
+ });
17
+ });
18
+
19
+ function makeSchema() {
20
+ return createSchema({
21
+ nodes: ['doc', 'paragraph', 'text', 'codeBlock'],
22
+ marks: ['breakout'],
23
+ });
24
+ }
@@ -0,0 +1,44 @@
1
+ import { createSchema } from '../../../../schema/create-schema';
2
+ import {
3
+ fromHTML,
4
+ toHTML,
5
+ textWithMarks,
6
+ } from 'adf-test-helpers/src/adf-schema';
7
+
8
+ const packageName = process.env._PACKAGE_NAME_ as string;
9
+
10
+ describe(`${packageName}/schema code mark`, () => {
11
+ itMatches('<span class="code">text</span>', 'text');
12
+ itMatches('<code>text</code>', 'text');
13
+ itMatches('<tt>text</tt>', 'text');
14
+ itMatches(
15
+ `<span style="font-family: Menlo, Monaco, 'Courier New', monospace;">text</span>`,
16
+ 'text',
17
+ );
18
+ itMatches(`<span style="white-space: pre;">text</span>`, 'text');
19
+
20
+ it('serializes to <span class="code">', () => {
21
+ const schema = makeSchema();
22
+ const node = schema.text('foo', [schema.marks.code.create()]);
23
+ expect(toHTML(node, schema)).toEqual(
24
+ '<span class="code" spellcheck="false">foo</span>',
25
+ );
26
+ });
27
+ });
28
+
29
+ function makeSchema() {
30
+ return createSchema({
31
+ nodes: ['doc', 'paragraph', 'text'],
32
+ marks: ['code'],
33
+ });
34
+ }
35
+
36
+ function itMatches(html: string, expectedText: string) {
37
+ it(`matches ${html}`, () => {
38
+ const schema = makeSchema();
39
+ const doc = fromHTML(`${html}`, schema);
40
+ const codeNode = schema.marks.code.create();
41
+
42
+ expect(textWithMarks(doc, expectedText, [codeNode])).toBe(true);
43
+ });
44
+ }
@@ -0,0 +1,25 @@
1
+ import { createSchema } from '../../../../schema/create-schema';
2
+ import { toHTML } from 'adf-test-helpers/src/adf-schema/html-helpers';
3
+
4
+ const packageName = process.env._PACKAGE_NAME_ as string;
5
+
6
+ describe(`${packageName}/schema confluence-inline-comment mark`, () => {
7
+ it('serializes to <span data-reference="hash-ref-goes-here">', () => {
8
+ const schema = makeSchema();
9
+ const node = schema.text('foo', [
10
+ schema.marks.confluenceInlineComment.create({
11
+ reference: 'hash-ref-goes-here',
12
+ }),
13
+ ]);
14
+ expect(toHTML(node, schema)).toContain(
15
+ 'data-reference="hash-ref-goes-here"',
16
+ );
17
+ });
18
+ });
19
+
20
+ function makeSchema() {
21
+ return createSchema({
22
+ nodes: ['doc', 'paragraph', 'text'],
23
+ marks: ['confluenceInlineComment'],
24
+ });
25
+ }
@@ -0,0 +1,52 @@
1
+ import { createSchema } from '../../../../schema/create-schema';
2
+ import { toHTML, fromHTML } from 'adf-test-helpers/src/adf-schema/html-helpers';
3
+ import { Schema } from '@atlaskit/editor-prosemirror/model';
4
+
5
+ const packageName = process.env._PACKAGE_NAME_ as string;
6
+
7
+ describe(`${packageName}/schema data-consumer mark`, () => {
8
+ let schema: Schema;
9
+ const firstSourceId = 'first-source-id';
10
+ const secondSourceId = 'second-source-id';
11
+ const dataSourceString = `&quot;${firstSourceId}&quot;,&quot;${secondSourceId}&quot;`;
12
+
13
+ beforeEach(() => {
14
+ schema = makeSchema();
15
+ });
16
+
17
+ it('serializes to the correct HTML', () => {
18
+ const node = schema.text('foo', [
19
+ schema.marks.dataConsumer.create({
20
+ sources: [firstSourceId, secondSourceId],
21
+ }),
22
+ ]);
23
+ const html = toHTML(node, schema);
24
+
25
+ expect(html).toContain(`data-sources="[${dataSourceString}]"`);
26
+ expect(html).toContain('data-mark-type="dataConsumer"');
27
+ });
28
+
29
+ it.each(['div', 'span'])(
30
+ 'parses annotation correctly from html for %s',
31
+ (wrapperType) => {
32
+ const doc = fromHTML(
33
+ `<${wrapperType} data-mark-type="dataConsumer" data-sources="[${dataSourceString}]">foo</${wrapperType}>`,
34
+ schema,
35
+ );
36
+ const dataConsumerNode = doc.firstChild!;
37
+
38
+ expect(dataConsumerNode.marks).toHaveLength(1);
39
+ expect(dataConsumerNode.marks[0].type.name).toBe('dataConsumer');
40
+ expect(dataConsumerNode.marks[0].attrs).toEqual({
41
+ sources: [firstSourceId, secondSourceId],
42
+ });
43
+ },
44
+ );
45
+ });
46
+
47
+ function makeSchema() {
48
+ return createSchema({
49
+ nodes: ['doc', 'paragraph', 'text'],
50
+ marks: ['dataConsumer'],
51
+ });
52
+ }
@@ -0,0 +1,37 @@
1
+ import { createSchema } from '../../../../schema/create-schema';
2
+ import {
3
+ fromHTML,
4
+ toHTML,
5
+ textWithMarks,
6
+ } from 'adf-test-helpers/src/adf-schema';
7
+
8
+ const packageName = process.env._PACKAGE_NAME_ as string;
9
+
10
+ describe(`${packageName}/schema em mark`, () => {
11
+ itMatches('<em>text</em>', 'text');
12
+ itMatches('<i>text</i>', 'text');
13
+ itMatches('<span style="font-style: italic">text</span>', 'text');
14
+
15
+ it('serializes to <em>', () => {
16
+ const schema = makeSchema();
17
+ const node = schema.text('foo', [schema.marks.em.create()]);
18
+ expect(toHTML(node, schema)).toEqual('<em>foo</em>');
19
+ });
20
+ });
21
+
22
+ function makeSchema() {
23
+ return createSchema({
24
+ nodes: ['doc', 'paragraph', 'text'],
25
+ marks: ['em'],
26
+ });
27
+ }
28
+
29
+ function itMatches(html: string, expectedText: string) {
30
+ it(`matches ${html}`, () => {
31
+ const schema = makeSchema();
32
+ const doc = fromHTML(`${html}`, schema);
33
+ const emNode = schema.marks.em.create();
34
+
35
+ expect(textWithMarks(doc, expectedText, [emNode])).toBe(true);
36
+ });
37
+ }
@@ -0,0 +1,188 @@
1
+ import { createSchema } from '../../../../schema/create-schema';
2
+ import {
3
+ toHTML,
4
+ fromHTML,
5
+ textWithMarks,
6
+ } from 'adf-test-helpers/src/adf-schema';
7
+ import { Node } from '@atlaskit/editor-prosemirror/model';
8
+
9
+ const href = 'http://atlassian.com';
10
+ const href2 = 'http://atlassian.com/test';
11
+ const href3 = 'http://atlassian.com?test=123';
12
+ const unsafeHref = 'javascript:alert("hack")';
13
+ const content = 'foo';
14
+ const sampleLink = `<a href="${href}">${content}</a>`;
15
+ const sampleBlockLink = `<a href="${href}" data-block-link="true" class="blockLink"><p>${content}</p></a>`;
16
+ const emptyLink = `<a>${content}</a>`;
17
+ const packageName = process.env._PACKAGE_NAME_ as string;
18
+
19
+ describe(`${packageName}/schema link mark`, () => {
20
+ itMatches(`<p>${sampleLink}</p>`, href, content);
21
+ itMatches(
22
+ `<p><a href="${href}" title="test" alt="hello">${content}</a></p>`,
23
+ href,
24
+ content,
25
+ );
26
+ itMatches(`<p><a href="${href2}">${content}</a></p>`, href2, content);
27
+ itMatches(`<p><a href="${href3}">${content}</a></p>`, href3, content);
28
+
29
+ describe('when there is a textColor mark', () => {
30
+ it('should not throw an error when the check() is called', () => {
31
+ const doc = {
32
+ type: 'text',
33
+ text: 'Foo',
34
+ marks: [
35
+ {
36
+ type: 'link',
37
+ attrs: {
38
+ href: 'http://example.com',
39
+ },
40
+ },
41
+
42
+ {
43
+ type: 'textColor',
44
+ attrs: {
45
+ color: '#ff5630',
46
+ },
47
+ },
48
+ ],
49
+ };
50
+
51
+ const textNode = Node.fromJSON(makeSchema(), doc);
52
+ expect(() => {
53
+ textNode.check();
54
+ }).not.toThrow();
55
+ });
56
+ });
57
+
58
+ describe('whitelist URLs', () => {
59
+ const schema = makeSchema();
60
+
61
+ it(`should parse links starting from http://`, () => {
62
+ const doc = fromHTML(
63
+ `<p><a href="http://www.atlassian.com">Atlassian</a></p>`,
64
+ schema,
65
+ );
66
+ const textNode = doc.firstChild!.firstChild!;
67
+
68
+ expect(textNode.marks).toHaveLength(1);
69
+ });
70
+
71
+ it(`should parse links starting from https://`, () => {
72
+ const doc = fromHTML(
73
+ `<p><a href="https://www.atlassian.com">Atlassian</a></p>`,
74
+ schema,
75
+ );
76
+ const textNode = doc.firstChild!.firstChild!;
77
+
78
+ expect(textNode.marks).toHaveLength(1);
79
+ });
80
+
81
+ it(`should parse links starting from sourcetree://`, () => {
82
+ const doc = fromHTML(
83
+ `<p><a href="sourcetree://cloneRepo/ssh://user@bitbucket.org/owner/repo.git">Clone me</a></p>`,
84
+ schema,
85
+ );
86
+ const textNode = doc.firstChild!.firstChild!;
87
+
88
+ expect(textNode.marks).toHaveLength(1);
89
+ });
90
+
91
+ it(`should parse root relative links`, () => {
92
+ const doc = fromHTML(`<p><a href="/TEST-100">TEST-100</a></p>`, schema);
93
+ const textNode = doc.firstChild!.firstChild!;
94
+
95
+ expect(textNode.marks).toHaveLength(1);
96
+ });
97
+
98
+ it(`should not parse links starting from javascript://`, () => {
99
+ const doc = fromHTML(
100
+ `<p><a href="javascript:alert(1)">Click me</a></p>`,
101
+ schema,
102
+ );
103
+ const textNode = doc.firstChild!.firstChild!;
104
+
105
+ expect(textNode.marks).toHaveLength(0);
106
+ });
107
+
108
+ it(`should not parse links starting from javascript://`, () => {
109
+ const doc = fromHTML(
110
+ `<p><a href="view-source:https://bitbucket.org/atlassian/atlaskit/pull-requests/3196/fix-component-prevent-javascript-links-for/diff">View source</a></p>`,
111
+ schema,
112
+ );
113
+ const textNode = doc.firstChild!.firstChild!;
114
+
115
+ expect(textNode.marks).toHaveLength(0);
116
+ });
117
+
118
+ it(`should remove unsafe link when serialize`, () => {
119
+ const schema = makeSchema();
120
+ const node = schema.text(content, [
121
+ schema.marks.link.create({ href: unsafeHref }),
122
+ ]);
123
+ const html: string = toHTML(node, schema);
124
+
125
+ expect(html).toContain(`${emptyLink}`);
126
+ });
127
+ });
128
+
129
+ describe('serialization', () => {
130
+ it(`serializes to ${sampleLink}`, () => {
131
+ const schema = makeSchema();
132
+ const node = schema.text(content, [schema.marks.link.create({ href })]);
133
+ const html: string = toHTML(node, schema);
134
+ expect(html).toContain(`${sampleLink}`);
135
+ });
136
+ it(`serializes block marked links ${sampleLink}`, () => {
137
+ const schema = makeSchema();
138
+ const node = schema.nodes.paragraph.create(null, schema.text(content), [
139
+ schema.marks.link.create({ href }),
140
+ ]);
141
+ const html: string = toHTML(node, schema);
142
+ expect(html).toContain(`${sampleBlockLink}`);
143
+ });
144
+ });
145
+
146
+ describe('confluence metadata', () => {
147
+ it('creates a PM node with attributes from ADF', () => {
148
+ const doc = {
149
+ type: 'text',
150
+ text: 'Foo',
151
+ marks: [
152
+ {
153
+ type: 'link',
154
+ attrs: {
155
+ href: 'http://example.com',
156
+ __confluenceMetadata: {
157
+ linkType: 'value',
158
+ },
159
+ },
160
+ },
161
+ ],
162
+ };
163
+
164
+ const text = Node.fromJSON(makeSchema(), doc);
165
+ expect(text.marks[0].attrs).toHaveProperty('__confluenceMetadata');
166
+ expect(text.marks[0].attrs.__confluenceMetadata).toHaveProperty(
167
+ 'linkType',
168
+ 'value',
169
+ );
170
+ });
171
+ });
172
+ });
173
+
174
+ function makeSchema() {
175
+ return createSchema({
176
+ nodes: ['doc', 'paragraph', 'text'],
177
+ marks: ['link', 'textColor'],
178
+ });
179
+ }
180
+
181
+ function itMatches(html: string, href: string, expectedText: string) {
182
+ it(`matches ${html}`, () => {
183
+ const schema = makeSchema();
184
+ const doc = fromHTML(html, schema);
185
+ const link = schema.marks.link.create({ href });
186
+ expect(textWithMarks(doc, expectedText, [link])).toBe(true);
187
+ });
188
+ }
@@ -0,0 +1,37 @@
1
+ import { createSchema } from '../../../../schema/create-schema';
2
+ import {
3
+ fromHTML,
4
+ toHTML,
5
+ textWithMarks,
6
+ } from 'adf-test-helpers/src/adf-schema';
7
+
8
+ const packageName = process.env._PACKAGE_NAME_ as string;
9
+
10
+ describe(`${packageName}/schema strike mark`, () => {
11
+ itMatches('<s>text</s>', 'text');
12
+ itMatches('<del>text</del>', 'text');
13
+ itMatches('<strike>text</strike>', 'text');
14
+ itMatches('<span style="text-decoration: line-through">text</span>', 'text');
15
+
16
+ it('serializes to <s>', () => {
17
+ const schema = makeSchema();
18
+ const node = schema.text('foo', [schema.marks.strike.create()]);
19
+ expect(toHTML(node, schema)).toEqual('<s>foo</s>');
20
+ });
21
+ });
22
+
23
+ function makeSchema() {
24
+ return createSchema({
25
+ nodes: ['doc', 'paragraph', 'text'],
26
+ marks: ['strike'],
27
+ });
28
+ }
29
+
30
+ function itMatches(html: string, expectedText: string) {
31
+ it(`matches ${html}`, () => {
32
+ const schema = makeSchema();
33
+ const doc = fromHTML(html, schema);
34
+ const strike = schema.marks.strike.create();
35
+ expect(textWithMarks(doc, expectedText, [strike])).toBe(true);
36
+ });
37
+ }
@@ -0,0 +1,43 @@
1
+ import { createSchema } from '../../../../schema/create-schema';
2
+ import {
3
+ fromHTML,
4
+ toHTML,
5
+ textWithMarks,
6
+ } from 'adf-test-helpers/src/adf-schema';
7
+
8
+ const packageName = process.env._PACKAGE_NAME_ as string;
9
+
10
+ describe(`${packageName}/schema strong mark`, () => {
11
+ itMatches('<strong>text</strong>', 'text');
12
+ itMatches('<b>text</b>', 'text');
13
+ itMatches('<b style="font-weight: bold">text</b>', 'text');
14
+ itMatches('<span style="font-weight: bold">text</span>', 'text');
15
+
16
+ it('serializes to <strong>', () => {
17
+ const schema = makeSchema();
18
+ const node = schema.text('foo', [schema.marks.strong.create()]);
19
+ expect(toHTML(node, schema)).toEqual('<strong>foo</strong>');
20
+ });
21
+
22
+ it('should not match <b style=font-weight: normal> as strong', () => {
23
+ const schema = makeSchema();
24
+ const doc = fromHTML('<b style="font-weight: normal">text</b>', schema);
25
+ expect(textWithMarks(doc, 'text', [])).toBe(true);
26
+ });
27
+ });
28
+
29
+ function makeSchema() {
30
+ return createSchema({
31
+ nodes: ['doc', 'paragraph', 'text'],
32
+ marks: ['strong'],
33
+ });
34
+ }
35
+
36
+ function itMatches(html: string, expectedText: string) {
37
+ it(`matches ${html}`, () => {
38
+ const schema = makeSchema();
39
+ const doc = fromHTML(html, schema);
40
+ const strong = schema.marks.strong.create();
41
+ expect(textWithMarks(doc, expectedText, [strong])).toBe(true);
42
+ });
43
+ }
@@ -0,0 +1,50 @@
1
+ import { createSchema } from '../../../../schema/create-schema';
2
+ import {
3
+ fromHTML,
4
+ toHTML,
5
+ textWithMarks,
6
+ } from 'adf-test-helpers/src/adf-schema';
7
+
8
+ const packageName = process.env._PACKAGE_NAME_ as string;
9
+
10
+ describe(`${packageName}/schema subsup mark`, () => {
11
+ itMatches('<sub>text</sub>', 'text', { type: 'sub' });
12
+ itMatches('<sup>text</sup>', 'text', { type: 'sup' });
13
+
14
+ it('serializes to <sub>', () => {
15
+ const schema = makeSchema();
16
+ const node = schema.text('foo', [
17
+ schema.marks.subsup.create({ type: 'sub' }),
18
+ ]);
19
+ expect(toHTML(node, schema)).toEqual('<sub>foo</sub>');
20
+ });
21
+
22
+ it('serializes to <sup>', () => {
23
+ const schema = makeSchema();
24
+ const node = schema.text('foo', [
25
+ schema.marks.subsup.create({ type: 'sup' }),
26
+ ]);
27
+ expect(toHTML(node, schema)).toEqual('<sup>foo</sup>');
28
+ });
29
+ });
30
+
31
+ function makeSchema() {
32
+ return createSchema({
33
+ nodes: ['doc', 'paragraph', 'text'],
34
+ marks: ['subsup'],
35
+ });
36
+ }
37
+
38
+ function itMatches(
39
+ html: string,
40
+ expectedText: string,
41
+ attrs: { type: 'sub' | 'sup' },
42
+ ) {
43
+ it(`matches ${html}`, () => {
44
+ const schema = makeSchema();
45
+ const doc = fromHTML(`${html}`, schema);
46
+ const subsupNode = schema.marks.subsup.create(attrs);
47
+
48
+ expect(textWithMarks(doc, expectedText, [subsupNode])).toBe(true);
49
+ });
50
+ }