@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,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
- });