@atlaskit/editor-wikimarkup-transformer 9.5.3

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 (432) hide show
  1. package/CHANGELOG.md +2299 -0
  2. package/LICENSE +13 -0
  3. package/build/tsconfig.json +17 -0
  4. package/char/package.json +7 -0
  5. package/dist/cjs/char.js +8 -0
  6. package/dist/cjs/encoder/emoji-unicode-mapping.js +1618 -0
  7. package/dist/cjs/encoder/index.js +76 -0
  8. package/dist/cjs/encoder/marks/__base.js +24 -0
  9. package/dist/cjs/encoder/marks/code.js +12 -0
  10. package/dist/cjs/encoder/marks/color.js +12 -0
  11. package/dist/cjs/encoder/marks/em.js +19 -0
  12. package/dist/cjs/encoder/marks/link.js +12 -0
  13. package/dist/cjs/encoder/marks/strike.js +14 -0
  14. package/dist/cjs/encoder/marks/strong.js +18 -0
  15. package/dist/cjs/encoder/marks/subsup.js +18 -0
  16. package/dist/cjs/encoder/marks/underline.js +14 -0
  17. package/dist/cjs/encoder/nodes/block-card.js +18 -0
  18. package/dist/cjs/encoder/nodes/blockquote.js +21 -0
  19. package/dist/cjs/encoder/nodes/bullet-list.js +21 -0
  20. package/dist/cjs/encoder/nodes/code-block.js +27 -0
  21. package/dist/cjs/encoder/nodes/date.js +21 -0
  22. package/dist/cjs/encoder/nodes/decisionItem.js +23 -0
  23. package/dist/cjs/encoder/nodes/decisionList.js +18 -0
  24. package/dist/cjs/encoder/nodes/doc.js +21 -0
  25. package/dist/cjs/encoder/nodes/embed-card.js +18 -0
  26. package/dist/cjs/encoder/nodes/emoji.js +26 -0
  27. package/dist/cjs/encoder/nodes/expand.js +22 -0
  28. package/dist/cjs/encoder/nodes/hard-break.js +12 -0
  29. package/dist/cjs/encoder/nodes/heading.js +18 -0
  30. package/dist/cjs/encoder/nodes/inline-card.js +26 -0
  31. package/dist/cjs/encoder/nodes/inlines.js +44 -0
  32. package/dist/cjs/encoder/nodes/listItem.js +77 -0
  33. package/dist/cjs/encoder/nodes/media-group.js +24 -0
  34. package/dist/cjs/encoder/nodes/media.js +66 -0
  35. package/dist/cjs/encoder/nodes/mention.js +27 -0
  36. package/dist/cjs/encoder/nodes/ordered-list.js +21 -0
  37. package/dist/cjs/encoder/nodes/panel.js +29 -0
  38. package/dist/cjs/encoder/nodes/paragraph.js +23 -0
  39. package/dist/cjs/encoder/nodes/rule.js +12 -0
  40. package/dist/cjs/encoder/nodes/status.js +43 -0
  41. package/dist/cjs/encoder/nodes/table.js +77 -0
  42. package/dist/cjs/encoder/nodes/taskItem.js +32 -0
  43. package/dist/cjs/encoder/nodes/taskList.js +27 -0
  44. package/dist/cjs/encoder/nodes/text.js +67 -0
  45. package/dist/cjs/encoder/nodes/unknown.js +17 -0
  46. package/dist/cjs/index.js +93 -0
  47. package/dist/cjs/interfaces.js +5 -0
  48. package/dist/cjs/parser/abstract-tree.js +44 -0
  49. package/dist/cjs/parser/builder/list-builder.js +350 -0
  50. package/dist/cjs/parser/builder/table-builder.js +156 -0
  51. package/dist/cjs/parser/color.js +13 -0
  52. package/dist/cjs/parser/error.js +22 -0
  53. package/dist/cjs/parser/nodes/mediaGroup.js +25 -0
  54. package/dist/cjs/parser/nodes/mediaSingle.js +107 -0
  55. package/dist/cjs/parser/nodes/paragraph.js +72 -0
  56. package/dist/cjs/parser/nodes/rule.js +27 -0
  57. package/dist/cjs/parser/nodes/text.js +15 -0
  58. package/dist/cjs/parser/text.js +165 -0
  59. package/dist/cjs/parser/tokenize/adf-macro.js +49 -0
  60. package/dist/cjs/parser/tokenize/anchor-macro.js +31 -0
  61. package/dist/cjs/parser/tokenize/blockquote.js +42 -0
  62. package/dist/cjs/parser/tokenize/citation.js +71 -0
  63. package/dist/cjs/parser/tokenize/code-macro.js +95 -0
  64. package/dist/cjs/parser/tokenize/color-macro.js +64 -0
  65. package/dist/cjs/parser/tokenize/common-formatter.js +230 -0
  66. package/dist/cjs/parser/tokenize/common-macro.js +62 -0
  67. package/dist/cjs/parser/tokenize/dash-token-creator.js +42 -0
  68. package/dist/cjs/parser/tokenize/deleted.js +66 -0
  69. package/dist/cjs/parser/tokenize/double-dash-symbol.js +30 -0
  70. package/dist/cjs/parser/tokenize/emoji.js +184 -0
  71. package/dist/cjs/parser/tokenize/emphasis.js +65 -0
  72. package/dist/cjs/parser/tokenize/file-link.js +36 -0
  73. package/dist/cjs/parser/tokenize/force-line-break.js +48 -0
  74. package/dist/cjs/parser/tokenize/hardbreak.js +33 -0
  75. package/dist/cjs/parser/tokenize/heading.js +70 -0
  76. package/dist/cjs/parser/tokenize/index.js +144 -0
  77. package/dist/cjs/parser/tokenize/inserted.js +65 -0
  78. package/dist/cjs/parser/tokenize/issue-key.js +107 -0
  79. package/dist/cjs/parser/tokenize/keyword.js +159 -0
  80. package/dist/cjs/parser/tokenize/link-text.js +77 -0
  81. package/dist/cjs/parser/tokenize/links/attachment-link.js +18 -0
  82. package/dist/cjs/parser/tokenize/links/issue-link.js +41 -0
  83. package/dist/cjs/parser/tokenize/links/link-format.js +65 -0
  84. package/dist/cjs/parser/tokenize/links/link-parser.js +224 -0
  85. package/dist/cjs/parser/tokenize/links/link-resolver.js +57 -0
  86. package/dist/cjs/parser/tokenize/links/mention-link.js +24 -0
  87. package/dist/cjs/parser/tokenize/links/url-link.js +64 -0
  88. package/dist/cjs/parser/tokenize/list.js +339 -0
  89. package/dist/cjs/parser/tokenize/media.js +51 -0
  90. package/dist/cjs/parser/tokenize/monospace.js +59 -0
  91. package/dist/cjs/parser/tokenize/noformat-macro.js +46 -0
  92. package/dist/cjs/parser/tokenize/panel-macro.js +106 -0
  93. package/dist/cjs/parser/tokenize/quadruple-dash-symbol.js +30 -0
  94. package/dist/cjs/parser/tokenize/quote-macro.js +166 -0
  95. package/dist/cjs/parser/tokenize/ruler.js +33 -0
  96. package/dist/cjs/parser/tokenize/strong.js +65 -0
  97. package/dist/cjs/parser/tokenize/subscript.js +67 -0
  98. package/dist/cjs/parser/tokenize/superscript.js +67 -0
  99. package/dist/cjs/parser/tokenize/table.js +353 -0
  100. package/dist/cjs/parser/tokenize/triple-dash-symbol.js +30 -0
  101. package/dist/cjs/parser/tokenize/whitespace.js +56 -0
  102. package/dist/cjs/parser/utils/attrs.js +33 -0
  103. package/dist/cjs/parser/utils/color-name-mapping.js +700 -0
  104. package/dist/cjs/parser/utils/escape.js +36 -0
  105. package/dist/cjs/parser/utils/normalize.js +209 -0
  106. package/dist/cjs/parser/utils/panel-type.js +120 -0
  107. package/dist/cjs/parser/utils/text.js +98 -0
  108. package/dist/cjs/parser/utils/title.js +17 -0
  109. package/dist/cjs/parser/utils/url.js +31 -0
  110. package/dist/cjs/version.json +5 -0
  111. package/dist/es2019/char.js +1 -0
  112. package/dist/es2019/encoder/emoji-unicode-mapping.js +1611 -0
  113. package/dist/es2019/encoder/index.js +51 -0
  114. package/dist/es2019/encoder/marks/__base.js +15 -0
  115. package/dist/es2019/encoder/marks/code.js +3 -0
  116. package/dist/es2019/encoder/marks/color.js +3 -0
  117. package/dist/es2019/encoder/marks/em.js +9 -0
  118. package/dist/es2019/encoder/marks/link.js +3 -0
  119. package/dist/es2019/encoder/marks/strike.js +4 -0
  120. package/dist/es2019/encoder/marks/strong.js +9 -0
  121. package/dist/es2019/encoder/marks/subsup.js +8 -0
  122. package/dist/es2019/encoder/marks/underline.js +4 -0
  123. package/dist/es2019/encoder/nodes/block-card.js +8 -0
  124. package/dist/es2019/encoder/nodes/blockquote.js +10 -0
  125. package/dist/es2019/encoder/nodes/bullet-list.js +10 -0
  126. package/dist/es2019/encoder/nodes/code-block.js +16 -0
  127. package/dist/es2019/encoder/nodes/date.js +12 -0
  128. package/dist/es2019/encoder/nodes/decisionItem.js +12 -0
  129. package/dist/es2019/encoder/nodes/decisionList.js +8 -0
  130. package/dist/es2019/encoder/nodes/doc.js +10 -0
  131. package/dist/es2019/encoder/nodes/embed-card.js +8 -0
  132. package/dist/es2019/encoder/nodes/emoji.js +15 -0
  133. package/dist/es2019/encoder/nodes/expand.js +11 -0
  134. package/dist/es2019/encoder/nodes/hard-break.js +3 -0
  135. package/dist/es2019/encoder/nodes/heading.js +8 -0
  136. package/dist/es2019/encoder/nodes/inline-card.js +15 -0
  137. package/dist/es2019/encoder/nodes/inlines.js +26 -0
  138. package/dist/es2019/encoder/nodes/listItem.js +63 -0
  139. package/dist/es2019/encoder/nodes/media-group.js +13 -0
  140. package/dist/es2019/encoder/nodes/media.js +54 -0
  141. package/dist/es2019/encoder/nodes/mention.js +16 -0
  142. package/dist/es2019/encoder/nodes/ordered-list.js +10 -0
  143. package/dist/es2019/encoder/nodes/panel.js +19 -0
  144. package/dist/es2019/encoder/nodes/paragraph.js +12 -0
  145. package/dist/es2019/encoder/nodes/rule.js +3 -0
  146. package/dist/es2019/encoder/nodes/status.js +23 -0
  147. package/dist/es2019/encoder/nodes/table.js +62 -0
  148. package/dist/es2019/encoder/nodes/taskItem.js +21 -0
  149. package/dist/es2019/encoder/nodes/taskList.js +17 -0
  150. package/dist/es2019/encoder/nodes/text.js +46 -0
  151. package/dist/es2019/encoder/nodes/unknown.js +8 -0
  152. package/dist/es2019/index.js +58 -0
  153. package/dist/es2019/interfaces.js +1 -0
  154. package/dist/es2019/parser/abstract-tree.js +23 -0
  155. package/dist/es2019/parser/builder/list-builder.js +294 -0
  156. package/dist/es2019/parser/builder/table-builder.js +135 -0
  157. package/dist/es2019/parser/color.js +5 -0
  158. package/dist/es2019/parser/error.js +15 -0
  159. package/dist/es2019/parser/nodes/mediaGroup.js +18 -0
  160. package/dist/es2019/parser/nodes/mediaSingle.js +95 -0
  161. package/dist/es2019/parser/nodes/paragraph.js +43 -0
  162. package/dist/es2019/parser/nodes/rule.js +21 -0
  163. package/dist/es2019/parser/nodes/text.js +8 -0
  164. package/dist/es2019/parser/text.js +145 -0
  165. package/dist/es2019/parser/tokenize/adf-macro.js +40 -0
  166. package/dist/es2019/parser/tokenize/anchor-macro.js +22 -0
  167. package/dist/es2019/parser/tokenize/blockquote.js +26 -0
  168. package/dist/es2019/parser/tokenize/citation.js +53 -0
  169. package/dist/es2019/parser/tokenize/code-macro.js +57 -0
  170. package/dist/es2019/parser/tokenize/color-macro.js +46 -0
  171. package/dist/es2019/parser/tokenize/common-formatter.js +215 -0
  172. package/dist/es2019/parser/tokenize/common-macro.js +48 -0
  173. package/dist/es2019/parser/tokenize/dash-token-creator.js +31 -0
  174. package/dist/es2019/parser/tokenize/deleted.js +49 -0
  175. package/dist/es2019/parser/tokenize/double-dash-symbol.js +11 -0
  176. package/dist/es2019/parser/tokenize/emoji.js +174 -0
  177. package/dist/es2019/parser/tokenize/emphasis.js +48 -0
  178. package/dist/es2019/parser/tokenize/file-link.js +25 -0
  179. package/dist/es2019/parser/tokenize/force-line-break.js +38 -0
  180. package/dist/es2019/parser/tokenize/hardbreak.js +24 -0
  181. package/dist/es2019/parser/tokenize/heading.js +58 -0
  182. package/dist/es2019/parser/tokenize/index.js +129 -0
  183. package/dist/es2019/parser/tokenize/inserted.js +48 -0
  184. package/dist/es2019/parser/tokenize/issue-key.js +81 -0
  185. package/dist/es2019/parser/tokenize/keyword.js +142 -0
  186. package/dist/es2019/parser/tokenize/link-text.js +65 -0
  187. package/dist/es2019/parser/tokenize/links/attachment-link.js +8 -0
  188. package/dist/es2019/parser/tokenize/links/issue-link.js +35 -0
  189. package/dist/es2019/parser/tokenize/links/link-format.js +52 -0
  190. package/dist/es2019/parser/tokenize/links/link-parser.js +208 -0
  191. package/dist/es2019/parser/tokenize/links/link-resolver.js +39 -0
  192. package/dist/es2019/parser/tokenize/links/mention-link.js +17 -0
  193. package/dist/es2019/parser/tokenize/links/url-link.js +49 -0
  194. package/dist/es2019/parser/tokenize/list.js +296 -0
  195. package/dist/es2019/parser/tokenize/media.js +30 -0
  196. package/dist/es2019/parser/tokenize/monospace.js +47 -0
  197. package/dist/es2019/parser/tokenize/noformat-macro.js +37 -0
  198. package/dist/es2019/parser/tokenize/panel-macro.js +63 -0
  199. package/dist/es2019/parser/tokenize/quadruple-dash-symbol.js +22 -0
  200. package/dist/es2019/parser/tokenize/quote-macro.js +129 -0
  201. package/dist/es2019/parser/tokenize/ruler.js +23 -0
  202. package/dist/es2019/parser/tokenize/strong.js +48 -0
  203. package/dist/es2019/parser/tokenize/subscript.js +50 -0
  204. package/dist/es2019/parser/tokenize/superscript.js +50 -0
  205. package/dist/es2019/parser/tokenize/table.js +333 -0
  206. package/dist/es2019/parser/tokenize/triple-dash-symbol.js +11 -0
  207. package/dist/es2019/parser/tokenize/whitespace.js +45 -0
  208. package/dist/es2019/parser/utils/attrs.js +17 -0
  209. package/dist/es2019/parser/utils/color-name-mapping.js +693 -0
  210. package/dist/es2019/parser/utils/escape.js +28 -0
  211. package/dist/es2019/parser/utils/normalize.js +161 -0
  212. package/dist/es2019/parser/utils/panel-type.js +109 -0
  213. package/dist/es2019/parser/utils/text.js +58 -0
  214. package/dist/es2019/parser/utils/title.js +10 -0
  215. package/dist/es2019/parser/utils/url.js +24 -0
  216. package/dist/es2019/version.json +5 -0
  217. package/dist/esm/char.js +1 -0
  218. package/dist/esm/encoder/emoji-unicode-mapping.js +1611 -0
  219. package/dist/esm/encoder/index.js +51 -0
  220. package/dist/esm/encoder/marks/__base.js +15 -0
  221. package/dist/esm/encoder/marks/code.js +3 -0
  222. package/dist/esm/encoder/marks/color.js +3 -0
  223. package/dist/esm/encoder/marks/em.js +9 -0
  224. package/dist/esm/encoder/marks/link.js +3 -0
  225. package/dist/esm/encoder/marks/strike.js +4 -0
  226. package/dist/esm/encoder/marks/strong.js +9 -0
  227. package/dist/esm/encoder/marks/subsup.js +8 -0
  228. package/dist/esm/encoder/marks/underline.js +4 -0
  229. package/dist/esm/encoder/nodes/block-card.js +8 -0
  230. package/dist/esm/encoder/nodes/blockquote.js +11 -0
  231. package/dist/esm/encoder/nodes/bullet-list.js +11 -0
  232. package/dist/esm/encoder/nodes/code-block.js +16 -0
  233. package/dist/esm/encoder/nodes/date.js +12 -0
  234. package/dist/esm/encoder/nodes/decisionItem.js +13 -0
  235. package/dist/esm/encoder/nodes/decisionList.js +8 -0
  236. package/dist/esm/encoder/nodes/doc.js +11 -0
  237. package/dist/esm/encoder/nodes/embed-card.js +8 -0
  238. package/dist/esm/encoder/nodes/emoji.js +15 -0
  239. package/dist/esm/encoder/nodes/expand.js +12 -0
  240. package/dist/esm/encoder/nodes/hard-break.js +3 -0
  241. package/dist/esm/encoder/nodes/heading.js +8 -0
  242. package/dist/esm/encoder/nodes/inline-card.js +15 -0
  243. package/dist/esm/encoder/nodes/inlines.js +26 -0
  244. package/dist/esm/encoder/nodes/listItem.js +63 -0
  245. package/dist/esm/encoder/nodes/media-group.js +14 -0
  246. package/dist/esm/encoder/nodes/media.js +57 -0
  247. package/dist/esm/encoder/nodes/mention.js +19 -0
  248. package/dist/esm/encoder/nodes/ordered-list.js +11 -0
  249. package/dist/esm/encoder/nodes/panel.js +18 -0
  250. package/dist/esm/encoder/nodes/paragraph.js +13 -0
  251. package/dist/esm/encoder/nodes/rule.js +3 -0
  252. package/dist/esm/encoder/nodes/status.js +29 -0
  253. package/dist/esm/encoder/nodes/table.js +66 -0
  254. package/dist/esm/encoder/nodes/taskItem.js +22 -0
  255. package/dist/esm/encoder/nodes/taskList.js +18 -0
  256. package/dist/esm/encoder/nodes/text.js +51 -0
  257. package/dist/esm/encoder/nodes/unknown.js +6 -0
  258. package/dist/esm/index.js +78 -0
  259. package/dist/esm/interfaces.js +1 -0
  260. package/dist/esm/parser/abstract-tree.js +34 -0
  261. package/dist/esm/parser/builder/list-builder.js +338 -0
  262. package/dist/esm/parser/builder/table-builder.js +150 -0
  263. package/dist/esm/parser/color.js +5 -0
  264. package/dist/esm/parser/error.js +15 -0
  265. package/dist/esm/parser/nodes/mediaGroup.js +18 -0
  266. package/dist/esm/parser/nodes/mediaSingle.js +97 -0
  267. package/dist/esm/parser/nodes/paragraph.js +61 -0
  268. package/dist/esm/parser/nodes/rule.js +18 -0
  269. package/dist/esm/parser/nodes/text.js +8 -0
  270. package/dist/esm/parser/text.js +149 -0
  271. package/dist/esm/parser/tokenize/adf-macro.js +39 -0
  272. package/dist/esm/parser/tokenize/anchor-macro.js +21 -0
  273. package/dist/esm/parser/tokenize/blockquote.js +28 -0
  274. package/dist/esm/parser/tokenize/citation.js +54 -0
  275. package/dist/esm/parser/tokenize/code-macro.js +80 -0
  276. package/dist/esm/parser/tokenize/color-macro.js +46 -0
  277. package/dist/esm/parser/tokenize/common-formatter.js +216 -0
  278. package/dist/esm/parser/tokenize/common-macro.js +52 -0
  279. package/dist/esm/parser/tokenize/dash-token-creator.js +33 -0
  280. package/dist/esm/parser/tokenize/deleted.js +50 -0
  281. package/dist/esm/parser/tokenize/double-dash-symbol.js +19 -0
  282. package/dist/esm/parser/tokenize/emoji.js +173 -0
  283. package/dist/esm/parser/tokenize/emphasis.js +49 -0
  284. package/dist/esm/parser/tokenize/file-link.js +25 -0
  285. package/dist/esm/parser/tokenize/force-line-break.js +38 -0
  286. package/dist/esm/parser/tokenize/hardbreak.js +23 -0
  287. package/dist/esm/parser/tokenize/heading.js +58 -0
  288. package/dist/esm/parser/tokenize/index.js +102 -0
  289. package/dist/esm/parser/tokenize/inserted.js +49 -0
  290. package/dist/esm/parser/tokenize/issue-key.js +89 -0
  291. package/dist/esm/parser/tokenize/keyword.js +142 -0
  292. package/dist/esm/parser/tokenize/link-text.js +64 -0
  293. package/dist/esm/parser/tokenize/links/attachment-link.js +8 -0
  294. package/dist/esm/parser/tokenize/links/issue-link.js +33 -0
  295. package/dist/esm/parser/tokenize/links/link-format.js +51 -0
  296. package/dist/esm/parser/tokenize/links/link-parser.js +213 -0
  297. package/dist/esm/parser/tokenize/links/link-resolver.js +55 -0
  298. package/dist/esm/parser/tokenize/links/mention-link.js +17 -0
  299. package/dist/esm/parser/tokenize/links/url-link.js +50 -0
  300. package/dist/esm/parser/tokenize/list.js +318 -0
  301. package/dist/esm/parser/tokenize/media.js +36 -0
  302. package/dist/esm/parser/tokenize/monospace.js +47 -0
  303. package/dist/esm/parser/tokenize/noformat-macro.js +34 -0
  304. package/dist/esm/parser/tokenize/panel-macro.js +88 -0
  305. package/dist/esm/parser/tokenize/quadruple-dash-symbol.js +21 -0
  306. package/dist/esm/parser/tokenize/quote-macro.js +148 -0
  307. package/dist/esm/parser/tokenize/ruler.js +22 -0
  308. package/dist/esm/parser/tokenize/strong.js +49 -0
  309. package/dist/esm/parser/tokenize/subscript.js +51 -0
  310. package/dist/esm/parser/tokenize/superscript.js +51 -0
  311. package/dist/esm/parser/tokenize/table.js +336 -0
  312. package/dist/esm/parser/tokenize/triple-dash-symbol.js +19 -0
  313. package/dist/esm/parser/tokenize/whitespace.js +45 -0
  314. package/dist/esm/parser/utils/attrs.js +23 -0
  315. package/dist/esm/parser/utils/color-name-mapping.js +693 -0
  316. package/dist/esm/parser/utils/escape.js +28 -0
  317. package/dist/esm/parser/utils/normalize.js +195 -0
  318. package/dist/esm/parser/utils/panel-type.js +109 -0
  319. package/dist/esm/parser/utils/text.js +81 -0
  320. package/dist/esm/parser/utils/title.js +10 -0
  321. package/dist/esm/parser/utils/url.js +24 -0
  322. package/dist/esm/version.json +5 -0
  323. package/dist/types/char.d.ts +1 -0
  324. package/dist/types/encoder/emoji-unicode-mapping.d.ts +3 -0
  325. package/dist/types/encoder/index.d.ts +9 -0
  326. package/dist/types/encoder/marks/__base.d.ts +5 -0
  327. package/dist/types/encoder/marks/code.d.ts +2 -0
  328. package/dist/types/encoder/marks/color.d.ts +2 -0
  329. package/dist/types/encoder/marks/em.d.ts +2 -0
  330. package/dist/types/encoder/marks/link.d.ts +2 -0
  331. package/dist/types/encoder/marks/strike.d.ts +2 -0
  332. package/dist/types/encoder/marks/strong.d.ts +6 -0
  333. package/dist/types/encoder/marks/subsup.d.ts +2 -0
  334. package/dist/types/encoder/marks/underline.d.ts +2 -0
  335. package/dist/types/encoder/nodes/block-card.d.ts +2 -0
  336. package/dist/types/encoder/nodes/blockquote.d.ts +2 -0
  337. package/dist/types/encoder/nodes/bullet-list.d.ts +2 -0
  338. package/dist/types/encoder/nodes/code-block.d.ts +2 -0
  339. package/dist/types/encoder/nodes/date.d.ts +2 -0
  340. package/dist/types/encoder/nodes/decisionItem.d.ts +3 -0
  341. package/dist/types/encoder/nodes/decisionList.d.ts +2 -0
  342. package/dist/types/encoder/nodes/doc.d.ts +2 -0
  343. package/dist/types/encoder/nodes/embed-card.d.ts +2 -0
  344. package/dist/types/encoder/nodes/emoji.d.ts +2 -0
  345. package/dist/types/encoder/nodes/expand.d.ts +2 -0
  346. package/dist/types/encoder/nodes/hard-break.d.ts +2 -0
  347. package/dist/types/encoder/nodes/heading.d.ts +2 -0
  348. package/dist/types/encoder/nodes/inline-card.d.ts +2 -0
  349. package/dist/types/encoder/nodes/inlines.d.ts +2 -0
  350. package/dist/types/encoder/nodes/listItem.d.ts +3 -0
  351. package/dist/types/encoder/nodes/media-group.d.ts +2 -0
  352. package/dist/types/encoder/nodes/media.d.ts +2 -0
  353. package/dist/types/encoder/nodes/mention.d.ts +2 -0
  354. package/dist/types/encoder/nodes/ordered-list.d.ts +2 -0
  355. package/dist/types/encoder/nodes/panel.d.ts +2 -0
  356. package/dist/types/encoder/nodes/paragraph.d.ts +2 -0
  357. package/dist/types/encoder/nodes/rule.d.ts +2 -0
  358. package/dist/types/encoder/nodes/status.d.ts +2 -0
  359. package/dist/types/encoder/nodes/table.d.ts +2 -0
  360. package/dist/types/encoder/nodes/taskItem.d.ts +3 -0
  361. package/dist/types/encoder/nodes/taskList.d.ts +2 -0
  362. package/dist/types/encoder/nodes/text.d.ts +2 -0
  363. package/dist/types/encoder/nodes/unknown.d.ts +2 -0
  364. package/dist/types/index.d.ts +15 -0
  365. package/dist/types/interfaces.d.ts +68 -0
  366. package/dist/types/parser/abstract-tree.d.ts +11 -0
  367. package/dist/types/parser/builder/list-builder.d.ts +66 -0
  368. package/dist/types/parser/builder/table-builder.d.ts +45 -0
  369. package/dist/types/parser/color.d.ts +3 -0
  370. package/dist/types/parser/error.d.ts +1 -0
  371. package/dist/types/parser/nodes/mediaGroup.d.ts +3 -0
  372. package/dist/types/parser/nodes/mediaSingle.d.ts +5 -0
  373. package/dist/types/parser/nodes/paragraph.d.ts +7 -0
  374. package/dist/types/parser/nodes/rule.d.ts +3 -0
  375. package/dist/types/parser/nodes/text.d.ts +2 -0
  376. package/dist/types/parser/text.d.ts +10 -0
  377. package/dist/types/parser/tokenize/adf-macro.d.ts +2 -0
  378. package/dist/types/parser/tokenize/anchor-macro.d.ts +2 -0
  379. package/dist/types/parser/tokenize/blockquote.d.ts +2 -0
  380. package/dist/types/parser/tokenize/citation.d.ts +2 -0
  381. package/dist/types/parser/tokenize/code-macro.d.ts +2 -0
  382. package/dist/types/parser/tokenize/color-macro.d.ts +2 -0
  383. package/dist/types/parser/tokenize/common-formatter.d.ts +10 -0
  384. package/dist/types/parser/tokenize/common-macro.d.ts +10 -0
  385. package/dist/types/parser/tokenize/dash-token-creator.d.ts +2 -0
  386. package/dist/types/parser/tokenize/deleted.d.ts +2 -0
  387. package/dist/types/parser/tokenize/double-dash-symbol.d.ts +1 -0
  388. package/dist/types/parser/tokenize/emoji.d.ts +15 -0
  389. package/dist/types/parser/tokenize/emphasis.d.ts +2 -0
  390. package/dist/types/parser/tokenize/file-link.d.ts +3 -0
  391. package/dist/types/parser/tokenize/force-line-break.d.ts +2 -0
  392. package/dist/types/parser/tokenize/hardbreak.d.ts +2 -0
  393. package/dist/types/parser/tokenize/heading.d.ts +2 -0
  394. package/dist/types/parser/tokenize/index.d.ts +55 -0
  395. package/dist/types/parser/tokenize/inserted.d.ts +2 -0
  396. package/dist/types/parser/tokenize/issue-key.d.ts +20 -0
  397. package/dist/types/parser/tokenize/keyword.d.ts +13 -0
  398. package/dist/types/parser/tokenize/link-text.d.ts +3 -0
  399. package/dist/types/parser/tokenize/links/attachment-link.d.ts +4 -0
  400. package/dist/types/parser/tokenize/links/issue-link.d.ts +4 -0
  401. package/dist/types/parser/tokenize/links/link-format.d.ts +2 -0
  402. package/dist/types/parser/tokenize/links/link-parser.d.ts +17 -0
  403. package/dist/types/parser/tokenize/links/link-resolver.d.ts +5 -0
  404. package/dist/types/parser/tokenize/links/mention-link.d.ts +4 -0
  405. package/dist/types/parser/tokenize/links/url-link.d.ts +4 -0
  406. package/dist/types/parser/tokenize/list.d.ts +3 -0
  407. package/dist/types/parser/tokenize/media.d.ts +2 -0
  408. package/dist/types/parser/tokenize/monospace.d.ts +2 -0
  409. package/dist/types/parser/tokenize/noformat-macro.d.ts +2 -0
  410. package/dist/types/parser/tokenize/panel-macro.d.ts +2 -0
  411. package/dist/types/parser/tokenize/quadruple-dash-symbol.d.ts +2 -0
  412. package/dist/types/parser/tokenize/quote-macro.d.ts +5 -0
  413. package/dist/types/parser/tokenize/ruler.d.ts +2 -0
  414. package/dist/types/parser/tokenize/strong.d.ts +2 -0
  415. package/dist/types/parser/tokenize/subscript.d.ts +2 -0
  416. package/dist/types/parser/tokenize/superscript.d.ts +2 -0
  417. package/dist/types/parser/tokenize/table.d.ts +2 -0
  418. package/dist/types/parser/tokenize/triple-dash-symbol.d.ts +1 -0
  419. package/dist/types/parser/tokenize/whitespace.d.ts +3 -0
  420. package/dist/types/parser/utils/attrs.d.ts +3 -0
  421. package/dist/types/parser/utils/color-name-mapping.d.ts +10 -0
  422. package/dist/types/parser/utils/escape.d.ts +2 -0
  423. package/dist/types/parser/utils/normalize.d.ts +4 -0
  424. package/dist/types/parser/utils/panel-type.d.ts +3 -0
  425. package/dist/types/parser/utils/text.d.ts +21 -0
  426. package/dist/types/parser/utils/title.d.ts +7 -0
  427. package/dist/types/parser/utils/url.d.ts +8 -0
  428. package/docs/0-intro.tsx +24 -0
  429. package/interfaces/package.json +7 -0
  430. package/package.json +53 -0
  431. package/tsconfig.json +12 -0
  432. package/typings/json.d.ts +1 -0
@@ -0,0 +1,48 @@
1
+ // TODO: Create a type for rawContentProcessor which will be shared among parsers
2
+ export function commonMacro(input, schema, opt) {
3
+ /**
4
+ * Forging the opening regex, the result would look something like
5
+ * /^\{(quote)(?::([^\{\n\}]*))?\}/i
6
+ */
7
+ const opening = new RegExp(`^\{(${opt.keyword})(?::([^\{\n\}]*))?\}`, 'i');
8
+ const matchOpening = input.match(opening);
9
+
10
+ if (!matchOpening) {
11
+ return fallback(input);
12
+ }
13
+
14
+ const [, name, rawAttrs] = matchOpening;
15
+ const openingLength = matchOpening[0].length;
16
+
17
+ if (!opt.paired) {
18
+ /**
19
+ * Some macros do not have a closing symbol, for example
20
+ * {anchor:here} {loremipsum}
21
+ */
22
+ return opt.rawContentProcessor(rawAttrs, '', openingLength, schema, opt.context);
23
+ }
24
+ /**
25
+ * Forging the closing regex, the result would look something like
26
+ * /\{quote\}/
27
+ */
28
+
29
+
30
+ const closing = new RegExp(`\{${name}\}`);
31
+ const matchClosing = closing.exec(input.substring(openingLength));
32
+ let rawContent = '';
33
+
34
+ if (matchClosing) {
35
+ rawContent = input.substring(openingLength, openingLength + matchClosing.index);
36
+ }
37
+
38
+ const length = matchClosing ? openingLength + matchClosing.index + matchClosing[0].length : openingLength;
39
+ return opt.rawContentProcessor(rawAttrs, rawContent, length, schema, opt.context);
40
+ }
41
+
42
+ function fallback(input) {
43
+ return {
44
+ type: 'text',
45
+ text: input.substr(0, 1),
46
+ length: 1
47
+ };
48
+ }
@@ -0,0 +1,31 @@
1
+ export const createDashTokenParser = (token, fallback) => ({
2
+ input,
3
+ position
4
+ }) => {
5
+ /**
6
+ * From Jira https://stash.atlassian.com/projects/JIRACLOUD/repos/jira/browse/jira-components/jira-renderer/src/main/java/com/atlassian/renderer/v2/components/phrase/DashRendererComponent.java
7
+ * public static final Replacer EN_DASH = new Replacer(Pattern.compile("(^|\\s)--(\\s|$)"), "$1–$2", "--");
8
+ * public static final Replacer EM_DASH = new Replacer(Pattern.compile("(^|\\s)---(\\s|$)"), "$1—$2", "---");
9
+ */
10
+ if (position > 0) {
11
+ const charBeforeToken = input.charAt(position - 1);
12
+
13
+ if (!isSpace(charBeforeToken)) {
14
+ return fallback;
15
+ }
16
+ }
17
+
18
+ if (position + token.length < input.length) {
19
+ const charAfterToken = input.charAt(position + token.length);
20
+
21
+ if (!isSpace(charAfterToken)) {
22
+ return fallback;
23
+ }
24
+ }
25
+
26
+ return token;
27
+ };
28
+
29
+ const isSpace = char => {
30
+ return /\s/.test(char);
31
+ };
@@ -0,0 +1,49 @@
1
+ import { TokenType } from './';
2
+ import { hasAnyOfMarks } from '../utils/text';
3
+ import { commonFormatter } from './common-formatter';
4
+ import { parseString } from '../text';
5
+ export const deleted = ({
6
+ input,
7
+ position,
8
+ schema,
9
+ context
10
+ }) => {
11
+ /**
12
+ * The following token types will be ignored in parsing
13
+ * the content
14
+ */
15
+ const ignoreTokenTypes = [TokenType.DOUBLE_DASH_SYMBOL, TokenType.TRIPLE_DASH_SYMBOL, TokenType.QUADRUPLE_DASH_SYMBOL, TokenType.ISSUE_KEY, TokenType.TABLE];
16
+ /** Add strike mark to each text */
17
+
18
+ const contentDecorator = n => {
19
+ const mark = schema.marks.strike.create(); // We don't want to mix `code` mark with others
20
+
21
+ if (n.type.name === 'text' && !hasAnyOfMarks(n, ['strike', 'code'])) {
22
+ return n.mark([...n.marks, mark]);
23
+ }
24
+
25
+ return n;
26
+ };
27
+
28
+ const rawContentProcessor = (raw, length) => {
29
+ const content = parseString({
30
+ ignoreTokenTypes,
31
+ schema,
32
+ context,
33
+ input: raw
34
+ });
35
+ const decoratedContent = content.map(contentDecorator);
36
+ return {
37
+ type: 'pmnode',
38
+ nodes: decoratedContent,
39
+ length
40
+ };
41
+ };
42
+
43
+ return commonFormatter(input, position, schema, {
44
+ opening: '-',
45
+ closing: '-',
46
+ context,
47
+ rawContentProcessor
48
+ });
49
+ };
@@ -0,0 +1,11 @@
1
+ import { createDashTokenParser } from './dash-token-creator';
2
+ const token = {
3
+ type: 'text',
4
+ text: '\u2013',
5
+ // EN DASH
6
+ length: 2
7
+ };
8
+ const fallback = { ...token,
9
+ text: '--'
10
+ };
11
+ export const doubleDashSymbol = createDashTokenParser(token, fallback);
@@ -0,0 +1,174 @@
1
+ const emptyOrWhitespaceRegex = new RegExp(/^$|\s/);
2
+ export const emoji = ({
3
+ input,
4
+ position,
5
+ schema
6
+ }) => {
7
+ const substring = input.substring(position);
8
+ /**
9
+ * The length of wikimakrup emoji test ranges from 2 to 9 characters at the time of writing.
10
+ */
11
+
12
+ for (let i = 2; i <= 9 && i <= substring.length; ++i) {
13
+ const candidateText = substring.substring(0, i);
14
+ const emojiId = wikiToAdfEmojiMapping[candidateText]; // Is current candidate an emoji AND next character empty string or whitespace?
15
+
16
+ if (emojiId && emptyOrWhitespaceRegex.test(substring.charAt(i))) {
17
+ return {
18
+ type: 'pmnode',
19
+ nodes: [schema.nodes.emoji.createChecked(adfEmojiItems[emojiId])],
20
+ length: i
21
+ };
22
+ }
23
+ }
24
+
25
+ return {
26
+ type: 'text',
27
+ text: substring.substr(0, 1),
28
+ length: 1
29
+ };
30
+ };
31
+ export const adfEmojiItems = {
32
+ '1f642': {
33
+ id: '1f642',
34
+ shortName: ':slight_smile:',
35
+ text: '🙂'
36
+ },
37
+ '1f61e': {
38
+ id: '1f61e',
39
+ shortName: ':disappointed:',
40
+ text: '😞'
41
+ },
42
+ '1f61b': {
43
+ id: '1f61b',
44
+ shortName: ':stuck_out_tongue:',
45
+ text: '😛'
46
+ },
47
+ '1f603': {
48
+ id: '1f603',
49
+ shortName: ':smiley:',
50
+ text: '😃'
51
+ },
52
+ '1f609': {
53
+ id: '1f609',
54
+ shortName: ':wink:',
55
+ text: '😉'
56
+ },
57
+ '1f44d': {
58
+ id: '1f44d',
59
+ shortName: ':thumbsup:',
60
+ text: '👍'
61
+ },
62
+ '1f44e': {
63
+ id: '1f44e',
64
+ shortName: ':thumbsdown:',
65
+ text: '👎'
66
+ },
67
+ 'atlassian-info': {
68
+ id: 'atlassian-info',
69
+ shortName: ':info:',
70
+ text: ':info'
71
+ },
72
+ 'atlassian-check_mark': {
73
+ id: 'atlassian-check_mark',
74
+ shortName: ':check_mark:',
75
+ text: ':check_mark:'
76
+ },
77
+ 'atlassian-cross_mark': {
78
+ id: 'atlassian-cross_mark',
79
+ shortName: ':cross_mark:',
80
+ text: ':cross_mark:'
81
+ },
82
+ 'atlassian-warning': {
83
+ id: 'atlassian-warning',
84
+ shortName: ':warning:',
85
+ text: ':warning:'
86
+ },
87
+ 'atlassian-plus': {
88
+ id: 'atlassian-plus',
89
+ shortName: ':plus:',
90
+ text: ':plus:'
91
+ },
92
+ 'atlassian-minus': {
93
+ id: 'atlassian-minus',
94
+ shortName: ':minus:',
95
+ text: ':minus:'
96
+ },
97
+ 'atlassian-question_mark': {
98
+ id: 'atlassian-question_mark',
99
+ shortName: ':question:',
100
+ text: ':question:'
101
+ },
102
+ 'atlassian-light_bulb_on': {
103
+ id: 'atlassian-light_bulb_on',
104
+ shortName: ':light_bulb_on:',
105
+ text: ':light_bulb_on:'
106
+ },
107
+ 'atlassian-light_bulb_off': {
108
+ id: 'atlassian-light_bulb_off',
109
+ shortName: ':light_bulb_off:',
110
+ text: ':light_bulb_off:'
111
+ },
112
+ 'atlassian-yellow_star': {
113
+ id: 'atlassian-yellow_star',
114
+ shortName: ':yellow_star:',
115
+ text: ':yellow_star:'
116
+ },
117
+ 'atlassian-red_star': {
118
+ id: 'atlassian-red_star',
119
+ shortName: ':red_star:',
120
+ text: ':red_star:'
121
+ },
122
+ 'atlassian-green_star': {
123
+ id: 'atlassian-green_star',
124
+ shortName: ':green_star:',
125
+ text: ':green_star:'
126
+ },
127
+ 'atlassian-blue_star': {
128
+ id: 'atlassian-blue_star',
129
+ shortName: ':blue_star:',
130
+ text: ':blue_star:'
131
+ },
132
+ 'atlassian-flag_on': {
133
+ id: 'atlassian-flag_on',
134
+ shortName: ':flag_on:',
135
+ text: ':flag_on:'
136
+ },
137
+ 'atlassian-flag_off': {
138
+ id: 'atlassian-flag_off',
139
+ shortName: ':flag_off:',
140
+ text: ':flag_off:'
141
+ }
142
+ };
143
+ export const wikiToAdfEmojiMapping = {
144
+ ':)': '1f642',
145
+ ':-)': '1f642',
146
+ ':(': '1f61e',
147
+ ':-(': '1f61e',
148
+ ':P': '1f61b',
149
+ ':-P': '1f61b',
150
+ ':p': '1f61b',
151
+ ':-p': '1f61b',
152
+ ':D': '1f603',
153
+ ':-D': '1f603',
154
+ ';)': '1f609',
155
+ ';-)': '1f609',
156
+ '(y)': '1f44d',
157
+ '(n)': '1f44e',
158
+ '(i)': 'atlassian-info',
159
+ '(/)': 'atlassian-check_mark',
160
+ '(x)': 'atlassian-cross_mark',
161
+ '(!)': 'atlassian-warning',
162
+ '(+)': 'atlassian-plus',
163
+ '(-)': 'atlassian-minus',
164
+ '(?)': 'atlassian-question_mark',
165
+ '(on)': 'atlassian-light_bulb_on',
166
+ '(off)': 'atlassian-light_bulb_off',
167
+ '(*)': 'atlassian-yellow_star',
168
+ '(*y)': 'atlassian-yellow_star',
169
+ '(*r)': 'atlassian-red_star',
170
+ '(*g)': 'atlassian-green_star',
171
+ '(*b)': 'atlassian-blue_star',
172
+ '(flag)': 'atlassian-flag_on',
173
+ '(flagoff)': 'atlassian-flag_off'
174
+ };
@@ -0,0 +1,48 @@
1
+ import { TokenType } from './';
2
+ import { hasAnyOfMarks } from '../utils/text';
3
+ import { commonFormatter } from './common-formatter';
4
+ import { parseString } from '../text';
5
+ export const emphasis = ({
6
+ input,
7
+ position,
8
+ schema,
9
+ context
10
+ }) => {
11
+ /**
12
+ * The following token types will be ignored in parsing
13
+ * the content of a mark
14
+ */
15
+ const ignoreTokenTypes = [TokenType.DOUBLE_DASH_SYMBOL, TokenType.TRIPLE_DASH_SYMBOL, TokenType.QUADRUPLE_DASH_SYMBOL, TokenType.ISSUE_KEY, TokenType.TABLE]; // Add underline mark to each text
16
+
17
+ const contentDecorator = n => {
18
+ const mark = schema.marks.em.create(); // We don't want to mix `code` mark with others
19
+
20
+ if (n.type.name === 'text' && !hasAnyOfMarks(n, ['em', 'code'])) {
21
+ return n.mark([...n.marks, mark]);
22
+ }
23
+
24
+ return n;
25
+ };
26
+
27
+ const rawContentProcessor = (raw, length) => {
28
+ const content = parseString({
29
+ ignoreTokenTypes,
30
+ schema,
31
+ context,
32
+ input: raw
33
+ });
34
+ const decoratedContent = content.map(contentDecorator);
35
+ return {
36
+ type: 'pmnode',
37
+ nodes: decoratedContent,
38
+ length
39
+ };
40
+ };
41
+
42
+ return commonFormatter(input, position, schema, {
43
+ opening: '_',
44
+ closing: '_',
45
+ context,
46
+ rawContentProcessor
47
+ });
48
+ };
@@ -0,0 +1,25 @@
1
+ import getMediaGroupNodeView from '../nodes/mediaGroup';
2
+ // [^attachment.pdf]
3
+ const FILE_LINK_REGEXP = /^\[\^([\(\)\w. -]+)\]/;
4
+ export function fileLink(input, position, schema) {
5
+ const match = input.substring(position).match(FILE_LINK_REGEXP);
6
+
7
+ if (!match) {
8
+ return fallback(input, position);
9
+ }
10
+
11
+ const node = getMediaGroupNodeView(schema, match[1]);
12
+ return {
13
+ type: 'pmnode',
14
+ nodes: [node],
15
+ length: match[0].length
16
+ };
17
+ }
18
+
19
+ function fallback(input, position) {
20
+ return {
21
+ type: 'text',
22
+ text: input.substr(position, 1),
23
+ length: 1
24
+ };
25
+ }
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Jira is using the following regex to match force line break
3
+ * private static final Pattern FORCE_NEWLINE = Pattern.compile("(?<!\\\\)\\\\{2}(?!\\S*\\\\)");
4
+ */
5
+ const FORCE_LINE_BREAK_REGEX = /^\\{2}(?!\S*\\)/;
6
+ export const forceLineBreak = ({
7
+ input,
8
+ position,
9
+ schema
10
+ }) => {
11
+ if (position > 0) {
12
+ const charBefore = input.charAt(position - 1);
13
+
14
+ if (charBefore === '\\') {
15
+ return fallback(input, position);
16
+ }
17
+ }
18
+
19
+ const match = input.substring(position).match(FORCE_LINE_BREAK_REGEX);
20
+
21
+ if (match) {
22
+ return {
23
+ type: 'pmnode',
24
+ nodes: [schema.nodes.hardBreak.createChecked()],
25
+ length: 2
26
+ };
27
+ }
28
+
29
+ return fallback(input, position);
30
+ };
31
+
32
+ function fallback(input, position) {
33
+ return {
34
+ type: 'text',
35
+ text: input.substr(position, 2),
36
+ length: 2
37
+ };
38
+ }
@@ -0,0 +1,24 @@
1
+ import { parseNewlineOnly } from './whitespace';
2
+ export const hardbreak = ({
3
+ input,
4
+ position,
5
+ schema
6
+ }) => {
7
+ // Look for normal hardbreak \r, \n, \r\n
8
+ const length = parseNewlineOnly(input.substring(position));
9
+
10
+ if (length === 0) {
11
+ // not a valid hardbreak
12
+ return {
13
+ type: 'text',
14
+ text: input.substr(position, 1),
15
+ length: 1
16
+ };
17
+ }
18
+
19
+ return {
20
+ type: 'pmnode',
21
+ nodes: [schema.nodes.hardBreak.createChecked()],
22
+ length
23
+ };
24
+ };