@remotion/cli 4.0.0-alpha.217 → 4.0.0-alpha10

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 (273) hide show
  1. package/dist/benchmark.js +11 -6
  2. package/dist/better-opn/index.js +3 -3
  3. package/dist/chalk/index.d.ts +45 -54
  4. package/dist/chalk/index.js +2 -135
  5. package/dist/codemods/stringify-with-path.d.ts +5 -0
  6. package/dist/codemods/stringify-with-path.js +44 -0
  7. package/dist/codemods/update-default-props.d.ts +4 -2
  8. package/dist/codemods/update-default-props.js +3 -18
  9. package/dist/color-math.d.ts +2 -2
  10. package/dist/color-math.js +5 -3
  11. package/dist/compositions.js +1 -0
  12. package/dist/config/image-format.d.ts +1 -1
  13. package/dist/config/index.d.ts +2 -2
  14. package/dist/config/log.d.ts +1 -3
  15. package/dist/config/log.js +2 -9
  16. package/dist/convert-entry-point-to-serve-url.js +2 -2
  17. package/dist/download-progress.d.ts +1 -1
  18. package/dist/download-progress.js +1 -4
  19. package/dist/editor/components/CanvasOrLoading.d.ts +5 -0
  20. package/dist/editor/components/CanvasOrLoading.js +66 -0
  21. package/dist/editor/components/CheckboardToggle.js +2 -1
  22. package/dist/editor/components/CompositionSelectorItem.js +2 -2
  23. package/dist/editor/components/CurrentCompositionSideEffects.js +3 -3
  24. package/dist/editor/components/InitialCompositionLoader.js +1 -1
  25. package/dist/editor/components/InlineAction.d.ts +6 -4
  26. package/dist/editor/components/InlineAction.js +7 -8
  27. package/dist/editor/components/LoopToggle.js +2 -1
  28. package/dist/editor/components/Menu/MenuItem.js +1 -1
  29. package/dist/editor/components/Menu/SubMenu.js +1 -1
  30. package/dist/editor/components/Menu/styles.d.ts +1 -0
  31. package/dist/editor/components/Menu/styles.js +6 -1
  32. package/dist/editor/components/MenuBuildIndicator.js +20 -1
  33. package/dist/editor/components/MenuToolbar.js +15 -3
  34. package/dist/editor/components/Modals.js +2 -2
  35. package/dist/editor/components/NewComposition/ComboBox.js +20 -5
  36. package/dist/editor/components/NewComposition/InputDragger.js +3 -2
  37. package/dist/editor/components/NewComposition/MenuContent.d.ts +1 -0
  38. package/dist/editor/components/NewComposition/MenuContent.js +12 -4
  39. package/dist/editor/components/Notifications/ServerDisconnected.js +2 -2
  40. package/dist/editor/components/OpenEditorButton.d.ts +2 -0
  41. package/dist/editor/components/OpenEditorButton.js +52 -0
  42. package/dist/editor/components/PlayPause.js +4 -2
  43. package/dist/editor/components/PreviewToolbar.js +2 -2
  44. package/dist/editor/components/QuickSwitcher/algolia-search.js +1 -1
  45. package/dist/editor/components/RenderButton.d.ts +1 -5
  46. package/dist/editor/components/RenderButton.js +48 -21
  47. package/dist/editor/components/RenderModal/CliCopyButton.js +51 -14
  48. package/dist/editor/components/RenderModal/CrfSetting.d.ts +0 -1
  49. package/dist/editor/components/RenderModal/CrfSetting.js +0 -1
  50. package/dist/editor/components/RenderModal/DataEditor.d.ts +21 -0
  51. package/dist/editor/components/RenderModal/DataEditor.js +287 -0
  52. package/dist/editor/components/RenderModal/EnforceAudioTrackSetting.js +3 -2
  53. package/dist/editor/components/RenderModal/InfoBubble.js +2 -1
  54. package/dist/editor/components/RenderModal/InfoTooltip.d.ts +1 -0
  55. package/dist/editor/components/RenderModal/InfoTooltip.js +6 -5
  56. package/dist/editor/components/RenderModal/InlineEyeIcon.js +6 -3
  57. package/dist/editor/components/RenderModal/InlineRemoveButton.js +6 -1
  58. package/dist/editor/components/RenderModal/MutedSetting.js +3 -2
  59. package/dist/editor/components/RenderModal/OptionExplainer.js +14 -3
  60. package/dist/editor/components/RenderModal/RenderModal.d.ts +7 -3
  61. package/dist/editor/components/RenderModal/RenderModal.js +108 -49
  62. package/dist/editor/components/RenderModal/RenderModalAdvanced.js +0 -2
  63. package/dist/editor/components/RenderModal/RenderModalAudio.js +1 -1
  64. package/dist/editor/components/RenderModal/RenderModalBasic.d.ts +3 -2
  65. package/dist/editor/components/RenderModal/RenderModalBasic.js +4 -3
  66. package/dist/editor/components/RenderModal/RenderModalData.d.ts +16 -4
  67. package/dist/editor/components/RenderModal/RenderModalData.js +109 -42
  68. package/dist/editor/components/RenderModal/RenderModalJSONPropsEditor.d.ts +14 -0
  69. package/dist/editor/components/RenderModal/{RenderModalJSONInputPropsEditor.js → RenderModalJSONPropsEditor.js} +51 -30
  70. package/dist/editor/components/RenderModal/RenderModalPicture.d.ts +2 -2
  71. package/dist/editor/components/RenderModal/RenderModalPicture.js +2 -4
  72. package/dist/editor/components/RenderModal/SchemaEditor/SchemaEditor.d.ts +6 -4
  73. package/dist/editor/components/RenderModal/SchemaEditor/SchemaEditor.js +4 -4
  74. package/dist/editor/components/RenderModal/SchemaEditor/SchemaErrorMessages.d.ts +4 -0
  75. package/dist/editor/components/RenderModal/SchemaEditor/SchemaErrorMessages.js +15 -6
  76. package/dist/editor/components/RenderModal/SchemaEditor/SchemaLabel.d.ts +5 -0
  77. package/dist/editor/components/RenderModal/SchemaEditor/SchemaLabel.js +5 -4
  78. package/dist/editor/components/RenderModal/SchemaEditor/SchemaResetButton.js +6 -1
  79. package/dist/editor/components/RenderModal/SchemaEditor/SchemaSaveButton.d.ts +1 -0
  80. package/dist/editor/components/RenderModal/SchemaEditor/SchemaSaveButton.js +7 -2
  81. package/dist/editor/components/RenderModal/SchemaEditor/ZodArrayEditor.d.ts +5 -2
  82. package/dist/editor/components/RenderModal/SchemaEditor/ZodArrayEditor.js +19 -29
  83. package/dist/editor/components/RenderModal/SchemaEditor/ZodArrayItemEditor.d.ts +5 -2
  84. package/dist/editor/components/RenderModal/SchemaEditor/ZodArrayItemEditor.js +4 -4
  85. package/dist/editor/components/RenderModal/SchemaEditor/ZodBooleanEditor.d.ts +5 -2
  86. package/dist/editor/components/RenderModal/SchemaEditor/ZodBooleanEditor.js +7 -7
  87. package/dist/editor/components/RenderModal/SchemaEditor/ZodColorEditor.d.ts +5 -2
  88. package/dist/editor/components/RenderModal/SchemaEditor/ZodColorEditor.js +23 -66
  89. package/dist/editor/components/RenderModal/SchemaEditor/ZodDateEditor.d.ts +5 -2
  90. package/dist/editor/components/RenderModal/SchemaEditor/ZodDateEditor.js +13 -21
  91. package/dist/editor/components/RenderModal/SchemaEditor/ZodDefaultEditor.d.ts +17 -0
  92. package/dist/editor/components/RenderModal/SchemaEditor/ZodDefaultEditor.js +10 -0
  93. package/dist/editor/components/RenderModal/SchemaEditor/ZodEffectEditor.d.ts +4 -2
  94. package/dist/editor/components/RenderModal/SchemaEditor/ZodEffectEditor.js +20 -19
  95. package/dist/editor/components/RenderModal/SchemaEditor/ZodEnumEditor.d.ts +4 -2
  96. package/dist/editor/components/RenderModal/SchemaEditor/ZodEnumEditor.js +12 -26
  97. package/dist/editor/components/RenderModal/SchemaEditor/ZodNonEditableValue.d.ts +1 -0
  98. package/dist/editor/components/RenderModal/SchemaEditor/ZodNonEditableValue.js +2 -2
  99. package/dist/editor/components/RenderModal/SchemaEditor/ZodNullableEditor.d.ts +5 -2
  100. package/dist/editor/components/RenderModal/SchemaEditor/ZodNullableEditor.js +2 -2
  101. package/dist/editor/components/RenderModal/SchemaEditor/ZodNumberEditor.d.ts +5 -2
  102. package/dist/editor/components/RenderModal/SchemaEditor/ZodNumberEditor.js +16 -32
  103. package/dist/editor/components/RenderModal/SchemaEditor/ZodObjectEditor.d.ts +7 -4
  104. package/dist/editor/components/RenderModal/SchemaEditor/ZodObjectEditor.js +18 -11
  105. package/dist/editor/components/RenderModal/SchemaEditor/ZodOptionalEditor.d.ts +5 -2
  106. package/dist/editor/components/RenderModal/SchemaEditor/ZodOptionalEditor.js +2 -2
  107. package/dist/editor/components/RenderModal/SchemaEditor/ZodOrNullishEditor.d.ts +5 -2
  108. package/dist/editor/components/RenderModal/SchemaEditor/ZodOrNullishEditor.js +44 -11
  109. package/dist/editor/components/RenderModal/SchemaEditor/ZodStaticFileEditor.d.ts +17 -0
  110. package/dist/editor/components/RenderModal/SchemaEditor/ZodStaticFileEditor.js +59 -0
  111. package/dist/editor/components/RenderModal/SchemaEditor/ZodStringEditor.d.ts +5 -2
  112. package/dist/editor/components/RenderModal/SchemaEditor/ZodStringEditor.js +12 -23
  113. package/dist/editor/components/RenderModal/SchemaEditor/ZodSwitch.d.ts +5 -2
  114. package/dist/editor/components/RenderModal/SchemaEditor/ZodSwitch.js +32 -21
  115. package/dist/editor/components/RenderModal/SchemaEditor/ZodUnionEditor.d.ts +5 -2
  116. package/dist/editor/components/RenderModal/SchemaEditor/ZodUnionEditor.js +6 -6
  117. package/dist/editor/components/RenderModal/SchemaEditor/create-zod-values.d.ts +2 -2
  118. package/dist/editor/components/RenderModal/SchemaEditor/create-zod-values.js +22 -22
  119. package/dist/editor/components/RenderModal/SchemaEditor/deep-equal.d.ts +1 -0
  120. package/dist/editor/components/RenderModal/SchemaEditor/deep-equal.js +27 -0
  121. package/dist/editor/components/RenderModal/SchemaEditor/extract-enum-json-paths.d.ts +3 -0
  122. package/dist/editor/components/RenderModal/SchemaEditor/extract-enum-json-paths.js +126 -0
  123. package/dist/editor/components/RenderModal/SchemaEditor/input-props-serialization.d.ts +14 -0
  124. package/dist/editor/components/RenderModal/SchemaEditor/input-props-serialization.js +42 -0
  125. package/dist/editor/components/RenderModal/SchemaEditor/local-state.d.ts +16 -0
  126. package/dist/editor/components/RenderModal/SchemaEditor/local-state.js +38 -0
  127. package/dist/editor/components/RenderModal/get-render-modal-warnings.d.ts +9 -1
  128. package/dist/editor/components/RenderModal/get-render-modal-warnings.js +42 -8
  129. package/dist/editor/components/RenderModal/human-readable-codec.d.ts +1 -1
  130. package/dist/editor/components/RenderModal/layout.js +3 -0
  131. package/dist/editor/components/RenderModal/out-name-checker.js +1 -11
  132. package/dist/editor/components/RenderQueue/RenderQueueItemCancelButton.js +5 -1
  133. package/dist/editor/components/RenderQueue/RenderQueueOpenInFolder.js +5 -1
  134. package/dist/editor/components/RenderQueue/RenderQueueRemoveItem.js +5 -1
  135. package/dist/editor/components/RenderQueue/RenderQueueRepeat.js +5 -1
  136. package/dist/editor/components/RenderQueue/actions.d.ts +4 -3
  137. package/dist/editor/components/RenderQueue/actions.js +8 -3
  138. package/dist/editor/components/RenderQueue/index.js +9 -2
  139. package/dist/editor/components/RightPanel.js +8 -5
  140. package/dist/editor/components/SidebarCollapserControls.js +22 -9
  141. package/dist/editor/components/SidebarRenderButton.d.ts +6 -0
  142. package/dist/editor/components/{RenderToolbarIcon.js → SidebarRenderButton.js} +27 -41
  143. package/dist/editor/components/Spinner.d.ts +5 -0
  144. package/dist/editor/components/Spinner.js +41 -0
  145. package/dist/editor/components/Tabs/index.js +12 -14
  146. package/dist/editor/components/Timeline/Timeline.js +3 -1
  147. package/dist/editor/components/Timeline/TimelinePlayCursorSyncer.js +4 -3
  148. package/dist/editor/components/Timeline/TimelineSequence.js +8 -6
  149. package/dist/editor/components/TimelineInOutToggle.js +2 -4
  150. package/dist/editor/components/TopPanel.js +2 -2
  151. package/dist/editor/components/UpdateCheck.js +2 -1
  152. package/dist/editor/components/get-zod-if-possible.d.ts +3 -3
  153. package/dist/editor/components/get-zod-if-possible.js +11 -11
  154. package/dist/editor/helpers/calculate-timeline.js +1 -1
  155. package/dist/editor/helpers/client-id.d.ts +2 -2
  156. package/dist/editor/helpers/client-id.js +5 -5
  157. package/dist/editor/helpers/colors.d.ts +4 -2
  158. package/dist/editor/helpers/colors.js +4 -2
  159. package/dist/editor/helpers/get-timeline-sequence-layout.d.ts +2 -2
  160. package/dist/editor/helpers/is-composition-still.d.ts +3 -2
  161. package/dist/editor/helpers/is-current-selected-still.js +3 -4
  162. package/dist/editor/helpers/use-file-existence.js +1 -1
  163. package/dist/editor/helpers/use-menu-structure.js +1 -1
  164. package/dist/editor/icons/media-volume.js +2 -1
  165. package/dist/editor/icons/render.d.ts +1 -0
  166. package/dist/editor/icons/render.js +1 -1
  167. package/dist/editor/state/modals.d.ts +3 -1
  168. package/dist/entry-point.js +17 -17
  169. package/dist/event-source-events.d.ts +2 -0
  170. package/dist/event-source.js +2 -2
  171. package/dist/ffmpeg.js +14 -5
  172. package/dist/file-watcher.js +5 -5
  173. package/dist/get-cli-options.d.ts +3 -3
  174. package/dist/get-cli-options.js +4 -4
  175. package/dist/get-composition-id.d.ts +14 -2
  176. package/dist/get-composition-id.js +32 -8
  177. package/dist/get-composition-with-dimension-override.d.ts +13 -2
  178. package/dist/get-composition-with-dimension-override.js +12 -2
  179. package/dist/get-config-file-name.js +6 -6
  180. package/dist/get-env.js +10 -10
  181. package/dist/get-filename.js +1 -0
  182. package/dist/get-input-props.d.ts +1 -1
  183. package/dist/get-input-props.js +9 -9
  184. package/dist/get-network-address.js +2 -2
  185. package/dist/handle-common-errors.d.ts +2 -1
  186. package/dist/handle-common-errors.js +2 -2
  187. package/dist/index.d.ts +41 -19
  188. package/dist/index.js +9 -6
  189. package/dist/list-of-remotion-packages.js +2 -1
  190. package/dist/load-config.js +8 -8
  191. package/dist/log.d.ts +5 -5
  192. package/dist/log.js +3 -42
  193. package/dist/parse-command-line.d.ts +1 -0
  194. package/dist/preview-server/api-types.d.ts +3 -3
  195. package/dist/preview-server/dev-middleware/compatible-api.d.ts +2 -2
  196. package/dist/preview-server/dev-middleware/middleware.d.ts +1 -1
  197. package/dist/preview-server/dev-middleware/middleware.js +7 -7
  198. package/dist/preview-server/dev-middleware/range-parser.d.ts +1 -1
  199. package/dist/preview-server/dev-middleware/setup-hooks.js +2 -2
  200. package/dist/preview-server/error-overlay/react-overlay/utils/get-file-source.js +5 -5
  201. package/dist/preview-server/error-overlay/react-overlay/utils/open-in-editor.js +17 -17
  202. package/dist/preview-server/error-overlay/remotion-overlay/CalculateMetadataErrorExplainer.d.ts +2 -0
  203. package/dist/preview-server/error-overlay/remotion-overlay/CalculateMetadataErrorExplainer.js +18 -0
  204. package/dist/preview-server/error-overlay/remotion-overlay/CodeFrame.js +30 -12
  205. package/dist/preview-server/error-overlay/remotion-overlay/ErrorDisplay.d.ts +4 -0
  206. package/dist/preview-server/error-overlay/remotion-overlay/ErrorDisplay.js +5 -2
  207. package/dist/preview-server/error-overlay/remotion-overlay/ErrorLoader.d.ts +4 -0
  208. package/dist/preview-server/error-overlay/remotion-overlay/ErrorLoader.js +5 -5
  209. package/dist/preview-server/error-overlay/remotion-overlay/ErrorTitle.d.ts +1 -0
  210. package/dist/preview-server/error-overlay/remotion-overlay/ErrorTitle.js +4 -3
  211. package/dist/preview-server/error-overlay/remotion-overlay/HelpLink.js +2 -1
  212. package/dist/preview-server/error-overlay/remotion-overlay/Overlay.js +1 -1
  213. package/dist/preview-server/error-overlay/remotion-overlay/Retry.d.ts +4 -0
  214. package/dist/preview-server/error-overlay/remotion-overlay/Retry.js +9 -0
  215. package/dist/preview-server/file-existence-watchers.js +3 -3
  216. package/dist/preview-server/get-absolute-public-dir.js +3 -3
  217. package/dist/preview-server/get-package-manager.js +3 -3
  218. package/dist/preview-server/handler.d.ts +1 -1
  219. package/dist/preview-server/hot-middleware/index.d.ts +1 -1
  220. package/dist/preview-server/hot-middleware/index.js +2 -2
  221. package/dist/preview-server/live-events.d.ts +1 -1
  222. package/dist/preview-server/parse-body.d.ts +1 -1
  223. package/dist/preview-server/project-info.js +5 -5
  224. package/dist/preview-server/public-folder.js +8 -8
  225. package/dist/preview-server/render-queue/job.d.ts +11 -2
  226. package/dist/preview-server/render-queue/make-retry-payload.js +5 -1
  227. package/dist/preview-server/render-queue/open-directory-in-finder.js +8 -8
  228. package/dist/preview-server/render-queue/process-still.js +1 -0
  229. package/dist/preview-server/render-queue/queue.js +4 -4
  230. package/dist/preview-server/routes/can-update-default-props.js +3 -2
  231. package/dist/preview-server/routes/update-default-props.d.ts +2 -2
  232. package/dist/preview-server/routes/update-default-props.js +26 -15
  233. package/dist/preview-server/routes.d.ts +3 -2
  234. package/dist/preview-server/routes.js +10 -10
  235. package/dist/preview-server/serve-static.d.ts +1 -1
  236. package/dist/preview-server/serve-static.js +7 -7
  237. package/dist/preview-server/start-server.js +3 -3
  238. package/dist/preview.js +6 -4
  239. package/dist/print-error.d.ts +2 -1
  240. package/dist/print-error.js +8 -5
  241. package/dist/print-help.js +1 -1
  242. package/dist/progress-bar.d.ts +5 -4
  243. package/dist/progress-bar.js +42 -29
  244. package/dist/render-flows/render.d.ts +1 -1
  245. package/dist/render-flows/render.js +62 -35
  246. package/dist/render-flows/still.d.ts +3 -2
  247. package/dist/render-flows/still.js +34 -28
  248. package/dist/resolve-from.js +5 -5
  249. package/dist/setup-cache.d.ts +2 -1
  250. package/dist/setup-cache.js +10 -6
  251. package/dist/should-use-non-overlaying-logger.d.ts +4 -0
  252. package/dist/should-use-non-overlaying-logger.js +12 -0
  253. package/dist/show-compositions-picker.d.ts +8 -0
  254. package/dist/show-compositions-picker.js +51 -0
  255. package/dist/still.js +1 -0
  256. package/dist/studio.d.ts +1 -0
  257. package/dist/studio.js +140 -0
  258. package/dist/upgrade.js +2 -2
  259. package/dist/user-passed-output-location.d.ts +3 -2
  260. package/dist/user-passed-output-location.js +10 -5
  261. package/dist/versions.js +2 -2
  262. package/dist/watch-root-file.d.ts +1 -0
  263. package/dist/watch-root-file.js +22 -0
  264. package/package.json +89 -88
  265. package/styles/styles.css +4 -5
  266. package/dist/editor/components/CollapsableOptions.d.ts +0 -6
  267. package/dist/editor/components/CollapsableOptions.js +0 -35
  268. package/dist/editor/components/RenderModal/RenderModalJSONInputPropsEditor.d.ts +0 -10
  269. package/dist/editor/components/RenderModal/SchemaEditor/date-serialization.d.ts +0 -2
  270. package/dist/editor/components/RenderModal/SchemaEditor/date-serialization.js +0 -21
  271. package/dist/editor/components/RenderToolbarIcon.d.ts +0 -2
  272. package/dist/editor/icons/RenderStillIcon.d.ts +0 -3
  273. package/dist/editor/icons/RenderStillIcon.js +0 -8
@@ -6,48 +6,73 @@ const client_1 = require("@remotion/renderer/client");
6
6
  const react_1 = require("react");
7
7
  const remotion_1 = require("remotion");
8
8
  const get_default_out_name_1 = require("../../get-default-out-name");
9
+ const Button_1 = require("../../preview-server/error-overlay/remotion-overlay/Button");
9
10
  const get_default_video_contexts_1 = require("../../preview-server/render-queue/get-default-video-contexts");
11
+ const client_id_1 = require("../helpers/client-id");
12
+ const use_keybinding_1 = require("../helpers/use-keybinding");
10
13
  const render_1 = require("../icons/render");
14
+ const in_out_1 = require("../state/in-out");
11
15
  const modals_1 = require("../state/modals");
12
- const InlineAction_1 = require("./InlineAction");
13
- const RenderButton = ({ composition, visible }) => {
16
+ const layout_1 = require("./layout");
17
+ const button = {
18
+ paddingLeft: 7,
19
+ paddingRight: 7,
20
+ paddingTop: 7,
21
+ paddingBottom: 7,
22
+ };
23
+ const label = {
24
+ fontSize: 14,
25
+ };
26
+ const RenderButton = () => {
27
+ const { inFrame, outFrame } = (0, in_out_1.useTimelineInOutFramePosition)();
14
28
  const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
29
+ const { type } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
30
+ const connectionStatus = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx).type;
31
+ const shortcut = (0, use_keybinding_1.areKeyboardShortcutsDisabled)() ? '' : '(R)';
32
+ const tooltip = type === 'connected'
33
+ ? 'Export the current composition ' + shortcut
34
+ : 'Connect to the preview server to render';
15
35
  const iconStyle = (0, react_1.useMemo)(() => {
16
36
  return {
17
37
  style: {
18
- height: 12,
38
+ height: 16,
39
+ color: 'currentColor',
19
40
  },
20
41
  };
21
42
  }, []);
43
+ const video = remotion_1.Internals.useVideo();
44
+ const frame = (0, remotion_1.useCurrentFrame)();
22
45
  const { props } = (0, react_1.useContext)(remotion_1.Internals.EditorPropsContext);
23
- const isVideo = composition.durationInFrames > 1;
24
- const onClick = (0, react_1.useCallback)((e) => {
25
- var _a;
46
+ const onClick = (0, react_1.useCallback)(() => {
47
+ var _a, _b, _c;
48
+ if (!video) {
49
+ return null;
50
+ }
51
+ const isVideo = video.durationInFrames > 1;
26
52
  const defaults = window.remotion_renderDefaults;
27
53
  if (!defaults) {
28
- throw new Error('expected defaults');
54
+ throw new TypeError('Expected defaults');
29
55
  }
30
- e.stopPropagation();
31
56
  const { initialAudioCodec, initialRenderType, initialVideoCodec } = (0, get_default_video_contexts_1.getDefaultCodecs)({
32
57
  defaultCodec: defaults.codec,
33
58
  isStill: !isVideo,
34
59
  });
35
60
  setSelectedModal({
36
61
  type: 'render',
37
- compositionId: composition.id,
38
- initialFrame: 0,
39
- initialVideoImageFormat: defaults.videoImageFormat,
62
+ compositionId: video.id,
63
+ initialFrame: frame,
40
64
  initialStillImageFormat: defaults.stillImageFormat,
41
- initialJpegQuality: defaults.jpegQuality,
42
- initialScale: defaults.scale,
43
- initialVerbose: defaults.logLevel === 'verbose',
65
+ initialVideoImageFormat: defaults.videoImageFormat,
44
66
  initialOutName: (0, get_default_out_name_1.getDefaultOutLocation)({
45
- compositionName: composition.id,
67
+ compositionName: video.id,
46
68
  defaultExtension: isVideo
47
- ? defaults.stillImageFormat
48
- : client_1.BrowserSafeApis.getFileExtensionFromCodec(initialVideoCodec, defaults.audioCodec),
69
+ ? client_1.BrowserSafeApis.getFileExtensionFromCodec(initialVideoCodec, defaults.audioCodec)
70
+ : defaults.stillImageFormat,
49
71
  type: 'asset',
50
72
  }),
73
+ initialJpegQuality: defaults.jpegQuality,
74
+ initialScale: (_b = (_a = window.remotion_renderDefaults) === null || _a === void 0 ? void 0 : _a.scale) !== null && _b !== void 0 ? _b : 1,
75
+ initialVerbose: defaults.logLevel === 'verbose',
51
76
  initialVideoCodecForAudioTab: initialAudioCodec,
52
77
  initialRenderType,
53
78
  initialVideoCodecForVideoTab: initialVideoCodec,
@@ -69,12 +94,14 @@ const RenderButton = ({ composition, visible }) => {
69
94
  initialOpenGlRenderer: defaults.openGlRenderer,
70
95
  initialHeadless: defaults.headless,
71
96
  initialIgnoreCertificateErrors: defaults.ignoreCertificateErrors,
72
- defaultProps: (_a = props[composition.id]) !== null && _a !== void 0 ? _a : composition.defaultProps,
97
+ defaultProps: (_c = props[video.id]) !== null && _c !== void 0 ? _c : video.defaultProps,
98
+ inFrameMark: inFrame,
99
+ outFrameMark: outFrame,
73
100
  });
74
- }, [composition.defaultProps, composition.id, isVideo, props, setSelectedModal]);
75
- if (!visible) {
101
+ }, [video, setSelectedModal, frame, props, inFrame, outFrame]);
102
+ if (!video) {
76
103
  return null;
77
104
  }
78
- return ((0, jsx_runtime_1.jsx)(InlineAction_1.InlineAction, { onClick: onClick, children: (0, jsx_runtime_1.jsx)(render_1.ThinRenderIcon, { svgProps: iconStyle }) }));
105
+ return ((0, jsx_runtime_1.jsx)(Button_1.Button, { id: "render-modal-button", title: tooltip, onClick: onClick, buttonContainerStyle: button, disabled: connectionStatus !== 'connected', children: (0, jsx_runtime_1.jsxs)(layout_1.Row, { align: "center", children: [(0, jsx_runtime_1.jsx)(render_1.RenderIcon, { svgProps: iconStyle }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 1 }), (0, jsx_runtime_1.jsx)("span", { style: label, children: "Render" })] }) }));
79
106
  };
80
107
  exports.RenderButton = RenderButton;
@@ -2,21 +2,58 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CliCopyButton = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const colors_1 = require("../../helpers/colors");
7
+ const svgStyle = {
8
+ width: 16,
9
+ height: 16,
10
+ verticalAlign: 'sub',
11
+ };
12
+ const copiedStyle = {
13
+ fontSize: '14px',
14
+ minHeight: '30px',
15
+ minWidth: '30px',
16
+ display: 'flex',
17
+ alignItems: 'center',
18
+ justifyContent: 'center',
19
+ };
20
+ const buttonStyle = {
21
+ width: '30px',
22
+ height: '30px',
23
+ border: 'none',
24
+ cursor: 'pointer',
25
+ display: 'flex',
26
+ alignItems: 'center',
27
+ justifyContent: 'center',
28
+ };
5
29
  const CliCopyButton = ({ valueToCopy, }) => {
6
- const iconStyle = {
7
- width: 16,
8
- height: 16,
9
- color: '#a6a8aa',
10
- verticalAlign: 'sub',
11
- };
12
- const clipBoardIcon = ((0, jsx_runtime_1.jsx)("svg", { "aria-hidden": "true", focusable: "false", "data-prefix": "far", "data-icon": "clipboard", className: "svg-inline--fa fa-clipboard fa-w-12", role: "img", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 384 512", style: iconStyle, children: (0, jsx_runtime_1.jsx)("path", { fill: "#a6a8aa", d: "M336 64h-80c0-35.3-28.7-64-64-64s-64 28.7-64 64H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V112c0-26.5-21.5-48-48-48zM192 40c13.3 0 24 10.7 24 24s-10.7 24-24 24-24-10.7-24-24 10.7-24 24-24zm144 418c0 3.3-2.7 6-6 6H54c-3.3 0-6-2.7-6-6V118c0-3.3 2.7-6 6-6h42v36c0 6.6 5.4 12 12 12h168c6.6 0 12-5.4 12-12v-36h42c3.3 0 6 2.7 6 6z" }) }));
13
- return ((0, jsx_runtime_1.jsx)("button", { type: "button", style: {
14
- width: '30px',
15
- height: '30px',
16
- border: 'none',
17
- cursor: 'pointer',
18
- }, onClick: () => {
30
+ const [copied, setCopied] = (0, react_1.useState)(false);
31
+ const [hovered, setHovered] = (0, react_1.useState)(false);
32
+ const fillColor = (0, react_1.useMemo)(() => {
33
+ return hovered ? 'white' : colors_1.LIGHT_TEXT;
34
+ }, [hovered]);
35
+ const clipboardIcon = ((0, jsx_runtime_1.jsx)("svg", { "aria-hidden": "true", focusable: "false", "data-prefix": "far", "data-icon": "clipboard", className: "svg-inline--fa fa-clipboard fa-w-12", role: "img", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 384 512", style: svgStyle, children: (0, jsx_runtime_1.jsx)("path", { fill: fillColor, d: "M336 64h-80c0-35.3-28.7-64-64-64s-64 28.7-64 64H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V112c0-26.5-21.5-48-48-48zM192 40c13.3 0 24 10.7 24 24s-10.7 24-24 24-24-10.7-24-24 10.7-24 24-24zm144 418c0 3.3-2.7 6-6 6H54c-3.3 0-6-2.7-6-6V118c0-3.3 2.7-6 6-6h42v36c0 6.6 5.4 12 12 12h168c6.6 0 12-5.4 12-12v-36h42c3.3 0 6 2.7 6 6z" }) }));
36
+ const checkSvg = ((0, jsx_runtime_1.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 448 512", style: svgStyle, children: (0, jsx_runtime_1.jsx)("path", { fill: fillColor, d: "M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z" }) }));
37
+ const onPointerEnter = (0, react_1.useCallback)(() => {
38
+ setHovered(true);
39
+ }, []);
40
+ const onPointerLeave = (0, react_1.useCallback)(() => {
41
+ setHovered(false);
42
+ }, []);
43
+ (0, react_1.useEffect)(() => {
44
+ if (!copied) {
45
+ return;
46
+ }
47
+ const handleClear = () => {
48
+ setCopied(false);
49
+ setHovered(false);
50
+ };
51
+ const to = setTimeout(() => handleClear(), 2000);
52
+ return () => clearTimeout(to);
53
+ }, [copied]);
54
+ return copied ? ((0, jsx_runtime_1.jsx)("span", { style: copiedStyle, children: checkSvg })) : ((0, jsx_runtime_1.jsx)("button", { type: "button", onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, style: buttonStyle, onClick: () => {
19
55
  navigator.clipboard.writeText(valueToCopy);
20
- }, children: clipBoardIcon }));
56
+ setCopied(true);
57
+ }, children: clipboardIcon }));
21
58
  };
22
59
  exports.CliCopyButton = CliCopyButton;
@@ -5,7 +5,6 @@ export declare const useCrfState: (codec: Codec) => {
5
5
  setCrf: import("react").Dispatch<import("react").SetStateAction<number>>;
6
6
  minCrf: number;
7
7
  maxCrf: number;
8
- shouldDisplayOption: boolean;
9
8
  };
10
9
  export declare const CrfSetting: React.FC<{
11
10
  crf: number;
@@ -33,7 +33,6 @@ const useCrfState = (codec) => {
33
33
  setCrf,
34
34
  minCrf: range[0],
35
35
  maxCrf: range[1],
36
- shouldDisplayOption: range[0] !== range[1] && client_1.BrowserSafeApis.codecSupportsCrf(codec),
37
36
  };
38
37
  };
39
38
  exports.useCrfState = useCrfState;
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import type { AnyComposition } from 'remotion';
3
+ export declare type State = {
4
+ str: string;
5
+ value: Record<string, unknown>;
6
+ validJSON: true;
7
+ zodValidation: Zod.SafeParseReturnType<unknown, unknown>;
8
+ } | {
9
+ str: string;
10
+ validJSON: false;
11
+ error: string;
12
+ };
13
+ export declare type PropsEditType = 'input-props' | 'default-props';
14
+ export declare const DataEditor: React.FC<{
15
+ unresolvedComposition: AnyComposition;
16
+ inputProps: Record<string, unknown>;
17
+ setInputProps: React.Dispatch<React.SetStateAction<Record<string, unknown>>>;
18
+ compact: boolean;
19
+ mayShowSaveButton: boolean;
20
+ propsEditType: PropsEditType;
21
+ }>;
@@ -0,0 +1,287 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.DataEditor = void 0;
27
+ const jsx_runtime_1 = require("react/jsx-runtime");
28
+ const react_1 = __importStar(require("react"));
29
+ const remotion_1 = require("remotion");
30
+ const event_source_1 = require("../../../event-source");
31
+ const client_id_1 = require("../../helpers/client-id");
32
+ const colors_1 = require("../../helpers/colors");
33
+ const get_zod_if_possible_1 = require("../get-zod-if-possible");
34
+ const layout_1 = require("../layout");
35
+ const ValidationMessage_1 = require("../NewComposition/ValidationMessage");
36
+ const NotificationCenter_1 = require("../Notifications/NotificationCenter");
37
+ const actions_1 = require("../RenderQueue/actions");
38
+ const SegmentedControl_1 = require("../SegmentedControl");
39
+ const get_render_modal_warnings_1 = require("./get-render-modal-warnings");
40
+ const RenderModalJSONPropsEditor_1 = require("./RenderModalJSONPropsEditor");
41
+ const extract_enum_json_paths_1 = require("./SchemaEditor/extract-enum-json-paths");
42
+ const input_props_serialization_1 = require("./SchemaEditor/input-props-serialization");
43
+ const SchemaEditor_1 = require("./SchemaEditor/SchemaEditor");
44
+ const SchemaErrorMessages_1 = require("./SchemaEditor/SchemaErrorMessages");
45
+ const WarningIndicatorButton_1 = require("./WarningIndicatorButton");
46
+ const errorExplanation = {
47
+ fontSize: 14,
48
+ color: colors_1.LIGHT_TEXT,
49
+ fontFamily: 'sans-serif',
50
+ lineHeight: 1.5,
51
+ };
52
+ const explainer = {
53
+ display: 'flex',
54
+ flex: 1,
55
+ flexDirection: 'column',
56
+ padding: '0 12px',
57
+ justifyContent: 'center',
58
+ alignItems: 'center',
59
+ textAlign: 'center',
60
+ };
61
+ const outer = {
62
+ display: 'flex',
63
+ flexDirection: 'column',
64
+ flex: 1,
65
+ overflow: 'hidden',
66
+ backgroundColor: colors_1.BACKGROUND,
67
+ };
68
+ const controlContainer = {
69
+ flexDirection: 'column',
70
+ display: 'flex',
71
+ padding: 12,
72
+ borderBottom: `1px solid ${colors_1.BORDER_COLOR}`,
73
+ };
74
+ const tabWrapper = {
75
+ display: 'flex',
76
+ marginBottom: '4px',
77
+ flexDirection: 'row',
78
+ alignItems: 'center',
79
+ };
80
+ const persistanceKey = 'remotion.show-render-modalwarning';
81
+ const getPersistedShowWarningState = () => {
82
+ const val = localStorage.getItem(persistanceKey);
83
+ if (!val) {
84
+ return true;
85
+ }
86
+ return val === 'true';
87
+ };
88
+ const setPersistedShowWarningState = (val) => {
89
+ localStorage.setItem(persistanceKey, String(Boolean(val)));
90
+ };
91
+ const DataEditor = ({ unresolvedComposition, inputProps, setInputProps, compact, mayShowSaveButton, propsEditType, }) => {
92
+ const [mode, setMode] = (0, react_1.useState)('schema');
93
+ const [valBeforeSafe, setValBeforeSafe] = (0, react_1.useState)(inputProps);
94
+ const [saving, setSaving] = (0, react_1.useState)(false);
95
+ const [showWarning, setShowWarningWithoutPersistance] = (0, react_1.useState)(() => getPersistedShowWarningState());
96
+ const inJSONEditor = mode === 'json';
97
+ const serializedJSON = (0, react_1.useMemo)(() => {
98
+ if (!inJSONEditor) {
99
+ return null;
100
+ }
101
+ const value = inputProps;
102
+ return (0, input_props_serialization_1.serializeJSONWithDate)({
103
+ data: value,
104
+ indent: 2,
105
+ staticBase: window.remotion_staticBase,
106
+ });
107
+ }, [inJSONEditor, inputProps]);
108
+ const cliProps = (0, remotion_1.getInputProps)();
109
+ const [canSaveDefaultPropsObjectState, setCanSaveDefaultProps] = (0, react_1.useState)({
110
+ [unresolvedComposition.id]: get_render_modal_warnings_1.defaultTypeCanSaveState,
111
+ });
112
+ const z = (0, get_zod_if_possible_1.useZodIfPossible)();
113
+ const schema = (0, react_1.useMemo)(() => {
114
+ if (!z) {
115
+ return 'no-zod';
116
+ }
117
+ if (!unresolvedComposition.schema) {
118
+ return z.object({});
119
+ }
120
+ if (!(typeof unresolvedComposition.schema.safeParse === 'function')) {
121
+ throw new Error('A value which is not a Zod schema was passed to `schema`');
122
+ }
123
+ return unresolvedComposition.schema;
124
+ }, [unresolvedComposition.schema, z]);
125
+ const zodValidationResult = (0, react_1.useMemo)(() => {
126
+ if (schema === 'no-zod') {
127
+ return 'no-zod';
128
+ }
129
+ return schema.safeParse(inputProps);
130
+ }, [inputProps, schema]);
131
+ const setShowWarning = (0, react_1.useCallback)((val) => {
132
+ setShowWarningWithoutPersistance((prevVal) => {
133
+ if (typeof val === 'boolean') {
134
+ setPersistedShowWarningState(val);
135
+ return val;
136
+ }
137
+ setPersistedShowWarningState(val(prevVal));
138
+ return val(prevVal);
139
+ });
140
+ }, []);
141
+ const canSaveDefaultProps = (0, react_1.useMemo)(() => {
142
+ return canSaveDefaultPropsObjectState[unresolvedComposition.id]
143
+ ? canSaveDefaultPropsObjectState[unresolvedComposition.id]
144
+ : get_render_modal_warnings_1.defaultTypeCanSaveState;
145
+ }, [canSaveDefaultPropsObjectState, unresolvedComposition.id]);
146
+ const showSaveButton = mayShowSaveButton && canSaveDefaultProps.canUpdate;
147
+ const { fastRefreshes } = (0, react_1.useContext)(remotion_1.Internals.NonceContext);
148
+ const checkIfCanSaveDefaultProps = (0, react_1.useCallback)(async () => {
149
+ try {
150
+ const can = await (0, actions_1.canUpdateDefaultProps)(unresolvedComposition.id);
151
+ if (can.canUpdate) {
152
+ setCanSaveDefaultProps((prevState) => ({
153
+ ...prevState,
154
+ [unresolvedComposition.id]: {
155
+ canUpdate: true,
156
+ },
157
+ }));
158
+ }
159
+ else {
160
+ setCanSaveDefaultProps((prevState) => ({
161
+ ...prevState,
162
+ [unresolvedComposition.id]: {
163
+ canUpdate: false,
164
+ reason: can.reason,
165
+ determined: true,
166
+ },
167
+ }));
168
+ }
169
+ }
170
+ catch (err) {
171
+ setCanSaveDefaultProps((prevState) => ({
172
+ ...prevState,
173
+ [unresolvedComposition.id]: {
174
+ canUpdate: false,
175
+ reason: err.message,
176
+ determined: true,
177
+ },
178
+ }));
179
+ }
180
+ }, [unresolvedComposition.id]);
181
+ (0, react_1.useEffect)(() => {
182
+ checkIfCanSaveDefaultProps();
183
+ }, [checkIfCanSaveDefaultProps]);
184
+ (0, react_1.useEffect)(() => {
185
+ const unsub = (0, event_source_1.subscribeToEvent)('root-file-changed', checkIfCanSaveDefaultProps);
186
+ return () => {
187
+ unsub();
188
+ };
189
+ }, [checkIfCanSaveDefaultProps]);
190
+ const modeItems = (0, react_1.useMemo)(() => {
191
+ return [
192
+ {
193
+ key: 'schema',
194
+ label: 'Schema',
195
+ onClick: () => {
196
+ setMode('schema');
197
+ },
198
+ selected: mode === 'schema',
199
+ },
200
+ {
201
+ key: 'json',
202
+ label: 'JSON',
203
+ onClick: () => {
204
+ setMode('json');
205
+ },
206
+ selected: mode === 'json',
207
+ },
208
+ ];
209
+ }, [mode]);
210
+ const onUpdate = (0, react_1.useCallback)(() => {
211
+ if (schema === 'no-zod' || z === null) {
212
+ (0, NotificationCenter_1.sendErrorNotification)('Cannot update default props: No Zod schema');
213
+ return;
214
+ }
215
+ setValBeforeSafe(inputProps);
216
+ (0, actions_1.updateDefaultProps)(unresolvedComposition.id, inputProps, (0, extract_enum_json_paths_1.extractEnumJsonPaths)(schema, z, [])).then((response) => {
217
+ if (!response.success) {
218
+ (0, NotificationCenter_1.sendErrorNotification)('Cannot update default props: ' + response.reason);
219
+ }
220
+ });
221
+ }, [unresolvedComposition.id, inputProps, schema, z]);
222
+ (0, react_1.useEffect)(() => {
223
+ setSaving(false);
224
+ }, [fastRefreshes]);
225
+ const onSave = (0, react_1.useCallback)((updater) => {
226
+ if (schema === 'no-zod' || z === null) {
227
+ (0, NotificationCenter_1.sendErrorNotification)('Cannot update default props: No Zod schema');
228
+ return;
229
+ }
230
+ setSaving(true);
231
+ (0, actions_1.updateDefaultProps)(unresolvedComposition.id, updater(unresolvedComposition.defaultProps), (0, extract_enum_json_paths_1.extractEnumJsonPaths)(schema, z, []))
232
+ .then((response) => {
233
+ if (!response.success) {
234
+ console.log(response.stack);
235
+ (0, NotificationCenter_1.sendErrorNotification)(`Cannot update default props: ${response.reason}. See console for more information.`);
236
+ }
237
+ })
238
+ .catch((err) => {
239
+ (0, NotificationCenter_1.sendErrorNotification)(`Cannot update default props: ${err.message}`);
240
+ setSaving(false);
241
+ });
242
+ }, [unresolvedComposition.defaultProps, unresolvedComposition.id, schema, z]);
243
+ const connectionStatus = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx).type;
244
+ const warnings = (0, react_1.useMemo)(() => {
245
+ return (0, get_render_modal_warnings_1.getRenderModalWarnings)({
246
+ canSaveDefaultProps,
247
+ cliProps,
248
+ isCustomDateUsed: serializedJSON ? serializedJSON.customDateUsed : false,
249
+ customFileUsed: serializedJSON ? serializedJSON.customFileUsed : false,
250
+ inJSONEditor,
251
+ propsEditType,
252
+ jsMapUsed: serializedJSON ? serializedJSON.mapUsed : false,
253
+ jsSetUsed: serializedJSON ? serializedJSON.setUsed : false,
254
+ });
255
+ }, [
256
+ cliProps,
257
+ canSaveDefaultProps,
258
+ inJSONEditor,
259
+ propsEditType,
260
+ serializedJSON,
261
+ ]);
262
+ if (connectionStatus === 'disconnected') {
263
+ return ((0, jsx_runtime_1.jsxs)("div", { style: explainer, children: [(0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 5 }), (0, jsx_runtime_1.jsx)("div", { style: errorExplanation, children: "The preview server has disconnected. Reconnect to edit the schema." }), (0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 2, block: true })] }));
264
+ }
265
+ if (schema === 'no-zod') {
266
+ return (0, jsx_runtime_1.jsx)(SchemaErrorMessages_1.ZodNotInstalled, {});
267
+ }
268
+ if (!z) {
269
+ throw new Error('expected zod');
270
+ }
271
+ if (zodValidationResult === 'no-zod') {
272
+ throw new Error('expected zod');
273
+ }
274
+ const def = schema._def;
275
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
276
+ const typeName = def.typeName;
277
+ if (typeName === z.ZodFirstPartyTypeKind.ZodAny) {
278
+ return (0, jsx_runtime_1.jsx)(SchemaErrorMessages_1.NoSchemaDefined, {});
279
+ }
280
+ if (!unresolvedComposition.defaultProps) {
281
+ return (0, jsx_runtime_1.jsx)(SchemaErrorMessages_1.NoDefaultProps, {});
282
+ }
283
+ return ((0, jsx_runtime_1.jsxs)("div", { style: outer, children: [(0, jsx_runtime_1.jsxs)("div", { style: controlContainer, children: [(0, jsx_runtime_1.jsxs)("div", { style: tabWrapper, children: [(0, jsx_runtime_1.jsx)(SegmentedControl_1.SegmentedControl, { items: modeItems, needsWrapping: false }), (0, jsx_runtime_1.jsx)(layout_1.Flex, {}), warnings.length > 0 ? ((0, jsx_runtime_1.jsx)(WarningIndicatorButton_1.WarningIndicatorButton, { setShowWarning: setShowWarning, showWarning: showWarning, warningCount: warnings.length })) : null] }), showWarning && warnings.length > 0
284
+ ? warnings.map((warning) => ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsx)(layout_1.Spacing, { y: 1 }), (0, jsx_runtime_1.jsx)(ValidationMessage_1.ValidationMessage, { message: warning, align: "flex-start", type: "warning" })] }, warning)))
285
+ : null] }), mode === 'schema' ? ((0, jsx_runtime_1.jsx)(SchemaEditor_1.SchemaEditor, { value: inputProps, setValue: setInputProps, schema: schema, zodValidationResult: zodValidationResult, compact: compact, defaultProps: unresolvedComposition.defaultProps, onSave: onSave, showSaveButton: showSaveButton, saving: saving, saveDisabledByParent: !zodValidationResult.success })) : ((0, jsx_runtime_1.jsx)(RenderModalJSONPropsEditor_1.RenderModalJSONPropsEditor, { value: inputProps !== null && inputProps !== void 0 ? inputProps : {}, setValue: setInputProps, onSave: onUpdate, valBeforeSafe: valBeforeSafe, showSaveButton: showSaveButton, serializedJSON: serializedJSON, defaultProps: unresolvedComposition.defaultProps, schema: schema }))] }));
286
+ };
287
+ exports.DataEditor = DataEditor;
@@ -4,13 +4,14 @@ exports.EnforceAudioTrackSetting = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const Checkbox_1 = require("../Checkbox");
7
+ const layout_1 = require("../layout");
7
8
  const InfoBubble_1 = require("./InfoBubble");
8
- const layout_1 = require("./layout");
9
+ const layout_2 = require("./layout");
9
10
  const OptionExplainer_1 = require("./OptionExplainer");
10
11
  const EnforceAudioTrackSetting = ({ enforceAudioTrack, muted, setEnforceAudioTrack, option }) => {
11
12
  const onEnforceAudioTrackChanged = (0, react_1.useCallback)((e) => {
12
13
  setEnforceAudioTrack(e.target.checked);
13
14
  }, [setEnforceAudioTrack]);
14
- return ((0, jsx_runtime_1.jsxs)("div", { style: layout_1.optionRow, children: [(0, jsx_runtime_1.jsxs)("div", { style: layout_1.label, children: ["Enforce Audio Track", (0, jsx_runtime_1.jsx)(InfoBubble_1.InfoBubble, { title: "Learn more about this option", children: (0, jsx_runtime_1.jsx)(OptionExplainer_1.OptionExplainer, { option: option }) })] }), (0, jsx_runtime_1.jsx)("div", { style: layout_1.rightRow, children: (0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { disabled: muted && !enforceAudioTrack, checked: enforceAudioTrack, onChange: onEnforceAudioTrackChanged }) })] }));
15
+ return ((0, jsx_runtime_1.jsxs)("div", { style: layout_2.optionRow, children: [(0, jsx_runtime_1.jsxs)("div", { style: layout_2.label, children: ["Enforce Audio Track", (0, jsx_runtime_1.jsx)(layout_1.Spacing, { x: 0.5 }), (0, jsx_runtime_1.jsx)(InfoBubble_1.InfoBubble, { title: "Learn more about this option", children: (0, jsx_runtime_1.jsx)(OptionExplainer_1.OptionExplainer, { option: option }) })] }), (0, jsx_runtime_1.jsx)("div", { style: layout_2.rightRow, children: (0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { disabled: muted && !enforceAudioTrack, checked: enforceAudioTrack, onChange: onEnforceAudioTrackChanged }) })] }));
15
16
  };
16
17
  exports.EnforceAudioTrackSetting = EnforceAudioTrackSetting;
@@ -106,10 +106,11 @@ const InfoBubble = ({ title, children }) => {
106
106
  display: 'inline-flex',
107
107
  flexDirection: 'row',
108
108
  alignItems: 'center',
109
+ padding: 6,
109
110
  };
110
111
  }, []);
111
112
  return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("button", { ref: ref, tabIndex: tabIndex, style: style, title: title, type: "button", children: (0, jsx_runtime_1.jsx)("svg", { style: icon, viewBox: "0 0 512 512", children: (0, jsx_runtime_1.jsx)("path", { fill: hovered ? 'white' : colors_1.LIGHT_TEXT, d: "M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM216 336c-13.3 0-24 10.7-24 24s10.7 24 24 24h80c13.3 0 24-10.7 24-24s-10.7-24-24-24h-8V248c0-13.3-10.7-24-24-24H216c-13.3 0-24 10.7-24 24s10.7 24 24 24h24v64H216zm40-144a32 32 0 1 0 0-64 32 32 0 1 0 0 64z" }) }) }), portalStyle
112
- ? react_dom_1.default.createPortal((0, jsx_runtime_1.jsx)("div", { style: styles_1.outerPortal, className: "css-reset", children: (0, jsx_runtime_1.jsx)(z_index_1.HigherZIndex, { onOutsideClick: onHide, onEscape: onHide, children: (0, jsx_runtime_1.jsx)("div", { style: portalStyle, children: (0, jsx_runtime_1.jsx)(InfoTooltip_1.InfoTooltip, { arrowDirection: layout, children: children }) }) }) }), (0, portals_1.getPortal)(currentZIndex))
113
+ ? react_dom_1.default.createPortal((0, jsx_runtime_1.jsx)("div", { style: styles_1.outerPortal, className: "css-reset", children: (0, jsx_runtime_1.jsx)(z_index_1.HigherZIndex, { onOutsideClick: onHide, onEscape: onHide, children: (0, jsx_runtime_1.jsx)("div", { style: portalStyle, children: (0, jsx_runtime_1.jsx)(InfoTooltip_1.InfoTooltip, { backgroundColor: colors_1.INPUT_BACKGROUND, arrowDirection: layout, children: children }) }) }) }), (0, portals_1.getPortal)(currentZIndex))
113
114
  : null] }));
114
115
  };
115
116
  exports.InfoBubble = InfoBubble;
@@ -2,4 +2,5 @@ import React from 'react';
2
2
  export declare const InfoTooltip: React.FC<{
3
3
  children: React.ReactNode;
4
4
  arrowDirection: 'up' | 'down';
5
+ backgroundColor: string;
5
6
  }>;
@@ -18,23 +18,24 @@ const arrowUp = {
18
18
  };
19
19
  const arrowDown = {
20
20
  ...arrow,
21
- marginTop: -0.5,
21
+ marginTop: -1,
22
22
  };
23
- const InfoTooltip = ({ children, arrowDirection }) => {
23
+ const InfoTooltip = ({ children, arrowDirection, backgroundColor }) => {
24
24
  const container = (0, react_1.useMemo)(() => {
25
25
  return {
26
26
  boxShadow: arrowDirection === 'down' ? styles_1.SHADOW_TOWARDS_TOP : styles_1.SHADOW_TOWARDS_BOTTOM,
27
- background: colors_1.BACKGROUND,
27
+ background: backgroundColor,
28
28
  color: 'white',
29
29
  border: '0.5px solid ' + colors_1.BORDER_COLOR,
30
30
  maxHeight: 200,
31
31
  overflow: 'auto',
32
+ borderRadius: '4px',
32
33
  };
33
- }, [arrowDirection]);
34
+ }, [arrowDirection, backgroundColor]);
34
35
  return ((0, jsx_runtime_1.jsxs)("div", { style: {
35
36
  display: 'flex',
36
37
  flexDirection: arrowDirection === 'up' ? 'column-reverse' : 'column',
37
38
  alignItems: 'flex-start',
38
- }, children: [(0, jsx_runtime_1.jsx)("div", { style: container, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: children }), arrowDirection === 'down' ? ((0, jsx_runtime_1.jsx)("svg", { viewBox: "0 0 14 7", style: arrowDown, children: (0, jsx_runtime_1.jsx)("path", { d: `M 14 0 L 7 7 L 0 0`, fill: colors_1.BACKGROUND, strokeLinecap: "butt", stroke: colors_1.BORDER_COLOR, strokeWidth: 0.5 }) })) : null, arrowDirection === 'up' ? ((0, jsx_runtime_1.jsx)("svg", { viewBox: "0 0 14 7", style: arrowUp, children: (0, jsx_runtime_1.jsx)("path", { d: `M 0 7 L 7 0 L 14 7`, fill: colors_1.BACKGROUND, strokeLinecap: "butt", stroke: colors_1.BORDER_COLOR, strokeWidth: 0.5 }) })) : null] }));
39
+ }, children: [(0, jsx_runtime_1.jsx)("div", { style: container, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: children }), arrowDirection === 'down' ? ((0, jsx_runtime_1.jsx)("svg", { viewBox: "0 0 14 7", style: arrowDown, children: (0, jsx_runtime_1.jsx)("path", { d: `M 14 0 L 7 7 L 0 0`, fill: backgroundColor, strokeLinecap: "butt", stroke: colors_1.BORDER_COLOR, strokeWidth: 0.5 }) })) : null, arrowDirection === 'up' ? ((0, jsx_runtime_1.jsx)("svg", { viewBox: "0 0 14 7", style: arrowUp, children: (0, jsx_runtime_1.jsx)("path", { d: `M 0 7 L 7 0 L 14 7`, fill: backgroundColor, strokeLinecap: "butt", stroke: colors_1.BORDER_COLOR, strokeWidth: 0.5 }) })) : null] }));
39
40
  };
40
41
  exports.InfoTooltip = InfoTooltip;
@@ -2,13 +2,16 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.InlineEyeButton = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
- const colors_1 = require("../../helpers/colors");
5
+ const react_1 = require("react");
6
6
  const InlineAction_1 = require("../InlineAction");
7
7
  const clearIcon = {
8
8
  height: 14,
9
- color: colors_1.LIGHT_TEXT,
9
+ color: 'currentColor',
10
10
  };
11
11
  const InlineEyeButton = ({ onClick, enabled }) => {
12
- return ((0, jsx_runtime_1.jsx)(InlineAction_1.InlineAction, { onClick: onClick, children: enabled ? ((0, jsx_runtime_1.jsx)("svg", { style: clearIcon, viewBox: "0 0 640 512", children: (0, jsx_runtime_1.jsx)("path", { fill: 'currentColor', d: "M25.9 3.4C19-2 8.9-.8 3.4 6.1S-.8 23.1 6.1 28.6l608 480c6.9 5.5 17 4.3 22.5-2.6s4.3-17-2.6-22.5L25.9 3.4zM605.5 268.3c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C465.5 68.8 400.8 32 320 32c-51.2 0-96 14.8-133.9 36.8l27.3 21.5C244.6 74.2 280.2 64 320 64c70.4 0 127.7 32 170.8 72c43.1 40 71.9 88 85.2 120c-9.2 22.1-25.9 52-49.5 81.5l25.1 19.8c25.6-32 43.7-64.4 53.9-89zM88.4 154.7c-25.6 32-43.7 64.4-53.9 89c-3.3 7.9-3.3 16.7 0 24.6c14.9 35.7 46.2 87.7 93 131.1C174.5 443.2 239.2 480 320 480c51.2 0 96-14.8 133.9-36.8l-27.3-21.5C395.4 437.8 359.8 448 320 448c-70.4 0-127.7-32-170.8-72C106.1 336 77.3 288 64 256c9.2-22.1 25.9-52 49.5-81.5L88.4 154.7zM320 384c16.7 0 32.7-3.2 47.4-9.1l-30.9-24.4c-5.4 .9-10.9 1.4-16.5 1.4c-51 0-92.8-39.8-95.8-90.1l-30.9-24.4c-.9 6-1.3 12.2-1.3 18.5c0 70.7 57.3 128 128 128zM448 256c0-70.7-57.3-128-128-128c-16.7 0-32.7 3.2-47.4 9.1l30.9 24.4c5.4-.9 10.9-1.4 16.5-1.4c51 0 92.8 39.8 95.8 90.1l30.9 24.4c.9-6 1.3-12.2 1.3-18.5z" }) })) : ((0, jsx_runtime_1.jsx)("svg", { style: clearIcon, viewBox: "0 0 576 512", children: (0, jsx_runtime_1.jsx)("path", { fill: 'currentColor', d: "M117.2 136C160.3 96 217.6 64 288 64s127.7 32 170.8 72c43.1 40 71.9 88 85.2 120c-13.3 32-42.1 80-85.2 120c-43.1 40-100.4 72-170.8 72s-127.7-32-170.8-72C74.1 336 45.3 288 32 256c13.3-32 42.1-80 85.2-120zM288 32c-80.8 0-145.5 36.8-192.6 80.6C48.6 156 17.3 208 2.5 243.7c-3.3 7.9-3.3 16.7 0 24.6C17.3 304 48.6 356 95.4 399.4C142.5 443.2 207.2 480 288 480s145.5-36.8 192.6-80.6c46.8-43.5 78.1-95.4 93-131.1c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C433.5 68.8 368.8 32 288 32zM192 256a96 96 0 1 1 192 0 96 96 0 1 1 -192 0zm224 0a128 128 0 1 0 -256 0 128 128 0 1 0 256 0z" }) })) }));
12
+ const renderAction = (0, react_1.useCallback)((color) => {
13
+ return enabled ? ((0, jsx_runtime_1.jsx)("svg", { style: clearIcon, viewBox: "0 0 640 512", children: (0, jsx_runtime_1.jsx)("path", { fill: color, d: "M25.9 3.4C19-2 8.9-.8 3.4 6.1S-.8 23.1 6.1 28.6l608 480c6.9 5.5 17 4.3 22.5-2.6s4.3-17-2.6-22.5L25.9 3.4zM605.5 268.3c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C465.5 68.8 400.8 32 320 32c-51.2 0-96 14.8-133.9 36.8l27.3 21.5C244.6 74.2 280.2 64 320 64c70.4 0 127.7 32 170.8 72c43.1 40 71.9 88 85.2 120c-9.2 22.1-25.9 52-49.5 81.5l25.1 19.8c25.6-32 43.7-64.4 53.9-89zM88.4 154.7c-25.6 32-43.7 64.4-53.9 89c-3.3 7.9-3.3 16.7 0 24.6c14.9 35.7 46.2 87.7 93 131.1C174.5 443.2 239.2 480 320 480c51.2 0 96-14.8 133.9-36.8l-27.3-21.5C395.4 437.8 359.8 448 320 448c-70.4 0-127.7-32-170.8-72C106.1 336 77.3 288 64 256c9.2-22.1 25.9-52 49.5-81.5L88.4 154.7zM320 384c16.7 0 32.7-3.2 47.4-9.1l-30.9-24.4c-5.4 .9-10.9 1.4-16.5 1.4c-51 0-92.8-39.8-95.8-90.1l-30.9-24.4c-.9 6-1.3 12.2-1.3 18.5c0 70.7 57.3 128 128 128zM448 256c0-70.7-57.3-128-128-128c-16.7 0-32.7 3.2-47.4 9.1l30.9 24.4c5.4-.9 10.9-1.4 16.5-1.4c51 0 92.8 39.8 95.8 90.1l30.9 24.4c.9-6 1.3-12.2 1.3-18.5z" }) })) : ((0, jsx_runtime_1.jsx)("svg", { style: clearIcon, viewBox: "0 0 576 512", children: (0, jsx_runtime_1.jsx)("path", { fill: color, d: "M117.2 136C160.3 96 217.6 64 288 64s127.7 32 170.8 72c43.1 40 71.9 88 85.2 120c-13.3 32-42.1 80-85.2 120c-43.1 40-100.4 72-170.8 72s-127.7-32-170.8-72C74.1 336 45.3 288 32 256c13.3-32 42.1-80 85.2-120zM288 32c-80.8 0-145.5 36.8-192.6 80.6C48.6 156 17.3 208 2.5 243.7c-3.3 7.9-3.3 16.7 0 24.6C17.3 304 48.6 356 95.4 399.4C142.5 443.2 207.2 480 288 480s145.5-36.8 192.6-80.6c46.8-43.5 78.1-95.4 93-131.1c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C433.5 68.8 368.8 32 288 32zM192 256a96 96 0 1 1 192 0 96 96 0 1 1 -192 0zm224 0a128 128 0 1 0 -256 0 128 128 0 1 0 256 0z" }) }));
14
+ }, [enabled]);
15
+ return (0, jsx_runtime_1.jsx)(InlineAction_1.InlineAction, { renderAction: renderAction, onClick: onClick });
13
16
  };
14
17
  exports.InlineEyeButton = InlineEyeButton;
@@ -2,11 +2,16 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.InlineRemoveButton = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
5
6
  const InlineAction_1 = require("../InlineAction");
6
7
  const clearIcon = {
7
8
  height: 14,
9
+ color: 'currentColor',
8
10
  };
9
11
  const InlineRemoveButton = ({ onClick }) => {
10
- return ((0, jsx_runtime_1.jsx)(InlineAction_1.InlineAction, { onClick: onClick, children: (0, jsx_runtime_1.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 320 512", style: clearIcon, children: (0, jsx_runtime_1.jsx)("path", { d: "M310.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L160 210.7 54.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L114.7 256 9.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 301.3 265.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L205.3 256 310.6 150.6z", fill: "currentcolor" }) }) }));
12
+ const renderAction = (0, react_1.useCallback)((color) => {
13
+ return ((0, jsx_runtime_1.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 320 512", style: clearIcon, children: (0, jsx_runtime_1.jsx)("path", { d: "M310.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L160 210.7 54.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L114.7 256 9.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 301.3 265.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L205.3 256 310.6 150.6z", fill: color }) }));
14
+ }, []);
15
+ return (0, jsx_runtime_1.jsx)(InlineAction_1.InlineAction, { renderAction: renderAction, onClick: onClick });
11
16
  };
12
17
  exports.InlineRemoveButton = InlineRemoveButton;