@remotion/cli 3.0.28 → 3.0.31

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 (401) hide show
  1. package/dist/chalk/symbols.d.ts +111 -0
  2. package/dist/chalk/symbols.js +75 -0
  3. package/dist/chalk/utilities.d.ts +2 -0
  4. package/dist/chalk/utilities.js +37 -0
  5. package/dist/editor/components/CompositionManager.d.ts +4 -0
  6. package/dist/editor/components/CompositionManager.js +60 -0
  7. package/dist/editor/components/CopyButton.js +1 -1
  8. package/dist/editor/components/Editor.js +2 -1
  9. package/dist/editor/components/GlobalKeybindings.js +26 -11
  10. package/dist/editor/components/KeyboardShortcutsModal.js +1 -1
  11. package/dist/editor/components/Menu/MenuItem.d.ts +1 -1
  12. package/dist/editor/components/MenuToolbar.js +24 -2
  13. package/dist/editor/components/NewComposition/MenuContent.js +42 -7
  14. package/dist/editor/components/Notifications/ColorDot.d.ts +4 -0
  15. package/dist/editor/components/Notifications/ColorDot.js +22 -0
  16. package/dist/editor/components/Notifications/Notification.d.ts +8 -0
  17. package/dist/editor/components/Notifications/Notification.js +31 -0
  18. package/dist/editor/components/Notifications/NotificationCenter.d.ts +13 -0
  19. package/dist/editor/components/Notifications/NotificationCenter.js +39 -0
  20. package/dist/editor/components/PlayPause.js +53 -7
  21. package/dist/editor/components/PlaybackKeyboardShortcutsManager.js +18 -3
  22. package/dist/editor/components/TimelineInOutToggle.js +21 -6
  23. package/dist/editor/components/UpdateModal/UpdateModal.js +1 -1
  24. package/dist/editor/helpers/copy-text.d.ts +1 -1
  25. package/dist/editor/helpers/copy-text.js +5 -4
  26. package/dist/editor/helpers/pick-color.d.ts +1 -0
  27. package/dist/editor/helpers/pick-color.js +36 -0
  28. package/dist/editor/helpers/use-keybinding.d.ts +6 -1
  29. package/dist/editor/helpers/use-keybinding.js +10 -5
  30. package/dist/editor/state/keybindings.js +3 -1
  31. package/dist/editor/state/z-index.js +6 -1
  32. package/dist/get-cli-options.js +3 -1
  33. package/dist/preview-server/error-overlay/remotion-overlay/AskOnDiscord.d.ts +3 -1
  34. package/dist/preview-server/error-overlay/remotion-overlay/AskOnDiscord.js +20 -2
  35. package/dist/preview-server/error-overlay/remotion-overlay/Button.js +4 -4
  36. package/dist/preview-server/error-overlay/remotion-overlay/ErrorDisplay.d.ts +1 -0
  37. package/dist/preview-server/error-overlay/remotion-overlay/ErrorDisplay.js +5 -2
  38. package/dist/preview-server/error-overlay/remotion-overlay/ErrorLoader.d.ts +1 -0
  39. package/dist/preview-server/error-overlay/remotion-overlay/ErrorLoader.js +2 -2
  40. package/dist/preview-server/error-overlay/remotion-overlay/ErrorMessage.d.ts +4 -0
  41. package/dist/preview-server/error-overlay/remotion-overlay/ErrorMessage.js +67 -0
  42. package/dist/preview-server/error-overlay/remotion-overlay/ErrorTitle.js +5 -9
  43. package/dist/preview-server/error-overlay/remotion-overlay/HelpLink.d.ts +6 -0
  44. package/dist/preview-server/error-overlay/remotion-overlay/HelpLink.js +31 -0
  45. package/dist/preview-server/error-overlay/remotion-overlay/OpenInEditor.d.ts +1 -0
  46. package/dist/preview-server/error-overlay/remotion-overlay/OpenInEditor.js +20 -2
  47. package/dist/preview-server/error-overlay/remotion-overlay/Overlay.js +8 -7
  48. package/dist/preview-server/error-overlay/remotion-overlay/SearchGitHubIssues.d.ts +1 -0
  49. package/dist/preview-server/error-overlay/remotion-overlay/SearchGitHubIssues.js +20 -2
  50. package/dist/preview-server/error-overlay/remotion-overlay/ShortcutHint.d.ts +5 -0
  51. package/dist/preview-server/error-overlay/remotion-overlay/ShortcutHint.js +16 -0
  52. package/dist/preview-server/error-overlay/remotion-overlay/StackFrame.js +1 -1
  53. package/dist/preview-server/error-overlay/remotion-overlay/carets.d.ts +4 -2
  54. package/dist/preview-server/error-overlay/remotion-overlay/carets.js +2 -2
  55. package/dist/preview-server/error-overlay/remotion-overlay/get-help-link.d.ts +5 -0
  56. package/dist/preview-server/error-overlay/remotion-overlay/get-help-link.js +19 -0
  57. package/dist/preview-server/fast-refresh/helpers.d.ts +39 -0
  58. package/dist/preview-server/fast-refresh/helpers.js +145 -0
  59. package/dist/preview-server/fast-refresh/index.d.ts +30 -0
  60. package/dist/preview-server/fast-refresh/index.js +86 -0
  61. package/dist/preview-server/fast-refresh/loader.d.ts +35 -0
  62. package/dist/preview-server/fast-refresh/loader.js +81 -0
  63. package/dist/preview-server/fast-refresh/runtime.d.ts +35 -0
  64. package/dist/preview-server/fast-refresh/runtime.js +32 -0
  65. package/dist/preview-server/static-preview.d.ts +1 -0
  66. package/dist/preview-server/static-preview.js +40 -0
  67. package/dist/preview-server/webpack-cache.d.ts +12 -0
  68. package/dist/preview-server/webpack-cache.js +66 -0
  69. package/package.json +7 -7
  70. package/dist/ansi/ansi-diff.d.ts.map +0 -1
  71. package/dist/ansi/ansi-diff.js.map +0 -1
  72. package/dist/ansi/ansi-regex.d.ts.map +0 -1
  73. package/dist/ansi/ansi-regex.js.map +0 -1
  74. package/dist/ansi/ansi-split.d.ts.map +0 -1
  75. package/dist/ansi/ansi-split.js.map +0 -1
  76. package/dist/check-version.d.ts.map +0 -1
  77. package/dist/check-version.js.map +0 -1
  78. package/dist/code-frame.d.ts.map +0 -1
  79. package/dist/code-frame.js.map +0 -1
  80. package/dist/compositions.d.ts.map +0 -1
  81. package/dist/compositions.js.map +0 -1
  82. package/dist/download-progress.d.ts.map +0 -1
  83. package/dist/download-progress.js.map +0 -1
  84. package/dist/editor/components/AudioWaveform.d.ts.map +0 -1
  85. package/dist/editor/components/AudioWaveform.js.map +0 -1
  86. package/dist/editor/components/AudioWaveformBar.d.ts.map +0 -1
  87. package/dist/editor/components/AudioWaveformBar.js.map +0 -1
  88. package/dist/editor/components/Canvas.d.ts.map +0 -1
  89. package/dist/editor/components/Canvas.js.map +0 -1
  90. package/dist/editor/components/CheckboardToggle.d.ts.map +0 -1
  91. package/dist/editor/components/CheckboardToggle.js.map +0 -1
  92. package/dist/editor/components/ClipboardIcon.d.ts.map +0 -1
  93. package/dist/editor/components/ClipboardIcon.js.map +0 -1
  94. package/dist/editor/components/CompositionSelector.d.ts.map +0 -1
  95. package/dist/editor/components/CompositionSelector.js.map +0 -1
  96. package/dist/editor/components/CompositionSelectorItem.d.ts.map +0 -1
  97. package/dist/editor/components/CompositionSelectorItem.js.map +0 -1
  98. package/dist/editor/components/ControlButton.d.ts.map +0 -1
  99. package/dist/editor/components/ControlButton.js.map +0 -1
  100. package/dist/editor/components/CopyButton.d.ts.map +0 -1
  101. package/dist/editor/components/CopyButton.js.map +0 -1
  102. package/dist/editor/components/CurrentComposition.d.ts.map +0 -1
  103. package/dist/editor/components/CurrentComposition.js.map +0 -1
  104. package/dist/editor/components/Editor.d.ts.map +0 -1
  105. package/dist/editor/components/Editor.js.map +0 -1
  106. package/dist/editor/components/EditorContent.d.ts.map +0 -1
  107. package/dist/editor/components/EditorContent.js.map +0 -1
  108. package/dist/editor/components/FpsCounter.d.ts.map +0 -1
  109. package/dist/editor/components/FpsCounter.js.map +0 -1
  110. package/dist/editor/components/FramePersistor.d.ts.map +0 -1
  111. package/dist/editor/components/FramePersistor.js.map +0 -1
  112. package/dist/editor/components/GlobalKeybindings.d.ts.map +0 -1
  113. package/dist/editor/components/GlobalKeybindings.js.map +0 -1
  114. package/dist/editor/components/KeyboardShortcutsModal.d.ts.map +0 -1
  115. package/dist/editor/components/KeyboardShortcutsModal.js.map +0 -1
  116. package/dist/editor/components/LoadingIndicator.d.ts.map +0 -1
  117. package/dist/editor/components/LoadingIndicator.js.map +0 -1
  118. package/dist/editor/components/LoopToggle.d.ts.map +0 -1
  119. package/dist/editor/components/LoopToggle.js.map +0 -1
  120. package/dist/editor/components/Menu/MenuDivider.d.ts.map +0 -1
  121. package/dist/editor/components/Menu/MenuDivider.js.map +0 -1
  122. package/dist/editor/components/Menu/MenuItem.d.ts.map +0 -1
  123. package/dist/editor/components/Menu/MenuItem.js.map +0 -1
  124. package/dist/editor/components/Menu/MenuSubItem.d.ts.map +0 -1
  125. package/dist/editor/components/Menu/MenuSubItem.js.map +0 -1
  126. package/dist/editor/components/Menu/SubMenu.d.ts.map +0 -1
  127. package/dist/editor/components/Menu/SubMenu.js.map +0 -1
  128. package/dist/editor/components/Menu/portals.d.ts.map +0 -1
  129. package/dist/editor/components/Menu/portals.js.map +0 -1
  130. package/dist/editor/components/Menu/styles.d.ts.map +0 -1
  131. package/dist/editor/components/Menu/styles.js.map +0 -1
  132. package/dist/editor/components/MenuToolbar.d.ts.map +0 -1
  133. package/dist/editor/components/MenuToolbar.js.map +0 -1
  134. package/dist/editor/components/ModalContainer.d.ts.map +0 -1
  135. package/dist/editor/components/ModalContainer.js.map +0 -1
  136. package/dist/editor/components/ModalHeader.d.ts.map +0 -1
  137. package/dist/editor/components/ModalHeader.js.map +0 -1
  138. package/dist/editor/components/MuteToggle.d.ts.map +0 -1
  139. package/dist/editor/components/MuteToggle.js.map +0 -1
  140. package/dist/editor/components/NewComposition/CancelButton.d.ts.map +0 -1
  141. package/dist/editor/components/NewComposition/CancelButton.js.map +0 -1
  142. package/dist/editor/components/NewComposition/ComboBox.d.ts.map +0 -1
  143. package/dist/editor/components/NewComposition/ComboBox.js.map +0 -1
  144. package/dist/editor/components/NewComposition/CopyHint.d.ts.map +0 -1
  145. package/dist/editor/components/NewComposition/CopyHint.js.map +0 -1
  146. package/dist/editor/components/NewComposition/InputDragger.d.ts.map +0 -1
  147. package/dist/editor/components/NewComposition/InputDragger.js.map +0 -1
  148. package/dist/editor/components/NewComposition/MenuContent.d.ts.map +0 -1
  149. package/dist/editor/components/NewComposition/MenuContent.js.map +0 -1
  150. package/dist/editor/components/NewComposition/NewCompAspectRatio.d.ts.map +0 -1
  151. package/dist/editor/components/NewComposition/NewCompAspectRatio.js.map +0 -1
  152. package/dist/editor/components/NewComposition/NewCompCode.d.ts.map +0 -1
  153. package/dist/editor/components/NewComposition/NewCompCode.js.map +0 -1
  154. package/dist/editor/components/NewComposition/NewCompDuration.d.ts.map +0 -1
  155. package/dist/editor/components/NewComposition/NewCompDuration.js.map +0 -1
  156. package/dist/editor/components/NewComposition/NewComposition.d.ts.map +0 -1
  157. package/dist/editor/components/NewComposition/NewComposition.js.map +0 -1
  158. package/dist/editor/components/NewComposition/RemInput.d.ts.map +0 -1
  159. package/dist/editor/components/NewComposition/RemInput.js.map +0 -1
  160. package/dist/editor/components/NewComposition/ToggleAspectRatio.d.ts.map +0 -1
  161. package/dist/editor/components/NewComposition/ToggleAspectRatio.js.map +0 -1
  162. package/dist/editor/components/NewComposition/ValidationMessage.d.ts.map +0 -1
  163. package/dist/editor/components/NewComposition/ValidationMessage.js.map +0 -1
  164. package/dist/editor/components/NewComposition/new-comp-layout.d.ts.map +0 -1
  165. package/dist/editor/components/NewComposition/new-comp-layout.js.map +0 -1
  166. package/dist/editor/components/NewComposition/render-aspect-ratio.d.ts.map +0 -1
  167. package/dist/editor/components/NewComposition/render-aspect-ratio.js.map +0 -1
  168. package/dist/editor/components/PlayPause.d.ts.map +0 -1
  169. package/dist/editor/components/PlayPause.js.map +0 -1
  170. package/dist/editor/components/PlaybackKeyboardShortcutsManager.d.ts.map +0 -1
  171. package/dist/editor/components/PlaybackKeyboardShortcutsManager.js.map +0 -1
  172. package/dist/editor/components/PlaybackRatePersistor.d.ts.map +0 -1
  173. package/dist/editor/components/PlaybackRatePersistor.js.map +0 -1
  174. package/dist/editor/components/PlaybackRateSelector.d.ts.map +0 -1
  175. package/dist/editor/components/PlaybackRateSelector.js.map +0 -1
  176. package/dist/editor/components/Preview.d.ts.map +0 -1
  177. package/dist/editor/components/Preview.js.map +0 -1
  178. package/dist/editor/components/PreviewToolbar.d.ts.map +0 -1
  179. package/dist/editor/components/PreviewToolbar.js.map +0 -1
  180. package/dist/editor/components/RichTimelineToggle.d.ts.map +0 -1
  181. package/dist/editor/components/RichTimelineToggle.js.map +0 -1
  182. package/dist/editor/components/SizeSelector.d.ts.map +0 -1
  183. package/dist/editor/components/SizeSelector.js.map +0 -1
  184. package/dist/editor/components/Splitter/SplitterContainer.d.ts.map +0 -1
  185. package/dist/editor/components/Splitter/SplitterContainer.js.map +0 -1
  186. package/dist/editor/components/Splitter/SplitterContext.d.ts.map +0 -1
  187. package/dist/editor/components/Splitter/SplitterContext.js.map +0 -1
  188. package/dist/editor/components/Splitter/SplitterElement.d.ts.map +0 -1
  189. package/dist/editor/components/Splitter/SplitterElement.js.map +0 -1
  190. package/dist/editor/components/Splitter/SplitterHandle.d.ts.map +0 -1
  191. package/dist/editor/components/Splitter/SplitterHandle.js.map +0 -1
  192. package/dist/editor/components/Thumbnail.d.ts.map +0 -1
  193. package/dist/editor/components/Thumbnail.js.map +0 -1
  194. package/dist/editor/components/TimeValue.d.ts.map +0 -1
  195. package/dist/editor/components/TimeValue.js.map +0 -1
  196. package/dist/editor/components/Timeline/LoopedIndicator.d.ts.map +0 -1
  197. package/dist/editor/components/Timeline/LoopedIndicator.js.map +0 -1
  198. package/dist/editor/components/Timeline/LoopedTimelineIndicators.d.ts.map +0 -1
  199. package/dist/editor/components/Timeline/LoopedTimelineIndicators.js.map +0 -1
  200. package/dist/editor/components/Timeline/MaxTimelineTracks.d.ts.map +0 -1
  201. package/dist/editor/components/Timeline/MaxTimelineTracks.js.map +0 -1
  202. package/dist/editor/components/Timeline/Timeline.d.ts.map +0 -1
  203. package/dist/editor/components/Timeline/Timeline.js.map +0 -1
  204. package/dist/editor/components/Timeline/TimelineCollapseToggle.d.ts.map +0 -1
  205. package/dist/editor/components/Timeline/TimelineCollapseToggle.js.map +0 -1
  206. package/dist/editor/components/Timeline/TimelineDragHandler.d.ts.map +0 -1
  207. package/dist/editor/components/Timeline/TimelineDragHandler.js.map +0 -1
  208. package/dist/editor/components/Timeline/TimelineInOutPointer.d.ts.map +0 -1
  209. package/dist/editor/components/Timeline/TimelineInOutPointer.js.map +0 -1
  210. package/dist/editor/components/Timeline/TimelineInOutPointerHandle.d.ts.map +0 -1
  211. package/dist/editor/components/Timeline/TimelineInOutPointerHandle.js.map +0 -1
  212. package/dist/editor/components/Timeline/TimelineList.d.ts.map +0 -1
  213. package/dist/editor/components/Timeline/TimelineList.js.map +0 -1
  214. package/dist/editor/components/Timeline/TimelineListItem.d.ts.map +0 -1
  215. package/dist/editor/components/Timeline/TimelineListItem.js.map +0 -1
  216. package/dist/editor/components/Timeline/TimelineSequence.d.ts.map +0 -1
  217. package/dist/editor/components/Timeline/TimelineSequence.js.map +0 -1
  218. package/dist/editor/components/Timeline/TimelineSequenceFrame.d.ts.map +0 -1
  219. package/dist/editor/components/Timeline/TimelineSequenceFrame.js.map +0 -1
  220. package/dist/editor/components/Timeline/TimelineSlider.d.ts.map +0 -1
  221. package/dist/editor/components/Timeline/TimelineSlider.js.map +0 -1
  222. package/dist/editor/components/Timeline/TimelineSliderHandle.d.ts.map +0 -1
  223. package/dist/editor/components/Timeline/TimelineSliderHandle.js.map +0 -1
  224. package/dist/editor/components/Timeline/TimelineTracks.d.ts.map +0 -1
  225. package/dist/editor/components/Timeline/TimelineTracks.js.map +0 -1
  226. package/dist/editor/components/Timeline/TimelineVideoInfo.d.ts.map +0 -1
  227. package/dist/editor/components/Timeline/TimelineVideoInfo.js.map +0 -1
  228. package/dist/editor/components/Timeline/is-collapsed.d.ts.map +0 -1
  229. package/dist/editor/components/Timeline/is-collapsed.js.map +0 -1
  230. package/dist/editor/components/Timeline/timeline-refs.d.ts.map +0 -1
  231. package/dist/editor/components/Timeline/timeline-refs.js.map +0 -1
  232. package/dist/editor/components/Timeline/timeline-state-reducer.d.ts.map +0 -1
  233. package/dist/editor/components/Timeline/timeline-state-reducer.js.map +0 -1
  234. package/dist/editor/components/TimelineInOutToggle.d.ts.map +0 -1
  235. package/dist/editor/components/TimelineInOutToggle.js.map +0 -1
  236. package/dist/editor/components/TopPanel.d.ts.map +0 -1
  237. package/dist/editor/components/TopPanel.js.map +0 -1
  238. package/dist/editor/components/UpdateCheck.d.ts.map +0 -1
  239. package/dist/editor/components/UpdateCheck.js.map +0 -1
  240. package/dist/editor/components/UpdateModal/UpdateModal.d.ts.map +0 -1
  241. package/dist/editor/components/UpdateModal/UpdateModal.js.map +0 -1
  242. package/dist/editor/components/layout.d.ts.map +0 -1
  243. package/dist/editor/components/layout.js.map +0 -1
  244. package/dist/editor/helpers/calculate-timeline.d.ts.map +0 -1
  245. package/dist/editor/helpers/calculate-timeline.js.map +0 -1
  246. package/dist/editor/helpers/checkerboard-background.d.ts.map +0 -1
  247. package/dist/editor/helpers/checkerboard-background.js.map +0 -1
  248. package/dist/editor/helpers/colors.d.ts.map +0 -1
  249. package/dist/editor/helpers/colors.js.map +0 -1
  250. package/dist/editor/helpers/copy-text.d.ts.map +0 -1
  251. package/dist/editor/helpers/copy-text.js.map +0 -1
  252. package/dist/editor/helpers/create-folder-tree.d.ts.map +0 -1
  253. package/dist/editor/helpers/create-folder-tree.js.map +0 -1
  254. package/dist/editor/helpers/get-left-of-timeline-slider.d.ts.map +0 -1
  255. package/dist/editor/helpers/get-left-of-timeline-slider.js.map +0 -1
  256. package/dist/editor/helpers/get-sequence-visible-range.d.ts.map +0 -1
  257. package/dist/editor/helpers/get-sequence-visible-range.js.map +0 -1
  258. package/dist/editor/helpers/get-timeline-nestedness.d.ts.map +0 -1
  259. package/dist/editor/helpers/get-timeline-nestedness.js.map +0 -1
  260. package/dist/editor/helpers/get-timeline-sequence-hash.d.ts.map +0 -1
  261. package/dist/editor/helpers/get-timeline-sequence-hash.js.map +0 -1
  262. package/dist/editor/helpers/get-timeline-sequence-layout.d.ts.map +0 -1
  263. package/dist/editor/helpers/get-timeline-sequence-layout.js.map +0 -1
  264. package/dist/editor/helpers/get-timeline-sequence-sort-key.d.ts.map +0 -1
  265. package/dist/editor/helpers/get-timeline-sequence-sort-key.js.map +0 -1
  266. package/dist/editor/helpers/is-composition-still.d.ts.map +0 -1
  267. package/dist/editor/helpers/is-composition-still.js.map +0 -1
  268. package/dist/editor/helpers/is-current-selected-still.d.ts.map +0 -1
  269. package/dist/editor/helpers/is-current-selected-still.js.map +0 -1
  270. package/dist/editor/helpers/noop.d.ts.map +0 -1
  271. package/dist/editor/helpers/noop.js.map +0 -1
  272. package/dist/editor/helpers/persist-open-folders.d.ts.map +0 -1
  273. package/dist/editor/helpers/persist-open-folders.js.map +0 -1
  274. package/dist/editor/helpers/timeline-layout.d.ts.map +0 -1
  275. package/dist/editor/helpers/timeline-layout.js.map +0 -1
  276. package/dist/editor/helpers/use-keybinding.d.ts.map +0 -1
  277. package/dist/editor/helpers/use-keybinding.js.map +0 -1
  278. package/dist/editor/helpers/validate-new-comp-data.d.ts.map +0 -1
  279. package/dist/editor/helpers/validate-new-comp-data.js.map +0 -1
  280. package/dist/editor/icons/Checkmark.d.ts.map +0 -1
  281. package/dist/editor/icons/Checkmark.js.map +0 -1
  282. package/dist/editor/icons/caret.d.ts.map +0 -1
  283. package/dist/editor/icons/caret.js.map +0 -1
  284. package/dist/editor/icons/film.d.ts.map +0 -1
  285. package/dist/editor/icons/film.js.map +0 -1
  286. package/dist/editor/icons/folder.d.ts.map +0 -1
  287. package/dist/editor/icons/folder.js.map +0 -1
  288. package/dist/editor/icons/keys.d.ts.map +0 -1
  289. package/dist/editor/icons/keys.js.map +0 -1
  290. package/dist/editor/icons/lock.d.ts.map +0 -1
  291. package/dist/editor/icons/lock.js.map +0 -1
  292. package/dist/editor/icons/media-volume.d.ts.map +0 -1
  293. package/dist/editor/icons/media-volume.js.map +0 -1
  294. package/dist/editor/icons/pause.d.ts.map +0 -1
  295. package/dist/editor/icons/pause.js.map +0 -1
  296. package/dist/editor/icons/play.d.ts.map +0 -1
  297. package/dist/editor/icons/play.js.map +0 -1
  298. package/dist/editor/icons/step-back.d.ts.map +0 -1
  299. package/dist/editor/icons/step-back.js.map +0 -1
  300. package/dist/editor/icons/step-forward.d.ts.map +0 -1
  301. package/dist/editor/icons/step-forward.js.map +0 -1
  302. package/dist/editor/icons/still.d.ts.map +0 -1
  303. package/dist/editor/icons/still.js.map +0 -1
  304. package/dist/editor/icons/timeline.d.ts.map +0 -1
  305. package/dist/editor/icons/timeline.js.map +0 -1
  306. package/dist/editor/icons/timelineInOutPointer.d.ts.map +0 -1
  307. package/dist/editor/icons/timelineInOutPointer.js.map +0 -1
  308. package/dist/editor/state/aspect-ratio-locked.d.ts.map +0 -1
  309. package/dist/editor/state/aspect-ratio-locked.js.map +0 -1
  310. package/dist/editor/state/checkerboard.d.ts.map +0 -1
  311. package/dist/editor/state/checkerboard.js.map +0 -1
  312. package/dist/editor/state/highest-z-index.d.ts.map +0 -1
  313. package/dist/editor/state/highest-z-index.js.map +0 -1
  314. package/dist/editor/state/input-dragger-click-lock.d.ts.map +0 -1
  315. package/dist/editor/state/input-dragger-click-lock.js.map +0 -1
  316. package/dist/editor/state/keybindings.d.ts.map +0 -1
  317. package/dist/editor/state/keybindings.js.map +0 -1
  318. package/dist/editor/state/loop.d.ts.map +0 -1
  319. package/dist/editor/state/loop.js.map +0 -1
  320. package/dist/editor/state/marks.d.ts.map +0 -1
  321. package/dist/editor/state/marks.js.map +0 -1
  322. package/dist/editor/state/modals.d.ts.map +0 -1
  323. package/dist/editor/state/modals.js.map +0 -1
  324. package/dist/editor/state/mute.d.ts.map +0 -1
  325. package/dist/editor/state/mute.js.map +0 -1
  326. package/dist/editor/state/playbackrate.d.ts.map +0 -1
  327. package/dist/editor/state/playbackrate.js.map +0 -1
  328. package/dist/editor/state/preview-size.d.ts.map +0 -1
  329. package/dist/editor/state/preview-size.js.map +0 -1
  330. package/dist/editor/state/render-frame.d.ts.map +0 -1
  331. package/dist/editor/state/render-frame.js.map +0 -1
  332. package/dist/editor/state/rich-timeline.d.ts.map +0 -1
  333. package/dist/editor/state/rich-timeline.js.map +0 -1
  334. package/dist/editor/state/timeline-ref.d.ts.map +0 -1
  335. package/dist/editor/state/timeline-ref.js.map +0 -1
  336. package/dist/editor/state/timeline.d.ts.map +0 -1
  337. package/dist/editor/state/timeline.js.map +0 -1
  338. package/dist/editor/state/z-index.d.ts.map +0 -1
  339. package/dist/editor/state/z-index.js.map +0 -1
  340. package/dist/get-cli-options.d.ts.map +0 -1
  341. package/dist/get-cli-options.js.map +0 -1
  342. package/dist/get-composition-id.d.ts.map +0 -1
  343. package/dist/get-composition-id.js.map +0 -1
  344. package/dist/get-config-file-name.d.ts.map +0 -1
  345. package/dist/get-config-file-name.js.map +0 -1
  346. package/dist/get-env.d.ts.map +0 -1
  347. package/dist/get-env.js.map +0 -1
  348. package/dist/get-filename.d.ts.map +0 -1
  349. package/dist/get-filename.js.map +0 -1
  350. package/dist/get-input-props.d.ts.map +0 -1
  351. package/dist/get-input-props.js.map +0 -1
  352. package/dist/handle-common-errors.d.ts.map +0 -1
  353. package/dist/handle-common-errors.js.map +0 -1
  354. package/dist/image-formats.d.ts.map +0 -1
  355. package/dist/image-formats.js.map +0 -1
  356. package/dist/index.d.ts.map +0 -1
  357. package/dist/index.js.map +0 -1
  358. package/dist/initialize-render-cli.d.ts.map +0 -1
  359. package/dist/initialize-render-cli.js.map +0 -1
  360. package/dist/is-javascript.d.ts.map +0 -1
  361. package/dist/is-javascript.js.map +0 -1
  362. package/dist/lambda-command.d.ts.map +0 -1
  363. package/dist/lambda-command.js.map +0 -1
  364. package/dist/load-config.d.ts.map +0 -1
  365. package/dist/load-config.js.map +0 -1
  366. package/dist/log.d.ts.map +0 -1
  367. package/dist/log.js.map +0 -1
  368. package/dist/make-progress-bar.d.ts.map +0 -1
  369. package/dist/make-progress-bar.js.map +0 -1
  370. package/dist/parse-command-line.d.ts.map +0 -1
  371. package/dist/parse-command-line.js.map +0 -1
  372. package/dist/preview.d.ts.map +0 -1
  373. package/dist/preview.js.map +0 -1
  374. package/dist/previewEntry.d.ts.map +0 -1
  375. package/dist/previewEntry.js.map +0 -1
  376. package/dist/print-error.d.ts.map +0 -1
  377. package/dist/print-error.js.map +0 -1
  378. package/dist/print-help.d.ts.map +0 -1
  379. package/dist/print-help.js.map +0 -1
  380. package/dist/progress-bar.d.ts.map +0 -1
  381. package/dist/progress-bar.js.map +0 -1
  382. package/dist/render.d.ts.map +0 -1
  383. package/dist/render.js.map +0 -1
  384. package/dist/resolve-from.d.ts.map +0 -1
  385. package/dist/resolve-from.js.map +0 -1
  386. package/dist/setup-cache.d.ts.map +0 -1
  387. package/dist/setup-cache.js.map +0 -1
  388. package/dist/step.d.ts.map +0 -1
  389. package/dist/step.js.map +0 -1
  390. package/dist/still.d.ts.map +0 -1
  391. package/dist/still.js.map +0 -1
  392. package/dist/upgrade.d.ts.map +0 -1
  393. package/dist/upgrade.js.map +0 -1
  394. package/dist/user-passed-output-location.d.ts.map +0 -1
  395. package/dist/user-passed-output-location.js.map +0 -1
  396. package/dist/validate-ffmpeg-version.d.ts.map +0 -1
  397. package/dist/validate-ffmpeg-version.js.map +0 -1
  398. package/dist/versions.d.ts.map +0 -1
  399. package/dist/versions.js.map +0 -1
  400. package/dist/warn-about-ffmpeg-version.d.ts.map +0 -1
  401. package/dist/warn-about-ffmpeg-version.js.map +0 -1
@@ -4,7 +4,9 @@ exports.OpenInEditor = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  /* eslint-disable no-console */
6
6
  const react_1 = require("react");
7
+ const use_keybinding_1 = require("../../../editor/helpers/use-keybinding");
7
8
  const Button_1 = require("./Button");
9
+ const ShortcutHint_1 = require("./ShortcutHint");
8
10
  const initialState = { type: 'idle' };
9
11
  const reducer = (state, action) => {
10
12
  if (action.type === 'start') {
@@ -29,9 +31,10 @@ const reducer = (state, action) => {
29
31
  }
30
32
  return state;
31
33
  };
32
- const OpenInEditor = ({ stack }) => {
34
+ const OpenInEditor = ({ stack, canHaveKeyboardShortcuts }) => {
33
35
  const isMounted = (0, react_1.useRef)(true);
34
36
  const [state, dispatch] = (0, react_1.useReducer)(reducer, initialState);
37
+ const { registerKeybinding } = (0, use_keybinding_1.useKeybinding)();
35
38
  const dispatchIfMounted = (0, react_1.useCallback)((payload) => {
36
39
  if (isMounted.current === false)
37
40
  return;
@@ -72,6 +75,21 @@ const OpenInEditor = ({ stack }) => {
72
75
  isMounted.current = false;
73
76
  };
74
77
  }, []);
78
+ (0, react_1.useEffect)(() => {
79
+ if (!canHaveKeyboardShortcuts) {
80
+ return;
81
+ }
82
+ const onEditor = () => {
83
+ openInBrowser();
84
+ };
85
+ const { unregister } = registerKeybinding({
86
+ event: 'keydown',
87
+ key: 'o',
88
+ callback: onEditor,
89
+ commandCtrlKey: true,
90
+ });
91
+ return () => unregister();
92
+ }, [canHaveKeyboardShortcuts, openInBrowser, registerKeybinding]);
75
93
  const label = (0, react_1.useMemo)(() => {
76
94
  switch (state.type) {
77
95
  case 'error':
@@ -86,6 +104,6 @@ const OpenInEditor = ({ stack }) => {
86
104
  throw new Error('invalid state');
87
105
  }
88
106
  }, [state.type]);
89
- return ((0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: openInBrowser, disabled: state.type !== 'idle', children: label }));
107
+ return ((0, jsx_runtime_1.jsxs)(Button_1.Button, { onClick: openInBrowser, disabled: state.type !== 'idle', children: [label, canHaveKeyboardShortcuts ? ((0, jsx_runtime_1.jsx)(ShortcutHint_1.ShortcutHint, { keyToPress: "o", cmdOrCtrl: true })) : null] }));
90
108
  };
91
109
  exports.OpenInEditor = OpenInEditor;
@@ -4,6 +4,7 @@ exports.Overlay = exports.setErrorsRef = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const remotion_1 = require("remotion");
7
+ const keybindings_1 = require("../../../editor/state/keybindings");
7
8
  const ErrorLoader_1 = require("./ErrorLoader");
8
9
  exports.setErrorsRef = (0, react_1.createRef)();
9
10
  const errorsAreTheSame = (first, second) => {
@@ -38,12 +39,12 @@ const Overlay = () => {
38
39
  if (errors.errors.length === 0) {
39
40
  return null;
40
41
  }
41
- return ((0, jsx_runtime_1.jsx)(remotion_1.AbsoluteFill, { style: {
42
- backgroundColor: BACKGROUND_COLOR,
43
- overflow: 'auto',
44
- color: 'white',
45
- }, children: errors.errors.map((err) => {
46
- return (0, jsx_runtime_1.jsx)(ErrorLoader_1.ErrorLoader, { error: err }, err.stack);
47
- }) }));
42
+ return ((0, jsx_runtime_1.jsx)(keybindings_1.KeybindingContextProvider, { children: (0, jsx_runtime_1.jsx)(remotion_1.AbsoluteFill, { style: {
43
+ backgroundColor: BACKGROUND_COLOR,
44
+ overflow: 'auto',
45
+ color: 'white',
46
+ }, children: errors.errors.map((err, i) => {
47
+ return ((0, jsx_runtime_1.jsx)(ErrorLoader_1.ErrorLoader, { keyboardShortcuts: i === 0, error: err }, err.stack));
48
+ }) }) }));
48
49
  };
49
50
  exports.Overlay = Overlay;
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
2
  export declare const SearchGithubIssues: React.FC<{
3
3
  message: string;
4
+ canHaveKeyboardShortcuts: boolean;
4
5
  }>;
@@ -3,11 +3,29 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SearchGithubIssues = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
+ const use_keybinding_1 = require("../../../editor/helpers/use-keybinding");
6
7
  const Button_1 = require("./Button");
7
- const SearchGithubIssues = ({ message }) => {
8
+ const ShortcutHint_1 = require("./ShortcutHint");
9
+ const SearchGithubIssues = ({ message, canHaveKeyboardShortcuts }) => {
8
10
  const openInBrowser = (0, react_1.useCallback)(() => {
9
11
  window.open(`https://github.com/remotion-dev/remotion/issues?q=${encodeURIComponent(message)}`, '_blank');
10
12
  }, [message]);
11
- return (0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: openInBrowser, children: "Search GitHub Issues" });
13
+ const { registerKeybinding } = (0, use_keybinding_1.useKeybinding)();
14
+ (0, react_1.useEffect)(() => {
15
+ if (!canHaveKeyboardShortcuts) {
16
+ return;
17
+ }
18
+ const onEditor = () => {
19
+ openInBrowser();
20
+ };
21
+ const { unregister } = registerKeybinding({
22
+ event: 'keydown',
23
+ key: 'g',
24
+ callback: onEditor,
25
+ commandCtrlKey: true,
26
+ });
27
+ return () => unregister();
28
+ }, [canHaveKeyboardShortcuts, openInBrowser, registerKeybinding]);
29
+ return ((0, jsx_runtime_1.jsxs)(Button_1.Button, { onClick: openInBrowser, children: ["Search GitHub Issues", ' ', canHaveKeyboardShortcuts ? ((0, jsx_runtime_1.jsx)(ShortcutHint_1.ShortcutHint, { keyToPress: "g", cmdOrCtrl: true })) : null] }));
12
30
  };
13
31
  exports.SearchGithubIssues = SearchGithubIssues;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ export declare const ShortcutHint: React.FC<{
3
+ keyToPress: string;
4
+ cmdOrCtrl: boolean;
5
+ }>;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ShortcutHint = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const cmdOrCtrlCharacter = window.navigator.platform.startsWith('Mac')
6
+ ? '⌘'
7
+ : 'Ctrl';
8
+ const container = {
9
+ display: 'inline-block',
10
+ marginLeft: 6,
11
+ opacity: 0.6,
12
+ };
13
+ const ShortcutHint = ({ keyToPress, cmdOrCtrl }) => {
14
+ return ((0, jsx_runtime_1.jsxs)("span", { style: container, children: [cmdOrCtrl ? `${cmdOrCtrlCharacter}+` : '', keyToPress.toUpperCase()] }));
15
+ };
16
+ exports.ShortcutHint = ShortcutHint;
@@ -41,7 +41,7 @@ const StackElement = ({ s, lineNumberWidth, isFirst, defaultFunctionName }) => {
41
41
  const toggleCodeFrame = (0, react_1.useCallback)(() => {
42
42
  setShowCodeFrame((f) => !f);
43
43
  }, []);
44
- return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { style: header, children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)("div", { style: fnName, children: (_a = s.originalFunctionName) !== null && _a !== void 0 ? _a : defaultFunctionName }), s.originalFileName ? ((0, jsx_runtime_1.jsxs)("div", { style: location, children: [(0, format_location_1.formatLocation)(s.originalFileName), ":", s.originalLineNumber] })) : null] }), s.originalScriptCode && s.originalScriptCode.length > 0 ? ((0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: toggleCodeFrame, children: showCodeFrame ? (0, jsx_runtime_1.jsx)(carets_1.CaretDown, {}) : (0, jsx_runtime_1.jsx)(carets_1.CaretRight, {}) })) : null] }), (0, jsx_runtime_1.jsx)("div", { children: s.originalScriptCode &&
44
+ return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { style: header, children: [(0, jsx_runtime_1.jsxs)("div", { style: left, children: [(0, jsx_runtime_1.jsx)("div", { style: fnName, children: (_a = s.originalFunctionName) !== null && _a !== void 0 ? _a : defaultFunctionName }), s.originalFileName ? ((0, jsx_runtime_1.jsxs)("div", { style: location, children: [(0, format_location_1.formatLocation)(s.originalFileName), ":", s.originalLineNumber] })) : null] }), s.originalScriptCode && s.originalScriptCode.length > 0 ? ((0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: toggleCodeFrame, children: showCodeFrame ? (0, jsx_runtime_1.jsx)(carets_1.CaretDown, { invert: false }) : (0, jsx_runtime_1.jsx)(carets_1.CaretRight, {}) })) : null] }), (0, jsx_runtime_1.jsx)("div", { children: s.originalScriptCode &&
45
45
  s.originalScriptCode.length > 0 &&
46
46
  showCodeFrame ? ((0, jsx_runtime_1.jsx)(CodeFrame_1.CodeFrame, { lineNumberWidth: lineNumberWidth, source: s.originalScriptCode })) : null })] }));
47
47
  };
@@ -1,3 +1,5 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  export declare const CaretRight: () => JSX.Element;
3
- export declare const CaretDown: () => JSX.Element;
3
+ export declare const CaretDown: React.FC<{
4
+ invert: boolean;
5
+ }>;
@@ -6,7 +6,7 @@ const CaretRight = () => {
6
6
  return ((0, jsx_runtime_1.jsx)("svg", { style: { height: 20 }, "aria-hidden": "true", focusable: "false", role: "img", viewBox: "0 0 192 512", children: (0, jsx_runtime_1.jsx)("path", { fill: "currentColor", d: "M0 384.662V127.338c0-17.818 21.543-26.741 34.142-14.142l128.662 128.662c7.81 7.81 7.81 20.474 0 28.284L34.142 398.804C21.543 411.404 0 402.48 0 384.662z" }) }));
7
7
  };
8
8
  exports.CaretRight = CaretRight;
9
- const CaretDown = () => {
10
- return ((0, jsx_runtime_1.jsx)("svg", { "aria-hidden": "true", focusable: "false", role: "img", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 320 512", style: { height: 20 }, children: (0, jsx_runtime_1.jsx)("path", { fill: "currentColor", d: "M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z" }) }));
9
+ const CaretDown = ({ invert }) => {
10
+ return ((0, jsx_runtime_1.jsx)("svg", { "aria-hidden": "true", focusable: "false", role: "img", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 320 512", style: { height: 20, transform: invert ? `rotate(180deg)` : '' }, children: (0, jsx_runtime_1.jsx)("path", { fill: "currentColor", d: "M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z" }) }));
11
11
  };
12
12
  exports.CaretDown = CaretDown;
@@ -0,0 +1,5 @@
1
+ export declare type THelpLink = {
2
+ url: string;
3
+ title: string;
4
+ };
5
+ export declare const getHelpLink: (message: string) => THelpLink | null;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getHelpLink = void 0;
4
+ const getHelpLink = (message) => {
5
+ if (message.includes('See https://www.remotion.dev/docs/the-fundamentals#defining-compositions')) {
6
+ return {
7
+ title: 'Defining compositions',
8
+ url: 'See https://www.remotion.dev/docs/the-fundamentals#defining-compositions',
9
+ };
10
+ }
11
+ if (message.includes('https://remotion.dev/docs/wrong-composition-mount')) {
12
+ return {
13
+ title: 'Wrongly mounted <Composition>',
14
+ url: 'https://remotion.dev/docs/wrong-composition-mount',
15
+ };
16
+ }
17
+ return null;
18
+ };
19
+ exports.getHelpLink = getHelpLink;
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Source code is adapted from https://github.com/WebHotelier/webpack-fast-refresh#readme and rewritten in Typescript. This file is MIT licensed.
3
+ */
4
+ /**
5
+ * MIT License
6
+ *
7
+ * Copyright (c) Facebook, Inc. and its affiliates.
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ * of this software and associated documentation files (the "Software"), to deal
11
+ * in the Software without restriction, including without limitation the rights
12
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ * copies of the Software, and to permit persons to whom the Software is
14
+ * furnished to do so, subject to the following conditions:
15
+ *
16
+ * The above copyright notice and this permission notice shall be included in all
17
+ * copies or substantial portions of the Software.
18
+ *
19
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
+ * SOFTWARE.
26
+ */
27
+ declare function registerExportsForReactRefresh(moduleExports: unknown, moduleID: unknown): void;
28
+ declare function isReactRefreshBoundary(moduleExports: unknown): boolean;
29
+ declare function shouldInvalidateReactRefreshBoundary(prevExports: unknown, nextExports: unknown): boolean;
30
+ declare function getRefreshBoundarySignature(moduleExports: unknown): any[];
31
+ declare function scheduleUpdate(): void;
32
+ declare const _default: {
33
+ registerExportsForReactRefresh: typeof registerExportsForReactRefresh;
34
+ isReactRefreshBoundary: typeof isReactRefreshBoundary;
35
+ shouldInvalidateReactRefreshBoundary: typeof shouldInvalidateReactRefreshBoundary;
36
+ getRefreshBoundarySignature: typeof getRefreshBoundarySignature;
37
+ scheduleUpdate: typeof scheduleUpdate;
38
+ };
39
+ export default _default;
@@ -0,0 +1,145 @@
1
+ "use strict";
2
+ /**
3
+ * Source code is adapted from https://github.com/WebHotelier/webpack-fast-refresh#readme and rewritten in Typescript. This file is MIT licensed.
4
+ */
5
+ /**
6
+ * MIT License
7
+ *
8
+ * Copyright (c) Facebook, Inc. and its affiliates.
9
+ *
10
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ * of this software and associated documentation files (the "Software"), to deal
12
+ * in the Software without restriction, including without limitation the rights
13
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ * copies of the Software, and to permit persons to whom the Software is
15
+ * furnished to do so, subject to the following conditions:
16
+ *
17
+ * The above copyright notice and this permission notice shall be included in all
18
+ * copies or substantial portions of the Software.
19
+ *
20
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ * SOFTWARE.
27
+ */
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ // This file is copied from the Metro JavaScript bundler, with minor tweaks for
30
+ // webpack compatibility.
31
+ //
32
+ // https://github.com/facebook/metro/blob/d6b9685c730d0d63577db40f41369157f28dfa3a/packages/metro/src/lib/polyfills/require.js
33
+ const RefreshRuntime = require('react-refresh/runtime');
34
+ function isSafeExport(key) {
35
+ return (key === '__esModule' ||
36
+ key === '__N_SSG' ||
37
+ key === '__N_SSP' ||
38
+ key === 'config');
39
+ }
40
+ function registerExportsForReactRefresh(moduleExports, moduleID) {
41
+ RefreshRuntime.register(moduleExports, moduleID + ' %exports%');
42
+ if (moduleExports === null ||
43
+ moduleExports === undefined ||
44
+ typeof moduleExports !== 'object') {
45
+ // Exit if we can't iterate over exports.
46
+ // (This is important for legacy environments.)
47
+ return;
48
+ }
49
+ for (const key in moduleExports) {
50
+ if (isSafeExport(key)) {
51
+ continue;
52
+ }
53
+ // @ts-expect-error
54
+ const exportValue = moduleExports[key];
55
+ const typeID = moduleID + ' %exports% ' + key;
56
+ RefreshRuntime.register(exportValue, typeID);
57
+ }
58
+ }
59
+ function isReactRefreshBoundary(moduleExports) {
60
+ if (RefreshRuntime.isLikelyComponentType(moduleExports)) {
61
+ return true;
62
+ }
63
+ if (moduleExports === null ||
64
+ moduleExports === undefined ||
65
+ typeof moduleExports !== 'object') {
66
+ // Exit if we can't iterate over exports.
67
+ return false;
68
+ }
69
+ let hasExports = false;
70
+ let areAllExportsComponents = true;
71
+ for (const key in moduleExports) {
72
+ hasExports = true;
73
+ if (isSafeExport(key)) {
74
+ continue;
75
+ }
76
+ // @ts-expect-error
77
+ const exportValue = moduleExports[key];
78
+ if (!RefreshRuntime.isLikelyComponentType(exportValue)) {
79
+ areAllExportsComponents = false;
80
+ }
81
+ }
82
+ return hasExports && areAllExportsComponents;
83
+ }
84
+ function shouldInvalidateReactRefreshBoundary(prevExports, nextExports) {
85
+ const prevSignature = getRefreshBoundarySignature(prevExports);
86
+ const nextSignature = getRefreshBoundarySignature(nextExports);
87
+ if (prevSignature.length !== nextSignature.length) {
88
+ return true;
89
+ }
90
+ for (let i = 0; i < nextSignature.length; i++) {
91
+ if (prevSignature[i] !== nextSignature[i]) {
92
+ return true;
93
+ }
94
+ }
95
+ return false;
96
+ }
97
+ function getRefreshBoundarySignature(moduleExports) {
98
+ const signature = [];
99
+ signature.push(RefreshRuntime.getFamilyByType(moduleExports));
100
+ if (moduleExports === null ||
101
+ moduleExports === undefined ||
102
+ typeof moduleExports !== 'object') {
103
+ // Exit if we can't iterate over exports.
104
+ // (This is important for legacy environments.)
105
+ return signature;
106
+ }
107
+ for (const key in moduleExports) {
108
+ if (isSafeExport(key)) {
109
+ continue;
110
+ }
111
+ // @ts-expect-error
112
+ const exportValue = moduleExports[key];
113
+ signature.push(key);
114
+ signature.push(RefreshRuntime.getFamilyByType(exportValue));
115
+ }
116
+ return signature;
117
+ }
118
+ function scheduleUpdate() {
119
+ var _a, _b;
120
+ const execute = () => {
121
+ try {
122
+ RefreshRuntime.performReactRefresh();
123
+ }
124
+ catch (err) {
125
+ console.warn('Warning: Failed to re-render. We will retry on the next Fast Refresh event.\n' +
126
+ err);
127
+ }
128
+ };
129
+ // Only trigger refresh if the webpack HMR state is idle
130
+ if (((_a = module.hot) === null || _a === void 0 ? void 0 : _a.status()) === 'idle') {
131
+ return;
132
+ }
133
+ (_b = module.hot) === null || _b === void 0 ? void 0 : _b.addStatusHandler((status) => {
134
+ if (status === 'idle') {
135
+ execute();
136
+ }
137
+ });
138
+ }
139
+ exports.default = {
140
+ registerExportsForReactRefresh,
141
+ isReactRefreshBoundary,
142
+ shouldInvalidateReactRefreshBoundary,
143
+ getRefreshBoundarySignature,
144
+ scheduleUpdate,
145
+ };
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Source code is adapted from https://github.com/WebHotelier/webpack-fast-refresh#readme and rewritten in Typescript. This file is MIT licensed.
3
+ */
4
+ /**
5
+ * The MIT License (MIT)
6
+ *
7
+ * Copyright (c) 2020 Vercel, Inc.
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ * of this software and associated documentation files (the "Software"), to deal
11
+ * in the Software without restriction, including without limitation the rights
12
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ * copies of the Software, and to permit persons to whom the Software is
14
+ * furnished to do so, subject to the following conditions:
15
+ *
16
+ * The above copyright notice and this permission notice shall be included in all
17
+ * copies or substantial portions of the Software.
18
+ *
19
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
+ * SOFTWARE.
26
+ */
27
+ import webpack from 'webpack';
28
+ export declare class ReactFreshWebpackPlugin {
29
+ apply(compiler: webpack.Compiler): void;
30
+ }
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+ /**
3
+ * Source code is adapted from https://github.com/WebHotelier/webpack-fast-refresh#readme and rewritten in Typescript. This file is MIT licensed.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.ReactFreshWebpackPlugin = void 0;
7
+ /**
8
+ * The MIT License (MIT)
9
+ *
10
+ * Copyright (c) 2020 Vercel, Inc.
11
+ *
12
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ * of this software and associated documentation files (the "Software"), to deal
14
+ * in the Software without restriction, including without limitation the rights
15
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ * copies of the Software, and to permit persons to whom the Software is
17
+ * furnished to do so, subject to the following conditions:
18
+ *
19
+ * The above copyright notice and this permission notice shall be included in all
20
+ * copies or substantial portions of the Software.
21
+ *
22
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ * SOFTWARE.
29
+ */
30
+ // This file is copied from the @vercel/next.js, with removed TS annotations
31
+ // minor tweaks, and removed all webpack v4-related functionality
32
+ //
33
+ // https://github.com/vercel/next.js/blob/canary/packages/react-refresh-utils/ReactRefreshWebpackPlugin.ts
34
+ const webpack_1 = require("webpack");
35
+ class ReactRefreshRuntimeModule extends webpack_1.RuntimeModule {
36
+ constructor() {
37
+ super('react refresh', 5);
38
+ }
39
+ generate() {
40
+ const { runtimeTemplate } = this.compilation;
41
+ return webpack_1.Template.asString([
42
+ `${webpack_1.RuntimeGlobals.interceptModuleExecution}.push(${runtimeTemplate.basicFunction('options', [
43
+ `const originalFactory = options.factory;`,
44
+ `options.factory = ${runtimeTemplate.basicFunction('moduleObject, moduleExports, webpackRequire', [
45
+ // Legacy CSS implementations will `eval` browser code in a Node.js
46
+ // context to extract CSS. For backwards compatibility, we need to check
47
+ // we're in a browser context before continuing.
48
+ `const hasRefresh = typeof self !== "undefined" && !!self.$RefreshInterceptModuleExecution$;`,
49
+ `const cleanup = hasRefresh ? self.$RefreshInterceptModuleExecution$(moduleObject.id) : () => {};`,
50
+ 'try {',
51
+ webpack_1.Template.indent('originalFactory.call(this, moduleObject, moduleExports, webpackRequire);'),
52
+ '} finally {',
53
+ webpack_1.Template.indent(`cleanup();`),
54
+ '}',
55
+ ])}`,
56
+ ])})`,
57
+ ]);
58
+ }
59
+ }
60
+ class ReactFreshWebpackPlugin {
61
+ apply(compiler) {
62
+ const webpackMajorVersion = parseInt(webpack_1.version !== null && webpack_1.version !== void 0 ? webpack_1.version : '', 10);
63
+ if (webpackMajorVersion < 5) {
64
+ throw new Error(`ReactFreshWebpackPlugin does not support webpack v${webpackMajorVersion}.`);
65
+ }
66
+ compiler.hooks.compilation.tap(this.constructor.name, (compilation) => {
67
+ compilation.mainTemplate.hooks.localVars.tap(this.constructor.name, (source) => webpack_1.Template.asString([
68
+ source,
69
+ '',
70
+ '// noop fns to prevent runtime errors during initialization',
71
+ 'if (typeof self !== "undefined") {',
72
+ webpack_1.Template.indent('self.$RefreshReg$ = function () {};'),
73
+ webpack_1.Template.indent('self.$RefreshSig$ = function () {'),
74
+ webpack_1.Template.indent(webpack_1.Template.indent('return function (type) {')),
75
+ webpack_1.Template.indent(webpack_1.Template.indent(webpack_1.Template.indent('return type;'))),
76
+ webpack_1.Template.indent(webpack_1.Template.indent('};')),
77
+ webpack_1.Template.indent('};'),
78
+ '}',
79
+ ]));
80
+ compilation.hooks.additionalTreeRuntimeRequirements.tap(this.constructor.name, (chunk) => {
81
+ compilation.addRuntimeModule(chunk, new ReactRefreshRuntimeModule());
82
+ });
83
+ });
84
+ }
85
+ }
86
+ exports.ReactFreshWebpackPlugin = ReactFreshWebpackPlugin;
@@ -0,0 +1,35 @@
1
+ /**
2
+ * ⚠️ Be careful when refactoring this file!
3
+ * This gets injected into every file of the browser.
4
+ * You cannot have returns, optional chains, inverse the if statement etc.
5
+ * Check the Typescript output in dist/ to see that no extra `var` statements were produced
6
+ */
7
+ /**
8
+ * Source code is adapted from https://github.com/WebHotelier/webpack-fast-refresh#readme and rewritten in Typescript. This file is MIT licensed.
9
+ */
10
+ /**
11
+ * The MIT License (MIT)
12
+ *
13
+ * Copyright (c) 2020 Vercel, Inc.
14
+ *
15
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
16
+ * of this software and associated documentation files (the "Software"), to deal
17
+ * in the Software without restriction, including without limitation the rights
18
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
19
+ * copies of the Software, and to permit persons to whom the Software is
20
+ * furnished to do so, subject to the following conditions:
21
+ *
22
+ * The above copyright notice and this permission notice shall be included in all
23
+ * copies or substantial portions of the Software.
24
+ *
25
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
26
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
30
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31
+ * SOFTWARE.
32
+ */
33
+ import { LoaderDefinition } from 'webpack';
34
+ declare const ReactRefreshLoader: LoaderDefinition;
35
+ export default ReactRefreshLoader;
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ /**
3
+ * ⚠️ Be careful when refactoring this file!
4
+ * This gets injected into every file of the browser.
5
+ * You cannot have returns, optional chains, inverse the if statement etc.
6
+ * Check the Typescript output in dist/ to see that no extra `var` statements were produced
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ // This file is copied from the @vercel/next.js, with removed TS annotations
10
+ //
11
+ // https://github.com/vercel/next.js/blob/canary/packages/react-refresh-utils/loader.ts
12
+ // This function gets unwrapped into global scope, which is why we don't invert
13
+ // if-blocks. Also, you cannot use `return`.
14
+ function RefreshModuleRuntime() {
15
+ // Legacy CSS implementations will `eval` browser code in a Node.js context
16
+ // to extract CSS. For backwards compatibility, we need to check we're in a
17
+ // browser context before continuing.
18
+ if (typeof self !== 'undefined' &&
19
+ // AMP / No-JS mode does not inject these helpers:
20
+ '$RefreshHelpers$' in self) {
21
+ // @ts-expect-error
22
+ // eslint-disable-next-line no-proto
23
+ const currentExports = module.__proto__.exports;
24
+ let prevExports = null;
25
+ // eslint-disable-next-line @typescript-eslint/prefer-optional-chain
26
+ if (module.hot && module.hot.data && module.hot.data.prevExports) {
27
+ prevExports = module.hot.data.prevExports;
28
+ }
29
+ // This cannot happen in MainTemplate because the exports mismatch between
30
+ // templating and execution.
31
+ self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);
32
+ // A module can be accepted automatically based on its exports, e.g. when
33
+ // it is a Refresh Boundary.
34
+ if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {
35
+ // Save the previous exports on update so we can compare the boundary
36
+ // signatures.
37
+ module.hot.dispose((data) => {
38
+ data.prevExports = currentExports;
39
+ });
40
+ // Unconditionally accept an update to this module, we'll check if it's
41
+ // still a Refresh Boundary later.
42
+ module.hot.accept();
43
+ // This field is set when the previous version of this module was a
44
+ // Refresh Boundary, letting us know we need to check for invalidation or
45
+ // enqueue an update.
46
+ if (prevExports !== null) {
47
+ // A boundary can become ineligible if its exports are incompatible
48
+ // with the previous exports.
49
+ //
50
+ // For example, if you add/remove/change exports, we'll want to
51
+ // re-execute the importing modules, and force those components to
52
+ // re-render. Similarly, if you convert a class component to a
53
+ // function, we want to invalidate the boundary.
54
+ if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {
55
+ // @ts-expect-error
56
+ module.hot.invalidate();
57
+ }
58
+ else {
59
+ self.$RefreshHelpers$.scheduleUpdate();
60
+ }
61
+ }
62
+ }
63
+ else {
64
+ // Since we just executed the code for the module, it's possible that the
65
+ // new exports made it ineligible for being a boundary.
66
+ // We only care about the case when we were _previously_ a boundary,
67
+ // because we already accepted this update (accidental side effect).
68
+ const isNoLongerABoundary = prevExports !== null;
69
+ if (isNoLongerABoundary) {
70
+ // @ts-expect-error
71
+ module.hot.invalidate();
72
+ }
73
+ }
74
+ }
75
+ }
76
+ let refreshModuleRuntime = RefreshModuleRuntime.toString();
77
+ refreshModuleRuntime = refreshModuleRuntime.slice(refreshModuleRuntime.indexOf('{') + 1, refreshModuleRuntime.lastIndexOf('}'));
78
+ const ReactRefreshLoader = function (source, inputSourceMap) {
79
+ this.callback(null, `${source}\n\n;${refreshModuleRuntime}`, inputSourceMap);
80
+ };
81
+ exports.default = ReactRefreshLoader;