@atlaskit/adf-schema 19.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (430) hide show
  1. package/CHANGELOG.md +1524 -0
  2. package/LICENSE +13 -0
  3. package/build/tsconfig.json +17 -0
  4. package/dist/cjs/index.js +1089 -0
  5. package/dist/cjs/schema/bitbucket-schema.js +14 -0
  6. package/dist/cjs/schema/confluence-schema.js +21 -0
  7. package/dist/cjs/schema/create-schema.js +354 -0
  8. package/dist/cjs/schema/default-schema.js +52 -0
  9. package/dist/cjs/schema/groups.js +35 -0
  10. package/dist/cjs/schema/index.js +755 -0
  11. package/dist/cjs/schema/inline-nodes.js +20 -0
  12. package/dist/cjs/schema/jira-schema.js +118 -0
  13. package/dist/cjs/schema/marks/alignment.js +39 -0
  14. package/dist/cjs/schema/marks/annotation.js +96 -0
  15. package/dist/cjs/schema/marks/breakout.js +32 -0
  16. package/dist/cjs/schema/marks/code.js +46 -0
  17. package/dist/cjs/schema/marks/confluence-inline-comment.js +30 -0
  18. package/dist/cjs/schema/marks/data-consumer.js +71 -0
  19. package/dist/cjs/schema/marks/em.js +25 -0
  20. package/dist/cjs/schema/marks/indentation.js +32 -0
  21. package/dist/cjs/schema/marks/index.js +189 -0
  22. package/dist/cjs/schema/marks/link.js +128 -0
  23. package/dist/cjs/schema/marks/strike.js +29 -0
  24. package/dist/cjs/schema/marks/strong.js +37 -0
  25. package/dist/cjs/schema/marks/subsup.js +61 -0
  26. package/dist/cjs/schema/marks/text-color.js +93 -0
  27. package/dist/cjs/schema/marks/type-ahead-query.js +31 -0
  28. package/dist/cjs/schema/marks/underline.js +25 -0
  29. package/dist/cjs/schema/marks/unsupported-mark.js +15 -0
  30. package/dist/cjs/schema/marks/unsupported-node-attributes.js +16 -0
  31. package/dist/cjs/schema/nodes/block-card.js +56 -0
  32. package/dist/cjs/schema/nodes/blockquote.js +23 -0
  33. package/dist/cjs/schema/nodes/bodied-extension.js +66 -0
  34. package/dist/cjs/schema/nodes/bullet-list.js +29 -0
  35. package/dist/cjs/schema/nodes/caption.js +27 -0
  36. package/dist/cjs/schema/nodes/code-block.js +160 -0
  37. package/dist/cjs/schema/nodes/confluence-jira-issue.js +54 -0
  38. package/dist/cjs/schema/nodes/confluence-unsupported-block.js +33 -0
  39. package/dist/cjs/schema/nodes/confluence-unsupported-inline.js +34 -0
  40. package/dist/cjs/schema/nodes/date.js +36 -0
  41. package/dist/cjs/schema/nodes/decision-item.js +45 -0
  42. package/dist/cjs/schema/nodes/decision-list.js +45 -0
  43. package/dist/cjs/schema/nodes/doc.js +15 -0
  44. package/dist/cjs/schema/nodes/embed-card.js +62 -0
  45. package/dist/cjs/schema/nodes/emoji.js +73 -0
  46. package/dist/cjs/schema/nodes/expand.js +86 -0
  47. package/dist/cjs/schema/nodes/extension.js +59 -0
  48. package/dist/cjs/schema/nodes/hard-break.js +22 -0
  49. package/dist/cjs/schema/nodes/heading.js +69 -0
  50. package/dist/cjs/schema/nodes/image.js +40 -0
  51. package/dist/cjs/schema/nodes/index.js +539 -0
  52. package/dist/cjs/schema/nodes/inline-card.js +64 -0
  53. package/dist/cjs/schema/nodes/inline-extension.js +54 -0
  54. package/dist/cjs/schema/nodes/layout-column.js +53 -0
  55. package/dist/cjs/schema/nodes/layout-section.js +61 -0
  56. package/dist/cjs/schema/nodes/list-item.js +25 -0
  57. package/dist/cjs/schema/nodes/media-group.js +29 -0
  58. package/dist/cjs/schema/nodes/media-inline.js +11 -0
  59. package/dist/cjs/schema/nodes/media-single.js +101 -0
  60. package/dist/cjs/schema/nodes/media.js +196 -0
  61. package/dist/cjs/schema/nodes/mention.js +90 -0
  62. package/dist/cjs/schema/nodes/nested-expand.js +64 -0
  63. package/dist/cjs/schema/nodes/ordered-list.js +29 -0
  64. package/dist/cjs/schema/nodes/panel.js +85 -0
  65. package/dist/cjs/schema/nodes/paragraph.js +45 -0
  66. package/dist/cjs/schema/nodes/placeholder.js +39 -0
  67. package/dist/cjs/schema/nodes/rule.js +21 -0
  68. package/dist/cjs/schema/nodes/status.js +56 -0
  69. package/dist/cjs/schema/nodes/tableNodes.js +276 -0
  70. package/dist/cjs/schema/nodes/task-item.js +46 -0
  71. package/dist/cjs/schema/nodes/task-list.js +45 -0
  72. package/dist/cjs/schema/nodes/text.js +17 -0
  73. package/dist/cjs/schema/nodes/types/block-content.js +5 -0
  74. package/dist/cjs/schema/nodes/types/extensions.js +5 -0
  75. package/dist/cjs/schema/nodes/types/inline-content.js +5 -0
  76. package/dist/cjs/schema/nodes/types/mark.js +5 -0
  77. package/dist/cjs/schema/nodes/types/non-nestable-block-content.js +5 -0
  78. package/dist/cjs/schema/nodes/types/rich-media-common.js +5 -0
  79. package/dist/cjs/schema/nodes/unknown-block.js +21 -0
  80. package/dist/cjs/schema/nodes/unsupported-block.js +33 -0
  81. package/dist/cjs/schema/nodes/unsupported-inline.js +32 -0
  82. package/dist/cjs/schema/unsupported.js +8 -0
  83. package/dist/cjs/steps/analytics.js +183 -0
  84. package/dist/cjs/steps/set-attrs.js +106 -0
  85. package/dist/cjs/steps/table/add-column.js +453 -0
  86. package/dist/cjs/steps/table/constants.js +13 -0
  87. package/dist/cjs/steps/table/sort-column.js +87 -0
  88. package/dist/cjs/steps/table/types.js +5 -0
  89. package/dist/cjs/steps/table/utils/cell-step.js +233 -0
  90. package/dist/cjs/steps/table/utils/cells-at-column.js +94 -0
  91. package/dist/cjs/steps/table/utils/find-column.js +94 -0
  92. package/dist/cjs/steps/table/utils/get-table-rect-from-doc.js +38 -0
  93. package/dist/cjs/steps/table/utils/side-effects/rows.js +370 -0
  94. package/dist/cjs/steps/table/utils/side-effects/side-effects.js +106 -0
  95. package/dist/cjs/steps/table/utils/side-effects/table.js +126 -0
  96. package/dist/cjs/steps/table/utils/side-effects/types.js +5 -0
  97. package/dist/cjs/steps/table/utils/table-map.js +36 -0
  98. package/dist/cjs/steps/type-ahead.js +134 -0
  99. package/dist/cjs/steps.js +59 -0
  100. package/dist/cjs/utils/colors.js +234 -0
  101. package/dist/cjs/utils/confluence/emoji.js +97 -0
  102. package/dist/cjs/utils/extensions.js +39 -0
  103. package/dist/cjs/utils/index.js +373 -0
  104. package/dist/cjs/utils/parseDOM.js +12 -0
  105. package/dist/cjs/utils/url.js +38 -0
  106. package/dist/cjs/utils/uuid.js +28 -0
  107. package/dist/cjs/version.json +5 -0
  108. package/dist/es2019/index.js +2 -0
  109. package/dist/es2019/schema/bitbucket-schema.js +5 -0
  110. package/dist/es2019/schema/confluence-schema.js +11 -0
  111. package/dist/es2019/schema/create-schema.js +325 -0
  112. package/dist/es2019/schema/default-schema.js +35 -0
  113. package/dist/es2019/schema/groups.js +23 -0
  114. package/dist/es2019/schema/index.js +9 -0
  115. package/dist/es2019/schema/inline-nodes.js +3 -0
  116. package/dist/es2019/schema/jira-schema.js +88 -0
  117. package/dist/es2019/schema/marks/alignment.js +32 -0
  118. package/dist/es2019/schema/marks/annotation.js +80 -0
  119. package/dist/es2019/schema/marks/breakout.js +29 -0
  120. package/dist/es2019/schema/marks/code.js +43 -0
  121. package/dist/es2019/schema/marks/confluence-inline-comment.js +24 -0
  122. package/dist/es2019/schema/marks/data-consumer.js +61 -0
  123. package/dist/es2019/schema/marks/em.js +22 -0
  124. package/dist/es2019/schema/marks/indentation.js +27 -0
  125. package/dist/es2019/schema/marks/index.js +17 -0
  126. package/dist/es2019/schema/marks/link.js +105 -0
  127. package/dist/es2019/schema/marks/strike.js +24 -0
  128. package/dist/es2019/schema/marks/strong.js +40 -0
  129. package/dist/es2019/schema/marks/subsup.js +51 -0
  130. package/dist/es2019/schema/marks/text-color.js +67 -0
  131. package/dist/es2019/schema/marks/type-ahead-query.js +23 -0
  132. package/dist/es2019/schema/marks/underline.js +20 -0
  133. package/dist/es2019/schema/marks/unsupported-mark.js +9 -0
  134. package/dist/es2019/schema/marks/unsupported-node-attributes.js +10 -0
  135. package/dist/es2019/schema/nodes/block-card.js +50 -0
  136. package/dist/es2019/schema/nodes/blockquote.js +17 -0
  137. package/dist/es2019/schema/nodes/bodied-extension.js +58 -0
  138. package/dist/es2019/schema/nodes/bullet-list.js +23 -0
  139. package/dist/es2019/schema/nodes/caption.js +21 -0
  140. package/dist/es2019/schema/nodes/code-block.js +143 -0
  141. package/dist/es2019/schema/nodes/confluence-jira-issue.js +49 -0
  142. package/dist/es2019/schema/nodes/confluence-unsupported-block.js +30 -0
  143. package/dist/es2019/schema/nodes/confluence-unsupported-inline.js +31 -0
  144. package/dist/es2019/schema/nodes/date.js +28 -0
  145. package/dist/es2019/schema/nodes/decision-item.js +37 -0
  146. package/dist/es2019/schema/nodes/decision-list.js +41 -0
  147. package/dist/es2019/schema/nodes/doc.js +7 -0
  148. package/dist/es2019/schema/nodes/embed-card.js +55 -0
  149. package/dist/es2019/schema/nodes/emoji.js +67 -0
  150. package/dist/es2019/schema/nodes/expand.js +73 -0
  151. package/dist/es2019/schema/nodes/extension.js +51 -0
  152. package/dist/es2019/schema/nodes/hard-break.js +16 -0
  153. package/dist/es2019/schema/nodes/heading.js +63 -0
  154. package/dist/es2019/schema/nodes/image.js +37 -0
  155. package/dist/es2019/schema/nodes/index.js +44 -0
  156. package/dist/es2019/schema/nodes/inline-card.js +58 -0
  157. package/dist/es2019/schema/nodes/inline-extension.js +46 -0
  158. package/dist/es2019/schema/nodes/layout-column.js +49 -0
  159. package/dist/es2019/schema/nodes/layout-section.js +56 -0
  160. package/dist/es2019/schema/nodes/list-item.js +20 -0
  161. package/dist/es2019/schema/nodes/media-group.js +23 -0
  162. package/dist/es2019/schema/nodes/media-inline.js +2 -0
  163. package/dist/es2019/schema/nodes/media-single.js +77 -0
  164. package/dist/es2019/schema/nodes/media.js +165 -0
  165. package/dist/es2019/schema/nodes/mention.js +81 -0
  166. package/dist/es2019/schema/nodes/nested-expand.js +58 -0
  167. package/dist/es2019/schema/nodes/ordered-list.js +23 -0
  168. package/dist/es2019/schema/nodes/panel.js +79 -0
  169. package/dist/es2019/schema/nodes/paragraph.js +39 -0
  170. package/dist/es2019/schema/nodes/placeholder.js +33 -0
  171. package/dist/es2019/schema/nodes/rule.js +15 -0
  172. package/dist/es2019/schema/nodes/status.js +54 -0
  173. package/dist/es2019/schema/nodes/tableNodes.js +222 -0
  174. package/dist/es2019/schema/nodes/task-item.js +38 -0
  175. package/dist/es2019/schema/nodes/task-list.js +37 -0
  176. package/dist/es2019/schema/nodes/text.js +7 -0
  177. package/dist/es2019/schema/nodes/types/block-content.js +1 -0
  178. package/dist/es2019/schema/nodes/types/extensions.js +1 -0
  179. package/dist/es2019/schema/nodes/types/inline-content.js +1 -0
  180. package/dist/es2019/schema/nodes/types/mark.js +1 -0
  181. package/dist/es2019/schema/nodes/types/non-nestable-block-content.js +1 -0
  182. package/dist/es2019/schema/nodes/types/rich-media-common.js +1 -0
  183. package/dist/es2019/schema/nodes/unknown-block.js +16 -0
  184. package/dist/es2019/schema/nodes/unsupported-block.js +26 -0
  185. package/dist/es2019/schema/nodes/unsupported-inline.js +25 -0
  186. package/dist/es2019/schema/unsupported.js +1 -0
  187. package/dist/es2019/steps/analytics.js +122 -0
  188. package/dist/es2019/steps/set-attrs.js +57 -0
  189. package/dist/es2019/steps/table/add-column.js +349 -0
  190. package/dist/es2019/steps/table/constants.js +6 -0
  191. package/dist/es2019/steps/table/sort-column.js +41 -0
  192. package/dist/es2019/steps/table/types.js +1 -0
  193. package/dist/es2019/steps/table/utils/cell-step.js +204 -0
  194. package/dist/es2019/steps/table/utils/cells-at-column.js +57 -0
  195. package/dist/es2019/steps/table/utils/find-column.js +86 -0
  196. package/dist/es2019/steps/table/utils/get-table-rect-from-doc.js +30 -0
  197. package/dist/es2019/steps/table/utils/side-effects/rows.js +297 -0
  198. package/dist/es2019/steps/table/utils/side-effects/side-effects.js +81 -0
  199. package/dist/es2019/steps/table/utils/side-effects/table.js +99 -0
  200. package/dist/es2019/steps/table/utils/side-effects/types.js +1 -0
  201. package/dist/es2019/steps/table/utils/table-map.js +19 -0
  202. package/dist/es2019/steps/type-ahead.js +85 -0
  203. package/dist/es2019/steps.js +6 -0
  204. package/dist/es2019/utils/colors.js +148 -0
  205. package/dist/es2019/utils/confluence/emoji.js +83 -0
  206. package/dist/es2019/utils/extensions.js +26 -0
  207. package/dist/es2019/utils/index.js +4 -0
  208. package/dist/es2019/utils/parseDOM.js +1 -0
  209. package/dist/es2019/utils/url.js +19 -0
  210. package/dist/es2019/utils/uuid.js +18 -0
  211. package/dist/es2019/version.json +5 -0
  212. package/dist/esm/index.js +2 -0
  213. package/dist/esm/schema/bitbucket-schema.js +5 -0
  214. package/dist/esm/schema/confluence-schema.js +11 -0
  215. package/dist/esm/schema/create-schema.js +338 -0
  216. package/dist/esm/schema/default-schema.js +36 -0
  217. package/dist/esm/schema/groups.js +23 -0
  218. package/dist/esm/schema/index.js +9 -0
  219. package/dist/esm/schema/inline-nodes.js +5 -0
  220. package/dist/esm/schema/jira-schema.js +88 -0
  221. package/dist/esm/schema/marks/alignment.js +30 -0
  222. package/dist/esm/schema/marks/annotation.js +82 -0
  223. package/dist/esm/schema/marks/breakout.js +25 -0
  224. package/dist/esm/schema/marks/code.js +41 -0
  225. package/dist/esm/schema/marks/confluence-inline-comment.js +22 -0
  226. package/dist/esm/schema/marks/data-consumer.js +63 -0
  227. package/dist/esm/schema/marks/em.js +20 -0
  228. package/dist/esm/schema/marks/indentation.js +23 -0
  229. package/dist/esm/schema/marks/index.js +17 -0
  230. package/dist/esm/schema/marks/link.js +113 -0
  231. package/dist/esm/schema/marks/strike.js +24 -0
  232. package/dist/esm/schema/marks/strong.js +32 -0
  233. package/dist/esm/schema/marks/subsup.js +53 -0
  234. package/dist/esm/schema/marks/text-color.js +78 -0
  235. package/dist/esm/schema/marks/type-ahead-query.js +21 -0
  236. package/dist/esm/schema/marks/underline.js +20 -0
  237. package/dist/esm/schema/marks/unsupported-mark.js +8 -0
  238. package/dist/esm/schema/marks/unsupported-node-attributes.js +9 -0
  239. package/dist/esm/schema/nodes/block-card.js +48 -0
  240. package/dist/esm/schema/nodes/blockquote.js +15 -0
  241. package/dist/esm/schema/nodes/bodied-extension.js +58 -0
  242. package/dist/esm/schema/nodes/bullet-list.js +21 -0
  243. package/dist/esm/schema/nodes/caption.js +19 -0
  244. package/dist/esm/schema/nodes/code-block.js +149 -0
  245. package/dist/esm/schema/nodes/confluence-jira-issue.js +47 -0
  246. package/dist/esm/schema/nodes/confluence-unsupported-block.js +26 -0
  247. package/dist/esm/schema/nodes/confluence-unsupported-inline.js +27 -0
  248. package/dist/esm/schema/nodes/date.js +28 -0
  249. package/dist/esm/schema/nodes/decision-item.js +36 -0
  250. package/dist/esm/schema/nodes/decision-list.js +39 -0
  251. package/dist/esm/schema/nodes/doc.js +7 -0
  252. package/dist/esm/schema/nodes/embed-card.js +54 -0
  253. package/dist/esm/schema/nodes/emoji.js +68 -0
  254. package/dist/esm/schema/nodes/expand.js +75 -0
  255. package/dist/esm/schema/nodes/extension.js +51 -0
  256. package/dist/esm/schema/nodes/hard-break.js +14 -0
  257. package/dist/esm/schema/nodes/heading.js +61 -0
  258. package/dist/esm/schema/nodes/image.js +33 -0
  259. package/dist/esm/schema/nodes/index.js +44 -0
  260. package/dist/esm/schema/nodes/inline-card.js +56 -0
  261. package/dist/esm/schema/nodes/inline-extension.js +46 -0
  262. package/dist/esm/schema/nodes/layout-column.js +45 -0
  263. package/dist/esm/schema/nodes/layout-section.js +52 -0
  264. package/dist/esm/schema/nodes/list-item.js +18 -0
  265. package/dist/esm/schema/nodes/media-group.js +21 -0
  266. package/dist/esm/schema/nodes/media-inline.js +2 -0
  267. package/dist/esm/schema/nodes/media-single.js +84 -0
  268. package/dist/esm/schema/nodes/media.js +174 -0
  269. package/dist/esm/schema/nodes/mention.js +80 -0
  270. package/dist/esm/schema/nodes/nested-expand.js +56 -0
  271. package/dist/esm/schema/nodes/ordered-list.js +21 -0
  272. package/dist/esm/schema/nodes/panel.js +76 -0
  273. package/dist/esm/schema/nodes/paragraph.js +37 -0
  274. package/dist/esm/schema/nodes/placeholder.js +31 -0
  275. package/dist/esm/schema/nodes/rule.js +13 -0
  276. package/dist/esm/schema/nodes/status.js +51 -0
  277. package/dist/esm/schema/nodes/tableNodes.js +238 -0
  278. package/dist/esm/schema/nodes/task-item.js +37 -0
  279. package/dist/esm/schema/nodes/task-list.js +35 -0
  280. package/dist/esm/schema/nodes/text.js +9 -0
  281. package/dist/esm/schema/nodes/types/block-content.js +1 -0
  282. package/dist/esm/schema/nodes/types/extensions.js +1 -0
  283. package/dist/esm/schema/nodes/types/inline-content.js +1 -0
  284. package/dist/esm/schema/nodes/types/mark.js +1 -0
  285. package/dist/esm/schema/nodes/types/non-nestable-block-content.js +1 -0
  286. package/dist/esm/schema/nodes/types/rich-media-common.js +1 -0
  287. package/dist/esm/schema/nodes/unknown-block.js +14 -0
  288. package/dist/esm/schema/nodes/unsupported-block.js +26 -0
  289. package/dist/esm/schema/nodes/unsupported-inline.js +25 -0
  290. package/dist/esm/schema/unsupported.js +1 -0
  291. package/dist/esm/steps/analytics.js +166 -0
  292. package/dist/esm/steps/set-attrs.js +89 -0
  293. package/dist/esm/steps/table/add-column.js +431 -0
  294. package/dist/esm/steps/table/constants.js +6 -0
  295. package/dist/esm/steps/table/sort-column.js +69 -0
  296. package/dist/esm/steps/table/types.js +1 -0
  297. package/dist/esm/steps/table/utils/cell-step.js +216 -0
  298. package/dist/esm/steps/table/utils/cells-at-column.js +84 -0
  299. package/dist/esm/steps/table/utils/find-column.js +87 -0
  300. package/dist/esm/steps/table/utils/get-table-rect-from-doc.js +30 -0
  301. package/dist/esm/steps/table/utils/side-effects/rows.js +360 -0
  302. package/dist/esm/steps/table/utils/side-effects/side-effects.js +93 -0
  303. package/dist/esm/steps/table/utils/side-effects/table.js +113 -0
  304. package/dist/esm/steps/table/utils/side-effects/types.js +1 -0
  305. package/dist/esm/steps/table/utils/table-map.js +19 -0
  306. package/dist/esm/steps/type-ahead.js +117 -0
  307. package/dist/esm/steps.js +6 -0
  308. package/dist/esm/utils/colors.js +160 -0
  309. package/dist/esm/utils/confluence/emoji.js +85 -0
  310. package/dist/esm/utils/extensions.js +27 -0
  311. package/dist/esm/utils/index.js +4 -0
  312. package/dist/esm/utils/parseDOM.js +3 -0
  313. package/dist/esm/utils/url.js +21 -0
  314. package/dist/esm/utils/uuid.js +18 -0
  315. package/dist/esm/version.json +5 -0
  316. package/dist/json-schema/v1/full.json +2536 -0
  317. package/dist/json-schema/v1/stage-0.json +2737 -0
  318. package/dist/types/index.d.ts +4 -0
  319. package/dist/types/schema/bitbucket-schema.d.ts +2 -0
  320. package/dist/types/schema/confluence-schema.d.ts +3 -0
  321. package/dist/types/schema/create-schema.d.ts +31 -0
  322. package/dist/types/schema/default-schema.d.ts +7 -0
  323. package/dist/types/schema/groups.d.ts +6 -0
  324. package/dist/types/schema/index.d.ts +11 -0
  325. package/dist/types/schema/inline-nodes.d.ts +1 -0
  326. package/dist/types/schema/jira-schema.d.ts +26 -0
  327. package/dist/types/schema/marks/alignment.d.ts +16 -0
  328. package/dist/types/schema/marks/annotation.d.ts +32 -0
  329. package/dist/types/schema/marks/breakout.d.ts +12 -0
  330. package/dist/types/schema/marks/code.d.ts +8 -0
  331. package/dist/types/schema/marks/confluence-inline-comment.d.ts +12 -0
  332. package/dist/types/schema/marks/data-consumer.d.ts +41 -0
  333. package/dist/types/schema/marks/em.d.ts +8 -0
  334. package/dist/types/schema/marks/indentation.d.ts +16 -0
  335. package/dist/types/schema/marks/index.d.ts +30 -0
  336. package/dist/types/schema/marks/link.d.ts +32 -0
  337. package/dist/types/schema/marks/strike.d.ts +8 -0
  338. package/dist/types/schema/marks/strong.d.ts +8 -0
  339. package/dist/types/schema/marks/subsup.d.ts +15 -0
  340. package/dist/types/schema/marks/text-color.d.ts +21 -0
  341. package/dist/types/schema/marks/type-ahead-query.d.ts +2 -0
  342. package/dist/types/schema/marks/underline.d.ts +8 -0
  343. package/dist/types/schema/marks/unsupported-mark.d.ts +2 -0
  344. package/dist/types/schema/marks/unsupported-node-attributes.d.ts +2 -0
  345. package/dist/types/schema/nodes/block-card.d.ts +19 -0
  346. package/dist/types/schema/nodes/blockquote.d.ts +14 -0
  347. package/dist/types/schema/nodes/bodied-extension.d.ts +27 -0
  348. package/dist/types/schema/nodes/bullet-list.d.ts +14 -0
  349. package/dist/types/schema/nodes/caption.d.ts +21 -0
  350. package/dist/types/schema/nodes/code-block.d.ts +31 -0
  351. package/dist/types/schema/nodes/confluence-jira-issue.d.ts +2 -0
  352. package/dist/types/schema/nodes/confluence-unsupported-block.d.ts +2 -0
  353. package/dist/types/schema/nodes/confluence-unsupported-inline.d.ts +2 -0
  354. package/dist/types/schema/nodes/date.d.ts +14 -0
  355. package/dist/types/schema/nodes/decision-item.d.ts +17 -0
  356. package/dist/types/schema/nodes/decision-list.d.ts +18 -0
  357. package/dist/types/schema/nodes/doc.d.ts +18 -0
  358. package/dist/types/schema/nodes/embed-card.d.ts +15 -0
  359. package/dist/types/schema/nodes/emoji.d.ts +14 -0
  360. package/dist/types/schema/nodes/expand.d.ts +33 -0
  361. package/dist/types/schema/nodes/extension.d.ts +21 -0
  362. package/dist/types/schema/nodes/hard-break.d.ts +11 -0
  363. package/dist/types/schema/nodes/heading.d.ts +36 -0
  364. package/dist/types/schema/nodes/image.d.ts +2 -0
  365. package/dist/types/schema/nodes/index.d.ts +93 -0
  366. package/dist/types/schema/nodes/inline-card.d.ts +19 -0
  367. package/dist/types/schema/nodes/inline-extension.d.ts +21 -0
  368. package/dist/types/schema/nodes/layout-column.d.ts +21 -0
  369. package/dist/types/schema/nodes/layout-section.d.ts +44 -0
  370. package/dist/types/schema/nodes/list-item.d.ts +20 -0
  371. package/dist/types/schema/nodes/media-group.d.ts +14 -0
  372. package/dist/types/schema/nodes/media-inline.d.ts +16 -0
  373. package/dist/types/schema/nodes/media-single.d.ts +59 -0
  374. package/dist/types/schema/nodes/media.d.ts +60 -0
  375. package/dist/types/schema/nodes/mention.d.ts +26 -0
  376. package/dist/types/schema/nodes/nested-expand.d.ts +27 -0
  377. package/dist/types/schema/nodes/ordered-list.d.ts +20 -0
  378. package/dist/types/schema/nodes/panel.d.ts +46 -0
  379. package/dist/types/schema/nodes/paragraph.d.ts +37 -0
  380. package/dist/types/schema/nodes/placeholder.d.ts +11 -0
  381. package/dist/types/schema/nodes/rule.d.ts +8 -0
  382. package/dist/types/schema/nodes/status.d.ts +20 -0
  383. package/dist/types/schema/nodes/tableNodes.d.ts +111 -0
  384. package/dist/types/schema/nodes/task-item.d.ts +17 -0
  385. package/dist/types/schema/nodes/task-list.d.ts +21 -0
  386. package/dist/types/schema/nodes/text.d.ts +15 -0
  387. package/dist/types/schema/nodes/types/block-content.d.ts +22 -0
  388. package/dist/types/schema/nodes/types/extensions.d.ts +34 -0
  389. package/dist/types/schema/nodes/types/inline-content.d.ts +32 -0
  390. package/dist/types/schema/nodes/types/mark.d.ts +15 -0
  391. package/dist/types/schema/nodes/types/non-nestable-block-content.d.ts +20 -0
  392. package/dist/types/schema/nodes/types/rich-media-common.d.ts +9 -0
  393. package/dist/types/schema/nodes/unknown-block.d.ts +3 -0
  394. package/dist/types/schema/nodes/unsupported-block.d.ts +2 -0
  395. package/dist/types/schema/nodes/unsupported-inline.d.ts +2 -0
  396. package/dist/types/schema/unsupported.d.ts +1 -0
  397. package/dist/types/steps/analytics.d.ts +59 -0
  398. package/dist/types/steps/set-attrs.d.ts +23 -0
  399. package/dist/types/steps/table/add-column.d.ts +88 -0
  400. package/dist/types/steps/table/constants.d.ts +4 -0
  401. package/dist/types/steps/table/sort-column.d.ts +18 -0
  402. package/dist/types/steps/table/types.d.ts +39 -0
  403. package/dist/types/steps/table/utils/cell-step.d.ts +47 -0
  404. package/dist/types/steps/table/utils/cells-at-column.d.ts +20 -0
  405. package/dist/types/steps/table/utils/find-column.d.ts +8 -0
  406. package/dist/types/steps/table/utils/get-table-rect-from-doc.d.ts +8 -0
  407. package/dist/types/steps/table/utils/side-effects/rows.d.ts +25 -0
  408. package/dist/types/steps/table/utils/side-effects/side-effects.d.ts +15 -0
  409. package/dist/types/steps/table/utils/side-effects/table.d.ts +16 -0
  410. package/dist/types/steps/table/utils/side-effects/types.d.ts +33 -0
  411. package/dist/types/steps/table/utils/table-map.d.ts +6 -0
  412. package/dist/types/steps/type-ahead.d.ts +35 -0
  413. package/dist/types/steps.d.ts +8 -0
  414. package/dist/types/utils/colors.d.ts +71 -0
  415. package/dist/types/utils/confluence/emoji.d.ts +50 -0
  416. package/dist/types/utils/extensions.d.ts +3 -0
  417. package/dist/types/utils/index.d.ts +6 -0
  418. package/dist/types/utils/parseDOM.d.ts +1 -0
  419. package/dist/types/utils/url.d.ts +15 -0
  420. package/dist/types/utils/uuid.d.ts +5 -0
  421. package/document-fixtures/unsupported-content.json +526 -0
  422. package/json-schema/v1/full.json +2536 -0
  423. package/json-schema/v1/stage-0.json +2737 -0
  424. package/package.json +63 -0
  425. package/steps/package.json +7 -0
  426. package/test-helpers/html-helpers.ts +40 -0
  427. package/test-helpers/matches.ts +8 -0
  428. package/test-helpers/schema-builder.ts +329 -0
  429. package/test-helpers/schema.ts +79 -0
  430. package/tsconfig.json +18 -0
@@ -0,0 +1,113 @@
1
+ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
+ import _createClass from "@babel/runtime/helpers/createClass";
3
+ import { StepMap } from 'prosemirror-transform';
4
+ export var TableSideEffectHandler = /*#__PURE__*/function () {
5
+ function TableSideEffectHandler(tableSideEffect) {
6
+ _classCallCheck(this, TableSideEffectHandler);
7
+
8
+ if (tableSideEffect) {
9
+ this.table = tableSideEffect;
10
+ }
11
+ }
12
+
13
+ _createClass(TableSideEffectHandler, [{
14
+ key: "addTableSideEffect",
15
+ value: function addTableSideEffect(from, to, node) {
16
+ this.table = {
17
+ from: from,
18
+ to: to,
19
+ node: node
20
+ };
21
+ }
22
+ }, {
23
+ key: "handleAddTable",
24
+ value: function handleAddTable(tr, isDelete) {
25
+ if (isDelete || !this.table) {
26
+ return false;
27
+ }
28
+
29
+ tr.insert(this.table.from, this.table.node);
30
+ return true;
31
+ }
32
+ }, {
33
+ key: "handleRemoveTable",
34
+ value: function handleRemoveTable(tr, tablePos, tableRect, column, isDelete) {
35
+ if (isDelete && tableRect.map.width === 1 && column === 0) {
36
+ // Add side effect
37
+ this.addTableSideEffect(tablePos, tablePos + tableRect.table.nodeSize, tableRect.table.copy(tableRect.table.content));
38
+ tr.delete(tablePos, tablePos + tableRect.table.nodeSize);
39
+ return true;
40
+ }
41
+
42
+ return false;
43
+ }
44
+ }, {
45
+ key: "getTableMap",
46
+ value: function getTableMap(isDelete) {
47
+ if (!this.table) {
48
+ return;
49
+ }
50
+
51
+ var _this$table = this.table,
52
+ from = _this$table.from,
53
+ to = _this$table.to;
54
+
55
+ if (isDelete) {
56
+ return new StepMap([from, to - from, 0]);
57
+ }
58
+
59
+ return new StepMap([from, 0, to - from]);
60
+ }
61
+ }, {
62
+ key: "map",
63
+ value: function map(mapping) {
64
+ if (!this.table) {
65
+ return;
66
+ }
67
+
68
+ return {
69
+ from: mapping.map(this.table.from),
70
+ to: mapping.map(this.table.to),
71
+ node: this.table.node
72
+ };
73
+ }
74
+ }, {
75
+ key: "invert",
76
+ value: function invert(doc) {
77
+ if (!this.table) {
78
+ return;
79
+ }
80
+
81
+ var tableNode = doc.nodeAt(this.table.from);
82
+ return {
83
+ from: this.table.from,
84
+ to: this.table.from + tableNode.nodeSize,
85
+ node: tableNode.copy(tableNode.content)
86
+ };
87
+ }
88
+ }, {
89
+ key: "toJSON",
90
+ value: function toJSON() {
91
+ if (!this.table) {
92
+ return;
93
+ }
94
+
95
+ return {
96
+ from: this.table.from,
97
+ to: this.table.to,
98
+ node: this.table.node.toJSON()
99
+ };
100
+ }
101
+ }], [{
102
+ key: "fromJSON",
103
+ value: function fromJSON(schema, json) {
104
+ return {
105
+ from: json.from,
106
+ to: json.to,
107
+ node: schema.nodeFromJSON(json.node)
108
+ };
109
+ }
110
+ }]);
111
+
112
+ return TableSideEffectHandler;
113
+ }();
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,19 @@
1
+ export var getCellIndex = function getCellIndex(map, row, col) {
2
+ return row * map.width + col;
3
+ };
4
+ export function hasMergedColumns(map, row, col) {
5
+ var index = getCellIndex(map, row, col);
6
+ return col > 0 && map.map[index - 1] === map.map[index] || col < map.width - 1 && map.map[index + 1] === map.map[index];
7
+ }
8
+ export function hasMergedRows(map, row, col) {
9
+ var index = getCellIndex(map, row, col);
10
+ return row > 0 && map.map[index - map.width] !== map.map[index] || row < map.height - 1 && map.map[index + map.width] === map.map[index];
11
+ }
12
+ export function isRootRow(map, row, col) {
13
+ var index = getCellIndex(map, row, col);
14
+ return row > 0 ? map.map[index - map.width] !== map.map[index] : true;
15
+ }
16
+ export function isRootCol(map, row, col) {
17
+ var index = getCellIndex(map, row, col);
18
+ return row > 0 ? map.map[index - 1] !== map.map[index] : true;
19
+ }
@@ -0,0 +1,117 @@
1
+ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
+ import _createClass from "@babel/runtime/helpers/createClass";
3
+ import _inherits from "@babel/runtime/helpers/inherits";
4
+ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
5
+ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
+
7
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
8
+
9
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
10
+
11
+ import { Slice } from 'prosemirror-model';
12
+ import { ReplaceStep, Step, StepMap, StepResult } from 'prosemirror-transform';
13
+ export var insertTypeAheadStepType = 'atlaskit-insert-type-ahead';
14
+ export var InsertTypeAheadStages;
15
+
16
+ (function (InsertTypeAheadStages) {
17
+ InsertTypeAheadStages["DELETING_RAW_QUERY"] = "DELETING_RAW_QUERY";
18
+ InsertTypeAheadStages["INSERTING_ITEM"] = "INSERTING_ITEM";
19
+ })(InsertTypeAheadStages || (InsertTypeAheadStages = {}));
20
+
21
+ export var InsertTypeAheadStep = /*#__PURE__*/function (_Step) {
22
+ _inherits(InsertTypeAheadStep, _Step);
23
+
24
+ var _super = _createSuper(InsertTypeAheadStep);
25
+
26
+ function InsertTypeAheadStep(_ref) {
27
+ var _this;
28
+
29
+ var stage = _ref.stage,
30
+ query = _ref.query,
31
+ trigger = _ref.trigger,
32
+ selectedIndex = _ref.selectedIndex;
33
+ var isInvertStep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
34
+
35
+ _classCallCheck(this, InsertTypeAheadStep);
36
+
37
+ _this = _super.call(this);
38
+ _this.isInvertStep = isInvertStep;
39
+ _this.stage = stage;
40
+ _this.query = query;
41
+ _this.trigger = trigger;
42
+ _this.selectedIndex = selectedIndex;
43
+ return _this;
44
+ }
45
+
46
+ _createClass(InsertTypeAheadStep, [{
47
+ key: "invert",
48
+ value: function invert() {
49
+ var config = {
50
+ stage: this.stage,
51
+ query: this.query,
52
+ trigger: this.trigger,
53
+ selectedIndex: this.selectedIndex
54
+ };
55
+ return new InsertTypeAheadStep(config, !this.isInvertStep);
56
+ }
57
+ }, {
58
+ key: "apply",
59
+ value: function apply(doc) {
60
+ return StepResult.ok(doc);
61
+ }
62
+ }, {
63
+ key: "merge",
64
+ value: function merge() {
65
+ return null;
66
+ }
67
+ }, {
68
+ key: "isInsertionStep",
69
+ value: function isInsertionStep() {
70
+ return !this.isInvertStep;
71
+ }
72
+ }, {
73
+ key: "isUndoingStep",
74
+ value: function isUndoingStep() {
75
+ return this.isInvertStep;
76
+ }
77
+ }, {
78
+ key: "map",
79
+ value: function map(mapping) {
80
+ var config = {
81
+ stage: this.stage,
82
+ query: this.query,
83
+ trigger: this.trigger,
84
+ selectedIndex: this.selectedIndex
85
+ }; // Return the same events, this step will never be removed
86
+
87
+ return new InsertTypeAheadStep(config, this.isInvertStep);
88
+ }
89
+ }, {
90
+ key: "getMap",
91
+ value: function getMap() {
92
+ return new StepMap([0, 0, 0]);
93
+ }
94
+ }, {
95
+ key: "toJSON",
96
+ value: function toJSON() {
97
+ // When serialized we should create a noop Replace step
98
+ return {
99
+ stepType: 'replace',
100
+ from: 0,
101
+ to: 0
102
+ };
103
+ }
104
+ }], [{
105
+ key: "fromJSON",
106
+ value: function fromJSON() {
107
+ // This is a "local custom step" once serialized
108
+ // we need to transform it in a no-operation action
109
+ return new ReplaceStep(0, 0, Slice.empty);
110
+ }
111
+ }]);
112
+
113
+ return InsertTypeAheadStep;
114
+ }(Step);
115
+ /** Register this step with Prosemirror */
116
+
117
+ Step.jsonID(insertTypeAheadStepType, InsertTypeAheadStep);
@@ -0,0 +1,6 @@
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';
@@ -0,0 +1,160 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
+ import * as namedColors from 'css-color-names'; // eslint-disable-line import/extensions
3
+
4
+ /**
5
+ * We're avoding importing these colors from @atlaskit/theme since we
6
+ * do not want to have react as a dependency of this package.
7
+ * TODO: Refactor this once tokenization by Core team is ready
8
+ * https://product-fabric.atlassian.net/browse/CS-908
9
+ */
10
+
11
+ export var R50 = '#FFEBE6';
12
+ export var R75 = '#FFBDAD';
13
+ export var R100 = '#FF8F73';
14
+ export var R300 = '#FF5630';
15
+ export var R400 = '#DE350B';
16
+ export var R500 = '#BF2600';
17
+ export var Y50 = '#FFFAE6';
18
+ export var Y75 = '#FFF0B3';
19
+ export var Y200 = '#FFC400';
20
+ export var Y400 = '#FF991F';
21
+ export var Y500 = '#FF8B00';
22
+ export var G50 = '#E3FCEF';
23
+ export var G75 = '#ABF5D1';
24
+ export var G200 = '#57D9A3';
25
+ export var G300 = '#36B37E';
26
+ export var G400 = '#00875A';
27
+ export var G500 = '#006644';
28
+ export var B50 = '#DEEBFF';
29
+ export var B75 = '#B3D4FF';
30
+ export var B100 = '#4C9AFF';
31
+ export var B400 = '#0052CC';
32
+ export var B500 = '#0747A6';
33
+ export var N0 = '#FFFFFF';
34
+ export var N20 = '#F4F5F7';
35
+ export var N30 = '#EBECF0';
36
+ export var N40 = '#DFE1E6';
37
+ export var N50 = '#C1C7D0';
38
+ export var N60 = '#B3BAC5';
39
+ export var N80 = '#97A0AF';
40
+ export var N90 = '#8993A4';
41
+ export var N200 = '#6B778C';
42
+ export var N300 = '#5E6C84';
43
+ export var N500 = '#42526E';
44
+ export var N800 = '#172B4D';
45
+ export var P50 = '#EAE6FF';
46
+ export var P75 = '#C0B6F2';
47
+ export var P100 = '#998DD9';
48
+ export var P300 = '#6554C0';
49
+ export var P400 = '#5243AA';
50
+ export var P500 = '#403294';
51
+ export var T50 = '#E6FCFF';
52
+ export var T75 = '#B3F5FF';
53
+ export var T100 = '#79E2F2';
54
+ export var T300 = '#00B8D9';
55
+ export var T500 = '#008DA6';
56
+ /**
57
+ * @return String with HEX-coded color
58
+ */
59
+
60
+ export function normalizeHexColor(color, defaultColor) {
61
+ if (!color) {
62
+ return null;
63
+ } // Normalize to hex
64
+
65
+
66
+ color = color.trim().toLowerCase();
67
+
68
+ if (isHex(color)) {
69
+ // Normalize 3-hex to 6-hex colours
70
+ if (color.length === 4) {
71
+ color = color.split('').map(function (c) {
72
+ return c === '#' ? '#' : "".concat(c).concat(c);
73
+ }).join('');
74
+ }
75
+ } else if (isRgb(color)) {
76
+ return rgbToHex(color);
77
+ } else {
78
+ // http://dev.w3.org/csswg/css-color/#named-colors
79
+ if (color === 'default') {
80
+ return null;
81
+ } else if (namedColors.default && namedColors.default[color]) {
82
+ color = namedColors.default[color];
83
+ } else if (namedColors && namedColors[color]) {
84
+ color = namedColors[color];
85
+ } else {
86
+ return null;
87
+ }
88
+ }
89
+
90
+ if (color === defaultColor) {
91
+ return null;
92
+ }
93
+
94
+ return color;
95
+ }
96
+ /**
97
+ * Converts hex color format to rgb.
98
+ * Works well with full hex color format and shortcut as well.
99
+ *
100
+ * @param hex - hex color string (#xxx, or #xxxxxx)
101
+ */
102
+
103
+ export function hexToRgb(color) {
104
+ if (!isHex(color)) {
105
+ return null;
106
+ }
107
+
108
+ var colorBits = color.substring(1).split('');
109
+
110
+ if (colorBits.length === 3) {
111
+ colorBits = [colorBits[0], colorBits[0], colorBits[1], colorBits[1], colorBits[2], colorBits[2]];
112
+ }
113
+
114
+ var rgb = Number("0x".concat(colorBits.join(''))); // eslint-disable-next-line no-bitwise
115
+
116
+ return "rgb(".concat(rgb >> 16 & 255, ",").concat(rgb >> 8 & 255, ",").concat(rgb & 255, ")");
117
+ }
118
+ /**
119
+ * Converts hex color format to rgba.
120
+ *
121
+ * @param hex - hex color string (#xxx, or #xxxxxx)
122
+ */
123
+
124
+ export function hexToRgba(rawColor, alpha) {
125
+ var color = normalizeHexColor(rawColor);
126
+
127
+ if (!color) {
128
+ return null;
129
+ }
130
+
131
+ var hex2rgb = function hex2rgb(color) {
132
+ return color.match(/[a-z0-9]{2}/gi).map(function (hex) {
133
+ return parseInt(hex, 16);
134
+ });
135
+ };
136
+
137
+ return "rgba(".concat(hex2rgb(color).concat(alpha).join(','), ")");
138
+ }
139
+ export function rgbToHex(value) {
140
+ var matches = value.match(/(0?\.?\d{1,3})%?\b/g);
141
+
142
+ if (matches && matches.length >= 3) {
143
+ var _matches$map = matches.map(Number),
144
+ _matches$map2 = _slicedToArray(_matches$map, 3),
145
+ red = _matches$map2[0],
146
+ green = _matches$map2[1],
147
+ blue = _matches$map2[2];
148
+
149
+ return '#' + (blue | green << 8 | red << 16 | 1 << 24).toString(16).slice(1) // eslint-disable-line no-bitwise
150
+ ;
151
+ }
152
+
153
+ return null;
154
+ }
155
+ export function isRgb(color) {
156
+ return /rgba?\(/.test(color);
157
+ }
158
+ export function isHex(color) {
159
+ return /^#([A-Fa-f0-9]{3}){1,2}$/.test(color);
160
+ }
@@ -0,0 +1,85 @@
1
+ // Default emoji id for Confluence glyphs that has no match to Fabric Emoji
2
+ var DEFAULT_EMOJI_ID = '2b50'; // Default ac:name for emoticons as a fallback is `blue-star`
3
+
4
+ var DEFAULT_EMOJI_ACNAME = 'blue-star'; // ac:hipchat-emoticon prefix when converting to Emoji ID
5
+
6
+ var HC_EMOTICON_PREFIX = 'atlassian-';
7
+ /**
8
+ * Confluence glyphs ac:name of <ac:emoticon /> map to new emojis
9
+ * {
10
+ * [ac:name] : ['emoji-id', 'emoji-shortName', 'emoji-fallback']
11
+ * ...
12
+ * }
13
+ * Glyphs that do not map to Fabric Emoji
14
+ * will be mapped to Emoji Id '2b50' (:star:) with preserving ac:name as shortName attribute;
15
+ */
16
+
17
+ var acNameToEmojiMap = {
18
+ smile: ['1f642', ':slight_smile:', "\uD83D\uDE42"],
19
+ sad: ['1f641', ':slight_frown:', "\uD83D\uDE41"],
20
+ cheeky: ['1f61b', ':stuck_out_tongue:', "\uD83D\uDE1B"],
21
+ laugh: ['1f600', ':grinning:', "\uD83D\uDE00"],
22
+ wink: ['1f609', ':wink:', "\uD83D\uDE09"],
23
+ information: ['2139', ':information_source:', "\u2139"],
24
+ tick: ['2705', ':white_check_mark:', "\u2705"],
25
+ cross: ['274c', ':x:', "\u274C"],
26
+ warning: ['26a0', ':warning:', "\u26A0"],
27
+ plus: ['2795', ':heavy_plus_sign:', "\u2795"],
28
+ minus: ['2796', ':heavy_minus_sign:', "\u2796"],
29
+ question: ['2753', ':question:', "?"],
30
+ 'thumbs-up': ['1f44d', ':thumbsup:', "\uD83D\uDC4D"],
31
+ 'thumbs-down': ['1f44e', ':thumbsdown:', "\uD83D\uDC4E"],
32
+ 'light-on': ['1f4a1', ':bulb:', "\uD83D\uDCA1"],
33
+ 'yellow-star': ['2b50', ':star:', "\uD83D\uDC9B"],
34
+ 'light-off': ['1f6ab', ':no_entry_sign:', "\uD83D\uDEAB"],
35
+ 'red-star': ['2764', ':heart:', "\u2764\uFE0F"],
36
+ 'green-star': ['1f49a', ':green_heart:', "\uD83D\uDC9A"],
37
+ 'blue-star': ['1f499', ':blue_heart:', "\uD83D\uDC99"],
38
+ heart: ['2764', ':heart:', "\u2764\uFE0F"],
39
+ 'broken-heart': ['1f494', ':broken_heart:', "\uD83D\uDC94"]
40
+ };
41
+ export function acNameToEmoji(acName) {
42
+ var emojiData = acNameToEmojiMap[acName];
43
+ return emojiData ? {
44
+ id: emojiData[0],
45
+ shortName: emojiData[1],
46
+ text: emojiData[2]
47
+ } : {
48
+ id: DEFAULT_EMOJI_ID,
49
+ shortName: ":".concat(acName, ":"),
50
+ text: ''
51
+ };
52
+ }
53
+ export function emojiIdToAcName(emojiId) {
54
+ var filterEmojis = function filterEmojis(acName) {
55
+ return acNameToEmojiMap[acName] ? acNameToEmojiMap[acName][0] === emojiId : false;
56
+ };
57
+
58
+ return Object.keys(acNameToEmojiMap).filter(filterEmojis)[0];
59
+ }
60
+ export function acShortcutToEmoji(hipchatEmoticonShortName) {
61
+ return {
62
+ id: "".concat(HC_EMOTICON_PREFIX).concat(hipchatEmoticonShortName),
63
+ shortName: ":".concat(hipchatEmoticonShortName, ":"),
64
+ text: ''
65
+ };
66
+ }
67
+
68
+ function getAcNameFromShortName(shortName) {
69
+ return shortName.slice(shortName[0] === ':' ? 1 : 0, shortName[shortName.length - 1] === ':' ? -1 : shortName.length);
70
+ }
71
+
72
+ export function getEmojiAcName(_ref) {
73
+ var id = _ref.id,
74
+ shortName = _ref.shortName;
75
+
76
+ if (DEFAULT_EMOJI_ID === id) {
77
+ var possibleName = getAcNameFromShortName(shortName);
78
+
79
+ if (possibleName in acNameToEmojiMap) {
80
+ return possibleName;
81
+ }
82
+ }
83
+
84
+ return emojiIdToAcName(id) || DEFAULT_EMOJI_ACNAME;
85
+ }