@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,360 +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.default = void 0;
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 _react2 = require("@emotion/react");
18
- var _prosemirrorUtils = require("prosemirror-utils");
19
- var _ui = require("@atlaskit/editor-common/ui");
20
- var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
21
- var _smartCard = require("@atlaskit/smart-card");
22
- var _styles = require("@atlaskit/editor-common/styles");
23
- 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; }
24
- 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; }
25
- 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); }; }
26
- 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; } } /** @jsx jsx */
27
- var ResizableEmbedCard = /*#__PURE__*/function (_React$Component) {
28
- (0, _inherits2.default)(ResizableEmbedCard, _React$Component);
29
- var _super = _createSuper(ResizableEmbedCard);
30
- function ResizableEmbedCard() {
31
- var _this;
32
- (0, _classCallCheck2.default)(this, ResizableEmbedCard);
33
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
34
- args[_key] = arguments[_key];
35
- }
36
- _this = _super.call.apply(_super, [this].concat(args));
37
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", {
38
- offsetLeft: _this.calcOffsetLeft()
39
- });
40
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "calcNewSize", function (newWidth, stop) {
41
- var _this$props = _this.props,
42
- layout = _this$props.layout,
43
- state = _this$props.view.state;
44
- var newPct = (0, _ui.calcPctFromPx)(newWidth, _this.props.lineLength) * 100;
45
- _this.setState({
46
- resizedPctWidth: newPct
47
- });
48
- var newLayout = (0, _prosemirrorUtils.hasParentNodeOfType)(state.schema.nodes.table)(state.selection) ? layout : _this.calcUnwrappedLayout(newPct, newWidth);
49
- if (newPct <= 100) {
50
- if (_this.wrappedLayout && (stop ? newPct !== 100 : true)) {
51
- newLayout = layout;
52
- }
53
- return {
54
- width: newPct,
55
- layout: newLayout
56
- };
57
- } else {
58
- return {
59
- width: _this.props.pctWidth || null,
60
- layout: newLayout
61
- };
62
- }
63
- });
64
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "calcUnwrappedLayout", function (pct, width) {
65
- if (pct <= 100) {
66
- return 'center';
67
- }
68
- if (width <= _this.wideLayoutWidth) {
69
- return 'wide';
70
- }
71
- return 'full-width';
72
- });
73
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "calcColumnLeftOffset", function () {
74
- var offsetLeft = _this.state.offsetLeft;
75
- return _this.insideInlineLike ? (0, _ui.calcColumnsFromPx)(offsetLeft, _this.props.lineLength, _this.props.gridSize) : 0;
76
- });
77
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "calcPxWidth", function (useLayout) {
78
- var _this$props2 = _this.props,
79
- layout = _this$props2.layout,
80
- pctWidth = _this$props2.pctWidth,
81
- lineLength = _this$props2.lineLength,
82
- containerWidth = _this$props2.containerWidth,
83
- fullWidthMode = _this$props2.fullWidthMode,
84
- getPos = _this$props2.getPos,
85
- state = _this$props2.view.state;
86
- var resizedPctWidth = _this.state.resizedPctWidth;
87
- var pos = typeof getPos === 'function' ? getPos() : undefined;
88
- return (0, _ui.calcMediaPxWidth)({
89
- origWidth: _editorSharedStyles.DEFAULT_EMBED_CARD_WIDTH,
90
- origHeight: _editorSharedStyles.DEFAULT_EMBED_CARD_HEIGHT,
91
- pctWidth: pctWidth,
92
- state: state,
93
- containerWidth: {
94
- width: containerWidth,
95
- lineLength: lineLength
96
- },
97
- isFullWidthModeEnabled: fullWidthMode,
98
- layout: useLayout || layout,
99
- pos: pos,
100
- resizedPctWidth: resizedPctWidth
101
- });
102
- });
103
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "highlights", function (newWidth, snapPoints) {
104
- var snapWidth = (0, _ui.snapTo)(newWidth, snapPoints);
105
- var _this$props$view$stat = _this.props.view.state.schema.nodes,
106
- layoutColumn = _this$props$view$stat.layoutColumn,
107
- table = _this$props$view$stat.table,
108
- expand = _this$props$view$stat.expand,
109
- nestedExpand = _this$props$view$stat.nestedExpand;
110
- if (_this.$pos && !!(0, _prosemirrorUtils.findParentNodeOfTypeClosestToPos)(_this.$pos, [layoutColumn, table, expand, nestedExpand].filter(Boolean))) {
111
- return [];
112
- }
113
- if (snapWidth > _this.wideLayoutWidth) {
114
- return ['full-width'];
115
- }
116
- var _this$props3 = _this.props,
117
- layout = _this$props3.layout,
118
- lineLength = _this$props3.lineLength,
119
- gridSize = _this$props3.gridSize;
120
- var columns = (0, _ui.calcColumnsFromPx)(snapWidth, lineLength, gridSize);
121
- var columnWidth = Math.round(columns);
122
- var highlight = [];
123
- if (layout === 'wrap-left' || layout === 'align-start') {
124
- highlight.push(0, columnWidth);
125
- } else if (layout === 'wrap-right' || layout === 'align-end') {
126
- highlight.push(gridSize, gridSize - columnWidth);
127
- } else if (_this.insideInlineLike) {
128
- highlight.push(Math.round(columns + _this.calcColumnLeftOffset()));
129
- } else {
130
- highlight.push(Math.floor((gridSize - columnWidth) / 2), Math.ceil((gridSize + columnWidth) / 2));
131
- }
132
- return highlight;
133
- });
134
- return _this;
135
- }
136
- (0, _createClass2.default)(ResizableEmbedCard, [{
137
- key: "componentDidUpdate",
138
- value: function componentDidUpdate() {
139
- var offsetLeft = this.calcOffsetLeft();
140
- if (offsetLeft !== this.state.offsetLeft && offsetLeft >= 0) {
141
- this.setState({
142
- offsetLeft: offsetLeft
143
- });
144
- }
145
- }
146
- }, {
147
- key: "wrappedLayout",
148
- get: function get() {
149
- return _ui.wrappedLayouts.indexOf(this.props.layout) > -1;
150
- }
151
- }, {
152
- key: "UNSAFE_componentWillReceiveProps",
153
- value: function UNSAFE_componentWillReceiveProps(nextProps) {
154
- if (this.props.layout !== nextProps.layout) {
155
- this.checkLayout(this.props.layout, nextProps.layout);
156
- }
157
- }
158
-
159
- /**
160
- * When returning to center layout from a wrapped/aligned layout, it might actually
161
- * be wide or full-width
162
- */
163
- }, {
164
- key: "checkLayout",
165
- value: function checkLayout(oldLayout, newLayout) {
166
- var resizedPctWidth = this.state.resizedPctWidth;
167
- if (_ui.wrappedLayouts.indexOf(oldLayout) > -1 && newLayout === 'center' && resizedPctWidth) {
168
- var layout = this.calcUnwrappedLayout(resizedPctWidth, this.calcPxWidth(newLayout));
169
- this.props.updateSize(resizedPctWidth, layout);
170
- }
171
- }
172
- }, {
173
- key: "$pos",
174
- get: function get() {
175
- if (typeof this.props.getPos !== 'function') {
176
- return null;
177
- }
178
- var pos = this.props.getPos();
179
- if (Number.isNaN(pos) || typeof pos !== 'number') {
180
- return null;
181
- }
182
-
183
- // need to pass view because we may not get updated props in time
184
- return this.props.view.state.doc.resolve(pos);
185
- }
186
-
187
- /**
188
- * The maxmimum number of grid columns this node can resize to.
189
- */
190
- }, {
191
- key: "gridWidth",
192
- get: function get() {
193
- var gridSize = this.props.gridSize;
194
- return !(this.wrappedLayout || this.insideInlineLike) ? gridSize / 2 : gridSize;
195
- }
196
- }, {
197
- key: "calcOffsetLeft",
198
- value: function calcOffsetLeft() {
199
- var offsetLeft = 0;
200
- if (this.wrapper && this.insideInlineLike) {
201
- var currentNode = this.wrapper;
202
- var boundingRect = currentNode.getBoundingClientRect();
203
- var pmRect = this.props.view.dom.getBoundingClientRect();
204
- offsetLeft = boundingRect.left - pmRect.left;
205
- }
206
- return offsetLeft;
207
- }
208
- }, {
209
- key: "wideLayoutWidth",
210
- get: function get() {
211
- var lineLength = this.props.lineLength;
212
- if (lineLength) {
213
- return Math.ceil(lineLength * _editorSharedStyles.breakoutWideScaleRatio);
214
- } else {
215
- return _editorSharedStyles.akEditorWideLayoutWidth;
216
- }
217
- }
218
- }, {
219
- key: "calcSnapPoints",
220
- value: function calcSnapPoints() {
221
- var offsetLeft = this.state.offsetLeft;
222
- var _this$props4 = this.props,
223
- containerWidth = _this$props4.containerWidth,
224
- lineLength = _this$props4.lineLength;
225
- var snapTargets = [];
226
- for (var i = 0; i < this.gridWidth; i++) {
227
- snapTargets.push((0, _ui.calcPxFromColumns)(i, lineLength, this.gridWidth) - offsetLeft);
228
- }
229
- // full width
230
- snapTargets.push(lineLength - offsetLeft);
231
- var minimumWidth = (0, _ui.calcPxFromColumns)(this.wrappedLayout || this.insideInlineLike ? 1 : 2, lineLength, this.props.gridSize);
232
- var snapPoints = snapTargets.filter(function (width) {
233
- return width >= minimumWidth;
234
- });
235
- var $pos = this.$pos;
236
- if (!$pos) {
237
- return snapPoints;
238
- }
239
- var isTopLevel = $pos.parent.type.name === 'doc';
240
- if (isTopLevel) {
241
- snapPoints.push(this.wideLayoutWidth);
242
- var fullWidthPoint = containerWidth - _editorSharedStyles.akEditorBreakoutPadding;
243
- if (fullWidthPoint > this.wideLayoutWidth) {
244
- snapPoints.push(fullWidthPoint);
245
- }
246
- }
247
- return snapPoints;
248
- }
249
- }, {
250
- key: "insideInlineLike",
251
- get: function get() {
252
- var $pos = this.$pos;
253
- if (!$pos) {
254
- return false;
255
- }
256
- var listItem = this.props.view.state.schema.nodes.listItem;
257
- return !!(0, _prosemirrorUtils.findParentNodeOfTypeClosestToPos)($pos, [listItem]);
258
- }
259
- }, {
260
- key: "getHeightDefiningComponent",
261
- value:
262
- /**
263
- * Previously height of the box was controlled with paddingTop/paddingBottom trick inside Wrapper.
264
- * It allowed height to be defined by a given percent ratio and so absolute value was defined by actual width.
265
- * Also, it was part of styled component, which was fine because it was static through out life time of component.
266
- *
267
- * Now, two things changed:
268
- * 1. If `height` is present we take it as actual height of the box, and hence we don't need
269
- * (or even can't have, due to lack of width value) paddingTop trick.
270
- * 2. Since `height` can be changing through out life time of a component, we can't have it as part of styled component,
271
- * and hence we use `style` prop.
272
- */
273
- function getHeightDefiningComponent() {
274
- var _this$props5 = this.props,
275
- height = _this$props5.height,
276
- aspectRatio = _this$props5.aspectRatio;
277
- var heightDefiningStyles;
278
- if (height) {
279
- heightDefiningStyles = {
280
- height: "".concat(height, "px")
281
- };
282
- } else {
283
- // paddingBottom css trick defines ratio of `iframe height (y) + header (32)` to `width (x)`,
284
- // where is `aspectRatio` defines iframe aspectRatio alone
285
- // So, visually:
286
- //
287
- // x
288
- // ┌──────────┐
289
- // │ header │ 32
290
- // ├──────────┤
291
- // │ │
292
- // │ iframe │ y
293
- // │ │
294
- // └──────────┘
295
- //
296
- // aspectRatio = x / y
297
- // paddingBottom = (y + 32) / x
298
- // which can be achieved with css calc() as (1 / (x/y)) * 100)% + 32px
299
- heightDefiningStyles = {
300
- paddingBottom: "calc(".concat((1 / aspectRatio * 100).toFixed(3), "% + ").concat(_smartCard.embedHeaderHeight, "px)")
301
- };
302
- }
303
- return (0, _react2.jsx)("span", {
304
- "data-testid": 'resizable-embed-card-height-definer',
305
- style: _objectSpread({
306
- display: 'block',
307
- /* Fixes extra padding problem in Firefox */
308
- fontSize: 0,
309
- lineHeight: 0
310
- }, heightDefiningStyles)
311
- });
312
- }
313
- }, {
314
- key: "render",
315
- value: function render() {
316
- var _this2 = this;
317
- var _this$props6 = this.props,
318
- layout = _this$props6.layout,
319
- pctWidth = _this$props6.pctWidth,
320
- containerWidth = _this$props6.containerWidth,
321
- fullWidthMode = _this$props6.fullWidthMode,
322
- children = _this$props6.children;
323
- var initialWidth = this.calcPxWidth() - _editorSharedStyles.akEditorMediaResizeHandlerPaddingWide;
324
- var enable = {};
325
- _ui.handleSides.forEach(function (side) {
326
- var oppositeSide = side === 'left' ? 'right' : 'left';
327
- enable[side] = ['full-width', 'wide', 'center'].concat("wrap-".concat(oppositeSide)).concat("align-".concat(_ui.imageAlignmentMap[oppositeSide])).indexOf(layout) > -1;
328
- if (side === 'left' && _this2.insideInlineLike) {
329
- enable[side] = false;
330
- }
331
- });
332
- return (0, _react2.jsx)("div", {
333
- css: _styles.embedSpacingStyles,
334
- "data-testid": "resizable-embed-card-spacing"
335
- }, (0, _react2.jsx)("div", {
336
- css: (0, _ui.wrapperStyle)({
337
- layout: layout,
338
- isResized: !!pctWidth,
339
- containerWidth: containerWidth || _editorSharedStyles.DEFAULT_EMBED_CARD_WIDTH,
340
- fullWidthMode: fullWidthMode
341
- })
342
- }, (0, _react2.jsx)(_ui.Resizer, (0, _extends2.default)({}, this.props, {
343
- width: initialWidth // Starting or initial width of embed <iframe> itself.
344
- ,
345
- enable: enable,
346
- calcNewSize: this.calcNewSize,
347
- snapPoints: this.calcSnapPoints(),
348
- scaleFactor: !this.wrappedLayout && !this.insideInlineLike ? 2 : 1,
349
- highlights: this.highlights,
350
- innerPadding: _editorSharedStyles.akEditorMediaResizeHandlerPaddingWide,
351
- nodeType: "embed"
352
- }), children, this.getHeightDefiningComponent())));
353
- }
354
- }]);
355
- return ResizableEmbedCard;
356
- }(_react.default.Component);
357
- exports.default = ResizableEmbedCard;
358
- (0, _defineProperty2.default)(ResizableEmbedCard, "defaultProps", {
359
- aspectRatio: _editorSharedStyles.DEFAULT_EMBED_CARD_WIDTH / _editorSharedStyles.DEFAULT_EMBED_CARD_HEIGHT
360
- });
@@ -1,20 +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.SmallerEditIcon = void 0;
8
- var _react = require("@emotion/react");
9
- var _edit = _interopRequireDefault(require("@atlaskit/icon/glyph/edit"));
10
- var _styles = require("@atlaskit/editor-common/styles");
11
- /** @jsx jsx */
12
-
13
- var SmallerEditIcon = function SmallerEditIcon() {
14
- return (0, _react.jsx)("div", {
15
- css: _styles.editIconStyles
16
- }, (0, _react.jsx)(_edit.default, {
17
- label: "edit"
18
- }));
19
- };
20
- exports.SmallerEditIcon = SmallerEditIcon;
@@ -1,60 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.titleUrlPairFromNode = exports.selectedCardAppearance = exports.mergeCardInfo = exports.findCardInfo = exports.displayInfoForCard = exports.appearanceForNodeType = void 0;
7
- var _prosemirrorState = require("prosemirror-state");
8
- var _pluginKey = require("./pm-plugins/plugin-key");
9
- var appearanceForNodeType = function appearanceForNodeType(spec) {
10
- if (spec.name === 'inlineCard') {
11
- return 'inline';
12
- } else if (spec.name === 'blockCard') {
13
- return 'block';
14
- } else if (spec.name === 'embedCard') {
15
- return 'embed';
16
- }
17
- return;
18
- };
19
- exports.appearanceForNodeType = appearanceForNodeType;
20
- var selectedCardAppearance = function selectedCardAppearance(state) {
21
- if (state.selection instanceof _prosemirrorState.NodeSelection) {
22
- return appearanceForNodeType(state.selection.node.type);
23
- }
24
- };
25
- exports.selectedCardAppearance = selectedCardAppearance;
26
- var titleUrlPairFromNode = function titleUrlPairFromNode(node) {
27
- var attrs = node.attrs;
28
- return {
29
- url: attrs.url || attrs.data && attrs.data.url,
30
- title: attrs.data && attrs.data.title
31
- };
32
- };
33
-
34
- /**
35
- * Merges the title and url from attributes and CardInfo from the resolved view, preferring the CardInfo.
36
- * @param titleUrlPair title and url information from the node attributes
37
- * @param info information stored in state from the resolved UI component view
38
- */
39
- exports.titleUrlPairFromNode = titleUrlPairFromNode;
40
- var mergeCardInfo = function mergeCardInfo(titleUrlPair, info) {
41
- return {
42
- title: info && info.title || titleUrlPair.title,
43
- url: info && info.url || titleUrlPair.url
44
- };
45
- };
46
- exports.mergeCardInfo = mergeCardInfo;
47
- var displayInfoForCard = function displayInfoForCard(node, info) {
48
- return mergeCardInfo(titleUrlPairFromNode(node), info);
49
- };
50
- exports.displayInfoForCard = displayInfoForCard;
51
- var findCardInfo = function findCardInfo(state) {
52
- var pluginState = _pluginKey.pluginKey.getState(state);
53
- if (!pluginState) {
54
- return undefined;
55
- }
56
- return pluginState.cards.find(function (cardInfo) {
57
- return cardInfo.pos === state.selection.from;
58
- });
59
- };
60
- exports.findCardInfo = findCardInfo;
@@ -1,131 +0,0 @@
1
- import React from 'react';
2
- import { inlineCard, blockCard, embedCard } from '@atlaskit/adf-schema';
3
- import { createPlugin } from './pm-plugins/main';
4
- import { floatingToolbar } from './toolbar';
5
- import { EditorSmartCardEvents } from './ui/EditorSmartCardEvents';
6
- import { cardKeymap } from './pm-plugins/keymap';
7
- import { queueCardsFromChangedTr, changeSelectedCardToLink, setSelectedCardAppearance } from './pm-plugins/doc';
8
- import { hideLinkToolbar } from './pm-plugins/actions';
9
- import { EditorSmartCardEventsNext } from './ui/EditorSmartCardEventsNext';
10
- import LayoutButton from './ui/LayoutButton';
11
- import { pluginKey } from './pm-plugins/plugin-key';
12
- import { mountHyperlinkPlugin } from './pm-plugins/mountHyperlink';
13
- import { showDatasourceModal } from './pm-plugins/actions';
14
- import DatasourceModalWithState from './ui/DatasourceModal/ModalWithState';
15
- import { messages } from './messages';
16
- import { IconDatasourceJiraIssue } from '@atlaskit/editor-common/quick-insert';
17
- import { canRenderDatasource } from '@atlaskit/editor-common/utils';
18
- import { JIRA_LIST_OF_LINKS_DATASOURCE_ID } from '@atlaskit/link-datasource';
19
- const cardPlugin = (options, api) => {
20
- var _api$dependencies, _api$dependencies$fea;
21
- const featureFlags = (api === null || api === void 0 ? void 0 : (_api$dependencies = api.dependencies) === null || _api$dependencies === void 0 ? void 0 : (_api$dependencies$fea = _api$dependencies.featureFlags) === null || _api$dependencies$fea === void 0 ? void 0 : _api$dependencies$fea.sharedState.currentState()) || {};
22
- return {
23
- name: 'card',
24
- getSharedState(editorState) {
25
- if (!editorState) {
26
- return null;
27
- }
28
- return pluginKey.getState(editorState) || null;
29
- },
30
- nodes() {
31
- const nodes = [{
32
- name: 'inlineCard',
33
- node: inlineCard
34
- }, {
35
- name: 'blockCard',
36
- node: blockCard
37
- }];
38
- if (options.allowEmbeds) {
39
- nodes.push({
40
- name: 'embedCard',
41
- node: embedCard
42
- });
43
- }
44
- return nodes;
45
- },
46
- pmPlugins() {
47
- var _options$allowBlockCa, _options$allowResizin, _options$useAlternati, _options$allowWrappin, _options$allowAlignme;
48
- const allowBlockCards = (_options$allowBlockCa = options.allowBlockCards) !== null && _options$allowBlockCa !== void 0 ? _options$allowBlockCa : true;
49
- const allowResizing = (_options$allowResizin = options.allowResizing) !== null && _options$allowResizin !== void 0 ? _options$allowResizin : true;
50
- const useAlternativePreloader = (_options$useAlternati = options.useAlternativePreloader) !== null && _options$useAlternati !== void 0 ? _options$useAlternati : true;
51
- const allowWrapping = (_options$allowWrappin = options.allowWrapping) !== null && _options$allowWrappin !== void 0 ? _options$allowWrappin : true;
52
- const allowAlignment = (_options$allowAlignme = options.allowAlignment) !== null && _options$allowAlignme !== void 0 ? _options$allowAlignme : true;
53
- const plugins = [{
54
- name: 'card',
55
- plugin: createPlugin({
56
- ...options,
57
- allowBlockCards,
58
- allowResizing,
59
- useAlternativePreloader,
60
- allowWrapping,
61
- allowAlignment
62
- }, api)
63
- }, {
64
- name: 'cardHyperlink',
65
- plugin: () => mountHyperlinkPlugin(api, options)
66
- }];
67
- plugins.push({
68
- name: 'cardKeymap',
69
- plugin: ({
70
- featureFlags
71
- }) => {
72
- return cardKeymap(featureFlags);
73
- }
74
- });
75
- return plugins;
76
- },
77
- contentComponent({
78
- editorView,
79
- popupsMountPoint,
80
- popupsScrollableElement,
81
- popupsBoundariesElement
82
- }) {
83
- const {
84
- lpAnalyticsEventsNext
85
- } = featureFlags;
86
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(EditorSmartCardEvents, {
87
- editorView: editorView
88
- }), lpAnalyticsEventsNext && /*#__PURE__*/React.createElement(EditorSmartCardEventsNext, {
89
- editorView: editorView
90
- }), /*#__PURE__*/React.createElement(LayoutButton, {
91
- api: api,
92
- editorView: editorView,
93
- mountPoint: popupsMountPoint,
94
- scrollableElement: popupsScrollableElement,
95
- boundariesElement: popupsBoundariesElement
96
- }), /*#__PURE__*/React.createElement(DatasourceModalWithState, {
97
- api: api,
98
- editorView: editorView
99
- }));
100
- },
101
- actions: {
102
- hideLinkToolbar,
103
- queueCardsFromChangedTr,
104
- changeSelectedCardToLink,
105
- setSelectedCardAppearance
106
- },
107
- pluginsOptions: {
108
- floatingToolbar: floatingToolbar(options, featureFlags, options.platform, options.linkPicker, api),
109
- quickInsert: ({
110
- formatMessage
111
- }) => {
112
- if (canRenderDatasource(JIRA_LIST_OF_LINKS_DATASOURCE_ID)) {
113
- return [{
114
- id: 'datasource',
115
- title: formatMessage(messages.datasourceJiraIssue),
116
- description: formatMessage(messages.datasourceJiraIssueDescription),
117
- keywords: ['jira'],
118
- icon: () => /*#__PURE__*/React.createElement(IconDatasourceJiraIssue, null),
119
- action(insert) {
120
- const tr = insert(undefined);
121
- showDatasourceModal('jira')(tr);
122
- return tr;
123
- }
124
- }];
125
- }
126
- return [];
127
- }
128
- }
129
- };
130
- };
131
- export default cardPlugin;
@@ -1,13 +0,0 @@
1
- import { defineMessages } from 'react-intl-next';
2
- export const messages = defineMessages({
3
- datasourceJiraIssue: {
4
- id: 'fabric.editor.datasource.jiraIssue',
5
- defaultMessage: 'Jira Issues',
6
- description: 'Insert a jira datasource table'
7
- },
8
- datasourceJiraIssueDescription: {
9
- id: 'fabric.editor.datasource.jiraIssue.description',
10
- defaultMessage: 'Insert issues from Jira Cloud with enhanced search, filtering, and configuration',
11
- description: 'Insert a jira datasource table'
12
- }
13
- });