@remotion/studio-shared 4.0.506 → 4.0.508
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/api-requests.d.ts +58 -24
- package/dist/config-method-lifecycles.d.ts +94 -0
- package/dist/config-method-lifecycles.js +97 -0
- package/dist/define-plugin-definitions.d.ts +1 -3
- package/dist/define-plugin-definitions.js +1 -2
- package/dist/easing-clipboard-data.js +1 -0
- package/dist/effect-catalog.js +69 -0
- package/dist/effect-clipboard-data.js +1 -0
- package/dist/element-drag-data.d.ts +3 -1
- package/dist/element-drag-data.js +11 -2
- package/dist/esm/index.mjs +181 -2
- package/dist/esm/keyframe-easing-presets.mjs +7 -0
- package/dist/event-source-event.d.ts +5 -0
- package/dist/index.d.ts +6 -2
- package/dist/index.js +7 -2
- package/dist/keyframe-easing-presets.d.ts +2 -1
- package/dist/keyframe-easing-presets.js +7 -1
- package/dist/package-info.d.ts +2 -2
- package/dist/package-info.js +4 -0
- package/dist/react-refresh-event.d.ts +1 -0
- package/dist/react-refresh-event.js +4 -0
- package/dist/render-job.d.ts +3 -0
- package/dist/sequence-node-path-mutation.d.ts +13 -0
- package/dist/sequence-node-path-mutation.js +2 -0
- package/dist/studio-runtime-config.d.ts +4 -0
- package/dist/terminal.d.ts +1 -0
- package/dist/terminal.js +2 -0
- package/package.json +5 -5
- package/dist/optimistic-update-for-code-values.d.ts +0 -7
- package/dist/optimistic-update-for-code-values.js +0 -30
- package/dist/optimistic-update-for-effect-code-values.d.ts +0 -8
- package/dist/optimistic-update-for-effect-code-values.js +0 -43
- package/dist/shape-drag-data.d.ts +0 -22
- package/dist/shape-drag-data.js +0 -90
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.optimisticUpdateForCodeValues = void 0;
|
|
4
|
-
const no_react_1 = require("remotion/no-react");
|
|
5
|
-
const optimisticUpdateForCodeValues = ({ previous, fieldKey, value, schema, }) => {
|
|
6
|
-
var _a;
|
|
7
|
-
if (!previous.canUpdate) {
|
|
8
|
-
return previous;
|
|
9
|
-
}
|
|
10
|
-
const props = {
|
|
11
|
-
...previous.props,
|
|
12
|
-
[fieldKey]: { status: 'static', codeValue: value },
|
|
13
|
-
};
|
|
14
|
-
if (((_a = schema[fieldKey]) === null || _a === void 0 ? void 0 : _a.type) === 'enum') {
|
|
15
|
-
const propsToDelete = no_react_1.NoReactInternals.findPropsToDelete({
|
|
16
|
-
schema,
|
|
17
|
-
key: fieldKey,
|
|
18
|
-
value,
|
|
19
|
-
});
|
|
20
|
-
for (const propToDelete of propsToDelete) {
|
|
21
|
-
delete props[propToDelete];
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
return {
|
|
25
|
-
canUpdate: true,
|
|
26
|
-
props,
|
|
27
|
-
effects: previous.effects,
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
exports.optimisticUpdateForCodeValues = optimisticUpdateForCodeValues;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { type CanUpdateSequencePropsResponse, type SequenceSchema } from 'remotion';
|
|
2
|
-
export declare const optimisticUpdateForEffectCodeValues: ({ previous, effectIndex, fieldKey, value, schema, }: {
|
|
3
|
-
previous: CanUpdateSequencePropsResponse;
|
|
4
|
-
effectIndex: number;
|
|
5
|
-
fieldKey: string;
|
|
6
|
-
value: unknown;
|
|
7
|
-
schema: SequenceSchema;
|
|
8
|
-
}) => CanUpdateSequencePropsResponse;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.optimisticUpdateForEffectCodeValues = void 0;
|
|
4
|
-
const no_react_1 = require("remotion/no-react");
|
|
5
|
-
const optimisticUpdateForEffectCodeValues = ({ previous, effectIndex, fieldKey, value, schema, }) => {
|
|
6
|
-
var _a;
|
|
7
|
-
if (!previous.canUpdate) {
|
|
8
|
-
return previous;
|
|
9
|
-
}
|
|
10
|
-
const targetIndex = previous.effects.findIndex((e) => e.effectIndex === effectIndex);
|
|
11
|
-
if (targetIndex === -1) {
|
|
12
|
-
return previous;
|
|
13
|
-
}
|
|
14
|
-
const target = previous.effects[targetIndex];
|
|
15
|
-
if (!target.canUpdate) {
|
|
16
|
-
return previous;
|
|
17
|
-
}
|
|
18
|
-
const props = {
|
|
19
|
-
...target.props,
|
|
20
|
-
[fieldKey]: { status: 'static', codeValue: value },
|
|
21
|
-
};
|
|
22
|
-
if (((_a = schema[fieldKey]) === null || _a === void 0 ? void 0 : _a.type) === 'enum') {
|
|
23
|
-
const propsToDelete = no_react_1.NoReactInternals.findPropsToDelete({
|
|
24
|
-
schema,
|
|
25
|
-
key: fieldKey,
|
|
26
|
-
value,
|
|
27
|
-
});
|
|
28
|
-
for (const propToDelete of propsToDelete) {
|
|
29
|
-
delete props[propToDelete];
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
const updatedEffect = {
|
|
33
|
-
...target,
|
|
34
|
-
props,
|
|
35
|
-
};
|
|
36
|
-
const effects = [...previous.effects];
|
|
37
|
-
effects[targetIndex] = updatedEffect;
|
|
38
|
-
return {
|
|
39
|
-
...previous,
|
|
40
|
-
effects,
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
exports.optimisticUpdateForEffectCodeValues = optimisticUpdateForEffectCodeValues;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export declare const SHAPE_DRAG_MIME_TYPE = "application/vnd.remotion.shape+json";
|
|
2
|
-
export declare const shapeNames: readonly ["Arrow", "Circle", "Ellipse", "Heart", "Pie", "Polygon", "Rect", "Star", "Triangle"];
|
|
3
|
-
export type ShapeName = (typeof shapeNames)[number];
|
|
4
|
-
export type ShapeAttribute = {
|
|
5
|
-
name: string;
|
|
6
|
-
value: string | number | boolean;
|
|
7
|
-
};
|
|
8
|
-
export type ShapeDragData = {
|
|
9
|
-
type: 'remotion-shape';
|
|
10
|
-
version: 1;
|
|
11
|
-
shape: ShapeName;
|
|
12
|
-
attributes: ShapeAttribute[];
|
|
13
|
-
};
|
|
14
|
-
export declare const isShapeName: (value: unknown) => value is "Arrow" | "Circle" | "Ellipse" | "Heart" | "Pie" | "Polygon" | "Rect" | "Star" | "Triangle";
|
|
15
|
-
export declare const isShapeAttributeName: (value: unknown) => value is string;
|
|
16
|
-
export declare const isShapeAttribute: (value: unknown) => value is ShapeAttribute;
|
|
17
|
-
export declare const areShapeAttributes: (value: unknown) => value is ShapeAttribute[];
|
|
18
|
-
export declare const makeShapeDragData: ({ attributes, shape, }: {
|
|
19
|
-
attributes: ShapeAttribute[];
|
|
20
|
-
shape: "Arrow" | "Circle" | "Ellipse" | "Heart" | "Pie" | "Polygon" | "Rect" | "Star" | "Triangle";
|
|
21
|
-
}) => ShapeDragData;
|
|
22
|
-
export declare const parseShapeDragData: (value: string) => ShapeDragData | null;
|
package/dist/shape-drag-data.js
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseShapeDragData = exports.makeShapeDragData = exports.areShapeAttributes = exports.isShapeAttribute = exports.isShapeAttributeName = exports.isShapeName = exports.shapeNames = exports.SHAPE_DRAG_MIME_TYPE = void 0;
|
|
4
|
-
exports.SHAPE_DRAG_MIME_TYPE = 'application/vnd.remotion.shape+json';
|
|
5
|
-
exports.shapeNames = [
|
|
6
|
-
'Arrow',
|
|
7
|
-
'Circle',
|
|
8
|
-
'Ellipse',
|
|
9
|
-
'Heart',
|
|
10
|
-
'Pie',
|
|
11
|
-
'Polygon',
|
|
12
|
-
'Rect',
|
|
13
|
-
'Star',
|
|
14
|
-
'Triangle',
|
|
15
|
-
];
|
|
16
|
-
const isRecord = (value) => {
|
|
17
|
-
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
18
|
-
};
|
|
19
|
-
const isShapeName = (value) => {
|
|
20
|
-
return typeof value === 'string' && exports.shapeNames.includes(value);
|
|
21
|
-
};
|
|
22
|
-
exports.isShapeName = isShapeName;
|
|
23
|
-
const isShapeAttributeName = (value) => {
|
|
24
|
-
return (typeof value === 'string' &&
|
|
25
|
-
value !== 'style' &&
|
|
26
|
-
/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(value));
|
|
27
|
-
};
|
|
28
|
-
exports.isShapeAttributeName = isShapeAttributeName;
|
|
29
|
-
const isShapeAttribute = (value) => {
|
|
30
|
-
if (!isRecord(value)) {
|
|
31
|
-
return false;
|
|
32
|
-
}
|
|
33
|
-
if (!(0, exports.isShapeAttributeName)(value.name)) {
|
|
34
|
-
return false;
|
|
35
|
-
}
|
|
36
|
-
return (typeof value.value === 'string' ||
|
|
37
|
-
typeof value.value === 'boolean' ||
|
|
38
|
-
(typeof value.value === 'number' && Number.isFinite(value.value)));
|
|
39
|
-
};
|
|
40
|
-
exports.isShapeAttribute = isShapeAttribute;
|
|
41
|
-
const areShapeAttributes = (value) => {
|
|
42
|
-
if (!Array.isArray(value)) {
|
|
43
|
-
return false;
|
|
44
|
-
}
|
|
45
|
-
const seen = new Set();
|
|
46
|
-
for (const attribute of value) {
|
|
47
|
-
if (!(0, exports.isShapeAttribute)(attribute) || seen.has(attribute.name)) {
|
|
48
|
-
return false;
|
|
49
|
-
}
|
|
50
|
-
seen.add(attribute.name);
|
|
51
|
-
}
|
|
52
|
-
return true;
|
|
53
|
-
};
|
|
54
|
-
exports.areShapeAttributes = areShapeAttributes;
|
|
55
|
-
const makeShapeDragData = ({ attributes, shape, }) => {
|
|
56
|
-
return {
|
|
57
|
-
type: 'remotion-shape',
|
|
58
|
-
version: 1,
|
|
59
|
-
shape,
|
|
60
|
-
attributes,
|
|
61
|
-
};
|
|
62
|
-
};
|
|
63
|
-
exports.makeShapeDragData = makeShapeDragData;
|
|
64
|
-
const parseShapeDragData = (value) => {
|
|
65
|
-
try {
|
|
66
|
-
const parsed = JSON.parse(value);
|
|
67
|
-
if (!isRecord(parsed)) {
|
|
68
|
-
return null;
|
|
69
|
-
}
|
|
70
|
-
if (parsed.type !== 'remotion-shape' || parsed.version !== 1) {
|
|
71
|
-
return null;
|
|
72
|
-
}
|
|
73
|
-
if (!(0, exports.isShapeName)(parsed.shape)) {
|
|
74
|
-
return null;
|
|
75
|
-
}
|
|
76
|
-
if (!(0, exports.areShapeAttributes)(parsed.attributes)) {
|
|
77
|
-
return null;
|
|
78
|
-
}
|
|
79
|
-
return {
|
|
80
|
-
type: 'remotion-shape',
|
|
81
|
-
version: 1,
|
|
82
|
-
shape: parsed.shape,
|
|
83
|
-
attributes: parsed.attributes,
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
catch (_a) {
|
|
87
|
-
return null;
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
exports.parseShapeDragData = parseShapeDragData;
|