@remotion/studio 4.0.414 → 4.0.415
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.
- package/dist/FastRefreshProvider.d.ts +4 -0
- package/dist/FastRefreshProvider.js +27 -0
- package/dist/ResolveCompositionConfigInStudio.d.ts +5 -0
- package/dist/ResolveCompositionConfigInStudio.js +273 -0
- package/dist/Studio.js +11 -4
- package/dist/api/visual-control.js +1 -1
- package/dist/components/GlobalPropsEditorUpdateButton.js +2 -1
- package/dist/components/RenderModal/DataEditor.js +2 -1
- package/dist/components/VisualControls/VisualControlHandle.js +2 -3
- package/dist/esm/{chunk-t3rf3vkq.js → chunk-wg48cezw.js} +409 -102
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/internals.mjs +409 -102
- package/dist/esm/previewEntry.mjs +421 -114
- package/dist/esm/renderEntry.mjs +3 -1
- package/dist/fast-refresh-context.d.ts +6 -0
- package/dist/fast-refresh-context.js +9 -0
- package/dist/renderEntry.js +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FastRefreshProvider = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const fast_refresh_context_1 = require("./fast-refresh-context");
|
|
7
|
+
const FastRefreshProvider = ({ children }) => {
|
|
8
|
+
const [fastRefreshes, setFastRefreshes] = (0, react_1.useState)(0);
|
|
9
|
+
const [manualRefreshes, setManualRefreshes] = (0, react_1.useState)(0);
|
|
10
|
+
const increaseManualRefreshes = (0, react_1.useCallback)(() => {
|
|
11
|
+
setManualRefreshes((i) => i + 1);
|
|
12
|
+
}, []);
|
|
13
|
+
(0, react_1.useEffect)(() => {
|
|
14
|
+
if (typeof __webpack_module__ !== 'undefined') {
|
|
15
|
+
if (__webpack_module__.hot) {
|
|
16
|
+
__webpack_module__.hot.addStatusHandler((status) => {
|
|
17
|
+
if (status === 'idle') {
|
|
18
|
+
setFastRefreshes((i) => i + 1);
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}, []);
|
|
24
|
+
const value = (0, react_1.useMemo)(() => ({ fastRefreshes, manualRefreshes, increaseManualRefreshes }), [fastRefreshes, manualRefreshes, increaseManualRefreshes]);
|
|
25
|
+
return ((0, jsx_runtime_1.jsx)(fast_refresh_context_1.FastRefreshContext.Provider, { value: value, children: children }));
|
|
26
|
+
};
|
|
27
|
+
exports.FastRefreshProvider = FastRefreshProvider;
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ResolveCompositionConfigInStudio = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const remotion_1 = require("remotion");
|
|
7
|
+
const fast_refresh_context_1 = require("./fast-refresh-context");
|
|
8
|
+
const ResolveCompositionConfigInStudio = ({ children }) => {
|
|
9
|
+
const [currentRenderModalComposition, setCurrentRenderModalComposition] = (0, react_1.useState)(null);
|
|
10
|
+
const { compositions, canvasContent, currentCompositionMetadata } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
11
|
+
const { fastRefreshes, manualRefreshes } = (0, react_1.useContext)(fast_refresh_context_1.FastRefreshContext);
|
|
12
|
+
// don't do anything, this component should should re-render if the value changes
|
|
13
|
+
if (manualRefreshes) {
|
|
14
|
+
/** */
|
|
15
|
+
}
|
|
16
|
+
const selectedComposition = (0, react_1.useMemo)(() => {
|
|
17
|
+
return compositions.find((c) => canvasContent &&
|
|
18
|
+
canvasContent.type === 'composition' &&
|
|
19
|
+
canvasContent.compositionId === c.id);
|
|
20
|
+
}, [canvasContent, compositions]);
|
|
21
|
+
const renderModalComposition = compositions.find((c) => c.id === currentRenderModalComposition);
|
|
22
|
+
const { props: allEditorProps } = (0, react_1.useContext)(remotion_1.Internals.EditorPropsContext);
|
|
23
|
+
const env = remotion_1.Internals.getRemotionEnvironment();
|
|
24
|
+
const inputProps = (0, react_1.useMemo)(() => {
|
|
25
|
+
var _a;
|
|
26
|
+
return typeof window === 'undefined' || env.isPlayer
|
|
27
|
+
? {}
|
|
28
|
+
: ((_a = (0, remotion_1.getInputProps)()) !== null && _a !== void 0 ? _a : {});
|
|
29
|
+
}, [env.isPlayer]);
|
|
30
|
+
const [resolvedConfigs, setResolvedConfigs] = (0, react_1.useState)({});
|
|
31
|
+
const selectedEditorProps = (0, react_1.useMemo)(() => {
|
|
32
|
+
var _a;
|
|
33
|
+
return selectedComposition
|
|
34
|
+
? ((_a = allEditorProps[selectedComposition.id]) !== null && _a !== void 0 ? _a : {})
|
|
35
|
+
: {};
|
|
36
|
+
}, [allEditorProps, selectedComposition]);
|
|
37
|
+
const renderModalProps = (0, react_1.useMemo)(() => {
|
|
38
|
+
var _a;
|
|
39
|
+
return renderModalComposition
|
|
40
|
+
? ((_a = allEditorProps[renderModalComposition.id]) !== null && _a !== void 0 ? _a : {})
|
|
41
|
+
: {};
|
|
42
|
+
}, [allEditorProps, renderModalComposition]);
|
|
43
|
+
const hasResolution = Boolean(currentCompositionMetadata);
|
|
44
|
+
const doResolution = (0, react_1.useCallback)(({ calculateMetadata, combinedProps, compositionDurationInFrames, compositionFps, compositionHeight, compositionId, compositionWidth, defaultProps, }) => {
|
|
45
|
+
const controller = new AbortController();
|
|
46
|
+
if (hasResolution) {
|
|
47
|
+
return controller;
|
|
48
|
+
}
|
|
49
|
+
const { signal } = controller;
|
|
50
|
+
const result = remotion_1.Internals.resolveVideoConfigOrCatch({
|
|
51
|
+
compositionId,
|
|
52
|
+
calculateMetadata: calculateMetadata,
|
|
53
|
+
inputProps: combinedProps,
|
|
54
|
+
signal,
|
|
55
|
+
defaultProps,
|
|
56
|
+
compositionDurationInFrames,
|
|
57
|
+
compositionFps,
|
|
58
|
+
compositionHeight,
|
|
59
|
+
compositionWidth,
|
|
60
|
+
});
|
|
61
|
+
if (result.type === 'error') {
|
|
62
|
+
setResolvedConfigs((r) => ({
|
|
63
|
+
...r,
|
|
64
|
+
[compositionId]: {
|
|
65
|
+
type: 'error',
|
|
66
|
+
error: result.error,
|
|
67
|
+
},
|
|
68
|
+
}));
|
|
69
|
+
return controller;
|
|
70
|
+
}
|
|
71
|
+
const promOrNot = result.result;
|
|
72
|
+
if (typeof promOrNot === 'object' && 'then' in promOrNot) {
|
|
73
|
+
setResolvedConfigs((r) => {
|
|
74
|
+
const prev = r[compositionId];
|
|
75
|
+
if ((prev === null || prev === void 0 ? void 0 : prev.type) === 'success' ||
|
|
76
|
+
(prev === null || prev === void 0 ? void 0 : prev.type) === 'success-and-refreshing') {
|
|
77
|
+
return {
|
|
78
|
+
...r,
|
|
79
|
+
[compositionId]: {
|
|
80
|
+
type: 'success-and-refreshing',
|
|
81
|
+
result: prev.result,
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
return {
|
|
86
|
+
...r,
|
|
87
|
+
[compositionId]: {
|
|
88
|
+
type: 'loading',
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
});
|
|
92
|
+
promOrNot
|
|
93
|
+
.then((c) => {
|
|
94
|
+
if (controller.signal.aborted) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
setResolvedConfigs((r) => ({
|
|
98
|
+
...r,
|
|
99
|
+
[compositionId]: {
|
|
100
|
+
type: 'success',
|
|
101
|
+
result: c,
|
|
102
|
+
},
|
|
103
|
+
}));
|
|
104
|
+
})
|
|
105
|
+
.catch((err) => {
|
|
106
|
+
if (controller.signal.aborted) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
setResolvedConfigs((r) => ({
|
|
110
|
+
...r,
|
|
111
|
+
[compositionId]: {
|
|
112
|
+
type: 'error',
|
|
113
|
+
error: err,
|
|
114
|
+
},
|
|
115
|
+
}));
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
setResolvedConfigs((r) => ({
|
|
120
|
+
...r,
|
|
121
|
+
[compositionId]: {
|
|
122
|
+
type: 'success',
|
|
123
|
+
result: promOrNot,
|
|
124
|
+
},
|
|
125
|
+
}));
|
|
126
|
+
}
|
|
127
|
+
return controller;
|
|
128
|
+
}, [hasResolution]);
|
|
129
|
+
const currentComposition = (canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'composition' ? canvasContent.compositionId : null;
|
|
130
|
+
(0, react_1.useImperativeHandle)(remotion_1.Internals.resolveCompositionsRef, () => {
|
|
131
|
+
return {
|
|
132
|
+
setCurrentRenderModalComposition: (id) => {
|
|
133
|
+
setCurrentRenderModalComposition(id);
|
|
134
|
+
},
|
|
135
|
+
reloadCurrentlySelectedComposition: () => {
|
|
136
|
+
var _a, _b, _c, _d, _e, _f;
|
|
137
|
+
if (!currentComposition) {
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
const composition = compositions.find((c) => c.id === currentComposition);
|
|
141
|
+
if (!composition) {
|
|
142
|
+
throw new Error(`Could not find composition with id ${currentComposition}`);
|
|
143
|
+
}
|
|
144
|
+
const editorProps = (_a = allEditorProps[currentComposition]) !== null && _a !== void 0 ? _a : {};
|
|
145
|
+
const defaultProps = {
|
|
146
|
+
...((_b = composition.defaultProps) !== null && _b !== void 0 ? _b : {}),
|
|
147
|
+
...(editorProps !== null && editorProps !== void 0 ? editorProps : {}),
|
|
148
|
+
};
|
|
149
|
+
const props = {
|
|
150
|
+
...defaultProps,
|
|
151
|
+
...(inputProps !== null && inputProps !== void 0 ? inputProps : {}),
|
|
152
|
+
};
|
|
153
|
+
doResolution({
|
|
154
|
+
defaultProps,
|
|
155
|
+
calculateMetadata: composition.calculateMetadata,
|
|
156
|
+
combinedProps: props,
|
|
157
|
+
compositionDurationInFrames: (_c = composition.durationInFrames) !== null && _c !== void 0 ? _c : null,
|
|
158
|
+
compositionFps: (_d = composition.fps) !== null && _d !== void 0 ? _d : null,
|
|
159
|
+
compositionHeight: (_e = composition.height) !== null && _e !== void 0 ? _e : null,
|
|
160
|
+
compositionWidth: (_f = composition.width) !== null && _f !== void 0 ? _f : null,
|
|
161
|
+
compositionId: composition.id,
|
|
162
|
+
});
|
|
163
|
+
},
|
|
164
|
+
};
|
|
165
|
+
}, [
|
|
166
|
+
allEditorProps,
|
|
167
|
+
compositions,
|
|
168
|
+
currentComposition,
|
|
169
|
+
doResolution,
|
|
170
|
+
inputProps,
|
|
171
|
+
]);
|
|
172
|
+
const isTheSame = (selectedComposition === null || selectedComposition === void 0 ? void 0 : selectedComposition.id) === (renderModalComposition === null || renderModalComposition === void 0 ? void 0 : renderModalComposition.id);
|
|
173
|
+
const currentDefaultProps = (0, react_1.useMemo)(() => {
|
|
174
|
+
var _a;
|
|
175
|
+
return {
|
|
176
|
+
...((_a = selectedComposition === null || selectedComposition === void 0 ? void 0 : selectedComposition.defaultProps) !== null && _a !== void 0 ? _a : {}),
|
|
177
|
+
...(selectedEditorProps !== null && selectedEditorProps !== void 0 ? selectedEditorProps : {}),
|
|
178
|
+
};
|
|
179
|
+
}, [selectedComposition === null || selectedComposition === void 0 ? void 0 : selectedComposition.defaultProps, selectedEditorProps]);
|
|
180
|
+
const originalProps = (0, react_1.useMemo)(() => {
|
|
181
|
+
return {
|
|
182
|
+
...currentDefaultProps,
|
|
183
|
+
...(inputProps !== null && inputProps !== void 0 ? inputProps : {}),
|
|
184
|
+
};
|
|
185
|
+
}, [currentDefaultProps, inputProps]);
|
|
186
|
+
const canResolve = selectedComposition && Boolean(selectedComposition.calculateMetadata);
|
|
187
|
+
const shouldIgnoreUpdate = typeof window !== 'undefined' &&
|
|
188
|
+
window.remotion_ignoreFastRefreshUpdate &&
|
|
189
|
+
fastRefreshes <= window.remotion_ignoreFastRefreshUpdate;
|
|
190
|
+
(0, react_1.useEffect)(() => {
|
|
191
|
+
var _a, _b, _c, _d;
|
|
192
|
+
if (shouldIgnoreUpdate) {
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
if (canResolve) {
|
|
196
|
+
const controller = doResolution({
|
|
197
|
+
calculateMetadata: selectedComposition.calculateMetadata,
|
|
198
|
+
combinedProps: originalProps,
|
|
199
|
+
compositionDurationInFrames: (_a = selectedComposition.durationInFrames) !== null && _a !== void 0 ? _a : null,
|
|
200
|
+
compositionFps: (_b = selectedComposition.fps) !== null && _b !== void 0 ? _b : null,
|
|
201
|
+
compositionHeight: (_c = selectedComposition.height) !== null && _c !== void 0 ? _c : null,
|
|
202
|
+
compositionWidth: (_d = selectedComposition.width) !== null && _d !== void 0 ? _d : null,
|
|
203
|
+
defaultProps: currentDefaultProps,
|
|
204
|
+
compositionId: selectedComposition.id,
|
|
205
|
+
});
|
|
206
|
+
return () => {
|
|
207
|
+
controller.abort();
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
}, [
|
|
211
|
+
canResolve,
|
|
212
|
+
currentDefaultProps,
|
|
213
|
+
doResolution,
|
|
214
|
+
originalProps,
|
|
215
|
+
selectedComposition === null || selectedComposition === void 0 ? void 0 : selectedComposition.calculateMetadata,
|
|
216
|
+
selectedComposition === null || selectedComposition === void 0 ? void 0 : selectedComposition.durationInFrames,
|
|
217
|
+
selectedComposition === null || selectedComposition === void 0 ? void 0 : selectedComposition.fps,
|
|
218
|
+
selectedComposition === null || selectedComposition === void 0 ? void 0 : selectedComposition.height,
|
|
219
|
+
selectedComposition === null || selectedComposition === void 0 ? void 0 : selectedComposition.id,
|
|
220
|
+
selectedComposition === null || selectedComposition === void 0 ? void 0 : selectedComposition.width,
|
|
221
|
+
shouldIgnoreUpdate,
|
|
222
|
+
]);
|
|
223
|
+
(0, react_1.useEffect)(() => {
|
|
224
|
+
var _a, _b, _c, _d, _e;
|
|
225
|
+
if (renderModalComposition && !isTheSame) {
|
|
226
|
+
const combinedProps = {
|
|
227
|
+
...((_a = renderModalComposition.defaultProps) !== null && _a !== void 0 ? _a : {}),
|
|
228
|
+
...(renderModalProps !== null && renderModalProps !== void 0 ? renderModalProps : {}),
|
|
229
|
+
...(inputProps !== null && inputProps !== void 0 ? inputProps : {}),
|
|
230
|
+
};
|
|
231
|
+
const controller = doResolution({
|
|
232
|
+
calculateMetadata: renderModalComposition.calculateMetadata,
|
|
233
|
+
compositionDurationInFrames: (_b = renderModalComposition.durationInFrames) !== null && _b !== void 0 ? _b : null,
|
|
234
|
+
compositionFps: (_c = renderModalComposition.fps) !== null && _c !== void 0 ? _c : null,
|
|
235
|
+
compositionHeight: (_d = renderModalComposition.height) !== null && _d !== void 0 ? _d : null,
|
|
236
|
+
compositionId: renderModalComposition.id,
|
|
237
|
+
compositionWidth: (_e = renderModalComposition.width) !== null && _e !== void 0 ? _e : null,
|
|
238
|
+
defaultProps: currentDefaultProps,
|
|
239
|
+
combinedProps,
|
|
240
|
+
});
|
|
241
|
+
return () => {
|
|
242
|
+
controller.abort();
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
}, [
|
|
246
|
+
currentDefaultProps,
|
|
247
|
+
doResolution,
|
|
248
|
+
inputProps,
|
|
249
|
+
isTheSame,
|
|
250
|
+
renderModalComposition,
|
|
251
|
+
renderModalProps,
|
|
252
|
+
]);
|
|
253
|
+
const resolvedConfigsIncludingStaticOnes = (0, react_1.useMemo)(() => {
|
|
254
|
+
const staticComps = compositions.filter((c) => {
|
|
255
|
+
return c.calculateMetadata === null;
|
|
256
|
+
});
|
|
257
|
+
return {
|
|
258
|
+
...resolvedConfigs,
|
|
259
|
+
...staticComps.reduce((acc, curr) => {
|
|
260
|
+
var _a;
|
|
261
|
+
return {
|
|
262
|
+
...acc,
|
|
263
|
+
[curr.id]: {
|
|
264
|
+
type: 'success',
|
|
265
|
+
result: { ...curr, defaultProps: (_a = curr.defaultProps) !== null && _a !== void 0 ? _a : {} },
|
|
266
|
+
},
|
|
267
|
+
};
|
|
268
|
+
}, {}),
|
|
269
|
+
};
|
|
270
|
+
}, [compositions, resolvedConfigs]);
|
|
271
|
+
return ((0, jsx_runtime_1.jsx)(remotion_1.Internals.ResolveCompositionContext.Provider, { value: resolvedConfigsIncludingStaticOnes, children: children }));
|
|
272
|
+
};
|
|
273
|
+
exports.ResolveCompositionConfigInStudio = ResolveCompositionConfigInStudio;
|
package/dist/Studio.js
CHANGED
|
@@ -8,17 +8,24 @@ const remotion_1 = require("remotion");
|
|
|
8
8
|
const Editor_1 = require("./components/Editor");
|
|
9
9
|
const EditorContexts_1 = require("./components/EditorContexts");
|
|
10
10
|
const ServerDisconnected_1 = require("./components/Notifications/ServerDisconnected");
|
|
11
|
+
const fast_refresh_context_1 = require("./fast-refresh-context");
|
|
12
|
+
const FastRefreshProvider_1 = require("./FastRefreshProvider");
|
|
11
13
|
const inject_css_1 = require("./helpers/inject-css");
|
|
14
|
+
const ResolveCompositionConfigInStudio_1 = require("./ResolveCompositionConfigInStudio");
|
|
12
15
|
const getServerDisconnectedDomElement = () => {
|
|
13
16
|
return document.getElementById('server-disconnected-overlay');
|
|
14
17
|
};
|
|
15
|
-
const
|
|
18
|
+
const StudioInner = ({ rootComponent, readOnly }) => {
|
|
16
19
|
var _a;
|
|
20
|
+
const { fastRefreshes, manualRefreshes } = (0, react_1.useContext)(fast_refresh_context_1.FastRefreshContext);
|
|
21
|
+
return ((0, jsx_runtime_1.jsx)(remotion_1.Internals.CompositionManagerProvider, { onlyRenderComposition: null, currentCompositionMetadata: null, initialCompositions: [], initialCanvasContent: null, children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.RemotionRootContexts, { frameState: null, audioEnabled: window.remotion_audioEnabled, videoEnabled: window.remotion_videoEnabled, logLevel: window.remotion_logLevel, numberOfAudioTags: window.remotion_numberOfAudioTags, audioLatencyHint: (_a = window.remotion_audioLatencyHint) !== null && _a !== void 0 ? _a : 'interactive', nonceContextSeed: fastRefreshes + manualRefreshes, children: (0, jsx_runtime_1.jsx)(ResolveCompositionConfigInStudio_1.ResolveCompositionConfigInStudio, { 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
|
|
22
|
+
? null
|
|
23
|
+
: (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)(ServerDisconnected_1.ServerDisconnected, {}), getServerDisconnectedDomElement())] }) }) }) }));
|
|
24
|
+
};
|
|
25
|
+
const Studio = ({ rootComponent, readOnly }) => {
|
|
17
26
|
(0, react_1.useLayoutEffect)(() => {
|
|
18
27
|
(0, inject_css_1.injectCSS)();
|
|
19
28
|
}, []);
|
|
20
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
21
|
-
? null
|
|
22
|
-
: (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)(ServerDisconnected_1.ServerDisconnected, {}), getServerDisconnectedDomElement())] }) }) }) }));
|
|
29
|
+
return ((0, jsx_runtime_1.jsx)(FastRefreshProvider_1.FastRefreshProvider, { children: (0, jsx_runtime_1.jsx)(StudioInner, { rootComponent: rootComponent, readOnly: readOnly }) }));
|
|
23
30
|
};
|
|
24
31
|
exports.Studio = Studio;
|
|
@@ -8,7 +8,7 @@ const visualControl = (key, value, schema) => {
|
|
|
8
8
|
return value;
|
|
9
9
|
}
|
|
10
10
|
if (!VisualControls_1.visualControlRef.current) {
|
|
11
|
-
|
|
11
|
+
return value;
|
|
12
12
|
}
|
|
13
13
|
return VisualControls_1.visualControlRef.current.globalVisualControl(key, value, schema);
|
|
14
14
|
};
|
|
@@ -38,6 +38,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
38
38
|
const react_1 = __importStar(require("react"));
|
|
39
39
|
const remotion_1 = require("remotion");
|
|
40
40
|
const save_default_props_1 = require("../api/save-default-props");
|
|
41
|
+
const fast_refresh_context_1 = require("../fast-refresh-context");
|
|
41
42
|
const NotificationCenter_1 = require("./Notifications/NotificationCenter");
|
|
42
43
|
const SchemaResetButton_1 = require("./RenderModal/SchemaEditor/SchemaResetButton");
|
|
43
44
|
const SchemaSaveButton_1 = require("./RenderModal/SchemaEditor/SchemaSaveButton");
|
|
@@ -46,7 +47,7 @@ const container = {
|
|
|
46
47
|
flexDirection: 'row',
|
|
47
48
|
};
|
|
48
49
|
const GlobalPropsEditorUpdateButton = ({ compositionId, currentDefaultProps }) => {
|
|
49
|
-
const { fastRefreshes } = (0, react_1.useContext)(
|
|
50
|
+
const { fastRefreshes } = (0, react_1.useContext)(fast_refresh_context_1.FastRefreshContext);
|
|
50
51
|
const [disabled, setDisabled] = react_1.default.useState(false);
|
|
51
52
|
const onClicked = (0, react_1.useCallback)(() => {
|
|
52
53
|
setDisabled(true);
|
|
@@ -38,6 +38,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
38
38
|
const react_1 = __importStar(require("react"));
|
|
39
39
|
const remotion_1 = require("remotion");
|
|
40
40
|
const no_react_1 = require("remotion/no-react");
|
|
41
|
+
const fast_refresh_context_1 = require("../../fast-refresh-context");
|
|
41
42
|
const client_id_1 = require("../../helpers/client-id");
|
|
42
43
|
const colors_1 = require("../../helpers/colors");
|
|
43
44
|
const ValidationMessage_1 = require("../NewComposition/ValidationMessage");
|
|
@@ -156,7 +157,7 @@ const DataEditor = ({ unresolvedComposition, defaultProps, setDefaultProps, mayS
|
|
|
156
157
|
: get_render_modal_warnings_1.defaultTypeCanSaveState;
|
|
157
158
|
}, [canSaveDefaultPropsObjectState, unresolvedComposition.id]);
|
|
158
159
|
const showSaveButton = mayShowSaveButton && canSaveDefaultProps.canUpdate;
|
|
159
|
-
const { fastRefreshes } = (0, react_1.useContext)(
|
|
160
|
+
const { fastRefreshes } = (0, react_1.useContext)(fast_refresh_context_1.FastRefreshContext);
|
|
160
161
|
const checkIfCanSaveDefaultProps = (0, react_1.useCallback)(async () => {
|
|
161
162
|
try {
|
|
162
163
|
const can = await (0, actions_1.canUpdateDefaultProps)(unresolvedComposition.id, readOnlyStudio);
|
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.VisualControlHandle = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
-
const remotion_1 = require("remotion");
|
|
7
6
|
const no_react_1 = require("remotion/no-react");
|
|
7
|
+
const fast_refresh_context_1 = require("../../fast-refresh-context");
|
|
8
8
|
const VisualControls_1 = require("../../visual-controls/VisualControls");
|
|
9
9
|
const get_current_edited_value_1 = require("../../visual-controls/get-current-edited-value");
|
|
10
10
|
const NotificationCenter_1 = require("../Notifications/NotificationCenter");
|
|
@@ -24,8 +24,7 @@ const VisualControlHandle = ({ value, keyName }) => {
|
|
|
24
24
|
const zodTypes = (0, get_zod_if_possible_1.useZodTypesIfPossible)();
|
|
25
25
|
const state = (0, react_1.useContext)(VisualControls_1.VisualControlsContext);
|
|
26
26
|
const { updateValue } = (0, react_1.useContext)(VisualControls_1.SetVisualControlsContext);
|
|
27
|
-
const { fastRefreshes } = (0, react_1.useContext)(
|
|
28
|
-
const { increaseManualRefreshes } = (0, react_1.useContext)(remotion_1.Internals.SetNonceContext);
|
|
27
|
+
const { fastRefreshes, increaseManualRefreshes } = (0, react_1.useContext)(fast_refresh_context_1.FastRefreshContext);
|
|
29
28
|
const [saving, setSaving] = (0, react_1.useState)(false);
|
|
30
29
|
const currentValue = (0, get_current_edited_value_1.getVisualControlEditedValue)({
|
|
31
30
|
handles: state.handles,
|