@atlaskit/editor-core 185.16.3 → 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 (358) hide show
  1. package/.eslintrc.js +1 -0
  2. package/CHANGELOG.md +8 -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/version-wrapper.js +1 -1
  36. package/dist/cjs/version.json +1 -1
  37. package/dist/es2019/i18n/cs.js +0 -35
  38. package/dist/es2019/i18n/da.js +0 -35
  39. package/dist/es2019/i18n/de.js +0 -35
  40. package/dist/es2019/i18n/en.js +0 -35
  41. package/dist/es2019/i18n/en_GB.js +0 -35
  42. package/dist/es2019/i18n/en_ZZ.js +0 -35
  43. package/dist/es2019/i18n/es.js +1 -35
  44. package/dist/es2019/i18n/fi.js +0 -35
  45. package/dist/es2019/i18n/fr.js +1 -35
  46. package/dist/es2019/i18n/hu.js +1 -35
  47. package/dist/es2019/i18n/it.js +1 -35
  48. package/dist/es2019/i18n/ja.js +1 -35
  49. package/dist/es2019/i18n/ko.js +0 -35
  50. package/dist/es2019/i18n/nb.js +1 -35
  51. package/dist/es2019/i18n/nl.js +1 -35
  52. package/dist/es2019/i18n/pl.js +1 -35
  53. package/dist/es2019/i18n/pt_BR.js +1 -35
  54. package/dist/es2019/i18n/ru.js +1 -35
  55. package/dist/es2019/i18n/sv.js +0 -35
  56. package/dist/es2019/i18n/th.js +0 -35
  57. package/dist/es2019/i18n/tr.js +1 -35
  58. package/dist/es2019/i18n/uk.js +1 -35
  59. package/dist/es2019/i18n/vi.js +0 -35
  60. package/dist/es2019/i18n/zh.js +1 -35
  61. package/dist/es2019/i18n/zh_TW.js +1 -35
  62. package/dist/es2019/labs/next/presets/mobile.js +1 -1
  63. package/dist/es2019/labs/next/presets/universal.js +1 -1
  64. package/dist/es2019/plugins/deprecated-card/doc.js +97 -0
  65. package/dist/es2019/plugins/deprecated-hyperlink/commands.js +1 -1
  66. package/dist/es2019/plugins/index.js +0 -1
  67. package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +2 -14
  68. package/dist/es2019/plugins/media/ui/ResizableMediaSingle/index.js +13 -0
  69. package/dist/es2019/version-wrapper.js +1 -1
  70. package/dist/es2019/version.json +1 -1
  71. package/dist/esm/i18n/cs.js +0 -35
  72. package/dist/esm/i18n/da.js +0 -35
  73. package/dist/esm/i18n/de.js +0 -35
  74. package/dist/esm/i18n/en.js +0 -35
  75. package/dist/esm/i18n/en_GB.js +0 -35
  76. package/dist/esm/i18n/en_ZZ.js +0 -35
  77. package/dist/esm/i18n/es.js +1 -35
  78. package/dist/esm/i18n/fi.js +0 -35
  79. package/dist/esm/i18n/fr.js +1 -35
  80. package/dist/esm/i18n/hu.js +1 -35
  81. package/dist/esm/i18n/it.js +1 -35
  82. package/dist/esm/i18n/ja.js +1 -35
  83. package/dist/esm/i18n/ko.js +0 -35
  84. package/dist/esm/i18n/nb.js +1 -35
  85. package/dist/esm/i18n/nl.js +1 -35
  86. package/dist/esm/i18n/pl.js +1 -35
  87. package/dist/esm/i18n/pt_BR.js +1 -35
  88. package/dist/esm/i18n/ru.js +1 -35
  89. package/dist/esm/i18n/sv.js +0 -35
  90. package/dist/esm/i18n/th.js +0 -35
  91. package/dist/esm/i18n/tr.js +1 -35
  92. package/dist/esm/i18n/uk.js +1 -35
  93. package/dist/esm/i18n/vi.js +0 -35
  94. package/dist/esm/i18n/zh.js +1 -35
  95. package/dist/esm/i18n/zh_TW.js +1 -35
  96. package/dist/esm/labs/next/presets/mobile.js +1 -1
  97. package/dist/esm/labs/next/presets/universal.js +1 -1
  98. package/dist/esm/plugins/deprecated-card/doc.js +105 -0
  99. package/dist/esm/plugins/deprecated-hyperlink/commands.js +1 -1
  100. package/dist/esm/plugins/index.js +0 -1
  101. package/dist/esm/plugins/media/nodeviews/mediaSingle.js +14 -25
  102. package/dist/esm/plugins/media/ui/ResizableMediaSingle/index.js +39 -27
  103. package/dist/esm/version-wrapper.js +1 -1
  104. package/dist/esm/version.json +1 -1
  105. package/dist/types/i18n/cs.d.ts +0 -35
  106. package/dist/types/i18n/da.d.ts +0 -35
  107. package/dist/types/i18n/de.d.ts +0 -35
  108. package/dist/types/i18n/en.d.ts +0 -35
  109. package/dist/types/i18n/en_GB.d.ts +0 -35
  110. package/dist/types/i18n/en_ZZ.d.ts +0 -35
  111. package/dist/types/i18n/es.d.ts +1 -35
  112. package/dist/types/i18n/fi.d.ts +0 -35
  113. package/dist/types/i18n/fr.d.ts +1 -35
  114. package/dist/types/i18n/hu.d.ts +1 -35
  115. package/dist/types/i18n/it.d.ts +1 -35
  116. package/dist/types/i18n/ja.d.ts +1 -35
  117. package/dist/types/i18n/ko.d.ts +0 -35
  118. package/dist/types/i18n/nb.d.ts +1 -35
  119. package/dist/types/i18n/nl.d.ts +1 -35
  120. package/dist/types/i18n/pl.d.ts +1 -35
  121. package/dist/types/i18n/pt_BR.d.ts +1 -35
  122. package/dist/types/i18n/ru.d.ts +1 -35
  123. package/dist/types/i18n/sv.d.ts +0 -35
  124. package/dist/types/i18n/th.d.ts +0 -35
  125. package/dist/types/i18n/tr.d.ts +1 -35
  126. package/dist/types/i18n/uk.d.ts +1 -35
  127. package/dist/types/i18n/vi.d.ts +0 -35
  128. package/dist/types/i18n/zh.d.ts +1 -35
  129. package/dist/types/i18n/zh_TW.d.ts +1 -35
  130. package/dist/types/plugins/deprecated-card/doc.d.ts +20 -0
  131. package/dist/types/plugins/index.d.ts +0 -1
  132. package/dist/types/plugins/media/nodeviews/mediaSingle.d.ts +0 -1
  133. package/dist/types/plugins/media/ui/ResizableMediaSingle/index.d.ts +1 -0
  134. package/dist/types/plugins/media/ui/ResizableMediaSingle/types.d.ts +3 -2
  135. package/dist/types/plugins/paste/index.d.ts +1 -1
  136. package/dist/types-ts4.5/i18n/cs.d.ts +0 -35
  137. package/dist/types-ts4.5/i18n/da.d.ts +0 -35
  138. package/dist/types-ts4.5/i18n/de.d.ts +0 -35
  139. package/dist/types-ts4.5/i18n/en.d.ts +0 -35
  140. package/dist/types-ts4.5/i18n/en_GB.d.ts +0 -35
  141. package/dist/types-ts4.5/i18n/en_ZZ.d.ts +0 -35
  142. package/dist/types-ts4.5/i18n/es.d.ts +1 -35
  143. package/dist/types-ts4.5/i18n/fi.d.ts +0 -35
  144. package/dist/types-ts4.5/i18n/fr.d.ts +1 -35
  145. package/dist/types-ts4.5/i18n/hu.d.ts +1 -35
  146. package/dist/types-ts4.5/i18n/it.d.ts +1 -35
  147. package/dist/types-ts4.5/i18n/ja.d.ts +1 -35
  148. package/dist/types-ts4.5/i18n/ko.d.ts +0 -35
  149. package/dist/types-ts4.5/i18n/nb.d.ts +1 -35
  150. package/dist/types-ts4.5/i18n/nl.d.ts +1 -35
  151. package/dist/types-ts4.5/i18n/pl.d.ts +1 -35
  152. package/dist/types-ts4.5/i18n/pt_BR.d.ts +1 -35
  153. package/dist/types-ts4.5/i18n/ru.d.ts +1 -35
  154. package/dist/types-ts4.5/i18n/sv.d.ts +0 -35
  155. package/dist/types-ts4.5/i18n/th.d.ts +0 -35
  156. package/dist/types-ts4.5/i18n/tr.d.ts +1 -35
  157. package/dist/types-ts4.5/i18n/uk.d.ts +1 -35
  158. package/dist/types-ts4.5/i18n/vi.d.ts +0 -35
  159. package/dist/types-ts4.5/i18n/zh.d.ts +1 -35
  160. package/dist/types-ts4.5/i18n/zh_TW.d.ts +1 -35
  161. package/dist/types-ts4.5/plugins/deprecated-card/doc.d.ts +20 -0
  162. package/dist/types-ts4.5/plugins/index.d.ts +0 -1
  163. package/dist/types-ts4.5/plugins/media/nodeviews/mediaSingle.d.ts +0 -1
  164. package/dist/types-ts4.5/plugins/media/ui/ResizableMediaSingle/index.d.ts +1 -0
  165. package/dist/types-ts4.5/plugins/media/ui/ResizableMediaSingle/types.d.ts +3 -2
  166. package/dist/types-ts4.5/plugins/paste/index.d.ts +1 -1
  167. package/package.json +6 -5
  168. package/tmp/api-report-tmp.d.ts +2307 -0
  169. package/dist/cjs/plugins/card/index.js +0 -139
  170. package/dist/cjs/plugins/card/messages.js +0 -20
  171. package/dist/cjs/plugins/card/nodeviews/blockCard.js +0 -163
  172. package/dist/cjs/plugins/card/nodeviews/datasource.js +0 -172
  173. package/dist/cjs/plugins/card/nodeviews/embedCard.js +0 -396
  174. package/dist/cjs/plugins/card/nodeviews/genericCard.js +0 -118
  175. package/dist/cjs/plugins/card/nodeviews/inlineCard.js +0 -131
  176. package/dist/cjs/plugins/card/pm-plugins/actions.js +0 -122
  177. package/dist/cjs/plugins/card/pm-plugins/analytics/create-analytics-queue.js +0 -48
  178. package/dist/cjs/plugins/card/pm-plugins/analytics/events-from-tr.js +0 -353
  179. package/dist/cjs/plugins/card/pm-plugins/analytics/index.js +0 -19
  180. package/dist/cjs/plugins/card/pm-plugins/analytics/types.js +0 -5
  181. package/dist/cjs/plugins/card/pm-plugins/analytics/utils.js +0 -178
  182. package/dist/cjs/plugins/card/pm-plugins/doc.js +0 -478
  183. package/dist/cjs/plugins/card/pm-plugins/keymap.js +0 -64
  184. package/dist/cjs/plugins/card/pm-plugins/main.js +0 -212
  185. package/dist/cjs/plugins/card/pm-plugins/mountHyperlink.js +0 -47
  186. package/dist/cjs/plugins/card/pm-plugins/plugin-key.js +0 -9
  187. package/dist/cjs/plugins/card/pm-plugins/reducers.js +0 -111
  188. package/dist/cjs/plugins/card/pm-plugins/shouldReplaceLink.js +0 -35
  189. package/dist/cjs/plugins/card/pm-plugins/util/resolve.js +0 -58
  190. package/dist/cjs/plugins/card/pm-plugins/util/state.js +0 -49
  191. package/dist/cjs/plugins/card/toolbar.js +0 -364
  192. package/dist/cjs/plugins/card/types.js +0 -5
  193. package/dist/cjs/plugins/card/ui/DatasourceModal/ModalWithState.js +0 -25
  194. package/dist/cjs/plugins/card/ui/DatasourceModal/index.js +0 -60
  195. package/dist/cjs/plugins/card/ui/EditLinkToolbar.js +0 -256
  196. package/dist/cjs/plugins/card/ui/EditorSmartCardEvents.js +0 -21
  197. package/dist/cjs/plugins/card/ui/EditorSmartCardEventsNext.js +0 -213
  198. package/dist/cjs/plugins/card/ui/HyperlinkToolbarAppearance.js +0 -173
  199. package/dist/cjs/plugins/card/ui/LayoutButton/index.js +0 -113
  200. package/dist/cjs/plugins/card/ui/LayoutButton/styled.js +0 -17
  201. package/dist/cjs/plugins/card/ui/LayoutButton/types.js +0 -5
  202. package/dist/cjs/plugins/card/ui/LayoutButton/utils.js +0 -19
  203. package/dist/cjs/plugins/card/ui/LinkToolbarAppearance.js +0 -151
  204. package/dist/cjs/plugins/card/ui/ResizableEmbedCard.js +0 -360
  205. package/dist/cjs/plugins/card/ui/SmallerEditIcon.js +0 -20
  206. package/dist/cjs/plugins/card/utils.js +0 -60
  207. package/dist/es2019/plugins/card/index.js +0 -131
  208. package/dist/es2019/plugins/card/messages.js +0 -13
  209. package/dist/es2019/plugins/card/nodeviews/blockCard.js +0 -130
  210. package/dist/es2019/plugins/card/nodeviews/datasource.js +0 -136
  211. package/dist/es2019/plugins/card/nodeviews/embedCard.js +0 -368
  212. package/dist/es2019/plugins/card/nodeviews/genericCard.js +0 -92
  213. package/dist/es2019/plugins/card/nodeviews/inlineCard.js +0 -112
  214. package/dist/es2019/plugins/card/pm-plugins/actions.js +0 -57
  215. package/dist/es2019/plugins/card/pm-plugins/analytics/create-analytics-queue.js +0 -38
  216. package/dist/es2019/plugins/card/pm-plugins/analytics/events-from-tr.js +0 -333
  217. package/dist/es2019/plugins/card/pm-plugins/analytics/index.js +0 -2
  218. package/dist/es2019/plugins/card/pm-plugins/analytics/types.js +0 -1
  219. package/dist/es2019/plugins/card/pm-plugins/analytics/utils.js +0 -160
  220. package/dist/es2019/plugins/card/pm-plugins/doc.js +0 -451
  221. package/dist/es2019/plugins/card/pm-plugins/keymap.js +0 -59
  222. package/dist/es2019/plugins/card/pm-plugins/main.js +0 -208
  223. package/dist/es2019/plugins/card/pm-plugins/mountHyperlink.js +0 -37
  224. package/dist/es2019/plugins/card/pm-plugins/plugin-key.js +0 -2
  225. package/dist/es2019/plugins/card/pm-plugins/reducers.js +0 -110
  226. package/dist/es2019/plugins/card/pm-plugins/shouldReplaceLink.js +0 -25
  227. package/dist/es2019/plugins/card/pm-plugins/util/resolve.js +0 -48
  228. package/dist/es2019/plugins/card/pm-plugins/util/state.js +0 -26
  229. package/dist/es2019/plugins/card/toolbar.js +0 -362
  230. package/dist/es2019/plugins/card/types.js +0 -1
  231. package/dist/es2019/plugins/card/ui/DatasourceModal/ModalWithState.js +0 -19
  232. package/dist/es2019/plugins/card/ui/DatasourceModal/index.js +0 -48
  233. package/dist/es2019/plugins/card/ui/EditLinkToolbar.js +0 -225
  234. package/dist/es2019/plugins/card/ui/EditorSmartCardEvents.js +0 -15
  235. package/dist/es2019/plugins/card/ui/EditorSmartCardEventsNext.js +0 -198
  236. package/dist/es2019/plugins/card/ui/HyperlinkToolbarAppearance.js +0 -86
  237. package/dist/es2019/plugins/card/ui/LayoutButton/index.js +0 -106
  238. package/dist/es2019/plugins/card/ui/LayoutButton/styled.js +0 -10
  239. package/dist/es2019/plugins/card/ui/LayoutButton/types.js +0 -1
  240. package/dist/es2019/plugins/card/ui/LayoutButton/utils.js +0 -15
  241. package/dist/es2019/plugins/card/ui/LinkToolbarAppearance.js +0 -117
  242. package/dist/es2019/plugins/card/ui/ResizableEmbedCard.js +0 -332
  243. package/dist/es2019/plugins/card/ui/SmallerEditIcon.js +0 -11
  244. package/dist/es2019/plugins/card/utils.js +0 -46
  245. package/dist/esm/plugins/card/index.js +0 -132
  246. package/dist/esm/plugins/card/messages.js +0 -13
  247. package/dist/esm/plugins/card/nodeviews/blockCard.js +0 -155
  248. package/dist/esm/plugins/card/nodeviews/datasource.js +0 -164
  249. package/dist/esm/plugins/card/nodeviews/embedCard.js +0 -387
  250. package/dist/esm/plugins/card/nodeviews/genericCard.js +0 -111
  251. package/dist/esm/plugins/card/nodeviews/inlineCard.js +0 -123
  252. package/dist/esm/plugins/card/pm-plugins/actions.js +0 -102
  253. package/dist/esm/plugins/card/pm-plugins/analytics/create-analytics-queue.js +0 -41
  254. package/dist/esm/plugins/card/pm-plugins/analytics/events-from-tr.js +0 -344
  255. package/dist/esm/plugins/card/pm-plugins/analytics/index.js +0 -2
  256. package/dist/esm/plugins/card/pm-plugins/analytics/types.js +0 -1
  257. package/dist/esm/plugins/card/pm-plugins/analytics/utils.js +0 -160
  258. package/dist/esm/plugins/card/pm-plugins/doc.js +0 -460
  259. package/dist/esm/plugins/card/pm-plugins/keymap.js +0 -58
  260. package/dist/esm/plugins/card/pm-plugins/main.js +0 -199
  261. package/dist/esm/plugins/card/pm-plugins/mountHyperlink.js +0 -39
  262. package/dist/esm/plugins/card/pm-plugins/plugin-key.js +0 -2
  263. package/dist/esm/plugins/card/pm-plugins/reducers.js +0 -103
  264. package/dist/esm/plugins/card/pm-plugins/shouldReplaceLink.js +0 -29
  265. package/dist/esm/plugins/card/pm-plugins/util/resolve.js +0 -50
  266. package/dist/esm/plugins/card/pm-plugins/util/state.js +0 -40
  267. package/dist/esm/plugins/card/toolbar.js +0 -353
  268. package/dist/esm/plugins/card/types.js +0 -1
  269. package/dist/esm/plugins/card/ui/DatasourceModal/ModalWithState.js +0 -17
  270. package/dist/esm/plugins/card/ui/DatasourceModal/index.js +0 -49
  271. package/dist/esm/plugins/card/ui/EditLinkToolbar.js +0 -243
  272. package/dist/esm/plugins/card/ui/EditorSmartCardEvents.js +0 -14
  273. package/dist/esm/plugins/card/ui/EditorSmartCardEventsNext.js +0 -202
  274. package/dist/esm/plugins/card/ui/HyperlinkToolbarAppearance.js +0 -163
  275. package/dist/esm/plugins/card/ui/LayoutButton/index.js +0 -102
  276. package/dist/esm/plugins/card/ui/LayoutButton/styled.js +0 -10
  277. package/dist/esm/plugins/card/ui/LayoutButton/types.js +0 -1
  278. package/dist/esm/plugins/card/ui/LayoutButton/utils.js +0 -12
  279. package/dist/esm/plugins/card/ui/LinkToolbarAppearance.js +0 -140
  280. package/dist/esm/plugins/card/ui/ResizableEmbedCard.js +0 -355
  281. package/dist/esm/plugins/card/ui/SmallerEditIcon.js +0 -11
  282. package/dist/esm/plugins/card/utils.js +0 -48
  283. package/dist/types/plugins/card/index.d.ts +0 -26
  284. package/dist/types/plugins/card/messages.d.ts +0 -12
  285. package/dist/types/plugins/card/nodeviews/blockCard.d.ts +0 -26
  286. package/dist/types/plugins/card/nodeviews/datasource.d.ts +0 -42
  287. package/dist/types/plugins/card/nodeviews/embedCard.d.ts +0 -46
  288. package/dist/types/plugins/card/nodeviews/genericCard.d.ts +0 -37
  289. package/dist/types/plugins/card/nodeviews/inlineCard.d.ts +0 -23
  290. package/dist/types/plugins/card/pm-plugins/actions.d.ts +0 -23
  291. package/dist/types/plugins/card/pm-plugins/analytics/create-analytics-queue.d.ts +0 -10
  292. package/dist/types/plugins/card/pm-plugins/analytics/events-from-tr.d.ts +0 -17
  293. package/dist/types/plugins/card/pm-plugins/analytics/index.d.ts +0 -2
  294. package/dist/types/plugins/card/pm-plugins/analytics/types.d.ts +0 -12
  295. package/dist/types/plugins/card/pm-plugins/analytics/utils.d.ts +0 -32
  296. package/dist/types/plugins/card/pm-plugins/doc.d.ts +0 -23
  297. package/dist/types/plugins/card/pm-plugins/keymap.d.ts +0 -3
  298. package/dist/types/plugins/card/pm-plugins/main.d.ts +0 -6
  299. package/dist/types/plugins/card/pm-plugins/mountHyperlink.d.ts +0 -5
  300. package/dist/types/plugins/card/pm-plugins/plugin-key.d.ts +0 -3
  301. package/dist/types/plugins/card/pm-plugins/reducers.d.ts +0 -3
  302. package/dist/types/plugins/card/pm-plugins/shouldReplaceLink.d.ts +0 -2
  303. package/dist/types/plugins/card/pm-plugins/util/resolve.d.ts +0 -8
  304. package/dist/types/plugins/card/pm-plugins/util/state.d.ts +0 -31
  305. package/dist/types/plugins/card/toolbar.d.ts +0 -12
  306. package/dist/types/plugins/card/types.d.ts +0 -165
  307. package/dist/types/plugins/card/ui/DatasourceModal/ModalWithState.d.ts +0 -9
  308. package/dist/types/plugins/card/ui/DatasourceModal/index.d.ts +0 -11
  309. package/dist/types/plugins/card/ui/EditLinkToolbar.d.ts +0 -47
  310. package/dist/types/plugins/card/ui/EditorSmartCardEvents.d.ts +0 -5
  311. package/dist/types/plugins/card/ui/EditorSmartCardEventsNext.d.ts +0 -18
  312. package/dist/types/plugins/card/ui/HyperlinkToolbarAppearance.d.ts +0 -32
  313. package/dist/types/plugins/card/ui/LayoutButton/index.d.ts +0 -9
  314. package/dist/types/plugins/card/ui/LayoutButton/styled.d.ts +0 -1
  315. package/dist/types/plugins/card/ui/LayoutButton/types.d.ts +0 -19
  316. package/dist/types/plugins/card/ui/LayoutButton/utils.d.ts +0 -5
  317. package/dist/types/plugins/card/ui/LinkToolbarAppearance.d.ts +0 -29
  318. package/dist/types/plugins/card/ui/ResizableEmbedCard.d.ts +0 -61
  319. package/dist/types/plugins/card/ui/SmallerEditIcon.d.ts +0 -3
  320. package/dist/types/plugins/card/utils.d.ts +0 -19
  321. package/dist/types-ts4.5/plugins/card/index.d.ts +0 -26
  322. package/dist/types-ts4.5/plugins/card/messages.d.ts +0 -12
  323. package/dist/types-ts4.5/plugins/card/nodeviews/blockCard.d.ts +0 -26
  324. package/dist/types-ts4.5/plugins/card/nodeviews/datasource.d.ts +0 -42
  325. package/dist/types-ts4.5/plugins/card/nodeviews/embedCard.d.ts +0 -46
  326. package/dist/types-ts4.5/plugins/card/nodeviews/genericCard.d.ts +0 -37
  327. package/dist/types-ts4.5/plugins/card/nodeviews/inlineCard.d.ts +0 -23
  328. package/dist/types-ts4.5/plugins/card/pm-plugins/actions.d.ts +0 -23
  329. package/dist/types-ts4.5/plugins/card/pm-plugins/analytics/create-analytics-queue.d.ts +0 -10
  330. package/dist/types-ts4.5/plugins/card/pm-plugins/analytics/events-from-tr.d.ts +0 -17
  331. package/dist/types-ts4.5/plugins/card/pm-plugins/analytics/index.d.ts +0 -2
  332. package/dist/types-ts4.5/plugins/card/pm-plugins/analytics/types.d.ts +0 -12
  333. package/dist/types-ts4.5/plugins/card/pm-plugins/analytics/utils.d.ts +0 -32
  334. package/dist/types-ts4.5/plugins/card/pm-plugins/doc.d.ts +0 -23
  335. package/dist/types-ts4.5/plugins/card/pm-plugins/keymap.d.ts +0 -3
  336. package/dist/types-ts4.5/plugins/card/pm-plugins/main.d.ts +0 -6
  337. package/dist/types-ts4.5/plugins/card/pm-plugins/mountHyperlink.d.ts +0 -5
  338. package/dist/types-ts4.5/plugins/card/pm-plugins/plugin-key.d.ts +0 -3
  339. package/dist/types-ts4.5/plugins/card/pm-plugins/reducers.d.ts +0 -3
  340. package/dist/types-ts4.5/plugins/card/pm-plugins/shouldReplaceLink.d.ts +0 -2
  341. package/dist/types-ts4.5/plugins/card/pm-plugins/util/resolve.d.ts +0 -8
  342. package/dist/types-ts4.5/plugins/card/pm-plugins/util/state.d.ts +0 -31
  343. package/dist/types-ts4.5/plugins/card/toolbar.d.ts +0 -12
  344. package/dist/types-ts4.5/plugins/card/types.d.ts +0 -165
  345. package/dist/types-ts4.5/plugins/card/ui/DatasourceModal/ModalWithState.d.ts +0 -9
  346. package/dist/types-ts4.5/plugins/card/ui/DatasourceModal/index.d.ts +0 -11
  347. package/dist/types-ts4.5/plugins/card/ui/EditLinkToolbar.d.ts +0 -47
  348. package/dist/types-ts4.5/plugins/card/ui/EditorSmartCardEvents.d.ts +0 -5
  349. package/dist/types-ts4.5/plugins/card/ui/EditorSmartCardEventsNext.d.ts +0 -18
  350. package/dist/types-ts4.5/plugins/card/ui/HyperlinkToolbarAppearance.d.ts +0 -32
  351. package/dist/types-ts4.5/plugins/card/ui/LayoutButton/index.d.ts +0 -9
  352. package/dist/types-ts4.5/plugins/card/ui/LayoutButton/styled.d.ts +0 -1
  353. package/dist/types-ts4.5/plugins/card/ui/LayoutButton/types.d.ts +0 -19
  354. package/dist/types-ts4.5/plugins/card/ui/LayoutButton/utils.d.ts +0 -5
  355. package/dist/types-ts4.5/plugins/card/ui/LinkToolbarAppearance.d.ts +0 -29
  356. package/dist/types-ts4.5/plugins/card/ui/ResizableEmbedCard.d.ts +0 -61
  357. package/dist/types-ts4.5/plugins/card/ui/SmallerEditIcon.d.ts +0 -3
  358. package/dist/types-ts4.5/plugins/card/utils.d.ts +0 -19
@@ -1,332 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
- /** @jsx jsx */
4
- import React from 'react';
5
- import { jsx } from '@emotion/react';
6
- import { findParentNodeOfTypeClosestToPos, hasParentNodeOfType } from 'prosemirror-utils';
7
- import { calcColumnsFromPx, calcPctFromPx, calcPxFromColumns, wrappedLayouts } from '@atlaskit/editor-common/ui';
8
- import { akEditorMediaResizeHandlerPaddingWide, akEditorBreakoutPadding, akEditorWideLayoutWidth, breakoutWideScaleRatio, DEFAULT_EMBED_CARD_HEIGHT, DEFAULT_EMBED_CARD_WIDTH } from '@atlaskit/editor-shared-styles';
9
- import { embedHeaderHeight } from '@atlaskit/smart-card';
10
- import { wrapperStyle, Resizer, handleSides, imageAlignmentMap, snapTo, calcMediaPxWidth } from '@atlaskit/editor-common/ui';
11
- import { embedSpacingStyles } from '@atlaskit/editor-common/styles';
12
- export default class ResizableEmbedCard extends React.Component {
13
- constructor(...args) {
14
- super(...args);
15
- _defineProperty(this, "state", {
16
- offsetLeft: this.calcOffsetLeft()
17
- });
18
- _defineProperty(this, "calcNewSize", (newWidth, stop) => {
19
- const {
20
- layout,
21
- view: {
22
- state
23
- }
24
- } = this.props;
25
- const newPct = calcPctFromPx(newWidth, this.props.lineLength) * 100;
26
- this.setState({
27
- resizedPctWidth: newPct
28
- });
29
- let newLayout = hasParentNodeOfType(state.schema.nodes.table)(state.selection) ? layout : this.calcUnwrappedLayout(newPct, newWidth);
30
- if (newPct <= 100) {
31
- if (this.wrappedLayout && (stop ? newPct !== 100 : true)) {
32
- newLayout = layout;
33
- }
34
- return {
35
- width: newPct,
36
- layout: newLayout
37
- };
38
- } else {
39
- return {
40
- width: this.props.pctWidth || null,
41
- layout: newLayout
42
- };
43
- }
44
- });
45
- _defineProperty(this, "calcUnwrappedLayout", (pct, width) => {
46
- if (pct <= 100) {
47
- return 'center';
48
- }
49
- if (width <= this.wideLayoutWidth) {
50
- return 'wide';
51
- }
52
- return 'full-width';
53
- });
54
- _defineProperty(this, "calcColumnLeftOffset", () => {
55
- const {
56
- offsetLeft
57
- } = this.state;
58
- return this.insideInlineLike ? calcColumnsFromPx(offsetLeft, this.props.lineLength, this.props.gridSize) : 0;
59
- });
60
- _defineProperty(this, "calcPxWidth", useLayout => {
61
- const {
62
- layout,
63
- pctWidth,
64
- lineLength,
65
- containerWidth,
66
- fullWidthMode,
67
- getPos,
68
- view: {
69
- state
70
- }
71
- } = this.props;
72
- const {
73
- resizedPctWidth
74
- } = this.state;
75
- const pos = typeof getPos === 'function' ? getPos() : undefined;
76
- return calcMediaPxWidth({
77
- origWidth: DEFAULT_EMBED_CARD_WIDTH,
78
- origHeight: DEFAULT_EMBED_CARD_HEIGHT,
79
- pctWidth,
80
- state,
81
- containerWidth: {
82
- width: containerWidth,
83
- lineLength
84
- },
85
- isFullWidthModeEnabled: fullWidthMode,
86
- layout: useLayout || layout,
87
- pos: pos,
88
- resizedPctWidth
89
- });
90
- });
91
- _defineProperty(this, "highlights", (newWidth, snapPoints) => {
92
- const snapWidth = snapTo(newWidth, snapPoints);
93
- const {
94
- layoutColumn,
95
- table,
96
- expand,
97
- nestedExpand
98
- } = this.props.view.state.schema.nodes;
99
- if (this.$pos && !!findParentNodeOfTypeClosestToPos(this.$pos, [layoutColumn, table, expand, nestedExpand].filter(Boolean))) {
100
- return [];
101
- }
102
- if (snapWidth > this.wideLayoutWidth) {
103
- return ['full-width'];
104
- }
105
- const {
106
- layout,
107
- lineLength,
108
- gridSize
109
- } = this.props;
110
- const columns = calcColumnsFromPx(snapWidth, lineLength, gridSize);
111
- const columnWidth = Math.round(columns);
112
- const highlight = [];
113
- if (layout === 'wrap-left' || layout === 'align-start') {
114
- highlight.push(0, columnWidth);
115
- } else if (layout === 'wrap-right' || layout === 'align-end') {
116
- highlight.push(gridSize, gridSize - columnWidth);
117
- } else if (this.insideInlineLike) {
118
- highlight.push(Math.round(columns + this.calcColumnLeftOffset()));
119
- } else {
120
- highlight.push(Math.floor((gridSize - columnWidth) / 2), Math.ceil((gridSize + columnWidth) / 2));
121
- }
122
- return highlight;
123
- });
124
- }
125
- componentDidUpdate() {
126
- const offsetLeft = this.calcOffsetLeft();
127
- if (offsetLeft !== this.state.offsetLeft && offsetLeft >= 0) {
128
- this.setState({
129
- offsetLeft
130
- });
131
- }
132
- }
133
- get wrappedLayout() {
134
- return wrappedLayouts.indexOf(this.props.layout) > -1;
135
- }
136
- UNSAFE_componentWillReceiveProps(nextProps) {
137
- if (this.props.layout !== nextProps.layout) {
138
- this.checkLayout(this.props.layout, nextProps.layout);
139
- }
140
- }
141
-
142
- /**
143
- * When returning to center layout from a wrapped/aligned layout, it might actually
144
- * be wide or full-width
145
- */
146
- checkLayout(oldLayout, newLayout) {
147
- const {
148
- resizedPctWidth
149
- } = this.state;
150
- if (wrappedLayouts.indexOf(oldLayout) > -1 && newLayout === 'center' && resizedPctWidth) {
151
- const layout = this.calcUnwrappedLayout(resizedPctWidth, this.calcPxWidth(newLayout));
152
- this.props.updateSize(resizedPctWidth, layout);
153
- }
154
- }
155
- get $pos() {
156
- if (typeof this.props.getPos !== 'function') {
157
- return null;
158
- }
159
- const pos = this.props.getPos();
160
- if (Number.isNaN(pos) || typeof pos !== 'number') {
161
- return null;
162
- }
163
-
164
- // need to pass view because we may not get updated props in time
165
- return this.props.view.state.doc.resolve(pos);
166
- }
167
-
168
- /**
169
- * The maxmimum number of grid columns this node can resize to.
170
- */
171
- get gridWidth() {
172
- const {
173
- gridSize
174
- } = this.props;
175
- return !(this.wrappedLayout || this.insideInlineLike) ? gridSize / 2 : gridSize;
176
- }
177
- calcOffsetLeft() {
178
- let offsetLeft = 0;
179
- if (this.wrapper && this.insideInlineLike) {
180
- const currentNode = this.wrapper;
181
- const boundingRect = currentNode.getBoundingClientRect();
182
- const pmRect = this.props.view.dom.getBoundingClientRect();
183
- offsetLeft = boundingRect.left - pmRect.left;
184
- }
185
- return offsetLeft;
186
- }
187
- get wideLayoutWidth() {
188
- const {
189
- lineLength
190
- } = this.props;
191
- if (lineLength) {
192
- return Math.ceil(lineLength * breakoutWideScaleRatio);
193
- } else {
194
- return akEditorWideLayoutWidth;
195
- }
196
- }
197
- calcSnapPoints() {
198
- const {
199
- offsetLeft
200
- } = this.state;
201
- const {
202
- containerWidth,
203
- lineLength
204
- } = this.props;
205
- const snapTargets = [];
206
- for (let i = 0; i < this.gridWidth; i++) {
207
- snapTargets.push(calcPxFromColumns(i, lineLength, this.gridWidth) - offsetLeft);
208
- }
209
- // full width
210
- snapTargets.push(lineLength - offsetLeft);
211
- const minimumWidth = calcPxFromColumns(this.wrappedLayout || this.insideInlineLike ? 1 : 2, lineLength, this.props.gridSize);
212
- let snapPoints = snapTargets.filter(width => width >= minimumWidth);
213
- const $pos = this.$pos;
214
- if (!$pos) {
215
- return snapPoints;
216
- }
217
- const isTopLevel = $pos.parent.type.name === 'doc';
218
- if (isTopLevel) {
219
- snapPoints.push(this.wideLayoutWidth);
220
- const fullWidthPoint = containerWidth - akEditorBreakoutPadding;
221
- if (fullWidthPoint > this.wideLayoutWidth) {
222
- snapPoints.push(fullWidthPoint);
223
- }
224
- }
225
- return snapPoints;
226
- }
227
- get insideInlineLike() {
228
- const $pos = this.$pos;
229
- if (!$pos) {
230
- return false;
231
- }
232
- const {
233
- listItem
234
- } = this.props.view.state.schema.nodes;
235
- return !!findParentNodeOfTypeClosestToPos($pos, [listItem]);
236
- }
237
- /**
238
- * Previously height of the box was controlled with paddingTop/paddingBottom trick inside Wrapper.
239
- * It allowed height to be defined by a given percent ratio and so absolute value was defined by actual width.
240
- * Also, it was part of styled component, which was fine because it was static through out life time of component.
241
- *
242
- * Now, two things changed:
243
- * 1. If `height` is present we take it as actual height of the box, and hence we don't need
244
- * (or even can't have, due to lack of width value) paddingTop trick.
245
- * 2. Since `height` can be changing through out life time of a component, we can't have it as part of styled component,
246
- * and hence we use `style` prop.
247
- */
248
- getHeightDefiningComponent() {
249
- const {
250
- height,
251
- aspectRatio
252
- } = this.props;
253
- let heightDefiningStyles;
254
- if (height) {
255
- heightDefiningStyles = {
256
- height: `${height}px`
257
- };
258
- } else {
259
- // paddingBottom css trick defines ratio of `iframe height (y) + header (32)` to `width (x)`,
260
- // where is `aspectRatio` defines iframe aspectRatio alone
261
- // So, visually:
262
- //
263
- // x
264
- // ┌──────────┐
265
- // │ header │ 32
266
- // ├──────────┤
267
- // │ │
268
- // │ iframe │ y
269
- // │ │
270
- // └──────────┘
271
- //
272
- // aspectRatio = x / y
273
- // paddingBottom = (y + 32) / x
274
- // which can be achieved with css calc() as (1 / (x/y)) * 100)% + 32px
275
- heightDefiningStyles = {
276
- paddingBottom: `calc(${(1 / aspectRatio * 100).toFixed(3)}% + ${embedHeaderHeight}px)`
277
- };
278
- }
279
- return jsx("span", {
280
- "data-testid": 'resizable-embed-card-height-definer',
281
- style: {
282
- display: 'block',
283
- /* Fixes extra padding problem in Firefox */
284
- fontSize: 0,
285
- lineHeight: 0,
286
- ...heightDefiningStyles
287
- }
288
- });
289
- }
290
- render() {
291
- const {
292
- layout,
293
- pctWidth,
294
- containerWidth,
295
- fullWidthMode,
296
- children
297
- } = this.props;
298
- const initialWidth = this.calcPxWidth() - akEditorMediaResizeHandlerPaddingWide;
299
- const enable = {};
300
- handleSides.forEach(side => {
301
- const oppositeSide = side === 'left' ? 'right' : 'left';
302
- enable[side] = ['full-width', 'wide', 'center'].concat(`wrap-${oppositeSide}`).concat(`align-${imageAlignmentMap[oppositeSide]}`).indexOf(layout) > -1;
303
- if (side === 'left' && this.insideInlineLike) {
304
- enable[side] = false;
305
- }
306
- });
307
- return jsx("div", {
308
- css: embedSpacingStyles,
309
- "data-testid": "resizable-embed-card-spacing"
310
- }, jsx("div", {
311
- css: wrapperStyle({
312
- layout,
313
- isResized: !!pctWidth,
314
- containerWidth: containerWidth || DEFAULT_EMBED_CARD_WIDTH,
315
- fullWidthMode
316
- })
317
- }, jsx(Resizer, _extends({}, this.props, {
318
- width: initialWidth // Starting or initial width of embed <iframe> itself.
319
- ,
320
- enable: enable,
321
- calcNewSize: this.calcNewSize,
322
- snapPoints: this.calcSnapPoints(),
323
- scaleFactor: !this.wrappedLayout && !this.insideInlineLike ? 2 : 1,
324
- highlights: this.highlights,
325
- innerPadding: akEditorMediaResizeHandlerPaddingWide,
326
- nodeType: "embed"
327
- }), children, this.getHeightDefiningComponent())));
328
- }
329
- }
330
- _defineProperty(ResizableEmbedCard, "defaultProps", {
331
- aspectRatio: DEFAULT_EMBED_CARD_WIDTH / DEFAULT_EMBED_CARD_HEIGHT
332
- });
@@ -1,11 +0,0 @@
1
- /** @jsx jsx */
2
- import { jsx } from '@emotion/react';
3
- import EditIcon from '@atlaskit/icon/glyph/edit';
4
- import { editIconStyles } from '@atlaskit/editor-common/styles';
5
- export const SmallerEditIcon = () => {
6
- return jsx("div", {
7
- css: editIconStyles
8
- }, jsx(EditIcon, {
9
- label: "edit"
10
- }));
11
- };
@@ -1,46 +0,0 @@
1
- import { NodeSelection } from 'prosemirror-state';
2
- import { pluginKey } from './pm-plugins/plugin-key';
3
- export const appearanceForNodeType = spec => {
4
- if (spec.name === 'inlineCard') {
5
- return 'inline';
6
- } else if (spec.name === 'blockCard') {
7
- return 'block';
8
- } else if (spec.name === 'embedCard') {
9
- return 'embed';
10
- }
11
- return;
12
- };
13
- export const selectedCardAppearance = state => {
14
- if (state.selection instanceof NodeSelection) {
15
- return appearanceForNodeType(state.selection.node.type);
16
- }
17
- };
18
- export const titleUrlPairFromNode = node => {
19
- const {
20
- attrs
21
- } = node;
22
- return {
23
- url: attrs.url || attrs.data && attrs.data.url,
24
- title: attrs.data && attrs.data.title
25
- };
26
- };
27
-
28
- /**
29
- * Merges the title and url from attributes and CardInfo from the resolved view, preferring the CardInfo.
30
- * @param titleUrlPair title and url information from the node attributes
31
- * @param info information stored in state from the resolved UI component view
32
- */
33
- export const mergeCardInfo = (titleUrlPair, info) => {
34
- return {
35
- title: info && info.title || titleUrlPair.title,
36
- url: info && info.url || titleUrlPair.url
37
- };
38
- };
39
- export const displayInfoForCard = (node, info) => mergeCardInfo(titleUrlPairFromNode(node), info);
40
- export const findCardInfo = state => {
41
- const pluginState = pluginKey.getState(state);
42
- if (!pluginState) {
43
- return undefined;
44
- }
45
- return pluginState.cards.find(cardInfo => cardInfo.pos === state.selection.from);
46
- };
@@ -1,132 +0,0 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- 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; }
3
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
- import React from 'react';
5
- import { inlineCard, blockCard, embedCard } from '@atlaskit/adf-schema';
6
- import { createPlugin } from './pm-plugins/main';
7
- import { floatingToolbar } from './toolbar';
8
- import { EditorSmartCardEvents } from './ui/EditorSmartCardEvents';
9
- import { cardKeymap } from './pm-plugins/keymap';
10
- import { queueCardsFromChangedTr, changeSelectedCardToLink, setSelectedCardAppearance } from './pm-plugins/doc';
11
- import { hideLinkToolbar } from './pm-plugins/actions';
12
- import { EditorSmartCardEventsNext } from './ui/EditorSmartCardEventsNext';
13
- import LayoutButton from './ui/LayoutButton';
14
- import { pluginKey } from './pm-plugins/plugin-key';
15
- import { mountHyperlinkPlugin } from './pm-plugins/mountHyperlink';
16
- import { showDatasourceModal } from './pm-plugins/actions';
17
- import DatasourceModalWithState from './ui/DatasourceModal/ModalWithState';
18
- import { messages } from './messages';
19
- import { IconDatasourceJiraIssue } from '@atlaskit/editor-common/quick-insert';
20
- import { canRenderDatasource } from '@atlaskit/editor-common/utils';
21
- import { JIRA_LIST_OF_LINKS_DATASOURCE_ID } from '@atlaskit/link-datasource';
22
- var cardPlugin = function cardPlugin(options, api) {
23
- var _api$dependencies, _api$dependencies$fea;
24
- var 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()) || {};
25
- return {
26
- name: 'card',
27
- getSharedState: function getSharedState(editorState) {
28
- if (!editorState) {
29
- return null;
30
- }
31
- return pluginKey.getState(editorState) || null;
32
- },
33
- nodes: function nodes() {
34
- var nodes = [{
35
- name: 'inlineCard',
36
- node: inlineCard
37
- }, {
38
- name: 'blockCard',
39
- node: blockCard
40
- }];
41
- if (options.allowEmbeds) {
42
- nodes.push({
43
- name: 'embedCard',
44
- node: embedCard
45
- });
46
- }
47
- return nodes;
48
- },
49
- pmPlugins: function pmPlugins() {
50
- var _options$allowBlockCa, _options$allowResizin, _options$useAlternati, _options$allowWrappin, _options$allowAlignme;
51
- var allowBlockCards = (_options$allowBlockCa = options.allowBlockCards) !== null && _options$allowBlockCa !== void 0 ? _options$allowBlockCa : true;
52
- var allowResizing = (_options$allowResizin = options.allowResizing) !== null && _options$allowResizin !== void 0 ? _options$allowResizin : true;
53
- var useAlternativePreloader = (_options$useAlternati = options.useAlternativePreloader) !== null && _options$useAlternati !== void 0 ? _options$useAlternati : true;
54
- var allowWrapping = (_options$allowWrappin = options.allowWrapping) !== null && _options$allowWrappin !== void 0 ? _options$allowWrappin : true;
55
- var allowAlignment = (_options$allowAlignme = options.allowAlignment) !== null && _options$allowAlignme !== void 0 ? _options$allowAlignme : true;
56
- var plugins = [{
57
- name: 'card',
58
- plugin: createPlugin(_objectSpread(_objectSpread({}, options), {}, {
59
- allowBlockCards: allowBlockCards,
60
- allowResizing: allowResizing,
61
- useAlternativePreloader: useAlternativePreloader,
62
- allowWrapping: allowWrapping,
63
- allowAlignment: allowAlignment
64
- }), api)
65
- }, {
66
- name: 'cardHyperlink',
67
- plugin: function plugin() {
68
- return mountHyperlinkPlugin(api, options);
69
- }
70
- }];
71
- plugins.push({
72
- name: 'cardKeymap',
73
- plugin: function plugin(_ref) {
74
- var featureFlags = _ref.featureFlags;
75
- return cardKeymap(featureFlags);
76
- }
77
- });
78
- return plugins;
79
- },
80
- contentComponent: function contentComponent(_ref2) {
81
- var editorView = _ref2.editorView,
82
- popupsMountPoint = _ref2.popupsMountPoint,
83
- popupsScrollableElement = _ref2.popupsScrollableElement,
84
- popupsBoundariesElement = _ref2.popupsBoundariesElement;
85
- var lpAnalyticsEventsNext = featureFlags.lpAnalyticsEventsNext;
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: hideLinkToolbar,
103
- queueCardsFromChangedTr: queueCardsFromChangedTr,
104
- changeSelectedCardToLink: changeSelectedCardToLink,
105
- setSelectedCardAppearance: setSelectedCardAppearance
106
- },
107
- pluginsOptions: {
108
- floatingToolbar: floatingToolbar(options, featureFlags, options.platform, options.linkPicker, api),
109
- quickInsert: function quickInsert(_ref3) {
110
- var formatMessage = _ref3.formatMessage;
111
- if (canRenderDatasource(JIRA_LIST_OF_LINKS_DATASOURCE_ID)) {
112
- return [{
113
- id: 'datasource',
114
- title: formatMessage(messages.datasourceJiraIssue),
115
- description: formatMessage(messages.datasourceJiraIssueDescription),
116
- keywords: ['jira'],
117
- icon: function icon() {
118
- return /*#__PURE__*/React.createElement(IconDatasourceJiraIssue, null);
119
- },
120
- action: function action(insert) {
121
- var tr = insert(undefined);
122
- showDatasourceModal('jira')(tr);
123
- return tr;
124
- }
125
- }];
126
- }
127
- return [];
128
- }
129
- }
130
- };
131
- };
132
- export default cardPlugin;
@@ -1,13 +0,0 @@
1
- import { defineMessages } from 'react-intl-next';
2
- export var 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
- });
@@ -1,155 +0,0 @@
1
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/createClass";
3
- import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
4
- import _inherits from "@babel/runtime/helpers/inherits";
5
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
6
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
9
- 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; } }
10
- import React from 'react';
11
- import { Card as SmartCard } from '@atlaskit/smart-card';
12
- import { UnsupportedBlock } from '@atlaskit/editor-common/ui';
13
- import { browser } from '@atlaskit/editor-common/utils';
14
- import PropTypes from 'prop-types';
15
- import rafSchedule from 'raf-schd';
16
- import { Card } from './genericCard';
17
- import ReactNodeView from '@atlaskit/editor-common/react-node-view';
18
- import { registerCard } from '../pm-plugins/actions';
19
- import { findOverflowScrollParent } from '@atlaskit/editor-common/ui';
20
- export var BlockCardComponent = /*#__PURE__*/function (_React$PureComponent) {
21
- _inherits(BlockCardComponent, _React$PureComponent);
22
- var _super = _createSuper(BlockCardComponent);
23
- function BlockCardComponent() {
24
- var _this;
25
- _classCallCheck(this, BlockCardComponent);
26
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
27
- args[_key] = arguments[_key];
28
- }
29
- _this = _super.call.apply(_super, [this].concat(args));
30
- _defineProperty(_assertThisInitialized(_this), "onClick", function () {});
31
- _defineProperty(_assertThisInitialized(_this), "onResolve", function (data) {
32
- var _this$props = _this.props,
33
- getPos = _this$props.getPos,
34
- view = _this$props.view;
35
- if (!getPos || typeof getPos === 'boolean') {
36
- return;
37
- }
38
- var title = data.title,
39
- url = data.url;
40
-
41
- // don't dispatch immediately since we might be in the middle of
42
- // rendering a nodeview
43
- rafSchedule(function () {
44
- var pos = getPos();
45
- if (typeof pos !== 'number') {
46
- return;
47
- }
48
- view.dispatch(registerCard({
49
- title: title,
50
- url: url,
51
- pos: pos
52
- })(view.state.tr));
53
- })();
54
- });
55
- _defineProperty(_assertThisInitialized(_this), "gapCursorSpan", function () {
56
- // Don't render in EdgeHTMl version <= 18 (Edge version 44)
57
- // as it forces the edit popup to render 24px lower than it should
58
- if (browser.ie && browser.ie_version < 79) {
59
- return;
60
- }
61
-
62
- // render an empty span afterwards to get around Webkit bug
63
- // that puts caret in next editable text element
64
- return /*#__PURE__*/React.createElement("span", {
65
- contentEditable: true
66
- });
67
- });
68
- _defineProperty(_assertThisInitialized(_this), "onError", function (_ref) {
69
- var err = _ref.err;
70
- if (err) {
71
- throw err;
72
- }
73
- });
74
- return _this;
75
- }
76
- _createClass(BlockCardComponent, [{
77
- key: "UNSAFE_componentWillMount",
78
- value: function UNSAFE_componentWillMount() {
79
- var view = this.props.view;
80
- var scrollContainer = findOverflowScrollParent(view.dom);
81
- this.scrollContainer = scrollContainer || undefined;
82
- }
83
- }, {
84
- key: "render",
85
- value: function render() {
86
- var _this$props2 = this.props,
87
- node = _this$props2.node,
88
- cardContext = _this$props2.cardContext,
89
- platform = _this$props2.platform,
90
- showServerActions = _this$props2.showServerActions;
91
- var _node$attrs = node.attrs,
92
- url = _node$attrs.url,
93
- data = _node$attrs.data;
94
- var cardInner = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SmartCard, {
95
- key: url,
96
- url: url,
97
- data: data,
98
- container: this.scrollContainer,
99
- appearance: "block",
100
- onClick: this.onClick,
101
- onResolve: this.onResolve,
102
- onError: this.onError,
103
- showActions: platform === 'web',
104
- platform: platform,
105
- showServerActions: showServerActions
106
- }), this.gapCursorSpan());
107
- // [WS-2307]: we only render card wrapped into a Provider when the value is ready,
108
- // otherwise if we got data, we can render the card directly since it doesn't need the Provider
109
- return /*#__PURE__*/React.createElement("div", null, cardContext && cardContext.value ? /*#__PURE__*/React.createElement(cardContext.Provider, {
110
- value: cardContext.value
111
- }, cardInner) : data ? cardInner : null);
112
- }
113
- }]);
114
- return BlockCardComponent;
115
- }(React.PureComponent);
116
- _defineProperty(BlockCardComponent, "contextTypes", {
117
- contextAdapter: PropTypes.object
118
- });
119
- var WrappedBlockCard = Card(BlockCardComponent, UnsupportedBlock);
120
- export var BlockCard = /*#__PURE__*/function (_ReactNodeView) {
121
- _inherits(BlockCard, _ReactNodeView);
122
- var _super2 = _createSuper(BlockCard);
123
- function BlockCard() {
124
- _classCallCheck(this, BlockCard);
125
- return _super2.apply(this, arguments);
126
- }
127
- _createClass(BlockCard, [{
128
- key: "createDomRef",
129
- value: function createDomRef() {
130
- var domRef = document.createElement('div');
131
- if (this.reactComponentProps.platform !== 'mobile') {
132
- // workaround Chrome bug in https://product-fabric.atlassian.net/browse/ED-5379
133
- // see also: https://github.com/ProseMirror/prosemirror/issues/884
134
- domRef.contentEditable = 'true';
135
- domRef.setAttribute('spellcheck', 'false');
136
- }
137
- return domRef;
138
- }
139
- }, {
140
- key: "render",
141
- value: function render() {
142
- var _this$reactComponentP = this.reactComponentProps,
143
- platform = _this$reactComponentP.platform,
144
- showServerActions = _this$reactComponentP.showServerActions;
145
- return /*#__PURE__*/React.createElement(WrappedBlockCard, {
146
- node: this.node,
147
- view: this.view,
148
- getPos: this.getPos,
149
- platform: platform,
150
- showServerActions: showServerActions
151
- });
152
- }
153
- }]);
154
- return BlockCard;
155
- }(ReactNodeView);