@atlaskit/editor-core 185.16.1 → 185.16.5

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 (389) hide show
  1. package/.eslintrc.js +1 -0
  2. package/CHANGELOG.md +14 -0
  3. package/dist/cjs/i18n/cs.js +0 -35
  4. package/dist/cjs/i18n/da.js +0 -35
  5. package/dist/cjs/i18n/de.js +0 -35
  6. package/dist/cjs/i18n/en.js +0 -35
  7. package/dist/cjs/i18n/en_GB.js +0 -35
  8. package/dist/cjs/i18n/en_ZZ.js +0 -35
  9. package/dist/cjs/i18n/es.js +1 -35
  10. package/dist/cjs/i18n/fi.js +0 -35
  11. package/dist/cjs/i18n/fr.js +1 -35
  12. package/dist/cjs/i18n/hu.js +1 -35
  13. package/dist/cjs/i18n/it.js +1 -35
  14. package/dist/cjs/i18n/ja.js +1 -35
  15. package/dist/cjs/i18n/ko.js +0 -35
  16. package/dist/cjs/i18n/nb.js +1 -35
  17. package/dist/cjs/i18n/nl.js +1 -35
  18. package/dist/cjs/i18n/pl.js +1 -35
  19. package/dist/cjs/i18n/pt_BR.js +1 -35
  20. package/dist/cjs/i18n/ru.js +1 -35
  21. package/dist/cjs/i18n/sv.js +0 -35
  22. package/dist/cjs/i18n/th.js +0 -35
  23. package/dist/cjs/i18n/tr.js +1 -35
  24. package/dist/cjs/i18n/uk.js +1 -35
  25. package/dist/cjs/i18n/vi.js +0 -35
  26. package/dist/cjs/i18n/zh.js +1 -35
  27. package/dist/cjs/i18n/zh_TW.js +1 -35
  28. package/dist/cjs/labs/next/presets/mobile.js +1 -1
  29. package/dist/cjs/labs/next/presets/universal.js +2 -2
  30. package/dist/cjs/plugins/deprecated-card/doc.js +111 -0
  31. package/dist/cjs/plugins/deprecated-hyperlink/commands.js +1 -1
  32. package/dist/cjs/plugins/index.js +0 -7
  33. package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +14 -25
  34. package/dist/cjs/plugins/media/ui/ResizableMediaSingle/index.js +39 -27
  35. package/dist/cjs/plugins/text-formatting/commands/clear-formatting.js +5 -6
  36. package/dist/cjs/plugins/text-formatting/index.js +6 -2
  37. package/dist/cjs/plugins/text-formatting/pm-plugins/clear-formatting-keymap.js +2 -2
  38. package/dist/cjs/plugins/text-formatting/ui/Toolbar/hooks/clear-formatting-icon.js +6 -3
  39. package/dist/cjs/plugins/text-formatting/ui/Toolbar/index.js +8 -4
  40. package/dist/cjs/version-wrapper.js +1 -1
  41. package/dist/cjs/version.json +1 -1
  42. package/dist/es2019/i18n/cs.js +0 -35
  43. package/dist/es2019/i18n/da.js +0 -35
  44. package/dist/es2019/i18n/de.js +0 -35
  45. package/dist/es2019/i18n/en.js +0 -35
  46. package/dist/es2019/i18n/en_GB.js +0 -35
  47. package/dist/es2019/i18n/en_ZZ.js +0 -35
  48. package/dist/es2019/i18n/es.js +1 -35
  49. package/dist/es2019/i18n/fi.js +0 -35
  50. package/dist/es2019/i18n/fr.js +1 -35
  51. package/dist/es2019/i18n/hu.js +1 -35
  52. package/dist/es2019/i18n/it.js +1 -35
  53. package/dist/es2019/i18n/ja.js +1 -35
  54. package/dist/es2019/i18n/ko.js +0 -35
  55. package/dist/es2019/i18n/nb.js +1 -35
  56. package/dist/es2019/i18n/nl.js +1 -35
  57. package/dist/es2019/i18n/pl.js +1 -35
  58. package/dist/es2019/i18n/pt_BR.js +1 -35
  59. package/dist/es2019/i18n/ru.js +1 -35
  60. package/dist/es2019/i18n/sv.js +0 -35
  61. package/dist/es2019/i18n/th.js +0 -35
  62. package/dist/es2019/i18n/tr.js +1 -35
  63. package/dist/es2019/i18n/uk.js +1 -35
  64. package/dist/es2019/i18n/vi.js +0 -35
  65. package/dist/es2019/i18n/zh.js +1 -35
  66. package/dist/es2019/i18n/zh_TW.js +1 -35
  67. package/dist/es2019/labs/next/presets/mobile.js +1 -1
  68. package/dist/es2019/labs/next/presets/universal.js +1 -1
  69. package/dist/es2019/plugins/deprecated-card/doc.js +97 -0
  70. package/dist/es2019/plugins/deprecated-hyperlink/commands.js +1 -1
  71. package/dist/es2019/plugins/index.js +0 -1
  72. package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +2 -14
  73. package/dist/es2019/plugins/media/ui/ResizableMediaSingle/index.js +13 -0
  74. package/dist/es2019/plugins/text-formatting/commands/clear-formatting.js +5 -6
  75. package/dist/es2019/plugins/text-formatting/index.js +8 -3
  76. package/dist/es2019/plugins/text-formatting/pm-plugins/clear-formatting-keymap.js +2 -2
  77. package/dist/es2019/plugins/text-formatting/ui/Toolbar/hooks/clear-formatting-icon.js +5 -4
  78. package/dist/es2019/plugins/text-formatting/ui/Toolbar/index.js +8 -4
  79. package/dist/es2019/version-wrapper.js +1 -1
  80. package/dist/es2019/version.json +1 -1
  81. package/dist/esm/i18n/cs.js +0 -35
  82. package/dist/esm/i18n/da.js +0 -35
  83. package/dist/esm/i18n/de.js +0 -35
  84. package/dist/esm/i18n/en.js +0 -35
  85. package/dist/esm/i18n/en_GB.js +0 -35
  86. package/dist/esm/i18n/en_ZZ.js +0 -35
  87. package/dist/esm/i18n/es.js +1 -35
  88. package/dist/esm/i18n/fi.js +0 -35
  89. package/dist/esm/i18n/fr.js +1 -35
  90. package/dist/esm/i18n/hu.js +1 -35
  91. package/dist/esm/i18n/it.js +1 -35
  92. package/dist/esm/i18n/ja.js +1 -35
  93. package/dist/esm/i18n/ko.js +0 -35
  94. package/dist/esm/i18n/nb.js +1 -35
  95. package/dist/esm/i18n/nl.js +1 -35
  96. package/dist/esm/i18n/pl.js +1 -35
  97. package/dist/esm/i18n/pt_BR.js +1 -35
  98. package/dist/esm/i18n/ru.js +1 -35
  99. package/dist/esm/i18n/sv.js +0 -35
  100. package/dist/esm/i18n/th.js +0 -35
  101. package/dist/esm/i18n/tr.js +1 -35
  102. package/dist/esm/i18n/uk.js +1 -35
  103. package/dist/esm/i18n/vi.js +0 -35
  104. package/dist/esm/i18n/zh.js +1 -35
  105. package/dist/esm/i18n/zh_TW.js +1 -35
  106. package/dist/esm/labs/next/presets/mobile.js +1 -1
  107. package/dist/esm/labs/next/presets/universal.js +1 -1
  108. package/dist/esm/plugins/deprecated-card/doc.js +105 -0
  109. package/dist/esm/plugins/deprecated-hyperlink/commands.js +1 -1
  110. package/dist/esm/plugins/index.js +0 -1
  111. package/dist/esm/plugins/media/nodeviews/mediaSingle.js +14 -25
  112. package/dist/esm/plugins/media/ui/ResizableMediaSingle/index.js +39 -27
  113. package/dist/esm/plugins/text-formatting/commands/clear-formatting.js +5 -6
  114. package/dist/esm/plugins/text-formatting/index.js +6 -2
  115. package/dist/esm/plugins/text-formatting/pm-plugins/clear-formatting-keymap.js +2 -2
  116. package/dist/esm/plugins/text-formatting/ui/Toolbar/hooks/clear-formatting-icon.js +7 -4
  117. package/dist/esm/plugins/text-formatting/ui/Toolbar/index.js +8 -4
  118. package/dist/esm/version-wrapper.js +1 -1
  119. package/dist/esm/version.json +1 -1
  120. package/dist/types/i18n/cs.d.ts +0 -35
  121. package/dist/types/i18n/da.d.ts +0 -35
  122. package/dist/types/i18n/de.d.ts +0 -35
  123. package/dist/types/i18n/en.d.ts +0 -35
  124. package/dist/types/i18n/en_GB.d.ts +0 -35
  125. package/dist/types/i18n/en_ZZ.d.ts +0 -35
  126. package/dist/types/i18n/es.d.ts +1 -35
  127. package/dist/types/i18n/fi.d.ts +0 -35
  128. package/dist/types/i18n/fr.d.ts +1 -35
  129. package/dist/types/i18n/hu.d.ts +1 -35
  130. package/dist/types/i18n/it.d.ts +1 -35
  131. package/dist/types/i18n/ja.d.ts +1 -35
  132. package/dist/types/i18n/ko.d.ts +0 -35
  133. package/dist/types/i18n/nb.d.ts +1 -35
  134. package/dist/types/i18n/nl.d.ts +1 -35
  135. package/dist/types/i18n/pl.d.ts +1 -35
  136. package/dist/types/i18n/pt_BR.d.ts +1 -35
  137. package/dist/types/i18n/ru.d.ts +1 -35
  138. package/dist/types/i18n/sv.d.ts +0 -35
  139. package/dist/types/i18n/th.d.ts +0 -35
  140. package/dist/types/i18n/tr.d.ts +1 -35
  141. package/dist/types/i18n/uk.d.ts +1 -35
  142. package/dist/types/i18n/vi.d.ts +0 -35
  143. package/dist/types/i18n/zh.d.ts +1 -35
  144. package/dist/types/i18n/zh_TW.d.ts +1 -35
  145. package/dist/types/labs/next/presets/cxhtml.d.ts +58 -0
  146. package/dist/types/labs/next/presets/default.d.ts +116 -0
  147. package/dist/types/labs/next/presets/mobile.d.ts +58 -0
  148. package/dist/types/plugins/deprecated-card/doc.d.ts +20 -0
  149. package/dist/types/plugins/index.d.ts +0 -1
  150. package/dist/types/plugins/media/nodeviews/mediaSingle.d.ts +0 -1
  151. package/dist/types/plugins/media/ui/ResizableMediaSingle/index.d.ts +1 -0
  152. package/dist/types/plugins/media/ui/ResizableMediaSingle/types.d.ts +3 -2
  153. package/dist/types/plugins/paste/index.d.ts +1 -1
  154. package/dist/types/plugins/text-formatting/commands/clear-formatting.d.ts +3 -3
  155. package/dist/types/plugins/text-formatting/index.d.ts +3 -1
  156. package/dist/types/plugins/text-formatting/pm-plugins/clear-formatting-keymap.d.ts +2 -1
  157. package/dist/types/plugins/text-formatting/ui/Toolbar/hooks/clear-formatting-icon.d.ts +6 -1
  158. package/dist/types/plugins/text-formatting/ui/Toolbar/index.d.ts +2 -0
  159. package/dist/types-ts4.5/i18n/cs.d.ts +0 -35
  160. package/dist/types-ts4.5/i18n/da.d.ts +0 -35
  161. package/dist/types-ts4.5/i18n/de.d.ts +0 -35
  162. package/dist/types-ts4.5/i18n/en.d.ts +0 -35
  163. package/dist/types-ts4.5/i18n/en_GB.d.ts +0 -35
  164. package/dist/types-ts4.5/i18n/en_ZZ.d.ts +0 -35
  165. package/dist/types-ts4.5/i18n/es.d.ts +1 -35
  166. package/dist/types-ts4.5/i18n/fi.d.ts +0 -35
  167. package/dist/types-ts4.5/i18n/fr.d.ts +1 -35
  168. package/dist/types-ts4.5/i18n/hu.d.ts +1 -35
  169. package/dist/types-ts4.5/i18n/it.d.ts +1 -35
  170. package/dist/types-ts4.5/i18n/ja.d.ts +1 -35
  171. package/dist/types-ts4.5/i18n/ko.d.ts +0 -35
  172. package/dist/types-ts4.5/i18n/nb.d.ts +1 -35
  173. package/dist/types-ts4.5/i18n/nl.d.ts +1 -35
  174. package/dist/types-ts4.5/i18n/pl.d.ts +1 -35
  175. package/dist/types-ts4.5/i18n/pt_BR.d.ts +1 -35
  176. package/dist/types-ts4.5/i18n/ru.d.ts +1 -35
  177. package/dist/types-ts4.5/i18n/sv.d.ts +0 -35
  178. package/dist/types-ts4.5/i18n/th.d.ts +0 -35
  179. package/dist/types-ts4.5/i18n/tr.d.ts +1 -35
  180. package/dist/types-ts4.5/i18n/uk.d.ts +1 -35
  181. package/dist/types-ts4.5/i18n/vi.d.ts +0 -35
  182. package/dist/types-ts4.5/i18n/zh.d.ts +1 -35
  183. package/dist/types-ts4.5/i18n/zh_TW.d.ts +1 -35
  184. package/dist/types-ts4.5/labs/next/presets/cxhtml.d.ts +70 -0
  185. package/dist/types-ts4.5/labs/next/presets/default.d.ts +140 -0
  186. package/dist/types-ts4.5/labs/next/presets/mobile.d.ts +70 -0
  187. package/dist/types-ts4.5/plugins/deprecated-card/doc.d.ts +20 -0
  188. package/dist/types-ts4.5/plugins/index.d.ts +0 -1
  189. package/dist/types-ts4.5/plugins/media/nodeviews/mediaSingle.d.ts +0 -1
  190. package/dist/types-ts4.5/plugins/media/ui/ResizableMediaSingle/index.d.ts +1 -0
  191. package/dist/types-ts4.5/plugins/media/ui/ResizableMediaSingle/types.d.ts +3 -2
  192. package/dist/types-ts4.5/plugins/paste/index.d.ts +1 -1
  193. package/dist/types-ts4.5/plugins/text-formatting/commands/clear-formatting.d.ts +3 -3
  194. package/dist/types-ts4.5/plugins/text-formatting/index.d.ts +5 -1
  195. package/dist/types-ts4.5/plugins/text-formatting/pm-plugins/clear-formatting-keymap.d.ts +2 -1
  196. package/dist/types-ts4.5/plugins/text-formatting/ui/Toolbar/hooks/clear-formatting-icon.d.ts +6 -1
  197. package/dist/types-ts4.5/plugins/text-formatting/ui/Toolbar/index.d.ts +2 -0
  198. package/package.json +6 -5
  199. package/tmp/api-report-tmp.d.ts +2307 -0
  200. package/dist/cjs/plugins/card/index.js +0 -139
  201. package/dist/cjs/plugins/card/messages.js +0 -20
  202. package/dist/cjs/plugins/card/nodeviews/blockCard.js +0 -163
  203. package/dist/cjs/plugins/card/nodeviews/datasource.js +0 -172
  204. package/dist/cjs/plugins/card/nodeviews/embedCard.js +0 -396
  205. package/dist/cjs/plugins/card/nodeviews/genericCard.js +0 -118
  206. package/dist/cjs/plugins/card/nodeviews/inlineCard.js +0 -131
  207. package/dist/cjs/plugins/card/pm-plugins/actions.js +0 -122
  208. package/dist/cjs/plugins/card/pm-plugins/analytics/create-analytics-queue.js +0 -48
  209. package/dist/cjs/plugins/card/pm-plugins/analytics/events-from-tr.js +0 -353
  210. package/dist/cjs/plugins/card/pm-plugins/analytics/index.js +0 -19
  211. package/dist/cjs/plugins/card/pm-plugins/analytics/types.js +0 -5
  212. package/dist/cjs/plugins/card/pm-plugins/analytics/utils.js +0 -178
  213. package/dist/cjs/plugins/card/pm-plugins/doc.js +0 -478
  214. package/dist/cjs/plugins/card/pm-plugins/keymap.js +0 -64
  215. package/dist/cjs/plugins/card/pm-plugins/main.js +0 -212
  216. package/dist/cjs/plugins/card/pm-plugins/mountHyperlink.js +0 -47
  217. package/dist/cjs/plugins/card/pm-plugins/plugin-key.js +0 -9
  218. package/dist/cjs/plugins/card/pm-plugins/reducers.js +0 -111
  219. package/dist/cjs/plugins/card/pm-plugins/shouldReplaceLink.js +0 -35
  220. package/dist/cjs/plugins/card/pm-plugins/util/resolve.js +0 -58
  221. package/dist/cjs/plugins/card/pm-plugins/util/state.js +0 -49
  222. package/dist/cjs/plugins/card/toolbar.js +0 -364
  223. package/dist/cjs/plugins/card/types.js +0 -5
  224. package/dist/cjs/plugins/card/ui/DatasourceModal/ModalWithState.js +0 -25
  225. package/dist/cjs/plugins/card/ui/DatasourceModal/index.js +0 -60
  226. package/dist/cjs/plugins/card/ui/EditLinkToolbar.js +0 -256
  227. package/dist/cjs/plugins/card/ui/EditorSmartCardEvents.js +0 -21
  228. package/dist/cjs/plugins/card/ui/EditorSmartCardEventsNext.js +0 -213
  229. package/dist/cjs/plugins/card/ui/HyperlinkToolbarAppearance.js +0 -173
  230. package/dist/cjs/plugins/card/ui/LayoutButton/index.js +0 -113
  231. package/dist/cjs/plugins/card/ui/LayoutButton/styled.js +0 -17
  232. package/dist/cjs/plugins/card/ui/LayoutButton/types.js +0 -5
  233. package/dist/cjs/plugins/card/ui/LayoutButton/utils.js +0 -19
  234. package/dist/cjs/plugins/card/ui/LinkToolbarAppearance.js +0 -151
  235. package/dist/cjs/plugins/card/ui/ResizableEmbedCard.js +0 -360
  236. package/dist/cjs/plugins/card/ui/SmallerEditIcon.js +0 -20
  237. package/dist/cjs/plugins/card/utils.js +0 -60
  238. package/dist/es2019/plugins/card/index.js +0 -131
  239. package/dist/es2019/plugins/card/messages.js +0 -13
  240. package/dist/es2019/plugins/card/nodeviews/blockCard.js +0 -130
  241. package/dist/es2019/plugins/card/nodeviews/datasource.js +0 -136
  242. package/dist/es2019/plugins/card/nodeviews/embedCard.js +0 -368
  243. package/dist/es2019/plugins/card/nodeviews/genericCard.js +0 -92
  244. package/dist/es2019/plugins/card/nodeviews/inlineCard.js +0 -112
  245. package/dist/es2019/plugins/card/pm-plugins/actions.js +0 -57
  246. package/dist/es2019/plugins/card/pm-plugins/analytics/create-analytics-queue.js +0 -38
  247. package/dist/es2019/plugins/card/pm-plugins/analytics/events-from-tr.js +0 -333
  248. package/dist/es2019/plugins/card/pm-plugins/analytics/index.js +0 -2
  249. package/dist/es2019/plugins/card/pm-plugins/analytics/types.js +0 -1
  250. package/dist/es2019/plugins/card/pm-plugins/analytics/utils.js +0 -160
  251. package/dist/es2019/plugins/card/pm-plugins/doc.js +0 -451
  252. package/dist/es2019/plugins/card/pm-plugins/keymap.js +0 -59
  253. package/dist/es2019/plugins/card/pm-plugins/main.js +0 -208
  254. package/dist/es2019/plugins/card/pm-plugins/mountHyperlink.js +0 -37
  255. package/dist/es2019/plugins/card/pm-plugins/plugin-key.js +0 -2
  256. package/dist/es2019/plugins/card/pm-plugins/reducers.js +0 -110
  257. package/dist/es2019/plugins/card/pm-plugins/shouldReplaceLink.js +0 -25
  258. package/dist/es2019/plugins/card/pm-plugins/util/resolve.js +0 -48
  259. package/dist/es2019/plugins/card/pm-plugins/util/state.js +0 -26
  260. package/dist/es2019/plugins/card/toolbar.js +0 -362
  261. package/dist/es2019/plugins/card/types.js +0 -1
  262. package/dist/es2019/plugins/card/ui/DatasourceModal/ModalWithState.js +0 -19
  263. package/dist/es2019/plugins/card/ui/DatasourceModal/index.js +0 -48
  264. package/dist/es2019/plugins/card/ui/EditLinkToolbar.js +0 -225
  265. package/dist/es2019/plugins/card/ui/EditorSmartCardEvents.js +0 -15
  266. package/dist/es2019/plugins/card/ui/EditorSmartCardEventsNext.js +0 -198
  267. package/dist/es2019/plugins/card/ui/HyperlinkToolbarAppearance.js +0 -86
  268. package/dist/es2019/plugins/card/ui/LayoutButton/index.js +0 -106
  269. package/dist/es2019/plugins/card/ui/LayoutButton/styled.js +0 -10
  270. package/dist/es2019/plugins/card/ui/LayoutButton/types.js +0 -1
  271. package/dist/es2019/plugins/card/ui/LayoutButton/utils.js +0 -15
  272. package/dist/es2019/plugins/card/ui/LinkToolbarAppearance.js +0 -117
  273. package/dist/es2019/plugins/card/ui/ResizableEmbedCard.js +0 -332
  274. package/dist/es2019/plugins/card/ui/SmallerEditIcon.js +0 -11
  275. package/dist/es2019/plugins/card/utils.js +0 -46
  276. package/dist/esm/plugins/card/index.js +0 -132
  277. package/dist/esm/plugins/card/messages.js +0 -13
  278. package/dist/esm/plugins/card/nodeviews/blockCard.js +0 -155
  279. package/dist/esm/plugins/card/nodeviews/datasource.js +0 -164
  280. package/dist/esm/plugins/card/nodeviews/embedCard.js +0 -387
  281. package/dist/esm/plugins/card/nodeviews/genericCard.js +0 -111
  282. package/dist/esm/plugins/card/nodeviews/inlineCard.js +0 -123
  283. package/dist/esm/plugins/card/pm-plugins/actions.js +0 -102
  284. package/dist/esm/plugins/card/pm-plugins/analytics/create-analytics-queue.js +0 -41
  285. package/dist/esm/plugins/card/pm-plugins/analytics/events-from-tr.js +0 -344
  286. package/dist/esm/plugins/card/pm-plugins/analytics/index.js +0 -2
  287. package/dist/esm/plugins/card/pm-plugins/analytics/types.js +0 -1
  288. package/dist/esm/plugins/card/pm-plugins/analytics/utils.js +0 -160
  289. package/dist/esm/plugins/card/pm-plugins/doc.js +0 -460
  290. package/dist/esm/plugins/card/pm-plugins/keymap.js +0 -58
  291. package/dist/esm/plugins/card/pm-plugins/main.js +0 -199
  292. package/dist/esm/plugins/card/pm-plugins/mountHyperlink.js +0 -39
  293. package/dist/esm/plugins/card/pm-plugins/plugin-key.js +0 -2
  294. package/dist/esm/plugins/card/pm-plugins/reducers.js +0 -103
  295. package/dist/esm/plugins/card/pm-plugins/shouldReplaceLink.js +0 -29
  296. package/dist/esm/plugins/card/pm-plugins/util/resolve.js +0 -50
  297. package/dist/esm/plugins/card/pm-plugins/util/state.js +0 -40
  298. package/dist/esm/plugins/card/toolbar.js +0 -353
  299. package/dist/esm/plugins/card/types.js +0 -1
  300. package/dist/esm/plugins/card/ui/DatasourceModal/ModalWithState.js +0 -17
  301. package/dist/esm/plugins/card/ui/DatasourceModal/index.js +0 -49
  302. package/dist/esm/plugins/card/ui/EditLinkToolbar.js +0 -243
  303. package/dist/esm/plugins/card/ui/EditorSmartCardEvents.js +0 -14
  304. package/dist/esm/plugins/card/ui/EditorSmartCardEventsNext.js +0 -202
  305. package/dist/esm/plugins/card/ui/HyperlinkToolbarAppearance.js +0 -163
  306. package/dist/esm/plugins/card/ui/LayoutButton/index.js +0 -102
  307. package/dist/esm/plugins/card/ui/LayoutButton/styled.js +0 -10
  308. package/dist/esm/plugins/card/ui/LayoutButton/types.js +0 -1
  309. package/dist/esm/plugins/card/ui/LayoutButton/utils.js +0 -12
  310. package/dist/esm/plugins/card/ui/LinkToolbarAppearance.js +0 -140
  311. package/dist/esm/plugins/card/ui/ResizableEmbedCard.js +0 -355
  312. package/dist/esm/plugins/card/ui/SmallerEditIcon.js +0 -11
  313. package/dist/esm/plugins/card/utils.js +0 -48
  314. package/dist/types/plugins/card/index.d.ts +0 -26
  315. package/dist/types/plugins/card/messages.d.ts +0 -12
  316. package/dist/types/plugins/card/nodeviews/blockCard.d.ts +0 -26
  317. package/dist/types/plugins/card/nodeviews/datasource.d.ts +0 -42
  318. package/dist/types/plugins/card/nodeviews/embedCard.d.ts +0 -46
  319. package/dist/types/plugins/card/nodeviews/genericCard.d.ts +0 -37
  320. package/dist/types/plugins/card/nodeviews/inlineCard.d.ts +0 -23
  321. package/dist/types/plugins/card/pm-plugins/actions.d.ts +0 -23
  322. package/dist/types/plugins/card/pm-plugins/analytics/create-analytics-queue.d.ts +0 -10
  323. package/dist/types/plugins/card/pm-plugins/analytics/events-from-tr.d.ts +0 -17
  324. package/dist/types/plugins/card/pm-plugins/analytics/index.d.ts +0 -2
  325. package/dist/types/plugins/card/pm-plugins/analytics/types.d.ts +0 -12
  326. package/dist/types/plugins/card/pm-plugins/analytics/utils.d.ts +0 -32
  327. package/dist/types/plugins/card/pm-plugins/doc.d.ts +0 -23
  328. package/dist/types/plugins/card/pm-plugins/keymap.d.ts +0 -3
  329. package/dist/types/plugins/card/pm-plugins/main.d.ts +0 -6
  330. package/dist/types/plugins/card/pm-plugins/mountHyperlink.d.ts +0 -5
  331. package/dist/types/plugins/card/pm-plugins/plugin-key.d.ts +0 -3
  332. package/dist/types/plugins/card/pm-plugins/reducers.d.ts +0 -3
  333. package/dist/types/plugins/card/pm-plugins/shouldReplaceLink.d.ts +0 -2
  334. package/dist/types/plugins/card/pm-plugins/util/resolve.d.ts +0 -8
  335. package/dist/types/plugins/card/pm-plugins/util/state.d.ts +0 -31
  336. package/dist/types/plugins/card/toolbar.d.ts +0 -12
  337. package/dist/types/plugins/card/types.d.ts +0 -165
  338. package/dist/types/plugins/card/ui/DatasourceModal/ModalWithState.d.ts +0 -9
  339. package/dist/types/plugins/card/ui/DatasourceModal/index.d.ts +0 -11
  340. package/dist/types/plugins/card/ui/EditLinkToolbar.d.ts +0 -47
  341. package/dist/types/plugins/card/ui/EditorSmartCardEvents.d.ts +0 -5
  342. package/dist/types/plugins/card/ui/EditorSmartCardEventsNext.d.ts +0 -18
  343. package/dist/types/plugins/card/ui/HyperlinkToolbarAppearance.d.ts +0 -32
  344. package/dist/types/plugins/card/ui/LayoutButton/index.d.ts +0 -9
  345. package/dist/types/plugins/card/ui/LayoutButton/styled.d.ts +0 -1
  346. package/dist/types/plugins/card/ui/LayoutButton/types.d.ts +0 -19
  347. package/dist/types/plugins/card/ui/LayoutButton/utils.d.ts +0 -5
  348. package/dist/types/plugins/card/ui/LinkToolbarAppearance.d.ts +0 -29
  349. package/dist/types/plugins/card/ui/ResizableEmbedCard.d.ts +0 -61
  350. package/dist/types/plugins/card/ui/SmallerEditIcon.d.ts +0 -3
  351. package/dist/types/plugins/card/utils.d.ts +0 -19
  352. package/dist/types-ts4.5/plugins/card/index.d.ts +0 -26
  353. package/dist/types-ts4.5/plugins/card/messages.d.ts +0 -12
  354. package/dist/types-ts4.5/plugins/card/nodeviews/blockCard.d.ts +0 -26
  355. package/dist/types-ts4.5/plugins/card/nodeviews/datasource.d.ts +0 -42
  356. package/dist/types-ts4.5/plugins/card/nodeviews/embedCard.d.ts +0 -46
  357. package/dist/types-ts4.5/plugins/card/nodeviews/genericCard.d.ts +0 -37
  358. package/dist/types-ts4.5/plugins/card/nodeviews/inlineCard.d.ts +0 -23
  359. package/dist/types-ts4.5/plugins/card/pm-plugins/actions.d.ts +0 -23
  360. package/dist/types-ts4.5/plugins/card/pm-plugins/analytics/create-analytics-queue.d.ts +0 -10
  361. package/dist/types-ts4.5/plugins/card/pm-plugins/analytics/events-from-tr.d.ts +0 -17
  362. package/dist/types-ts4.5/plugins/card/pm-plugins/analytics/index.d.ts +0 -2
  363. package/dist/types-ts4.5/plugins/card/pm-plugins/analytics/types.d.ts +0 -12
  364. package/dist/types-ts4.5/plugins/card/pm-plugins/analytics/utils.d.ts +0 -32
  365. package/dist/types-ts4.5/plugins/card/pm-plugins/doc.d.ts +0 -23
  366. package/dist/types-ts4.5/plugins/card/pm-plugins/keymap.d.ts +0 -3
  367. package/dist/types-ts4.5/plugins/card/pm-plugins/main.d.ts +0 -6
  368. package/dist/types-ts4.5/plugins/card/pm-plugins/mountHyperlink.d.ts +0 -5
  369. package/dist/types-ts4.5/plugins/card/pm-plugins/plugin-key.d.ts +0 -3
  370. package/dist/types-ts4.5/plugins/card/pm-plugins/reducers.d.ts +0 -3
  371. package/dist/types-ts4.5/plugins/card/pm-plugins/shouldReplaceLink.d.ts +0 -2
  372. package/dist/types-ts4.5/plugins/card/pm-plugins/util/resolve.d.ts +0 -8
  373. package/dist/types-ts4.5/plugins/card/pm-plugins/util/state.d.ts +0 -31
  374. package/dist/types-ts4.5/plugins/card/toolbar.d.ts +0 -12
  375. package/dist/types-ts4.5/plugins/card/types.d.ts +0 -165
  376. package/dist/types-ts4.5/plugins/card/ui/DatasourceModal/ModalWithState.d.ts +0 -9
  377. package/dist/types-ts4.5/plugins/card/ui/DatasourceModal/index.d.ts +0 -11
  378. package/dist/types-ts4.5/plugins/card/ui/EditLinkToolbar.d.ts +0 -47
  379. package/dist/types-ts4.5/plugins/card/ui/EditorSmartCardEvents.d.ts +0 -5
  380. package/dist/types-ts4.5/plugins/card/ui/EditorSmartCardEventsNext.d.ts +0 -18
  381. package/dist/types-ts4.5/plugins/card/ui/HyperlinkToolbarAppearance.d.ts +0 -32
  382. package/dist/types-ts4.5/plugins/card/ui/LayoutButton/index.d.ts +0 -9
  383. package/dist/types-ts4.5/plugins/card/ui/LayoutButton/styled.d.ts +0 -1
  384. package/dist/types-ts4.5/plugins/card/ui/LayoutButton/types.d.ts +0 -19
  385. package/dist/types-ts4.5/plugins/card/ui/LayoutButton/utils.d.ts +0 -5
  386. package/dist/types-ts4.5/plugins/card/ui/LinkToolbarAppearance.d.ts +0 -29
  387. package/dist/types-ts4.5/plugins/card/ui/ResizableEmbedCard.d.ts +0 -61
  388. package/dist/types-ts4.5/plugins/card/ui/SmallerEditIcon.d.ts +0 -3
  389. package/dist/types-ts4.5/plugins/card/utils.d.ts +0 -19
@@ -1,355 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
- import _createClass from "@babel/runtime/helpers/createClass";
4
- import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
5
- import _inherits from "@babel/runtime/helpers/inherits";
6
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
7
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
8
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
9
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
10
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
11
- 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); }; }
12
- 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; } }
13
- /** @jsx jsx */
14
- import React from 'react';
15
- import { jsx } from '@emotion/react';
16
- import { findParentNodeOfTypeClosestToPos, hasParentNodeOfType } from 'prosemirror-utils';
17
- import { calcColumnsFromPx, calcPctFromPx, calcPxFromColumns, wrappedLayouts } from '@atlaskit/editor-common/ui';
18
- import { akEditorMediaResizeHandlerPaddingWide, akEditorBreakoutPadding, akEditorWideLayoutWidth, breakoutWideScaleRatio, DEFAULT_EMBED_CARD_HEIGHT, DEFAULT_EMBED_CARD_WIDTH } from '@atlaskit/editor-shared-styles';
19
- import { embedHeaderHeight } from '@atlaskit/smart-card';
20
- import { wrapperStyle, Resizer, handleSides, imageAlignmentMap, snapTo, calcMediaPxWidth } from '@atlaskit/editor-common/ui';
21
- import { embedSpacingStyles } from '@atlaskit/editor-common/styles';
22
- var ResizableEmbedCard = /*#__PURE__*/function (_React$Component) {
23
- _inherits(ResizableEmbedCard, _React$Component);
24
- var _super = _createSuper(ResizableEmbedCard);
25
- function ResizableEmbedCard() {
26
- var _this;
27
- _classCallCheck(this, ResizableEmbedCard);
28
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
29
- args[_key] = arguments[_key];
30
- }
31
- _this = _super.call.apply(_super, [this].concat(args));
32
- _defineProperty(_assertThisInitialized(_this), "state", {
33
- offsetLeft: _this.calcOffsetLeft()
34
- });
35
- _defineProperty(_assertThisInitialized(_this), "calcNewSize", function (newWidth, stop) {
36
- var _this$props = _this.props,
37
- layout = _this$props.layout,
38
- state = _this$props.view.state;
39
- var newPct = calcPctFromPx(newWidth, _this.props.lineLength) * 100;
40
- _this.setState({
41
- resizedPctWidth: newPct
42
- });
43
- var newLayout = hasParentNodeOfType(state.schema.nodes.table)(state.selection) ? layout : _this.calcUnwrappedLayout(newPct, newWidth);
44
- if (newPct <= 100) {
45
- if (_this.wrappedLayout && (stop ? newPct !== 100 : true)) {
46
- newLayout = layout;
47
- }
48
- return {
49
- width: newPct,
50
- layout: newLayout
51
- };
52
- } else {
53
- return {
54
- width: _this.props.pctWidth || null,
55
- layout: newLayout
56
- };
57
- }
58
- });
59
- _defineProperty(_assertThisInitialized(_this), "calcUnwrappedLayout", function (pct, width) {
60
- if (pct <= 100) {
61
- return 'center';
62
- }
63
- if (width <= _this.wideLayoutWidth) {
64
- return 'wide';
65
- }
66
- return 'full-width';
67
- });
68
- _defineProperty(_assertThisInitialized(_this), "calcColumnLeftOffset", function () {
69
- var offsetLeft = _this.state.offsetLeft;
70
- return _this.insideInlineLike ? calcColumnsFromPx(offsetLeft, _this.props.lineLength, _this.props.gridSize) : 0;
71
- });
72
- _defineProperty(_assertThisInitialized(_this), "calcPxWidth", function (useLayout) {
73
- var _this$props2 = _this.props,
74
- layout = _this$props2.layout,
75
- pctWidth = _this$props2.pctWidth,
76
- lineLength = _this$props2.lineLength,
77
- containerWidth = _this$props2.containerWidth,
78
- fullWidthMode = _this$props2.fullWidthMode,
79
- getPos = _this$props2.getPos,
80
- state = _this$props2.view.state;
81
- var resizedPctWidth = _this.state.resizedPctWidth;
82
- var pos = typeof getPos === 'function' ? getPos() : undefined;
83
- return calcMediaPxWidth({
84
- origWidth: DEFAULT_EMBED_CARD_WIDTH,
85
- origHeight: DEFAULT_EMBED_CARD_HEIGHT,
86
- pctWidth: pctWidth,
87
- state: state,
88
- containerWidth: {
89
- width: containerWidth,
90
- lineLength: lineLength
91
- },
92
- isFullWidthModeEnabled: fullWidthMode,
93
- layout: useLayout || layout,
94
- pos: pos,
95
- resizedPctWidth: resizedPctWidth
96
- });
97
- });
98
- _defineProperty(_assertThisInitialized(_this), "highlights", function (newWidth, snapPoints) {
99
- var snapWidth = snapTo(newWidth, snapPoints);
100
- var _this$props$view$stat = _this.props.view.state.schema.nodes,
101
- layoutColumn = _this$props$view$stat.layoutColumn,
102
- table = _this$props$view$stat.table,
103
- expand = _this$props$view$stat.expand,
104
- nestedExpand = _this$props$view$stat.nestedExpand;
105
- if (_this.$pos && !!findParentNodeOfTypeClosestToPos(_this.$pos, [layoutColumn, table, expand, nestedExpand].filter(Boolean))) {
106
- return [];
107
- }
108
- if (snapWidth > _this.wideLayoutWidth) {
109
- return ['full-width'];
110
- }
111
- var _this$props3 = _this.props,
112
- layout = _this$props3.layout,
113
- lineLength = _this$props3.lineLength,
114
- gridSize = _this$props3.gridSize;
115
- var columns = calcColumnsFromPx(snapWidth, lineLength, gridSize);
116
- var columnWidth = Math.round(columns);
117
- var highlight = [];
118
- if (layout === 'wrap-left' || layout === 'align-start') {
119
- highlight.push(0, columnWidth);
120
- } else if (layout === 'wrap-right' || layout === 'align-end') {
121
- highlight.push(gridSize, gridSize - columnWidth);
122
- } else if (_this.insideInlineLike) {
123
- highlight.push(Math.round(columns + _this.calcColumnLeftOffset()));
124
- } else {
125
- highlight.push(Math.floor((gridSize - columnWidth) / 2), Math.ceil((gridSize + columnWidth) / 2));
126
- }
127
- return highlight;
128
- });
129
- return _this;
130
- }
131
- _createClass(ResizableEmbedCard, [{
132
- key: "componentDidUpdate",
133
- value: function componentDidUpdate() {
134
- var offsetLeft = this.calcOffsetLeft();
135
- if (offsetLeft !== this.state.offsetLeft && offsetLeft >= 0) {
136
- this.setState({
137
- offsetLeft: offsetLeft
138
- });
139
- }
140
- }
141
- }, {
142
- key: "wrappedLayout",
143
- get: function get() {
144
- return wrappedLayouts.indexOf(this.props.layout) > -1;
145
- }
146
- }, {
147
- key: "UNSAFE_componentWillReceiveProps",
148
- value: function UNSAFE_componentWillReceiveProps(nextProps) {
149
- if (this.props.layout !== nextProps.layout) {
150
- this.checkLayout(this.props.layout, nextProps.layout);
151
- }
152
- }
153
-
154
- /**
155
- * When returning to center layout from a wrapped/aligned layout, it might actually
156
- * be wide or full-width
157
- */
158
- }, {
159
- key: "checkLayout",
160
- value: function checkLayout(oldLayout, newLayout) {
161
- var resizedPctWidth = this.state.resizedPctWidth;
162
- if (wrappedLayouts.indexOf(oldLayout) > -1 && newLayout === 'center' && resizedPctWidth) {
163
- var layout = this.calcUnwrappedLayout(resizedPctWidth, this.calcPxWidth(newLayout));
164
- this.props.updateSize(resizedPctWidth, layout);
165
- }
166
- }
167
- }, {
168
- key: "$pos",
169
- get: function get() {
170
- if (typeof this.props.getPos !== 'function') {
171
- return null;
172
- }
173
- var pos = this.props.getPos();
174
- if (Number.isNaN(pos) || typeof pos !== 'number') {
175
- return null;
176
- }
177
-
178
- // need to pass view because we may not get updated props in time
179
- return this.props.view.state.doc.resolve(pos);
180
- }
181
-
182
- /**
183
- * The maxmimum number of grid columns this node can resize to.
184
- */
185
- }, {
186
- key: "gridWidth",
187
- get: function get() {
188
- var gridSize = this.props.gridSize;
189
- return !(this.wrappedLayout || this.insideInlineLike) ? gridSize / 2 : gridSize;
190
- }
191
- }, {
192
- key: "calcOffsetLeft",
193
- value: function calcOffsetLeft() {
194
- var offsetLeft = 0;
195
- if (this.wrapper && this.insideInlineLike) {
196
- var currentNode = this.wrapper;
197
- var boundingRect = currentNode.getBoundingClientRect();
198
- var pmRect = this.props.view.dom.getBoundingClientRect();
199
- offsetLeft = boundingRect.left - pmRect.left;
200
- }
201
- return offsetLeft;
202
- }
203
- }, {
204
- key: "wideLayoutWidth",
205
- get: function get() {
206
- var lineLength = this.props.lineLength;
207
- if (lineLength) {
208
- return Math.ceil(lineLength * breakoutWideScaleRatio);
209
- } else {
210
- return akEditorWideLayoutWidth;
211
- }
212
- }
213
- }, {
214
- key: "calcSnapPoints",
215
- value: function calcSnapPoints() {
216
- var offsetLeft = this.state.offsetLeft;
217
- var _this$props4 = this.props,
218
- containerWidth = _this$props4.containerWidth,
219
- lineLength = _this$props4.lineLength;
220
- var snapTargets = [];
221
- for (var i = 0; i < this.gridWidth; i++) {
222
- snapTargets.push(calcPxFromColumns(i, lineLength, this.gridWidth) - offsetLeft);
223
- }
224
- // full width
225
- snapTargets.push(lineLength - offsetLeft);
226
- var minimumWidth = calcPxFromColumns(this.wrappedLayout || this.insideInlineLike ? 1 : 2, lineLength, this.props.gridSize);
227
- var snapPoints = snapTargets.filter(function (width) {
228
- return width >= minimumWidth;
229
- });
230
- var $pos = this.$pos;
231
- if (!$pos) {
232
- return snapPoints;
233
- }
234
- var isTopLevel = $pos.parent.type.name === 'doc';
235
- if (isTopLevel) {
236
- snapPoints.push(this.wideLayoutWidth);
237
- var fullWidthPoint = containerWidth - akEditorBreakoutPadding;
238
- if (fullWidthPoint > this.wideLayoutWidth) {
239
- snapPoints.push(fullWidthPoint);
240
- }
241
- }
242
- return snapPoints;
243
- }
244
- }, {
245
- key: "insideInlineLike",
246
- get: function get() {
247
- var $pos = this.$pos;
248
- if (!$pos) {
249
- return false;
250
- }
251
- var listItem = this.props.view.state.schema.nodes.listItem;
252
- return !!findParentNodeOfTypeClosestToPos($pos, [listItem]);
253
- }
254
- }, {
255
- key: "getHeightDefiningComponent",
256
- value:
257
- /**
258
- * Previously height of the box was controlled with paddingTop/paddingBottom trick inside Wrapper.
259
- * It allowed height to be defined by a given percent ratio and so absolute value was defined by actual width.
260
- * Also, it was part of styled component, which was fine because it was static through out life time of component.
261
- *
262
- * Now, two things changed:
263
- * 1. If `height` is present we take it as actual height of the box, and hence we don't need
264
- * (or even can't have, due to lack of width value) paddingTop trick.
265
- * 2. Since `height` can be changing through out life time of a component, we can't have it as part of styled component,
266
- * and hence we use `style` prop.
267
- */
268
- function getHeightDefiningComponent() {
269
- var _this$props5 = this.props,
270
- height = _this$props5.height,
271
- aspectRatio = _this$props5.aspectRatio;
272
- var heightDefiningStyles;
273
- if (height) {
274
- heightDefiningStyles = {
275
- height: "".concat(height, "px")
276
- };
277
- } else {
278
- // paddingBottom css trick defines ratio of `iframe height (y) + header (32)` to `width (x)`,
279
- // where is `aspectRatio` defines iframe aspectRatio alone
280
- // So, visually:
281
- //
282
- // x
283
- // ┌──────────┐
284
- // │ header │ 32
285
- // ├──────────┤
286
- // │ │
287
- // │ iframe │ y
288
- // │ │
289
- // └──────────┘
290
- //
291
- // aspectRatio = x / y
292
- // paddingBottom = (y + 32) / x
293
- // which can be achieved with css calc() as (1 / (x/y)) * 100)% + 32px
294
- heightDefiningStyles = {
295
- paddingBottom: "calc(".concat((1 / aspectRatio * 100).toFixed(3), "% + ").concat(embedHeaderHeight, "px)")
296
- };
297
- }
298
- return jsx("span", {
299
- "data-testid": 'resizable-embed-card-height-definer',
300
- style: _objectSpread({
301
- display: 'block',
302
- /* Fixes extra padding problem in Firefox */
303
- fontSize: 0,
304
- lineHeight: 0
305
- }, heightDefiningStyles)
306
- });
307
- }
308
- }, {
309
- key: "render",
310
- value: function render() {
311
- var _this2 = this;
312
- var _this$props6 = this.props,
313
- layout = _this$props6.layout,
314
- pctWidth = _this$props6.pctWidth,
315
- containerWidth = _this$props6.containerWidth,
316
- fullWidthMode = _this$props6.fullWidthMode,
317
- children = _this$props6.children;
318
- var initialWidth = this.calcPxWidth() - akEditorMediaResizeHandlerPaddingWide;
319
- var enable = {};
320
- handleSides.forEach(function (side) {
321
- var oppositeSide = side === 'left' ? 'right' : 'left';
322
- enable[side] = ['full-width', 'wide', 'center'].concat("wrap-".concat(oppositeSide)).concat("align-".concat(imageAlignmentMap[oppositeSide])).indexOf(layout) > -1;
323
- if (side === 'left' && _this2.insideInlineLike) {
324
- enable[side] = false;
325
- }
326
- });
327
- return jsx("div", {
328
- css: embedSpacingStyles,
329
- "data-testid": "resizable-embed-card-spacing"
330
- }, jsx("div", {
331
- css: wrapperStyle({
332
- layout: layout,
333
- isResized: !!pctWidth,
334
- containerWidth: containerWidth || DEFAULT_EMBED_CARD_WIDTH,
335
- fullWidthMode: fullWidthMode
336
- })
337
- }, jsx(Resizer, _extends({}, this.props, {
338
- width: initialWidth // Starting or initial width of embed <iframe> itself.
339
- ,
340
- enable: enable,
341
- calcNewSize: this.calcNewSize,
342
- snapPoints: this.calcSnapPoints(),
343
- scaleFactor: !this.wrappedLayout && !this.insideInlineLike ? 2 : 1,
344
- highlights: this.highlights,
345
- innerPadding: akEditorMediaResizeHandlerPaddingWide,
346
- nodeType: "embed"
347
- }), children, this.getHeightDefiningComponent())));
348
- }
349
- }]);
350
- return ResizableEmbedCard;
351
- }(React.Component);
352
- _defineProperty(ResizableEmbedCard, "defaultProps", {
353
- aspectRatio: DEFAULT_EMBED_CARD_WIDTH / DEFAULT_EMBED_CARD_HEIGHT
354
- });
355
- export { ResizableEmbedCard as default };
@@ -1,11 +0,0 @@
1
- /** @jsx jsx */
2
- import { jsx } from '@emotion/react';
3
- import EditIcon from '@atlaskit/icon/glyph/edit';
4
- import { editIconStyles } from '@atlaskit/editor-common/styles';
5
- export var SmallerEditIcon = function SmallerEditIcon() {
6
- return jsx("div", {
7
- css: editIconStyles
8
- }, jsx(EditIcon, {
9
- label: "edit"
10
- }));
11
- };
@@ -1,48 +0,0 @@
1
- import { NodeSelection } from 'prosemirror-state';
2
- import { pluginKey } from './pm-plugins/plugin-key';
3
- export var appearanceForNodeType = function appearanceForNodeType(spec) {
4
- if (spec.name === 'inlineCard') {
5
- return 'inline';
6
- } else if (spec.name === 'blockCard') {
7
- return 'block';
8
- } else if (spec.name === 'embedCard') {
9
- return 'embed';
10
- }
11
- return;
12
- };
13
- export var selectedCardAppearance = function selectedCardAppearance(state) {
14
- if (state.selection instanceof NodeSelection) {
15
- return appearanceForNodeType(state.selection.node.type);
16
- }
17
- };
18
- export var titleUrlPairFromNode = function titleUrlPairFromNode(node) {
19
- var attrs = node.attrs;
20
- return {
21
- url: attrs.url || attrs.data && attrs.data.url,
22
- title: attrs.data && attrs.data.title
23
- };
24
- };
25
-
26
- /**
27
- * Merges the title and url from attributes and CardInfo from the resolved view, preferring the CardInfo.
28
- * @param titleUrlPair title and url information from the node attributes
29
- * @param info information stored in state from the resolved UI component view
30
- */
31
- export var mergeCardInfo = function mergeCardInfo(titleUrlPair, info) {
32
- return {
33
- title: info && info.title || titleUrlPair.title,
34
- url: info && info.url || titleUrlPair.url
35
- };
36
- };
37
- export var displayInfoForCard = function displayInfoForCard(node, info) {
38
- return mergeCardInfo(titleUrlPairFromNode(node), info);
39
- };
40
- export var findCardInfo = function findCardInfo(state) {
41
- var pluginState = pluginKey.getState(state);
42
- if (!pluginState) {
43
- return undefined;
44
- }
45
- return pluginState.cards.find(function (cardInfo) {
46
- return cardInfo.pos === state.selection.from;
47
- });
48
- };
@@ -1,26 +0,0 @@
1
- import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
2
- import { CardPluginOptions } from './types';
3
- import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
4
- import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
5
- import type { widthPlugin } from '@atlaskit/editor-plugin-width';
6
- import type { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
7
- import type { gridPlugin } from '@atlaskit/editor-plugin-grid';
8
- import type { FloatingToolbarPlugin } from '@atlaskit/editor-plugin-floating-toolbar';
9
- import type { CardPluginActions } from '@atlaskit/editor-common/card';
10
- import { CardPluginState } from './types';
11
- import type { hyperlinkPlugin } from '@atlaskit/editor-plugin-hyperlink';
12
- declare const cardPlugin: NextEditorPlugin<'card', {
13
- pluginConfiguration: CardPluginOptions;
14
- dependencies: [
15
- typeof featureFlagsPlugin,
16
- typeof analyticsPlugin,
17
- typeof widthPlugin,
18
- typeof decorationsPlugin,
19
- typeof gridPlugin,
20
- FloatingToolbarPlugin,
21
- typeof hyperlinkPlugin
22
- ];
23
- sharedState: CardPluginState | null;
24
- actions: CardPluginActions;
25
- }>;
26
- export default cardPlugin;
@@ -1,12 +0,0 @@
1
- export declare const messages: {
2
- datasourceJiraIssue: {
3
- id: string;
4
- defaultMessage: string;
5
- description: string;
6
- };
7
- datasourceJiraIssueDescription: {
8
- id: string;
9
- defaultMessage: string;
10
- description: string;
11
- };
12
- };
@@ -1,26 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import { SmartCardProps } from './genericCard';
4
- import ReactNodeView from '@atlaskit/editor-common/react-node-view';
5
- export declare class BlockCardComponent extends React.PureComponent<SmartCardProps> {
6
- private scrollContainer?;
7
- onClick: () => void;
8
- static contextTypes: {
9
- contextAdapter: PropTypes.Requireable<object>;
10
- };
11
- UNSAFE_componentWillMount(): void;
12
- onResolve: (data: {
13
- url?: string | undefined;
14
- title?: string | undefined;
15
- }) => void;
16
- gapCursorSpan: () => JSX.Element | undefined;
17
- onError: ({ err }: {
18
- err?: Error | undefined;
19
- }) => void;
20
- render(): JSX.Element;
21
- }
22
- export type BlockCardNodeViewProps = Pick<SmartCardProps, 'platform' | 'showServerActions'>;
23
- export declare class BlockCard extends ReactNodeView<BlockCardNodeViewProps> {
24
- createDomRef(): HTMLElement;
25
- render(): JSX.Element;
26
- }
@@ -1,42 +0,0 @@
1
- /** @jsx jsx */
2
- import React from 'react';
3
- import PropTypes from 'prop-types';
4
- import { jsx } from '@emotion/react';
5
- import { Node as PMNode } from 'prosemirror-model';
6
- import { EditorView } from 'prosemirror-view';
7
- import ReactNodeView, { getPosHandler, ReactComponentProps } from '@atlaskit/editor-common/react-node-view';
8
- import { DatasourceTableLayout } from '../ui/LayoutButton/types';
9
- import { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
10
- import type { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
11
- import { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
12
- import type cardPlugin from '../index';
13
- interface DatasourceProps extends ReactComponentProps {
14
- node: PMNode;
15
- view: EditorView;
16
- getPos: getPosHandler;
17
- portalProviderAPI: PortalProviderAPI;
18
- eventDispatcher: EventDispatcher;
19
- hasIntlContext: boolean;
20
- pluginInjectionApi: ExtractInjectionAPI<typeof cardPlugin> | undefined;
21
- }
22
- interface DatasourceComponentProps extends ReactComponentProps, Pick<DatasourceProps, 'node' | 'view' | 'getPos'> {
23
- }
24
- export declare class DatasourceComponent extends React.PureComponent<DatasourceComponentProps> {
25
- static contextTypes: {
26
- contextAdapter: PropTypes.Requireable<object>;
27
- };
28
- constructor(props: DatasourceComponentProps);
29
- private getPosSafely;
30
- private getDatasource;
31
- private getTableView;
32
- handleColumnChange: (columnKeys: string[]) => void;
33
- render(): jsx.JSX.Element | null;
34
- }
35
- export declare class Datasource extends ReactNodeView<DatasourceProps> {
36
- private tableWidth;
37
- constructor(props: DatasourceProps);
38
- createDomRef(): HTMLElement;
39
- calcTableWidth: (layout: DatasourceTableLayout, containerWidth?: number) => number | 'inherit';
40
- render(): jsx.JSX.Element;
41
- }
42
- export {};
@@ -1,46 +0,0 @@
1
- import React from 'react';
2
- import { Node as PMNode } from 'prosemirror-model';
3
- import PropTypes from 'prop-types';
4
- import { SmartCardProps } from './genericCard';
5
- import { RichMediaLayout } from '@atlaskit/adf-schema';
6
- import ReactNodeView from '@atlaskit/editor-common/react-node-view';
7
- export type EmbedCardState = {
8
- hasPreview: boolean;
9
- liveHeight?: number;
10
- initialAspectRatio?: number;
11
- };
12
- export declare class EmbedCardComponent extends React.PureComponent<SmartCardProps, EmbedCardState> {
13
- private scrollContainer?;
14
- private embedIframeRef;
15
- onClick: () => void;
16
- static contextTypes: {
17
- contextAdapter: PropTypes.Requireable<object>;
18
- };
19
- state: EmbedCardState;
20
- UNSAFE_componentWillMount(): void;
21
- private getPosSafely;
22
- onResolve: (data: {
23
- url?: string | undefined;
24
- title?: string | undefined;
25
- aspectRatio?: number | undefined;
26
- }) => void;
27
- updateSize: (pctWidth: number | null, layout: RichMediaLayout) => true | undefined;
28
- private getLineLength;
29
- /**
30
- * Even though render is capable of listening and reacting to iframely wrapper iframe sent `resize` events
31
- * it's good idea to store latest actual height in ADF, so that when renderer (well, editor as well) is loading
32
- * we will show embed window of appropriate size and avoid unnecessary content jumping.
33
- */
34
- saveOriginalDimensionsAttributes: (height: number, width: number | undefined) => void;
35
- onHeightUpdate: (height: number) => void;
36
- onError: ({ err }: {
37
- err?: Error | undefined;
38
- }) => void;
39
- render(): JSX.Element;
40
- }
41
- export type EmbedCardNodeViewProps = Pick<SmartCardProps, 'eventDispatcher' | 'allowResizing' | 'platform' | 'fullWidthMode' | 'dispatchAnalyticsEvent' | 'pluginInjectionApi'>;
42
- export declare class EmbedCard extends ReactNodeView<EmbedCardNodeViewProps> {
43
- viewShouldUpdate(nextNode: PMNode): boolean;
44
- createDomRef(): HTMLElement;
45
- render(): JSX.Element;
46
- }
@@ -1,37 +0,0 @@
1
- import React from 'react';
2
- import { Node as PMNode } from 'prosemirror-model';
3
- import { EditorView } from 'prosemirror-view';
4
- import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
5
- import { CardPlatform } from '@atlaskit/smart-card';
6
- import { SmartCardContext } from '@atlaskit/link-provider';
7
- import { getPosHandler, ReactComponentProps } from '@atlaskit/editor-common/react-node-view';
8
- import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
9
- import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
10
- import { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
11
- import type cardPlugin from '../index';
12
- export type EditorContext<T> = React.Context<T> & {
13
- value: T;
14
- };
15
- export interface CardNodeViewProps extends ReactComponentProps {
16
- providerFactory?: ProviderFactory;
17
- platform?: CardPlatform;
18
- eventDispatcher?: EventDispatcher<any>;
19
- }
20
- export interface CardProps extends CardNodeViewProps {
21
- children?: React.ReactNode;
22
- node: PMNode;
23
- view: EditorView;
24
- getPos: getPosHandler;
25
- dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
26
- isMobile?: boolean;
27
- eventDispatcher?: EventDispatcher<any>;
28
- allowResizing?: boolean;
29
- fullWidthMode?: boolean;
30
- useAlternativePreloader?: boolean;
31
- showServerActions?: boolean;
32
- pluginInjectionApi?: ExtractInjectionAPI<typeof cardPlugin>;
33
- }
34
- export interface SmartCardProps extends CardProps {
35
- cardContext?: EditorContext<typeof SmartCardContext>;
36
- }
37
- export declare function Card(SmartCardComponent: React.ComponentType<SmartCardProps>, UnsupportedComponent: React.ComponentType): React.ComponentType<CardProps>;
@@ -1,23 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import { SmartCardProps } from './genericCard';
4
- import type { InlineNodeViewComponentProps } from '@atlaskit/editor-common/react-node-view';
5
- export declare class InlineCardComponent extends React.PureComponent<SmartCardProps> {
6
- private scrollContainer?;
7
- private onClick;
8
- static contextTypes: {
9
- contextAdapter: PropTypes.Requireable<object>;
10
- };
11
- UNSAFE_componentWillMount(): void;
12
- onResolve: (data: {
13
- url?: string | undefined;
14
- title?: string | undefined;
15
- }) => void;
16
- onError: (data: {
17
- url?: string | undefined;
18
- err?: Error | undefined;
19
- }) => void;
20
- render(): JSX.Element | null;
21
- }
22
- export type InlineCardNodeViewProps = Pick<SmartCardProps, 'useAlternativePreloader' | 'showServerActions'>;
23
- export declare function InlineCardNodeView(props: InlineNodeViewComponentProps & InlineCardNodeViewProps): JSX.Element;
@@ -1,23 +0,0 @@
1
- import { Transaction } from 'prosemirror-state';
2
- import { CardProvider } from '@atlaskit/editor-common/provider-factory';
3
- import { CardPluginAction, Request, CardInfo, SmartLinkEventsNext } from '../types';
4
- import { SmartLinkEvents } from '@atlaskit/smart-card';
5
- import { DatasourceTableLayout } from '../ui/LayoutButton/types';
6
- import { DatasourceModalType } from '@atlaskit/editor-common/types';
7
- export declare const cardAction: (tr: Transaction, action: CardPluginAction) => Transaction;
8
- export declare const resolveCard: (url: string) => (tr: Transaction) => Transaction;
9
- export declare const queueCards: (requests: Request[]) => (tr: Transaction) => Transaction;
10
- export declare const registerCard: (info: CardInfo) => (tr: Transaction) => Transaction;
11
- export declare const registerSmartCardEvents: (smartLinkEvents: SmartLinkEvents) => (tr: Transaction) => Transaction;
12
- export declare const registerSmartCardEventsNext: (smartLinkEvents: SmartLinkEventsNext) => (tr: Transaction) => Transaction;
13
- export declare const setProvider: (cardProvider: CardProvider | null) => (tr: Transaction) => Transaction;
14
- export declare const setDatasourceTableRef: (datasourceTableRef?: HTMLElement) => (tr: Transaction) => Transaction;
15
- export declare const setCardLayout: (layout: DatasourceTableLayout) => (tr: Transaction) => Transaction;
16
- export declare const setCardLayoutAndDatasourceTableRef: ({ layout, datasourceTableRef, }: {
17
- layout: DatasourceTableLayout;
18
- datasourceTableRef?: HTMLElement | undefined;
19
- }) => (tr: Transaction) => Transaction;
20
- export declare const showLinkToolbar: (tr: Transaction) => Transaction;
21
- export declare const hideLinkToolbar: (tr: Transaction) => Transaction;
22
- export declare const showDatasourceModal: (modalType: DatasourceModalType) => (tr: Transaction) => Transaction;
23
- export declare const hideDatasourceModal: (tr: Transaction) => Transaction;
@@ -1,10 +0,0 @@
1
- import { LifecycleEvent, SmartLinkEventsNext } from '../../types';
2
- /**
3
- * Simple mechanism to defer analytics related callbacks
4
- */
5
- export declare const createAnalyticsQueue: (enabled?: boolean) => {
6
- push: (...events: LifecycleEvent[]) => void;
7
- flush: () => void;
8
- setCallbacks: (callbacks: SmartLinkEventsNext) => void;
9
- getSize: () => number;
10
- };