@atlaskit/editor-core 185.16.3 → 185.16.6

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 (366) 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/expand/commands.js +15 -12
  33. package/dist/cjs/plugins/expand/nodeviews/index.js +4 -1
  34. package/dist/cjs/plugins/index.js +0 -7
  35. package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +14 -25
  36. package/dist/cjs/plugins/media/ui/ResizableMediaSingle/index.js +39 -27
  37. package/dist/cjs/version-wrapper.js +1 -1
  38. package/dist/cjs/version.json +1 -1
  39. package/dist/es2019/i18n/cs.js +0 -35
  40. package/dist/es2019/i18n/da.js +0 -35
  41. package/dist/es2019/i18n/de.js +0 -35
  42. package/dist/es2019/i18n/en.js +0 -35
  43. package/dist/es2019/i18n/en_GB.js +0 -35
  44. package/dist/es2019/i18n/en_ZZ.js +0 -35
  45. package/dist/es2019/i18n/es.js +1 -35
  46. package/dist/es2019/i18n/fi.js +0 -35
  47. package/dist/es2019/i18n/fr.js +1 -35
  48. package/dist/es2019/i18n/hu.js +1 -35
  49. package/dist/es2019/i18n/it.js +1 -35
  50. package/dist/es2019/i18n/ja.js +1 -35
  51. package/dist/es2019/i18n/ko.js +0 -35
  52. package/dist/es2019/i18n/nb.js +1 -35
  53. package/dist/es2019/i18n/nl.js +1 -35
  54. package/dist/es2019/i18n/pl.js +1 -35
  55. package/dist/es2019/i18n/pt_BR.js +1 -35
  56. package/dist/es2019/i18n/ru.js +1 -35
  57. package/dist/es2019/i18n/sv.js +0 -35
  58. package/dist/es2019/i18n/th.js +0 -35
  59. package/dist/es2019/i18n/tr.js +1 -35
  60. package/dist/es2019/i18n/uk.js +1 -35
  61. package/dist/es2019/i18n/vi.js +0 -35
  62. package/dist/es2019/i18n/zh.js +1 -35
  63. package/dist/es2019/i18n/zh_TW.js +1 -35
  64. package/dist/es2019/labs/next/presets/mobile.js +1 -1
  65. package/dist/es2019/labs/next/presets/universal.js +1 -1
  66. package/dist/es2019/plugins/deprecated-card/doc.js +97 -0
  67. package/dist/es2019/plugins/deprecated-hyperlink/commands.js +1 -1
  68. package/dist/es2019/plugins/expand/commands.js +13 -14
  69. package/dist/es2019/plugins/expand/nodeviews/index.js +4 -1
  70. package/dist/es2019/plugins/index.js +0 -1
  71. package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +2 -14
  72. package/dist/es2019/plugins/media/ui/ResizableMediaSingle/index.js +13 -0
  73. package/dist/es2019/version-wrapper.js +1 -1
  74. package/dist/es2019/version.json +1 -1
  75. package/dist/esm/i18n/cs.js +0 -35
  76. package/dist/esm/i18n/da.js +0 -35
  77. package/dist/esm/i18n/de.js +0 -35
  78. package/dist/esm/i18n/en.js +0 -35
  79. package/dist/esm/i18n/en_GB.js +0 -35
  80. package/dist/esm/i18n/en_ZZ.js +0 -35
  81. package/dist/esm/i18n/es.js +1 -35
  82. package/dist/esm/i18n/fi.js +0 -35
  83. package/dist/esm/i18n/fr.js +1 -35
  84. package/dist/esm/i18n/hu.js +1 -35
  85. package/dist/esm/i18n/it.js +1 -35
  86. package/dist/esm/i18n/ja.js +1 -35
  87. package/dist/esm/i18n/ko.js +0 -35
  88. package/dist/esm/i18n/nb.js +1 -35
  89. package/dist/esm/i18n/nl.js +1 -35
  90. package/dist/esm/i18n/pl.js +1 -35
  91. package/dist/esm/i18n/pt_BR.js +1 -35
  92. package/dist/esm/i18n/ru.js +1 -35
  93. package/dist/esm/i18n/sv.js +0 -35
  94. package/dist/esm/i18n/th.js +0 -35
  95. package/dist/esm/i18n/tr.js +1 -35
  96. package/dist/esm/i18n/uk.js +1 -35
  97. package/dist/esm/i18n/vi.js +0 -35
  98. package/dist/esm/i18n/zh.js +1 -35
  99. package/dist/esm/i18n/zh_TW.js +1 -35
  100. package/dist/esm/labs/next/presets/mobile.js +1 -1
  101. package/dist/esm/labs/next/presets/universal.js +1 -1
  102. package/dist/esm/plugins/deprecated-card/doc.js +105 -0
  103. package/dist/esm/plugins/deprecated-hyperlink/commands.js +1 -1
  104. package/dist/esm/plugins/expand/commands.js +16 -13
  105. package/dist/esm/plugins/expand/nodeviews/index.js +4 -1
  106. package/dist/esm/plugins/index.js +0 -1
  107. package/dist/esm/plugins/media/nodeviews/mediaSingle.js +14 -25
  108. package/dist/esm/plugins/media/ui/ResizableMediaSingle/index.js +39 -27
  109. package/dist/esm/version-wrapper.js +1 -1
  110. package/dist/esm/version.json +1 -1
  111. package/dist/types/i18n/cs.d.ts +0 -35
  112. package/dist/types/i18n/da.d.ts +0 -35
  113. package/dist/types/i18n/de.d.ts +0 -35
  114. package/dist/types/i18n/en.d.ts +0 -35
  115. package/dist/types/i18n/en_GB.d.ts +0 -35
  116. package/dist/types/i18n/en_ZZ.d.ts +0 -35
  117. package/dist/types/i18n/es.d.ts +1 -35
  118. package/dist/types/i18n/fi.d.ts +0 -35
  119. package/dist/types/i18n/fr.d.ts +1 -35
  120. package/dist/types/i18n/hu.d.ts +1 -35
  121. package/dist/types/i18n/it.d.ts +1 -35
  122. package/dist/types/i18n/ja.d.ts +1 -35
  123. package/dist/types/i18n/ko.d.ts +0 -35
  124. package/dist/types/i18n/nb.d.ts +1 -35
  125. package/dist/types/i18n/nl.d.ts +1 -35
  126. package/dist/types/i18n/pl.d.ts +1 -35
  127. package/dist/types/i18n/pt_BR.d.ts +1 -35
  128. package/dist/types/i18n/ru.d.ts +1 -35
  129. package/dist/types/i18n/sv.d.ts +0 -35
  130. package/dist/types/i18n/th.d.ts +0 -35
  131. package/dist/types/i18n/tr.d.ts +1 -35
  132. package/dist/types/i18n/uk.d.ts +1 -35
  133. package/dist/types/i18n/vi.d.ts +0 -35
  134. package/dist/types/i18n/zh.d.ts +1 -35
  135. package/dist/types/i18n/zh_TW.d.ts +1 -35
  136. package/dist/types/plugins/deprecated-card/doc.d.ts +20 -0
  137. package/dist/types/plugins/expand/commands.d.ts +1 -1
  138. package/dist/types/plugins/index.d.ts +0 -1
  139. package/dist/types/plugins/media/nodeviews/mediaSingle.d.ts +0 -1
  140. package/dist/types/plugins/media/ui/ResizableMediaSingle/index.d.ts +1 -0
  141. package/dist/types/plugins/media/ui/ResizableMediaSingle/types.d.ts +3 -2
  142. package/dist/types/plugins/paste/index.d.ts +1 -1
  143. package/dist/types-ts4.5/i18n/cs.d.ts +0 -35
  144. package/dist/types-ts4.5/i18n/da.d.ts +0 -35
  145. package/dist/types-ts4.5/i18n/de.d.ts +0 -35
  146. package/dist/types-ts4.5/i18n/en.d.ts +0 -35
  147. package/dist/types-ts4.5/i18n/en_GB.d.ts +0 -35
  148. package/dist/types-ts4.5/i18n/en_ZZ.d.ts +0 -35
  149. package/dist/types-ts4.5/i18n/es.d.ts +1 -35
  150. package/dist/types-ts4.5/i18n/fi.d.ts +0 -35
  151. package/dist/types-ts4.5/i18n/fr.d.ts +1 -35
  152. package/dist/types-ts4.5/i18n/hu.d.ts +1 -35
  153. package/dist/types-ts4.5/i18n/it.d.ts +1 -35
  154. package/dist/types-ts4.5/i18n/ja.d.ts +1 -35
  155. package/dist/types-ts4.5/i18n/ko.d.ts +0 -35
  156. package/dist/types-ts4.5/i18n/nb.d.ts +1 -35
  157. package/dist/types-ts4.5/i18n/nl.d.ts +1 -35
  158. package/dist/types-ts4.5/i18n/pl.d.ts +1 -35
  159. package/dist/types-ts4.5/i18n/pt_BR.d.ts +1 -35
  160. package/dist/types-ts4.5/i18n/ru.d.ts +1 -35
  161. package/dist/types-ts4.5/i18n/sv.d.ts +0 -35
  162. package/dist/types-ts4.5/i18n/th.d.ts +0 -35
  163. package/dist/types-ts4.5/i18n/tr.d.ts +1 -35
  164. package/dist/types-ts4.5/i18n/uk.d.ts +1 -35
  165. package/dist/types-ts4.5/i18n/vi.d.ts +0 -35
  166. package/dist/types-ts4.5/i18n/zh.d.ts +1 -35
  167. package/dist/types-ts4.5/i18n/zh_TW.d.ts +1 -35
  168. package/dist/types-ts4.5/plugins/deprecated-card/doc.d.ts +20 -0
  169. package/dist/types-ts4.5/plugins/expand/commands.d.ts +1 -1
  170. package/dist/types-ts4.5/plugins/index.d.ts +0 -1
  171. package/dist/types-ts4.5/plugins/media/nodeviews/mediaSingle.d.ts +0 -1
  172. package/dist/types-ts4.5/plugins/media/ui/ResizableMediaSingle/index.d.ts +1 -0
  173. package/dist/types-ts4.5/plugins/media/ui/ResizableMediaSingle/types.d.ts +3 -2
  174. package/dist/types-ts4.5/plugins/paste/index.d.ts +1 -1
  175. package/package.json +6 -5
  176. package/tmp/api-report-tmp.d.ts +2307 -0
  177. package/dist/cjs/plugins/card/index.js +0 -139
  178. package/dist/cjs/plugins/card/messages.js +0 -20
  179. package/dist/cjs/plugins/card/nodeviews/blockCard.js +0 -163
  180. package/dist/cjs/plugins/card/nodeviews/datasource.js +0 -172
  181. package/dist/cjs/plugins/card/nodeviews/embedCard.js +0 -396
  182. package/dist/cjs/plugins/card/nodeviews/genericCard.js +0 -118
  183. package/dist/cjs/plugins/card/nodeviews/inlineCard.js +0 -131
  184. package/dist/cjs/plugins/card/pm-plugins/actions.js +0 -122
  185. package/dist/cjs/plugins/card/pm-plugins/analytics/create-analytics-queue.js +0 -48
  186. package/dist/cjs/plugins/card/pm-plugins/analytics/events-from-tr.js +0 -353
  187. package/dist/cjs/plugins/card/pm-plugins/analytics/index.js +0 -19
  188. package/dist/cjs/plugins/card/pm-plugins/analytics/types.js +0 -5
  189. package/dist/cjs/plugins/card/pm-plugins/analytics/utils.js +0 -178
  190. package/dist/cjs/plugins/card/pm-plugins/doc.js +0 -478
  191. package/dist/cjs/plugins/card/pm-plugins/keymap.js +0 -64
  192. package/dist/cjs/plugins/card/pm-plugins/main.js +0 -212
  193. package/dist/cjs/plugins/card/pm-plugins/mountHyperlink.js +0 -47
  194. package/dist/cjs/plugins/card/pm-plugins/plugin-key.js +0 -9
  195. package/dist/cjs/plugins/card/pm-plugins/reducers.js +0 -111
  196. package/dist/cjs/plugins/card/pm-plugins/shouldReplaceLink.js +0 -35
  197. package/dist/cjs/plugins/card/pm-plugins/util/resolve.js +0 -58
  198. package/dist/cjs/plugins/card/pm-plugins/util/state.js +0 -49
  199. package/dist/cjs/plugins/card/toolbar.js +0 -364
  200. package/dist/cjs/plugins/card/types.js +0 -5
  201. package/dist/cjs/plugins/card/ui/DatasourceModal/ModalWithState.js +0 -25
  202. package/dist/cjs/plugins/card/ui/DatasourceModal/index.js +0 -60
  203. package/dist/cjs/plugins/card/ui/EditLinkToolbar.js +0 -256
  204. package/dist/cjs/plugins/card/ui/EditorSmartCardEvents.js +0 -21
  205. package/dist/cjs/plugins/card/ui/EditorSmartCardEventsNext.js +0 -213
  206. package/dist/cjs/plugins/card/ui/HyperlinkToolbarAppearance.js +0 -173
  207. package/dist/cjs/plugins/card/ui/LayoutButton/index.js +0 -113
  208. package/dist/cjs/plugins/card/ui/LayoutButton/styled.js +0 -17
  209. package/dist/cjs/plugins/card/ui/LayoutButton/types.js +0 -5
  210. package/dist/cjs/plugins/card/ui/LayoutButton/utils.js +0 -19
  211. package/dist/cjs/plugins/card/ui/LinkToolbarAppearance.js +0 -151
  212. package/dist/cjs/plugins/card/ui/ResizableEmbedCard.js +0 -360
  213. package/dist/cjs/plugins/card/ui/SmallerEditIcon.js +0 -20
  214. package/dist/cjs/plugins/card/utils.js +0 -60
  215. package/dist/es2019/plugins/card/index.js +0 -131
  216. package/dist/es2019/plugins/card/messages.js +0 -13
  217. package/dist/es2019/plugins/card/nodeviews/blockCard.js +0 -130
  218. package/dist/es2019/plugins/card/nodeviews/datasource.js +0 -136
  219. package/dist/es2019/plugins/card/nodeviews/embedCard.js +0 -368
  220. package/dist/es2019/plugins/card/nodeviews/genericCard.js +0 -92
  221. package/dist/es2019/plugins/card/nodeviews/inlineCard.js +0 -112
  222. package/dist/es2019/plugins/card/pm-plugins/actions.js +0 -57
  223. package/dist/es2019/plugins/card/pm-plugins/analytics/create-analytics-queue.js +0 -38
  224. package/dist/es2019/plugins/card/pm-plugins/analytics/events-from-tr.js +0 -333
  225. package/dist/es2019/plugins/card/pm-plugins/analytics/index.js +0 -2
  226. package/dist/es2019/plugins/card/pm-plugins/analytics/types.js +0 -1
  227. package/dist/es2019/plugins/card/pm-plugins/analytics/utils.js +0 -160
  228. package/dist/es2019/plugins/card/pm-plugins/doc.js +0 -451
  229. package/dist/es2019/plugins/card/pm-plugins/keymap.js +0 -59
  230. package/dist/es2019/plugins/card/pm-plugins/main.js +0 -208
  231. package/dist/es2019/plugins/card/pm-plugins/mountHyperlink.js +0 -37
  232. package/dist/es2019/plugins/card/pm-plugins/plugin-key.js +0 -2
  233. package/dist/es2019/plugins/card/pm-plugins/reducers.js +0 -110
  234. package/dist/es2019/plugins/card/pm-plugins/shouldReplaceLink.js +0 -25
  235. package/dist/es2019/plugins/card/pm-plugins/util/resolve.js +0 -48
  236. package/dist/es2019/plugins/card/pm-plugins/util/state.js +0 -26
  237. package/dist/es2019/plugins/card/toolbar.js +0 -362
  238. package/dist/es2019/plugins/card/types.js +0 -1
  239. package/dist/es2019/plugins/card/ui/DatasourceModal/ModalWithState.js +0 -19
  240. package/dist/es2019/plugins/card/ui/DatasourceModal/index.js +0 -48
  241. package/dist/es2019/plugins/card/ui/EditLinkToolbar.js +0 -225
  242. package/dist/es2019/plugins/card/ui/EditorSmartCardEvents.js +0 -15
  243. package/dist/es2019/plugins/card/ui/EditorSmartCardEventsNext.js +0 -198
  244. package/dist/es2019/plugins/card/ui/HyperlinkToolbarAppearance.js +0 -86
  245. package/dist/es2019/plugins/card/ui/LayoutButton/index.js +0 -106
  246. package/dist/es2019/plugins/card/ui/LayoutButton/styled.js +0 -10
  247. package/dist/es2019/plugins/card/ui/LayoutButton/types.js +0 -1
  248. package/dist/es2019/plugins/card/ui/LayoutButton/utils.js +0 -15
  249. package/dist/es2019/plugins/card/ui/LinkToolbarAppearance.js +0 -117
  250. package/dist/es2019/plugins/card/ui/ResizableEmbedCard.js +0 -332
  251. package/dist/es2019/plugins/card/ui/SmallerEditIcon.js +0 -11
  252. package/dist/es2019/plugins/card/utils.js +0 -46
  253. package/dist/esm/plugins/card/index.js +0 -132
  254. package/dist/esm/plugins/card/messages.js +0 -13
  255. package/dist/esm/plugins/card/nodeviews/blockCard.js +0 -155
  256. package/dist/esm/plugins/card/nodeviews/datasource.js +0 -164
  257. package/dist/esm/plugins/card/nodeviews/embedCard.js +0 -387
  258. package/dist/esm/plugins/card/nodeviews/genericCard.js +0 -111
  259. package/dist/esm/plugins/card/nodeviews/inlineCard.js +0 -123
  260. package/dist/esm/plugins/card/pm-plugins/actions.js +0 -102
  261. package/dist/esm/plugins/card/pm-plugins/analytics/create-analytics-queue.js +0 -41
  262. package/dist/esm/plugins/card/pm-plugins/analytics/events-from-tr.js +0 -344
  263. package/dist/esm/plugins/card/pm-plugins/analytics/index.js +0 -2
  264. package/dist/esm/plugins/card/pm-plugins/analytics/types.js +0 -1
  265. package/dist/esm/plugins/card/pm-plugins/analytics/utils.js +0 -160
  266. package/dist/esm/plugins/card/pm-plugins/doc.js +0 -460
  267. package/dist/esm/plugins/card/pm-plugins/keymap.js +0 -58
  268. package/dist/esm/plugins/card/pm-plugins/main.js +0 -199
  269. package/dist/esm/plugins/card/pm-plugins/mountHyperlink.js +0 -39
  270. package/dist/esm/plugins/card/pm-plugins/plugin-key.js +0 -2
  271. package/dist/esm/plugins/card/pm-plugins/reducers.js +0 -103
  272. package/dist/esm/plugins/card/pm-plugins/shouldReplaceLink.js +0 -29
  273. package/dist/esm/plugins/card/pm-plugins/util/resolve.js +0 -50
  274. package/dist/esm/plugins/card/pm-plugins/util/state.js +0 -40
  275. package/dist/esm/plugins/card/toolbar.js +0 -353
  276. package/dist/esm/plugins/card/types.js +0 -1
  277. package/dist/esm/plugins/card/ui/DatasourceModal/ModalWithState.js +0 -17
  278. package/dist/esm/plugins/card/ui/DatasourceModal/index.js +0 -49
  279. package/dist/esm/plugins/card/ui/EditLinkToolbar.js +0 -243
  280. package/dist/esm/plugins/card/ui/EditorSmartCardEvents.js +0 -14
  281. package/dist/esm/plugins/card/ui/EditorSmartCardEventsNext.js +0 -202
  282. package/dist/esm/plugins/card/ui/HyperlinkToolbarAppearance.js +0 -163
  283. package/dist/esm/plugins/card/ui/LayoutButton/index.js +0 -102
  284. package/dist/esm/plugins/card/ui/LayoutButton/styled.js +0 -10
  285. package/dist/esm/plugins/card/ui/LayoutButton/types.js +0 -1
  286. package/dist/esm/plugins/card/ui/LayoutButton/utils.js +0 -12
  287. package/dist/esm/plugins/card/ui/LinkToolbarAppearance.js +0 -140
  288. package/dist/esm/plugins/card/ui/ResizableEmbedCard.js +0 -355
  289. package/dist/esm/plugins/card/ui/SmallerEditIcon.js +0 -11
  290. package/dist/esm/plugins/card/utils.js +0 -48
  291. package/dist/types/plugins/card/index.d.ts +0 -26
  292. package/dist/types/plugins/card/messages.d.ts +0 -12
  293. package/dist/types/plugins/card/nodeviews/blockCard.d.ts +0 -26
  294. package/dist/types/plugins/card/nodeviews/datasource.d.ts +0 -42
  295. package/dist/types/plugins/card/nodeviews/embedCard.d.ts +0 -46
  296. package/dist/types/plugins/card/nodeviews/genericCard.d.ts +0 -37
  297. package/dist/types/plugins/card/nodeviews/inlineCard.d.ts +0 -23
  298. package/dist/types/plugins/card/pm-plugins/actions.d.ts +0 -23
  299. package/dist/types/plugins/card/pm-plugins/analytics/create-analytics-queue.d.ts +0 -10
  300. package/dist/types/plugins/card/pm-plugins/analytics/events-from-tr.d.ts +0 -17
  301. package/dist/types/plugins/card/pm-plugins/analytics/index.d.ts +0 -2
  302. package/dist/types/plugins/card/pm-plugins/analytics/types.d.ts +0 -12
  303. package/dist/types/plugins/card/pm-plugins/analytics/utils.d.ts +0 -32
  304. package/dist/types/plugins/card/pm-plugins/doc.d.ts +0 -23
  305. package/dist/types/plugins/card/pm-plugins/keymap.d.ts +0 -3
  306. package/dist/types/plugins/card/pm-plugins/main.d.ts +0 -6
  307. package/dist/types/plugins/card/pm-plugins/mountHyperlink.d.ts +0 -5
  308. package/dist/types/plugins/card/pm-plugins/plugin-key.d.ts +0 -3
  309. package/dist/types/plugins/card/pm-plugins/reducers.d.ts +0 -3
  310. package/dist/types/plugins/card/pm-plugins/shouldReplaceLink.d.ts +0 -2
  311. package/dist/types/plugins/card/pm-plugins/util/resolve.d.ts +0 -8
  312. package/dist/types/plugins/card/pm-plugins/util/state.d.ts +0 -31
  313. package/dist/types/plugins/card/toolbar.d.ts +0 -12
  314. package/dist/types/plugins/card/types.d.ts +0 -165
  315. package/dist/types/plugins/card/ui/DatasourceModal/ModalWithState.d.ts +0 -9
  316. package/dist/types/plugins/card/ui/DatasourceModal/index.d.ts +0 -11
  317. package/dist/types/plugins/card/ui/EditLinkToolbar.d.ts +0 -47
  318. package/dist/types/plugins/card/ui/EditorSmartCardEvents.d.ts +0 -5
  319. package/dist/types/plugins/card/ui/EditorSmartCardEventsNext.d.ts +0 -18
  320. package/dist/types/plugins/card/ui/HyperlinkToolbarAppearance.d.ts +0 -32
  321. package/dist/types/plugins/card/ui/LayoutButton/index.d.ts +0 -9
  322. package/dist/types/plugins/card/ui/LayoutButton/styled.d.ts +0 -1
  323. package/dist/types/plugins/card/ui/LayoutButton/types.d.ts +0 -19
  324. package/dist/types/plugins/card/ui/LayoutButton/utils.d.ts +0 -5
  325. package/dist/types/plugins/card/ui/LinkToolbarAppearance.d.ts +0 -29
  326. package/dist/types/plugins/card/ui/ResizableEmbedCard.d.ts +0 -61
  327. package/dist/types/plugins/card/ui/SmallerEditIcon.d.ts +0 -3
  328. package/dist/types/plugins/card/utils.d.ts +0 -19
  329. package/dist/types-ts4.5/plugins/card/index.d.ts +0 -26
  330. package/dist/types-ts4.5/plugins/card/messages.d.ts +0 -12
  331. package/dist/types-ts4.5/plugins/card/nodeviews/blockCard.d.ts +0 -26
  332. package/dist/types-ts4.5/plugins/card/nodeviews/datasource.d.ts +0 -42
  333. package/dist/types-ts4.5/plugins/card/nodeviews/embedCard.d.ts +0 -46
  334. package/dist/types-ts4.5/plugins/card/nodeviews/genericCard.d.ts +0 -37
  335. package/dist/types-ts4.5/plugins/card/nodeviews/inlineCard.d.ts +0 -23
  336. package/dist/types-ts4.5/plugins/card/pm-plugins/actions.d.ts +0 -23
  337. package/dist/types-ts4.5/plugins/card/pm-plugins/analytics/create-analytics-queue.d.ts +0 -10
  338. package/dist/types-ts4.5/plugins/card/pm-plugins/analytics/events-from-tr.d.ts +0 -17
  339. package/dist/types-ts4.5/plugins/card/pm-plugins/analytics/index.d.ts +0 -2
  340. package/dist/types-ts4.5/plugins/card/pm-plugins/analytics/types.d.ts +0 -12
  341. package/dist/types-ts4.5/plugins/card/pm-plugins/analytics/utils.d.ts +0 -32
  342. package/dist/types-ts4.5/plugins/card/pm-plugins/doc.d.ts +0 -23
  343. package/dist/types-ts4.5/plugins/card/pm-plugins/keymap.d.ts +0 -3
  344. package/dist/types-ts4.5/plugins/card/pm-plugins/main.d.ts +0 -6
  345. package/dist/types-ts4.5/plugins/card/pm-plugins/mountHyperlink.d.ts +0 -5
  346. package/dist/types-ts4.5/plugins/card/pm-plugins/plugin-key.d.ts +0 -3
  347. package/dist/types-ts4.5/plugins/card/pm-plugins/reducers.d.ts +0 -3
  348. package/dist/types-ts4.5/plugins/card/pm-plugins/shouldReplaceLink.d.ts +0 -2
  349. package/dist/types-ts4.5/plugins/card/pm-plugins/util/resolve.d.ts +0 -8
  350. package/dist/types-ts4.5/plugins/card/pm-plugins/util/state.d.ts +0 -31
  351. package/dist/types-ts4.5/plugins/card/toolbar.d.ts +0 -12
  352. package/dist/types-ts4.5/plugins/card/types.d.ts +0 -165
  353. package/dist/types-ts4.5/plugins/card/ui/DatasourceModal/ModalWithState.d.ts +0 -9
  354. package/dist/types-ts4.5/plugins/card/ui/DatasourceModal/index.d.ts +0 -11
  355. package/dist/types-ts4.5/plugins/card/ui/EditLinkToolbar.d.ts +0 -47
  356. package/dist/types-ts4.5/plugins/card/ui/EditorSmartCardEvents.d.ts +0 -5
  357. package/dist/types-ts4.5/plugins/card/ui/EditorSmartCardEventsNext.d.ts +0 -18
  358. package/dist/types-ts4.5/plugins/card/ui/HyperlinkToolbarAppearance.d.ts +0 -32
  359. package/dist/types-ts4.5/plugins/card/ui/LayoutButton/index.d.ts +0 -9
  360. package/dist/types-ts4.5/plugins/card/ui/LayoutButton/styled.d.ts +0 -1
  361. package/dist/types-ts4.5/plugins/card/ui/LayoutButton/types.d.ts +0 -19
  362. package/dist/types-ts4.5/plugins/card/ui/LayoutButton/utils.d.ts +0 -5
  363. package/dist/types-ts4.5/plugins/card/ui/LinkToolbarAppearance.d.ts +0 -29
  364. package/dist/types-ts4.5/plugins/card/ui/ResizableEmbedCard.d.ts +0 -61
  365. package/dist/types-ts4.5/plugins/card/ui/SmallerEditIcon.d.ts +0 -3
  366. package/dist/types-ts4.5/plugins/card/utils.d.ts +0 -19
@@ -1,130 +0,0 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- import React from 'react';
3
- import { Card as SmartCard } from '@atlaskit/smart-card';
4
- import { UnsupportedBlock } from '@atlaskit/editor-common/ui';
5
- import { browser } from '@atlaskit/editor-common/utils';
6
- import PropTypes from 'prop-types';
7
- import rafSchedule from 'raf-schd';
8
- import { Card } from './genericCard';
9
- import ReactNodeView from '@atlaskit/editor-common/react-node-view';
10
- import { registerCard } from '../pm-plugins/actions';
11
- import { findOverflowScrollParent } from '@atlaskit/editor-common/ui';
12
- export class BlockCardComponent extends React.PureComponent {
13
- constructor(...args) {
14
- super(...args);
15
- _defineProperty(this, "onClick", () => {});
16
- _defineProperty(this, "onResolve", data => {
17
- const {
18
- getPos,
19
- view
20
- } = this.props;
21
- if (!getPos || typeof getPos === 'boolean') {
22
- return;
23
- }
24
- const {
25
- title,
26
- url
27
- } = data;
28
-
29
- // don't dispatch immediately since we might be in the middle of
30
- // rendering a nodeview
31
- rafSchedule(() => {
32
- const pos = getPos();
33
- if (typeof pos !== 'number') {
34
- return;
35
- }
36
- view.dispatch(registerCard({
37
- title,
38
- url,
39
- pos
40
- })(view.state.tr));
41
- })();
42
- });
43
- _defineProperty(this, "gapCursorSpan", () => {
44
- // Don't render in EdgeHTMl version <= 18 (Edge version 44)
45
- // as it forces the edit popup to render 24px lower than it should
46
- if (browser.ie && browser.ie_version < 79) {
47
- return;
48
- }
49
-
50
- // render an empty span afterwards to get around Webkit bug
51
- // that puts caret in next editable text element
52
- return /*#__PURE__*/React.createElement("span", {
53
- contentEditable: true
54
- });
55
- });
56
- _defineProperty(this, "onError", ({
57
- err
58
- }) => {
59
- if (err) {
60
- throw err;
61
- }
62
- });
63
- }
64
- UNSAFE_componentWillMount() {
65
- const {
66
- view
67
- } = this.props;
68
- const scrollContainer = findOverflowScrollParent(view.dom);
69
- this.scrollContainer = scrollContainer || undefined;
70
- }
71
- render() {
72
- const {
73
- node,
74
- cardContext,
75
- platform,
76
- showServerActions
77
- } = this.props;
78
- const {
79
- url,
80
- data
81
- } = node.attrs;
82
- const cardInner = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SmartCard, {
83
- key: url,
84
- url: url,
85
- data: data,
86
- container: this.scrollContainer,
87
- appearance: "block",
88
- onClick: this.onClick,
89
- onResolve: this.onResolve,
90
- onError: this.onError,
91
- showActions: platform === 'web',
92
- platform: platform,
93
- showServerActions: showServerActions
94
- }), this.gapCursorSpan());
95
- // [WS-2307]: we only render card wrapped into a Provider when the value is ready,
96
- // otherwise if we got data, we can render the card directly since it doesn't need the Provider
97
- return /*#__PURE__*/React.createElement("div", null, cardContext && cardContext.value ? /*#__PURE__*/React.createElement(cardContext.Provider, {
98
- value: cardContext.value
99
- }, cardInner) : data ? cardInner : null);
100
- }
101
- }
102
- _defineProperty(BlockCardComponent, "contextTypes", {
103
- contextAdapter: PropTypes.object
104
- });
105
- const WrappedBlockCard = Card(BlockCardComponent, UnsupportedBlock);
106
- export class BlockCard extends ReactNodeView {
107
- createDomRef() {
108
- const domRef = document.createElement('div');
109
- if (this.reactComponentProps.platform !== 'mobile') {
110
- // workaround Chrome bug in https://product-fabric.atlassian.net/browse/ED-5379
111
- // see also: https://github.com/ProseMirror/prosemirror/issues/884
112
- domRef.contentEditable = 'true';
113
- domRef.setAttribute('spellcheck', 'false');
114
- }
115
- return domRef;
116
- }
117
- render() {
118
- const {
119
- platform,
120
- showServerActions
121
- } = this.reactComponentProps;
122
- return /*#__PURE__*/React.createElement(WrappedBlockCard, {
123
- node: this.node,
124
- view: this.view,
125
- getPos: this.getPos,
126
- platform: platform,
127
- showServerActions: showServerActions
128
- });
129
- }
130
- }
@@ -1,136 +0,0 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- /** @jsx jsx */
3
- import React from 'react';
4
- import PropTypes from 'prop-types';
5
- import { css, jsx } from '@emotion/react';
6
- import ReactNodeView from '@atlaskit/editor-common/react-node-view';
7
- import { DatasourceTableView } from '@atlaskit/link-datasource';
8
- import { SmartCardSharedCssClassName, DATASOURCE_INNER_CONTAINER_CLASSNAME } from '@atlaskit/editor-common/styles';
9
- import { calcBreakoutWidthPx } from '@atlaskit/editor-common/utils';
10
- const containerStyles = css({
11
- height: '500px',
12
- overflow: 'auto'
13
- });
14
- export class DatasourceComponent extends React.PureComponent {
15
- constructor(props) {
16
- super(props);
17
- _defineProperty(this, "getPosSafely", () => {
18
- const {
19
- getPos
20
- } = this.props;
21
- if (!getPos || typeof getPos === 'boolean') {
22
- return;
23
- }
24
- try {
25
- return getPos();
26
- } catch (e) {
27
- // Can blow up in rare cases, when node has been removed.
28
- }
29
- });
30
- _defineProperty(this, "getDatasource", () => this.props.node.attrs.datasource);
31
- _defineProperty(this, "getTableView", datasource => {
32
- const views = (datasource || this.getDatasource()).views;
33
- return views.find(view => view.type === 'table') || undefined;
34
- });
35
- _defineProperty(this, "handleColumnChange", columnKeys => {
36
- const {
37
- state,
38
- dispatch
39
- } = this.props.view;
40
- const pos = this.getPosSafely();
41
- if (pos === undefined) {
42
- return;
43
- }
44
- const attrs = this.props.node.attrs;
45
- const views = [{
46
- type: 'table',
47
- properties: {
48
- columns: columnKeys.map(key => ({
49
- key
50
- }))
51
- }
52
- }];
53
- const tr = state.tr.setNodeMarkup(pos, undefined, {
54
- ...attrs,
55
- datasource: {
56
- ...attrs.datasource,
57
- views
58
- }
59
- });
60
- tr.setMeta('scrollIntoView', false);
61
- dispatch(tr);
62
- });
63
- }
64
- render() {
65
- const cardContext = this.context.contextAdapter ? this.context.contextAdapter.card : undefined;
66
- const datasource = this.getDatasource();
67
- const tableView = this.getTableView();
68
- if (tableView) {
69
- var _tableView$properties;
70
- const visibleColumnKeys = (_tableView$properties = tableView.properties) === null || _tableView$properties === void 0 ? void 0 : _tableView$properties.columns.map(({
71
- key
72
- }) => key);
73
-
74
- // [WS-2307]: we only render card wrapped into a Provider when the value is ready
75
- if (cardContext && cardContext.value) {
76
- return jsx(cardContext.Provider, {
77
- value: cardContext.value
78
- }, jsx(DatasourceTableView, {
79
- datasourceId: datasource.id,
80
- parameters: datasource.parameters,
81
- visibleColumnKeys: visibleColumnKeys,
82
- onVisibleColumnKeysChange: this.handleColumnChange
83
- }));
84
- }
85
- }
86
- return null;
87
- }
88
- }
89
- _defineProperty(DatasourceComponent, "contextTypes", {
90
- contextAdapter: PropTypes.object
91
- });
92
- export class Datasource extends ReactNodeView {
93
- constructor(props) {
94
- var _props$pluginInjectio, _props$pluginInjectio2, _props$pluginInjectio3, _sharedState$currentS;
95
- super(props.node, props.view, props.getPos, props.portalProviderAPI, props.eventDispatcher, props, undefined, true, undefined, props.hasIntlContext);
96
- _defineProperty(this, "calcTableWidth", (layout, containerWidth) => {
97
- if (layout === 'center') {
98
- return 'inherit';
99
- }
100
- return calcBreakoutWidthPx(layout, containerWidth);
101
- });
102
- const sharedState = props === null || props === void 0 ? void 0 : (_props$pluginInjectio = props.pluginInjectionApi) === null || _props$pluginInjectio === void 0 ? void 0 : (_props$pluginInjectio2 = _props$pluginInjectio.dependencies) === null || _props$pluginInjectio2 === void 0 ? void 0 : (_props$pluginInjectio3 = _props$pluginInjectio2.width) === null || _props$pluginInjectio3 === void 0 ? void 0 : _props$pluginInjectio3.sharedState;
103
- this.tableWidth = sharedState === null || sharedState === void 0 ? void 0 : (_sharedState$currentS = sharedState.currentState()) === null || _sharedState$currentS === void 0 ? void 0 : _sharedState$currentS.width;
104
- sharedState === null || sharedState === void 0 ? void 0 : sharedState.onChange(({
105
- nextSharedState
106
- }) => {
107
- if (nextSharedState !== null && nextSharedState !== void 0 && nextSharedState.width && this.tableWidth !== (nextSharedState === null || nextSharedState === void 0 ? void 0 : nextSharedState.width)) {
108
- this.tableWidth = nextSharedState === null || nextSharedState === void 0 ? void 0 : nextSharedState.width;
109
- this.update(this.node, []); // required to update the width when page is resized.
110
- }
111
- });
112
- }
113
-
114
- createDomRef() {
115
- const domRef = document.createElement('div');
116
- domRef.classList.add(SmartCardSharedCssClassName.DATASOURCE_CONTAINER);
117
- return domRef;
118
- }
119
- render() {
120
- const {
121
- attrs
122
- } = this.node;
123
- const calculatedWidth = this.calcTableWidth(attrs.layout, this.tableWidth);
124
- return jsx("div", {
125
- className: DATASOURCE_INNER_CONTAINER_CLASSNAME,
126
- css: containerStyles,
127
- style: {
128
- minWidth: calculatedWidth
129
- }
130
- }, jsx(DatasourceComponent, {
131
- node: this.node,
132
- view: this.view,
133
- getPos: this.getPos
134
- }));
135
- }
136
- }
@@ -1,368 +0,0 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- import _extends from "@babel/runtime/helpers/extends";
3
- import React from 'react';
4
- import { Card as SmartCard, EmbedResizeMessageListener } from '@atlaskit/smart-card';
5
- import PropTypes from 'prop-types';
6
- import rafSchedule from 'raf-schd';
7
- import { Card } from './genericCard';
8
- import { UnsupportedBlock, MediaSingle as RichMediaWrapper, findOverflowScrollParent } from '@atlaskit/editor-common/ui';
9
- import { DEFAULT_EMBED_CARD_HEIGHT, DEFAULT_EMBED_CARD_WIDTH } from '@atlaskit/editor-shared-styles';
10
- import ReactNodeView from '@atlaskit/editor-common/react-node-view';
11
- import { registerCard } from '../pm-plugins/actions';
12
- import ResizableEmbedCard from '../ui/ResizableEmbedCard';
13
- import { floatingLayouts, isRichMediaInsideOfBlockNode } from '@atlaskit/editor-common/utils';
14
- import { SetAttrsStep } from '@atlaskit/adf-schema/steps';
15
- import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
16
- const CardInner = ({
17
- pluginInjectionApi,
18
- getPosSafely,
19
- getLineLength,
20
- view,
21
- smartCard,
22
- eventDispatcher,
23
- updateSize,
24
- getPos,
25
- aspectRatio,
26
- allowResizing,
27
- hasPreview,
28
- heightAlone,
29
- cardProps,
30
- dispatchAnalyticsEvent
31
- }) => {
32
- const {
33
- widthState
34
- } = useSharedPluginState(pluginInjectionApi, ['width']);
35
- const widthStateLineLength = (widthState === null || widthState === void 0 ? void 0 : widthState.lineLength) || 0;
36
- const widthStateWidth = (widthState === null || widthState === void 0 ? void 0 : widthState.width) || 0;
37
- const pos = getPosSafely();
38
- if (pos === undefined) {
39
- return null;
40
- }
41
- const lineLength = getLineLength(view, pos, widthStateLineLength);
42
- const containerWidth = isRichMediaInsideOfBlockNode(view, pos) ? lineLength : widthStateWidth;
43
- if (!allowResizing || !hasPreview) {
44
- // There are two ways `width` and `height` can be defined here:
45
- // 1) Either as `heightAlone` as height value and no width
46
- // 2) or as `1` for height and aspectRation (defined or a default one) as a width
47
- // See above for how aspectRation is calculated.
48
- const defaultAspectRatio = DEFAULT_EMBED_CARD_WIDTH / DEFAULT_EMBED_CARD_HEIGHT;
49
- let richMediaWrapperHeight = 1;
50
- let richMediaWrapperWidth = aspectRatio || defaultAspectRatio;
51
- if (heightAlone) {
52
- richMediaWrapperHeight = heightAlone;
53
- richMediaWrapperWidth = undefined;
54
- }
55
- return /*#__PURE__*/React.createElement(RichMediaWrapper, _extends({}, cardProps, {
56
- height: richMediaWrapperHeight,
57
- width: richMediaWrapperWidth,
58
- nodeType: "embedCard",
59
- hasFallbackContainer: hasPreview,
60
- lineLength: lineLength,
61
- containerWidth: containerWidth
62
- }), smartCard);
63
- }
64
- const displayGrid = (visible, gridType, highlight) => {
65
- var _pluginInjectionApi$d;
66
- 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)({
67
- visible,
68
- gridType,
69
- highlight: highlight
70
- });
71
- };
72
- return /*#__PURE__*/React.createElement(ResizableEmbedCard, _extends({}, cardProps, {
73
- height: heightAlone,
74
- aspectRatio: aspectRatio,
75
- view: view,
76
- getPos: getPos,
77
- lineLength: lineLength,
78
- gridSize: 12,
79
- containerWidth: containerWidth,
80
- displayGrid: displayGrid,
81
- updateSize: updateSize,
82
- dispatchAnalyticsEvent: dispatchAnalyticsEvent
83
- }), smartCard);
84
- };
85
- export class EmbedCardComponent extends React.PureComponent {
86
- constructor(...args) {
87
- super(...args);
88
- _defineProperty(this, "embedIframeRef", /*#__PURE__*/React.createRef());
89
- _defineProperty(this, "onClick", () => {});
90
- _defineProperty(this, "state", {
91
- hasPreview: true
92
- });
93
- _defineProperty(this, "getPosSafely", () => {
94
- const {
95
- getPos
96
- } = this.props;
97
- if (!getPos || typeof getPos === 'boolean') {
98
- return;
99
- }
100
- try {
101
- return getPos();
102
- } catch (e) {
103
- // Can blow up in rare cases, when node has been removed.
104
- }
105
- });
106
- _defineProperty(this, "onResolve", data => {
107
- const {
108
- view
109
- } = this.props;
110
- const {
111
- title,
112
- url,
113
- aspectRatio
114
- } = data;
115
- const {
116
- originalHeight,
117
- originalWidth
118
- } = this.props.node.attrs;
119
- if (aspectRatio && !originalHeight && !originalWidth) {
120
- // Assumption here is if ADF already have both height and width set,
121
- // we will going to use that later on in this class as aspectRatio
122
- // Most likely we dealing with an embed that received aspectRatio via onResolve previously
123
- // and now this information already stored in ADF.
124
- this.setState({
125
- initialAspectRatio: aspectRatio
126
- });
127
- this.saveOriginalDimensionsAttributes(DEFAULT_EMBED_CARD_HEIGHT, DEFAULT_EMBED_CARD_HEIGHT * aspectRatio);
128
- }
129
-
130
- // don't dispatch immediately since we might be in the middle of
131
- // rendering a nodeview
132
- rafSchedule(() => {
133
- const pos = this.getPosSafely();
134
- if (pos === undefined) {
135
- return;
136
- }
137
- return view.dispatch(registerCard({
138
- title,
139
- url,
140
- pos
141
- })(view.state.tr));
142
- })();
143
- try {
144
- const cardContext = this.context.contextAdapter ? this.context.contextAdapter.card : undefined;
145
- const hasPreview = cardContext && cardContext.value.extractors.getPreview(url, this.props.platform);
146
- if (!hasPreview) {
147
- this.setState({
148
- hasPreview: false
149
- });
150
- }
151
- } catch (e) {}
152
- });
153
- _defineProperty(this, "updateSize", (pctWidth, layout) => {
154
- const {
155
- state,
156
- dispatch
157
- } = this.props.view;
158
- const pos = this.getPosSafely();
159
- if (pos === undefined) {
160
- return;
161
- }
162
- const tr = state.tr.setNodeMarkup(pos, undefined, {
163
- ...this.props.node.attrs,
164
- width: pctWidth,
165
- layout
166
- });
167
- tr.setMeta('scrollIntoView', false);
168
- dispatch(tr);
169
- return true;
170
- });
171
- _defineProperty(this, "getLineLength", (view, pos, originalLineLength) => {
172
- if (typeof pos === 'number' && isRichMediaInsideOfBlockNode(view, pos)) {
173
- const $pos = view.state.doc.resolve(pos);
174
- const domNode = view.nodeDOM($pos.pos);
175
- if ($pos.nodeAfter && floatingLayouts.indexOf($pos.nodeAfter.attrs.layout) > -1 && domNode && domNode.parentElement) {
176
- return domNode.parentElement.offsetWidth;
177
- }
178
- if (domNode instanceof HTMLElement) {
179
- return domNode.offsetWidth;
180
- }
181
- }
182
- return originalLineLength;
183
- });
184
- /**
185
- * Even though render is capable of listening and reacting to iframely wrapper iframe sent `resize` events
186
- * it's good idea to store latest actual height in ADF, so that when renderer (well, editor as well) is loading
187
- * we will show embed window of appropriate size and avoid unnecessary content jumping.
188
- */
189
- _defineProperty(this, "saveOriginalDimensionsAttributes", (height, width) => {
190
- const {
191
- view
192
- } = this.props;
193
-
194
- // TODO: ED-15663
195
- // Please, do not copy or use this kind of code below
196
- // @ts-ignore
197
- const fakeTableResizePluginKey = {
198
- key: 'tableFlexiColumnResizing$',
199
- getState: state => {
200
- return state['tableFlexiColumnResizing$'];
201
- }
202
- };
203
- const fakeTableResizeState = fakeTableResizePluginKey.getState(view.state);
204
-
205
- // We are not updating ADF when this function fired while table is resizing.
206
- // Changing ADF in the middle of resize will break table resize plugin logic
207
- // (tables will be considered different at the end of the drag and cell size won't be stored)
208
- // But this is not a big problem, editor user will be seeing latest height anyway (via updated state)
209
- // And even if page to be saved with slightly outdated height, renderer is capable of reading latest height value
210
- // when embed loads, and so it won't be a problem.
211
- if (fakeTableResizeState !== null && fakeTableResizeState !== void 0 && fakeTableResizeState.dragging) {
212
- return;
213
- }
214
- rafSchedule(() => {
215
- const pos = this.getPosSafely();
216
- if (pos === undefined) {
217
- return;
218
- }
219
- view.dispatch(view.state.tr.step(new SetAttrsStep(pos, {
220
- originalHeight: height,
221
- originalWidth: width
222
- })).setMeta('addToHistory', false));
223
- })();
224
- });
225
- _defineProperty(this, "onHeightUpdate", height => {
226
- this.setState({
227
- liveHeight: height
228
- });
229
- this.saveOriginalDimensionsAttributes(height, undefined);
230
- });
231
- _defineProperty(this, "onError", ({
232
- err
233
- }) => {
234
- if (err) {
235
- throw err;
236
- }
237
- });
238
- }
239
- UNSAFE_componentWillMount() {
240
- const {
241
- view
242
- } = this.props;
243
- const scrollContainer = findOverflowScrollParent(view.dom);
244
- this.scrollContainer = scrollContainer || undefined;
245
- }
246
- render() {
247
- const {
248
- node,
249
- cardContext,
250
- platform,
251
- allowResizing,
252
- fullWidthMode,
253
- view,
254
- dispatchAnalyticsEvent,
255
- getPos,
256
- pluginInjectionApi
257
- } = this.props;
258
- let {
259
- url,
260
- width: pctWidth,
261
- layout,
262
- originalHeight,
263
- originalWidth
264
- } = node.attrs;
265
- const {
266
- hasPreview,
267
- liveHeight,
268
- initialAspectRatio
269
- } = this.state;
270
-
271
- // We don't want to use `originalHeight` when `originalWidth` also present,
272
- // since `heightAlone` is defined only when just height is available.
273
- let heightAlone = liveHeight !== null && liveHeight !== void 0 ? liveHeight : !originalWidth && originalHeight || undefined;
274
- const aspectRatio = !heightAlone && (
275
- // No need getting aspectRatio if heightAlone defined already
276
- initialAspectRatio ||
277
- // If we have initialAspectRatio (coming from iframely) we should go with that
278
- originalHeight && originalWidth && originalWidth / originalHeight) ||
279
- // If ADF contains both width and height we get ratio from that
280
- undefined;
281
- const cardProps = {
282
- layout,
283
- pctWidth,
284
- fullWidthMode
285
- };
286
- const smartCard = /*#__PURE__*/React.createElement(SmartCard, {
287
- key: url,
288
- url: url,
289
- appearance: "embed",
290
- onClick: this.onClick,
291
- onResolve: this.onResolve,
292
- onError: this.onError,
293
- showActions: platform === 'web',
294
- isFrameVisible: true,
295
- inheritDimensions: true,
296
- platform: platform,
297
- container: this.scrollContainer,
298
- embedIframeRef: this.embedIframeRef
299
- });
300
- const cardInner = /*#__PURE__*/React.createElement(EmbedResizeMessageListener, {
301
- embedIframeRef: this.embedIframeRef,
302
- onHeightUpdate: this.onHeightUpdate
303
- }, /*#__PURE__*/React.createElement(CardInner, {
304
- pluginInjectionApi: pluginInjectionApi,
305
- smartCard: smartCard,
306
- hasPreview: hasPreview,
307
- getPosSafely: this.getPosSafely,
308
- view: view,
309
- getLineLength: this.getLineLength,
310
- eventDispatcher: this.props.eventDispatcher,
311
- updateSize: this.updateSize,
312
- getPos: getPos,
313
- aspectRatio: aspectRatio,
314
- allowResizing: allowResizing,
315
- heightAlone: heightAlone,
316
- cardProps: cardProps,
317
- dispatchAnalyticsEvent: dispatchAnalyticsEvent
318
- }));
319
-
320
- // [WS-2307]: we only render card wrapped into a Provider when the value is ready
321
- return /*#__PURE__*/React.createElement(React.Fragment, null, cardContext && cardContext.value ? /*#__PURE__*/React.createElement(cardContext.Provider, {
322
- value: cardContext.value
323
- }, cardInner) : null);
324
- }
325
- }
326
- _defineProperty(EmbedCardComponent, "contextTypes", {
327
- contextAdapter: PropTypes.object
328
- });
329
- const WrappedBlockCard = Card(EmbedCardComponent, UnsupportedBlock);
330
- export class EmbedCard extends ReactNodeView {
331
- viewShouldUpdate(nextNode) {
332
- if (this.node.attrs !== nextNode.attrs) {
333
- return true;
334
- }
335
- return super.viewShouldUpdate(nextNode);
336
- }
337
- createDomRef() {
338
- const domRef = document.createElement('div');
339
- if (this.reactComponentProps.platform !== 'mobile') {
340
- // workaround Chrome bug in https://product-fabric.atlassian.net/browse/ED-5379
341
- // see also: https://github.com/ProseMirror/prosemirror/issues/884
342
- domRef.contentEditable = 'true';
343
- domRef.setAttribute('spellcheck', 'false');
344
- }
345
- return domRef;
346
- }
347
- render() {
348
- const {
349
- eventDispatcher,
350
- allowResizing,
351
- platform,
352
- fullWidthMode,
353
- dispatchAnalyticsEvent,
354
- pluginInjectionApi
355
- } = this.reactComponentProps;
356
- return /*#__PURE__*/React.createElement(WrappedBlockCard, {
357
- node: this.node,
358
- view: this.view,
359
- eventDispatcher: eventDispatcher,
360
- getPos: this.getPos,
361
- allowResizing: allowResizing,
362
- platform: platform,
363
- fullWidthMode: fullWidthMode,
364
- dispatchAnalyticsEvent: dispatchAnalyticsEvent,
365
- pluginInjectionApi: pluginInjectionApi
366
- });
367
- }
368
- }