@atlaskit/editor-plugin-media 0.2.0 → 0.3.0

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 (408) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/cjs/commands/captions.js +59 -0
  3. package/dist/cjs/commands/helpers.js +127 -0
  4. package/dist/cjs/commands/index.js +24 -0
  5. package/dist/cjs/commands/linking.js +181 -0
  6. package/dist/cjs/index.js +8 -1
  7. package/dist/cjs/media-plugin-options.js +5 -0
  8. package/dist/cjs/next-plugin-type.js +5 -0
  9. package/dist/cjs/nodeviews/mediaGroup.js +376 -0
  10. package/dist/cjs/nodeviews/mediaInline.js +288 -0
  11. package/dist/cjs/nodeviews/mediaNodeUpdater.js +739 -0
  12. package/dist/cjs/nodeviews/mediaNodeView/index.js +177 -0
  13. package/dist/cjs/nodeviews/mediaNodeView/media.js +242 -0
  14. package/dist/cjs/nodeviews/mediaSingle.js +629 -0
  15. package/dist/cjs/nodeviews/messages.js +14 -0
  16. package/dist/cjs/nodeviews/styles.js +46 -0
  17. package/dist/cjs/nodeviews/types.js +5 -0
  18. package/dist/cjs/picker-facade.js +192 -0
  19. package/dist/cjs/plugin.js +293 -0
  20. package/dist/cjs/pm-plugins/alt-text/actions.js +5 -0
  21. package/dist/cjs/pm-plugins/alt-text/commands.js +59 -0
  22. package/dist/cjs/pm-plugins/alt-text/index.js +36 -0
  23. package/dist/cjs/pm-plugins/alt-text/keymap.js +15 -0
  24. package/dist/cjs/pm-plugins/alt-text/messages.js +44 -0
  25. package/dist/cjs/pm-plugins/alt-text/reducer.js +32 -0
  26. package/dist/cjs/pm-plugins/alt-text/types.js +5 -0
  27. package/dist/cjs/pm-plugins/alt-text/ui/AltTextEdit.js +209 -0
  28. package/dist/cjs/pm-plugins/keymap-media-single.js +163 -0
  29. package/dist/cjs/pm-plugins/keymap.js +88 -0
  30. package/dist/cjs/pm-plugins/linking/actions.js +13 -0
  31. package/dist/cjs/pm-plugins/linking/index.js +65 -0
  32. package/dist/cjs/pm-plugins/linking/keymap.js +14 -0
  33. package/dist/cjs/pm-plugins/linking/reducer.js +43 -0
  34. package/dist/cjs/pm-plugins/linking/types.js +5 -0
  35. package/dist/cjs/pm-plugins/main.js +813 -0
  36. package/dist/cjs/pm-plugins/media-editor-plugin-factory.js +8 -0
  37. package/dist/cjs/pm-plugins/mediaTaskManager.js +101 -0
  38. package/dist/cjs/pm-plugins/plugin-key.js +8 -0
  39. package/dist/cjs/pm-plugins/types.js +5 -0
  40. package/dist/cjs/toolbar/alt-text.js +80 -0
  41. package/dist/cjs/toolbar/commands.js +236 -0
  42. package/dist/cjs/toolbar/filePreviewItem.js +66 -0
  43. package/dist/cjs/toolbar/imageBorder.js +20 -0
  44. package/dist/cjs/toolbar/index.js +523 -0
  45. package/dist/cjs/toolbar/linking-toolbar-appearance.js +100 -0
  46. package/dist/cjs/toolbar/linking.js +96 -0
  47. package/dist/cjs/toolbar/utils.js +110 -0
  48. package/dist/cjs/ui/CaptionPlaceholder/index.js +27 -0
  49. package/dist/cjs/ui/CaptionPlaceholder/messages.js +14 -0
  50. package/dist/cjs/ui/ImageBorder/index.js +226 -0
  51. package/dist/cjs/ui/ImageBorder/messages.js +49 -0
  52. package/dist/cjs/ui/ImageBorder/styles.js +52 -0
  53. package/dist/cjs/ui/Media/DropPlaceholder.js +38 -0
  54. package/dist/cjs/ui/Media/drop-placeholder-messages.js +14 -0
  55. package/dist/cjs/ui/MediaLinkingToolbar.js +196 -0
  56. package/dist/cjs/ui/MediaPicker/BrowserWrapper.js +40 -0
  57. package/dist/cjs/ui/MediaPicker/ClipboardWrapper.js +39 -0
  58. package/dist/cjs/ui/MediaPicker/DropzoneWrapper.js +51 -0
  59. package/dist/cjs/ui/MediaPicker/PickerFacadeProvider.js +151 -0
  60. package/dist/cjs/ui/MediaPicker/index.js +103 -0
  61. package/dist/cjs/ui/PixelEntry/constants.js +7 -0
  62. package/dist/cjs/ui/PixelEntry/index.js +185 -0
  63. package/dist/cjs/ui/PixelEntry/messages.js +54 -0
  64. package/dist/cjs/ui/PixelEntry/styles.js +19 -0
  65. package/dist/cjs/ui/PixelEntry/types.js +5 -0
  66. package/dist/cjs/ui/ResizableMediaSingle/ResizableMediaMigrationNotification.js +16 -0
  67. package/dist/cjs/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +541 -0
  68. package/dist/cjs/ui/ResizableMediaSingle/index.js +422 -0
  69. package/dist/cjs/ui/ResizableMediaSingle/styled.js +14 -0
  70. package/dist/cjs/ui/ResizableMediaSingle/styles.js +17 -0
  71. package/dist/cjs/ui/ResizableMediaSingle/types.js +5 -0
  72. package/dist/cjs/ui/ToolbarMedia/index.js +42 -0
  73. package/dist/cjs/ui/ToolbarMedia/toolbar-media-messages.js +14 -0
  74. package/dist/cjs/ui/media-linking-toolbar-messages.js +14 -0
  75. package/dist/cjs/utils/analytics.js +53 -0
  76. package/dist/cjs/utils/check-media-type.js +56 -0
  77. package/dist/cjs/utils/current-media-node.js +41 -0
  78. package/dist/cjs/utils/is-image.js +9 -0
  79. package/dist/cjs/utils/media-common.js +181 -0
  80. package/dist/cjs/utils/media-files.js +297 -0
  81. package/dist/cjs/utils/media-single.js +181 -0
  82. package/dist/es2019/commands/captions.js +47 -0
  83. package/dist/es2019/commands/helpers.js +113 -0
  84. package/dist/es2019/commands/index.js +1 -0
  85. package/dist/es2019/commands/linking.js +169 -0
  86. package/dist/es2019/index.js +1 -1
  87. package/dist/es2019/media-plugin-options.js +1 -0
  88. package/dist/es2019/next-plugin-type.js +1 -0
  89. package/dist/es2019/nodeviews/mediaGroup.js +314 -0
  90. package/dist/es2019/nodeviews/mediaInline.js +201 -0
  91. package/dist/es2019/nodeviews/mediaNodeUpdater.js +384 -0
  92. package/dist/es2019/nodeviews/mediaNodeView/index.js +149 -0
  93. package/dist/es2019/nodeviews/mediaNodeView/media.js +182 -0
  94. package/dist/es2019/nodeviews/mediaSingle.js +511 -0
  95. package/dist/es2019/nodeviews/messages.js +8 -0
  96. package/dist/es2019/nodeviews/styles.js +46 -0
  97. package/dist/es2019/nodeviews/types.js +1 -0
  98. package/dist/es2019/picker-facade.js +146 -0
  99. package/dist/es2019/plugin.js +284 -0
  100. package/dist/es2019/pm-plugins/alt-text/actions.js +1 -0
  101. package/dist/es2019/pm-plugins/alt-text/commands.js +42 -0
  102. package/dist/es2019/pm-plugins/alt-text/index.js +33 -0
  103. package/dist/es2019/pm-plugins/alt-text/keymap.js +9 -0
  104. package/dist/es2019/pm-plugins/alt-text/messages.js +38 -0
  105. package/dist/es2019/pm-plugins/alt-text/reducer.js +26 -0
  106. package/dist/es2019/pm-plugins/alt-text/types.js +1 -0
  107. package/dist/es2019/pm-plugins/alt-text/ui/AltTextEdit.js +228 -0
  108. package/dist/es2019/pm-plugins/keymap-media-single.js +172 -0
  109. package/dist/es2019/pm-plugins/keymap.js +84 -0
  110. package/dist/es2019/pm-plugins/linking/actions.js +7 -0
  111. package/dist/es2019/pm-plugins/linking/index.js +56 -0
  112. package/dist/es2019/pm-plugins/linking/keymap.js +8 -0
  113. package/dist/es2019/pm-plugins/linking/reducer.js +37 -0
  114. package/dist/es2019/pm-plugins/linking/types.js +1 -0
  115. package/dist/es2019/pm-plugins/main.js +695 -0
  116. package/dist/es2019/pm-plugins/media-editor-plugin-factory.js +2 -0
  117. package/dist/es2019/pm-plugins/mediaTaskManager.js +64 -0
  118. package/dist/es2019/pm-plugins/plugin-key.js +2 -0
  119. package/dist/es2019/pm-plugins/types.js +1 -0
  120. package/dist/es2019/toolbar/alt-text.js +72 -0
  121. package/dist/es2019/toolbar/commands.js +212 -0
  122. package/dist/es2019/toolbar/filePreviewItem.js +54 -0
  123. package/dist/es2019/toolbar/imageBorder.js +15 -0
  124. package/dist/es2019/toolbar/index.js +538 -0
  125. package/dist/es2019/toolbar/linking-toolbar-appearance.js +90 -0
  126. package/dist/es2019/toolbar/linking.js +98 -0
  127. package/dist/es2019/toolbar/utils.js +86 -0
  128. package/dist/es2019/ui/CaptionPlaceholder/index.js +25 -0
  129. package/dist/es2019/ui/CaptionPlaceholder/messages.js +8 -0
  130. package/dist/es2019/ui/ImageBorder/index.js +213 -0
  131. package/dist/es2019/ui/ImageBorder/messages.js +43 -0
  132. package/dist/es2019/ui/ImageBorder/styles.js +126 -0
  133. package/dist/es2019/ui/Media/DropPlaceholder.js +47 -0
  134. package/dist/es2019/ui/Media/drop-placeholder-messages.js +8 -0
  135. package/dist/es2019/ui/MediaLinkingToolbar.js +190 -0
  136. package/dist/es2019/ui/MediaPicker/BrowserWrapper.js +31 -0
  137. package/dist/es2019/ui/MediaPicker/ClipboardWrapper.js +32 -0
  138. package/dist/es2019/ui/MediaPicker/DropzoneWrapper.js +42 -0
  139. package/dist/es2019/ui/MediaPicker/PickerFacadeProvider.js +85 -0
  140. package/dist/es2019/ui/MediaPicker/index.js +82 -0
  141. package/dist/es2019/ui/PixelEntry/constants.js +1 -0
  142. package/dist/es2019/ui/PixelEntry/index.js +170 -0
  143. package/dist/es2019/ui/PixelEntry/messages.js +48 -0
  144. package/dist/es2019/ui/PixelEntry/styles.js +51 -0
  145. package/dist/es2019/ui/PixelEntry/types.js +1 -0
  146. package/dist/es2019/ui/ResizableMediaSingle/ResizableMediaMigrationNotification.js +9 -0
  147. package/dist/es2019/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +454 -0
  148. package/dist/es2019/ui/ResizableMediaSingle/index.js +344 -0
  149. package/dist/es2019/ui/ResizableMediaSingle/styled.js +9 -0
  150. package/dist/es2019/ui/ResizableMediaSingle/styles.js +14 -0
  151. package/dist/es2019/ui/ResizableMediaSingle/types.js +1 -0
  152. package/dist/es2019/ui/ToolbarMedia/index.js +37 -0
  153. package/dist/es2019/ui/ToolbarMedia/toolbar-media-messages.js +8 -0
  154. package/dist/es2019/ui/media-linking-toolbar-messages.js +8 -0
  155. package/dist/es2019/utils/analytics.js +51 -0
  156. package/dist/es2019/utils/check-media-type.js +19 -0
  157. package/dist/es2019/utils/current-media-node.js +35 -0
  158. package/dist/es2019/utils/is-image.js +3 -0
  159. package/dist/es2019/utils/media-common.js +189 -0
  160. package/dist/es2019/utils/media-files.js +321 -0
  161. package/dist/es2019/utils/media-single.js +176 -0
  162. package/dist/esm/commands/captions.js +53 -0
  163. package/dist/esm/commands/helpers.js +120 -0
  164. package/dist/esm/commands/index.js +1 -0
  165. package/dist/esm/commands/linking.js +174 -0
  166. package/dist/esm/index.js +1 -1
  167. package/dist/esm/media-plugin-options.js +1 -0
  168. package/dist/esm/next-plugin-type.js +1 -0
  169. package/dist/esm/nodeviews/mediaGroup.js +369 -0
  170. package/dist/esm/nodeviews/mediaInline.js +278 -0
  171. package/dist/esm/nodeviews/mediaNodeUpdater.js +732 -0
  172. package/dist/esm/nodeviews/mediaNodeView/index.js +170 -0
  173. package/dist/esm/nodeviews/mediaNodeView/media.js +233 -0
  174. package/dist/esm/nodeviews/mediaSingle.js +622 -0
  175. package/dist/esm/nodeviews/messages.js +8 -0
  176. package/dist/esm/nodeviews/styles.js +39 -0
  177. package/dist/esm/nodeviews/types.js +1 -0
  178. package/dist/esm/picker-facade.js +186 -0
  179. package/dist/esm/plugin.js +282 -0
  180. package/dist/esm/pm-plugins/alt-text/actions.js +1 -0
  181. package/dist/esm/pm-plugins/alt-text/commands.js +52 -0
  182. package/dist/esm/pm-plugins/alt-text/index.js +31 -0
  183. package/dist/esm/pm-plugins/alt-text/keymap.js +9 -0
  184. package/dist/esm/pm-plugins/alt-text/messages.js +38 -0
  185. package/dist/esm/pm-plugins/alt-text/reducer.js +25 -0
  186. package/dist/esm/pm-plugins/alt-text/types.js +1 -0
  187. package/dist/esm/pm-plugins/alt-text/ui/AltTextEdit.js +206 -0
  188. package/dist/esm/pm-plugins/keymap-media-single.js +158 -0
  189. package/dist/esm/pm-plugins/keymap.js +81 -0
  190. package/dist/esm/pm-plugins/linking/actions.js +7 -0
  191. package/dist/esm/pm-plugins/linking/index.js +59 -0
  192. package/dist/esm/pm-plugins/linking/keymap.js +8 -0
  193. package/dist/esm/pm-plugins/linking/reducer.js +36 -0
  194. package/dist/esm/pm-plugins/linking/types.js +1 -0
  195. package/dist/esm/pm-plugins/main.js +798 -0
  196. package/dist/esm/pm-plugins/media-editor-plugin-factory.js +2 -0
  197. package/dist/esm/pm-plugins/mediaTaskManager.js +94 -0
  198. package/dist/esm/pm-plugins/plugin-key.js +2 -0
  199. package/dist/esm/pm-plugins/types.js +1 -0
  200. package/dist/esm/toolbar/alt-text.js +70 -0
  201. package/dist/esm/toolbar/commands.js +229 -0
  202. package/dist/esm/toolbar/filePreviewItem.js +56 -0
  203. package/dist/esm/toolbar/imageBorder.js +14 -0
  204. package/dist/esm/toolbar/index.js +513 -0
  205. package/dist/esm/toolbar/linking-toolbar-appearance.js +91 -0
  206. package/dist/esm/toolbar/linking.js +88 -0
  207. package/dist/esm/toolbar/utils.js +103 -0
  208. package/dist/esm/ui/CaptionPlaceholder/index.js +20 -0
  209. package/dist/esm/ui/CaptionPlaceholder/messages.js +8 -0
  210. package/dist/esm/ui/ImageBorder/index.js +218 -0
  211. package/dist/esm/ui/ImageBorder/messages.js +43 -0
  212. package/dist/esm/ui/ImageBorder/styles.js +42 -0
  213. package/dist/esm/ui/Media/DropPlaceholder.js +31 -0
  214. package/dist/esm/ui/Media/drop-placeholder-messages.js +8 -0
  215. package/dist/esm/ui/MediaLinkingToolbar.js +188 -0
  216. package/dist/esm/ui/MediaPicker/BrowserWrapper.js +33 -0
  217. package/dist/esm/ui/MediaPicker/ClipboardWrapper.js +32 -0
  218. package/dist/esm/ui/MediaPicker/DropzoneWrapper.js +44 -0
  219. package/dist/esm/ui/MediaPicker/PickerFacadeProvider.js +145 -0
  220. package/dist/esm/ui/MediaPicker/index.js +96 -0
  221. package/dist/esm/ui/PixelEntry/constants.js +1 -0
  222. package/dist/esm/ui/PixelEntry/index.js +174 -0
  223. package/dist/esm/ui/PixelEntry/messages.js +48 -0
  224. package/dist/esm/ui/PixelEntry/styles.js +12 -0
  225. package/dist/esm/ui/PixelEntry/types.js +1 -0
  226. package/dist/esm/ui/ResizableMediaSingle/ResizableMediaMigrationNotification.js +9 -0
  227. package/dist/esm/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +535 -0
  228. package/dist/esm/ui/ResizableMediaSingle/index.js +417 -0
  229. package/dist/esm/ui/ResizableMediaSingle/styled.js +7 -0
  230. package/dist/esm/ui/ResizableMediaSingle/styles.js +7 -0
  231. package/dist/esm/ui/ResizableMediaSingle/types.js +1 -0
  232. package/dist/esm/ui/ToolbarMedia/index.js +35 -0
  233. package/dist/esm/ui/ToolbarMedia/toolbar-media-messages.js +8 -0
  234. package/dist/esm/ui/media-linking-toolbar-messages.js +8 -0
  235. package/dist/esm/utils/analytics.js +47 -0
  236. package/dist/esm/utils/check-media-type.js +49 -0
  237. package/dist/esm/utils/current-media-node.js +35 -0
  238. package/dist/esm/utils/is-image.js +3 -0
  239. package/dist/esm/utils/media-common.js +175 -0
  240. package/dist/esm/utils/media-files.js +291 -0
  241. package/dist/esm/utils/media-single.js +172 -0
  242. package/dist/types/commands/captions.d.ts +5 -0
  243. package/dist/types/commands/helpers.d.ts +15 -0
  244. package/dist/types/commands/index.d.ts +1 -0
  245. package/dist/types/commands/linking.d.ts +9 -0
  246. package/dist/types/index.d.ts +2 -1
  247. package/dist/types/media-plugin-options.d.ts +17 -0
  248. package/dist/types/next-plugin-type.d.ts +31 -0
  249. package/dist/types/nodeviews/__mocks__/mediaNodeUpdater.d.ts +24 -0
  250. package/dist/types/nodeviews/mediaGroup.d.ts +33 -0
  251. package/dist/types/nodeviews/mediaInline.d.ts +50 -0
  252. package/dist/types/nodeviews/mediaNodeUpdater.d.ts +45 -0
  253. package/dist/types/nodeviews/mediaNodeView/index.d.ts +28 -0
  254. package/dist/types/nodeviews/mediaNodeView/media.d.ts +44 -0
  255. package/dist/types/nodeviews/mediaSingle.d.ts +62 -0
  256. package/dist/types/nodeviews/messages.d.ts +7 -0
  257. package/dist/types/nodeviews/styles.d.ts +16 -0
  258. package/dist/types/nodeviews/types.d.ts +42 -0
  259. package/dist/types/picker-facade.d.ts +44 -0
  260. package/dist/types/plugin.d.ts +7 -0
  261. package/dist/types/pm-plugins/alt-text/actions.d.ts +10 -0
  262. package/dist/types/pm-plugins/alt-text/commands.d.ts +4 -0
  263. package/dist/types/pm-plugins/alt-text/index.d.ts +7 -0
  264. package/dist/types/pm-plugins/alt-text/keymap.d.ts +4 -0
  265. package/dist/types/pm-plugins/alt-text/messages.d.ts +37 -0
  266. package/dist/types/pm-plugins/alt-text/reducer.d.ts +4 -0
  267. package/dist/types/pm-plugins/alt-text/types.d.ts +3 -0
  268. package/dist/types/pm-plugins/alt-text/ui/AltTextEdit.d.ts +41 -0
  269. package/dist/types/pm-plugins/keymap-media-single.d.ts +3 -0
  270. package/dist/types/pm-plugins/keymap.d.ts +5 -0
  271. package/dist/types/pm-plugins/linking/actions.d.ts +20 -0
  272. package/dist/types/pm-plugins/linking/index.d.ts +10 -0
  273. package/dist/types/pm-plugins/linking/keymap.d.ts +3 -0
  274. package/dist/types/pm-plugins/linking/reducer.d.ts +4 -0
  275. package/dist/types/pm-plugins/linking/types.d.ts +12 -0
  276. package/dist/types/pm-plugins/main.d.ts +120 -0
  277. package/dist/types/pm-plugins/media-editor-plugin-factory.d.ts +3 -0
  278. package/dist/types/pm-plugins/mediaTaskManager.d.ts +9 -0
  279. package/dist/types/pm-plugins/plugin-key.d.ts +3 -0
  280. package/dist/types/pm-plugins/types.d.ts +65 -0
  281. package/dist/types/toolbar/alt-text.d.ts +13 -0
  282. package/dist/types/toolbar/commands.d.ts +12 -0
  283. package/dist/types/toolbar/filePreviewItem.d.ts +9 -0
  284. package/dist/types/toolbar/imageBorder.d.ts +2 -0
  285. package/dist/types/toolbar/index.d.ts +6 -0
  286. package/dist/types/toolbar/linking-toolbar-appearance.d.ts +14 -0
  287. package/dist/types/toolbar/linking.d.ts +10 -0
  288. package/dist/types/toolbar/utils.d.ts +11 -0
  289. package/dist/types/types.d.ts +2 -1
  290. package/dist/types/ui/CaptionPlaceholder/index.d.ts +6 -0
  291. package/dist/types/ui/CaptionPlaceholder/messages.d.ts +7 -0
  292. package/dist/types/ui/ImageBorder/index.d.ts +11 -0
  293. package/dist/types/ui/ImageBorder/messages.d.ts +42 -0
  294. package/dist/types/ui/ImageBorder/styles.d.ts +15 -0
  295. package/dist/types/ui/Media/DropPlaceholder.d.ts +8 -0
  296. package/dist/types/ui/Media/drop-placeholder-messages.d.ts +7 -0
  297. package/dist/types/ui/MediaLinkingToolbar.d.ts +35 -0
  298. package/dist/types/ui/MediaPicker/BrowserWrapper.d.ts +11 -0
  299. package/dist/types/ui/MediaPicker/ClipboardWrapper.d.ts +10 -0
  300. package/dist/types/ui/MediaPicker/DropzoneWrapper.d.ts +13 -0
  301. package/dist/types/ui/MediaPicker/PickerFacadeProvider.d.ts +28 -0
  302. package/dist/types/ui/MediaPicker/index.d.ts +23 -0
  303. package/dist/types/ui/PixelEntry/constants.d.ts +1 -0
  304. package/dist/types/ui/PixelEntry/index.d.ts +8 -0
  305. package/dist/types/ui/PixelEntry/messages.d.ts +47 -0
  306. package/dist/types/ui/PixelEntry/styles.d.ts +8 -0
  307. package/dist/types/ui/PixelEntry/types.d.ts +58 -0
  308. package/dist/types/ui/ResizableMediaSingle/ResizableMediaMigrationNotification.d.ts +3 -0
  309. package/dist/types/ui/ResizableMediaSingle/ResizableMediaSingleNext.d.ts +59 -0
  310. package/dist/types/ui/ResizableMediaSingle/index.d.ts +45 -0
  311. package/dist/types/ui/ResizableMediaSingle/styled.d.ts +2 -0
  312. package/dist/types/ui/ResizableMediaSingle/styles.d.ts +1 -0
  313. package/dist/types/ui/ResizableMediaSingle/types.d.ts +27 -0
  314. package/dist/types/ui/ToolbarMedia/index.d.ts +13 -0
  315. package/dist/types/ui/ToolbarMedia/toolbar-media-messages.d.ts +7 -0
  316. package/dist/types/ui/media-linking-toolbar-messages.d.ts +7 -0
  317. package/dist/types/utils/analytics.d.ts +3 -0
  318. package/dist/types/utils/check-media-type.d.ts +4 -0
  319. package/dist/types/utils/current-media-node.d.ts +9 -0
  320. package/dist/types/utils/is-image.d.ts +1 -0
  321. package/dist/types/utils/media-common.d.ts +20 -0
  322. package/dist/types/utils/media-files.d.ts +30 -0
  323. package/dist/types/utils/media-single.d.ts +20 -0
  324. package/dist/types-ts4.5/commands/captions.d.ts +5 -0
  325. package/dist/types-ts4.5/commands/helpers.d.ts +15 -0
  326. package/dist/types-ts4.5/commands/index.d.ts +1 -0
  327. package/dist/types-ts4.5/commands/linking.d.ts +9 -0
  328. package/dist/types-ts4.5/index.d.ts +2 -1
  329. package/dist/types-ts4.5/media-plugin-options.d.ts +17 -0
  330. package/dist/types-ts4.5/next-plugin-type.d.ts +31 -0
  331. package/dist/types-ts4.5/nodeviews/__mocks__/mediaNodeUpdater.d.ts +24 -0
  332. package/dist/types-ts4.5/nodeviews/mediaGroup.d.ts +33 -0
  333. package/dist/types-ts4.5/nodeviews/mediaInline.d.ts +50 -0
  334. package/dist/types-ts4.5/nodeviews/mediaNodeUpdater.d.ts +45 -0
  335. package/dist/types-ts4.5/nodeviews/mediaNodeView/index.d.ts +28 -0
  336. package/dist/types-ts4.5/nodeviews/mediaNodeView/media.d.ts +44 -0
  337. package/dist/types-ts4.5/nodeviews/mediaSingle.d.ts +62 -0
  338. package/dist/types-ts4.5/nodeviews/messages.d.ts +7 -0
  339. package/dist/types-ts4.5/nodeviews/styles.d.ts +16 -0
  340. package/dist/types-ts4.5/nodeviews/types.d.ts +42 -0
  341. package/dist/types-ts4.5/picker-facade.d.ts +44 -0
  342. package/dist/types-ts4.5/plugin.d.ts +7 -0
  343. package/dist/types-ts4.5/pm-plugins/alt-text/actions.d.ts +10 -0
  344. package/dist/types-ts4.5/pm-plugins/alt-text/commands.d.ts +4 -0
  345. package/dist/types-ts4.5/pm-plugins/alt-text/index.d.ts +7 -0
  346. package/dist/types-ts4.5/pm-plugins/alt-text/keymap.d.ts +4 -0
  347. package/dist/types-ts4.5/pm-plugins/alt-text/messages.d.ts +37 -0
  348. package/dist/types-ts4.5/pm-plugins/alt-text/reducer.d.ts +4 -0
  349. package/dist/types-ts4.5/pm-plugins/alt-text/types.d.ts +3 -0
  350. package/dist/types-ts4.5/pm-plugins/alt-text/ui/AltTextEdit.d.ts +41 -0
  351. package/dist/types-ts4.5/pm-plugins/keymap-media-single.d.ts +3 -0
  352. package/dist/types-ts4.5/pm-plugins/keymap.d.ts +5 -0
  353. package/dist/types-ts4.5/pm-plugins/linking/actions.d.ts +20 -0
  354. package/dist/types-ts4.5/pm-plugins/linking/index.d.ts +10 -0
  355. package/dist/types-ts4.5/pm-plugins/linking/keymap.d.ts +3 -0
  356. package/dist/types-ts4.5/pm-plugins/linking/reducer.d.ts +4 -0
  357. package/dist/types-ts4.5/pm-plugins/linking/types.d.ts +12 -0
  358. package/dist/types-ts4.5/pm-plugins/main.d.ts +120 -0
  359. package/dist/types-ts4.5/pm-plugins/media-editor-plugin-factory.d.ts +3 -0
  360. package/dist/types-ts4.5/pm-plugins/mediaTaskManager.d.ts +9 -0
  361. package/dist/types-ts4.5/pm-plugins/plugin-key.d.ts +3 -0
  362. package/dist/types-ts4.5/pm-plugins/types.d.ts +65 -0
  363. package/dist/types-ts4.5/toolbar/alt-text.d.ts +13 -0
  364. package/dist/types-ts4.5/toolbar/commands.d.ts +12 -0
  365. package/dist/types-ts4.5/toolbar/filePreviewItem.d.ts +9 -0
  366. package/dist/types-ts4.5/toolbar/imageBorder.d.ts +2 -0
  367. package/dist/types-ts4.5/toolbar/index.d.ts +6 -0
  368. package/dist/types-ts4.5/toolbar/linking-toolbar-appearance.d.ts +14 -0
  369. package/dist/types-ts4.5/toolbar/linking.d.ts +10 -0
  370. package/dist/types-ts4.5/toolbar/utils.d.ts +11 -0
  371. package/dist/types-ts4.5/types.d.ts +2 -1
  372. package/dist/types-ts4.5/ui/CaptionPlaceholder/index.d.ts +6 -0
  373. package/dist/types-ts4.5/ui/CaptionPlaceholder/messages.d.ts +7 -0
  374. package/dist/types-ts4.5/ui/ImageBorder/index.d.ts +11 -0
  375. package/dist/types-ts4.5/ui/ImageBorder/messages.d.ts +42 -0
  376. package/dist/types-ts4.5/ui/ImageBorder/styles.d.ts +15 -0
  377. package/dist/types-ts4.5/ui/Media/DropPlaceholder.d.ts +8 -0
  378. package/dist/types-ts4.5/ui/Media/drop-placeholder-messages.d.ts +7 -0
  379. package/dist/types-ts4.5/ui/MediaLinkingToolbar.d.ts +35 -0
  380. package/dist/types-ts4.5/ui/MediaPicker/BrowserWrapper.d.ts +11 -0
  381. package/dist/types-ts4.5/ui/MediaPicker/ClipboardWrapper.d.ts +10 -0
  382. package/dist/types-ts4.5/ui/MediaPicker/DropzoneWrapper.d.ts +13 -0
  383. package/dist/types-ts4.5/ui/MediaPicker/PickerFacadeProvider.d.ts +28 -0
  384. package/dist/types-ts4.5/ui/MediaPicker/index.d.ts +23 -0
  385. package/dist/types-ts4.5/ui/PixelEntry/constants.d.ts +1 -0
  386. package/dist/types-ts4.5/ui/PixelEntry/index.d.ts +8 -0
  387. package/dist/types-ts4.5/ui/PixelEntry/messages.d.ts +47 -0
  388. package/dist/types-ts4.5/ui/PixelEntry/styles.d.ts +8 -0
  389. package/dist/types-ts4.5/ui/PixelEntry/types.d.ts +58 -0
  390. package/dist/types-ts4.5/ui/ResizableMediaSingle/ResizableMediaMigrationNotification.d.ts +3 -0
  391. package/dist/types-ts4.5/ui/ResizableMediaSingle/ResizableMediaSingleNext.d.ts +59 -0
  392. package/dist/types-ts4.5/ui/ResizableMediaSingle/index.d.ts +45 -0
  393. package/dist/types-ts4.5/ui/ResizableMediaSingle/styled.d.ts +2 -0
  394. package/dist/types-ts4.5/ui/ResizableMediaSingle/styles.d.ts +1 -0
  395. package/dist/types-ts4.5/ui/ResizableMediaSingle/types.d.ts +27 -0
  396. package/dist/types-ts4.5/ui/ToolbarMedia/index.d.ts +13 -0
  397. package/dist/types-ts4.5/ui/ToolbarMedia/toolbar-media-messages.d.ts +7 -0
  398. package/dist/types-ts4.5/ui/media-linking-toolbar-messages.d.ts +7 -0
  399. package/dist/types-ts4.5/utils/analytics.d.ts +3 -0
  400. package/dist/types-ts4.5/utils/check-media-type.d.ts +4 -0
  401. package/dist/types-ts4.5/utils/current-media-node.d.ts +9 -0
  402. package/dist/types-ts4.5/utils/is-image.d.ts +1 -0
  403. package/dist/types-ts4.5/utils/media-common.d.ts +20 -0
  404. package/dist/types-ts4.5/utils/media-files.d.ts +30 -0
  405. package/dist/types-ts4.5/utils/media-single.d.ts +20 -0
  406. package/package.json +32 -20
  407. package/report.api.md +430 -0
  408. package/tmp/api-report-tmp.d.ts +381 -0
@@ -0,0 +1,58 @@
1
+ import type { IntlShape } from 'react-intl-next';
2
+ export type PixelEntryProps = {
3
+ /**
4
+ * IntlShape passed in for translations
5
+ */
6
+ intl: IntlShape;
7
+ /**
8
+ * The current pixel width
9
+ */
10
+ width: number;
11
+ /**
12
+ * The original media width used to calculate the height
13
+ */
14
+ mediaWidth: number;
15
+ /**
16
+ * The original media height used to calculate the width
17
+ */
18
+ mediaHeight: number;
19
+ /**
20
+ * The minimum acceptable width input
21
+ */
22
+ minWidth: number;
23
+ /**
24
+ * The maximum acceptable width input
25
+ */
26
+ maxWidth: number;
27
+ /**
28
+ *
29
+ * Handler for valid input
30
+ */
31
+ onChange?: (valid: boolean) => void;
32
+ /**
33
+ * show migration button to convert to pixels for legacy image resize experience
34
+ */
35
+ showMigration?: boolean;
36
+ /**
37
+ * The submit function that is called when the form is valid and the submit key is pressed
38
+ */
39
+ onSubmit?: (value: PixelEntryFormData) => void;
40
+ /**
41
+ * An optional validate function that is called before onSubmit is called.
42
+ * The value passed through the validator currently comes from the width input only.
43
+ */
44
+ validate?: (value: number | '') => boolean;
45
+ /**
46
+ * Migration handler called when the CTA button is clicked
47
+ */
48
+ onMigrate?: () => void;
49
+ };
50
+ export type PixelEntryFormValues = {
51
+ inputWidth: number | '';
52
+ inputHeight: number | '';
53
+ };
54
+ export type PixelEntryValidation = 'valid' | 'greater-than-max' | 'less-than-min';
55
+ export type PixelEntryFormData = {
56
+ width: number;
57
+ validation: PixelEntryValidation;
58
+ };
@@ -0,0 +1,3 @@
1
+ /** @jsx jsx */
2
+ import { jsx } from '@emotion/react';
3
+ export declare const ResizableMediaMigrationNotification: () => jsx.JSX.Element;
@@ -0,0 +1,59 @@
1
+ /** @jsx jsx */
2
+ import React from 'react';
3
+ import { jsx } from '@emotion/react';
4
+ import type { RichMediaLayout as MediaSingleLayout } from '@atlaskit/adf-schema';
5
+ import type { GuidelineConfig, GuidelineSnapsReference, RelativeGuides } from '@atlaskit/editor-common/guideline';
6
+ import type { Dimensions, HandleResize, HandleResizeStart, Position, Snap } from '@atlaskit/editor-common/resizer';
7
+ import type { MediaClientConfig } from '@atlaskit/media-core';
8
+ import type { Props } from './types';
9
+ type State = {
10
+ isVideoFile: boolean;
11
+ isResizing: boolean;
12
+ size: Dimensions;
13
+ snaps: Snap;
14
+ relativeGuides: RelativeGuides;
15
+ guidelines: GuidelineConfig[];
16
+ };
17
+ export declare const resizerNextTestId = "mediaSingle.resizerNext.testid";
18
+ type ResizableMediaSingleNextProps = Props & {
19
+ showLegacyNotification?: boolean;
20
+ };
21
+ declare class ResizableMediaSingleNext extends React.Component<ResizableMediaSingleNextProps, State> {
22
+ private lastSnappedGuidelineKeys;
23
+ constructor(props: ResizableMediaSingleNextProps);
24
+ componentDidUpdate(prevProps: Props): boolean;
25
+ componentDidMount(): Promise<void>;
26
+ UNSAFE_componentWillReceiveProps(nextProps: Props): void;
27
+ get wrappedLayout(): boolean;
28
+ get pos(): number | null;
29
+ get $pos(): import("prosemirror-model").ResolvedPos | null;
30
+ get aspectRatio(): number;
31
+ get insideInlineLike(): boolean;
32
+ get insideLayout(): boolean;
33
+ get isGuidelineEnabled(): boolean;
34
+ isNestedNode(): boolean;
35
+ private getDefaultGuidelines;
36
+ private updateGuidelines;
37
+ checkVideoFile(viewMediaClientConfig?: MediaClientConfig): Promise<void>;
38
+ calcNewLayout: (newWidth: number, stop: boolean) => MediaSingleLayout;
39
+ calcUnwrappedLayout: (width: number, containerWidth: number, contentWidth: number, fullWidthMode?: boolean, isNestedNode?: boolean) => 'center' | 'wide' | 'full-width';
40
+ calcPxHeight: (newWidth: number) => number;
41
+ private displayGuideline;
42
+ private setIsResizing;
43
+ private updateSizeInPluginState;
44
+ private calcMaxWidth;
45
+ private calcMinWidth;
46
+ private getRelativeGuides;
47
+ updateActiveGuidelines: (width: number | undefined, guidelines: GuidelineConfig[], guidelineSnapsReference: GuidelineSnapsReference) => void;
48
+ calculateSizeState: (size: Position & Dimensions, delta: Dimensions, onResizeStop?: boolean) => {
49
+ width: number;
50
+ height: number;
51
+ layout: MediaSingleLayout;
52
+ };
53
+ selectCurrentMediaNode: () => void;
54
+ handleResizeStart: HandleResizeStart;
55
+ handleResize: HandleResize;
56
+ handleResizeStop: HandleResize;
57
+ render(): jsx.JSX.Element;
58
+ }
59
+ export default ResizableMediaSingleNext;
@@ -0,0 +1,45 @@
1
+ /** @jsx jsx */
2
+ import React from 'react';
3
+ import { jsx } from '@emotion/react';
4
+ import type { RichMediaLayout as MediaSingleLayout } from '@atlaskit/adf-schema';
5
+ import type { MediaClientConfig } from '@atlaskit/media-core';
6
+ import type { Props } from './types';
7
+ type State = {
8
+ offsetLeft: number;
9
+ isVideoFile: boolean;
10
+ resizedPctWidth?: number;
11
+ };
12
+ export default class ResizableMediaSingle extends React.Component<Props, State> {
13
+ state: State;
14
+ componentDidUpdate(prevProps: Props): boolean;
15
+ private displayGrid;
16
+ get wrappedLayout(): boolean;
17
+ isNestedInTable(): boolean;
18
+ componentDidMount(): Promise<void>;
19
+ UNSAFE_componentWillReceiveProps(nextProps: Props): void;
20
+ checkVideoFile(viewMediaClientConfig?: MediaClientConfig): Promise<void>;
21
+ /**
22
+ * When returning to center layout from a wrapped/aligned layout, it might actually
23
+ * be wide or full-width
24
+ */
25
+ checkLayout(oldLayout: MediaSingleLayout, newLayout: MediaSingleLayout): void;
26
+ calcNewSize: (newWidth: number, stop: boolean) => {
27
+ width: number | null;
28
+ layout: MediaSingleLayout;
29
+ };
30
+ calcUnwrappedLayout: (pct: number, width: number) => 'center' | 'wide' | 'full-width';
31
+ get $pos(): import("prosemirror-model").ResolvedPos | null;
32
+ /**
33
+ * The maxmimum number of grid columns this node can resize to.
34
+ */
35
+ get gridWidth(): number;
36
+ calcColumnLeftOffset: () => number;
37
+ wrapper?: HTMLElement;
38
+ calcPxWidth: (useLayout?: MediaSingleLayout) => number;
39
+ get insideInlineLike(): boolean;
40
+ get insideLayout(): boolean;
41
+ highlights: (newWidth: number, snapPoints: number[]) => string[] | number[];
42
+ private saveWrapper;
43
+ render(): jsx.JSX.Element;
44
+ }
45
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { MediaSingleDimensionHelperProps } from '@atlaskit/editor-common/ui';
2
+ export declare const wrapperStyle: (props: MediaSingleDimensionHelperProps) => import("@emotion/react").SerializedStyles;
@@ -0,0 +1 @@
1
+ export declare const resizableMediaMigrationNotificationStyle: import("@emotion/react").SerializedStyles;
@@ -0,0 +1,27 @@
1
+ import type { RichMediaLayout as MediaSingleLayout } from '@atlaskit/adf-schema';
2
+ import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
3
+ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
4
+ import type { MediaSingleProps } from '@atlaskit/editor-common/ui';
5
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
6
+ import type { MediaClientConfig } from '@atlaskit/media-core';
7
+ import type { MediaNextEditorPluginType } from '../../next-plugin-type';
8
+ import type { getPosHandler } from '../../types';
9
+ export type EnabledHandles = {
10
+ left?: boolean;
11
+ right?: boolean;
12
+ };
13
+ export type Props = MediaSingleProps & {
14
+ updateSize: (width: number | null, layout: MediaSingleLayout) => void;
15
+ getPos: getPosHandler;
16
+ view: EditorView;
17
+ lineLength: number;
18
+ gridSize: number;
19
+ containerWidth: number;
20
+ allowBreakoutSnapPoints?: boolean;
21
+ selected: boolean;
22
+ viewMediaClientConfig?: MediaClientConfig;
23
+ fullWidthMode?: boolean;
24
+ dispatchAnalyticsEvent: DispatchAnalyticsEvent;
25
+ mediaSingleWidth?: number;
26
+ pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined;
27
+ };
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import type { WrappedComponentProps } from 'react-intl-next';
3
+ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
4
+ import type { MediaNextEditorPluginType } from '../../next-plugin-type';
5
+ export interface Props {
6
+ isDisabled?: boolean;
7
+ isReducedSpacing?: boolean;
8
+ api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined;
9
+ }
10
+ declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
11
+ WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
12
+ };
13
+ export default _default;
@@ -0,0 +1,7 @@
1
+ export declare const toolbarMediaMessages: {
2
+ toolbarMediaTitle: {
3
+ id: string;
4
+ defaultMessage: string;
5
+ description: string;
6
+ };
7
+ };
@@ -0,0 +1,7 @@
1
+ export declare const mediaLinkToolbarMessages: {
2
+ backLink: {
3
+ id: string;
4
+ defaultMessage: string;
5
+ description: string;
6
+ };
7
+ };
@@ -0,0 +1,3 @@
1
+ import type { MediaEventPayload, MediaInputResizeTrackAction, MediaResizeTrackAction } from '@atlaskit/editor-common/analytics';
2
+ export declare const getMediaResizeAnalyticsEvent: <T extends MediaResizeTrackAction>(type: string, attributes: T["attributes"]) => MediaEventPayload | void;
3
+ export declare const getMediaInputResizeAnalyticsEvent: <T extends MediaInputResizeTrackAction>(type: string, attributes: T["attributes"]) => MediaEventPayload | void;
@@ -0,0 +1,4 @@
1
+ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
+ import type { MediaType } from '@atlaskit/media-client';
3
+ import type { MediaClientConfig } from '@atlaskit/media-core';
4
+ export declare const checkMediaType: (mediaNode: PMNode, mediaClientConfig: MediaClientConfig) => Promise<MediaType | 'external' | undefined>;
@@ -0,0 +1,9 @@
1
+ import type { BorderMarkAttributes } from '@atlaskit/adf-schema';
2
+ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
3
+ import type { EditorState } from '@atlaskit/editor-prosemirror/state';
4
+ export declare const currentMediaNodeWithPos: (editorState: EditorState) => {
5
+ node: PMNode;
6
+ pos: number;
7
+ } | undefined;
8
+ export declare const currentMediaNode: (editorState: EditorState) => PMNode | undefined;
9
+ export declare const currentMediaNodeBorderMark: (editorState: EditorState) => BorderMarkAttributes | undefined;
@@ -0,0 +1 @@
1
+ export declare const isImage: (fileType?: string) => boolean;
@@ -0,0 +1,20 @@
1
+ import type { MediaADFAttrs } from '@atlaskit/adf-schema';
2
+ import type { Node as PMNode, ResolvedPos } from '@atlaskit/editor-prosemirror/model';
3
+ import type { EditorState } from '@atlaskit/editor-prosemirror/state';
4
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
5
+ import type { MediaState, getPosHandler as ProsemirrorGetPosHandler } from '../types';
6
+ export declare const isMediaBlobUrlFromAttrs: (attrs: MediaADFAttrs) => boolean;
7
+ export declare const posOfMediaGroupNearby: (state: EditorState) => number | undefined;
8
+ export declare const isSelectionNonMediaBlockNode: (state: EditorState) => boolean;
9
+ export declare const isSelectionMediaSingleNode: (state: EditorState) => boolean;
10
+ export declare const posOfPrecedingMediaGroup: (state: EditorState) => number | undefined;
11
+ /**
12
+ * Determine whether the cursor is inside empty paragraph
13
+ * or the selection is the entire paragraph
14
+ */
15
+ export declare const isInsidePotentialEmptyParagraph: (state: EditorState) => boolean;
16
+ export declare const posOfParentMediaGroup: (state: EditorState, $pos?: ResolvedPos, prepend?: boolean) => number | undefined;
17
+ export declare const removeMediaNode: (view: EditorView, node: PMNode, getPos: ProsemirrorGetPosHandler) => void;
18
+ export declare const splitMediaGroup: (view: EditorView) => boolean;
19
+ export declare const copyOptionalAttrsFromMediaState: (mediaState: MediaState, node: PMNode) => void;
20
+ export declare const getMediaNodeFromSelection: (state: EditorState) => PMNode | null;
@@ -0,0 +1,30 @@
1
+ import type { EditorAnalyticsAPI, InputMethodInsertMedia } from '@atlaskit/editor-common/analytics';
2
+ import type { EditorState } from '@atlaskit/editor-prosemirror/state';
3
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
+ import type { MediaState } from '../types';
5
+ export interface Range {
6
+ start: number;
7
+ end: number;
8
+ }
9
+ export declare const canInsertMediaInline: (state: EditorState) => boolean;
10
+ /**
11
+ * Create a new media inline to insert the new media.
12
+ * @param view Editor view
13
+ * @param mediaState Media file to be added to the editor
14
+ * @param collection Collection for the media to be added
15
+ */
16
+ export declare const insertMediaInlineNode: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (view: EditorView, mediaState: MediaState, collection: string, inputMethod?: InputMethodInsertMedia) => boolean;
17
+ /**
18
+ * Insert a media into an existing media group
19
+ * or create a new media group to insert the new media.
20
+ * @param view Editor view
21
+ * @param mediaStates Media files to be added to the editor
22
+ * @param collection Collection for the media to be added
23
+ */
24
+ export declare const insertMediaGroupNode: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (view: EditorView, mediaStates: MediaState[], collection: string, inputMethod?: InputMethodInsertMedia) => void;
25
+ /**
26
+ * Return position of media to be inserted, if it is inside a list
27
+ * @param content Content to be inserted
28
+ * @param state Editor State
29
+ */
30
+ export declare const getPosInList: (state: EditorState) => number | undefined;
@@ -0,0 +1,20 @@
1
+ import type { EditorAnalyticsAPI, InputMethodInsertMedia } from '@atlaskit/editor-common/analytics';
2
+ import type { WidthPluginState } from '@atlaskit/editor-plugin-width';
3
+ import type { Node as PMNode, Schema } from '@atlaskit/editor-prosemirror/model';
4
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
5
+ import type { MediaState } from '../types';
6
+ export interface MediaSingleState extends MediaState {
7
+ dimensions: {
8
+ width: number;
9
+ height: number;
10
+ };
11
+ scaleFactor?: number;
12
+ contextId?: string;
13
+ }
14
+ export declare const isMediaSingle: (schema: Schema, fileMimeType?: string) => boolean;
15
+ export type InsertMediaAsMediaSingle = (view: EditorView, node: PMNode, inputMethod: InputMethodInsertMedia) => boolean;
16
+ export declare const insertMediaAsMediaSingle: (view: EditorView, node: PMNode, inputMethod: InputMethodInsertMedia, editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => boolean;
17
+ export declare const insertMediaSingleNode: (view: EditorView, mediaState: MediaState, inputMethod?: InputMethodInsertMedia, collection?: string, alignLeftOnInsert?: boolean, newInsertionBehaviour?: boolean, widthPluginState?: WidthPluginState | undefined, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined) => boolean;
18
+ export declare const createMediaSingleNode: (schema: Schema, collection: string, maxWidth?: number, minWidth?: number, alignLeftOnInsert?: boolean) => (mediaState: MediaSingleState) => PMNode;
19
+ export declare function isCaptionNode(editorView: EditorView): boolean;
20
+ export declare const isVideo: (fileType?: string) => boolean;
@@ -0,0 +1,5 @@
1
+ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
2
+ import type { Command } from '@atlaskit/editor-common/types';
3
+ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
4
+ export declare const selectCaptionFromMediaSinglePos: (mediaSingleNodePos: number, mediaSingleNode: PMNode) => Command;
5
+ export declare const insertAndSelectCaptionFromMediaSinglePos: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (mediaSingleNodePos: number | undefined, mediaSingleNode: PMNode) => Command;
@@ -0,0 +1,15 @@
1
+ import type { Command } from '@atlaskit/editor-common/types';
2
+ import type { EditorState } from '@atlaskit/editor-prosemirror/state';
3
+ import type { MediaNodeWithPosHandler, MediaPluginState } from '../pm-plugins/types';
4
+ /**
5
+ * Note that Media Inline is inserted like a media single node into the media plugin state.
6
+ * Though it is not of type mediaSingle, it shares the same `findMediaSingleNode` method
7
+ *
8
+ */
9
+ export declare const findMediaSingleNode: (mediaPluginState: MediaPluginState, id: string) => MediaNodeWithPosHandler | null;
10
+ export declare const findAllMediaSingleNodes: (mediaPluginState: MediaPluginState, id: string) => MediaNodeWithPosHandler[];
11
+ export declare const isMediaNode: (pos: number, state: EditorState) => boolean | null;
12
+ export declare const updateAllMediaSingleNodesAttrs: (id: string, attrs: object) => Command;
13
+ export declare const updateCurrentMediaNodeAttrs: (attrs: object, mediaNode: MediaNodeWithPosHandler) => Command;
14
+ export declare const updateMediaSingleNodeAttrs: (id: string, attrs: object) => Command;
15
+ export declare const replaceExternalMedia: (pos: number, attrs: object) => Command;
@@ -0,0 +1 @@
1
+ export { updateMediaSingleNodeAttrs, updateAllMediaSingleNodesAttrs, replaceExternalMedia, } from './helpers';
@@ -0,0 +1,9 @@
1
+ import type { EditorAnalyticsAPI, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
2
+ import type { Command, CommandDispatch } from '@atlaskit/editor-common/types';
3
+ import type { EditorState } from '@atlaskit/editor-prosemirror/state';
4
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
5
+ export declare const showLinkingToolbar: Command;
6
+ export declare const showLinkingToolbarWithMediaTypeCheck: Command;
7
+ export declare const hideLinkingToolbar: (state: EditorState, dispatch?: CommandDispatch, view?: EditorView, focusFloatingToolbar?: boolean) => void;
8
+ export declare const unlink: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
9
+ export declare const setUrlToMedia: (url: string, inputMethod: INPUT_METHOD.TYPEAHEAD | INPUT_METHOD.MANUAL, editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
@@ -1 +1,2 @@
1
- export {};
1
+ export type { MediaNextEditorPluginType as MediaPlugin } from './next-plugin-type';
2
+ export { mediaPlugin } from './plugin';
@@ -0,0 +1,17 @@
1
+ import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
2
+ import type { ErrorReporter } from '@atlaskit/editor-common/utils';
3
+ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
4
+ import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
5
+ import type { CustomMediaPicker, getPosHandler, MediaState } from './types';
6
+ export type MediaPluginOptions = {
7
+ providerFactory: ProviderFactory;
8
+ nodeViews: {
9
+ [name: string]: (node: PMNode, view: EditorView, getPos: getPosHandler) => NodeView;
10
+ };
11
+ errorReporter?: ErrorReporter;
12
+ uploadErrorHandler?: (state: MediaState) => void;
13
+ waitForMediaUpload?: boolean;
14
+ customDropzoneContainer?: HTMLElement;
15
+ customMediaPicker?: CustomMediaPicker;
16
+ allowResizing: boolean;
17
+ };
@@ -0,0 +1,31 @@
1
+ import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
2
+ import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
3
+ import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
4
+ import type { EditorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled';
5
+ import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
6
+ import type { FloatingToolbarPlugin } from '@atlaskit/editor-plugin-floating-toolbar';
7
+ import type { FocusPlugin } from '@atlaskit/editor-plugin-focus';
8
+ import type { GridPlugin } from '@atlaskit/editor-plugin-grid';
9
+ import type { GuidelinePlugin } from '@atlaskit/editor-plugin-guideline';
10
+ import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
11
+ import type { MediaPluginState } from './pm-plugins/types';
12
+ import type { MediaOptions } from './types';
13
+ import type { InsertMediaAsMediaSingle } from './utils/media-single';
14
+ export type MediaNextEditorPluginType = NextEditorPlugin<'media', {
15
+ pluginConfiguration: MediaOptions | undefined;
16
+ dependencies: [
17
+ FeatureFlagsPlugin,
18
+ OptionalPlugin<AnalyticsPlugin>,
19
+ GuidelinePlugin,
20
+ GridPlugin,
21
+ WidthPlugin,
22
+ DecorationsPlugin,
23
+ FloatingToolbarPlugin,
24
+ EditorDisabledPlugin,
25
+ FocusPlugin
26
+ ];
27
+ sharedState: MediaPluginState | null;
28
+ actions: {
29
+ insertMediaAsMediaSingle: InsertMediaAsMediaSingle;
30
+ };
31
+ }>;
@@ -0,0 +1,24 @@
1
+ export declare class MediaNodeUpdater {
2
+ static instances: MediaNodeUpdater[];
3
+ static mockOverrides: {};
4
+ static mockReset(): void;
5
+ constructor();
6
+ static setMock(thisKey: string, value: any): void;
7
+ updateContextId(): Promise<void>;
8
+ updateNodeContextId(): Promise<void>;
9
+ getAttrs(): void;
10
+ getObjectId(): Promise<void>;
11
+ getNodeContextId(): void;
12
+ updateDimensions(): void;
13
+ getRemoteDimensions(): Promise<void>;
14
+ isNodeFromDifferentCollection(): Promise<void>;
15
+ hasDifferentContextId(): Promise<void>;
16
+ copyNode(): Promise<void>;
17
+ copyNodeFromPos(): Promise<void>;
18
+ updateMediaSingleFileAttrs(): Promise<void>;
19
+ uploadExternalMedia(): Promise<void>;
20
+ isMediaBlobUrl(): void;
21
+ copyNodeFromBlobUrl(): void;
22
+ updateNodeAttrs(): void;
23
+ handleExternalMedia(): Promise<void>;
24
+ }
@@ -0,0 +1,33 @@
1
+ import React from 'react';
2
+ import type { WrappedComponentProps } from 'react-intl-next';
3
+ import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
4
+ import type { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
5
+ import type { ContextIdentifierProvider, MediaProvider, ProviderFactory } from '@atlaskit/editor-common/provider-factory';
6
+ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
7
+ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
8
+ import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
9
+ import type { MediaClientConfig } from '@atlaskit/media-core';
10
+ import type { MediaNextEditorPluginType } from '../next-plugin-type';
11
+ import type { getPosHandler, MediaOptions } from '../types';
12
+ export type MediaGroupProps = {
13
+ forwardRef?: (ref: HTMLElement) => void;
14
+ node: PMNode;
15
+ view: EditorView;
16
+ getPos: () => number | undefined;
17
+ disabled?: boolean;
18
+ allowLazyLoading?: boolean;
19
+ mediaProvider: Promise<MediaProvider>;
20
+ contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
21
+ isCopyPasteEnabled?: boolean;
22
+ anchorPos: number;
23
+ headPos: number;
24
+ mediaOptions: MediaOptions;
25
+ } & WrappedComponentProps;
26
+ export interface MediaGroupState {
27
+ viewMediaClientConfig?: MediaClientConfig;
28
+ }
29
+ declare const IntlMediaGroup: React.FC<import("react-intl-next").WithIntlProps<MediaGroupProps>> & {
30
+ WrappedComponent: React.ComponentType<MediaGroupProps>;
31
+ };
32
+ export default IntlMediaGroup;
33
+ export declare const ReactMediaGroupNode: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, mediaOptions: MediaOptions | undefined, pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined) => (node: PMNode, view: EditorView, getPos: getPosHandler) => NodeView;
@@ -0,0 +1,50 @@
1
+ import React from 'react';
2
+ import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
3
+ import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
4
+ import type { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
5
+ import type { ContextIdentifierProvider, MediaProvider, ProviderFactory } from '@atlaskit/editor-common/provider-factory';
6
+ import { SelectionBasedNodeView } from '@atlaskit/editor-common/selection-based-node-view';
7
+ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
8
+ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
9
+ import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
10
+ import type { FileIdentifier } from '@atlaskit/media-client';
11
+ import type { MediaNextEditorPluginType } from '../next-plugin-type';
12
+ import type { MediaPluginState } from '../pm-plugins/types';
13
+ import type { getPosHandler, getPosHandler as ProsemirrorGetPosHandler } from '../types';
14
+ import { MediaNodeUpdater } from './mediaNodeUpdater';
15
+ export interface MediaInlineProps {
16
+ mediaProvider: Promise<MediaProvider>;
17
+ identifier: FileIdentifier;
18
+ node: PMNode;
19
+ isSelected: boolean;
20
+ view: EditorView;
21
+ getPos: ProsemirrorGetPosHandler;
22
+ dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
23
+ contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
24
+ mediaPluginState: MediaPluginState;
25
+ }
26
+ export declare const createMediaNodeUpdater: (props: MediaInlineProps) => MediaNodeUpdater;
27
+ /**
28
+ * Handles updating the media inline node attributes
29
+ * but also handling copy-paste for cross-editor of the same instance
30
+ * using the contextid
31
+ *
32
+ */
33
+ export declare const updateMediaNodeAttributes: (props: MediaInlineProps, mediaNodeUpdater: MediaNodeUpdater) => Promise<void>;
34
+ export declare const handleNewNode: (props: MediaInlineProps) => void;
35
+ export declare const MediaInline: React.FC<MediaInlineProps>;
36
+ export interface MediaInlineNodeViewProps {
37
+ providerFactory: ProviderFactory;
38
+ api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined;
39
+ dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
40
+ }
41
+ export declare class MediaInlineNodeView extends SelectionBasedNodeView<MediaInlineNodeViewProps> {
42
+ createDomRef(): HTMLSpanElement;
43
+ getContentDOM(): {
44
+ dom: HTMLSpanElement;
45
+ };
46
+ ignoreMutation(): boolean;
47
+ viewShouldUpdate(nextNode: PMNode): boolean;
48
+ render(props: MediaInlineNodeViewProps): JSX.Element;
49
+ }
50
+ export declare const ReactMediaInlineNode: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, api: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined, dispatchAnalyticsEvent?: DispatchAnalyticsEvent) => (node: PMNode, view: EditorView, getPos: getPosHandler) => NodeView;
@@ -0,0 +1,45 @@
1
+ import type { MediaADFAttrs } from '@atlaskit/adf-schema';
2
+ import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
3
+ import type { ContextIdentifierProvider, MediaProvider } from '@atlaskit/editor-common/provider-factory';
4
+ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
5
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
6
+ import type { MediaTraceContext } from '@atlaskit/media-common';
7
+ import type { MediaOptions, getPosHandler as ProsemirrorGetPosHandler } from '../types';
8
+ export type RemoteDimensions = {
9
+ id: string;
10
+ height: number;
11
+ width: number;
12
+ };
13
+ export interface MediaNodeUpdaterProps {
14
+ view: EditorView;
15
+ node: PMNode;
16
+ mediaProvider?: Promise<MediaProvider>;
17
+ contextIdentifierProvider?: Promise<ContextIdentifierProvider>;
18
+ isMediaSingle: boolean;
19
+ mediaOptions?: MediaOptions;
20
+ dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
21
+ }
22
+ export declare class MediaNodeUpdater {
23
+ props: MediaNodeUpdaterProps;
24
+ constructor(props: MediaNodeUpdaterProps);
25
+ isMediaBlobUrl(): boolean;
26
+ updateContextId: () => Promise<void>;
27
+ updateNodeContextId: (getPos: ProsemirrorGetPosHandler) => Promise<void>;
28
+ private hasFileAttributesDefined;
29
+ private getNewFileAttrsForNode;
30
+ updateMediaSingleFileAttrs: () => Promise<void>;
31
+ updateNodeAttrs: (getPos: ProsemirrorGetPosHandler) => Promise<void>;
32
+ getAttrs: () => MediaADFAttrs | undefined;
33
+ getObjectId: () => Promise<string | null>;
34
+ uploadExternalMedia: (getPos: ProsemirrorGetPosHandler) => Promise<void>;
35
+ getNodeContextId: () => string | null;
36
+ updateDimensions: (dimensions: RemoteDimensions) => void;
37
+ getRemoteDimensions(): Promise<false | RemoteDimensions>;
38
+ hasDifferentContextId: () => Promise<boolean>;
39
+ isNodeFromDifferentCollection: () => Promise<boolean>;
40
+ handleExternalMedia(getPos: ProsemirrorGetPosHandler): Promise<void>;
41
+ copyNodeFromBlobUrl: (getPos: ProsemirrorGetPosHandler) => Promise<void>;
42
+ copyNodeFromPos: (getPos: ProsemirrorGetPosHandler, traceContext?: MediaTraceContext) => Promise<void>;
43
+ copyNode: (traceContext?: MediaTraceContext) => Promise<void>;
44
+ private copyFile;
45
+ }
@@ -0,0 +1,28 @@
1
+ /// <reference types="react" />
2
+ import type { MediaADFAttrs } from '@atlaskit/adf-schema';
3
+ import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
4
+ import type { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
5
+ import type { ContextIdentifierProvider, MediaProvider, ProviderFactory, Providers } from '@atlaskit/editor-common/provider-factory';
6
+ import { SelectionBasedNodeView } from '@atlaskit/editor-common/selection-based-node-view';
7
+ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
8
+ import type { WidthPluginState } from '@atlaskit/editor-plugin-width';
9
+ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
10
+ import type { Decoration, EditorView } from '@atlaskit/editor-prosemirror/view';
11
+ import type { MediaNextEditorPluginType } from '../../next-plugin-type';
12
+ import type { getPosHandler, MediaOptions } from '../../types';
13
+ import type { MediaNodeViewProps } from '../types';
14
+ declare class MediaNodeView extends SelectionBasedNodeView<MediaNodeViewProps> {
15
+ private isSelected;
16
+ createDomRef(): HTMLElement;
17
+ viewShouldUpdate(nextNode: PMNode, decorations: Decoration[]): boolean;
18
+ stopEvent(event: Event): boolean;
19
+ getAttrs(): MediaADFAttrs;
20
+ isMediaBlobUrl(): boolean;
21
+ renderMediaNodeWithState: (mediaProvider?: Promise<MediaProvider>, contextIdentifierProvider?: Promise<ContextIdentifierProvider>) => ({ width: editorWidth }: {
22
+ width?: import("@atlaskit/editor-common/types").EditorContainerWidth | undefined;
23
+ }) => JSX.Element;
24
+ renderMediaNodeWithProviders: ({ mediaProvider, contextIdentifierProvider, }: Providers) => JSX.Element;
25
+ render(): JSX.Element;
26
+ }
27
+ export declare const ReactMediaNode: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, mediaOptions: MediaOptions | undefined, pluginInjectionApi: ExtractInjectionAPI<MediaNextEditorPluginType> | undefined) => (node: PMNode, view: EditorView, getPos: getPosHandler) => MediaNodeView;
28
+ export {};