@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,396 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.EmbedCardComponent = exports.EmbedCard = void 0;
8
- var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
9
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
10
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
11
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
12
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
13
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
14
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
15
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
16
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
17
- var _react = _interopRequireDefault(require("react"));
18
- var _smartCard = require("@atlaskit/smart-card");
19
- var _propTypes = _interopRequireDefault(require("prop-types"));
20
- var _rafSchd = _interopRequireDefault(require("raf-schd"));
21
- var _genericCard = require("./genericCard");
22
- var _ui = require("@atlaskit/editor-common/ui");
23
- var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
24
- var _reactNodeView = _interopRequireDefault(require("@atlaskit/editor-common/react-node-view"));
25
- var _actions = require("../pm-plugins/actions");
26
- var _ResizableEmbedCard = _interopRequireDefault(require("../ui/ResizableEmbedCard"));
27
- var _utils = require("@atlaskit/editor-common/utils");
28
- var _steps = require("@atlaskit/adf-schema/steps");
29
- var _hooks = require("@atlaskit/editor-common/hooks");
30
- 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; }
31
- 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) { (0, _defineProperty2.default)(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; }
32
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
33
- 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; } }
34
- var CardInner = function CardInner(_ref) {
35
- var pluginInjectionApi = _ref.pluginInjectionApi,
36
- getPosSafely = _ref.getPosSafely,
37
- getLineLength = _ref.getLineLength,
38
- view = _ref.view,
39
- smartCard = _ref.smartCard,
40
- eventDispatcher = _ref.eventDispatcher,
41
- updateSize = _ref.updateSize,
42
- getPos = _ref.getPos,
43
- aspectRatio = _ref.aspectRatio,
44
- allowResizing = _ref.allowResizing,
45
- hasPreview = _ref.hasPreview,
46
- heightAlone = _ref.heightAlone,
47
- cardProps = _ref.cardProps,
48
- dispatchAnalyticsEvent = _ref.dispatchAnalyticsEvent;
49
- var _useSharedPluginState = (0, _hooks.useSharedPluginState)(pluginInjectionApi, ['width']),
50
- widthState = _useSharedPluginState.widthState;
51
- var widthStateLineLength = (widthState === null || widthState === void 0 ? void 0 : widthState.lineLength) || 0;
52
- var widthStateWidth = (widthState === null || widthState === void 0 ? void 0 : widthState.width) || 0;
53
- var pos = getPosSafely();
54
- if (pos === undefined) {
55
- return null;
56
- }
57
- var lineLength = getLineLength(view, pos, widthStateLineLength);
58
- var containerWidth = (0, _utils.isRichMediaInsideOfBlockNode)(view, pos) ? lineLength : widthStateWidth;
59
- if (!allowResizing || !hasPreview) {
60
- // There are two ways `width` and `height` can be defined here:
61
- // 1) Either as `heightAlone` as height value and no width
62
- // 2) or as `1` for height and aspectRation (defined or a default one) as a width
63
- // See above for how aspectRation is calculated.
64
- var defaultAspectRatio = _editorSharedStyles.DEFAULT_EMBED_CARD_WIDTH / _editorSharedStyles.DEFAULT_EMBED_CARD_HEIGHT;
65
- var richMediaWrapperHeight = 1;
66
- var richMediaWrapperWidth = aspectRatio || defaultAspectRatio;
67
- if (heightAlone) {
68
- richMediaWrapperHeight = heightAlone;
69
- richMediaWrapperWidth = undefined;
70
- }
71
- return /*#__PURE__*/_react.default.createElement(_ui.MediaSingle, (0, _extends2.default)({}, cardProps, {
72
- height: richMediaWrapperHeight,
73
- width: richMediaWrapperWidth,
74
- nodeType: "embedCard",
75
- hasFallbackContainer: hasPreview,
76
- lineLength: lineLength,
77
- containerWidth: containerWidth
78
- }), smartCard);
79
- }
80
- var displayGrid = function displayGrid(visible, gridType, highlight) {
81
- var _pluginInjectionApi$d;
82
- return pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d = pluginInjectionApi.dependencies.grid.actions) === null || _pluginInjectionApi$d === void 0 ? void 0 : _pluginInjectionApi$d.displayGrid(view)({
83
- visible: visible,
84
- gridType: gridType,
85
- highlight: highlight
86
- });
87
- };
88
- return /*#__PURE__*/_react.default.createElement(_ResizableEmbedCard.default, (0, _extends2.default)({}, cardProps, {
89
- height: heightAlone,
90
- aspectRatio: aspectRatio,
91
- view: view,
92
- getPos: getPos,
93
- lineLength: lineLength,
94
- gridSize: 12,
95
- containerWidth: containerWidth,
96
- displayGrid: displayGrid,
97
- updateSize: updateSize,
98
- dispatchAnalyticsEvent: dispatchAnalyticsEvent
99
- }), smartCard);
100
- };
101
- var EmbedCardComponent = /*#__PURE__*/function (_React$PureComponent) {
102
- (0, _inherits2.default)(EmbedCardComponent, _React$PureComponent);
103
- var _super = _createSuper(EmbedCardComponent);
104
- function EmbedCardComponent() {
105
- var _this;
106
- (0, _classCallCheck2.default)(this, EmbedCardComponent);
107
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
108
- args[_key] = arguments[_key];
109
- }
110
- _this = _super.call.apply(_super, [this].concat(args));
111
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "embedIframeRef", /*#__PURE__*/_react.default.createRef());
112
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onClick", function () {});
113
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", {
114
- hasPreview: true
115
- });
116
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getPosSafely", function () {
117
- var getPos = _this.props.getPos;
118
- if (!getPos || typeof getPos === 'boolean') {
119
- return;
120
- }
121
- try {
122
- return getPos();
123
- } catch (e) {
124
- // Can blow up in rare cases, when node has been removed.
125
- }
126
- });
127
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onResolve", function (data) {
128
- var view = _this.props.view;
129
- var title = data.title,
130
- url = data.url,
131
- aspectRatio = data.aspectRatio;
132
- var _this$props$node$attr = _this.props.node.attrs,
133
- originalHeight = _this$props$node$attr.originalHeight,
134
- originalWidth = _this$props$node$attr.originalWidth;
135
- if (aspectRatio && !originalHeight && !originalWidth) {
136
- // Assumption here is if ADF already have both height and width set,
137
- // we will going to use that later on in this class as aspectRatio
138
- // Most likely we dealing with an embed that received aspectRatio via onResolve previously
139
- // and now this information already stored in ADF.
140
- _this.setState({
141
- initialAspectRatio: aspectRatio
142
- });
143
- _this.saveOriginalDimensionsAttributes(_editorSharedStyles.DEFAULT_EMBED_CARD_HEIGHT, _editorSharedStyles.DEFAULT_EMBED_CARD_HEIGHT * aspectRatio);
144
- }
145
-
146
- // don't dispatch immediately since we might be in the middle of
147
- // rendering a nodeview
148
- (0, _rafSchd.default)(function () {
149
- var pos = _this.getPosSafely();
150
- if (pos === undefined) {
151
- return;
152
- }
153
- return view.dispatch((0, _actions.registerCard)({
154
- title: title,
155
- url: url,
156
- pos: pos
157
- })(view.state.tr));
158
- })();
159
- try {
160
- var cardContext = _this.context.contextAdapter ? _this.context.contextAdapter.card : undefined;
161
- var hasPreview = cardContext && cardContext.value.extractors.getPreview(url, _this.props.platform);
162
- if (!hasPreview) {
163
- _this.setState({
164
- hasPreview: false
165
- });
166
- }
167
- } catch (e) {}
168
- });
169
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "updateSize", function (pctWidth, layout) {
170
- var _this$props$view = _this.props.view,
171
- state = _this$props$view.state,
172
- dispatch = _this$props$view.dispatch;
173
- var pos = _this.getPosSafely();
174
- if (pos === undefined) {
175
- return;
176
- }
177
- var tr = state.tr.setNodeMarkup(pos, undefined, _objectSpread(_objectSpread({}, _this.props.node.attrs), {}, {
178
- width: pctWidth,
179
- layout: layout
180
- }));
181
- tr.setMeta('scrollIntoView', false);
182
- dispatch(tr);
183
- return true;
184
- });
185
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getLineLength", function (view, pos, originalLineLength) {
186
- if (typeof pos === 'number' && (0, _utils.isRichMediaInsideOfBlockNode)(view, pos)) {
187
- var $pos = view.state.doc.resolve(pos);
188
- var domNode = view.nodeDOM($pos.pos);
189
- if ($pos.nodeAfter && _utils.floatingLayouts.indexOf($pos.nodeAfter.attrs.layout) > -1 && domNode && domNode.parentElement) {
190
- return domNode.parentElement.offsetWidth;
191
- }
192
- if (domNode instanceof HTMLElement) {
193
- return domNode.offsetWidth;
194
- }
195
- }
196
- return originalLineLength;
197
- });
198
- /**
199
- * Even though render is capable of listening and reacting to iframely wrapper iframe sent `resize` events
200
- * it's good idea to store latest actual height in ADF, so that when renderer (well, editor as well) is loading
201
- * we will show embed window of appropriate size and avoid unnecessary content jumping.
202
- */
203
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "saveOriginalDimensionsAttributes", function (height, width) {
204
- var view = _this.props.view;
205
-
206
- // TODO: ED-15663
207
- // Please, do not copy or use this kind of code below
208
- // @ts-ignore
209
- var fakeTableResizePluginKey = {
210
- key: 'tableFlexiColumnResizing$',
211
- getState: function getState(state) {
212
- return state['tableFlexiColumnResizing$'];
213
- }
214
- };
215
- var fakeTableResizeState = fakeTableResizePluginKey.getState(view.state);
216
-
217
- // We are not updating ADF when this function fired while table is resizing.
218
- // Changing ADF in the middle of resize will break table resize plugin logic
219
- // (tables will be considered different at the end of the drag and cell size won't be stored)
220
- // But this is not a big problem, editor user will be seeing latest height anyway (via updated state)
221
- // And even if page to be saved with slightly outdated height, renderer is capable of reading latest height value
222
- // when embed loads, and so it won't be a problem.
223
- if (fakeTableResizeState !== null && fakeTableResizeState !== void 0 && fakeTableResizeState.dragging) {
224
- return;
225
- }
226
- (0, _rafSchd.default)(function () {
227
- var pos = _this.getPosSafely();
228
- if (pos === undefined) {
229
- return;
230
- }
231
- view.dispatch(view.state.tr.step(new _steps.SetAttrsStep(pos, {
232
- originalHeight: height,
233
- originalWidth: width
234
- })).setMeta('addToHistory', false));
235
- })();
236
- });
237
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onHeightUpdate", function (height) {
238
- _this.setState({
239
- liveHeight: height
240
- });
241
- _this.saveOriginalDimensionsAttributes(height, undefined);
242
- });
243
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onError", function (_ref2) {
244
- var err = _ref2.err;
245
- if (err) {
246
- throw err;
247
- }
248
- });
249
- return _this;
250
- }
251
- (0, _createClass2.default)(EmbedCardComponent, [{
252
- key: "UNSAFE_componentWillMount",
253
- value: function UNSAFE_componentWillMount() {
254
- var view = this.props.view;
255
- var scrollContainer = (0, _ui.findOverflowScrollParent)(view.dom);
256
- this.scrollContainer = scrollContainer || undefined;
257
- }
258
- }, {
259
- key: "render",
260
- value: function render() {
261
- var _this$props = this.props,
262
- node = _this$props.node,
263
- cardContext = _this$props.cardContext,
264
- platform = _this$props.platform,
265
- allowResizing = _this$props.allowResizing,
266
- fullWidthMode = _this$props.fullWidthMode,
267
- view = _this$props.view,
268
- dispatchAnalyticsEvent = _this$props.dispatchAnalyticsEvent,
269
- getPos = _this$props.getPos,
270
- pluginInjectionApi = _this$props.pluginInjectionApi;
271
- var _node$attrs = node.attrs,
272
- url = _node$attrs.url,
273
- pctWidth = _node$attrs.width,
274
- layout = _node$attrs.layout,
275
- originalHeight = _node$attrs.originalHeight,
276
- originalWidth = _node$attrs.originalWidth;
277
- var _this$state = this.state,
278
- hasPreview = _this$state.hasPreview,
279
- liveHeight = _this$state.liveHeight,
280
- initialAspectRatio = _this$state.initialAspectRatio;
281
-
282
- // We don't want to use `originalHeight` when `originalWidth` also present,
283
- // since `heightAlone` is defined only when just height is available.
284
- var heightAlone = liveHeight !== null && liveHeight !== void 0 ? liveHeight : !originalWidth && originalHeight || undefined;
285
- var aspectRatio = !heightAlone && (
286
- // No need getting aspectRatio if heightAlone defined already
287
- initialAspectRatio ||
288
- // If we have initialAspectRatio (coming from iframely) we should go with that
289
- originalHeight && originalWidth && originalWidth / originalHeight) ||
290
- // If ADF contains both width and height we get ratio from that
291
- undefined;
292
- var cardProps = {
293
- layout: layout,
294
- pctWidth: pctWidth,
295
- fullWidthMode: fullWidthMode
296
- };
297
- var smartCard = /*#__PURE__*/_react.default.createElement(_smartCard.Card, {
298
- key: url,
299
- url: url,
300
- appearance: "embed",
301
- onClick: this.onClick,
302
- onResolve: this.onResolve,
303
- onError: this.onError,
304
- showActions: platform === 'web',
305
- isFrameVisible: true,
306
- inheritDimensions: true,
307
- platform: platform,
308
- container: this.scrollContainer,
309
- embedIframeRef: this.embedIframeRef
310
- });
311
- var cardInner = /*#__PURE__*/_react.default.createElement(_smartCard.EmbedResizeMessageListener, {
312
- embedIframeRef: this.embedIframeRef,
313
- onHeightUpdate: this.onHeightUpdate
314
- }, /*#__PURE__*/_react.default.createElement(CardInner, {
315
- pluginInjectionApi: pluginInjectionApi,
316
- smartCard: smartCard,
317
- hasPreview: hasPreview,
318
- getPosSafely: this.getPosSafely,
319
- view: view,
320
- getLineLength: this.getLineLength,
321
- eventDispatcher: this.props.eventDispatcher,
322
- updateSize: this.updateSize,
323
- getPos: getPos,
324
- aspectRatio: aspectRatio,
325
- allowResizing: allowResizing,
326
- heightAlone: heightAlone,
327
- cardProps: cardProps,
328
- dispatchAnalyticsEvent: dispatchAnalyticsEvent
329
- }));
330
-
331
- // [WS-2307]: we only render card wrapped into a Provider when the value is ready
332
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, cardContext && cardContext.value ? /*#__PURE__*/_react.default.createElement(cardContext.Provider, {
333
- value: cardContext.value
334
- }, cardInner) : null);
335
- }
336
- }]);
337
- return EmbedCardComponent;
338
- }(_react.default.PureComponent);
339
- exports.EmbedCardComponent = EmbedCardComponent;
340
- (0, _defineProperty2.default)(EmbedCardComponent, "contextTypes", {
341
- contextAdapter: _propTypes.default.object
342
- });
343
- var WrappedBlockCard = (0, _genericCard.Card)(EmbedCardComponent, _ui.UnsupportedBlock);
344
- var EmbedCard = /*#__PURE__*/function (_ReactNodeView) {
345
- (0, _inherits2.default)(EmbedCard, _ReactNodeView);
346
- var _super2 = _createSuper(EmbedCard);
347
- function EmbedCard() {
348
- (0, _classCallCheck2.default)(this, EmbedCard);
349
- return _super2.apply(this, arguments);
350
- }
351
- (0, _createClass2.default)(EmbedCard, [{
352
- key: "viewShouldUpdate",
353
- value: function viewShouldUpdate(nextNode) {
354
- if (this.node.attrs !== nextNode.attrs) {
355
- return true;
356
- }
357
- return (0, _get2.default)((0, _getPrototypeOf2.default)(EmbedCard.prototype), "viewShouldUpdate", this).call(this, nextNode);
358
- }
359
- }, {
360
- key: "createDomRef",
361
- value: function createDomRef() {
362
- var domRef = document.createElement('div');
363
- if (this.reactComponentProps.platform !== 'mobile') {
364
- // workaround Chrome bug in https://product-fabric.atlassian.net/browse/ED-5379
365
- // see also: https://github.com/ProseMirror/prosemirror/issues/884
366
- domRef.contentEditable = 'true';
367
- domRef.setAttribute('spellcheck', 'false');
368
- }
369
- return domRef;
370
- }
371
- }, {
372
- key: "render",
373
- value: function render() {
374
- var _this$reactComponentP = this.reactComponentProps,
375
- eventDispatcher = _this$reactComponentP.eventDispatcher,
376
- allowResizing = _this$reactComponentP.allowResizing,
377
- platform = _this$reactComponentP.platform,
378
- fullWidthMode = _this$reactComponentP.fullWidthMode,
379
- dispatchAnalyticsEvent = _this$reactComponentP.dispatchAnalyticsEvent,
380
- pluginInjectionApi = _this$reactComponentP.pluginInjectionApi;
381
- return /*#__PURE__*/_react.default.createElement(WrappedBlockCard, {
382
- node: this.node,
383
- view: this.view,
384
- eventDispatcher: eventDispatcher,
385
- getPos: this.getPos,
386
- allowResizing: allowResizing,
387
- platform: platform,
388
- fullWidthMode: fullWidthMode,
389
- dispatchAnalyticsEvent: dispatchAnalyticsEvent,
390
- pluginInjectionApi: pluginInjectionApi
391
- });
392
- }
393
- }]);
394
- return EmbedCard;
395
- }(_reactNodeView.default);
396
- exports.EmbedCard = EmbedCard;
@@ -1,118 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.Card = Card;
8
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
10
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
11
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
12
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
13
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
14
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
15
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
16
- var _react = _interopRequireDefault(require("react"));
17
- var _propTypes = _interopRequireDefault(require("prop-types"));
18
- var _adfSchema = require("@atlaskit/adf-schema");
19
- var _utils = require("../utils");
20
- var _doc = require("../pm-plugins/doc");
21
- var _analyticsNext = require("@atlaskit/analytics-next");
22
- var _state = require("../pm-plugins/util/state");
23
- var _utils2 = require("@atlaskit/editor-common/utils");
24
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
25
- 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; } }
26
- function Card(SmartCardComponent, UnsupportedComponent) {
27
- var _class;
28
- return _class = /*#__PURE__*/function (_React$Component) {
29
- (0, _inherits2.default)(_class, _React$Component);
30
- var _super = _createSuper(_class);
31
- function _class() {
32
- var _this;
33
- (0, _classCallCheck2.default)(this, _class);
34
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
35
- args[_key] = arguments[_key];
36
- }
37
- _this = _super.call.apply(_super, [this].concat(args));
38
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", {
39
- isError: false
40
- });
41
- return _this;
42
- }
43
- (0, _createClass2.default)(_class, [{
44
- key: "render",
45
- value: function render() {
46
- var _getPluginState;
47
- var _titleUrlPairFromNode = (0, _utils.titleUrlPairFromNode)(this.props.node),
48
- url = _titleUrlPairFromNode.url;
49
- if (url && !(0, _adfSchema.isSafeUrl)(url)) {
50
- return /*#__PURE__*/_react.default.createElement(UnsupportedComponent, null);
51
- }
52
- if (this.state.isError) {
53
- if (url) {
54
- return /*#__PURE__*/_react.default.createElement("a", {
55
- href: url,
56
- onClick: function onClick(e) {
57
- e.preventDefault();
58
- }
59
- }, url);
60
- } else {
61
- return /*#__PURE__*/_react.default.createElement(UnsupportedComponent, null);
62
- }
63
- }
64
- var cardContext = this.context.contextAdapter ? this.context.contextAdapter.card : undefined;
65
- var editorAppearance = (_getPluginState = (0, _state.getPluginState)(this.props.view.state)) === null || _getPluginState === void 0 ? void 0 : _getPluginState.editorAppearance;
66
- var analyticsEditorAppearance = (0, _utils2.getAnalyticsEditorAppearance)(editorAppearance);
67
- return /*#__PURE__*/_react.default.createElement(_analyticsNext.AnalyticsContext, {
68
- data: {
69
- attributes: {
70
- location: analyticsEditorAppearance
71
- },
72
- // Below is added for the future implementation of Linking Platform namespaced analytics context
73
- location: analyticsEditorAppearance
74
- }
75
- }, /*#__PURE__*/_react.default.createElement(SmartCardComponent, (0, _extends2.default)({
76
- key: url,
77
- cardContext: cardContext
78
- }, this.props)));
79
- }
80
- }, {
81
- key: "componentDidCatch",
82
- value: function componentDidCatch(error) {
83
- var maybeAPIError = error;
84
- // NB: errors received in this component are propagated by the `@atlaskit/smart-card` component.
85
- // Depending on the kind of error, the expectation for this component is to either:
86
- // (1) Render a blue link whilst retaining `inlineCard` in the ADF (non-fatal errs);
87
- // (2) Render a blue link whilst downgrading to `link` in the ADF (fatal errs).
88
-
89
- if (maybeAPIError.kind && maybeAPIError.kind === 'fatal') {
90
- var _pluginInjectionApi$d;
91
- this.setState({
92
- isError: true
93
- });
94
- var _this$props = this.props,
95
- view = _this$props.view,
96
- node = _this$props.node,
97
- getPos = _this$props.getPos,
98
- pluginInjectionApi = _this$props.pluginInjectionApi;
99
- var _titleUrlPairFromNode2 = (0, _utils.titleUrlPairFromNode)(node),
100
- url = _titleUrlPairFromNode2.url;
101
- if (!getPos || typeof getPos === 'boolean') {
102
- return;
103
- }
104
- (0, _doc.changeSelectedCardToLinkFallback)(undefined, url, true, node, getPos(), pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d = pluginInjectionApi.dependencies.analytics) === null || _pluginInjectionApi$d === void 0 ? void 0 : _pluginInjectionApi$d.actions)(view.state, view.dispatch);
105
- return null;
106
- } else {
107
- // Otherwise, render a blue link as fallback (above in render()).
108
- this.setState({
109
- isError: true
110
- });
111
- }
112
- }
113
- }]);
114
- return _class;
115
- }(_react.default.Component), (0, _defineProperty2.default)(_class, "contextTypes", {
116
- contextAdapter: _propTypes.default.object
117
- }), _class;
118
- }
@@ -1,131 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.InlineCardComponent = void 0;
8
- exports.InlineCardNodeView = InlineCardNodeView;
9
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
10
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
11
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
12
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
13
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
14
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
15
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
16
- var _react = _interopRequireDefault(require("react"));
17
- var _propTypes = _interopRequireDefault(require("prop-types"));
18
- var _smartCard = require("@atlaskit/smart-card");
19
- var _ui = require("@atlaskit/editor-common/ui");
20
- var _rafSchd = _interopRequireDefault(require("raf-schd"));
21
- var _genericCard = require("./genericCard");
22
- var _actions = require("../pm-plugins/actions");
23
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
24
- 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; } }
25
- var InlineCardComponent = /*#__PURE__*/function (_React$PureComponent) {
26
- (0, _inherits2.default)(InlineCardComponent, _React$PureComponent);
27
- var _super = _createSuper(InlineCardComponent);
28
- function InlineCardComponent() {
29
- var _this;
30
- (0, _classCallCheck2.default)(this, InlineCardComponent);
31
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
32
- args[_key] = arguments[_key];
33
- }
34
- _this = _super.call.apply(_super, [this].concat(args));
35
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onClick", function () {});
36
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onResolve", function (data) {
37
- var _this$props = _this.props,
38
- getPos = _this$props.getPos,
39
- view = _this$props.view;
40
- if (!getPos || typeof getPos === 'boolean') {
41
- return;
42
- }
43
- var title = data.title,
44
- url = data.url;
45
- // don't dispatch immediately since we might be in the middle of
46
- // rendering a nodeview
47
- (0, _rafSchd.default)(function () {
48
- // prosemirror-bump-fix
49
- var pos = getPos();
50
- if (typeof pos !== 'number') {
51
- return;
52
- }
53
- view.dispatch((0, _actions.registerCard)({
54
- title: title,
55
- url: url,
56
- pos: pos
57
- })(view.state.tr));
58
- })();
59
- });
60
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onError", function (data) {
61
- var url = data.url,
62
- err = data.err;
63
- if (err) {
64
- throw err;
65
- }
66
- _this.onResolve({
67
- url: url
68
- });
69
- });
70
- return _this;
71
- }
72
- (0, _createClass2.default)(InlineCardComponent, [{
73
- key: "UNSAFE_componentWillMount",
74
- value: function UNSAFE_componentWillMount() {
75
- var view = this.props.view;
76
- var scrollContainer = (0, _ui.findOverflowScrollParent)(view.dom);
77
- this.scrollContainer = scrollContainer || undefined;
78
- }
79
- }, {
80
- key: "render",
81
- value: function render() {
82
- var _this$props2 = this.props,
83
- node = _this$props2.node,
84
- cardContext = _this$props2.cardContext,
85
- showServerActions = _this$props2.showServerActions,
86
- useAlternativePreloader = _this$props2.useAlternativePreloader;
87
- var _node$attrs = node.attrs,
88
- url = _node$attrs.url,
89
- data = _node$attrs.data;
90
- var card = /*#__PURE__*/_react.default.createElement("span", {
91
- className: "card"
92
- }, /*#__PURE__*/_react.default.createElement(_smartCard.Card, {
93
- key: url,
94
- url: url,
95
- data: data,
96
- appearance: "inline",
97
- onClick: this.onClick,
98
- container: this.scrollContainer,
99
- onResolve: this.onResolve,
100
- onError: this.onError,
101
- inlinePreloaderStyle: useAlternativePreloader ? 'on-right-without-skeleton' : undefined,
102
- showServerActions: showServerActions
103
- }));
104
- // [WS-2307]: we only render card wrapped into a Provider when the value is ready,
105
- // otherwise if we got data, we can render the card directly since it doesn't need the Provider
106
- return cardContext && cardContext.value ? /*#__PURE__*/_react.default.createElement(cardContext.Provider, {
107
- value: cardContext.value
108
- }, card) : data ? card : null;
109
- }
110
- }]);
111
- return InlineCardComponent;
112
- }(_react.default.PureComponent);
113
- exports.InlineCardComponent = InlineCardComponent;
114
- (0, _defineProperty2.default)(InlineCardComponent, "contextTypes", {
115
- contextAdapter: _propTypes.default.object
116
- });
117
- var WrappedInlineCard = (0, _genericCard.Card)(InlineCardComponent, _ui.UnsupportedInline);
118
- function InlineCardNodeView(props) {
119
- var useAlternativePreloader = props.useAlternativePreloader,
120
- node = props.node,
121
- view = props.view,
122
- getPos = props.getPos,
123
- showServerActions = props.showServerActions;
124
- return /*#__PURE__*/_react.default.createElement(WrappedInlineCard, {
125
- node: node,
126
- view: view,
127
- getPos: getPos,
128
- showServerActions: showServerActions,
129
- useAlternativePreloader: useAlternativePreloader
130
- });
131
- }