@atlaskit/adf-schema 28.1.5 → 28.1.7

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 (514) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/index.ts +275 -0
  3. package/package.json +6 -23
  4. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/blockQuote-with-attrs.json +17 -0
  5. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/blockQuote-with-empty-content.json +10 -0
  6. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/blockQuote-with-marks.json +17 -0
  7. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/blockQuote-without-content.json +9 -0
  8. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/blockquote-with-list-inside.json +24 -0
  9. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/bodied-extension-with-nested-bodiedExtension.json +28 -0
  10. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/bodied-extension-without-content.json +13 -0
  11. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/bodied-extension-without-extensionKey.json +18 -0
  12. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/bodied-extension-without-extensionType.json +18 -0
  13. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/bulletList-with-attrs.json +17 -0
  14. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/bulletList-with-empty-content.json +10 -0
  15. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/bulletList-with-marks.json +24 -0
  16. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/bulletList-with-not-listItem-content.json +18 -0
  17. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/bulletList-without-content.json +9 -0
  18. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/code-and-em.json +23 -0
  19. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/code-and-strike.json +23 -0
  20. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/code-and-strong.json +23 -0
  21. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/code-and-subsup.json +23 -0
  22. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/code-and-underline.json +23 -0
  23. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/code-with-attrs.json +21 -0
  24. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/codeBlock-with-non-text.json +14 -0
  25. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/codeBlock-with-strong.json +20 -0
  26. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/codeBlock-with-unknown-attribute.json +13 -0
  27. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/codeBlock-with-unsupported-marks.json +14 -0
  28. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/decision-with-blockquote.json +31 -0
  29. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/decisionList-with-empty-decision.json +23 -0
  30. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/decisionList-with-no-decision.json +13 -0
  31. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/doc-with-attrs.json +10 -0
  32. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/doc-with-marks.json +10 -0
  33. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/doc-without-content.json +4 -0
  34. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/doc-without-version.json +4 -0
  35. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/em-with-attrs.json +21 -0
  36. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/emoji-as-top-level-node.json +12 -0
  37. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/emoji-with-content.json +23 -0
  38. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/emoji-with-empty-attrs.json +15 -0
  39. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/emoji-with-marks.json +18 -0
  40. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/emoji-with-unknown-attr.json +18 -0
  41. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/emoji-without-attrs.json +14 -0
  42. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/expand-nested-with-marks.json +60 -0
  43. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/expand-with-breakout-inside-of-layout.json +50 -0
  44. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/extension-with-content.json +19 -0
  45. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/extension-with-empty-local-id.json +16 -0
  46. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/extension-without-extensionKey.json +12 -0
  47. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/extension-without-extensionType.json +12 -0
  48. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/hardBreak-with-marks.json +18 -0
  49. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/hardBreak-with-wrong-text.json +17 -0
  50. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/heading-with-invalid-level-attr.json +18 -0
  51. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/heading-with-non-text-block.json +14 -0
  52. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/heading-with-non-text-inline.json +18 -0
  53. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/heading-with-unknown-attrs.json +19 -0
  54. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/heading-with-unsupported-mark.json +23 -0
  55. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/heading-without-attrs.json +10 -0
  56. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/inlineExtension-with-content.json +24 -0
  57. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/inlineExtension-without-extensionKey.json +17 -0
  58. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/inlineExtension-without-extensionType.json +17 -0
  59. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/layoutSection-with-missing-layoutColumn.json +10 -0
  60. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/layoutSection-with-one-column.json +24 -0
  61. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/layoutSection-with-overflow-width.json +37 -0
  62. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/layoutSection-with-two-columns-and-breakout-code-block.json +38 -0
  63. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/link-with-empty-attrs.json +21 -0
  64. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/link-with-unknown-attr.json +21 -0
  65. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/link-without-attrs.json +20 -0
  66. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/list-with-blockquote.json +27 -0
  67. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/listItem-with-attrs.json +24 -0
  68. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/listItem-with-empty-content.json +15 -0
  69. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/listItem-with-list-as-first-child.json +30 -0
  70. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/listItem-with-marks.json +24 -0
  71. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/media-as-top-level-node.json +13 -0
  72. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/media-with-empty-attrs.json +15 -0
  73. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/media-with-invalid-alt-text.json +29 -0
  74. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/media-with-invalid-occurrence-key-attr.json +20 -0
  75. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/media-with-marks.json +19 -0
  76. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/media-with-unknown-attr.json +19 -0
  77. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/media-without-attrs.json +14 -0
  78. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/media-without-id-attr.json +17 -0
  79. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/media-without-type-attr.json +17 -0
  80. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/mediaGroup-with-attrs.json +19 -0
  81. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/mediaGroup-with-empty-content.json +10 -0
  82. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/mediaGroup-with-marks.json +19 -0
  83. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/mediaGroup-without-content.json +9 -0
  84. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/mediaInline-with-subsup-mark.json +30 -0
  85. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/mediaSingle-with-empty-attrs.json +11 -0
  86. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/mediaSingle-with-empty-content.json +10 -0
  87. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/mediaSingle-with-invalid-caption.json +46 -0
  88. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/mediaSingle-with-invalid-layout-attr.json +38 -0
  89. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/mediaSingle-with-negative-width.json +22 -0
  90. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/mediaSingle-with-overflow-width.json +22 -0
  91. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/mediaSingle-with-zero-width.json +22 -0
  92. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/mention-with-extra-attrs.json +19 -0
  93. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/mention-with-invalid-user-type.json +19 -0
  94. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/mention-with-marks.json +19 -0
  95. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/mention-without-attrs.json +14 -0
  96. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/mono-with-attrs.json +21 -0
  97. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/orderedList-with-extra-attrs.json +34 -0
  98. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/orderedList-with-marks.json +34 -0
  99. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/orderedList-without-content.json +15 -0
  100. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/panel-with-blockquote.json +25 -0
  101. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/panel-with-codeBlock.json +22 -0
  102. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/panel-with-empty-attrs.json +19 -0
  103. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/panel-with-marks.json +22 -0
  104. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/panel-with-panel.json +25 -0
  105. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/panel-with-unknown-attr.json +22 -0
  106. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/panel-without-attrs.json +18 -0
  107. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/paragraph-with-text-with-unknown-mark.json +20 -0
  108. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/paragraph-with-top-level-content.json +14 -0
  109. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/paragraph-with-unsupported-marks.json +20 -0
  110. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/placeholder-with-content.json +23 -0
  111. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/placeholder-with-empty-attrs.json +15 -0
  112. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/rule-with-attrs.json +10 -0
  113. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/rule-with-content.json +10 -0
  114. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/rule-with-marks.json +10 -0
  115. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/status-with-extra-attr.json +24 -0
  116. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/status-without-attrs.json +18 -0
  117. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/status-without-color-attr.json +22 -0
  118. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/status-without-text-attr.json +22 -0
  119. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/strike-with-attrs.json +21 -0
  120. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/strong-with-attrs.json +21 -0
  121. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/subsup-with-extra-attrs.json +24 -0
  122. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/subsup-with-invalid-type-attr.json +23 -0
  123. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/subsup-without-attrs.json +20 -0
  124. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/subsup-without-type-attr.json +21 -0
  125. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/table-with-breakout-code-block.json +33 -0
  126. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/table-with-fragment-mark-with-empty-local-id.json +41 -0
  127. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/table-with-fragment-mark-without-local-id.json +40 -0
  128. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/table-with-nested-table.json +50 -0
  129. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/table-without-cells.json +15 -0
  130. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/table-without-rows.json +10 -0
  131. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/task-with-blockquote.json +31 -0
  132. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/task-with-invalid-state.json +27 -0
  133. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/taskItem-with-nested-taskItem.json +70 -0
  134. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/taskList-with-empty-task.json +23 -0
  135. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/taskList-with-no-task.json +13 -0
  136. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/taskList-with-taskList-as-first-child.json +48 -0
  137. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/text-empty.json +15 -0
  138. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/textColor-with-extra-attrs.json +24 -0
  139. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/textColor-with-invalid-color-attr.json +23 -0
  140. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/textColor-without-attrs.json +20 -0
  141. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/textColor-without-color-attr.json +21 -0
  142. package/src/__tests__/unit/json-schema/v1-reference/full/invalid/underline-with-attrs.json +21 -0
  143. package/src/__tests__/unit/json-schema/v1-reference/full/valid/annotation.json +28 -0
  144. package/src/__tests__/unit/json-schema/v1-reference/full/valid/blockQuote-with-content.json +16 -0
  145. package/src/__tests__/unit/json-schema/v1-reference/full/valid/bodied-Extension-with-rich-body.json +27 -0
  146. package/src/__tests__/unit/json-schema/v1-reference/full/valid/bodied-extension-with-empty-content.json +19 -0
  147. package/src/__tests__/unit/json-schema/v1-reference/full/valid/bodied-extension-with-media-link.json +41 -0
  148. package/src/__tests__/unit/json-schema/v1-reference/full/valid/bodied-extension-with-nested-extension.json +33 -0
  149. package/src/__tests__/unit/json-schema/v1-reference/full/valid/bodied-extension-with-parameters.json +30 -0
  150. package/src/__tests__/unit/json-schema/v1-reference/full/valid/bodiedExtension-with-data-consumer-mark.json +47 -0
  151. package/src/__tests__/unit/json-schema/v1-reference/full/valid/bulletList-with-content.json +23 -0
  152. package/src/__tests__/unit/json-schema/v1-reference/full/valid/codeBlock-empty-attrs.json +11 -0
  153. package/src/__tests__/unit/json-schema/v1-reference/full/valid/codeBlock-empty-content.json +10 -0
  154. package/src/__tests__/unit/json-schema/v1-reference/full/valid/codeBlock-with-breakout-mark.json +14 -0
  155. package/src/__tests__/unit/json-schema/v1-reference/full/valid/codeBlock-with-empty-marks.json +13 -0
  156. package/src/__tests__/unit/json-schema/v1-reference/full/valid/codeBlock-with-language.json +482 -0
  157. package/src/__tests__/unit/json-schema/v1-reference/full/valid/codeBlock-with-multiple-text.json +19 -0
  158. package/src/__tests__/unit/json-schema/v1-reference/full/valid/codeBlock-with-text.json +15 -0
  159. package/src/__tests__/unit/json-schema/v1-reference/full/valid/codeBlock-with-unknown-language.json +13 -0
  160. package/src/__tests__/unit/json-schema/v1-reference/full/valid/decision-with-mention.json +34 -0
  161. package/src/__tests__/unit/json-schema/v1-reference/full/valid/decisionList-with-decision.json +27 -0
  162. package/src/__tests__/unit/json-schema/v1-reference/full/valid/doc-with-all-content.json +32 -0
  163. package/src/__tests__/unit/json-schema/v1-reference/full/valid/doc-with-content.json +9 -0
  164. package/src/__tests__/unit/json-schema/v1-reference/full/valid/doc-with-empty-content.json +5 -0
  165. package/src/__tests__/unit/json-schema/v1-reference/full/valid/embed-card.json +17 -0
  166. package/src/__tests__/unit/json-schema/v1-reference/full/valid/emoji-with-fallback.json +19 -0
  167. package/src/__tests__/unit/json-schema/v1-reference/full/valid/emoji-with-variation.json +18 -0
  168. package/src/__tests__/unit/json-schema/v1-reference/full/valid/emoji.json +17 -0
  169. package/src/__tests__/unit/json-schema/v1-reference/full/valid/expand-with-embed-card.json +34 -0
  170. package/src/__tests__/unit/json-schema/v1-reference/full/valid/expand-with-marks.json +26 -0
  171. package/src/__tests__/unit/json-schema/v1-reference/full/valid/expand-with-nestedExpand.json +136 -0
  172. package/src/__tests__/unit/json-schema/v1-reference/full/valid/expand.json +18 -0
  173. package/src/__tests__/unit/json-schema/v1-reference/full/valid/extension-with-data-consumer-mark.json +23 -0
  174. package/src/__tests__/unit/json-schema/v1-reference/full/valid/extension-with-empty-marks.json +17 -0
  175. package/src/__tests__/unit/json-schema/v1-reference/full/valid/extension-with-local-id.json +16 -0
  176. package/src/__tests__/unit/json-schema/v1-reference/full/valid/extension-with-named-fragment-mark.json +25 -0
  177. package/src/__tests__/unit/json-schema/v1-reference/full/valid/extension-with-parameters.json +24 -0
  178. package/src/__tests__/unit/json-schema/v1-reference/full/valid/hardBreak-empty-attrs.json +15 -0
  179. package/src/__tests__/unit/json-schema/v1-reference/full/valid/hardBreak-with-text.json +17 -0
  180. package/src/__tests__/unit/json-schema/v1-reference/full/valid/hardBreak.json +14 -0
  181. package/src/__tests__/unit/json-schema/v1-reference/full/valid/heading-with-code-text.json +23 -0
  182. package/src/__tests__/unit/json-schema/v1-reference/full/valid/heading-with-content.json +78 -0
  183. package/src/__tests__/unit/json-schema/v1-reference/full/valid/heading-with-em-text.json +23 -0
  184. package/src/__tests__/unit/json-schema/v1-reference/full/valid/heading-with-empty-content.json +78 -0
  185. package/src/__tests__/unit/json-schema/v1-reference/full/valid/heading-with-empty-marks.json +14 -0
  186. package/src/__tests__/unit/json-schema/v1-reference/full/valid/heading-with-link-text.json +26 -0
  187. package/src/__tests__/unit/json-schema/v1-reference/full/valid/heading-with-strike-text.json +23 -0
  188. package/src/__tests__/unit/json-schema/v1-reference/full/valid/heading-with-strong-text.json +23 -0
  189. package/src/__tests__/unit/json-schema/v1-reference/full/valid/heading-with-subsup-text.json +26 -0
  190. package/src/__tests__/unit/json-schema/v1-reference/full/valid/heading-with-supported-mark.json +26 -0
  191. package/src/__tests__/unit/json-schema/v1-reference/full/valid/heading-with-underline-text.json +23 -0
  192. package/src/__tests__/unit/json-schema/v1-reference/full/valid/inlineExtension-with-data-consumer-mark.json +48 -0
  193. package/src/__tests__/unit/json-schema/v1-reference/full/valid/inlineExtension-with-fragment-mark.json +27 -0
  194. package/src/__tests__/unit/json-schema/v1-reference/full/valid/inlineExtension-with-parameters.json +29 -0
  195. package/src/__tests__/unit/json-schema/v1-reference/full/valid/inlineExtension-without-parameters.json +18 -0
  196. package/src/__tests__/unit/json-schema/v1-reference/full/valid/layout-with-embed.json +51 -0
  197. package/src/__tests__/unit/json-schema/v1-reference/full/valid/layoutSection-with-three-columns.json +50 -0
  198. package/src/__tests__/unit/json-schema/v1-reference/full/valid/layoutSection-with-two-columns-and-breakout.json +40 -0
  199. package/src/__tests__/unit/json-schema/v1-reference/full/valid/layoutSection-with-two-columns.json +37 -0
  200. package/src/__tests__/unit/json-schema/v1-reference/full/valid/link-with-href-title.json +24 -0
  201. package/src/__tests__/unit/json-schema/v1-reference/full/valid/link-with-href.json +23 -0
  202. package/src/__tests__/unit/json-schema/v1-reference/full/valid/list-item-with-bullet-list-and-media-single.json +47 -0
  203. package/src/__tests__/unit/json-schema/v1-reference/full/valid/list-item-with-media-single-and-bullet-list.json +57 -0
  204. package/src/__tests__/unit/json-schema/v1-reference/full/valid/list-item-with-ordered-list.json +37 -0
  205. package/src/__tests__/unit/json-schema/v1-reference/full/valid/list-item-with-paragraph.json +23 -0
  206. package/src/__tests__/unit/json-schema/v1-reference/full/valid/list-with-codeBlock.json +23 -0
  207. package/src/__tests__/unit/json-schema/v1-reference/full/valid/listItem-with-content.json +23 -0
  208. package/src/__tests__/unit/json-schema/v1-reference/full/valid/media-external-with-alt-text-value.json +26 -0
  209. package/src/__tests__/unit/json-schema/v1-reference/full/valid/media-single-with-a-link-mark-in-a-layout-column.json +57 -0
  210. package/src/__tests__/unit/json-schema/v1-reference/full/valid/media-single-with-a-link-mark-in-a-list-item.json +88 -0
  211. package/src/__tests__/unit/json-schema/v1-reference/full/valid/media-single-with-a-link-mark-in-a-nested-expand.json +64 -0
  212. package/src/__tests__/unit/json-schema/v1-reference/full/valid/media-single-with-a-link-mark-in-a-table.json +56 -0
  213. package/src/__tests__/unit/json-schema/v1-reference/full/valid/media-single-with-a-link-mark-in-an-expand.json +44 -0
  214. package/src/__tests__/unit/json-schema/v1-reference/full/valid/media-with-alt-text-value.json +29 -0
  215. package/src/__tests__/unit/json-schema/v1-reference/full/valid/media-with-alt-text.json +29 -0
  216. package/src/__tests__/unit/json-schema/v1-reference/full/valid/media-with-link-mark.json +36 -0
  217. package/src/__tests__/unit/json-schema/v1-reference/full/valid/media-with-occurrence-key.json +20 -0
  218. package/src/__tests__/unit/json-schema/v1-reference/full/valid/media-with-type-link.json +19 -0
  219. package/src/__tests__/unit/json-schema/v1-reference/full/valid/media.json +19 -0
  220. package/src/__tests__/unit/json-schema/v1-reference/full/valid/mediaGroup-with-multiple-media.json +27 -0
  221. package/src/__tests__/unit/json-schema/v1-reference/full/valid/mediaInline-with-file-type-attr.json +23 -0
  222. package/src/__tests__/unit/json-schema/v1-reference/full/valid/mediaInline-with-link-mark.json +30 -0
  223. package/src/__tests__/unit/json-schema/v1-reference/full/valid/mediaInline-with-link-type-attr.json +23 -0
  224. package/src/__tests__/unit/json-schema/v1-reference/full/valid/mediaInline.json +22 -0
  225. package/src/__tests__/unit/json-schema/v1-reference/full/valid/mediaSingle-with-caption-inside-list-item.json +38 -0
  226. package/src/__tests__/unit/json-schema/v1-reference/full/valid/mediaSingle-with-caption.json +28 -0
  227. package/src/__tests__/unit/json-schema/v1-reference/full/valid/mediaSingle-with-link-mark.json +32 -0
  228. package/src/__tests__/unit/json-schema/v1-reference/full/valid/mediaSingle-with-parameters.json +86 -0
  229. package/src/__tests__/unit/json-schema/v1-reference/full/valid/mediaSingle-with-width.json +74 -0
  230. package/src/__tests__/unit/json-schema/v1-reference/full/valid/mediaSingle-without-parameters.json +19 -0
  231. package/src/__tests__/unit/json-schema/v1-reference/full/valid/mention-with-attrs.json +18 -0
  232. package/src/__tests__/unit/json-schema/v1-reference/full/valid/mention-with-user-type.json +35 -0
  233. package/src/__tests__/unit/json-schema/v1-reference/full/valid/nested-extensions-with-data-consumer-mark.json +226 -0
  234. package/src/__tests__/unit/json-schema/v1-reference/full/valid/nested-extensions-without-mark.json +176 -0
  235. package/src/__tests__/unit/json-schema/v1-reference/full/valid/nestedExpand.json +128 -0
  236. package/src/__tests__/unit/json-schema/v1-reference/full/valid/orderedList-with-content.json +30 -0
  237. package/src/__tests__/unit/json-schema/v1-reference/full/valid/orderedList-with-order.json +33 -0
  238. package/src/__tests__/unit/json-schema/v1-reference/full/valid/panel-info.json +21 -0
  239. package/src/__tests__/unit/json-schema/v1-reference/full/valid/panel-note.json +21 -0
  240. package/src/__tests__/unit/json-schema/v1-reference/full/valid/panel-tip.json +21 -0
  241. package/src/__tests__/unit/json-schema/v1-reference/full/valid/panel-warning.json +21 -0
  242. package/src/__tests__/unit/json-schema/v1-reference/full/valid/panel-with-blockCard.json +20 -0
  243. package/src/__tests__/unit/json-schema/v1-reference/full/valid/panel-with-list.json +31 -0
  244. package/src/__tests__/unit/json-schema/v1-reference/full/valid/panel-with-paragraph.json +21 -0
  245. package/src/__tests__/unit/json-schema/v1-reference/full/valid/paragraph-with-content.json +15 -0
  246. package/src/__tests__/unit/json-schema/v1-reference/full/valid/paragraph-with-empty-content.json +10 -0
  247. package/src/__tests__/unit/json-schema/v1-reference/full/valid/paragraph-with-empty-marks.json +11 -0
  248. package/src/__tests__/unit/json-schema/v1-reference/full/valid/paragraph-with-supported-mark.json +23 -0
  249. package/src/__tests__/unit/json-schema/v1-reference/full/valid/paragraph-without-content.json +9 -0
  250. package/src/__tests__/unit/json-schema/v1-reference/full/valid/placeholder.json +17 -0
  251. package/src/__tests__/unit/json-schema/v1-reference/full/valid/rule.json +9 -0
  252. package/src/__tests__/unit/json-schema/v1-reference/full/valid/status-nested-in-list.json +43 -0
  253. package/src/__tests__/unit/json-schema/v1-reference/full/valid/status-with-all-attrs.json +23 -0
  254. package/src/__tests__/unit/json-schema/v1-reference/full/valid/status-with-default-attrs.json +23 -0
  255. package/src/__tests__/unit/json-schema/v1-reference/full/valid/subsup-as-sub.json +23 -0
  256. package/src/__tests__/unit/json-schema/v1-reference/full/valid/subsup-as-sup.json +23 -0
  257. package/src/__tests__/unit/json-schema/v1-reference/full/valid/table-with-empty-cell.json +29 -0
  258. package/src/__tests__/unit/json-schema/v1-reference/full/valid/table-with-fragment-mark.json +41 -0
  259. package/src/__tests__/unit/json-schema/v1-reference/full/valid/table-with-header-row.json +34 -0
  260. package/src/__tests__/unit/json-schema/v1-reference/full/valid/table-with-layout.json +50 -0
  261. package/src/__tests__/unit/json-schema/v1-reference/full/valid/table-with-local-id.json +32 -0
  262. package/src/__tests__/unit/json-schema/v1-reference/full/valid/table-with-nested-nodes.json +32 -0
  263. package/src/__tests__/unit/json-schema/v1-reference/full/valid/task-with-mention.json +34 -0
  264. package/src/__tests__/unit/json-schema/v1-reference/full/valid/taskList-with-nested-taskLists.json +74 -0
  265. package/src/__tests__/unit/json-schema/v1-reference/full/valid/taskList-with-tasks.json +40 -0
  266. package/src/__tests__/unit/json-schema/v1-reference/full/valid/text-code-and-link.json +26 -0
  267. package/src/__tests__/unit/json-schema/v1-reference/full/valid/text-code.json +20 -0
  268. package/src/__tests__/unit/json-schema/v1-reference/full/valid/text-em.json +20 -0
  269. package/src/__tests__/unit/json-schema/v1-reference/full/valid/text-link.json +23 -0
  270. package/src/__tests__/unit/json-schema/v1-reference/full/valid/text-strong.json +20 -0
  271. package/src/__tests__/unit/json-schema/v1-reference/full/valid/text-subsup.json +23 -0
  272. package/src/__tests__/unit/json-schema/v1-reference/full/valid/text-textColor.json +23 -0
  273. package/src/__tests__/unit/json-schema/v1-reference/full/valid/text-underline.json +20 -0
  274. package/src/__tests__/unit/json-schema/v1-reference/full/valid/text.json +15 -0
  275. package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/.gitkeep +0 -0
  276. package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/blockcard-with-empty-attrs.json +10 -0
  277. package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/blockcard-with-empty-datasource.json +12 -0
  278. package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/blockcard-with-invalid-datasource-empty-views.json +21 -0
  279. package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/blockcard-with-invalid-datasource-id.json +32 -0
  280. package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/blockcard-with-invalid-datasource-layout.json +32 -0
  281. package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/blockcard-with-invalid-datasource-views-type.json +32 -0
  282. package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/blockcard-with-invalid-datasource-width.json +32 -0
  283. package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/bodiedExtension-with-source-as-string-data-consumer-mark.json +46 -0
  284. package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/extension-with-invalid-local-id.json +16 -0
  285. package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/extension-with-nonsense-marks.json +21 -0
  286. package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/inlineExtension-with-source-as-string-data-consumer-mark.json +48 -0
  287. package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/mediaSingle-with-invalid-percentage-width.json +23 -0
  288. package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/mediaSingle-with-invalid-pixel-width.json +24 -0
  289. package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/nested-extensions-with-link-mark.json +216 -0
  290. package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/table-with-empty-local-id.json +32 -0
  291. package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/table-with-invalid-local-id.json +32 -0
  292. package/src/__tests__/unit/json-schema/v1-reference/stage-0/invalid/table-with-invalid-width.json +32 -0
  293. package/src/__tests__/unit/json-schema/v1-reference/stage-0/valid/.gitkeep +0 -0
  294. package/src/__tests__/unit/json-schema/v1-reference/stage-0/valid/blockcard-with-datasources.json +38 -0
  295. package/src/__tests__/unit/json-schema/v1-reference/stage-0/valid/blockcard-with-empty-datasource-parameters.json +29 -0
  296. package/src/__tests__/unit/json-schema/v1-reference/stage-0/valid/blockcard-without-optional-fields.json +23 -0
  297. package/src/__tests__/unit/json-schema/v1-reference/stage-0/valid/layoutSection-with-one-column.json +24 -0
  298. package/src/__tests__/unit/json-schema/v1-reference/stage-0/valid/mediaSingle-with-percentage-width.json +24 -0
  299. package/src/__tests__/unit/json-schema/v1-reference/stage-0/valid/mediaSingle-with-pixel-width.json +24 -0
  300. package/src/__tests__/unit/json-schema/v1-reference/stage-0/valid/table-with-width.json +32 -0
  301. package/src/__tests__/unit/json-schema/v1.ts +53 -0
  302. package/src/__tests__/unit/schema/create-schema.ts +214 -0
  303. package/src/__tests__/unit/schema/default-schema.ts +192 -0
  304. package/src/__tests__/unit/schema/marks/annotation.ts +46 -0
  305. package/src/__tests__/unit/schema/marks/border.ts +76 -0
  306. package/src/__tests__/unit/schema/marks/breakout.ts +24 -0
  307. package/src/__tests__/unit/schema/marks/code.ts +44 -0
  308. package/src/__tests__/unit/schema/marks/confluence-inline-comment.ts +25 -0
  309. package/src/__tests__/unit/schema/marks/data-consumer.ts +52 -0
  310. package/src/__tests__/unit/schema/marks/em.ts +37 -0
  311. package/src/__tests__/unit/schema/marks/link.ts +188 -0
  312. package/src/__tests__/unit/schema/marks/strike.ts +37 -0
  313. package/src/__tests__/unit/schema/marks/strong.ts +43 -0
  314. package/src/__tests__/unit/schema/marks/subsup.ts +50 -0
  315. package/src/__tests__/unit/schema/marks/text-color.ts +61 -0
  316. package/src/__tests__/unit/schema/marks/underline.ts +36 -0
  317. package/src/__tests__/unit/schema/nodes/_consts.ts +964 -0
  318. package/src/__tests__/unit/schema/nodes/block-card.ts +184 -0
  319. package/src/__tests__/unit/schema/nodes/blockquote.ts +44 -0
  320. package/src/__tests__/unit/schema/nodes/bodied-extension.ts +101 -0
  321. package/src/__tests__/unit/schema/nodes/code-block.ts +221 -0
  322. package/src/__tests__/unit/schema/nodes/confluence-unsupported-block.ts +36 -0
  323. package/src/__tests__/unit/schema/nodes/confluence-unsupported-inline.ts +35 -0
  324. package/src/__tests__/unit/schema/nodes/date.ts +51 -0
  325. package/src/__tests__/unit/schema/nodes/decision-item.ts +46 -0
  326. package/src/__tests__/unit/schema/nodes/decision-list.ts +52 -0
  327. package/src/__tests__/unit/schema/nodes/embed-card.ts +60 -0
  328. package/src/__tests__/unit/schema/nodes/emoji.ts +71 -0
  329. package/src/__tests__/unit/schema/nodes/expand.ts +51 -0
  330. package/src/__tests__/unit/schema/nodes/extension.ts +101 -0
  331. package/src/__tests__/unit/schema/nodes/hard-break.ts +24 -0
  332. package/src/__tests__/unit/schema/nodes/heading.ts +56 -0
  333. package/src/__tests__/unit/schema/nodes/image.ts +32 -0
  334. package/src/__tests__/unit/schema/nodes/inline-card.ts +106 -0
  335. package/src/__tests__/unit/schema/nodes/inline-extension.ts +79 -0
  336. package/src/__tests__/unit/schema/nodes/layout-column.ts +54 -0
  337. package/src/__tests__/unit/schema/nodes/layout-section.ts +95 -0
  338. package/src/__tests__/unit/schema/nodes/list-item.ts +49 -0
  339. package/src/__tests__/unit/schema/nodes/media-group.ts +67 -0
  340. package/src/__tests__/unit/schema/nodes/media-single.ts +171 -0
  341. package/src/__tests__/unit/schema/nodes/media.ts +388 -0
  342. package/src/__tests__/unit/schema/nodes/mention.ts +115 -0
  343. package/src/__tests__/unit/schema/nodes/nestedExpand.ts +72 -0
  344. package/src/__tests__/unit/schema/nodes/ordered-list.ts +49 -0
  345. package/src/__tests__/unit/schema/nodes/panel.ts +180 -0
  346. package/src/__tests__/unit/schema/nodes/paragraph.ts +25 -0
  347. package/src/__tests__/unit/schema/nodes/placeholder.ts +46 -0
  348. package/src/__tests__/unit/schema/nodes/rule.ts +24 -0
  349. package/src/__tests__/unit/schema/nodes/status.ts +120 -0
  350. package/src/__tests__/unit/schema/nodes/tableNodes.ts +555 -0
  351. package/src/__tests__/unit/schema/nodes/task-item.ts +39 -0
  352. package/src/__tests__/unit/schema/nodes/task-list.ts +45 -0
  353. package/src/__tests__/unit/schema/nodes/unknown-block.ts +42 -0
  354. package/src/__tests__/unit/schema/nodes/unsupported-block.ts +42 -0
  355. package/src/__tests__/unit/schema/nodes/unsupported-inline.ts +38 -0
  356. package/src/__tests__/unit/utils/colors.ts +42 -0
  357. package/src/__tests__/unit/utils/url.ts +209 -0
  358. package/src/index.ts +297 -0
  359. package/src/json-schema/index.ts +2 -0
  360. package/src/schema/bitbucket-schema.ts +43 -0
  361. package/src/schema/confluence-schema.ts +76 -0
  362. package/src/schema/create-schema.ts +337 -0
  363. package/src/schema/default-schema.ts +180 -0
  364. package/src/schema/groups.ts +30 -0
  365. package/src/schema/index.ts +238 -0
  366. package/src/schema/inline-nodes.ts +9 -0
  367. package/src/schema/jira-schema.ts +158 -0
  368. package/src/schema/marks/__tests__/unit/annotation.ts +18 -0
  369. package/src/schema/marks/alignment.ts +48 -0
  370. package/src/schema/marks/annotation.ts +107 -0
  371. package/src/schema/marks/border.ts +74 -0
  372. package/src/schema/marks/breakout.ts +42 -0
  373. package/src/schema/marks/code.ts +45 -0
  374. package/src/schema/marks/confluence-inline-comment.ts +32 -0
  375. package/src/schema/marks/data-consumer.ts +100 -0
  376. package/src/schema/marks/em.ts +19 -0
  377. package/src/schema/marks/fragment.ts +77 -0
  378. package/src/schema/marks/indentation.ts +47 -0
  379. package/src/schema/marks/index.ts +61 -0
  380. package/src/schema/marks/link.ts +139 -0
  381. package/src/schema/marks/strike.ts +26 -0
  382. package/src/schema/marks/strong.ts +45 -0
  383. package/src/schema/marks/subsup.ts +53 -0
  384. package/src/schema/marks/text-color.ts +172 -0
  385. package/src/schema/marks/type-ahead-query.ts +22 -0
  386. package/src/schema/marks/underline.ts +24 -0
  387. package/src/schema/marks/unsupported-mark.ts +9 -0
  388. package/src/schema/marks/unsupported-node-attributes.ts +8 -0
  389. package/src/schema/nodes/block-card.ts +121 -0
  390. package/src/schema/nodes/blockquote.ts +25 -0
  391. package/src/schema/nodes/bodied-extension.ts +75 -0
  392. package/src/schema/nodes/bullet-list.ts +17 -0
  393. package/src/schema/nodes/caption.ts +51 -0
  394. package/src/schema/nodes/code-block.ts +176 -0
  395. package/src/schema/nodes/confluence-jira-issue.ts +43 -0
  396. package/src/schema/nodes/confluence-unsupported-block.ts +29 -0
  397. package/src/schema/nodes/confluence-unsupported-inline.ts +30 -0
  398. package/src/schema/nodes/date.ts +38 -0
  399. package/src/schema/nodes/decision-item.ts +50 -0
  400. package/src/schema/nodes/decision-list.ts +56 -0
  401. package/src/schema/nodes/doc.ts +30 -0
  402. package/src/schema/nodes/embed-card.ts +62 -0
  403. package/src/schema/nodes/emoji.ts +89 -0
  404. package/src/schema/nodes/expand.ts +101 -0
  405. package/src/schema/nodes/extension.ts +60 -0
  406. package/src/schema/nodes/hard-break.ts +21 -0
  407. package/src/schema/nodes/heading.ts +64 -0
  408. package/src/schema/nodes/image.ts +32 -0
  409. package/src/schema/nodes/index.ts +184 -0
  410. package/src/schema/nodes/inline-card.ts +70 -0
  411. package/src/schema/nodes/inline-extension.ts +57 -0
  412. package/src/schema/nodes/layout-column.ts +68 -0
  413. package/src/schema/nodes/layout-section.ts +93 -0
  414. package/src/schema/nodes/list-item.ts +13 -0
  415. package/src/schema/nodes/media-group.ts +44 -0
  416. package/src/schema/nodes/media-inline.ts +19 -0
  417. package/src/schema/nodes/media-single.ts +179 -0
  418. package/src/schema/nodes/media.ts +249 -0
  419. package/src/schema/nodes/mention.ts +86 -0
  420. package/src/schema/nodes/nested-expand.ts +77 -0
  421. package/src/schema/nodes/ordered-list.ts +62 -0
  422. package/src/schema/nodes/panel.ts +133 -0
  423. package/src/schema/nodes/paragraph.ts +79 -0
  424. package/src/schema/nodes/placeholder.ts +40 -0
  425. package/src/schema/nodes/rule.ts +17 -0
  426. package/src/schema/nodes/status.ts +58 -0
  427. package/src/schema/nodes/tableNodes.ts +480 -0
  428. package/src/schema/nodes/task-item.ts +51 -0
  429. package/src/schema/nodes/task-list.ts +61 -0
  430. package/src/schema/nodes/text.ts +19 -0
  431. package/src/schema/nodes/types/block-content.ts +51 -0
  432. package/src/schema/nodes/types/extensions.ts +36 -0
  433. package/src/schema/nodes/types/inline-content.ts +56 -0
  434. package/src/schema/nodes/types/list.ts +54 -0
  435. package/src/schema/nodes/types/mark.ts +16 -0
  436. package/src/schema/nodes/types/non-nestable-block-content.ts +39 -0
  437. package/src/schema/nodes/types/rich-media-common.ts +51 -0
  438. package/src/schema/nodes/unknown-block.ts +13 -0
  439. package/src/schema/nodes/unsupported-block.ts +28 -0
  440. package/src/schema/nodes/unsupported-inline.ts +27 -0
  441. package/src/schema/unsupported.ts +4 -0
  442. package/src/steps/__tests__/unit/analytics.ts +72 -0
  443. package/src/steps/__tests__/unit/link-meta-step.ts +64 -0
  444. package/src/steps/__tests__/unit/override-document-step.ts +174 -0
  445. package/src/steps/__tests__/unit/set-attrs.ts +71 -0
  446. package/src/steps/analytics.ts +189 -0
  447. package/src/steps/link-meta-step.ts +105 -0
  448. package/src/steps/override-document-step.ts +97 -0
  449. package/src/steps/set-attrs.tsx +74 -0
  450. package/src/steps/table/__tests__/__fixtures__/basic/add-column-at-0.json +15 -0
  451. package/src/steps/table/__tests__/__fixtures__/basic/add-column-at-1.json +15 -0
  452. package/src/steps/table/__tests__/__fixtures__/basic/add-column-at-2.json +15 -0
  453. package/src/steps/table/__tests__/__fixtures__/basic/add-column-at-3.json +15 -0
  454. package/src/steps/table/__tests__/__fixtures__/basic/remove-column-at-0.json +9 -0
  455. package/src/steps/table/__tests__/__fixtures__/basic/remove-column-at-1.json +9 -0
  456. package/src/steps/table/__tests__/__fixtures__/basic/remove-column-at-2.json +9 -0
  457. package/src/steps/table/__tests__/__fixtures__/basic/remove-table/remove-last-row-inverted.json +98 -0
  458. package/src/steps/table/__tests__/__fixtures__/basic/remove-table/remove-last-row.json +71 -0
  459. package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/add-column-at-0-inverted.json +19 -0
  460. package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/add-column-at-0.json +19 -0
  461. package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/add-column-at-1-inverted.json +21 -0
  462. package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/add-column-at-1.json +21 -0
  463. package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/add-column-at-2-inverted.json +21 -0
  464. package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/add-column-at-2.json +21 -0
  465. package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/add-column-at-3-inverted.json +19 -0
  466. package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/add-column-at-3.json +19 -0
  467. package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/remove-column-at-0-inverted.json +63 -0
  468. package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/remove-column-at-0.json +21 -0
  469. package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/remove-column-at-1-inverted.json +64 -0
  470. package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/remove-column-at-1.json +22 -0
  471. package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/remove-column-at-2-inverted.json +63 -0
  472. package/src/steps/table/__tests__/__fixtures__/merge-cells/columns/remove-column-at-2.json +21 -0
  473. package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/add-column-at-0-inverted.json +19 -0
  474. package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/add-column-at-0.json +19 -0
  475. package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/add-column-at-1-inverted.json +19 -0
  476. package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/add-column-at-1.json +19 -0
  477. package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/add-column-at-2-inverted.json +19 -0
  478. package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/add-column-at-2.json +19 -0
  479. package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/add-column-at-3-inverted.json +19 -0
  480. package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/add-column-at-3.json +19 -0
  481. package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/remove-column-at-0-inverted.json +52 -0
  482. package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/remove-column-at-0.json +38 -0
  483. package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/remove-column-at-1-inverted.json +52 -0
  484. package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/remove-column-at-1.json +38 -0
  485. package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/remove-column-at-2-inverted.json +25 -0
  486. package/src/steps/table/__tests__/__fixtures__/merge-cells/rows/remove-column-at-2.json +11 -0
  487. package/src/steps/table/__tests__/_utils.ts +103 -0
  488. package/src/steps/table/__tests__/add-column-merge-columns.ts +491 -0
  489. package/src/steps/table/__tests__/add-column-merge-rows.ts +450 -0
  490. package/src/steps/table/__tests__/add-column.ts +610 -0
  491. package/src/steps/table/add-column.ts +440 -0
  492. package/src/steps/table/constants.ts +4 -0
  493. package/src/steps/table/sort-column.ts +57 -0
  494. package/src/steps/table/types.ts +48 -0
  495. package/src/steps/table/utils/cell-step.ts +239 -0
  496. package/src/steps/table/utils/cells-at-column.ts +72 -0
  497. package/src/steps/table/utils/find-column.ts +90 -0
  498. package/src/steps/table/utils/get-table-rect-from-doc.ts +37 -0
  499. package/src/steps/table/utils/side-effects/rows.ts +327 -0
  500. package/src/steps/table/utils/side-effects/side-effects.ts +90 -0
  501. package/src/steps/table/utils/side-effects/table.ts +112 -0
  502. package/src/steps/table/utils/side-effects/types.ts +34 -0
  503. package/src/steps/table/utils/table-map.ts +28 -0
  504. package/src/steps/type-ahead.ts +100 -0
  505. package/src/steps.ts +16 -0
  506. package/src/utils/colors.ts +171 -0
  507. package/src/utils/confluence/emoji.ts +99 -0
  508. package/src/utils/extensions.ts +32 -0
  509. package/src/utils/index.ts +69 -0
  510. package/src/utils/parseDOM.ts +2 -0
  511. package/src/utils/url.ts +173 -0
  512. package/src/utils/uuid.ts +19 -0
  513. package/src/version.json +6 -0
  514. package/babel.config.js +0 -156
@@ -0,0 +1,327 @@
1
+ import {
2
+ Node as ProseMirrorNode,
3
+ Schema,
4
+ } from '@atlaskit/editor-prosemirror/model';
5
+ import {
6
+ Mappable,
7
+ StepMap,
8
+ Transform,
9
+ } from '@atlaskit/editor-prosemirror/transform';
10
+ import { TableRect } from '@atlaskit/editor-tables/table-map';
11
+ import { hasMergedColumns } from '../table-map';
12
+ import { RowSideEffect, RowSideEffectJSON } from './types';
13
+ import { Cell } from '../cells-at-column';
14
+
15
+ function mergedRanges(first: number[], second: number[]) {
16
+ const newRanges: number[] = [];
17
+ const firstLength = first.length;
18
+ const secondLength = second.length;
19
+
20
+ let i = 0;
21
+ let j = 0;
22
+ while (i < firstLength && j < secondLength) {
23
+ if (first[i] < second[j]) {
24
+ newRanges.push(first[i], first[i + 1], first[i + 2]);
25
+ i += 3;
26
+ } else {
27
+ newRanges.push(second[j], second[j + 1], second[j + 2]);
28
+ j += 3;
29
+ }
30
+ }
31
+
32
+ if (i < firstLength) {
33
+ newRanges.push(...first.slice(i));
34
+ }
35
+ if (j < secondLength) {
36
+ newRanges.push(...second.slice(i));
37
+ }
38
+ return newRanges;
39
+ }
40
+
41
+ function increaseRowSpan(tr: Transform, rect: TableRect, row: number): void {
42
+ const { map, tableStart } = rect;
43
+ for (let col = 0; col < map.width; col++) {
44
+ let index = row * map.width + col;
45
+ let pos = map.map[index];
46
+ const mappedPos = tr.mapping.map(pos + tableStart);
47
+ let attrs = tr.doc.nodeAt(mappedPos)!.attrs;
48
+ tr.setNodeMarkup(mappedPos, undefined, {
49
+ ...attrs,
50
+ rowspan: attrs.rowspan + 1,
51
+ });
52
+ col += attrs.colspan - 1;
53
+ }
54
+ }
55
+
56
+ function decreaseRowspan(
57
+ tr: Transform,
58
+ rect: TableRect,
59
+ row: number,
60
+ colToRemove: number,
61
+ ): number {
62
+ let skipRows = 0;
63
+ const { map, table, tableStart } = rect;
64
+ for (let col = 0; col < map.width; col++) {
65
+ let index = row * map.width + col;
66
+ let pos = map.map[index];
67
+ if (row > 0 && pos === map.map[index - map.width]) {
68
+ // If this cell starts in the row above, simply reduce its rowspan
69
+ const mappedPos = tr.mapping.map(pos + tableStart);
70
+ let attrs = tr.doc.nodeAt(mappedPos)!.attrs;
71
+ tr.setNodeMarkup(mappedPos, undefined, {
72
+ ...attrs,
73
+ rowspan: attrs.rowspan - 1,
74
+ });
75
+ col += attrs.colspan - 1;
76
+ } else if (col === colToRemove) {
77
+ skipRows = table.nodeAt(pos)!.attrs.rowspan - 1;
78
+ }
79
+ }
80
+ return skipRows;
81
+ }
82
+
83
+ function isLastCellInRow(rect: TableRect, row: number, col: number): boolean {
84
+ const rowNode = rect.table.child(row);
85
+ if (!rowNode) {
86
+ return false;
87
+ }
88
+ return rowNode.childCount === 1 && !hasMergedColumns(rect.map, row, col);
89
+ }
90
+
91
+ interface RowsHandler {
92
+ handle: (
93
+ tr: Transform,
94
+ rect: TableRect,
95
+ row: number,
96
+ col: number,
97
+ cell: Cell,
98
+ ) => {
99
+ handled: boolean;
100
+ skipRows?: number;
101
+ };
102
+
103
+ end: (tr: Transform, rect: TableRect, col: number) => void;
104
+ }
105
+
106
+ function removeRowWithLastCell(
107
+ tr: Transform,
108
+ rect: TableRect,
109
+ row: number,
110
+ _col: number,
111
+ ): {
112
+ skipRows: number;
113
+ row: RowSideEffect;
114
+ } {
115
+ // Get row pos
116
+ let from = rect.tableStart;
117
+ for (let i = 0; i < row; i++) {
118
+ from += rect.table.child(i).nodeSize;
119
+ }
120
+ const rowNode = rect.table.child(row);
121
+ let to = from + rowNode.nodeSize;
122
+
123
+ // Create sideEffect and delete the row
124
+ // We store original row position before modifications
125
+ tr.delete(tr.mapping.map(from), tr.mapping.map(to));
126
+
127
+ // Change rowspan of all cells except current col and get the rows to skip
128
+ const skipRows = decreaseRowspan(tr, rect, row, _col);
129
+
130
+ return {
131
+ skipRows,
132
+ row: {
133
+ from,
134
+ to,
135
+ rowNode: rowNode.copy(rowNode.content),
136
+ },
137
+ };
138
+ }
139
+
140
+ function addRow(
141
+ tr: Transform,
142
+ rect: TableRect,
143
+ prevRow: number,
144
+ rowSideEffect: RowSideEffect,
145
+ ): number {
146
+ const cellNode = rowSideEffect.rowNode.child(0);
147
+
148
+ tr.insert(tr.mapping.map(rowSideEffect.from), rowSideEffect.rowNode);
149
+
150
+ increaseRowSpan(tr, rect, prevRow);
151
+ return cellNode.attrs.rowspan - 1;
152
+ }
153
+
154
+ export class RowsSideEffectHandler {
155
+ public rows?: RowSideEffect[];
156
+
157
+ constructor(rowsSideEffect?: RowSideEffect[]) {
158
+ this.rows = rowsSideEffect;
159
+ }
160
+
161
+ private deleteHandler = (): RowsHandler => {
162
+ const newRows: RowSideEffect[] = [];
163
+ return {
164
+ handle: (tr, rect, row, col, cell) => {
165
+ if (!isLastCellInRow(rect, row, col)) {
166
+ return {
167
+ handled: false,
168
+ };
169
+ }
170
+
171
+ const { row: rowSideEffect, skipRows } = removeRowWithLastCell(
172
+ tr,
173
+ rect,
174
+ row,
175
+ col,
176
+ );
177
+ newRows.push(rowSideEffect);
178
+
179
+ return { handled: true, skipRows: skipRows };
180
+ },
181
+ end: () => {
182
+ if (newRows.length > 0) {
183
+ this.rows = newRows;
184
+ } else {
185
+ this.rows = undefined;
186
+ }
187
+ },
188
+ };
189
+ };
190
+
191
+ private addHandler = (): RowsHandler => {
192
+ let lastCellFrom = 0;
193
+ let i = 0;
194
+
195
+ return {
196
+ handle: (tr, rect, row, col, cell) => {
197
+ // // If not sideEffects stored return;
198
+ if (!this.rows || i >= this.rows.length) {
199
+ return { handled: false };
200
+ }
201
+
202
+ // Next row to add;
203
+ let skipRows: undefined | number;
204
+ let nextRow: RowSideEffect;
205
+ while (
206
+ (nextRow = this.rows[i]) &&
207
+ nextRow.from > lastCellFrom &&
208
+ nextRow.from < cell.from
209
+ ) {
210
+ // I am in between of the previous and next row in the table;
211
+ skipRows = addRow(tr, rect, row - 1, nextRow);
212
+ i++;
213
+ }
214
+ lastCellFrom = cell.from;
215
+ if (!skipRows || skipRows === 0) {
216
+ return { handled: false };
217
+ }
218
+
219
+ return {
220
+ handled: true,
221
+ skipRows: skipRows - 1,
222
+ };
223
+ },
224
+ end: (tr, rect, col: number) => {
225
+ if (!this.rows || i >= this.rows.length) {
226
+ return;
227
+ }
228
+
229
+ // Add rows at the end of the table
230
+ let nextRow: RowSideEffect;
231
+ while ((nextRow = this.rows[i])) {
232
+ addRow(tr, rect, rect.map.height - 1, nextRow);
233
+ i++;
234
+ }
235
+ },
236
+ };
237
+ };
238
+
239
+ start(isDelete: boolean): RowsHandler {
240
+ if (isDelete) {
241
+ return this.deleteHandler();
242
+ }
243
+
244
+ return this.addHandler();
245
+ }
246
+
247
+ addRowRanges(ranges: number[], isDelete: boolean): number[] {
248
+ if (!this.rows) {
249
+ return ranges;
250
+ }
251
+
252
+ const rowRanges: number[] = [];
253
+ for (const row of this.rows) {
254
+ const { from, to } = row;
255
+ if (isDelete) {
256
+ rowRanges.push(from, to - from, 0);
257
+ } else {
258
+ rowRanges.push(from, 0, to - from);
259
+ }
260
+ }
261
+
262
+ // Merged ranges
263
+ return mergedRanges(ranges, rowRanges);
264
+ }
265
+
266
+ map(mapping: Mappable): RowSideEffect[] {
267
+ return [];
268
+ }
269
+
270
+ invert(
271
+ originalDoc: ProseMirrorNode,
272
+ isDelete: boolean,
273
+ map: StepMap,
274
+ ): RowSideEffect[] | undefined {
275
+ if (!this.rows) {
276
+ return;
277
+ }
278
+ const invertedRows: RowSideEffect[] = [];
279
+
280
+ for (const row of this.rows) {
281
+ if (isDelete) {
282
+ // Moving from delete to add keep the inverted rows + offset
283
+ let offset = map.map(row.from) - row.from;
284
+ invertedRows.push({
285
+ ...row,
286
+ from: row.from + offset,
287
+ to: row.from + offset,
288
+ });
289
+ } else {
290
+ // Moving from add to delete keep
291
+ // TODO: I think we need to add the respective cell into the cellSteps...... not sure....
292
+ }
293
+ }
294
+ return invertedRows;
295
+ }
296
+
297
+ toJSON(): RowSideEffectJSON[] | undefined {
298
+ if (!this.rows) {
299
+ return;
300
+ }
301
+ const rowsInJson: RowSideEffectJSON[] = [];
302
+
303
+ for (const row of this.rows) {
304
+ rowsInJson.push({
305
+ from: row.from,
306
+ to: row.to,
307
+ rowNode: row.rowNode.toJSON(),
308
+ });
309
+ }
310
+
311
+ return rowsInJson;
312
+ }
313
+
314
+ static fromJSON(schema: Schema, json: RowSideEffectJSON[]): RowSideEffect[] {
315
+ const rowSideEffects: RowSideEffect[] = [];
316
+
317
+ for (const row of json) {
318
+ rowSideEffects.push({
319
+ from: row.from,
320
+ to: row.to,
321
+ rowNode: schema.nodeFromJSON(row.rowNode),
322
+ });
323
+ }
324
+
325
+ return rowSideEffects;
326
+ }
327
+ }
@@ -0,0 +1,90 @@
1
+ import {
2
+ Node as ProseMirrorNode,
3
+ Schema,
4
+ } from '@atlaskit/editor-prosemirror/model';
5
+ import { Mappable, StepMap } from '@atlaskit/editor-prosemirror/transform';
6
+ import { SideEffects, SideEffectsJSON } from './types';
7
+ import { TableSideEffectHandler } from './table';
8
+ import { RowsSideEffectHandler } from './rows';
9
+
10
+ export class SideEffectsHandler {
11
+ public table: TableSideEffectHandler;
12
+ public rows: RowsSideEffectHandler;
13
+
14
+ constructor(sideEffects?: SideEffects) {
15
+ this.table = new TableSideEffectHandler(sideEffects && sideEffects.table);
16
+ this.rows = new RowsSideEffectHandler(sideEffects && sideEffects.rows);
17
+ }
18
+
19
+ getTableMap(isDelete: boolean): StepMap | undefined {
20
+ return this.table.getTableMap(isDelete);
21
+ }
22
+
23
+ map(mapping: Mappable): SideEffects {
24
+ const sideEffects: SideEffects = {};
25
+ const tableSideEffect = this.table.map(mapping);
26
+ const rowsSideEffect = this.rows.map(mapping);
27
+
28
+ if (tableSideEffect) {
29
+ sideEffects.table = tableSideEffect;
30
+ }
31
+
32
+ if (rowsSideEffect) {
33
+ sideEffects.rows = rowsSideEffect;
34
+ }
35
+ return sideEffects;
36
+ }
37
+
38
+ invert(
39
+ originalDoc: ProseMirrorNode,
40
+ isDelete: boolean,
41
+ map: StepMap,
42
+ ): SideEffects {
43
+ const sideEffects: SideEffects = {};
44
+
45
+ const tableSideEffect = this.table.invert(originalDoc);
46
+ if (tableSideEffect) {
47
+ sideEffects.table = tableSideEffect;
48
+ }
49
+
50
+ const rowsSideEffect = this.rows.invert(originalDoc, isDelete, map);
51
+ if (rowsSideEffect) {
52
+ sideEffects.rows = rowsSideEffect;
53
+ }
54
+
55
+ return sideEffects;
56
+ }
57
+
58
+ toJSON(): SideEffectsJSON | undefined {
59
+ const tableSideEffectJson = this.table.toJSON();
60
+ const rowsSideEffectJson = this.rows.toJSON();
61
+
62
+ if (!tableSideEffectJson && !rowsSideEffectJson) {
63
+ return;
64
+ }
65
+
66
+ const sideEffectsJSON: SideEffectsJSON = {};
67
+ if (tableSideEffectJson) {
68
+ sideEffectsJSON.table = tableSideEffectJson;
69
+ }
70
+ if (rowsSideEffectJson) {
71
+ sideEffectsJSON.rows = rowsSideEffectJson;
72
+ }
73
+
74
+ return sideEffectsJSON;
75
+ }
76
+
77
+ static fromJSON(schema: Schema, json: SideEffectsJSON): SideEffects {
78
+ const sideEffects: SideEffects = {};
79
+
80
+ if (json.table) {
81
+ sideEffects.table = TableSideEffectHandler.fromJSON(schema, json.table);
82
+ }
83
+
84
+ if (json.rows) {
85
+ sideEffects.rows = RowsSideEffectHandler.fromJSON(schema, json.rows);
86
+ }
87
+
88
+ return sideEffects;
89
+ }
90
+ }
@@ -0,0 +1,112 @@
1
+ import {
2
+ Node as ProseMirrorNode,
3
+ Schema,
4
+ } from '@atlaskit/editor-prosemirror/model';
5
+ import {
6
+ Mappable,
7
+ StepMap,
8
+ Transform,
9
+ } from '@atlaskit/editor-prosemirror/transform';
10
+ import { TableRect } from '@atlaskit/editor-tables/table-map';
11
+ import { TableSideEffect, TableSideEffectJSON } from './types';
12
+
13
+ export class TableSideEffectHandler {
14
+ public table?: TableSideEffect;
15
+
16
+ constructor(tableSideEffect?: TableSideEffect) {
17
+ if (tableSideEffect) {
18
+ this.table = tableSideEffect;
19
+ }
20
+ }
21
+
22
+ private addTableSideEffect(from: number, to: number, node: ProseMirrorNode) {
23
+ this.table = { from, to, node };
24
+ }
25
+
26
+ handleAddTable(tr: Transform, isDelete: boolean): boolean {
27
+ if (isDelete || !this.table) {
28
+ return false;
29
+ }
30
+
31
+ tr.insert(this.table.from, this.table.node);
32
+ return true;
33
+ }
34
+
35
+ handleRemoveTable(
36
+ tr: Transform,
37
+ tablePos: number,
38
+ tableRect: TableRect,
39
+ column: number | null,
40
+ isDelete: boolean,
41
+ ) {
42
+ if (isDelete && tableRect.map.width === 1 && column === 0) {
43
+ // Add side effect
44
+ this.addTableSideEffect(
45
+ tablePos,
46
+ tablePos + tableRect.table.nodeSize,
47
+ tableRect.table.copy(tableRect.table.content),
48
+ );
49
+
50
+ tr.delete(tablePos, tablePos + tableRect.table.nodeSize);
51
+ return true;
52
+ }
53
+ return false;
54
+ }
55
+
56
+ getTableMap(isDelete: boolean): StepMap | undefined {
57
+ if (!this.table) {
58
+ return;
59
+ }
60
+ const { from, to } = this.table;
61
+ if (isDelete) {
62
+ return new StepMap([from, to - from, 0]);
63
+ }
64
+
65
+ return new StepMap([from, 0, to - from]);
66
+ }
67
+
68
+ map(mapping: Mappable): TableSideEffect | undefined {
69
+ if (!this.table) {
70
+ return;
71
+ }
72
+
73
+ return {
74
+ from: mapping.map(this.table.from),
75
+ to: mapping.map(this.table.to),
76
+ node: this.table.node,
77
+ };
78
+ }
79
+
80
+ invert(doc: ProseMirrorNode): TableSideEffect | undefined {
81
+ if (!this.table) {
82
+ return;
83
+ }
84
+ const tableNode = doc.nodeAt(this.table.from)!;
85
+
86
+ return {
87
+ from: this.table.from,
88
+ to: this.table.from + tableNode.nodeSize,
89
+ node: tableNode.copy(tableNode.content),
90
+ };
91
+ }
92
+
93
+ toJSON(): TableSideEffectJSON | undefined {
94
+ if (!this.table) {
95
+ return;
96
+ }
97
+
98
+ return {
99
+ from: this.table.from,
100
+ to: this.table.to,
101
+ node: this.table.node.toJSON(),
102
+ };
103
+ }
104
+
105
+ static fromJSON(schema: Schema, json: TableSideEffectJSON): TableSideEffect {
106
+ return {
107
+ from: json.from,
108
+ to: json.to,
109
+ node: schema.nodeFromJSON(json.node),
110
+ };
111
+ }
112
+ }
@@ -0,0 +1,34 @@
1
+ import { Node as ProseMirrorNode } from '@atlaskit/editor-prosemirror/model';
2
+
3
+ export interface TableSideEffect {
4
+ from: number;
5
+ to: number;
6
+ node: ProseMirrorNode;
7
+ }
8
+
9
+ export interface RowSideEffect {
10
+ from: number;
11
+ to: number;
12
+ rowNode: ProseMirrorNode;
13
+ }
14
+
15
+ export interface TableSideEffectJSON {
16
+ from: number;
17
+ to: number;
18
+ node: { [key: string]: any }; // ToJson type of ProseMirrorNode.toJson()
19
+ }
20
+
21
+ export interface RowSideEffectJSON {
22
+ from: number;
23
+ to: number;
24
+ rowNode: { [key: string]: any }; // ToJson type of ProseMirrorNode.toJson()
25
+ }
26
+
27
+ export type SideEffects = {
28
+ table?: TableSideEffect;
29
+ rows?: RowSideEffect[];
30
+ };
31
+ export type SideEffectsJSON = {
32
+ table?: TableSideEffectJSON;
33
+ rows?: RowSideEffectJSON[];
34
+ };
@@ -0,0 +1,28 @@
1
+ import { TableMap } from '@atlaskit/editor-tables/table-map';
2
+
3
+ export const getCellIndex = (map: TableMap, row: number, col: number) => {
4
+ return row * map.width + col;
5
+ };
6
+
7
+ export function hasMergedColumns(map: TableMap, row: number, col: number) {
8
+ const index = getCellIndex(map, row, col);
9
+ return (
10
+ (col > 0 && map.map[index - 1] === map.map[index]) ||
11
+ (col < map.width - 1 && map.map[index + 1] === map.map[index])
12
+ );
13
+ }
14
+ export function hasMergedRows(map: TableMap, row: number, col: number) {
15
+ const index = getCellIndex(map, row, col);
16
+ return (
17
+ (row > 0 && map.map[index - map.width] !== map.map[index]) ||
18
+ (row < map.height - 1 && map.map[index + map.width] === map.map[index])
19
+ );
20
+ }
21
+ export function isRootRow(map: TableMap, row: number, col: number) {
22
+ const index = getCellIndex(map, row, col);
23
+ return row > 0 ? map.map[index - map.width] !== map.map[index] : true;
24
+ }
25
+ export function isRootCol(map: TableMap, row: number, col: number) {
26
+ const index = getCellIndex(map, row, col);
27
+ return row > 0 ? map.map[index - 1] !== map.map[index] : true;
28
+ }
@@ -0,0 +1,100 @@
1
+ import { Node as PMNode, Slice } from '@atlaskit/editor-prosemirror/model';
2
+ import {
3
+ Mappable,
4
+ ReplaceStep,
5
+ Step,
6
+ StepMap,
7
+ StepResult,
8
+ } from '@atlaskit/editor-prosemirror/transform';
9
+
10
+ export const insertTypeAheadStepType = 'atlaskit-insert-type-ahead';
11
+
12
+ export enum InsertTypeAheadStages {
13
+ DELETING_RAW_QUERY = 'DELETING_RAW_QUERY',
14
+ INSERTING_ITEM = 'INSERTING_ITEM',
15
+ }
16
+
17
+ type Config = {
18
+ selectedIndex: number;
19
+ stage: InsertTypeAheadStages;
20
+ query: string;
21
+ trigger: string;
22
+ };
23
+ export class InsertTypeAheadStep extends Step {
24
+ private isInvertStep: boolean;
25
+ selectedIndex: number;
26
+ stage: InsertTypeAheadStages;
27
+ query: string;
28
+ trigger: string;
29
+
30
+ constructor(
31
+ { stage, query, trigger, selectedIndex }: Config,
32
+ isInvertStep: boolean = false,
33
+ ) {
34
+ super();
35
+ this.isInvertStep = isInvertStep;
36
+ this.stage = stage;
37
+ this.query = query;
38
+ this.trigger = trigger;
39
+ this.selectedIndex = selectedIndex;
40
+ }
41
+
42
+ invert() {
43
+ const config = {
44
+ stage: this.stage,
45
+ query: this.query,
46
+ trigger: this.trigger,
47
+ selectedIndex: this.selectedIndex,
48
+ };
49
+ return new InsertTypeAheadStep(config, !this.isInvertStep);
50
+ }
51
+
52
+ apply(doc: PMNode) {
53
+ return StepResult.ok(doc);
54
+ }
55
+
56
+ merge(): null {
57
+ return null;
58
+ }
59
+
60
+ isInsertionStep() {
61
+ return !this.isInvertStep;
62
+ }
63
+
64
+ isUndoingStep() {
65
+ return this.isInvertStep;
66
+ }
67
+
68
+ map(mapping: Mappable) {
69
+ const config = {
70
+ stage: this.stage,
71
+ query: this.query,
72
+ trigger: this.trigger,
73
+ selectedIndex: this.selectedIndex,
74
+ };
75
+ // Return the same events, this step will never be removed
76
+ return new InsertTypeAheadStep(config, this.isInvertStep);
77
+ }
78
+
79
+ getMap() {
80
+ return new StepMap([0, 0, 0]);
81
+ }
82
+
83
+ toJSON() {
84
+ // When serialized we should create a noop Replace step
85
+ return {
86
+ stepType: 'replace',
87
+ from: 0,
88
+ to: 0,
89
+ };
90
+ }
91
+
92
+ static fromJSON() {
93
+ // This is a "local custom step" once serialized
94
+ // we need to transform it in a no-operation action
95
+ return new ReplaceStep(0, 0, Slice.empty);
96
+ }
97
+ }
98
+
99
+ /** Register this step with Prosemirror */
100
+ Step.jsonID(insertTypeAheadStepType, InsertTypeAheadStep);
package/src/steps.ts ADDED
@@ -0,0 +1,16 @@
1
+ export { SortOrder as TableSortOrder } from './steps/table/constants';
2
+ export { TableSortStep } from './steps/table/sort-column';
3
+ export { InsertTypeAheadStages, InsertTypeAheadStep } from './steps/type-ahead';
4
+ export { AddColumnStep } from './steps/table/add-column';
5
+ export { SetAttrsStep } from './steps/set-attrs';
6
+ export { AnalyticsStep } from './steps/analytics';
7
+ export type { TableColumnOrdering } from './steps/table/types';
8
+ export type {
9
+ AnalyticsInvertStep,
10
+ AnalyticsWithChannel,
11
+ AnalyticsPayload,
12
+ } from './steps/analytics';
13
+ export { LinkMetaStep } from './steps/link-meta-step';
14
+ export type { LinkStepMetadata } from './steps/link-meta-step';
15
+ export { OverrideDocumentStep } from './steps/override-document-step';
16
+ export type { OverrideDocumentStepJSON } from './steps/override-document-step';