@remotion/studio 4.0.273 → 4.0.274

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.
@@ -1,5 +1,6 @@
1
1
 
2
2
  
3
- > @remotion/studio@4.0.273 make /Users/jonathanburger/remotion/packages/studio
3
+ > @remotion/studio@4.0.274 make /Users/jonathanburger/remotion/packages/studio
4
4
  > tsc -d && bun --env-file=../.env.bundle bundle.ts
5
5
 
6
+ [65.22ms] Generated.
package/bundle.ts CHANGED
@@ -1,54 +1,47 @@
1
- import {build} from 'bun';
1
+ import {buildPackage} from '../.monorepo/builder';
2
2
 
3
- if (process.env.NODE_ENV !== 'production') {
4
- throw new Error('This script must be run using NODE_ENV=production');
5
- }
3
+ const external = [
4
+ 'react',
5
+ 'remotion',
6
+ 'scheduler',
7
+ 'react-dom',
8
+ 'react',
9
+ '@remotion/media-utils',
10
+ '@remotion/studio-shared',
11
+ '@remotion/zod-types',
12
+ '@remotion/renderer',
13
+ '@remotion/player',
14
+ '@remotion/renderer/client',
15
+ '@remotion/renderer/pure',
16
+ '@remotion/renderer/error-handling',
17
+ 'source-map',
18
+ 'zod',
19
+ 'remotion/no-react',
20
+ 'react/jsx-runtime',
21
+ ];
6
22
 
7
- const mainModule = await build({
8
- entrypoints: ['src/index.ts'],
9
- naming: '[name].mjs',
10
- external: [
11
- 'react',
12
- 'remotion',
13
- 'remotion/no-react',
14
- 'react/jsx-runtime',
15
- 'zod',
23
+ await buildPackage({
24
+ formats: {
25
+ esm: 'build',
26
+ cjs: 'use-tsc',
27
+ },
28
+ external,
29
+ entrypoints: [
30
+ {
31
+ path: 'src/index.ts',
32
+ target: 'browser',
33
+ },
34
+ {
35
+ path: 'src/renderEntry.tsx',
36
+ target: 'browser',
37
+ },
38
+ {
39
+ path: 'src/internals.ts',
40
+ target: 'browser',
41
+ },
42
+ {
43
+ path: 'src/previewEntry.tsx',
44
+ target: 'browser',
45
+ },
16
46
  ],
17
47
  });
18
-
19
- const [file] = mainModule.outputs;
20
- const text = await file.text();
21
-
22
- await Bun.write('dist/esm/index.mjs', text);
23
-
24
- const internalsModule = await build({
25
- entrypoints: ['src/internals.ts'],
26
- naming: 'internals.mjs',
27
- external: [
28
- 'react',
29
- 'remotion',
30
- 'scheduler',
31
- 'react-dom',
32
- 'react',
33
- '@remotion/media-utils',
34
- '@remotion/studio-shared',
35
- '@remotion/zod-types',
36
- '@remotion/renderer',
37
- '@remotion/player',
38
- '@remotion/renderer/client',
39
- '@remotion/renderer/pure',
40
- '@remotion/renderer/error-handling',
41
- 'source-map',
42
- 'zod',
43
- 'remotion/no-react',
44
- 'react/jsx-runtime',
45
- ],
46
- });
47
- const [enableFile] = internalsModule.outputs;
48
- const internalsText = (await enableFile.text())
49
- .replace(/jsxDEV/g, 'jsx')
50
- .replace(/react\/jsx-dev-runtime/g, 'react/jsx-runtime');
51
-
52
- await Bun.write('dist/esm/internals.mjs', internalsText);
53
-
54
- export {};
package/dist/Studio.js CHANGED
@@ -25,7 +25,7 @@ const Studio = ({ rootComponent, readOnly }) => {
25
25
  (0, react_1.useLayoutEffect)(() => {
26
26
  (0, inject_css_1.injectCSS)();
27
27
  }, []);
28
- return ((0, jsx_runtime_1.jsx)(remotion_1.Internals.RemotionRoot, { logLevel: window.remotion_logLevel, numberOfAudioTags: window.remotion_numberOfAudioTags, children: (0, jsx_runtime_1.jsxs)(EditorContexts_1.EditorContexts, { readOnlyStudio: readOnly, children: [(0, jsx_runtime_1.jsx)(Editor_1.Editor, { readOnlyStudio: readOnly, Root: rootComponent }), readOnly
28
+ return ((0, jsx_runtime_1.jsx)(remotion_1.Internals.RemotionRoot, { logLevel: window.remotion_logLevel, numberOfAudioTags: window.remotion_numberOfAudioTags, onlyRenderComposition: null, currentCompositionMetadata: null, children: (0, jsx_runtime_1.jsxs)(EditorContexts_1.EditorContexts, { readOnlyStudio: readOnly, children: [(0, jsx_runtime_1.jsx)(Editor_1.Editor, { readOnlyStudio: readOnly, Root: rootComponent }), readOnly
29
29
  ? null
30
30
  : (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)(ServerDisconnected_1.ServerDisconnected, {}), getServerDisconnectedDomElement())] }) }));
31
31
  };
@@ -1,4 +1,4 @@
1
- import type { AnyComposition } from 'remotion';
1
+ import type { _InternalTypes } from 'remotion';
2
2
  import type { AnyZodObject } from 'zod';
3
3
  export type UpdateDefaultPropsFunction = (currentValues: {
4
4
  schema: AnyZodObject | null;
@@ -6,6 +6,6 @@ export type UpdateDefaultPropsFunction = (currentValues: {
6
6
  unsavedDefaultProps: Record<string, unknown>;
7
7
  }) => Record<string, unknown>;
8
8
  export declare const calcNewProps: (compositionId: string, defaultProps: UpdateDefaultPropsFunction) => {
9
- composition: AnyComposition;
9
+ composition: _InternalTypes["AnyComposition"];
10
10
  generatedDefaultProps: Record<string, unknown>;
11
11
  };
@@ -146,7 +146,8 @@ const AssetSelectorItem = ({ item, tabIndex, level, parentFolder }) => {
146
146
  const onPointerEnter = (0, react_1.useCallback)(() => {
147
147
  setHovered(true);
148
148
  }, []);
149
- const { canvasContent, setCanvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
149
+ const { setCanvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionSetters);
150
+ const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
150
151
  const selected = (0, react_1.useMemo)(() => {
151
152
  if (canvasContent && canvasContent.type === 'asset') {
152
153
  const nameWOParent = canvasContent.asset.split('/').pop();
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
- import { type AnyComposition } from 'remotion';
2
+ import { type _InternalTypes } from 'remotion';
3
3
  export type CompositionSelectorItemType = {
4
4
  key: string;
5
5
  type: 'composition';
6
- composition: AnyComposition;
6
+ composition: _InternalTypes['AnyComposition'];
7
7
  } | {
8
8
  key: string;
9
9
  type: 'folder';
@@ -16,7 +16,7 @@ export declare const CompositionSelectorItem: React.FC<{
16
16
  readonly item: CompositionSelectorItemType;
17
17
  readonly currentComposition: string | null;
18
18
  readonly tabIndex: number;
19
- readonly selectComposition: (c: AnyComposition, push: boolean) => void;
19
+ readonly selectComposition: (c: _InternalTypes['AnyComposition'], push: boolean) => void;
20
20
  readonly toggleFolder: (folderName: string, parentName: string | null) => void;
21
21
  readonly level: number;
22
22
  }>;
@@ -1,5 +1,5 @@
1
1
  import type React from 'react';
2
- import type { AnyComposition } from 'remotion';
2
+ import type { _InternalTypes } from 'remotion';
3
3
  export declare const useSelectAsset: () => (asset: string) => void;
4
- export declare const useSelectComposition: () => (c: AnyComposition, push: boolean) => void;
4
+ export declare const useSelectComposition: () => (c: _InternalTypes["AnyComposition"], push: boolean) => void;
5
5
  export declare const InitialCompositionLoader: React.FC;
@@ -12,7 +12,7 @@ const CompositionSelector_1 = require("./CompositionSelector");
12
12
  const ExplorerPanel_1 = require("./ExplorerPanel");
13
13
  const load_canvas_content_from_url_1 = require("./load-canvas-content-from-url");
14
14
  const useSelectAsset = () => {
15
- const { setCanvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
15
+ const { setCanvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionSetters);
16
16
  const { setAssetFoldersExpanded } = (0, react_1.useContext)(folders_1.FolderContext);
17
17
  return (asset) => {
18
18
  var _a;
@@ -36,7 +36,7 @@ const useSelectAsset = () => {
36
36
  exports.useSelectAsset = useSelectAsset;
37
37
  const useSelectComposition = () => {
38
38
  const { setCompositionFoldersExpanded } = (0, react_1.useContext)(folders_1.FolderContext);
39
- const { setCanvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
39
+ const { setCanvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionSetters);
40
40
  const isMobileLayout = (0, mobile_layout_1.useMobileLayout)();
41
41
  const { setSidebarCollapsedState } = (0, react_1.useContext)(sidebar_1.SidebarContext);
42
42
  return (0, react_1.useCallback)((c, push) => {
@@ -71,7 +71,8 @@ const useSelectComposition = () => {
71
71
  };
72
72
  exports.useSelectComposition = useSelectComposition;
73
73
  const InitialCompositionLoader = () => {
74
- const { compositions, canvasContent, setCanvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
74
+ const { compositions, canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
75
+ const { setCanvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionSetters);
75
76
  const selectComposition = (0, exports.useSelectComposition)();
76
77
  const selectAsset = (0, exports.useSelectAsset)();
77
78
  (0, react_1.useEffect)(() => {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import type { AnyComposition } from 'remotion';
2
+ import type { _InternalTypes } from 'remotion';
3
3
  export type State = {
4
4
  str: string;
5
5
  value: Record<string, unknown>;
@@ -12,7 +12,7 @@ export type State = {
12
12
  };
13
13
  export type PropsEditType = 'input-props' | 'default-props';
14
14
  export declare const DataEditor: React.FC<{
15
- readonly unresolvedComposition: AnyComposition;
15
+ readonly unresolvedComposition: _InternalTypes['AnyComposition'];
16
16
  readonly defaultProps: Record<string, unknown>;
17
17
  readonly setDefaultProps: React.Dispatch<React.SetStateAction<Record<string, unknown>>>;
18
18
  readonly mayShowSaveButton: boolean;
@@ -90,7 +90,7 @@ const setPersistedShowWarningState = (val) => {
90
90
  const DataEditor = ({ unresolvedComposition, defaultProps, setDefaultProps, mayShowSaveButton, propsEditType, saving, setSaving, readOnlyStudio, }) => {
91
91
  const [mode, setMode] = (0, react_1.useState)('schema');
92
92
  const [showWarning, setShowWarningWithoutPersistance] = (0, react_1.useState)(() => getPersistedShowWarningState());
93
- const { updateCompositionDefaultProps } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
93
+ const { updateCompositionDefaultProps } = (0, react_1.useContext)(remotion_1.Internals.CompositionSetters);
94
94
  const inJSONEditor = mode === 'json';
95
95
  const serializedJSON = (0, react_1.useMemo)(() => {
96
96
  if (!inJSONEditor) {
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
- import type { AnyComposition, VideoConfig } from 'remotion';
2
+ import type { _InternalTypes, VideoConfig } from 'remotion';
3
3
  type TResolvedCompositionContext = {
4
- unresolved: AnyComposition;
4
+ unresolved: _InternalTypes['AnyComposition'];
5
5
  resolved: {
6
6
  type: 'success';
7
7
  result: VideoConfig;
@@ -42,7 +42,7 @@ const subtitle = {
42
42
  const SELECTED_CLASSNAME = '__remotion_selected_classname';
43
43
  const RenderQueueItem = ({ job, selected }) => {
44
44
  const [hovered, setHovered] = (0, react_1.useState)(false);
45
- const { setCanvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
45
+ const { setCanvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionSetters);
46
46
  const onPointerEnter = (0, react_1.useCallback)(() => {
47
47
  setHovered(true);
48
48
  }, []);
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import type { AnyCompMetadata } from 'remotion';
2
+ import type { _InternalTypes } from 'remotion';
3
3
  export declare const SidebarRenderButton: React.FC<{
4
- readonly composition: AnyCompMetadata;
4
+ readonly composition: _InternalTypes['AnyCompMetadata'];
5
5
  readonly visible: boolean;
6
6
  }>;
@@ -483,7 +483,7 @@ import { Internals as Internals2 } from "remotion";
483
483
 
484
484
  // src/helpers/url-state.ts
485
485
  var getUrlHandlingType = () => {
486
- if (window.process.env.NODE_ENV === "production") {
486
+ if (window.remotion_isReadOnlyStudio) {
487
487
  return "query-string";
488
488
  }
489
489
  return "spa";
@@ -3648,7 +3648,8 @@ var AssetSelectorItem = ({ item, tabIndex, level, parentFolder }) => {
3648
3648
  const onPointerEnter = useCallback17(() => {
3649
3649
  setHovered(true);
3650
3650
  }, []);
3651
- const { canvasContent, setCanvasContent } = useContext10(Internals8.CompositionManager);
3651
+ const { setCanvasContent } = useContext10(Internals8.CompositionSetters);
3652
+ const { canvasContent } = useContext10(Internals8.CompositionManager);
3652
3653
  const selected = useMemo23(() => {
3653
3654
  if (canvasContent && canvasContent.type === "asset") {
3654
3655
  const nameWOParent = canvasContent.asset.split("/").pop();
@@ -4053,7 +4054,7 @@ var ExplorerPanel = ({ readOnlyStudio }) => {
4053
4054
 
4054
4055
  // src/components/InitialCompositionLoader.tsx
4055
4056
  var useSelectAsset = () => {
4056
- const { setCanvasContent } = useContext12(Internals9.CompositionManager);
4057
+ const { setCanvasContent } = useContext12(Internals9.CompositionSetters);
4057
4058
  const { setAssetFoldersExpanded } = useContext12(FolderContext);
4058
4059
  return (asset) => {
4059
4060
  setCanvasContent({ type: "asset", asset });
@@ -4075,7 +4076,7 @@ var useSelectAsset = () => {
4075
4076
  };
4076
4077
  var useSelectComposition = () => {
4077
4078
  const { setCompositionFoldersExpanded } = useContext12(FolderContext);
4078
- const { setCanvasContent } = useContext12(Internals9.CompositionManager);
4079
+ const { setCanvasContent } = useContext12(Internals9.CompositionSetters);
4079
4080
  const isMobileLayout = useMobileLayout();
4080
4081
  const { setSidebarCollapsedState } = useContext12(SidebarContext);
4081
4082
  return useCallback21((c, push) => {
@@ -4108,7 +4109,8 @@ var useSelectComposition = () => {
4108
4109
  ]);
4109
4110
  };
4110
4111
  var InitialCompositionLoader = () => {
4111
- const { compositions, canvasContent, setCanvasContent } = useContext12(Internals9.CompositionManager);
4112
+ const { compositions, canvasContent } = useContext12(Internals9.CompositionManager);
4113
+ const { setCanvasContent } = useContext12(Internals9.CompositionSetters);
4112
4114
  const selectComposition = useSelectComposition();
4113
4115
  const selectAsset = useSelectAsset();
4114
4116
  useEffect13(() => {
@@ -10118,7 +10120,7 @@ import React88, {
10118
10120
  useMemo as useMemo76,
10119
10121
  useState as useState46
10120
10122
  } from "react";
10121
- import { Internals as Internals30, getInputProps } from "remotion";
10123
+ import { getInputProps, Internals as Internals30 } from "remotion";
10122
10124
  import { NoReactInternals as NoReactInternals10 } from "remotion/no-react";
10123
10125
 
10124
10126
  // src/components/NewComposition/ValidationMessage.tsx
@@ -14411,7 +14413,7 @@ var DataEditor = ({
14411
14413
  }) => {
14412
14414
  const [mode, setMode] = useState46("schema");
14413
14415
  const [showWarning, setShowWarningWithoutPersistance] = useState46(() => getPersistedShowWarningState());
14414
- const { updateCompositionDefaultProps } = useContext34(Internals30.CompositionManager);
14416
+ const { updateCompositionDefaultProps } = useContext34(Internals30.CompositionSetters);
14415
14417
  const inJSONEditor = mode === "json";
14416
14418
  const serializedJSON = useMemo76(() => {
14417
14419
  if (!inJSONEditor) {
@@ -15280,7 +15282,7 @@ var subtitle2 = {
15280
15282
  var SELECTED_CLASSNAME = "__remotion_selected_classname";
15281
15283
  var RenderQueueItem = ({ job, selected }) => {
15282
15284
  const [hovered, setHovered] = useState47(false);
15283
- const { setCanvasContent } = useContext39(Internals31.CompositionManager);
15285
+ const { setCanvasContent } = useContext39(Internals31.CompositionSetters);
15284
15286
  const onPointerEnter = useCallback73(() => {
15285
15287
  setHovered(true);
15286
15288
  }, []);
@@ -27693,6 +27695,8 @@ var Studio = ({ rootComponent, readOnly }) => {
27693
27695
  return /* @__PURE__ */ jsx261(Internals62.RemotionRoot, {
27694
27696
  logLevel: window.remotion_logLevel,
27695
27697
  numberOfAudioTags: window.remotion_numberOfAudioTags,
27698
+ onlyRenderComposition: null,
27699
+ currentCompositionMetadata: null,
27696
27700
  children: /* @__PURE__ */ jsxs134(EditorContexts, {
27697
27701
  readOnlyStudio: readOnly,
27698
27702
  children: [