@remotion/studio 4.0.462 → 4.0.463

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 (33) hide show
  1. package/dist/components/AssetSelector.js +2 -6
  2. package/dist/components/CompSelectorRef.js +2 -6
  3. package/dist/components/ExpandedTracksProvider.js +5 -20
  4. package/dist/components/Timeline/SubscribeToNodePaths.js +1 -6
  5. package/dist/components/Timeline/TimelineColorField.js +1 -1
  6. package/dist/components/Timeline/TimelineEffectFieldRow.js +21 -31
  7. package/dist/components/Timeline/TimelineEffectGroupRow.d.ts +17 -0
  8. package/dist/components/Timeline/TimelineEffectGroupRow.js +73 -0
  9. package/dist/components/Timeline/TimelineExpandedRow.js +4 -0
  10. package/dist/components/Timeline/TimelineFieldRow.js +5 -39
  11. package/dist/components/Timeline/TimelineLayerEye.d.ts +5 -3
  12. package/dist/components/Timeline/TimelineLayerEye.js +18 -1
  13. package/dist/components/Timeline/TimelineListItem.js +57 -14
  14. package/dist/components/Timeline/save-effect-prop.d.ts +12 -0
  15. package/dist/components/Timeline/save-effect-prop.js +42 -0
  16. package/dist/components/Timeline/save-prop-queue.d.ts +12 -0
  17. package/dist/components/Timeline/save-prop-queue.js +63 -0
  18. package/dist/components/Timeline/save-sequence-prop.d.ts +11 -0
  19. package/dist/components/Timeline/save-sequence-prop.js +38 -0
  20. package/dist/esm/chunk-5gtx3pza.js +9 -0
  21. package/dist/esm/{chunk-yvg1f56k.js → chunk-b0m62frw.js} +2327 -2028
  22. package/dist/esm/index.mjs +0 -16
  23. package/dist/esm/internals.mjs +2325 -2041
  24. package/dist/esm/previewEntry.mjs +2335 -2051
  25. package/dist/esm/renderEntry.mjs +3 -4
  26. package/dist/helpers/persist-boolean-map.d.ts +5 -0
  27. package/dist/helpers/persist-boolean-map.js +56 -0
  28. package/dist/helpers/persist-open-folders.d.ts +4 -3
  29. package/dist/helpers/persist-open-folders.js +4 -7
  30. package/dist/helpers/timeline-layout.d.ts +6 -1
  31. package/dist/helpers/timeline-layout.js +2 -0
  32. package/package.json +10 -10
  33. package/dist/esm/chunk-6jf1natv.js +0 -25
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.enqueueSavePropChange = void 0;
4
+ const remotion_1 = require("remotion");
5
+ const NotificationCenter_1 = require("../Notifications/NotificationCenter");
6
+ const queues = new Map();
7
+ const getQueue = (nodePath) => {
8
+ const key = remotion_1.Internals.makeSequencePropsSubscriptionKey(nodePath);
9
+ let q = queues.get(key);
10
+ if (!q) {
11
+ q = { chain: Promise.resolve(), cancelled: false, committed: null };
12
+ queues.set(key, q);
13
+ }
14
+ return q;
15
+ };
16
+ const dropQueue = (nodePath, q) => {
17
+ const key = remotion_1.Internals.makeSequencePropsSubscriptionKey(nodePath);
18
+ if (queues.get(key) === q) {
19
+ queues.delete(key);
20
+ }
21
+ };
22
+ const enqueueSavePropChange = ({ nodePath, setCodeValues, applyOptimistic, apiCall, mergeServerResponse, errorLabel, }) => {
23
+ const q = getQueue(nodePath);
24
+ if (q.cancelled) {
25
+ return Promise.resolve();
26
+ }
27
+ setCodeValues(nodePath, (prev) => {
28
+ if (q.committed === null) {
29
+ q.committed = prev;
30
+ }
31
+ return applyOptimistic(prev);
32
+ });
33
+ const myQueue = q;
34
+ const next = myQueue.chain.then(async () => {
35
+ if (myQueue.cancelled) {
36
+ return;
37
+ }
38
+ try {
39
+ const response = await apiCall();
40
+ if (myQueue.cancelled) {
41
+ return;
42
+ }
43
+ setCodeValues(nodePath, (prev) => mergeServerResponse(prev, response));
44
+ myQueue.committed = mergeServerResponse(myQueue.committed, response);
45
+ // If nothing more is queued, reset baseline so the next round starts fresh.
46
+ if (myQueue.chain === next) {
47
+ dropQueue(nodePath, myQueue);
48
+ }
49
+ }
50
+ catch (err) {
51
+ myQueue.cancelled = true;
52
+ const { committed } = myQueue;
53
+ if (committed !== null) {
54
+ setCodeValues(nodePath, () => committed);
55
+ }
56
+ dropQueue(nodePath, myQueue);
57
+ (0, NotificationCenter_1.showNotification)(`${errorLabel}: ${err instanceof Error ? err.message : String(err)}`, 4000);
58
+ }
59
+ });
60
+ myQueue.chain = next;
61
+ return next;
62
+ };
63
+ exports.enqueueSavePropChange = enqueueSavePropChange;
@@ -0,0 +1,11 @@
1
+ import type { CanUpdateSequencePropsResponse, SequencePropsSubscriptionKey, SequenceSchema } from 'remotion';
2
+ export type SetCodeValues = (nodePath: SequencePropsSubscriptionKey, values: (prev: CanUpdateSequencePropsResponse) => CanUpdateSequencePropsResponse) => void;
3
+ export declare const saveSequenceProp: ({ fileName, nodePath, fieldKey, value, defaultValue, schema, setCodeValues, }: {
4
+ fileName: string;
5
+ nodePath: SequencePropsSubscriptionKey;
6
+ fieldKey: string;
7
+ value: unknown;
8
+ defaultValue: string | null;
9
+ schema: SequenceSchema;
10
+ setCodeValues: SetCodeValues;
11
+ }) => Promise<void>;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.saveSequenceProp = void 0;
4
+ const studio_shared_1 = require("@remotion/studio-shared");
5
+ const call_api_1 = require("../call-api");
6
+ const save_prop_queue_1 = require("./save-prop-queue");
7
+ const saveSequenceProp = ({ fileName, nodePath, fieldKey, value, defaultValue, schema, setCodeValues, }) => {
8
+ return (0, save_prop_queue_1.enqueueSavePropChange)({
9
+ nodePath,
10
+ setCodeValues,
11
+ applyOptimistic: (prev) => (0, studio_shared_1.optimisticUpdateForCodeValues)({
12
+ previous: prev,
13
+ fieldKey,
14
+ value,
15
+ schema,
16
+ }),
17
+ apiCall: () => (0, call_api_1.callApi)('/api/save-sequence-props', {
18
+ fileName,
19
+ nodePath,
20
+ key: fieldKey,
21
+ value: JSON.stringify(value),
22
+ defaultValue,
23
+ schema,
24
+ }),
25
+ mergeServerResponse: (prev, data) => {
26
+ if (!data.canUpdate) {
27
+ return data;
28
+ }
29
+ return {
30
+ canUpdate: true,
31
+ props: data.props,
32
+ effects: prev.canUpdate ? prev.effects : [],
33
+ };
34
+ },
35
+ errorLabel: 'Could not save sequence prop',
36
+ });
37
+ };
38
+ exports.saveSequenceProp = saveSequenceProp;
@@ -0,0 +1,9 @@
1
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
2
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
3
+ }) : x)(function(x) {
4
+ if (typeof require !== "undefined")
5
+ return require.apply(this, arguments);
6
+ throw Error('Dynamic require of "' + x + '" is not supported');
7
+ });
8
+
9
+ export { __require };