@remotion/studio 4.0.291 → 4.0.293
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/.turbo/turbo-make.log +2 -2
- package/dist/api/get-zod-schema-from-primitive.js +6 -1
- package/dist/api/save-default-props.js +13 -1
- package/dist/api/update-default-props.js +1 -1
- package/dist/api/use-visual-control.js +1 -2
- package/dist/api/use-visual-controls.d.ts +7 -0
- package/dist/api/use-visual-controls.js +57 -0
- package/dist/api/visual-control.d.ts +2 -0
- package/dist/api/visual-control.js +11 -0
- package/dist/components/AskAiModal.d.ts +7 -0
- package/dist/components/AskAiModal.js +65 -0
- package/dist/components/Canvas.d.ts +0 -1
- package/dist/components/Canvas.js +2 -2
- package/dist/components/CanvasOrLoading.js +1 -1
- package/dist/components/EditorContexts.js +2 -1
- package/dist/components/GlobalKeybindings.js +14 -0
- package/dist/components/GlobalPropsEditorUpdateButton.js +6 -2
- package/dist/components/KeyboardShortcutsExplainer.js +1 -1
- package/dist/components/ModalContainer.d.ts +1 -0
- package/dist/components/ModalContainer.js +2 -2
- package/dist/components/ModalHeader.d.ts +1 -0
- package/dist/components/ModalHeader.js +2 -2
- package/dist/components/Modals.js +2 -1
- package/dist/components/OptionsPanel.d.ts +1 -1
- package/dist/components/OptionsPanel.js +12 -2
- package/dist/components/Preview.d.ts +0 -1
- package/dist/components/Preview.js +3 -5
- package/dist/components/QuickSwitcher/QuickSwitcherResult.js +1 -1
- package/dist/components/RenderModal/DataEditor.js +11 -4
- package/dist/components/RenderModal/RenderModalJSONPropsEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/Fieldset.d.ts +1 -0
- package/dist/components/RenderModal/SchemaEditor/Fieldset.js +5 -5
- package/dist/components/RenderModal/SchemaEditor/SchemaLabel.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodArrayEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodArrayItemEditor.d.ts +1 -0
- package/dist/components/RenderModal/SchemaEditor/ZodArrayItemEditor.js +2 -2
- package/dist/components/RenderModal/SchemaEditor/ZodMatrixEditor.js +3 -6
- package/dist/components/RenderModal/SchemaEditor/ZodSwitch.js +6 -0
- package/dist/components/RenderModal/SchemaEditor/create-zod-values.js +9 -0
- package/dist/components/RenderModal/SchemaEditor/extract-enum-json-paths.d.ts +7 -2
- package/dist/components/RenderModal/SchemaEditor/extract-enum-json-paths.js +96 -22
- package/dist/components/RenderQueue/actions.d.ts +5 -1
- package/dist/components/RenderQueue/actions.js +12 -5
- package/dist/components/Tabs/index.js +3 -1
- package/dist/components/Timeline/TimelineStack/get-stack.d.ts +1 -1
- package/dist/components/Timeline/TimelineStack/get-stack.js +4 -2
- package/dist/components/Timeline/TimelineStack/index.js +2 -8
- package/dist/components/VisualControls/ClickableFileName.d.ts +12 -2
- package/dist/components/VisualControls/ClickableFileName.js +17 -13
- package/dist/components/VisualControls/VisualControlHandle.d.ts +0 -2
- package/dist/components/VisualControls/VisualControlHandle.js +69 -7
- package/dist/components/VisualControls/VisualControlHandleHeader.d.ts +4 -0
- package/dist/components/VisualControls/VisualControlHandleHeader.js +9 -0
- package/dist/components/VisualControls/VisualControlsContent.js +40 -16
- package/dist/components/VisualControls/get-original-stack-trace.d.ts +2 -2
- package/dist/components/VisualControls/get-original-stack-trace.js +10 -2
- package/dist/esm/index.mjs +153 -29
- package/dist/esm/internals.mjs +4430 -3644
- package/dist/esm/previewEntry.mjs +4520 -3734
- package/dist/esm/renderEntry.mjs +4545 -3721
- package/dist/helpers/get-location-of-sequence.d.ts +1 -0
- package/dist/helpers/get-location-of-sequence.js +18 -1
- package/dist/helpers/open-in-editor.d.ts +2 -0
- package/dist/helpers/open-in-editor.js +11 -1
- package/dist/helpers/retry-payload.js +3 -3
- package/dist/helpers/use-menu-structure.js +16 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -1
- package/dist/renderEntry.js +5 -5
- package/dist/state/z-index.d.ts +1 -0
- package/dist/state/z-index.js +13 -5
- package/dist/visual-controls/VisualControls.d.ts +11 -18
- package/dist/visual-controls/VisualControls.js +69 -64
- package/dist/visual-controls/get-current-edited-value.d.ts +2 -3
- package/dist/visual-controls/get-current-edited-value.js +3 -3
- package/package.json +9 -9
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -107,7 +107,7 @@ const DataEditor = ({ unresolvedComposition, defaultProps, setDefaultProps, mayS
|
|
|
107
107
|
return null;
|
|
108
108
|
}
|
|
109
109
|
const value = defaultProps;
|
|
110
|
-
return no_react_1.NoReactInternals.
|
|
110
|
+
return no_react_1.NoReactInternals.serializeJSONWithSpecialTypes({
|
|
111
111
|
data: value,
|
|
112
112
|
indent: 2,
|
|
113
113
|
staticBase: window.remotion_staticBase,
|
|
@@ -118,6 +118,7 @@ const DataEditor = ({ unresolvedComposition, defaultProps, setDefaultProps, mayS
|
|
|
118
118
|
[unresolvedComposition.id]: get_render_modal_warnings_1.defaultTypeCanSaveState,
|
|
119
119
|
});
|
|
120
120
|
const z = (0, get_zod_if_possible_1.useZodIfPossible)();
|
|
121
|
+
const zodTypes = (0, get_zod_if_possible_1.useZodTypesIfPossible)();
|
|
121
122
|
const schema = (0, react_1.useMemo)(() => {
|
|
122
123
|
if (!z) {
|
|
123
124
|
return 'no-zod';
|
|
@@ -224,12 +225,12 @@ const DataEditor = ({ unresolvedComposition, defaultProps, setDefaultProps, mayS
|
|
|
224
225
|
(0, NotificationCenter_1.showNotification)('Cannot update default props: No Zod schema', 2000);
|
|
225
226
|
return;
|
|
226
227
|
}
|
|
227
|
-
(0, actions_1.callUpdateDefaultPropsApi)(unresolvedComposition.id, defaultProps, (0, extract_enum_json_paths_1.extractEnumJsonPaths)(schema, z, [])).then((response) => {
|
|
228
|
+
(0, actions_1.callUpdateDefaultPropsApi)(unresolvedComposition.id, defaultProps, (0, extract_enum_json_paths_1.extractEnumJsonPaths)({ schema, zodRuntime: z, currentPath: [], zodTypes })).then((response) => {
|
|
228
229
|
if (!response.success) {
|
|
229
230
|
(0, NotificationCenter_1.showNotification)(`Cannot update default props: ${response.reason}`, 2000);
|
|
230
231
|
}
|
|
231
232
|
});
|
|
232
|
-
}, [unresolvedComposition.id, defaultProps,
|
|
233
|
+
}, [schema, z, unresolvedComposition.id, defaultProps, zodTypes]);
|
|
233
234
|
const onSave = (0, react_1.useCallback)((updater) => {
|
|
234
235
|
var _a;
|
|
235
236
|
if (schema === 'no-zod' || schema === 'no-schema' || z === null) {
|
|
@@ -239,7 +240,12 @@ const DataEditor = ({ unresolvedComposition, defaultProps, setDefaultProps, mayS
|
|
|
239
240
|
window.remotion_ignoreFastRefreshUpdate = fastRefreshes + 1;
|
|
240
241
|
setSaving(true);
|
|
241
242
|
const newDefaultProps = updater((_a = unresolvedComposition.defaultProps) !== null && _a !== void 0 ? _a : {});
|
|
242
|
-
(0, actions_1.callUpdateDefaultPropsApi)(unresolvedComposition.id, newDefaultProps, (0, extract_enum_json_paths_1.extractEnumJsonPaths)(
|
|
243
|
+
(0, actions_1.callUpdateDefaultPropsApi)(unresolvedComposition.id, newDefaultProps, (0, extract_enum_json_paths_1.extractEnumJsonPaths)({
|
|
244
|
+
schema,
|
|
245
|
+
zodRuntime: z,
|
|
246
|
+
currentPath: [],
|
|
247
|
+
zodTypes,
|
|
248
|
+
}))
|
|
243
249
|
.then((response) => {
|
|
244
250
|
if (!response.success) {
|
|
245
251
|
// eslint-disable-next-line no-console
|
|
@@ -257,6 +263,7 @@ const DataEditor = ({ unresolvedComposition, defaultProps, setDefaultProps, mayS
|
|
|
257
263
|
}, [
|
|
258
264
|
schema,
|
|
259
265
|
z,
|
|
266
|
+
zodTypes,
|
|
260
267
|
fastRefreshes,
|
|
261
268
|
setSaving,
|
|
262
269
|
unresolvedComposition.defaultProps,
|
|
@@ -58,7 +58,7 @@ const scrollable = {
|
|
|
58
58
|
};
|
|
59
59
|
const parseJSON = (str, schema) => {
|
|
60
60
|
try {
|
|
61
|
-
const value = no_react_1.NoReactInternals.
|
|
61
|
+
const value = no_react_1.NoReactInternals.deserializeJSONWithSpecialTypes(str);
|
|
62
62
|
const zodValidation = schema.safeParse(value);
|
|
63
63
|
return { str, value, validJSON: true, zodValidation };
|
|
64
64
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Fieldset = void 0;
|
|
3
|
+
exports.Fieldset = exports.SCHEMA_EDITOR_FIELDSET_PADDING = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
-
|
|
6
|
+
exports.SCHEMA_EDITOR_FIELDSET_PADDING = 10;
|
|
7
7
|
const AlreadyPaddedRightContext = (0, react_1.createContext)(false);
|
|
8
8
|
const Fieldset = ({ children, shouldPad }) => {
|
|
9
9
|
const alreadyPadded = (0, react_1.useContext)(AlreadyPaddedRightContext);
|
|
10
10
|
const style = (0, react_1.useMemo)(() => {
|
|
11
11
|
if (shouldPad) {
|
|
12
12
|
return {
|
|
13
|
-
padding: SCHEMA_EDITOR_FIELDSET_PADDING,
|
|
14
|
-
paddingTop: SCHEMA_EDITOR_FIELDSET_PADDING / 2,
|
|
15
|
-
paddingRight: alreadyPadded ? 0 : SCHEMA_EDITOR_FIELDSET_PADDING,
|
|
13
|
+
padding: exports.SCHEMA_EDITOR_FIELDSET_PADDING,
|
|
14
|
+
paddingTop: exports.SCHEMA_EDITOR_FIELDSET_PADDING / 2,
|
|
15
|
+
paddingRight: alreadyPadded ? 0 : exports.SCHEMA_EDITOR_FIELDSET_PADDING,
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
18
|
return {};
|
|
@@ -43,6 +43,6 @@ const SchemaLabel = ({ jsonPath, isDefaultValue, onReset, onSave, showSaveButton
|
|
|
43
43
|
const labelContent = ((0, jsx_runtime_1.jsxs)("span", { style: labelStyle, children: [(0, get_schema_label_1.getSchemaLabel)(jsonPath), " ", suffix ? suffix : null] }));
|
|
44
44
|
return ((0, jsx_runtime_1.jsxs)("div", { style: compactStyles, className: scroll_to_default_props_path_1.DEFAULT_PROPS_PATH_CLASSNAME, "data-json-path": jsonPath.join('.'), children: [handleClick ? (
|
|
45
45
|
// Minus the padding that a button has (user agent padding-line-start)
|
|
46
|
-
(0, jsx_runtime_1.jsx)("button", { onPointerEnter: onClickablePointerEnter, onPointerLeave: onClickablePointerLeave, type: "button", onClick: handleClick, style: { border: 'none',
|
|
46
|
+
(0, jsx_runtime_1.jsx)("button", { onPointerEnter: onClickablePointerEnter, onPointerLeave: onClickablePointerLeave, type: "button", onClick: handleClick, style: { border: 'none', padding: 0 }, children: labelContent })) : (labelContent), (0, jsx_runtime_1.jsx)(layout_1.Flex, {}), isDefaultValue ? null : (0, jsx_runtime_1.jsx)(SchemaResetButton_1.SchemaResetButton, { onClick: onReset }), isDefaultValue ? null : showSaveButton ? ((0, jsx_runtime_1.jsx)(SchemaSaveButton_1.SchemaSaveButton, { onClick: onSave, disabled: disableSave })) : null, onRemove ? (0, jsx_runtime_1.jsx)(InlineRemoveButton_1.InlineRemoveButton, { onClick: onRemove }) : null] }));
|
|
47
47
|
};
|
|
48
48
|
exports.SchemaLabel = SchemaLabel;
|
|
@@ -79,7 +79,7 @@ const ZodArrayEditor = ({ schema, jsonPath, setValue, defaultValue, value, onSav
|
|
|
79
79
|
var _a;
|
|
80
80
|
return (
|
|
81
81
|
// eslint-disable-next-line react/no-array-index-key
|
|
82
|
-
(0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsx)(ZodArrayItemEditor_1.ZodArrayItemEditor, { onChange: onChange, value: child, def: def, index: i, jsonPath: jsonPath, defaultValue: (_a = defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue[i]) !== null && _a !== void 0 ? _a : (0, create_zod_values_1.createZodValues)(def.type, z, zodTypes), onSave: onSave, showSaveButton: showSaveButton, saving: saving, saveDisabledByParent: saveDisabledByParent, mayPad: mayPad }), (0, jsx_runtime_1.jsx)(SchemaSeparationLine_1.SchemaArrayItemSeparationLine, { schema: schema, index: i, onChange: onChange, isLast: i === localValue.value.length - 1, showAddButton: true })] }, `${i}${localValue.keyStabilityRevision}`));
|
|
82
|
+
(0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsx)(ZodArrayItemEditor_1.ZodArrayItemEditor, { onChange: onChange, value: child, def: def, index: i, jsonPath: jsonPath, defaultValue: (_a = defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue[i]) !== null && _a !== void 0 ? _a : (0, create_zod_values_1.createZodValues)(def.type, z, zodTypes), onSave: onSave, showSaveButton: showSaveButton, saving: saving, saveDisabledByParent: saveDisabledByParent, mayPad: mayPad, mayRemove: true }), (0, jsx_runtime_1.jsx)(SchemaSeparationLine_1.SchemaArrayItemSeparationLine, { schema: schema, index: i, onChange: onChange, isLast: i === localValue.value.length - 1, showAddButton: true })] }, `${i}${localValue.keyStabilityRevision}`));
|
|
83
83
|
}), value.length === 0 ? ((0, jsx_runtime_1.jsx)(SchemaSeparationLine_1.SchemaArrayItemSeparationLine, { schema: schema, index: 0, onChange: onChange, isLast: true, showAddButton: true })) : null] }) })) : null, (0, jsx_runtime_1.jsx)(ZodFieldValidation_1.ZodFieldValidation, { path: jsonPath, localValue: localValue })] }));
|
|
84
84
|
};
|
|
85
85
|
exports.ZodArrayEditor = ZodArrayEditor;
|
|
@@ -5,7 +5,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const get_zod_if_possible_1 = require("../../get-zod-if-possible");
|
|
7
7
|
const ZodSwitch_1 = require("./ZodSwitch");
|
|
8
|
-
const ZodArrayItemEditor = ({ def, onChange, jsonPath, index, value, defaultValue, onSave: onSaveObject, showSaveButton, saving, saveDisabledByParent, mayPad, }) => {
|
|
8
|
+
const ZodArrayItemEditor = ({ def, onChange, jsonPath, index, value, defaultValue, onSave: onSaveObject, showSaveButton, saving, saveDisabledByParent, mayPad, mayRemove, }) => {
|
|
9
9
|
const z = (0, get_zod_if_possible_1.useZodIfPossible)();
|
|
10
10
|
if (!z) {
|
|
11
11
|
throw new Error('expected zod');
|
|
@@ -28,6 +28,6 @@ const ZodArrayItemEditor = ({ def, onChange, jsonPath, index, value, defaultValu
|
|
|
28
28
|
...oldV.slice(index + 1),
|
|
29
29
|
], false, false);
|
|
30
30
|
}, [index, onSaveObject]);
|
|
31
|
-
return ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(ZodSwitch_1.ZodSwitch, { jsonPath: newJsonPath, schema: def.type, value: value, setValue: setValue, defaultValue: defaultValue, onSave: onSave, showSaveButton: showSaveButton, onRemove: onRemove, saving: saving, saveDisabledByParent: saveDisabledByParent, mayPad: mayPad }) }));
|
|
31
|
+
return ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(ZodSwitch_1.ZodSwitch, { jsonPath: newJsonPath, schema: def.type, value: value, setValue: setValue, defaultValue: defaultValue, onSave: onSave, showSaveButton: showSaveButton, onRemove: mayRemove ? onRemove : null, saving: saving, saveDisabledByParent: saveDisabledByParent, mayPad: mayPad }) }));
|
|
32
32
|
};
|
|
33
33
|
exports.ZodArrayItemEditor = ZodArrayItemEditor;
|
|
@@ -83,12 +83,9 @@ const ZodMatrixEditor = ({ schema, jsonPath, setValue, defaultValue, value, onSa
|
|
|
83
83
|
return acc;
|
|
84
84
|
}, []);
|
|
85
85
|
}, [localValue.value, dimensions]);
|
|
86
|
-
return ((0, jsx_runtime_1.jsxs)(Fieldset_1.Fieldset, { shouldPad: mayPad, success: localValue.zodValidation.success, children: [(0, jsx_runtime_1.jsx)(
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}, children: (0, jsx_runtime_1.jsx)(SchemaLabel_1.SchemaLabel, { onReset: reset, isDefaultValue: isDefaultValue, jsonPath: jsonPath, onRemove: onRemove, suffix: suffix, onSave: () => {
|
|
90
|
-
onSave(() => localValue.value, false, false);
|
|
91
|
-
}, saveDisabledByParent: saveDisabledByParent, saving: saving, showSaveButton: showSaveButton, valid: localValue.zodValidation.success, handleClick: () => setExpanded(!expanded) }) }), expanded ? ((0, jsx_runtime_1.jsx)(RevisionContextProvider, { children: (0, jsx_runtime_1.jsxs)(SchemaVerticalGuide_1.SchemaVerticalGuide, { isRoot: false, children: [chunkedItems.map((row, rowIndex) => {
|
|
86
|
+
return ((0, jsx_runtime_1.jsxs)(Fieldset_1.Fieldset, { shouldPad: mayPad, success: localValue.zodValidation.success, children: [(0, jsx_runtime_1.jsx)(SchemaLabel_1.SchemaLabel, { onReset: reset, isDefaultValue: isDefaultValue, jsonPath: jsonPath, onRemove: onRemove, suffix: suffix, onSave: () => {
|
|
87
|
+
onSave(() => localValue.value, false, false);
|
|
88
|
+
}, saveDisabledByParent: saveDisabledByParent, saving: saving, showSaveButton: showSaveButton, valid: localValue.zodValidation.success, handleClick: () => setExpanded(!expanded) }), expanded ? ((0, jsx_runtime_1.jsx)(RevisionContextProvider, { children: (0, jsx_runtime_1.jsxs)(SchemaVerticalGuide_1.SchemaVerticalGuide, { isRoot: false, children: [chunkedItems.map((row, rowIndex) => {
|
|
92
89
|
return ((0, jsx_runtime_1.jsx)(react_1.default.Fragment
|
|
93
90
|
// eslint-disable-next-line react/no-array-index-key
|
|
94
91
|
, { children: (0, jsx_runtime_1.jsx)("div", { style: rowStyle, children: row.map((item, _index) => {
|
|
@@ -11,6 +11,7 @@ const ZodDefaultEditor_1 = require("./ZodDefaultEditor");
|
|
|
11
11
|
const ZodDiscriminatedUnionEditor_1 = require("./ZodDiscriminatedUnionEditor");
|
|
12
12
|
const ZodEffectEditor_1 = require("./ZodEffectEditor");
|
|
13
13
|
const ZodEnumEditor_1 = require("./ZodEnumEditor");
|
|
14
|
+
const ZodMatrixEditor_1 = require("./ZodMatrixEditor");
|
|
14
15
|
const ZodNonEditableValue_1 = require("./ZodNonEditableValue");
|
|
15
16
|
const ZodNullableEditor_1 = require("./ZodNullableEditor");
|
|
16
17
|
const ZodNumberEditor_1 = require("./ZodNumberEditor");
|
|
@@ -80,6 +81,11 @@ const ZodSwitch = ({ schema, jsonPath, value, setValue, defaultValue, onSave, sh
|
|
|
80
81
|
zodTypes.ZodZypesInternals.REMOTION_COLOR_BRAND) {
|
|
81
82
|
return ((0, jsx_runtime_1.jsx)(ZodColorEditor_1.ZodColorEditor, { value: value, setValue: setValue, jsonPath: jsonPath, schema: schema, onSave: onSave, defaultValue: defaultValue, showSaveButton: showSaveButton, onRemove: onRemove, saving: saving, saveDisabledByParent: saveDisabledByParent, mayPad: mayPad }));
|
|
82
83
|
}
|
|
84
|
+
if (zodTypes &&
|
|
85
|
+
schema._def.description ===
|
|
86
|
+
zodTypes.ZodZypesInternals.REMOTION_MATRIX_BRAND) {
|
|
87
|
+
return ((0, jsx_runtime_1.jsx)(ZodMatrixEditor_1.ZodMatrixEditor, { setValue: setValue, value: value, jsonPath: jsonPath, schema: schema._def.schema, defaultValue: defaultValue, onSave: onSave, showSaveButton: showSaveButton, onRemove: onRemove, saving: saving, saveDisabledByParent: saveDisabledByParent, mayPad: mayPad }));
|
|
88
|
+
}
|
|
83
89
|
return ((0, jsx_runtime_1.jsx)(ZodEffectEditor_1.ZodEffectEditor, { value: value, setValue: setValue, jsonPath: jsonPath, schema: schema, defaultValue: defaultValue, onSave: onSave, showSaveButton: showSaveButton, onRemove: onRemove, saving: saving, mayPad: mayPad }));
|
|
84
90
|
}
|
|
85
91
|
if (typeName === z.ZodFirstPartyTypeKind.ZodUnion) {
|
|
@@ -81,6 +81,15 @@ const createZodValues = (schema, zodRuntime, zodTypes) => {
|
|
|
81
81
|
zodTypes.ZodZypesInternals.REMOTION_TEXTAREA_BRAND) {
|
|
82
82
|
return '';
|
|
83
83
|
}
|
|
84
|
+
if (zodTypes &&
|
|
85
|
+
schema._def.description ===
|
|
86
|
+
zodTypes.ZodZypesInternals.REMOTION_MATRIX_BRAND) {
|
|
87
|
+
return [
|
|
88
|
+
[1, 0, 0],
|
|
89
|
+
[0, 1, 0],
|
|
90
|
+
[0, 0, 1],
|
|
91
|
+
];
|
|
92
|
+
}
|
|
84
93
|
return (0, exports.createZodValues)(def.schema, zodRuntime, zodTypes);
|
|
85
94
|
}
|
|
86
95
|
case zodRuntime.ZodFirstPartyTypeKind.ZodIntersection: {
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
import type { ZodType } from '../../get-zod-if-possible';
|
|
2
|
-
export declare const extractEnumJsonPaths: (schema
|
|
1
|
+
import type { ZodType, ZodTypesType } from '../../get-zod-if-possible';
|
|
2
|
+
export declare const extractEnumJsonPaths: ({ schema, zodRuntime, currentPath, zodTypes, }: {
|
|
3
|
+
schema: Zod.ZodTypeAny;
|
|
4
|
+
zodRuntime: ZodType;
|
|
5
|
+
zodTypes: ZodTypesType | null;
|
|
6
|
+
currentPath: (string | number)[];
|
|
7
|
+
}) => (string | number)[][];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.extractEnumJsonPaths = void 0;
|
|
4
|
-
const extractEnumJsonPaths = (schema, zodRuntime, currentPath) => {
|
|
4
|
+
const extractEnumJsonPaths = ({ schema, zodRuntime, currentPath, zodTypes, }) => {
|
|
5
5
|
const def = schema._def;
|
|
6
6
|
const typeName = def.typeName;
|
|
7
7
|
switch (typeName) {
|
|
@@ -10,30 +10,44 @@ const extractEnumJsonPaths = (schema, zodRuntime, currentPath) => {
|
|
|
10
10
|
const keys = Object.keys(shape);
|
|
11
11
|
return keys
|
|
12
12
|
.map((key) => {
|
|
13
|
-
return (0, exports.extractEnumJsonPaths)(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
return (0, exports.extractEnumJsonPaths)({
|
|
14
|
+
schema: shape[key],
|
|
15
|
+
zodRuntime,
|
|
16
|
+
currentPath: [...currentPath, key],
|
|
17
|
+
zodTypes,
|
|
18
|
+
});
|
|
17
19
|
})
|
|
18
20
|
.flat(1);
|
|
19
21
|
}
|
|
20
22
|
case zodRuntime.ZodFirstPartyTypeKind.ZodArray: {
|
|
21
|
-
return (0, exports.extractEnumJsonPaths)(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
return (0, exports.extractEnumJsonPaths)({
|
|
24
|
+
schema: def.type,
|
|
25
|
+
zodRuntime,
|
|
26
|
+
currentPath: [...currentPath, '[]'],
|
|
27
|
+
zodTypes,
|
|
28
|
+
});
|
|
25
29
|
}
|
|
26
30
|
case zodRuntime.ZodFirstPartyTypeKind.ZodUnion: {
|
|
27
31
|
return def.options
|
|
28
32
|
.map((option) => {
|
|
29
|
-
return (0, exports.extractEnumJsonPaths)(
|
|
33
|
+
return (0, exports.extractEnumJsonPaths)({
|
|
34
|
+
schema: option,
|
|
35
|
+
zodRuntime,
|
|
36
|
+
currentPath,
|
|
37
|
+
zodTypes,
|
|
38
|
+
});
|
|
30
39
|
})
|
|
31
40
|
.flat(1);
|
|
32
41
|
}
|
|
33
42
|
case zodRuntime.ZodFirstPartyTypeKind.ZodDiscriminatedUnion: {
|
|
34
43
|
return def.options
|
|
35
44
|
.map((op) => {
|
|
36
|
-
return (0, exports.extractEnumJsonPaths)(
|
|
45
|
+
return (0, exports.extractEnumJsonPaths)({
|
|
46
|
+
schema: op,
|
|
47
|
+
zodRuntime,
|
|
48
|
+
currentPath,
|
|
49
|
+
zodTypes,
|
|
50
|
+
});
|
|
37
51
|
})
|
|
38
52
|
.flat(1);
|
|
39
53
|
}
|
|
@@ -41,21 +55,51 @@ const extractEnumJsonPaths = (schema, zodRuntime, currentPath) => {
|
|
|
41
55
|
return [currentPath];
|
|
42
56
|
}
|
|
43
57
|
case zodRuntime.ZodFirstPartyTypeKind.ZodEffects: {
|
|
44
|
-
|
|
58
|
+
if (zodTypes &&
|
|
59
|
+
schema._def.description ===
|
|
60
|
+
zodTypes.ZodZypesInternals.REMOTION_MATRIX_BRAND) {
|
|
61
|
+
return [currentPath];
|
|
62
|
+
}
|
|
63
|
+
return (0, exports.extractEnumJsonPaths)({
|
|
64
|
+
schema: def.schema,
|
|
65
|
+
zodRuntime,
|
|
66
|
+
currentPath,
|
|
67
|
+
zodTypes,
|
|
68
|
+
});
|
|
45
69
|
}
|
|
46
70
|
case zodRuntime.ZodFirstPartyTypeKind.ZodIntersection: {
|
|
47
71
|
const { left, right } = def;
|
|
48
|
-
const leftValue = (0, exports.extractEnumJsonPaths)(
|
|
49
|
-
|
|
72
|
+
const leftValue = (0, exports.extractEnumJsonPaths)({
|
|
73
|
+
schema: left,
|
|
74
|
+
zodRuntime,
|
|
75
|
+
currentPath,
|
|
76
|
+
zodTypes,
|
|
77
|
+
});
|
|
78
|
+
const rightValue = (0, exports.extractEnumJsonPaths)({
|
|
79
|
+
schema: right,
|
|
80
|
+
zodRuntime,
|
|
81
|
+
currentPath,
|
|
82
|
+
zodTypes,
|
|
83
|
+
});
|
|
50
84
|
return [...leftValue, ...rightValue];
|
|
51
85
|
}
|
|
52
86
|
case zodRuntime.ZodFirstPartyTypeKind.ZodTuple: {
|
|
53
87
|
return def.items
|
|
54
|
-
.map((item, i) => (0, exports.extractEnumJsonPaths)(
|
|
88
|
+
.map((item, i) => (0, exports.extractEnumJsonPaths)({
|
|
89
|
+
schema: item,
|
|
90
|
+
zodRuntime,
|
|
91
|
+
currentPath: [...currentPath, i],
|
|
92
|
+
zodTypes,
|
|
93
|
+
}))
|
|
55
94
|
.flat(1);
|
|
56
95
|
}
|
|
57
96
|
case zodRuntime.ZodFirstPartyTypeKind.ZodRecord: {
|
|
58
|
-
const values = (0, exports.extractEnumJsonPaths)(
|
|
97
|
+
const values = (0, exports.extractEnumJsonPaths)({
|
|
98
|
+
schema: def.valueType,
|
|
99
|
+
zodRuntime,
|
|
100
|
+
currentPath: [...currentPath, '{}'],
|
|
101
|
+
zodTypes,
|
|
102
|
+
});
|
|
59
103
|
return values;
|
|
60
104
|
}
|
|
61
105
|
case zodRuntime.ZodFirstPartyTypeKind.ZodFunction: {
|
|
@@ -69,21 +113,41 @@ const extractEnumJsonPaths = (schema, zodRuntime, currentPath) => {
|
|
|
69
113
|
}
|
|
70
114
|
case zodRuntime.ZodFirstPartyTypeKind.ZodOptional: {
|
|
71
115
|
const defType = def;
|
|
72
|
-
const value = (0, exports.extractEnumJsonPaths)(
|
|
116
|
+
const value = (0, exports.extractEnumJsonPaths)({
|
|
117
|
+
schema: defType.innerType,
|
|
118
|
+
zodRuntime,
|
|
119
|
+
currentPath,
|
|
120
|
+
zodTypes,
|
|
121
|
+
});
|
|
73
122
|
return value;
|
|
74
123
|
}
|
|
75
124
|
case zodRuntime.ZodFirstPartyTypeKind.ZodNullable: {
|
|
76
125
|
const defType = def;
|
|
77
|
-
const value = (0, exports.extractEnumJsonPaths)(
|
|
126
|
+
const value = (0, exports.extractEnumJsonPaths)({
|
|
127
|
+
schema: defType.innerType,
|
|
128
|
+
zodRuntime,
|
|
129
|
+
currentPath,
|
|
130
|
+
zodTypes,
|
|
131
|
+
});
|
|
78
132
|
return value;
|
|
79
133
|
}
|
|
80
134
|
case zodRuntime.ZodFirstPartyTypeKind.ZodDefault: {
|
|
81
135
|
const defType = def;
|
|
82
|
-
return (0, exports.extractEnumJsonPaths)(
|
|
136
|
+
return (0, exports.extractEnumJsonPaths)({
|
|
137
|
+
schema: defType.innerType,
|
|
138
|
+
zodRuntime,
|
|
139
|
+
currentPath,
|
|
140
|
+
zodTypes,
|
|
141
|
+
});
|
|
83
142
|
}
|
|
84
143
|
case zodRuntime.ZodFirstPartyTypeKind.ZodCatch: {
|
|
85
144
|
const defType = def;
|
|
86
|
-
return (0, exports.extractEnumJsonPaths)(
|
|
145
|
+
return (0, exports.extractEnumJsonPaths)({
|
|
146
|
+
schema: defType.innerType,
|
|
147
|
+
zodRuntime,
|
|
148
|
+
currentPath,
|
|
149
|
+
zodTypes,
|
|
150
|
+
});
|
|
87
151
|
}
|
|
88
152
|
case zodRuntime.ZodFirstPartyTypeKind.ZodPromise: {
|
|
89
153
|
return [];
|
|
@@ -91,13 +155,23 @@ const extractEnumJsonPaths = (schema, zodRuntime, currentPath) => {
|
|
|
91
155
|
case zodRuntime.ZodFirstPartyTypeKind.ZodBranded: {
|
|
92
156
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
93
157
|
const defType = def;
|
|
94
|
-
const value = (0, exports.extractEnumJsonPaths)(
|
|
158
|
+
const value = (0, exports.extractEnumJsonPaths)({
|
|
159
|
+
schema: defType.type,
|
|
160
|
+
zodRuntime,
|
|
161
|
+
currentPath,
|
|
162
|
+
zodTypes,
|
|
163
|
+
});
|
|
95
164
|
return value;
|
|
96
165
|
}
|
|
97
166
|
case zodRuntime.ZodFirstPartyTypeKind.ZodPipeline: {
|
|
98
167
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
99
168
|
const defType = def;
|
|
100
|
-
const value = (0, exports.extractEnumJsonPaths)(
|
|
169
|
+
const value = (0, exports.extractEnumJsonPaths)({
|
|
170
|
+
schema: defType.out,
|
|
171
|
+
zodRuntime,
|
|
172
|
+
currentPath,
|
|
173
|
+
zodTypes,
|
|
174
|
+
});
|
|
101
175
|
return value;
|
|
102
176
|
}
|
|
103
177
|
case zodRuntime.ZodFirstPartyTypeKind.ZodString:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AudioCodec, ChromeMode, Codec, ColorSpace, LogLevel, PixelFormat, ProResProfile, StillImageFormat, VideoImageFormat, X264Preset } from '@remotion/renderer';
|
|
2
2
|
import type { HardwareAccelerationOption } from '@remotion/renderer/client';
|
|
3
|
-
import type { CanUpdateDefaultPropsResponse, EnumPath, RecastCodemod, RenderJob, RequiredChromiumOptions } from '@remotion/studio-shared';
|
|
3
|
+
import type { CanUpdateDefaultPropsResponse, EnumPath, RecastCodemod, RenderJob, RequiredChromiumOptions, VisualControlChange } from '@remotion/studio-shared';
|
|
4
4
|
export declare const addStillRenderJob: ({ compositionId, outName, imageFormat, jpegQuality, frame, scale, logLevel, chromiumOptions, delayRenderTimeout, envVariables, inputProps, offthreadVideoCacheSizeInBytes, offthreadVideoThreads, multiProcessOnLinux, beepOnFinish, metadata, chromeMode, }: {
|
|
5
5
|
compositionId: string;
|
|
6
6
|
outName: string;
|
|
@@ -106,3 +106,7 @@ export declare const updateAvailable: (signal: AbortSignal) => Promise<import("@
|
|
|
106
106
|
export declare const getProjectInfo: (signal: AbortSignal) => Promise<import("@remotion/studio-shared").ProjectInfoResponse>;
|
|
107
107
|
export declare const callUpdateDefaultPropsApi: (compositionId: string, defaultProps: Record<string, unknown>, enumPaths: EnumPath[]) => Promise<import("@remotion/studio-shared").UpdateDefaultPropsResponse>;
|
|
108
108
|
export declare const canUpdateDefaultProps: (compositionId: string, readOnlyStudio: boolean) => Promise<CanUpdateDefaultPropsResponse>;
|
|
109
|
+
export declare const applyVisualControlChange: ({ fileName, changes, }: {
|
|
110
|
+
fileName: string;
|
|
111
|
+
changes: VisualControlChange[];
|
|
112
|
+
}) => Promise<import("@remotion/studio-shared").ApplyVisualControlResponse>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.canUpdateDefaultProps = exports.callUpdateDefaultPropsApi = exports.getProjectInfo = exports.updateAvailable = exports.cancelRenderJob = exports.removeRenderJob = exports.applyCodemod = exports.openInFileExplorer = exports.subscribeToFileExistenceWatcher = exports.unsubscribeFromFileExistenceWatcher = exports.addVideoRenderJob = exports.addSequenceRenderJob = exports.addStillRenderJob = void 0;
|
|
3
|
+
exports.applyVisualControlChange = exports.canUpdateDefaultProps = exports.callUpdateDefaultPropsApi = exports.getProjectInfo = exports.updateAvailable = exports.cancelRenderJob = exports.removeRenderJob = exports.applyCodemod = exports.openInFileExplorer = exports.subscribeToFileExistenceWatcher = exports.unsubscribeFromFileExistenceWatcher = exports.addVideoRenderJob = exports.addSequenceRenderJob = exports.addStillRenderJob = void 0;
|
|
4
4
|
const no_react_1 = require("remotion/no-react");
|
|
5
5
|
const call_api_1 = require("../call-api");
|
|
6
6
|
const addStillRenderJob = ({ compositionId, outName, imageFormat, jpegQuality, frame, scale, logLevel, chromiumOptions, delayRenderTimeout, envVariables, inputProps, offthreadVideoCacheSizeInBytes, offthreadVideoThreads, multiProcessOnLinux, beepOnFinish, metadata, chromeMode, }) => {
|
|
@@ -16,7 +16,7 @@ const addStillRenderJob = ({ compositionId, outName, imageFormat, jpegQuality, f
|
|
|
16
16
|
chromiumOptions,
|
|
17
17
|
delayRenderTimeout,
|
|
18
18
|
envVariables,
|
|
19
|
-
serializedInputPropsWithCustomSchema: no_react_1.NoReactInternals.
|
|
19
|
+
serializedInputPropsWithCustomSchema: no_react_1.NoReactInternals.serializeJSONWithSpecialTypes({
|
|
20
20
|
data: inputProps,
|
|
21
21
|
staticBase: window.remotion_staticBase,
|
|
22
22
|
indent: undefined,
|
|
@@ -45,7 +45,7 @@ const addSequenceRenderJob = ({ compositionId, outName, imageFormat, startFrame,
|
|
|
45
45
|
delayRenderTimeout,
|
|
46
46
|
envVariables,
|
|
47
47
|
concurrency,
|
|
48
|
-
serializedInputPropsWithCustomSchema: no_react_1.NoReactInternals.
|
|
48
|
+
serializedInputPropsWithCustomSchema: no_react_1.NoReactInternals.serializeJSONWithSpecialTypes({
|
|
49
49
|
data: inputProps,
|
|
50
50
|
staticBase: window.remotion_staticBase,
|
|
51
51
|
indent: undefined,
|
|
@@ -89,7 +89,7 @@ const addVideoRenderJob = ({ compositionId, outName, imageFormat, jpegQuality, s
|
|
|
89
89
|
disallowParallelEncoding,
|
|
90
90
|
chromiumOptions,
|
|
91
91
|
envVariables,
|
|
92
|
-
serializedInputPropsWithCustomSchema: no_react_1.NoReactInternals.
|
|
92
|
+
serializedInputPropsWithCustomSchema: no_react_1.NoReactInternals.serializeJSONWithSpecialTypes({
|
|
93
93
|
data: inputProps,
|
|
94
94
|
staticBase: window.remotion_staticBase,
|
|
95
95
|
indent: undefined,
|
|
@@ -160,7 +160,7 @@ exports.getProjectInfo = getProjectInfo;
|
|
|
160
160
|
const callUpdateDefaultPropsApi = (compositionId, defaultProps, enumPaths) => {
|
|
161
161
|
return (0, call_api_1.callApi)('/api/update-default-props', {
|
|
162
162
|
compositionId,
|
|
163
|
-
defaultProps: no_react_1.NoReactInternals.
|
|
163
|
+
defaultProps: no_react_1.NoReactInternals.serializeJSONWithSpecialTypes({
|
|
164
164
|
data: defaultProps,
|
|
165
165
|
indent: undefined,
|
|
166
166
|
staticBase: window.remotion_staticBase,
|
|
@@ -181,3 +181,10 @@ const canUpdateDefaultProps = (compositionId, readOnlyStudio) => {
|
|
|
181
181
|
});
|
|
182
182
|
};
|
|
183
183
|
exports.canUpdateDefaultProps = canUpdateDefaultProps;
|
|
184
|
+
const applyVisualControlChange = ({ fileName, changes, }) => {
|
|
185
|
+
return (0, call_api_1.callApi)('/api/apply-visual-control-change', {
|
|
186
|
+
fileName,
|
|
187
|
+
changes,
|
|
188
|
+
});
|
|
189
|
+
};
|
|
190
|
+
exports.applyVisualControlChange = applyVisualControlChange;
|
|
@@ -22,13 +22,15 @@ exports.Tabs = Tabs;
|
|
|
22
22
|
const selectorButton = {
|
|
23
23
|
border: 'none',
|
|
24
24
|
flex: 1,
|
|
25
|
-
padding:
|
|
25
|
+
padding: 4,
|
|
26
|
+
height: 40,
|
|
26
27
|
paddingLeft: 16,
|
|
27
28
|
display: 'flex',
|
|
28
29
|
flexDirection: 'row',
|
|
29
30
|
fontSize: 14,
|
|
30
31
|
color: 'inherit',
|
|
31
32
|
alignItems: 'center',
|
|
33
|
+
cursor: 'default',
|
|
32
34
|
};
|
|
33
35
|
const Tab = ({ children, onClick, style, selected }) => {
|
|
34
36
|
const [hovered, setHovered] = (0, react_1.useState)(false);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const getOriginalLocationFromStack: (stack: string) => Promise<import("../../../error-overlay/react-overlay/utils/get-source-map").OriginalPosition | null>;
|
|
1
|
+
export declare const getOriginalLocationFromStack: (stack: string, type: "sequence" | "visual-control") => Promise<import("../../../error-overlay/react-overlay/utils/get-source-map").OriginalPosition | null>;
|
|
@@ -39,8 +39,10 @@ const getSourceMapCache = async (fileName) => {
|
|
|
39
39
|
isCreating[fileName] = false;
|
|
40
40
|
return map;
|
|
41
41
|
};
|
|
42
|
-
const getOriginalLocationFromStack = async (stack) => {
|
|
43
|
-
const location =
|
|
42
|
+
const getOriginalLocationFromStack = async (stack, type) => {
|
|
43
|
+
const location = type === 'sequence'
|
|
44
|
+
? (0, get_location_of_sequence_1.getLocationOfSequence)(stack)
|
|
45
|
+
: (0, get_location_of_sequence_1.getLocationOfFunctionCall)(stack, 'visualControl');
|
|
44
46
|
if (!location) {
|
|
45
47
|
return null;
|
|
46
48
|
}
|
|
@@ -50,13 +50,7 @@ const TimelineStack = ({ isCompact, sequence }) => {
|
|
|
50
50
|
}
|
|
51
51
|
setOpening(true);
|
|
52
52
|
try {
|
|
53
|
-
await (0, open_in_editor_1.
|
|
54
|
-
originalColumnNumber: location.column,
|
|
55
|
-
originalFileName: location.source,
|
|
56
|
-
originalFunctionName: null,
|
|
57
|
-
originalLineNumber: location.line,
|
|
58
|
-
originalScriptCode: null,
|
|
59
|
-
});
|
|
53
|
+
await (0, open_in_editor_1.openOriginalPositionInEditor)(location);
|
|
60
54
|
}
|
|
61
55
|
catch (err) {
|
|
62
56
|
(0, NotificationCenter_1.showNotification)(err.message, 2000);
|
|
@@ -114,7 +108,7 @@ const TimelineStack = ({ isCompact, sequence }) => {
|
|
|
114
108
|
if (!sequence.stack) {
|
|
115
109
|
return;
|
|
116
110
|
}
|
|
117
|
-
(0, get_stack_1.getOriginalLocationFromStack)(sequence.stack)
|
|
111
|
+
(0, get_stack_1.getOriginalLocationFromStack)(sequence.stack, 'sequence')
|
|
118
112
|
.then((frame) => {
|
|
119
113
|
setOriginalLocation(frame);
|
|
120
114
|
})
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import type { OriginalPosition } from '../../error-overlay/react-overlay/utils/get-source-map';
|
|
2
|
+
export type OriginalFileNameState = {
|
|
3
|
+
type: 'loaded';
|
|
4
|
+
originalFileName: OriginalPosition;
|
|
5
|
+
} | {
|
|
6
|
+
type: 'error';
|
|
7
|
+
error: Error;
|
|
8
|
+
} | {
|
|
9
|
+
type: 'loading';
|
|
10
|
+
};
|
|
11
|
+
export declare const ClickableFileName: ({ originalFileName, }: {
|
|
12
|
+
readonly originalFileName: OriginalFileNameState;
|
|
3
13
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,16 +3,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ClickableFileName = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
+
const colors_1 = require("../../helpers/colors");
|
|
6
7
|
const open_in_editor_1 = require("../../helpers/open-in-editor");
|
|
8
|
+
const Fieldset_1 = require("../RenderModal/SchemaEditor/Fieldset");
|
|
7
9
|
const source_attribution_1 = require("../Timeline/TimelineStack/source-attribution");
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
const container = {
|
|
11
|
+
paddingLeft: Fieldset_1.SCHEMA_EDITOR_FIELDSET_PADDING,
|
|
12
|
+
paddingTop: Fieldset_1.SCHEMA_EDITOR_FIELDSET_PADDING / 2,
|
|
11
13
|
};
|
|
12
|
-
const ClickableFileName = ({
|
|
13
|
-
const originalFileName = (0, get_original_stack_trace_1.useOriginalFileName)(stack);
|
|
14
|
+
const ClickableFileName = ({ originalFileName, }) => {
|
|
14
15
|
const [titleHovered, setTitleHovered] = (0, react_1.useState)(false);
|
|
15
|
-
const hoverEffect = titleHovered && originalFileName;
|
|
16
|
+
const hoverEffect = titleHovered && originalFileName.type === 'loaded';
|
|
16
17
|
const onTitlePointerEnter = (0, react_1.useCallback)(() => {
|
|
17
18
|
setTitleHovered(true);
|
|
18
19
|
}, []);
|
|
@@ -21,19 +22,22 @@ const ClickableFileName = ({ stack }) => {
|
|
|
21
22
|
}, []);
|
|
22
23
|
const style = (0, react_1.useMemo)(() => {
|
|
23
24
|
return {
|
|
24
|
-
|
|
25
|
-
cursor: originalFileName ? 'pointer' : undefined,
|
|
25
|
+
fontSize: 12,
|
|
26
|
+
cursor: originalFileName.type === 'loaded' ? 'pointer' : undefined,
|
|
26
27
|
borderBottom: hoverEffect ? '1px solid #fff' : 'none',
|
|
28
|
+
color: hoverEffect ? '#fff' : colors_1.LIGHT_COLOR,
|
|
27
29
|
};
|
|
28
30
|
}, [originalFileName, hoverEffect]);
|
|
29
31
|
const onClick = (0, react_1.useCallback)(async () => {
|
|
30
|
-
if (
|
|
32
|
+
if (originalFileName.type !== 'loaded') {
|
|
31
33
|
return;
|
|
32
34
|
}
|
|
33
|
-
await (0, open_in_editor_1.openOriginalPositionInEditor)(originalFileName);
|
|
35
|
+
await (0, open_in_editor_1.openOriginalPositionInEditor)(originalFileName.originalFileName);
|
|
34
36
|
}, [originalFileName]);
|
|
35
|
-
return ((0, jsx_runtime_1.jsx)("span", { style: style, onClick: onClick, onPointerEnter: onTitlePointerEnter, onPointerLeave: onTitlePointerLeave, children: originalFileName
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: container, children: (0, jsx_runtime_1.jsx)("span", { style: style, onClick: onClick, onPointerEnter: onTitlePointerEnter, onPointerLeave: onTitlePointerLeave, children: originalFileName.type === 'loaded'
|
|
38
|
+
? (0, source_attribution_1.getOriginalSourceAttribution)(originalFileName.originalFileName)
|
|
39
|
+
: originalFileName.type === 'loading'
|
|
40
|
+
? 'Loading...'
|
|
41
|
+
: 'Error loading' }) }));
|
|
38
42
|
};
|
|
39
43
|
exports.ClickableFileName = ClickableFileName;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { VisualControlHook } from '../../visual-controls/VisualControls';
|
|
3
2
|
import { type VisualControlValue } from '../../visual-controls/VisualControls';
|
|
4
3
|
export declare const VisualControlHandle: React.FC<{
|
|
5
4
|
readonly value: VisualControlValue;
|
|
6
5
|
readonly keyName: string;
|
|
7
|
-
readonly hook: VisualControlHook;
|
|
8
6
|
}>;
|