@atlaskit/adf-schema 51.5.0 → 51.5.2

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 (583) hide show
  1. package/CHANGELOG.md +763 -424
  2. package/README.md +5 -0
  3. package/codemods/23.0.0-move-bitbucket-schema-to-own-entry-points.ts +1 -3
  4. package/codemods/23.0.0-move-confluence-schema-to-own-entry-points.ts +1 -3
  5. package/codemods/migrates/update-bitbucket-schema-entry-points.ts +5 -5
  6. package/codemods/migrates/update-confluence-schema-entry-points.ts +10 -10
  7. package/codemods/migrates/update-default-schema-entry-points.ts +15 -15
  8. package/codemods/migrates/update-jira-schema-entry-points.ts +60 -60
  9. package/dist/cjs/next-schema/groups/nonNestableBlockContentGroup.js +1 -1
  10. package/dist/cjs/next-schema/marks/link.js +1 -1
  11. package/dist/cjs/next-schema/nodes/bodiedSyncBlock.js +1 -1
  12. package/dist/cjs/schema/bitbucket-schema.js +1 -0
  13. package/dist/cjs/schema/confluence-schema.js +2 -0
  14. package/dist/cjs/schema/create-schema.js +0 -2
  15. package/dist/cjs/schema/createPMSpecFactory.js +2 -0
  16. package/dist/cjs/schema/inline-nodes.js +3 -0
  17. package/dist/cjs/schema/jira-schema.js +2 -0
  18. package/dist/cjs/schema/marks/annotation.js +6 -5
  19. package/dist/cjs/schema/marks/background-color.js +2 -0
  20. package/dist/cjs/schema/marks/border.js +1 -0
  21. package/dist/cjs/schema/marks/breakout.js +2 -0
  22. package/dist/cjs/schema/marks/indentation.js +1 -0
  23. package/dist/cjs/schema/marks/link.js +4 -0
  24. package/dist/cjs/schema/marks/strong.js +5 -1
  25. package/dist/cjs/schema/marks/text-color.js +2 -0
  26. package/dist/cjs/schema/nodes/block-card.js +4 -1
  27. package/dist/cjs/schema/nodes/bodied-extension.js +1 -0
  28. package/dist/cjs/schema/nodes/bodied-sync-block.js +1 -0
  29. package/dist/cjs/schema/nodes/caption.js +4 -2
  30. package/dist/cjs/schema/nodes/code-block.js +33 -8
  31. package/dist/cjs/schema/nodes/confluence-jira-issue.js +1 -0
  32. package/dist/cjs/schema/nodes/confluence-unsupported-block.js +1 -0
  33. package/dist/cjs/schema/nodes/confluence-unsupported-inline.js +1 -0
  34. package/dist/cjs/schema/nodes/date.js +2 -0
  35. package/dist/cjs/schema/nodes/decision-item.js +1 -0
  36. package/dist/cjs/schema/nodes/embed-card.js +18 -4
  37. package/dist/cjs/schema/nodes/emoji.js +20 -0
  38. package/dist/cjs/schema/nodes/expand.js +1 -0
  39. package/dist/cjs/schema/nodes/extension.js +1 -0
  40. package/dist/cjs/schema/nodes/heading.js +3 -2
  41. package/dist/cjs/schema/nodes/image.js +1 -0
  42. package/dist/cjs/schema/nodes/inline-extension.js +1 -0
  43. package/dist/cjs/schema/nodes/layout-column.js +6 -2
  44. package/dist/cjs/schema/nodes/media-group.js +1 -1
  45. package/dist/cjs/schema/nodes/media-single.js +1 -0
  46. package/dist/cjs/schema/nodes/media.js +25 -16
  47. package/dist/cjs/schema/nodes/mention.js +5 -0
  48. package/dist/cjs/schema/nodes/nested-expand.js +2 -1
  49. package/dist/cjs/schema/nodes/ordered-list.js +3 -0
  50. package/dist/cjs/schema/nodes/panel.js +6 -0
  51. package/dist/cjs/schema/nodes/paragraph.js +1 -0
  52. package/dist/cjs/schema/nodes/placeholder.js +6 -2
  53. package/dist/cjs/schema/nodes/status.js +3 -0
  54. package/dist/cjs/schema/nodes/sync-block.js +1 -0
  55. package/dist/cjs/schema/nodes/tableNodes.js +32 -15
  56. package/dist/cjs/schema/nodes/task-item.js +2 -0
  57. package/dist/cjs/schema/nodes/unsupported-block.js +1 -0
  58. package/dist/cjs/schema/nodes/unsupported-inline.js +1 -0
  59. package/dist/cjs/schema/sanitizeNodes.js +11 -6
  60. package/dist/cjs/steps/analytics.js +1 -1
  61. package/dist/cjs/steps/batch-attrs-step.js +1 -1
  62. package/dist/cjs/utils/colors.js +21 -8
  63. package/dist/cjs/utils/editor-palette.js +7 -0
  64. package/dist/cjs/utils/lch-color-inversion.js +11 -5
  65. package/dist/cjs/utils/url.js +9 -6
  66. package/dist/cjs/utils/uuid.js +7 -7
  67. package/dist/cjs/validator-schema/generated/validatorSpec.js +1 -1
  68. package/dist/es2019/index.js +4 -1
  69. package/dist/es2019/json-schema/index.js +1 -0
  70. package/dist/es2019/next-schema/groups/nonNestableBlockContentGroup.js +1 -1
  71. package/dist/es2019/next-schema/index.js +1 -0
  72. package/dist/es2019/next-schema/marks/alignmentAndIndentation.js +1 -2
  73. package/dist/es2019/next-schema/marks/color.js +1 -2
  74. package/dist/es2019/next-schema/marks/link.js +1 -1
  75. package/dist/es2019/next-schema/nodes/bodiedSyncBlock.js +1 -1
  76. package/dist/es2019/schema/bitbucket-schema.js +1 -0
  77. package/dist/es2019/schema/confluence-schema.js +2 -0
  78. package/dist/es2019/schema/create-schema.js +0 -2
  79. package/dist/es2019/schema/createPMSpecFactory.js +2 -0
  80. package/dist/es2019/schema/index.js +4 -1
  81. package/dist/es2019/schema/inline-nodes.js +3 -0
  82. package/dist/es2019/schema/jira-schema.js +1 -0
  83. package/dist/es2019/schema/marks/annotation.js +7 -5
  84. package/dist/es2019/schema/marks/background-color.js +3 -1
  85. package/dist/es2019/schema/marks/border.js +1 -0
  86. package/dist/es2019/schema/marks/breakout.js +2 -0
  87. package/dist/es2019/schema/marks/indentation.js +1 -0
  88. package/dist/es2019/schema/marks/index.js +1 -0
  89. package/dist/es2019/schema/marks/link.js +4 -0
  90. package/dist/es2019/schema/marks/strong.js +5 -1
  91. package/dist/es2019/schema/marks/text-color.js +3 -1
  92. package/dist/es2019/schema/nodes/block-card.js +4 -1
  93. package/dist/es2019/schema/nodes/blockquote.js +1 -2
  94. package/dist/es2019/schema/nodes/bodied-extension.js +1 -0
  95. package/dist/es2019/schema/nodes/bodied-sync-block.js +1 -0
  96. package/dist/es2019/schema/nodes/caption.js +4 -2
  97. package/dist/es2019/schema/nodes/code-block.js +34 -9
  98. package/dist/es2019/schema/nodes/confluence-jira-issue.js +1 -0
  99. package/dist/es2019/schema/nodes/confluence-unsupported-block.js +1 -0
  100. package/dist/es2019/schema/nodes/confluence-unsupported-inline.js +1 -0
  101. package/dist/es2019/schema/nodes/date.js +2 -0
  102. package/dist/es2019/schema/nodes/decision-item.js +1 -0
  103. package/dist/es2019/schema/nodes/embed-card.js +18 -4
  104. package/dist/es2019/schema/nodes/emoji.js +20 -0
  105. package/dist/es2019/schema/nodes/expand.js +1 -0
  106. package/dist/es2019/schema/nodes/extension.js +1 -0
  107. package/dist/es2019/schema/nodes/heading.js +6 -7
  108. package/dist/es2019/schema/nodes/image.js +1 -0
  109. package/dist/es2019/schema/nodes/index.js +1 -0
  110. package/dist/es2019/schema/nodes/inline-extension.js +1 -0
  111. package/dist/es2019/schema/nodes/layout-column.js +6 -2
  112. package/dist/es2019/schema/nodes/layout-section.js +1 -2
  113. package/dist/es2019/schema/nodes/media-group.js +1 -1
  114. package/dist/es2019/schema/nodes/media-single.js +1 -0
  115. package/dist/es2019/schema/nodes/media.js +22 -15
  116. package/dist/es2019/schema/nodes/mention.js +5 -0
  117. package/dist/es2019/schema/nodes/multi-bodied-extension.js +1 -2
  118. package/dist/es2019/schema/nodes/nested-expand.js +2 -1
  119. package/dist/es2019/schema/nodes/ordered-list.js +3 -0
  120. package/dist/es2019/schema/nodes/panel.js +6 -0
  121. package/dist/es2019/schema/nodes/paragraph.js +1 -0
  122. package/dist/es2019/schema/nodes/placeholder.js +6 -2
  123. package/dist/es2019/schema/nodes/status.js +4 -1
  124. package/dist/es2019/schema/nodes/sync-block.js +1 -0
  125. package/dist/es2019/schema/nodes/tableNodes.js +22 -8
  126. package/dist/es2019/schema/nodes/task-item.js +2 -0
  127. package/dist/es2019/schema/nodes/unsupported-block.js +1 -0
  128. package/dist/es2019/schema/nodes/unsupported-inline.js +1 -0
  129. package/dist/es2019/schema/sanitizeNodes.js +11 -6
  130. package/dist/es2019/steps/analytics.js +1 -1
  131. package/dist/es2019/steps/batch-attrs-step.js +1 -1
  132. package/dist/es2019/steps/set-attrs.js +5 -5
  133. package/dist/es2019/steps.js +1 -0
  134. package/dist/es2019/utils/colors.js +23 -9
  135. package/dist/es2019/utils/editor-palette.js +6 -0
  136. package/dist/es2019/utils/index.js +1 -0
  137. package/dist/es2019/utils/lch-color-inversion.js +8 -3
  138. package/dist/es2019/utils/url.js +9 -6
  139. package/dist/es2019/utils/uuid.js +3 -4
  140. package/dist/es2019/validator-schema/generated/validatorSpec.js +1 -1
  141. package/dist/esm/index.js +4 -1
  142. package/dist/esm/json-schema/index.js +1 -0
  143. package/dist/esm/next-schema/groups/nonNestableBlockContentGroup.js +1 -1
  144. package/dist/esm/next-schema/index.js +1 -0
  145. package/dist/esm/next-schema/marks/alignmentAndIndentation.js +1 -2
  146. package/dist/esm/next-schema/marks/color.js +1 -2
  147. package/dist/esm/next-schema/marks/link.js +1 -1
  148. package/dist/esm/next-schema/nodes/bodiedSyncBlock.js +1 -1
  149. package/dist/esm/schema/bitbucket-schema.js +1 -0
  150. package/dist/esm/schema/confluence-schema.js +2 -0
  151. package/dist/esm/schema/create-schema.js +0 -2
  152. package/dist/esm/schema/createPMSpecFactory.js +2 -0
  153. package/dist/esm/schema/index.js +4 -1
  154. package/dist/esm/schema/inline-nodes.js +3 -0
  155. package/dist/esm/schema/jira-schema.js +1 -0
  156. package/dist/esm/schema/marks/annotation.js +6 -5
  157. package/dist/esm/schema/marks/background-color.js +2 -0
  158. package/dist/esm/schema/marks/border.js +1 -0
  159. package/dist/esm/schema/marks/breakout.js +2 -0
  160. package/dist/esm/schema/marks/indentation.js +1 -0
  161. package/dist/esm/schema/marks/index.js +1 -0
  162. package/dist/esm/schema/marks/link.js +4 -0
  163. package/dist/esm/schema/marks/strong.js +5 -1
  164. package/dist/esm/schema/marks/text-color.js +2 -0
  165. package/dist/esm/schema/nodes/block-card.js +4 -1
  166. package/dist/esm/schema/nodes/blockquote.js +1 -2
  167. package/dist/esm/schema/nodes/bodied-extension.js +1 -0
  168. package/dist/esm/schema/nodes/bodied-sync-block.js +1 -0
  169. package/dist/esm/schema/nodes/caption.js +4 -2
  170. package/dist/esm/schema/nodes/code-block.js +33 -8
  171. package/dist/esm/schema/nodes/confluence-jira-issue.js +1 -0
  172. package/dist/esm/schema/nodes/confluence-unsupported-block.js +1 -0
  173. package/dist/esm/schema/nodes/confluence-unsupported-inline.js +1 -0
  174. package/dist/esm/schema/nodes/date.js +2 -0
  175. package/dist/esm/schema/nodes/decision-item.js +1 -0
  176. package/dist/esm/schema/nodes/embed-card.js +18 -4
  177. package/dist/esm/schema/nodes/emoji.js +20 -0
  178. package/dist/esm/schema/nodes/expand.js +1 -0
  179. package/dist/esm/schema/nodes/extension.js +1 -0
  180. package/dist/esm/schema/nodes/heading.js +3 -2
  181. package/dist/esm/schema/nodes/image.js +1 -0
  182. package/dist/esm/schema/nodes/index.js +1 -0
  183. package/dist/esm/schema/nodes/inline-extension.js +1 -0
  184. package/dist/esm/schema/nodes/layout-column.js +6 -2
  185. package/dist/esm/schema/nodes/layout-section.js +1 -2
  186. package/dist/esm/schema/nodes/media-group.js +1 -1
  187. package/dist/esm/schema/nodes/media-single.js +1 -0
  188. package/dist/esm/schema/nodes/media.js +26 -18
  189. package/dist/esm/schema/nodes/mention.js +5 -0
  190. package/dist/esm/schema/nodes/multi-bodied-extension.js +1 -2
  191. package/dist/esm/schema/nodes/nested-expand.js +2 -1
  192. package/dist/esm/schema/nodes/ordered-list.js +3 -0
  193. package/dist/esm/schema/nodes/panel.js +6 -0
  194. package/dist/esm/schema/nodes/paragraph.js +1 -0
  195. package/dist/esm/schema/nodes/placeholder.js +6 -2
  196. package/dist/esm/schema/nodes/status.js +3 -0
  197. package/dist/esm/schema/nodes/sync-block.js +1 -0
  198. package/dist/esm/schema/nodes/tableNodes.js +32 -15
  199. package/dist/esm/schema/nodes/task-item.js +2 -0
  200. package/dist/esm/schema/nodes/unsupported-block.js +1 -0
  201. package/dist/esm/schema/nodes/unsupported-inline.js +1 -0
  202. package/dist/esm/schema/sanitizeNodes.js +11 -6
  203. package/dist/esm/steps/analytics.js +1 -1
  204. package/dist/esm/steps/batch-attrs-step.js +1 -1
  205. package/dist/esm/steps.js +1 -0
  206. package/dist/esm/utils/colors.js +20 -8
  207. package/dist/esm/utils/editor-palette.js +6 -0
  208. package/dist/esm/utils/index.js +1 -0
  209. package/dist/esm/utils/lch-color-inversion.js +11 -5
  210. package/dist/esm/utils/url.js +9 -6
  211. package/dist/esm/utils/uuid.js +7 -7
  212. package/dist/esm/validator-schema/generated/validatorSpec.js +1 -1
  213. package/dist/types/next-schema/full-schema.adf.d.ts +1 -1
  214. package/dist/types/next-schema/generated/markTypes.d.ts +1 -1
  215. package/dist/types/next-schema/generated/nodeTypes.d.ts +4 -4
  216. package/dist/types/next-schema/groups/blockContentGroup.d.ts +1 -1
  217. package/dist/types/next-schema/groups/blockGroup.d.ts +1 -1
  218. package/dist/types/next-schema/groups/blockRootOnlyGroup.d.ts +1 -1
  219. package/dist/types/next-schema/groups/fontStyleGroup.d.ts +1 -1
  220. package/dist/types/next-schema/groups/inlineContentGroup.d.ts +1 -1
  221. package/dist/types/next-schema/groups/inlineGroup.d.ts +1 -1
  222. package/dist/types/next-schema/groups/linkMarkGroup.d.ts +1 -1
  223. package/dist/types/next-schema/groups/nonNestableBlockContentGroup.d.ts +6 -6
  224. package/dist/types/next-schema/groups/searchQueryMarkGroup.d.ts +1 -1
  225. package/dist/types/next-schema/groups/tableCellContentPseudoGroup.d.ts +7 -67
  226. package/dist/types/next-schema/marks/alignmentAndIndentation.d.ts +2 -2
  227. package/dist/types/next-schema/marks/annotation.d.ts +2 -2
  228. package/dist/types/next-schema/marks/border.d.ts +1 -1
  229. package/dist/types/next-schema/marks/breakout.d.ts +1 -1
  230. package/dist/types/next-schema/marks/code.d.ts +1 -1
  231. package/dist/types/next-schema/marks/color.d.ts +3 -3
  232. package/dist/types/next-schema/marks/confluenceInlineComment.d.ts +1 -1
  233. package/dist/types/next-schema/marks/dataConsumer.d.ts +1 -1
  234. package/dist/types/next-schema/marks/em.d.ts +1 -1
  235. package/dist/types/next-schema/marks/fragment.d.ts +1 -1
  236. package/dist/types/next-schema/marks/link.d.ts +1 -1
  237. package/dist/types/next-schema/marks/strike.d.ts +1 -1
  238. package/dist/types/next-schema/marks/strong.d.ts +1 -1
  239. package/dist/types/next-schema/marks/subsup.d.ts +1 -1
  240. package/dist/types/next-schema/marks/typeAheadQuery.d.ts +1 -1
  241. package/dist/types/next-schema/marks/underline.d.ts +1 -1
  242. package/dist/types/next-schema/marks/unsupportedMark.d.ts +1 -1
  243. package/dist/types/next-schema/marks/unsupportedNodeAttribute.d.ts +1 -1
  244. package/dist/types/next-schema/nodes/blockCard.d.ts +1 -1
  245. package/dist/types/next-schema/nodes/blockquote.d.ts +3 -3
  246. package/dist/types/next-schema/nodes/bodiedExtension.d.ts +4 -4
  247. package/dist/types/next-schema/nodes/bodiedSyncBlock.d.ts +1 -1
  248. package/dist/types/next-schema/nodes/caption.d.ts +1 -1
  249. package/dist/types/next-schema/nodes/codeBlock.d.ts +2 -2
  250. package/dist/types/next-schema/nodes/confluenceJiraIssue.d.ts +1 -1
  251. package/dist/types/next-schema/nodes/confluenceUnsupportedBlock.d.ts +1 -1
  252. package/dist/types/next-schema/nodes/confluenceUnsupportedInline.d.ts +1 -1
  253. package/dist/types/next-schema/nodes/date.d.ts +1 -1
  254. package/dist/types/next-schema/nodes/decisionItem.d.ts +1 -1
  255. package/dist/types/next-schema/nodes/decisionList.d.ts +1 -1
  256. package/dist/types/next-schema/nodes/embedCard.d.ts +1 -1
  257. package/dist/types/next-schema/nodes/emoji.d.ts +1 -1
  258. package/dist/types/next-schema/nodes/expand.d.ts +2 -2
  259. package/dist/types/next-schema/nodes/extension.d.ts +3 -3
  260. package/dist/types/next-schema/nodes/extensionFrame.d.ts +1 -1
  261. package/dist/types/next-schema/nodes/hardBreak.d.ts +1 -1
  262. package/dist/types/next-schema/nodes/heading.d.ts +20 -20
  263. package/dist/types/next-schema/nodes/image.d.ts +1 -1
  264. package/dist/types/next-schema/nodes/inlineCard.d.ts +2 -2
  265. package/dist/types/next-schema/nodes/inlineExtension.d.ts +2 -2
  266. package/dist/types/next-schema/nodes/layoutColumn.d.ts +1 -1
  267. package/dist/types/next-schema/nodes/layoutSection.d.ts +7 -7
  268. package/dist/types/next-schema/nodes/list.d.ts +2 -2
  269. package/dist/types/next-schema/nodes/media.d.ts +1 -1
  270. package/dist/types/next-schema/nodes/mediaGroup.d.ts +1 -1
  271. package/dist/types/next-schema/nodes/mediaInline.d.ts +1 -1
  272. package/dist/types/next-schema/nodes/mediaSingle.d.ts +10 -10
  273. package/dist/types/next-schema/nodes/mention.d.ts +1 -1
  274. package/dist/types/next-schema/nodes/multiBodiedExtension.d.ts +1 -1
  275. package/dist/types/next-schema/nodes/nestedExpand.d.ts +3 -3
  276. package/dist/types/next-schema/nodes/panel.d.ts +1 -1
  277. package/dist/types/next-schema/nodes/paragraph.d.ts +13 -13
  278. package/dist/types/next-schema/nodes/placeholder.d.ts +1 -1
  279. package/dist/types/next-schema/nodes/rule.d.ts +1 -1
  280. package/dist/types/next-schema/nodes/status.d.ts +1 -1
  281. package/dist/types/next-schema/nodes/syncBlock.d.ts +1 -1
  282. package/dist/types/next-schema/nodes/tableCellContent.d.ts +1 -1
  283. package/dist/types/next-schema/nodes/tableNodes.d.ts +1 -1
  284. package/dist/types/next-schema/nodes/task.d.ts +3 -3
  285. package/dist/types/next-schema/nodes/text.d.ts +5 -5
  286. package/dist/types/next-schema/nodes/unsupportedBlock.d.ts +1 -1
  287. package/dist/types/next-schema/nodes/unsupportedInline.d.ts +1 -1
  288. package/dist/types/schema/bitbucket-schema.d.ts +1 -1
  289. package/dist/types/schema/confluence-schema.d.ts +1 -1
  290. package/dist/types/schema/create-schema.d.ts +4 -3
  291. package/dist/types/schema/createPMSpecFactory.d.ts +3 -3
  292. package/dist/types/schema/default-schema.d.ts +1 -1
  293. package/dist/types/schema/index.d.ts +1 -1
  294. package/dist/types/schema/jira-schema.d.ts +8 -8
  295. package/dist/types/schema/marks/alignment.d.ts +2 -2
  296. package/dist/types/schema/marks/annotation.d.ts +5 -5
  297. package/dist/types/schema/marks/background-color.d.ts +3 -3
  298. package/dist/types/schema/marks/border.d.ts +6 -6
  299. package/dist/types/schema/marks/breakout.d.ts +2 -2
  300. package/dist/types/schema/marks/code.d.ts +1 -1
  301. package/dist/types/schema/marks/confluence-inline-comment.d.ts +2 -2
  302. package/dist/types/schema/marks/data-consumer.d.ts +2 -2
  303. package/dist/types/schema/marks/em.d.ts +1 -1
  304. package/dist/types/schema/marks/fragment.d.ts +2 -2
  305. package/dist/types/schema/marks/indentation.d.ts +2 -2
  306. package/dist/types/schema/marks/index.d.ts +3 -3
  307. package/dist/types/schema/marks/link.d.ts +12 -12
  308. package/dist/types/schema/marks/strike.d.ts +1 -1
  309. package/dist/types/schema/marks/strong.d.ts +1 -1
  310. package/dist/types/schema/marks/subsup.d.ts +2 -2
  311. package/dist/types/schema/marks/text-color.d.ts +2 -2
  312. package/dist/types/schema/marks/type-ahead-query.d.ts +1 -1
  313. package/dist/types/schema/marks/underline.d.ts +1 -1
  314. package/dist/types/schema/marks/unsupported-mark.d.ts +1 -1
  315. package/dist/types/schema/marks/unsupported-node-attributes.d.ts +1 -1
  316. package/dist/types/schema/nodes/block-card.d.ts +6 -6
  317. package/dist/types/schema/nodes/blockquote.d.ts +10 -11
  318. package/dist/types/schema/nodes/bodied-extension.d.ts +7 -7
  319. package/dist/types/schema/nodes/bodied-sync-block.d.ts +23 -24
  320. package/dist/types/schema/nodes/caption.d.ts +12 -12
  321. package/dist/types/schema/nodes/code-block.d.ts +7 -7
  322. package/dist/types/schema/nodes/date.d.ts +3 -3
  323. package/dist/types/schema/nodes/decision-item.d.ts +6 -6
  324. package/dist/types/schema/nodes/decision-list.d.ts +5 -5
  325. package/dist/types/schema/nodes/doc.d.ts +10 -10
  326. package/dist/types/schema/nodes/embed-card.d.ts +4 -4
  327. package/dist/types/schema/nodes/emoji.d.ts +3 -3
  328. package/dist/types/schema/nodes/expand.d.ts +7 -7
  329. package/dist/types/schema/nodes/extension.d.ts +5 -5
  330. package/dist/types/schema/nodes/heading.d.ts +9 -9
  331. package/dist/types/schema/nodes/index.d.ts +6 -6
  332. package/dist/types/schema/nodes/inline-card.d.ts +3 -3
  333. package/dist/types/schema/nodes/inline-extension.d.ts +5 -5
  334. package/dist/types/schema/nodes/layout-column.d.ts +3 -3
  335. package/dist/types/schema/nodes/layout-section.d.ts +9 -9
  336. package/dist/types/schema/nodes/media-group.d.ts +2 -2
  337. package/dist/types/schema/nodes/media-inline.d.ts +6 -6
  338. package/dist/types/schema/nodes/media-single.d.ts +10 -10
  339. package/dist/types/schema/nodes/media.d.ts +27 -27
  340. package/dist/types/schema/nodes/mention.d.ts +5 -5
  341. package/dist/types/schema/nodes/multi-bodied-extension.d.ts +21 -22
  342. package/dist/types/schema/nodes/nested-expand.d.ts +14 -14
  343. package/dist/types/schema/nodes/panel.d.ts +14 -15
  344. package/dist/types/schema/nodes/paragraph.d.ts +5 -5
  345. package/dist/types/schema/nodes/rule.d.ts +1 -1
  346. package/dist/types/schema/nodes/status.d.ts +6 -6
  347. package/dist/types/schema/nodes/sync-block.d.ts +7 -7
  348. package/dist/types/schema/nodes/tableNodes.d.ts +36 -37
  349. package/dist/types/schema/nodes/task-item.d.ts +13 -13
  350. package/dist/types/schema/nodes/task-list.d.ts +5 -5
  351. package/dist/types/schema/nodes/types/block-content.d.ts +17 -18
  352. package/dist/types/schema/nodes/types/inline-content.d.ts +12 -12
  353. package/dist/types/schema/nodes/types/list.d.ts +18 -18
  354. package/dist/types/schema/nodes/types/non-nestable-block-content.d.ts +15 -16
  355. package/dist/types/schema/nodes/unknown-block.d.ts +1 -1
  356. package/dist/types/schema/sanitizeNodes.d.ts +1 -1
  357. package/dist/types/steps/analytics.d.ts +4 -3
  358. package/dist/types/steps/batch-attrs-step.d.ts +4 -4
  359. package/dist/types/steps/link-meta-step.d.ts +7 -6
  360. package/dist/types/steps/override-document-step.d.ts +4 -4
  361. package/dist/types/steps/set-attrs.d.ts +4 -3
  362. package/dist/types/steps/type-ahead.d.ts +2 -2
  363. package/dist/types/utils/colors.d.ts +1 -1
  364. package/dist/types/utils/confluence/emoji.d.ts +1 -1
  365. package/dist/types/utils/extensions.d.ts +1 -1
  366. package/dist/types/utils/index.d.ts +1 -1
  367. package/dist/types/utils/url.d.ts +3 -3
  368. package/dist/types/validator-schema/generated/validatorSpec.d.ts +12 -12
  369. package/dist/types-ts4.5/index.d.ts +8 -0
  370. package/dist/types-ts4.5/next-schema/full-schema.adf.d.ts +4 -0
  371. package/dist/types-ts4.5/next-schema/generated/markTypes.d.ts +206 -0
  372. package/dist/types-ts4.5/next-schema/generated/nodeGroupTypes.d.ts +10 -0
  373. package/dist/types-ts4.5/next-schema/generated/nodeTypes.d.ts +976 -0
  374. package/dist/types-ts4.5/next-schema/groups/blockContentGroup.d.ts +12 -0
  375. package/dist/types-ts4.5/next-schema/groups/blockGroup.d.ts +1 -0
  376. package/dist/types-ts4.5/next-schema/groups/blockRootOnlyGroup.d.ts +1 -0
  377. package/dist/types-ts4.5/next-schema/groups/fontStyleGroup.d.ts +1 -0
  378. package/dist/types-ts4.5/next-schema/groups/inlineContentGroup.d.ts +10 -0
  379. package/dist/types-ts4.5/next-schema/groups/inlineGroup.d.ts +1 -0
  380. package/dist/types-ts4.5/next-schema/groups/linkMarkGroup.d.ts +1 -0
  381. package/dist/types-ts4.5/next-schema/groups/nonNestableBlockContentGroup.d.ts +30 -0
  382. package/dist/types-ts4.5/next-schema/groups/searchQueryMarkGroup.d.ts +1 -0
  383. package/dist/types-ts4.5/next-schema/groups/tableCellContentPseudoGroup.d.ts +26 -0
  384. package/dist/types-ts4.5/next-schema/index.d.ts +3 -0
  385. package/dist/types-ts4.5/next-schema/marks/alignmentAndIndentation.d.ts +2 -0
  386. package/dist/types-ts4.5/next-schema/marks/annotation.d.ts +2 -0
  387. package/dist/types-ts4.5/next-schema/marks/border.d.ts +1 -0
  388. package/dist/types-ts4.5/next-schema/marks/breakout.d.ts +1 -0
  389. package/dist/types-ts4.5/next-schema/marks/code.d.ts +1 -0
  390. package/dist/types-ts4.5/next-schema/marks/color.d.ts +3 -0
  391. package/dist/types-ts4.5/next-schema/marks/confluenceInlineComment.d.ts +1 -0
  392. package/dist/types-ts4.5/next-schema/marks/dataConsumer.d.ts +1 -0
  393. package/dist/types-ts4.5/next-schema/marks/em.d.ts +1 -0
  394. package/dist/types-ts4.5/next-schema/marks/fragment.d.ts +1 -0
  395. package/dist/types-ts4.5/next-schema/marks/link.d.ts +1 -0
  396. package/dist/types-ts4.5/next-schema/marks/strike.d.ts +1 -0
  397. package/dist/types-ts4.5/next-schema/marks/strong.d.ts +1 -0
  398. package/dist/types-ts4.5/next-schema/marks/subsup.d.ts +1 -0
  399. package/dist/types-ts4.5/next-schema/marks/typeAheadQuery.d.ts +1 -0
  400. package/dist/types-ts4.5/next-schema/marks/underline.d.ts +1 -0
  401. package/dist/types-ts4.5/next-schema/marks/unsupportedMark.d.ts +1 -0
  402. package/dist/types-ts4.5/next-schema/marks/unsupportedNodeAttribute.d.ts +1 -0
  403. package/dist/types-ts4.5/next-schema/nodes/blockCard.d.ts +3 -0
  404. package/dist/types-ts4.5/next-schema/nodes/blockquote.d.ts +14 -0
  405. package/dist/types-ts4.5/next-schema/nodes/bodiedExtension.d.ts +8 -0
  406. package/dist/types-ts4.5/next-schema/nodes/bodiedSyncBlock.d.ts +3 -0
  407. package/dist/types-ts4.5/next-schema/nodes/caption.d.ts +3 -0
  408. package/dist/types-ts4.5/next-schema/nodes/codeBlock.d.ts +8 -0
  409. package/dist/types-ts4.5/next-schema/nodes/confluenceJiraIssue.d.ts +3 -0
  410. package/dist/types-ts4.5/next-schema/nodes/confluenceUnsupportedBlock.d.ts +3 -0
  411. package/dist/types-ts4.5/next-schema/nodes/confluenceUnsupportedInline.d.ts +3 -0
  412. package/dist/types-ts4.5/next-schema/nodes/date.d.ts +3 -0
  413. package/dist/types-ts4.5/next-schema/nodes/decisionItem.d.ts +3 -0
  414. package/dist/types-ts4.5/next-schema/nodes/decisionList.d.ts +3 -0
  415. package/dist/types-ts4.5/next-schema/nodes/embedCard.d.ts +3 -0
  416. package/dist/types-ts4.5/next-schema/nodes/emoji.d.ts +3 -0
  417. package/dist/types-ts4.5/next-schema/nodes/expand.d.ts +8 -0
  418. package/dist/types-ts4.5/next-schema/nodes/extension.d.ts +7 -0
  419. package/dist/types-ts4.5/next-schema/nodes/extensionFrame.d.ts +3 -0
  420. package/dist/types-ts4.5/next-schema/nodes/hardBreak.d.ts +3 -0
  421. package/dist/types-ts4.5/next-schema/nodes/heading.d.ts +38 -0
  422. package/dist/types-ts4.5/next-schema/nodes/image.d.ts +3 -0
  423. package/dist/types-ts4.5/next-schema/nodes/inlineCard.d.ts +6 -0
  424. package/dist/types-ts4.5/next-schema/nodes/inlineExtension.d.ts +6 -0
  425. package/dist/types-ts4.5/next-schema/nodes/layoutColumn.d.ts +3 -0
  426. package/dist/types-ts4.5/next-schema/nodes/layoutSection.d.ts +25 -0
  427. package/dist/types-ts4.5/next-schema/nodes/list.d.ts +6 -0
  428. package/dist/types-ts4.5/next-schema/nodes/media.d.ts +3 -0
  429. package/dist/types-ts4.5/next-schema/nodes/mediaGroup.d.ts +3 -0
  430. package/dist/types-ts4.5/next-schema/nodes/mediaInline.d.ts +3 -0
  431. package/dist/types-ts4.5/next-schema/nodes/mediaSingle.d.ts +57 -0
  432. package/dist/types-ts4.5/next-schema/nodes/mention.d.ts +3 -0
  433. package/dist/types-ts4.5/next-schema/nodes/multiBodiedExtension.d.ts +3 -0
  434. package/dist/types-ts4.5/next-schema/nodes/nestedExpand.d.ts +11 -0
  435. package/dist/types-ts4.5/next-schema/nodes/panel.d.ts +3 -0
  436. package/dist/types-ts4.5/next-schema/nodes/paragraph.d.ts +24 -0
  437. package/dist/types-ts4.5/next-schema/nodes/placeholder.d.ts +3 -0
  438. package/dist/types-ts4.5/next-schema/nodes/rule.d.ts +3 -0
  439. package/dist/types-ts4.5/next-schema/nodes/status.d.ts +3 -0
  440. package/dist/types-ts4.5/next-schema/nodes/syncBlock.d.ts +3 -0
  441. package/dist/types-ts4.5/next-schema/nodes/tableCellContent.d.ts +3 -0
  442. package/dist/types-ts4.5/next-schema/nodes/tableNodes.d.ts +4 -0
  443. package/dist/types-ts4.5/next-schema/nodes/task.d.ts +9 -0
  444. package/dist/types-ts4.5/next-schema/nodes/text.d.ts +25 -0
  445. package/dist/types-ts4.5/next-schema/nodes/unsupportedBlock.d.ts +3 -0
  446. package/dist/types-ts4.5/next-schema/nodes/unsupportedInline.d.ts +3 -0
  447. package/dist/types-ts4.5/schema/bitbucket-schema.d.ts +5 -0
  448. package/dist/types-ts4.5/schema/confluence-schema.d.ts +9 -0
  449. package/dist/types-ts4.5/schema/create-schema.d.ts +27 -0
  450. package/dist/types-ts4.5/schema/createPMSpecFactory.d.ts +33 -0
  451. package/dist/types-ts4.5/schema/default-schema.d.ts +7 -0
  452. package/dist/types-ts4.5/schema/groups.d.ts +6 -0
  453. package/dist/types-ts4.5/schema/index.d.ts +12 -0
  454. package/dist/types-ts4.5/schema/inline-nodes.d.ts +1 -0
  455. package/dist/types-ts4.5/schema/jira-schema.d.ts +65 -0
  456. package/dist/types-ts4.5/schema/marks/alignment.d.ts +16 -0
  457. package/dist/types-ts4.5/schema/marks/annotation.d.ts +32 -0
  458. package/dist/types-ts4.5/schema/marks/background-color.d.ts +20 -0
  459. package/dist/types-ts4.5/schema/marks/border.d.ts +23 -0
  460. package/dist/types-ts4.5/schema/marks/breakout.d.ts +12 -0
  461. package/dist/types-ts4.5/schema/marks/code.d.ts +8 -0
  462. package/dist/types-ts4.5/schema/marks/confluence-inline-comment.d.ts +12 -0
  463. package/dist/types-ts4.5/schema/marks/data-consumer.d.ts +46 -0
  464. package/dist/types-ts4.5/schema/marks/em.d.ts +8 -0
  465. package/dist/types-ts4.5/schema/marks/fragment.d.ts +29 -0
  466. package/dist/types-ts4.5/schema/marks/indentation.d.ts +16 -0
  467. package/dist/types-ts4.5/schema/marks/index.d.ts +36 -0
  468. package/dist/types-ts4.5/schema/marks/link.d.ts +39 -0
  469. package/dist/types-ts4.5/schema/marks/strike.d.ts +8 -0
  470. package/dist/types-ts4.5/schema/marks/strong.d.ts +8 -0
  471. package/dist/types-ts4.5/schema/marks/subsup.d.ts +15 -0
  472. package/dist/types-ts4.5/schema/marks/text-color.d.ts +26 -0
  473. package/dist/types-ts4.5/schema/marks/type-ahead-query.d.ts +2 -0
  474. package/dist/types-ts4.5/schema/marks/underline.d.ts +8 -0
  475. package/dist/types-ts4.5/schema/marks/unsupported-mark.d.ts +2 -0
  476. package/dist/types-ts4.5/schema/marks/unsupported-node-attributes.d.ts +2 -0
  477. package/dist/types-ts4.5/schema/nodes/block-card.d.ts +44 -0
  478. package/dist/types-ts4.5/schema/nodes/blockquote.d.ts +27 -0
  479. package/dist/types-ts4.5/schema/nodes/bodied-extension.d.ts +23 -0
  480. package/dist/types-ts4.5/schema/nodes/bodied-sync-block.d.ts +43 -0
  481. package/dist/types-ts4.5/schema/nodes/bullet-list.d.ts +3 -0
  482. package/dist/types-ts4.5/schema/nodes/caption.d.ts +24 -0
  483. package/dist/types-ts4.5/schema/nodes/code-block.d.ts +31 -0
  484. package/dist/types-ts4.5/schema/nodes/confluence-jira-issue.d.ts +1 -0
  485. package/dist/types-ts4.5/schema/nodes/confluence-unsupported-block.d.ts +1 -0
  486. package/dist/types-ts4.5/schema/nodes/confluence-unsupported-inline.d.ts +1 -0
  487. package/dist/types-ts4.5/schema/nodes/date.d.ts +20 -0
  488. package/dist/types-ts4.5/schema/nodes/decision-item.d.ts +16 -0
  489. package/dist/types-ts4.5/schema/nodes/decision-list.d.ts +17 -0
  490. package/dist/types-ts4.5/schema/nodes/doc.d.ts +20 -0
  491. package/dist/types-ts4.5/schema/nodes/embed-card.d.ts +19 -0
  492. package/dist/types-ts4.5/schema/nodes/emoji.d.ts +20 -0
  493. package/dist/types-ts4.5/schema/nodes/expand.d.ts +34 -0
  494. package/dist/types-ts4.5/schema/nodes/extension.d.ts +17 -0
  495. package/dist/types-ts4.5/schema/nodes/hard-break.d.ts +10 -0
  496. package/dist/types-ts4.5/schema/nodes/heading.d.ts +39 -0
  497. package/dist/types-ts4.5/schema/nodes/image.d.ts +1 -0
  498. package/dist/types-ts4.5/schema/nodes/index.d.ts +98 -0
  499. package/dist/types-ts4.5/schema/nodes/inline-card.d.ts +15 -0
  500. package/dist/types-ts4.5/schema/nodes/inline-extension.d.ts +17 -0
  501. package/dist/types-ts4.5/schema/nodes/layout-column.d.ts +22 -0
  502. package/dist/types-ts4.5/schema/nodes/layout-section.d.ts +49 -0
  503. package/dist/types-ts4.5/schema/nodes/list-item.d.ts +12 -0
  504. package/dist/types-ts4.5/schema/nodes/media-group.d.ts +13 -0
  505. package/dist/types-ts4.5/schema/nodes/media-inline.d.ts +20 -0
  506. package/dist/types-ts4.5/schema/nodes/media-single.d.ts +69 -0
  507. package/dist/types-ts4.5/schema/nodes/media.d.ts +71 -0
  508. package/dist/types-ts4.5/schema/nodes/mention.d.ts +30 -0
  509. package/dist/types-ts4.5/schema/nodes/multi-bodied-extension.d.ts +50 -0
  510. package/dist/types-ts4.5/schema/nodes/nested-expand.d.ts +40 -0
  511. package/dist/types-ts4.5/schema/nodes/ordered-list.d.ts +5 -0
  512. package/dist/types-ts4.5/schema/nodes/panel.d.ts +50 -0
  513. package/dist/types-ts4.5/schema/nodes/paragraph.d.ts +43 -0
  514. package/dist/types-ts4.5/schema/nodes/placeholder.d.ts +12 -0
  515. package/dist/types-ts4.5/schema/nodes/rule.d.ts +11 -0
  516. package/dist/types-ts4.5/schema/nodes/status.d.ts +24 -0
  517. package/dist/types-ts4.5/schema/nodes/sync-block.d.ts +22 -0
  518. package/dist/types-ts4.5/schema/nodes/tableNodes.d.ts +159 -0
  519. package/dist/types-ts4.5/schema/nodes/task-item.d.ts +33 -0
  520. package/dist/types-ts4.5/schema/nodes/task-list.d.ts +20 -0
  521. package/dist/types-ts4.5/schema/nodes/text.d.ts +12 -0
  522. package/dist/types-ts4.5/schema/nodes/types/block-content.d.ts +21 -0
  523. package/dist/types-ts4.5/schema/nodes/types/extensions.d.ts +34 -0
  524. package/dist/types-ts4.5/schema/nodes/types/inline-content.d.ts +28 -0
  525. package/dist/types-ts4.5/schema/nodes/types/list.d.ts +51 -0
  526. package/dist/types-ts4.5/schema/nodes/types/mark.d.ts +15 -0
  527. package/dist/types-ts4.5/schema/nodes/types/non-nestable-block-content.d.ts +19 -0
  528. package/dist/types-ts4.5/schema/nodes/types/rich-media-common.d.ts +37 -0
  529. package/dist/types-ts4.5/schema/nodes/unknown-block.d.ts +3 -0
  530. package/dist/types-ts4.5/schema/nodes/unsupported-block.d.ts +1 -0
  531. package/dist/types-ts4.5/schema/nodes/unsupported-inline.d.ts +1 -0
  532. package/dist/types-ts4.5/schema/sanitizeNodes.d.ts +8 -0
  533. package/dist/types-ts4.5/schema/unsupported.d.ts +1 -0
  534. package/dist/types-ts4.5/steps/analytics.d.ts +60 -0
  535. package/dist/types-ts4.5/steps/batch-attrs-step.d.ts +74 -0
  536. package/dist/types-ts4.5/steps/link-meta-step.d.ts +50 -0
  537. package/dist/types-ts4.5/steps/override-document-step.d.ts +26 -0
  538. package/dist/types-ts4.5/steps/set-attrs.d.ts +24 -0
  539. package/dist/types-ts4.5/steps/type-ahead.d.ts +35 -0
  540. package/dist/types-ts4.5/steps/types.d.ts +96 -0
  541. package/dist/types-ts4.5/steps.d.ts +10 -0
  542. package/dist/types-ts4.5/utils/colors.d.ts +81 -0
  543. package/dist/types-ts4.5/utils/confluence/emoji.d.ts +50 -0
  544. package/dist/types-ts4.5/utils/editor-palette.d.ts +257 -0
  545. package/dist/types-ts4.5/utils/extensions.d.ts +3 -0
  546. package/dist/types-ts4.5/utils/index.d.ts +7 -0
  547. package/dist/types-ts4.5/utils/lch-color-inversion.d.ts +2 -0
  548. package/dist/types-ts4.5/utils/parseDOM.d.ts +1 -0
  549. package/dist/types-ts4.5/utils/url.d.ts +40 -0
  550. package/dist/types-ts4.5/utils/uuid.d.ts +5 -0
  551. package/dist/types-ts4.5/validator-schema/generated/validatorSpec.d.ts +1981 -0
  552. package/eslint-plugin-warn-schema.js +2 -1
  553. package/eslint.config.js +12 -14
  554. package/json-schema/package.json +8 -1
  555. package/json-schema/v1/full.json +3 -0
  556. package/json-schema/v1/stage-0.json +6 -0
  557. package/package.json +90 -82
  558. package/schema/package.json +8 -1
  559. package/schema-bitbucket/package.json +8 -1
  560. package/schema-confluence/package.json +8 -1
  561. package/schema-default/package.json +8 -1
  562. package/schema-generators/__tests__/helpers/_utils.ts +73 -77
  563. package/schema-generators/__tests__/helpers/utils.unit.ts +53 -59
  564. package/schema-generators/__tests__/unit/adfToValidatorSpec.unit.ts +79 -84
  565. package/schema-generators/__tests__/unit/json-full-schema-backwards-compat.unit.ts +43 -40
  566. package/schema-generators/__tests__/unit/validator-schema.ts +3 -3
  567. package/schema-generators/helpers/writeToFile.ts +12 -11
  568. package/schema-generators/json-full-schema.ts +4 -4
  569. package/schema-generators/pm-full-schema.ts +7 -5
  570. package/schema-generators/validator-full-schema.ts +7 -9
  571. package/schema-jira/package.json +8 -1
  572. package/schema-next/package.json +9 -3
  573. package/schema-validator/package.json +9 -3
  574. package/steps/package.json +8 -1
  575. package/url/package.json +8 -1
  576. package/warn-schema-change.js +121 -136
  577. package/warn-schema-change.test.js +31 -30
  578. package/copy-dist-to-afe.js +0 -32
  579. package/dist/json-schema/package.json +0 -8
  580. package/dist/json-schema/v1/full.json +0 -2916
  581. package/dist/json-schema/v1/stage-0.json +0 -3211
  582. package/dist/types/json-schema/index.d.ts +0 -2
  583. package/sanitize-nodes/package.json +0 -8
@@ -1,3 +1,4 @@
1
+ /* eslint-disable @atlaskit/editor/no-re-export */
1
2
  export { acNameToEmoji, acShortcutToEmoji, emojiIdToAcName, getEmojiAcName } from './confluence/emoji';
2
3
  export { generateUuid, uuid } from './uuid';
3
4
  export { B100, B400, B50, B500, B75, G200, G300, G400, G50, G500, G75, N0, N20, N200, N30, N300, N40, N50, N500, N60, N80, N800, N90, P100, P300, P400, P50, P500, P75, R100, R300, R400, R50, R500, R75, T100, T300, T50, T500, T75, Y200, Y400, Y50, Y500, Y75, hexToRgb, hexToRgba, isHex, isRgb, normalizeHexColor, rgbToHex } from './colors';
@@ -5,10 +5,13 @@
5
5
  // https://en.wikipedia.org/wiki/CIELAB_color_space
6
6
 
7
7
  const clamp = (i, min, max) => Math.round(Math.min(Math.max(i, min), max));
8
- const expandShorthandHex = input => input.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i, (m, r, g, b) => r + r + g + g + b + b);
8
+ const expandShorthandHex = input =>
9
+ // @ts-ignore TS1501: This regular expression flag is only available when targeting 'es6' or later.
10
+ input.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/iu, (m, r, g, b) => r + r + g + g + b + b);
9
11
  const rgbFromHex = input => {
10
12
  const fullHex = expandShorthandHex(input);
11
- const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(fullHex);
13
+ // @ts-ignore TS1501: This regular expression flag is only available when targeting 'es6' or later.
14
+ const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/iu.exec(fullHex);
12
15
  return result === null ? null : {
13
16
  r: parseInt(result[1], 16),
14
17
  g: parseInt(result[2], 16),
@@ -54,7 +57,9 @@ const labToLch = ({
54
57
  }) => {
55
58
  let h = (Math.atan2(b, a) * (180 / Math.PI) + 360) % 360;
56
59
  const c = Math.sqrt(Math.pow(a, 2) + Math.pow(b, 2));
57
- if (Math.round(c * 10000) === 0) h = Number.NaN;
60
+ if (Math.round(c * 10000) === 0) {
61
+ h = Number.NaN;
62
+ }
58
63
  return {
59
64
  l,
60
65
  c,
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck
1
2
  /**
2
3
  * This file has been partially duplicated in packages/linking-platform/linking-common/src/url.ts
3
4
  * Any changes made here should be mirrored there.
@@ -5,11 +6,11 @@
5
6
  * Ticket for fixing linkification of filename-like urls: https://product-fabric.atlassian.net/browse/EDM-7190
6
7
  */
7
8
  import LinkifyIt from 'linkify-it';
8
- const whitelistedURLPatterns = [/^https?:\/\//im, /^ftps?:\/\//im, /^gopher:\/\//im, /^integrity:\/\//im, /^file:\/\//im, /^smb:\/\//im, /^dynamicsnav:\/\//im, /^jamfselfservice:\/\//im, /^\//im, /^mailto:/im, /^skype:/im, /^callto:/im, /^facetime:/im, /^git:/im, /^irc6?:/im, /^news:/im, /^nntp:/im, /^feed:/im, /^cvs:/im, /^svn:/im, /^mvn:/im, /^ssh:/im, /^scp:\/\//im, /^sftp:\/\//im, /^itms:/im,
9
+ const whitelistedURLPatterns = [/^https?:\/\//imu, /^ftps?:\/\//imu, /^gopher:\/\//imu, /^integrity:\/\//imu, /^file:\/\//imu, /^smb:\/\//imu, /^dynamicsnav:\/\//imu, /^jamfselfservice:\/\//imu, /^\//imu, /^mailto:/imu, /^skype:/imu, /^callto:/imu, /^facetime:/imu, /^git:/imu, /^irc6?:/imu, /^news:/imu, /^nntp:/imu, /^feed:/imu, /^cvs:/imu, /^svn:/imu, /^mvn:/imu, /^ssh:/imu, /^scp:\/\//imu, /^sftp:\/\//imu, /^itms:/imu,
9
10
  // This is not a valid notes link, but we support this pattern for backwards compatibility
10
- /^notes:/im, /^notes:\/\//im, /^hipchat:\/\//im,
11
+ /^notes:/imu, /^notes:\/\//imu, /^hipchat:\/\//imu,
11
12
  // This is not a valid sourcetree link, but we support this pattern for backwards compatibility
12
- /^sourcetree:/im, /^sourcetree:\/\//im, /^urn:/im, /^tel:/im, /^xmpp:/im, /^telnet:/im, /^vnc:/im, /^rdp:/im, /^whatsapp:/im, /^slack:/im, /^sips?:/im, /^magnet:/im, /^#/im];
13
+ /^sourcetree:/imu, /^sourcetree:\/\//imu, /^urn:/imu, /^tel:/imu, /^xmpp:/imu, /^telnet:/imu, /^vnc:/imu, /^rdp:/imu, /^whatsapp:/imu, /^slack:/imu, /^sips?:/imu, /^magnet:/imu, /^#/imu];
13
14
 
14
15
  /**
15
16
  * Please notify the Editor Mobile team (Slack: #help-mobilekit) if the logic for this changes.
@@ -25,7 +26,7 @@ export const linkify = LinkifyIt();
25
26
  linkify.add('sourcetree:', 'http:');
26
27
  linkify.add('jamfselfservice:', 'http:');
27
28
  const urlWithoutSpacesValidator = {
28
- validate: /[^\s]+/
29
+ validate: /[^\s]+/u
29
30
  };
30
31
 
31
32
  // `tel:` URI spec is https://datatracker.ietf.org/doc/html/rfc3966
@@ -42,7 +43,7 @@ linkify.tlds(tlds, false);
42
43
 
43
44
  // linkify-it mishandles closing braces on long urls, so we preference using our own regex first:
44
45
  // https://product-fabric.atlassian.net/browse/ED-13669
45
- export const LINK_REGEXP = /(https?|ftp|jamfselfservice|gopher|dynamicsnav|integrity|file|smb):\/\/[^\s]+/;
46
+ export const LINK_REGEXP = /(https?|ftp|jamfselfservice|gopher|dynamicsnav|integrity|file|smb):\/\/[^\s]+/u;
46
47
 
47
48
  /** Attempt to find a link match using a regex string defining a URL */
48
49
  export const linkifyMatch = text => {
@@ -52,7 +53,8 @@ export const linkifyMatch = text => {
52
53
  const matches = [];
53
54
  let startpos = 0;
54
55
  let substr;
55
- while (substr = text.substr(startpos)) {
56
+ substr = text.substr(startpos);
57
+ while (substr) {
56
58
  const link = (substr.match(LINK_REGEXP) || [''])[0];
57
59
  if (link) {
58
60
  const index = substr.search(LINK_REGEXP);
@@ -67,6 +69,7 @@ export const linkifyMatch = text => {
67
69
  schema: ''
68
70
  });
69
71
  startpos += end;
72
+ substr = text.substr(startpos);
70
73
  } else {
71
74
  break;
72
75
  }
@@ -1,10 +1,9 @@
1
- /* eslint-disable no-bitwise */
2
- export const generateUuid = () => 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => {
1
+ export const generateUuid = () =>
2
+ // @ts-ignore TS1501: This regular expression flag is only available when targeting 'es6' or later.
3
+ 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/gu, c => {
3
4
  const r = Math.random() * 16 | 0;
4
5
  return (c === 'x' ? r : r & 0x3 | 0x8).toString(16);
5
6
  });
6
-
7
- /* eslint-enable no-bitwise */
8
7
  let staticValue = false;
9
8
  export const uuid = {
10
9
  setStatic(value) {
@@ -252,7 +252,7 @@ export const bodiedSyncBlock = {
252
252
  },
253
253
  content: {
254
254
  type: 'array',
255
- items: [['paragraph', 'paragraph_with_alignment', 'paragraph_with_indentation', 'paragraph_with_no_marks', 'blockCard', 'blockquote', 'bulletList', 'codeBlock', 'decisionList', 'embedCard', 'expand', 'heading', 'heading_with_alignment', 'heading_with_indentation', 'heading_with_no_marks', 'layoutSection', 'mediaGroup', 'mediaSingle', 'mediaSingle_caption', 'mediaSingle_full', 'mediaSingle_width_type', 'orderedList', 'panel', 'rule', 'table', 'taskList']],
255
+ items: [['paragraph', 'paragraph_with_alignment', 'paragraph_with_indentation', 'paragraph_with_no_marks', 'blockCard', 'blockquote', 'bulletList', 'codeBlock', 'decisionList', 'embedCard', 'expand', 'heading', 'heading_with_alignment', 'heading_with_indentation', 'heading_with_no_marks', 'layoutSection', 'layoutSection_with_single_column', 'layoutSection_full', 'mediaGroup', 'mediaSingle', 'mediaSingle_caption', 'mediaSingle_full', 'mediaSingle_width_type', 'orderedList', 'panel', 'rule', 'table', 'taskList']],
256
256
  minItems: 1,
257
257
  allowUnsupportedBlock: true
258
258
  },
package/dist/esm/index.js CHANGED
@@ -1,4 +1,7 @@
1
- export { PanelType, AnnotationTypes, alignment, alignmentPositionMap, annotation, blockCard, blockCardWithLocalId, blockquote, extendedBlockquote, extendedBlockquoteWithLocalId, bodiedExtension, breakout, bulletList, bulletListSelector, bulletListWithLocalId, caption, captionWithLocalId, code, codeBlock, codeBlockWithLocalId, codeBlockToJSON, colorPalette, /** @deprecated [ED-15849] The extended palette is now rolled into the main one. Use `colorPalette` instead. */
1
+ /* eslint-disable @atlaskit/editor/no-re-export */
2
+ export { PanelType, AnnotationTypes, alignment, alignmentPositionMap, annotation, blockCard, blockCardWithLocalId, blockquote, extendedBlockquote, extendedBlockquoteWithLocalId, bodiedExtension, breakout, bulletList, bulletListSelector, bulletListWithLocalId, caption, captionWithLocalId, code, codeBlock, codeBlockWithLocalId, codeBlockToJSON, colorPalette,
3
+ // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required
4
+ /** @deprecated [ED-15849] The extended palette is now rolled into the main one. Use `colorPalette` instead. */
2
5
  colorPaletteExtended, confluenceInlineComment, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, createSchema, dataConsumer, dataConsumerToJSON, date, dateWithLocalId, decisionItem, decisionList, decisionListSelector, doc, em, embedCard, embedCardWithLocalId, emoji, emojiWithLocalId, expandWithNestedExpand, expandWithNestedExpandLocalId, expandToJSON, extension, fragment, fragmentToJSON, hardBreak, heading, image, indentation, inlineCard, inlineCardWithLocalId, inlineExtension, inlineNodes, layoutColumn, layoutColumnWithLocalId, layoutSection, layoutSectionWithLocalId, layoutSectionWithSingleColumn, layoutSectionWithSingleColumnLocalId, link, linkToJSON, listItem, listItemWithLocalId, listItemWithDecisionStage0, media, mediaGroup, mediaSingle, mediaSingleWithCaption, mediaSingleWithWidthType, mediaSingleFull, mediaSingleFullWithLocalId, mediaSingleSpec, mediaInline, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, nestedExpandWithLocalId, orderedList, orderedListSelector, orderedListWithLocalId, orderedListWithOrder, orderedListWithOrderAndLocalId, extendedPanel, extendedPanelWithLocalId, paragraph, placeholder, placeholderWithLocalId, rule, ruleWithLocalId, sanitizeNodes, getCellAttrs, getCellDomAttrs, status, strike, strong, subsup, table, tableStage0, tableWithCustomWidth, tableBackgroundBorderColor, tableBackgroundColorNames, tableBackgroundColorPalette, tableCell, tableCellContentDomSelector, tableCellContentWrapperSelector, tableCellSelector, tableHeader, tableHeaderSelector, tablePrefixSelector, tableRow, tableToJSON, taskItem, blockTaskItem, taskList, taskListSelector, text, textColor, toJSONTableCell, toJSONTableHeader, typeAheadQuery, underline, unknownBlock, unsupportedBlock, unsupportedInline, unsupportedNodeTypesForMediaCards, buildAnnotationMarkDataAttributes, AnnotationMarkStates, unsupportedMark, unsupportedNodeAttribute, border, borderColorPalette, extensionFrame, multiBodiedExtension, backgroundColor, backgroundColorPalette, backgroundColorPaletteNext, syncBlock, bodiedSyncBlock, tableWithNestedTable, tableRowWithNestedTable, tableCellWithNestedTable, tableHeaderWithNestedTable, tableRowWithLocalId, tableCellWithLocalId, tableHeaderWithLocalId, tableRowWithNestedTableWithLocalId, tableCellWithNestedTableWithLocalId, tableHeaderWithNestedTableWithLocalId } from './schema';
3
6
  export { B100, B400, B50, B500, B75, G200, G300, G400, G50, G500, G75, N0, N20, N200, N30, N300, N40, N50, N500, N60, N80, N800, N90, P100, P300, P400, P50, P500, P75, R100, R300, R400, R50, R500, R75, T100, T300, T50, T500, T75, Y200, Y400, Y50, Y500, Y75, acNameToEmoji, acShortcutToEmoji, emojiIdToAcName, generateUuid, getEmojiAcName, getLinkMatch, hexToRgb, hexToRgba, isHex, isRgb, isSafeUrl, linkify, linkifyMatch, normalizeHexColor, normalizeUrl, rgbToHex, uuid, getDarkModeLCHColor } from './utils';
4
7
 
@@ -1,2 +1,3 @@
1
+ /* eslint-disable @atlaskit/editor/no-re-export */
1
2
  export { default as fullSchema } from '../../json-schema/v1/full.json';
2
3
  export { default as stageZeroSchema } from '../../json-schema/v1/stage-0.json';
@@ -17,7 +17,7 @@ import { taskList } from '../nodes/task';
17
17
  import { unsupportedBlock } from '../nodes/unsupportedBlock';
18
18
 
19
19
  // Not an actual group, but a collection of nodes that can't be nested inside each other
20
- // TODO: make it an actual group
20
+ // TODO: ED-29537 - make it an actual group
21
21
  export var nonNestableBlockContent = [paragraph.use('with_no_marks'), panel, blockquote, orderedList, bulletList, rule, heading.use('with_no_marks'), codeBlock, mediaGroup, mediaSingle.use('caption'), mediaSingle.use('full'), decisionList, taskList, table,
22
22
  // @ts-expect-error - types don't deal well with circular references for the variant
23
23
  table.use('with_nested_table'), blockCard, embedCard, extension.use('with_marks'), unsupportedBlock];
@@ -1,3 +1,4 @@
1
+ /* eslint-disable @atlassian/tangerine/export/no-export-all, @atlaskit/editor/no-re-export */
1
2
  export * from './generated/markTypes';
2
3
  export * from './generated/nodeTypes';
3
4
  export * from './generated/nodeGroupTypes';
@@ -1,5 +1,4 @@
1
- import { adfMark } from '@atlaskit/adf-schema-generator';
2
- import { adfMarkGroup } from '@atlaskit/adf-schema-generator';
1
+ import { adfMark, adfMarkGroup } from '@atlaskit/adf-schema-generator';
3
2
 
4
3
  // These marks defined together because they form a cycle within the excludes.
5
4
  export var alignment = adfMark('alignment');
@@ -1,5 +1,4 @@
1
- import { adfMark } from '@atlaskit/adf-schema-generator';
2
- import { adfMarkGroup } from '@atlaskit/adf-schema-generator';
1
+ import { adfMark, adfMarkGroup } from '@atlaskit/adf-schema-generator';
3
2
  export var backgroundColor = adfMark('backgroundColor');
4
3
  export var textColor = adfMark('textColor');
5
4
  export var colorGroup = adfMarkGroup('color', [textColor, backgroundColor]);
@@ -28,7 +28,7 @@ link.define({
28
28
  type: 'string',
29
29
  optional: true
30
30
  },
31
- // TODO: expand object
31
+ // TODO: ED-29537 - expand object
32
32
  // packages/adf-schema/src/schema/marks/link.ts
33
33
  __confluenceMetadata: {
34
34
  type: 'object',
@@ -34,7 +34,7 @@ export var bodiedSyncBlock = adfNode('bodiedSyncBlock').define({
34
34
  default: ''
35
35
  }
36
36
  },
37
- content: [$onePlus($or(paragraph, paragraph.use('with_alignment'), paragraph.use('with_indentation'), paragraph.use('with_no_marks'), blockCard, blockquote, blockquote.use('legacy'), bulletList, codeBlock, confluenceUnsupportedBlock, decisionList, embedCard, expand, heading, heading.use('with_alignment'), heading.use('with_indentation'), heading.use('with_no_marks'), layoutSection, mediaGroup, mediaSingle, mediaSingle.use('caption'), mediaSingle.use('full'), mediaSingle.use('width_type'), orderedList, panel, rule, table,
37
+ content: [$onePlus($or(paragraph, paragraph.use('with_alignment'), paragraph.use('with_indentation'), paragraph.use('with_no_marks'), blockCard, blockquote, blockquote.use('legacy'), bulletList, codeBlock, confluenceUnsupportedBlock, decisionList, embedCard, expand, heading, heading.use('with_alignment'), heading.use('with_indentation'), heading.use('with_no_marks'), layoutSection, layoutSection.use('with_single_column'), layoutSection.use('full'), mediaGroup, mediaSingle, mediaSingle.use('caption'), mediaSingle.use('full'), mediaSingle.use('width_type'), orderedList, panel, rule, table,
38
38
  // @ts-expect-error - types don't deal well with circular references for the variant
39
39
  table.use('with_nested_table'), taskList, unsupportedBlock))]
40
40
  });
@@ -1,5 +1,6 @@
1
1
  import { createSchema } from './create-schema';
2
2
 
3
+ // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required
3
4
  /**
4
5
  * @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
5
6
  **/
@@ -2,6 +2,7 @@ import { createSchema } from './create-schema';
2
2
  var nodes = ['doc', 'paragraph', 'blockquote', 'codeBlock', 'panel', 'hardBreak', 'orderedList', 'bulletList', 'heading', 'mediaInline', 'mediaGroup', 'mediaSingle', 'media', 'caption', 'confluenceUnsupportedBlock', 'confluenceJiraIssue', 'expand', 'nestedExpand', 'extension', 'inlineExtension', 'bodiedExtension', 'listItem', 'mention', 'text', 'confluenceUnsupportedInline', 'media', 'rule', 'table', 'tableCell', 'tableHeader', 'tableRow', 'emoji', 'taskList', 'taskItem', 'date', 'placeholder', 'decisionList', 'decisionItem', 'layoutSection', 'layoutColumn', 'inlineCard', 'unsupportedBlock', 'unsupportedInline'];
3
3
  var marks = ['link', 'em', 'strong', 'strike', 'subsup', 'underline', 'mentionQuery', 'code', 'textColor', 'backgroundColor', 'confluenceInlineComment', 'annotation', 'unsupportedMark', 'unsupportedNodeAttribute'];
4
4
 
5
+ // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required
5
6
  /**
6
7
  * @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
7
8
  **/
@@ -9,6 +10,7 @@ export var confluenceSchema = createSchema({
9
10
  nodes: nodes,
10
11
  marks: marks
11
12
  });
13
+ // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required
12
14
  /**
13
15
  * @deprecated [ED-15676] We have stopped supporting product specific schemas. Use `@atlaskit/adf-schema/schema-default` instead.
14
16
  **/
@@ -274,14 +274,12 @@ export function getNodesAndMarksMap() {
274
274
  var nodes = nodesInOrder.reduce(function (acc, _ref2) {
275
275
  var name = _ref2.name,
276
276
  spec = _ref2.spec;
277
- // @ts-expect-error - Type for SchemaBuiltInItem is not correct
278
277
  acc[name] = spec;
279
278
  return acc;
280
279
  }, {});
281
280
  var marks = marksInOrder.reduce(function (acc, _ref3) {
282
281
  var name = _ref3.name,
283
282
  spec = _ref3.spec;
284
- // @ts-expect-error - Type for SchemaBuiltInItem is not correct
285
283
  acc[name] = spec;
286
284
  return acc;
287
285
  }, {});
@@ -15,6 +15,7 @@ export var createPMNodeSpecFactory = function createPMNodeSpecFactory(nodeSpec)
15
15
  var parseDOM = _ref.parseDOM,
16
16
  toDOM = _ref.toDOM,
17
17
  toDebugString = _ref.toDebugString;
18
+ // @ts-ignore
18
19
  return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, nodeSpec), parseDOM && {
19
20
  parseDOM: parseDOM
20
21
  }), toDOM && {
@@ -39,6 +40,7 @@ export var createPMMarkSpecFactory = function createPMMarkSpecFactory(markSpec)
39
40
  var parseDOM = _ref2.parseDOM,
40
41
  toDOM = _ref2.toDOM,
41
42
  toDebugString = _ref2.toDebugString;
43
+ // @ts-ignore
42
44
  return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, markSpec), parseDOM && {
43
45
  parseDOM: parseDOM
44
46
  }), toDOM && {
@@ -1,5 +1,8 @@
1
+ /* eslint-disable @atlaskit/editor/no-re-export */
1
2
  export { PanelType, blockCard, blockCardWithLocalId, blockquote, extendedBlockquote, extendedBlockquoteWithLocalId, bodiedExtension, bulletList, bulletListSelector, bulletListWithLocalId, caption, captionWithLocalId, codeBlock, codeBlockWithLocalId, codeBlockToJSON, confluenceJiraIssue, confluenceUnsupportedBlock, confluenceUnsupportedInline, copyPrivateMediaAttributes, date, dateWithLocalId, decisionItem, decisionList, decisionListSelector, doc, embedCard, embedCardWithLocalId, emoji, emojiWithLocalId, expandWithNestedExpand, expandWithNestedExpandLocalId, expandToJSON, extension, hardBreak, heading, image, inlineCard, inlineCardWithLocalId, inlineExtension, layoutColumn, layoutColumnWithLocalId, layoutSection, layoutSectionWithLocalId, layoutSectionWithSingleColumn, layoutSectionWithSingleColumnLocalId, listItem, listItemWithDecisionStage0, listItemWithLocalId, media, mediaGroup, mediaSingle, mediaSingleSpec, mediaInline, mediaSingleWithCaption, mediaSingleWithWidthType, mediaSingleFull, mediaSingleFullWithLocalId, mediaSingleToJSON, mediaToJSON, mention, mentionToJSON, nestedExpand, nestedExpandWithLocalId, orderedList, orderedListSelector, orderedListWithLocalId, orderedListWithOrder, orderedListWithOrderAndLocalId, extendedPanel, extendedPanelWithLocalId, paragraph, placeholder, placeholderWithLocalId, rule, ruleWithLocalId, getCellAttrs, getCellDomAttrs, status, table, tableStage0, tableWithCustomWidth, tableBackgroundBorderColor, tableBackgroundColorNames, tableBackgroundColorPalette, tableCell, tableCellContentDomSelector, tableCellContentWrapperSelector, tableCellSelector, tableHeader, tableHeaderSelector, tablePrefixSelector, tableRow, tableToJSON, taskItem, blockTaskItem, taskList, taskListSelector, text, toJSONTableCell, toJSONTableHeader, unknownBlock, unsupportedBlock, unsupportedInline, extensionFrame, multiBodiedExtension, syncBlock, bodiedSyncBlock, tableWithNestedTable, tableRowWithNestedTable, tableCellWithNestedTable, tableHeaderWithNestedTable, tableRowWithLocalId, tableCellWithLocalId, tableHeaderWithLocalId, tableRowWithNestedTableWithLocalId, tableCellWithNestedTableWithLocalId, tableHeaderWithNestedTableWithLocalId } from './nodes';
2
- export { AnnotationTypes, alignment, alignmentPositionMap, annotation, breakout, code, colorPalette, /** @deprecated [ED-15849] The extended palette is now rolled into the main one. Use `colorPalette` instead. */
3
+ export { AnnotationTypes, alignment, alignmentPositionMap, annotation, breakout, code, colorPalette,
4
+ // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required
5
+ /** @deprecated [ED-15849] The extended palette is now rolled into the main one. Use `colorPalette` instead. */
3
6
  colorPaletteExtended, confluenceInlineComment, dataConsumer, dataConsumerToJSON, em, fragment, fragmentToJSON, indentation, link, linkToJSON, strike, strong, subsup, textColor, typeAheadQuery, underline, buildAnnotationMarkDataAttributes, AnnotationMarkStates, unsupportedMark, unsupportedNodeAttribute, border, borderColorPalette, backgroundColor, backgroundColorPalette, backgroundColorPaletteNext } from './marks';
4
7
  export { unsupportedNodeTypesForMediaCards } from './unsupported';
5
8
  export { inlineNodes } from './inline-nodes';
@@ -1,4 +1,7 @@
1
+ // eslint-disable-next-line import/no-namespace
1
2
  import * as nodes from './nodes';
3
+
4
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2
5
  var typedNodes = nodes;
3
6
  export var inlineNodes = new Set(Object.keys(typedNodes).filter(function (key) {
4
7
  return typedNodes[key] && typedNodes[key].group === 'inline';
@@ -1,3 +1,4 @@
1
+ /* eslint-disable @repo/internal/deprecations/deprecation-ticket-required */
1
2
  import { createSchema } from './create-schema';
2
3
 
3
4
  /**
@@ -37,6 +37,7 @@ export var annotation = annotationFactory({
37
37
  tag: 'span[data-mark-type="annotation"]',
38
38
  mark: 'annotation',
39
39
  getAttrs: function getAttrs(domNode) {
40
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
40
41
  var dom = domNode;
41
42
  var attrs = {
42
43
  id: dom.getAttribute('data-id'),
@@ -47,11 +48,11 @@ export var annotation = annotationFactory({
47
48
  }],
48
49
  toDOM: function toDOM(node) {
49
50
  /*
50
- Data attributes on the DOM node are a temporary means of
51
- incrementally switching over to the Annotation mark. Once renderer
52
- provides native support for inline comments the data attributes on the
53
- DOM nodes will be removed.
54
- */
51
+ Data attributes on the DOM node are a temporary means of
52
+ incrementally switching over to the Annotation mark. Once renderer
53
+ provides native support for inline comments the data attributes on the
54
+ DOM nodes will be removed.
55
+ */
55
56
  return ['span', _objectSpread({
56
57
  // Prettier will remove the quotes around class. This would cause some browsers
57
58
  // to not add this attribute properly, as its a reserved word.
@@ -41,6 +41,7 @@ var colorArrayPaletteNext = [[Neutral300, 'Gray'],
41
41
 
42
42
  // @see https://product-fabric.atlassian.net/wiki/spaces/E/pages/55979455/Colour+picker+decisions#Colourpickerdecisions-Visualdesigndecisions
43
43
  // Remove this when cleaning up platform_editor_add_orange_highlight_color
44
+ // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required
44
45
  /**
45
46
  * @deprecated use backgroundColorPaletteNext instead, which in addition supports yellow highlight
46
47
  */
@@ -64,6 +65,7 @@ export var backgroundColor = backgroundColorFactory({
64
65
  getAttrs: function getAttrs(maybeValue) {
65
66
  var value = maybeValue;
66
67
  var hexColor;
68
+ // @ts-ignore TS1501: This regular expression flag is only available when targeting 'es6' or later.
67
69
  if (value.match(/^rgb/i)) {
68
70
  hexColor = rgbToHex(value);
69
71
  } else if (value[0] === '#') {
@@ -21,6 +21,7 @@ export var border = borderFactory({
21
21
  tag: '[data-mark-type="border"]',
22
22
  getAttrs: function getAttrs(domNode) {
23
23
  var _dom$getAttribute, _dom$getAttribute2;
24
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
24
25
  var dom = domNode;
25
26
  var color = ((_dom$getAttribute = dom.getAttribute('data-color')) !== null && _dom$getAttribute !== void 0 ? _dom$getAttribute : '').toLowerCase();
26
27
  var size = +((_dom$getAttribute2 = dom.getAttribute('data-size')) !== null && _dom$getAttribute2 !== void 0 ? _dom$getAttribute2 : '0');
@@ -9,7 +9,9 @@ export var breakout = breakoutFactory({
9
9
  parseDOM: [{
10
10
  tag: 'div.fabric-editor-breakout-mark',
11
11
  getAttrs: function getAttrs(dom) {
12
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
12
13
  var mode = dom.getAttribute('data-mode');
14
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
13
15
  var width = dom.getAttribute('data-width');
14
16
  return {
15
17
  mode: allowedTypes.indexOf(mode || '') === -1 ? 'wide' : mode,
@@ -8,6 +8,7 @@ export var indentation = indentationFactory({
8
8
  parseDOM: [{
9
9
  tag: 'div.fabric-editor-indentation-mark',
10
10
  getAttrs: function getAttrs(dom) {
11
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
11
12
  var level = +(dom.getAttribute('data-level') || '0');
12
13
  return {
13
14
  level: level > 6 ? 6 : level < 1 ? false : level
@@ -1,3 +1,4 @@
1
+ /* eslint-disable @atlaskit/editor/no-re-export */
1
2
  export { em } from './em';
2
3
  export { code } from './code';
3
4
  export { strike } from './strike';
@@ -32,7 +32,9 @@ export var link = linkFactory({
32
32
  getAttrs: getLinkAttrs('data-block-link'),
33
33
  contentElement: function contentElement(node) {
34
34
  var clone = node.cloneNode(true);
35
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
35
36
  clone.removeAttribute('data-block-link');
37
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
36
38
  clone.setAttribute('data-skip-paste', 'true');
37
39
  var wrapper = document.createElement('div');
38
40
  wrapper.appendChild(clone);
@@ -43,6 +45,7 @@ export var link = linkFactory({
43
45
  getAttrs: getLinkAttrs('href')
44
46
  }],
45
47
  toDOM: function toDOM(node, isInline) {
48
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
46
49
  var attrs = Object.keys(node.attrs).reduce(function (attrs, key) {
47
50
  if (key === '__confluenceMetadata') {
48
51
  if (node.attrs[key] !== null) {
@@ -51,6 +54,7 @@ export var link = linkFactory({
51
54
  } else if (key === 'href') {
52
55
  attrs[key] = isSafeUrl(node.attrs[key]) ? node.attrs[key] : undefined;
53
56
  } else {
57
+ // @ts-ignore
54
58
  attrs[key] = node.attrs[key];
55
59
  }
56
60
  return attrs;
@@ -15,15 +15,19 @@ export var strong = strongFactory({
15
15
  {
16
16
  tag: 'b',
17
17
  getAttrs: function getAttrs(node) {
18
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
18
19
  var element = node;
19
20
  return element.style.fontWeight !== 'normal' && null;
20
21
  }
21
22
  }, {
22
23
  tag: 'span',
23
24
  getAttrs: function getAttrs(node) {
25
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
24
26
  var element = node;
25
27
  var fontWeight = element.style.fontWeight;
26
- return typeof fontWeight === 'string' && (fontWeight === 'bold' || fontWeight === 'bolder' || /^(bold(er)?|[5-9]\d{2,})$/.test(fontWeight)) && null;
28
+ return typeof fontWeight === 'string' && (fontWeight === 'bold' || fontWeight === 'bolder' ||
29
+ // @ts-ignore TS1501: This regular expression flag is only available when targeting 'es6' or later.
30
+ /^(bold(er)?|[5-9][0-9]{2,})$/.test(fontWeight)) && null;
27
31
  }
28
32
  }],
29
33
  toDOM: function toDOM() {
@@ -56,6 +56,7 @@ var colorArrayPalette = [
56
56
 
57
57
  // @see https://product-fabric.atlassian.net/wiki/spaces/E/pages/55979455/Colour+picker+decisions#Colourpickerdecisions-Visualdesigndecisions
58
58
  export var colorPalette = new Map();
59
+ // eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required
59
60
  /** @deprecated [ED-15849] The extended palette is now rolled into the main one. Use `colorPalette` instead. */
60
61
  export var colorPaletteExtended = colorPalette;
61
62
  colorArrayPalette.forEach(function (_ref) {
@@ -94,6 +95,7 @@ export var textColor = textColorFactory({
94
95
  getAttrs: function getAttrs(maybeValue) {
95
96
  var value = maybeValue;
96
97
  var hexColor;
98
+ // @ts-ignore TS1501: This regular expression flag is only available when targeting 'es6' or later.
97
99
  if (value.match(/^rgb/i)) {
98
100
  hexColor = rgbToHex(value);
99
101
  } else if (value[0] === '#') {
@@ -14,7 +14,10 @@ var getCommonAttributesFromDom = function getCommonAttributesFromDom(dom) {
14
14
  var datasource = anchor.getAttribute('data-datasource');
15
15
  return {
16
16
  data: data ? JSON.parse(data) : undefined,
17
- layout: datasource ? dom.getAttribute('data-layout') || undefined : undefined,
17
+ layout: datasource ?
18
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
19
+ dom.getAttribute('data-layout') || undefined : undefined,
20
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
18
21
  width: Number(dom.getAttribute('data-width')) || undefined,
19
22
  datasource: datasource ? JSON.parse(datasource) : undefined
20
23
  };
@@ -1,5 +1,4 @@
1
- import { blockquote as blockquoteFactory } from '../../next-schema/generated/nodeTypes';
2
- import { blockquoteLegacy as blockquoteLegacyFactory } from '../../next-schema/generated/nodeTypes';
1
+ import { blockquote as blockquoteFactory, blockquoteLegacy as blockquoteLegacyFactory } from '../../next-schema/generated/nodeTypes';
3
2
  import { uuid } from '../../utils';
4
3
 
5
4
  /**
@@ -16,6 +16,7 @@ export var bodiedExtension = bodiedExtensionFactory({
16
16
  skip: true
17
17
  }, {
18
18
  tag: '[data-node-type="bodied-extension"]',
19
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
19
20
  getAttrs: function getAttrs(domNode) {
20
21
  return getExtensionAttrs(domNode);
21
22
  }
@@ -11,6 +11,7 @@ export var bodiedSyncBlock = bodiedSyncBlockFactory({
11
11
  parseDOM: [{
12
12
  tag: 'div[data-bodied-sync-block]',
13
13
  getAttrs: function getAttrs(domNode) {
14
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
14
15
  var dom = domNode;
15
16
  var attrs = {
16
17
  localId: dom.getAttribute('data-local-id') || uuid.generate(),
@@ -28,9 +28,11 @@ export var captionWithLocalId = captionFactory({
28
28
  toDOM: function toDOM(node) {
29
29
  var _node$attrs;
30
30
  var attrs = {
31
- 'data-caption': 'true',
32
- 'data-local-id': (node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.localId) || undefined
31
+ 'data-caption': 'true'
33
32
  };
33
+ if ((node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.localId) !== undefined) {
34
+ attrs['data-local-id'] = node.attrs.localId;
35
+ }
34
36
  return ['figcaption', attrs, 0];
35
37
  }
36
38
  });
@@ -32,7 +32,8 @@ var getLanguageFromCode = function getLanguageFromCode(dom) {
32
32
  }
33
33
  };
34
34
  var extractLanguageFromClass = function extractLanguageFromClass(className) {
35
- var languageRegex = /(?:^|\s)language-([^\s]+)/;
35
+ // @ts-ignore TS1501: This regular expression flag is only available when targeting 'es6' or later.
36
+ var languageRegex = /(?:^|[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])language-((?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)/;
36
37
  var result = languageRegex.exec(className);
37
38
  if (result && result[1]) {
38
39
  return result[1];
@@ -42,6 +43,8 @@ var extractLanguageFromClass = function extractLanguageFromClass(className) {
42
43
  var removeLastNewLine = function removeLastNewLine(dom) {
43
44
  var parent = dom && dom.parentElement;
44
45
  if (parent && parent.classList.contains('codehilite')) {
46
+ // @ts-ignore TS1501: This regular expression flag is only available when targeting 'es6' or later.
47
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
45
48
  dom.textContent = dom.textContent.replace(/\n$/, '');
46
49
  }
47
50
  return dom;
@@ -74,8 +77,15 @@ export var codeBlock = codeBlockFactory({
74
77
  tag: 'pre',
75
78
  preserveWhitespace: 'full',
76
79
  getAttrs: function getAttrs(domNode) {
80
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
77
81
  var dom = domNode;
78
- var language = getLanguageFromBitbucketStyle(dom.parentElement) || getLanguageFromEditorStyle(dom.parentElement) || getLanguageFromCode(dom) || dom.getAttribute('data-language');
82
+ var language =
83
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
84
+ getLanguageFromBitbucketStyle(dom.parentElement) ||
85
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
86
+ getLanguageFromEditorStyle(dom.parentElement) || getLanguageFromCode(dom) ||
87
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
88
+ dom.getAttribute('data-language');
79
89
  dom = removeLastNewLine(dom);
80
90
  return {
81
91
  language: language
@@ -88,6 +98,7 @@ export var codeBlock = codeBlockFactory({
88
98
  tag: 'div[style]',
89
99
  preserveWhitespace: 'full',
90
100
  getAttrs: function getAttrs(domNode) {
101
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
91
102
  var dom = domNode;
92
103
  if (dom.style.whiteSpace === 'pre' || dom.style.fontFamily && dom.style.fontFamily.toLowerCase().indexOf('monospace') > -1) {
93
104
  return {};
@@ -104,6 +115,7 @@ export var codeBlock = codeBlockFactory({
104
115
  tag: 'table[style]',
105
116
  preserveWhitespace: 'full',
106
117
  getAttrs: function getAttrs(dom) {
118
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
107
119
  if (dom.querySelector('td[class*="blob-code"]')) {
108
120
  return {};
109
121
  }
@@ -113,8 +125,9 @@ export var codeBlock = codeBlockFactory({
113
125
  tag: 'div.code-block',
114
126
  preserveWhitespace: 'full',
115
127
  getAttrs: function getAttrs(domNode) {
128
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
116
129
  var dom = domNode;
117
- // TODO: ED-5604 Fix it inside `react-syntax-highlighter`
130
+ // TODO: ED-5604 - Fix it inside `react-syntax-highlighter`
118
131
  // Remove line numbers
119
132
  var lineNumber = dom.querySelectorAll('.react-syntax-highlighter-line-number');
120
133
  if (lineNumber.length > 0) {
@@ -135,6 +148,7 @@ export var codeBlock = codeBlockFactory({
135
148
  });
136
149
  export var toJSON = function toJSON(node) {
137
150
  return {
151
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
138
152
  attrs: Object.keys(node.attrs).reduce(function (memo, key) {
139
153
  if (key === 'uniqueId') {
140
154
  return memo;
@@ -152,8 +166,15 @@ export var codeBlockWithLocalId = codeBlockFactory({
152
166
  tag: 'pre',
153
167
  preserveWhitespace: 'full',
154
168
  getAttrs: function getAttrs(domNode) {
169
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
155
170
  var dom = domNode;
156
- var language = getLanguageFromBitbucketStyle(dom.parentElement) || getLanguageFromEditorStyle(dom.parentElement) || getLanguageFromCode(dom) || dom.getAttribute('data-language');
171
+ var language =
172
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
173
+ getLanguageFromBitbucketStyle(dom.parentElement) ||
174
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
175
+ getLanguageFromEditorStyle(dom.parentElement) || getLanguageFromCode(dom) ||
176
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
177
+ dom.getAttribute('data-language');
157
178
  dom = removeLastNewLine(dom);
158
179
  return {
159
180
  language: language,
@@ -167,6 +188,7 @@ export var codeBlockWithLocalId = codeBlockFactory({
167
188
  tag: 'div[style]',
168
189
  preserveWhitespace: 'full',
169
190
  getAttrs: function getAttrs(domNode) {
191
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
170
192
  var dom = domNode;
171
193
  if (dom.style.whiteSpace === 'pre' || dom.style.fontFamily && dom.style.fontFamily.toLowerCase().indexOf('monospace') > -1) {
172
194
  return {};
@@ -183,6 +205,7 @@ export var codeBlockWithLocalId = codeBlockFactory({
183
205
  tag: 'table[style]',
184
206
  preserveWhitespace: 'full',
185
207
  getAttrs: function getAttrs(dom) {
208
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
186
209
  if (dom.querySelector('td[class*="blob-code"]')) {
187
210
  return {};
188
211
  }
@@ -192,8 +215,9 @@ export var codeBlockWithLocalId = codeBlockFactory({
192
215
  tag: 'div.code-block',
193
216
  preserveWhitespace: 'full',
194
217
  getAttrs: function getAttrs(domNode) {
218
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
195
219
  var dom = domNode;
196
- // TODO: ED-5604 Fix it inside `react-syntax-highlighter`
220
+ // TODO: ED-5604 - Fix it inside `react-syntax-highlighter`
197
221
  // Remove line numbers
198
222
  var lineNumber = dom.querySelectorAll('.react-syntax-highlighter-line-number');
199
223
  if (lineNumber.length > 0) {
@@ -208,9 +232,10 @@ export var codeBlockWithLocalId = codeBlockFactory({
208
232
  }],
209
233
  toDOM: function toDOM(node) {
210
234
  var _node$attrs;
211
- var attrs = {
212
- 'data-local-id': (node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.localId) || undefined
213
- };
235
+ var attrs = {};
236
+ if ((node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.localId) !== undefined) {
237
+ attrs['data-local-id'] = node.attrs.localId;
238
+ }
214
239
  return ['pre', attrs, ['code', {
215
240
  'data-language': node.attrs.language
216
241
  }, 0]];
@@ -4,6 +4,7 @@ export var confluenceJiraIssue = confluenceJiraIssueFactory({
4
4
  parseDOM: [{
5
5
  tag: "span[data-node-type=\"".concat(name, "\"]"),
6
6
  getAttrs: function getAttrs(domNode) {
7
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
7
8
  var dom = domNode;
8
9
  return {
9
10
  issueKey: dom.textContent,