@remotion/cli 4.0.0-alpha13 → 4.0.0-alpha14
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/ansi/ansi-diff.d.ts +1 -1
- package/dist/ansi/ansi-regex.d.ts +2 -0
- package/dist/ansi/ansi-regex.js +18 -0
- package/dist/benchmark.js +29 -14
- package/dist/cleanup-before-quit.js +3 -0
- package/dist/composition-prompts.d.ts +2 -2
- package/dist/compositions.js +8 -7
- package/dist/config/concurrency.d.ts +1 -1
- package/dist/config/ffmpeg-executable.d.ts +5 -0
- package/dist/config/ffmpeg-executable.js +21 -0
- package/dist/config/index.d.ts +2 -2
- package/dist/config/jpeg-quality.d.ts +1 -1
- package/dist/config/jpeg-quality.js +1 -1
- package/dist/config/number-of-gif-loops.d.ts +1 -1
- package/dist/config/override-webpack.d.ts +1 -1
- package/dist/config/quality.d.ts +2 -0
- package/dist/config/quality.js +17 -0
- package/dist/config/scale.d.ts +1 -1
- package/dist/config/user-agent.d.ts +1 -1
- package/dist/editor/components/CanvasOrLoading.js +3 -0
- package/dist/editor/components/Checkbox.d.ts +1 -0
- package/dist/editor/components/Checkbox.js +2 -2
- package/dist/editor/components/ClipboardIcon.d.ts +2 -0
- package/dist/editor/components/ClipboardIcon.js +12 -0
- package/dist/editor/components/CollapsedCompositionSelector.d.ts +4 -0
- package/dist/editor/components/CollapsedCompositionSelector.js +39 -0
- package/dist/editor/components/CompositionSelectorItem.d.ts +1 -1
- package/dist/editor/components/InlineAction.d.ts +1 -1
- package/dist/editor/components/Menu/MenuItem.d.ts +2 -2
- package/dist/editor/components/Menu/MenuSubItem.d.ts +1 -1
- package/dist/editor/components/NewComposition/ComboBox.d.ts +4 -4
- package/dist/editor/components/NewComposition/CopyHint.js +1 -1
- package/dist/editor/components/NewComposition/InputDragger.d.ts +1 -1
- package/dist/editor/components/NewComposition/RemInput.d.ts +2 -2
- package/dist/editor/components/NewComposition/RemInputTypeColor.d.ts +2 -1
- package/dist/editor/components/NewComposition/RemInputTypeColor.js +1 -1
- package/dist/editor/components/NewComposition/RemTextarea.d.ts +1 -1
- package/dist/editor/components/Notifications/NotificationCenter.d.ts +2 -2
- package/dist/editor/components/QuickSwitcher/NoResults.d.ts +1 -1
- package/dist/editor/components/QuickSwitcher/QuickSwitcherResult.d.ts +2 -2
- package/dist/editor/components/RenderModal/DataEditor.d.ts +2 -3
- package/dist/editor/components/RenderModal/DataEditor.js +14 -5
- package/dist/editor/components/RenderModal/EnforceAudioTrackSetting.js +1 -1
- package/dist/editor/components/RenderModal/MutedSetting.js +1 -1
- package/dist/editor/components/RenderModal/RenderModal.d.ts +1 -1
- package/dist/editor/components/RenderModal/RenderModal.js +2 -2
- package/dist/editor/components/RenderModal/RenderModalAdvanced.d.ts +1 -1
- package/dist/editor/components/RenderModal/RenderModalAdvanced.js +1 -1
- package/dist/editor/components/RenderModal/RenderModalAudio.js +1 -1
- package/dist/editor/components/RenderModal/RenderModalData.d.ts +3 -2
- package/dist/editor/components/RenderModal/RenderModalData.js +23 -34
- package/dist/editor/components/RenderModal/RenderModalGif.js +1 -1
- package/dist/editor/components/RenderModal/RenderModalInput.d.ts +1 -1
- package/dist/editor/components/RenderModal/RenderModalJSONPropsEditor.d.ts +1 -1
- package/dist/editor/components/RenderModal/RenderModalPicture.d.ts +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/Fieldset.d.ts +7 -0
- package/dist/editor/components/RenderModal/SchemaEditor/Fieldset.js +26 -0
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaEditor.d.ts +0 -1
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaEditor.js +2 -3
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaErrorMessages.js +1 -3
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaLabel.d.ts +1 -7
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaLabel.js +14 -22
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaSeparationLine.d.ts +2 -0
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaSeparationLine.js +11 -0
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaVerticalGuide.d.ts +5 -0
- package/dist/editor/components/RenderModal/SchemaEditor/SchemaVerticalGuide.js +13 -0
- package/dist/editor/components/RenderModal/SchemaEditor/ZodArrayEditor.d.ts +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodArrayEditor.js +51 -42
- package/dist/editor/components/RenderModal/SchemaEditor/ZodArrayItemEditor.d.ts +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodArrayItemEditor.js +5 -5
- package/dist/editor/components/RenderModal/SchemaEditor/ZodBooleanEditor.d.ts +3 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodBooleanEditor.js +14 -13
- package/dist/editor/components/RenderModal/SchemaEditor/ZodColorEditor.d.ts +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodColorEditor.js +12 -14
- package/dist/editor/components/RenderModal/SchemaEditor/ZodDateEditor.d.ts +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodDateEditor.js +9 -15
- package/dist/editor/components/RenderModal/SchemaEditor/ZodDefaultEditor.d.ts +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodDefaultEditor.js +2 -2
- package/dist/editor/components/RenderModal/SchemaEditor/ZodEffectEditor.d.ts +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodEffectEditor.js +5 -30
- package/dist/editor/components/RenderModal/SchemaEditor/ZodEnumEditor.d.ts +0 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodEnumEditor.js +8 -11
- package/dist/editor/components/RenderModal/SchemaEditor/ZodFieldValidation.d.ts +7 -0
- package/dist/editor/components/RenderModal/SchemaEditor/ZodFieldValidation.js +27 -0
- package/dist/editor/components/RenderModal/SchemaEditor/ZodNonEditableValue.d.ts +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodNonEditableValue.js +3 -3
- package/dist/editor/components/RenderModal/SchemaEditor/ZodNullableEditor.d.ts +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodNullableEditor.js +2 -2
- package/dist/editor/components/RenderModal/SchemaEditor/ZodNumberEditor.d.ts +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodNumberEditor.js +10 -13
- package/dist/editor/components/RenderModal/SchemaEditor/ZodObjectEditor.d.ts +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodObjectEditor.js +39 -45
- package/dist/editor/components/RenderModal/SchemaEditor/ZodOptionalEditor.d.ts +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodOptionalEditor.js +2 -2
- package/dist/editor/components/RenderModal/SchemaEditor/ZodOrNullishEditor.d.ts +2 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodOrNullishEditor.js +13 -48
- package/dist/editor/components/RenderModal/SchemaEditor/ZodStaticFileEditor.d.ts +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodStaticFileEditor.js +7 -10
- package/dist/editor/components/RenderModal/SchemaEditor/ZodStringEditor.d.ts +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodStringEditor.js +8 -11
- package/dist/editor/components/RenderModal/SchemaEditor/ZodSwitch.d.ts +2 -2
- package/dist/editor/components/RenderModal/SchemaEditor/ZodSwitch.js +21 -21
- package/dist/editor/components/RenderModal/SchemaEditor/ZodUnionEditor.d.ts +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/ZodUnionEditor.js +6 -6
- package/dist/editor/components/RenderModal/SchemaEditor/deep-equal.js +3 -0
- package/dist/editor/components/RenderModal/SchemaEditor/extract-enum-json-paths.d.ts +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/get-schema-label.js +3 -3
- package/dist/editor/components/RenderModal/SchemaEditor/input-props-serialization.d.ts +1 -1
- package/dist/editor/components/RenderModal/SchemaEditor/local-state.d.ts +10 -5
- package/dist/editor/components/RenderModal/SchemaEditor/local-state.js +56 -15
- package/dist/editor/components/RenderModal/SchemaEditor/zod-types.d.ts +1 -1
- package/dist/editor/components/RenderModal/get-render-modal-warnings.d.ts +1 -1
- package/dist/editor/components/RenderModal/layout.d.ts +0 -1
- package/dist/editor/components/RenderModal/layout.js +1 -7
- package/dist/editor/components/RenderQueue/actions.d.ts +2 -1
- package/dist/editor/components/RenderQueue/actions.js +7 -2
- package/dist/editor/components/RenderQueue/context.d.ts +1 -1
- package/dist/editor/components/RichTimelineToggle.d.ts +2 -0
- package/dist/editor/components/RichTimelineToggle.js +29 -0
- package/dist/editor/components/RightPanel.d.ts +1 -1
- package/dist/editor/components/RightPanel.js +1 -1
- package/dist/editor/components/SegmentedControl.d.ts +1 -1
- package/dist/editor/components/SegmentedControl.js +2 -0
- package/dist/editor/components/Splitter/SplitterContext.d.ts +3 -3
- package/dist/editor/components/Thumbnail.d.ts +8 -0
- package/dist/editor/components/Thumbnail.js +76 -0
- package/dist/editor/components/Timeline/LoopedIndicator.js +6 -6
- package/dist/editor/components/Timeline/TimelineWidthProvider.d.ts +1 -1
- package/dist/editor/components/Timeline/TimelineZoomControls.js +1 -1
- package/dist/editor/components/Timeline/timeline-state-reducer.d.ts +2 -2
- package/dist/editor/components/UpdateCheck.d.ts +1 -1
- package/dist/editor/components/UpdateCheck.js +2 -4
- package/dist/editor/components/get-zod-if-possible.d.ts +2 -2
- package/dist/editor/helpers/client-id.d.ts +1 -1
- package/dist/editor/helpers/get-timeline-sequence-sort-key.d.ts +3 -3
- package/dist/editor/helpers/persist-open-folders.d.ts +1 -1
- package/dist/editor/helpers/render-modal-sections.d.ts +1 -2
- package/dist/editor/helpers/use-compact-ui.d.ts +1 -0
- package/dist/editor/helpers/use-compact-ui.js +18 -0
- package/dist/editor/helpers/use-menu-structure.d.ts +1 -1
- package/dist/editor/icons/film.d.ts +3 -0
- package/dist/editor/icons/film.js +8 -0
- package/dist/editor/icons/plus.d.ts +3 -1
- package/dist/editor/icons/plus.js +2 -2
- package/dist/editor/icons/timeline.d.ts +3 -0
- package/dist/editor/icons/timeline.js +9 -0
- package/dist/editor/state/checkerboard.d.ts +1 -1
- package/dist/editor/state/editor-zoom-gestures.d.ts +1 -1
- package/dist/editor/state/folders.d.ts +1 -1
- package/dist/editor/state/highest-z-index.d.ts +1 -1
- package/dist/editor/state/in-out.d.ts +2 -2
- package/dist/editor/state/keybindings.d.ts +4 -4
- package/dist/editor/state/modals.d.ts +4 -4
- package/dist/editor/state/preview-size.d.ts +1 -1
- package/dist/editor/state/rich-timeline.d.ts +9 -0
- package/dist/editor/state/rich-timeline.js +17 -0
- package/dist/editor/state/sidebar.d.ts +3 -3
- package/dist/editor/state/timeline-ref.d.ts +1 -1
- package/dist/event-source-events.d.ts +1 -1
- package/dist/file-watcher.d.ts +1 -1
- package/dist/get-cli-options.d.ts +1 -1
- package/dist/get-composition-id.d.ts +10 -11
- package/dist/get-composition-id.js +9 -6
- package/dist/get-composition-with-dimension-override.d.ts +4 -4
- package/dist/get-composition-with-dimension-override.js +2 -2
- package/dist/get-render-media-options.d.ts +8 -0
- package/dist/get-render-media-options.js +55 -0
- package/dist/index.d.ts +5 -4
- package/dist/install.d.ts +2 -0
- package/dist/install.js +36 -0
- package/dist/is-javascript.d.ts +2 -0
- package/dist/is-javascript.js +9 -0
- package/dist/log.d.ts +1 -0
- package/dist/parse-command-line.d.ts +1 -1
- package/dist/preview-server/api-routes.js +2 -0
- package/dist/preview-server/api-types.d.ts +5 -4
- package/dist/preview-server/dev-middleware/get-paths.d.ts +1 -1
- package/dist/preview-server/dev-middleware/is-color-supported.d.ts +1 -0
- package/dist/preview-server/dev-middleware/is-color-supported.js +37 -0
- package/dist/preview-server/dev-middleware/middleware.d.ts +1 -1
- package/dist/preview-server/dev-middleware/range-parser.d.ts +2 -2
- package/dist/preview-server/dev-middleware/types.d.ts +1 -1
- package/dist/preview-server/error-overlay/react-overlay/effects/map-error-to-react-stack.d.ts +1 -1
- package/dist/preview-server/error-overlay/react-overlay/effects/proxy-console.d.ts +3 -3
- package/dist/preview-server/error-overlay/react-overlay/effects/unhandled-error.d.ts +1 -1
- package/dist/preview-server/error-overlay/react-overlay/effects/unhandled-rejection.d.ts +1 -1
- package/dist/preview-server/error-overlay/react-overlay/listen-to-runtime-errors.d.ts +1 -1
- package/dist/preview-server/error-overlay/react-overlay/utils/get-source-map.js +1 -0
- package/dist/preview-server/error-overlay/react-overlay/utils/open-in-editor.d.ts +2 -2
- package/dist/preview-server/error-overlay/react-overlay/utils/stack-frame.d.ts +4 -4
- package/dist/preview-server/error-overlay/remotion-overlay/ErrorDisplay.d.ts +1 -1
- package/dist/preview-server/error-overlay/remotion-overlay/Overlay.d.ts +2 -2
- package/dist/preview-server/error-overlay/remotion-overlay/get-help-link.d.ts +1 -1
- package/dist/preview-server/get-package-manager.d.ts +2 -2
- package/dist/preview-server/hot-middleware/client.d.ts +1 -1
- package/dist/preview-server/hot-middleware/strip-ansi.d.ts +1 -0
- package/dist/preview-server/hot-middleware/strip-ansi.js +21 -0
- package/dist/preview-server/hot-middleware/types.d.ts +4 -4
- package/dist/preview-server/live-events.d.ts +1 -1
- package/dist/preview-server/live-events.js +10 -1
- package/dist/preview-server/project-info.d.ts +1 -1
- package/dist/preview-server/render-queue/job.d.ts +30 -21
- package/dist/preview-server/render-queue/process-still.js +1 -2
- package/dist/preview-server/routes/update-available.d.ts +3 -0
- package/dist/preview-server/routes/update-available.js +9 -0
- package/dist/preview-server/routes.d.ts +0 -1
- package/dist/preview-server/routes.js +1 -11
- package/dist/preview-server/update-available.d.ts +2 -10
- package/dist/preview.js +2 -0
- package/dist/progress-bar.d.ts +4 -4
- package/dist/progress-bar.js +3 -2
- package/dist/progress-types.d.ts +4 -4
- package/dist/render-flows/render.js +35 -28
- package/dist/render-flows/still.d.ts +1 -1
- package/dist/render-flows/still.js +23 -10
- package/dist/required-chromium-options.d.ts +2 -2
- package/dist/server-ready-comment.d.ts +1 -1
- package/dist/server-ready-comment.js +2 -2
- package/dist/setup-cache.js +10 -0
- package/dist/show-compositions-picker.d.ts +1 -1
- package/dist/step.d.ts +1 -1
- package/dist/studio.js +3 -3
- package/dist/truthy.d.ts +1 -1
- package/package.json +10 -12
|
@@ -18,7 +18,7 @@ const ZodOptionalEditor_1 = require("./ZodOptionalEditor");
|
|
|
18
18
|
const ZodStaticFileEditor_1 = require("./ZodStaticFileEditor");
|
|
19
19
|
const ZodStringEditor_1 = require("./ZodStringEditor");
|
|
20
20
|
const ZodUnionEditor_1 = require("./ZodUnionEditor");
|
|
21
|
-
const ZodSwitch = ({ schema, jsonPath,
|
|
21
|
+
const ZodSwitch = ({ schema, jsonPath, value, setValue, defaultValue, onSave, showSaveButton, onRemove, saving, saveDisabledByParent, mayPad, }) => {
|
|
22
22
|
const def = schema._def;
|
|
23
23
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
24
24
|
const typeName = def.typeName;
|
|
@@ -29,64 +29,64 @@ const ZodSwitch = ({ schema, jsonPath, compact, value, setValue, defaultValue, o
|
|
|
29
29
|
const zodTypes = (0, get_zod_if_possible_1.useZodTypesIfPossible)();
|
|
30
30
|
// TODO: (Maybe?) enable saving of inserted input props by cmd+s /ctrl + s (also for JSON view)
|
|
31
31
|
if (typeName === z.ZodFirstPartyTypeKind.ZodObject) {
|
|
32
|
-
return ((0, jsx_runtime_1.jsx)(ZodObjectEditor_1.ZodObjectEditor, { setValue: setValue, value: value, defaultValue: defaultValue, jsonPath: jsonPath, schema: schema,
|
|
32
|
+
return ((0, jsx_runtime_1.jsx)(ZodObjectEditor_1.ZodObjectEditor, { setValue: setValue, value: value, defaultValue: defaultValue, jsonPath: jsonPath, schema: schema, onSave: onSave, showSaveButton: showSaveButton, onRemove: onRemove, saving: saving, saveDisabledByParent: saveDisabledByParent, mayPad: mayPad }));
|
|
33
33
|
}
|
|
34
34
|
if (typeName === z.ZodFirstPartyTypeKind.ZodString) {
|
|
35
35
|
if (value.startsWith(window.remotion_staticBase)) {
|
|
36
|
-
return ((0, jsx_runtime_1.jsx)(ZodStaticFileEditor_1.ZodStaticFileEditor, { setValue: setValue, value: value, jsonPath: jsonPath, schema: schema,
|
|
36
|
+
return ((0, jsx_runtime_1.jsx)(ZodStaticFileEditor_1.ZodStaticFileEditor, { setValue: setValue, value: value, jsonPath: jsonPath, schema: schema, defaultValue: defaultValue, onSave: onSave, showSaveButton: showSaveButton, onRemove: onRemove, saving: saving, saveDisabledByParent: saveDisabledByParent, mayPad: mayPad }));
|
|
37
37
|
}
|
|
38
|
-
return ((0, jsx_runtime_1.jsx)(ZodStringEditor_1.ZodStringEditor, { value: value, setValue: setValue, jsonPath: jsonPath, schema: schema,
|
|
38
|
+
return ((0, jsx_runtime_1.jsx)(ZodStringEditor_1.ZodStringEditor, { value: value, setValue: setValue, jsonPath: jsonPath, schema: schema, onSave: onSave, defaultValue: defaultValue, showSaveButton: showSaveButton, onRemove: onRemove, saving: saving, saveDisabledByParent: saveDisabledByParent, mayPad: mayPad }));
|
|
39
39
|
}
|
|
40
40
|
if (typeName === z.ZodFirstPartyTypeKind.ZodDate) {
|
|
41
|
-
return ((0, jsx_runtime_1.jsx)(ZodDateEditor_1.ZodDateEditor, { value: value, setValue: setValue, jsonPath: jsonPath, schema: schema,
|
|
41
|
+
return ((0, jsx_runtime_1.jsx)(ZodDateEditor_1.ZodDateEditor, { value: value, setValue: setValue, jsonPath: jsonPath, schema: schema, onSave: onSave, defaultValue: defaultValue, showSaveButton: showSaveButton, onRemove: onRemove, saving: saving, saveDisabledByParent: saveDisabledByParent, mayPad: mayPad }));
|
|
42
42
|
}
|
|
43
43
|
if (typeName === z.ZodFirstPartyTypeKind.ZodNumber) {
|
|
44
|
-
return ((0, jsx_runtime_1.jsx)(ZodNumberEditor_1.ZodNumberEditor, { value: value, setValue: setValue, jsonPath: jsonPath, schema: schema,
|
|
44
|
+
return ((0, jsx_runtime_1.jsx)(ZodNumberEditor_1.ZodNumberEditor, { value: value, setValue: setValue, jsonPath: jsonPath, schema: schema, defaultValue: defaultValue, onSave: onSave, showSaveButton: showSaveButton, onRemove: onRemove, saving: saving, saveDisabledByParent: saveDisabledByParent, mayPad: mayPad }));
|
|
45
45
|
}
|
|
46
46
|
if (typeName === z.ZodFirstPartyTypeKind.ZodBoolean) {
|
|
47
|
-
return ((0, jsx_runtime_1.jsx)(ZodBooleanEditor_1.ZodBooleanEditor, { value: value, setValue: setValue, jsonPath: jsonPath,
|
|
47
|
+
return ((0, jsx_runtime_1.jsx)(ZodBooleanEditor_1.ZodBooleanEditor, { value: value, setValue: setValue, jsonPath: jsonPath, defaultValue: defaultValue, onSave: onSave, showSaveButton: showSaveButton, onRemove: onRemove, saving: saving, saveDisabledByParent: saveDisabledByParent, mayPad: mayPad, schema: schema }));
|
|
48
48
|
}
|
|
49
49
|
if (typeName === z.ZodFirstPartyTypeKind.ZodUndefined) {
|
|
50
|
-
return ((0, jsx_runtime_1.jsx)(ZodNonEditableValue_1.ZonNonEditableValue, {
|
|
50
|
+
return ((0, jsx_runtime_1.jsx)(ZodNonEditableValue_1.ZonNonEditableValue, { jsonPath: jsonPath, showSaveButton: showSaveButton, label: 'undefined', saving: saving, mayPad: mayPad }));
|
|
51
51
|
}
|
|
52
52
|
if (typeName === z.ZodFirstPartyTypeKind.ZodNull) {
|
|
53
|
-
return ((0, jsx_runtime_1.jsx)(ZodNonEditableValue_1.ZonNonEditableValue, {
|
|
53
|
+
return ((0, jsx_runtime_1.jsx)(ZodNonEditableValue_1.ZonNonEditableValue, { jsonPath: jsonPath, showSaveButton: showSaveButton, label: 'null', saving: saving, mayPad: mayPad }));
|
|
54
54
|
}
|
|
55
55
|
if (typeName === z.ZodFirstPartyTypeKind.ZodAny) {
|
|
56
|
-
return ((0, jsx_runtime_1.jsx)(ZodNonEditableValue_1.ZonNonEditableValue, {
|
|
56
|
+
return ((0, jsx_runtime_1.jsx)(ZodNonEditableValue_1.ZonNonEditableValue, { jsonPath: jsonPath, showSaveButton: showSaveButton, label: 'any (not editable)', saving: saving, mayPad: mayPad }));
|
|
57
57
|
}
|
|
58
58
|
if (typeName === z.ZodFirstPartyTypeKind.ZodBigInt) {
|
|
59
|
-
return ((0, jsx_runtime_1.jsx)(ZodNonEditableValue_1.ZonNonEditableValue, {
|
|
59
|
+
return ((0, jsx_runtime_1.jsx)(ZodNonEditableValue_1.ZonNonEditableValue, { jsonPath: jsonPath, showSaveButton: showSaveButton, label: 'BigInt (not editable)', saving: saving, mayPad: mayPad }));
|
|
60
60
|
}
|
|
61
61
|
if (typeName === z.ZodFirstPartyTypeKind.ZodUnknown) {
|
|
62
|
-
return ((0, jsx_runtime_1.jsx)(ZodNonEditableValue_1.ZonNonEditableValue, {
|
|
62
|
+
return ((0, jsx_runtime_1.jsx)(ZodNonEditableValue_1.ZonNonEditableValue, { jsonPath: jsonPath, showSaveButton: showSaveButton, label: 'unknown (not editable)', saving: saving, mayPad: mayPad }));
|
|
63
63
|
}
|
|
64
64
|
if (typeName === z.ZodFirstPartyTypeKind.ZodArray) {
|
|
65
|
-
return ((0, jsx_runtime_1.jsx)(ZodArrayEditor_1.ZodArrayEditor, { setValue: setValue, value: value, jsonPath: jsonPath, schema: schema,
|
|
65
|
+
return ((0, jsx_runtime_1.jsx)(ZodArrayEditor_1.ZodArrayEditor, { setValue: setValue, value: value, jsonPath: jsonPath, schema: schema, defaultValue: defaultValue, onSave: onSave, showSaveButton: showSaveButton, onRemove: onRemove, saving: saving, saveDisabledByParent: saveDisabledByParent, mayPad: mayPad }));
|
|
66
66
|
}
|
|
67
67
|
if (typeName === z.ZodFirstPartyTypeKind.ZodEnum) {
|
|
68
|
-
return ((0, jsx_runtime_1.jsx)(ZodEnumEditor_1.ZodEnumEditor, { setValue: setValue, value: value, jsonPath: jsonPath, schema: schema,
|
|
68
|
+
return ((0, jsx_runtime_1.jsx)(ZodEnumEditor_1.ZodEnumEditor, { setValue: setValue, value: value, jsonPath: jsonPath, schema: schema, defaultValue: defaultValue, onSave: onSave, showSaveButton: showSaveButton, onRemove: onRemove, saving: saving }));
|
|
69
69
|
}
|
|
70
70
|
if (typeName === z.ZodFirstPartyTypeKind.ZodEffects) {
|
|
71
71
|
if (zodTypes &&
|
|
72
72
|
schema._def.description ===
|
|
73
73
|
zodTypes.ZodZypesInternals.REMOTION_COLOR_BRAND) {
|
|
74
|
-
return ((0, jsx_runtime_1.jsx)(ZodColorEditor_1.ZodColorEditor, { value: value, setValue: setValue, jsonPath: jsonPath, schema: schema,
|
|
74
|
+
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 }));
|
|
75
75
|
}
|
|
76
|
-
return ((0, jsx_runtime_1.jsx)(ZodEffectEditor_1.ZodEffectEditor, { value: value, setValue: setValue, jsonPath: jsonPath, schema: schema,
|
|
76
|
+
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 }));
|
|
77
77
|
}
|
|
78
78
|
if (typeName === z.ZodFirstPartyTypeKind.ZodUnion) {
|
|
79
|
-
return ((0, jsx_runtime_1.jsx)(ZodUnionEditor_1.ZodUnionEditor, { schema: schema, showSaveButton: showSaveButton, jsonPath: jsonPath,
|
|
79
|
+
return ((0, jsx_runtime_1.jsx)(ZodUnionEditor_1.ZodUnionEditor, { schema: schema, showSaveButton: showSaveButton, jsonPath: jsonPath, value: value, defaultValue: defaultValue, setValue: setValue, onSave: onSave, onRemove: onRemove, saving: saving, saveDisabledByParent: saveDisabledByParent, mayPad: mayPad }));
|
|
80
80
|
}
|
|
81
81
|
if (typeName === z.ZodFirstPartyTypeKind.ZodOptional) {
|
|
82
|
-
return ((0, jsx_runtime_1.jsx)(ZodOptionalEditor_1.ZodOptionalEditor, {
|
|
82
|
+
return ((0, jsx_runtime_1.jsx)(ZodOptionalEditor_1.ZodOptionalEditor, { jsonPath: jsonPath, showSaveButton: showSaveButton, defaultValue: defaultValue, value: value, setValue: setValue, onSave: onSave, onRemove: onRemove, schema: schema, saving: saving, saveDisabledByParent: saveDisabledByParent, mayPad: mayPad }));
|
|
83
83
|
}
|
|
84
84
|
if (typeName === z.ZodFirstPartyTypeKind.ZodNullable) {
|
|
85
|
-
return ((0, jsx_runtime_1.jsx)(ZodNullableEditor_1.ZodNullableEditor, {
|
|
85
|
+
return ((0, jsx_runtime_1.jsx)(ZodNullableEditor_1.ZodNullableEditor, { jsonPath: jsonPath, showSaveButton: showSaveButton, defaultValue: defaultValue, value: value, setValue: setValue, onSave: onSave, onRemove: onRemove, schema: schema, saving: saving, saveDisabledByParent: saveDisabledByParent, mayPad: mayPad }));
|
|
86
86
|
}
|
|
87
87
|
if (typeName === z.ZodFirstPartyTypeKind.ZodDefault) {
|
|
88
|
-
return ((0, jsx_runtime_1.jsx)(ZodDefaultEditor_1.ZodDefaultEditor, {
|
|
88
|
+
return ((0, jsx_runtime_1.jsx)(ZodDefaultEditor_1.ZodDefaultEditor, { jsonPath: jsonPath, showSaveButton: showSaveButton, defaultValue: defaultValue, value: value, setValue: setValue, onSave: onSave, onRemove: onRemove, schema: schema, saving: saving, saveDisabledByParent: saveDisabledByParent, mayPad: mayPad }));
|
|
89
89
|
}
|
|
90
|
-
return ((0, jsx_runtime_1.jsx)(ZodNonEditableValue_1.ZonNonEditableValue, {
|
|
90
|
+
return ((0, jsx_runtime_1.jsx)(ZodNonEditableValue_1.ZonNonEditableValue, { jsonPath: jsonPath, showSaveButton: showSaveButton, label: `${typeName} (not editable)`, saving: saving, mayPad: mayPad }));
|
|
91
91
|
};
|
|
92
92
|
exports.ZodSwitch = ZodSwitch;
|
|
@@ -5,7 +5,6 @@ import type { UpdaterFunction } from './ZodSwitch';
|
|
|
5
5
|
export declare const ZodUnionEditor: React.FC<{
|
|
6
6
|
showSaveButton: boolean;
|
|
7
7
|
jsonPath: JSONPath;
|
|
8
|
-
compact: boolean;
|
|
9
8
|
value: unknown;
|
|
10
9
|
defaultValue: unknown;
|
|
11
10
|
schema: z.ZodTypeAny;
|
|
@@ -14,4 +13,5 @@ export declare const ZodUnionEditor: React.FC<{
|
|
|
14
13
|
onRemove: null | (() => void);
|
|
15
14
|
saving: boolean;
|
|
16
15
|
saveDisabledByParent: boolean;
|
|
16
|
+
mayPad: boolean;
|
|
17
17
|
}>;
|
|
@@ -24,26 +24,26 @@ const findNull = (value, zodType) => {
|
|
|
24
24
|
otherSchemaIsAlsoNullish,
|
|
25
25
|
};
|
|
26
26
|
};
|
|
27
|
-
const ZodUnionEditor = ({ jsonPath,
|
|
27
|
+
const ZodUnionEditor = ({ jsonPath, schema, setValue, onSave, defaultValue, value, showSaveButton, onRemove, saving, saveDisabledByParent, mayPad, }) => {
|
|
28
28
|
const { options } = schema._def;
|
|
29
29
|
const z = (0, get_zod_if_possible_1.useZodIfPossible)();
|
|
30
30
|
if (!z) {
|
|
31
31
|
throw new Error('expected zod');
|
|
32
32
|
}
|
|
33
33
|
if (options.length > 2) {
|
|
34
|
-
return ((0, jsx_runtime_1.jsx)(ZodNonEditableValue_1.ZonNonEditableValue, { jsonPath: jsonPath, label: 'Union with more than 2 options not editable',
|
|
34
|
+
return ((0, jsx_runtime_1.jsx)(ZodNonEditableValue_1.ZonNonEditableValue, { jsonPath: jsonPath, label: 'Union with more than 2 options not editable', showSaveButton: showSaveButton, saving: saving, mayPad: mayPad }));
|
|
35
35
|
}
|
|
36
36
|
if (options.length < 2) {
|
|
37
|
-
return ((0, jsx_runtime_1.jsx)(ZodNonEditableValue_1.ZonNonEditableValue, { jsonPath: jsonPath, label: 'Union with less than 2 options not editable',
|
|
37
|
+
return ((0, jsx_runtime_1.jsx)(ZodNonEditableValue_1.ZonNonEditableValue, { jsonPath: jsonPath, label: 'Union with less than 2 options not editable', showSaveButton: showSaveButton, saving: saving, mayPad: mayPad }));
|
|
38
38
|
}
|
|
39
39
|
const nullResult = findNull(options, z);
|
|
40
40
|
if (!nullResult) {
|
|
41
|
-
return ((0, jsx_runtime_1.jsx)(ZodNonEditableValue_1.ZonNonEditableValue, { jsonPath: jsonPath, label: 'Union only editable with 1 value being null',
|
|
41
|
+
return ((0, jsx_runtime_1.jsx)(ZodNonEditableValue_1.ZonNonEditableValue, { jsonPath: jsonPath, label: 'Union only editable with 1 value being null', showSaveButton: showSaveButton, saving: saving, mayPad: mayPad }));
|
|
42
42
|
}
|
|
43
43
|
const { otherSchema, nullishValue, otherSchemaIsAlsoNullish } = nullResult;
|
|
44
44
|
if (otherSchemaIsAlsoNullish) {
|
|
45
|
-
return ((0, jsx_runtime_1.jsx)(ZodNonEditableValue_1.ZonNonEditableValue, { jsonPath: jsonPath, label: 'Not editable - both union values are nullish',
|
|
45
|
+
return ((0, jsx_runtime_1.jsx)(ZodNonEditableValue_1.ZonNonEditableValue, { jsonPath: jsonPath, label: 'Not editable - both union values are nullish', showSaveButton: showSaveButton, saving: saving, mayPad: mayPad }));
|
|
46
46
|
}
|
|
47
|
-
return ((0, jsx_runtime_1.jsx)(ZodOrNullishEditor_1.ZodOrNullishEditor, {
|
|
47
|
+
return ((0, jsx_runtime_1.jsx)(ZodOrNullishEditor_1.ZodOrNullishEditor, { defaultValue: defaultValue, jsonPath: jsonPath, onRemove: onRemove, onSave: onSave, schema: schema, innerSchema: otherSchema, setValue: setValue, showSaveButton: showSaveButton, value: value, nullishValue: nullishValue, saving: saving, saveDisabledByParent: saveDisabledByParent, mayPad: mayPad }));
|
|
48
48
|
};
|
|
49
49
|
exports.ZodUnionEditor = ZodUnionEditor;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ZodType } from '../../get-zod-if-possible';
|
|
2
|
-
export
|
|
2
|
+
export type EnumPath = (string | number)[];
|
|
3
3
|
export declare const extractEnumJsonPaths: (schema: Zod.ZodTypeAny, zodRuntime: ZodType, currentPath: (string | number)[]) => (string | number)[][];
|
|
@@ -6,10 +6,10 @@ const getSchemaLabel = (jsonPath) => {
|
|
|
6
6
|
if (typeof lastKey === 'number') {
|
|
7
7
|
const secondLastKey = jsonPath[jsonPath.length - 2];
|
|
8
8
|
if (typeof secondLastKey === 'undefined') {
|
|
9
|
-
return `[${lastKey}]
|
|
9
|
+
return `[${lastKey}]:`;
|
|
10
10
|
}
|
|
11
|
-
return `${
|
|
11
|
+
return `${lastKey}:`;
|
|
12
12
|
}
|
|
13
|
-
return lastKey
|
|
13
|
+
return `${lastKey}:`;
|
|
14
14
|
};
|
|
15
15
|
exports.getSchemaLabel = getSchemaLabel;
|
|
@@ -1,16 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import type { z } from 'zod';
|
|
2
3
|
import type { UpdaterFunction } from './ZodSwitch';
|
|
3
|
-
|
|
4
|
+
export type LocalState<T> = {
|
|
4
5
|
value: T;
|
|
5
6
|
zodValidation: z.SafeParseReturnType<unknown, unknown>;
|
|
6
|
-
|
|
7
|
+
keyStabilityRevision: number;
|
|
7
8
|
};
|
|
8
|
-
export declare const useLocalState: <T>({ value, schema, setValue, }: {
|
|
9
|
+
export declare const useLocalState: <T>({ value, schema, setValue, defaultValue, }: {
|
|
9
10
|
value: T;
|
|
10
11
|
schema: z.ZodTypeAny;
|
|
11
12
|
setValue: UpdaterFunction<T>;
|
|
13
|
+
defaultValue: T;
|
|
12
14
|
}) => {
|
|
13
15
|
localValue: LocalState<T>;
|
|
14
|
-
onChange: (updater: (oldV: T) => T, forceApply: boolean) => void;
|
|
16
|
+
onChange: (updater: (oldV: T) => T, forceApply: boolean, increment: boolean) => void;
|
|
17
|
+
reset: () => void;
|
|
18
|
+
RevisionContextProvider: ({ children }: {
|
|
19
|
+
children: React.ReactNode;
|
|
20
|
+
}) => JSX.Element;
|
|
15
21
|
};
|
|
16
|
-
export {};
|
|
@@ -1,19 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useLocalState = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
5
|
const react_1 = require("react");
|
|
5
6
|
const deep_equal_1 = require("./deep-equal");
|
|
6
|
-
const
|
|
7
|
+
const RevisionContext = (0, react_1.createContext)({
|
|
8
|
+
childResetRevision: 0,
|
|
9
|
+
});
|
|
10
|
+
const useLocalState = ({ value, schema, setValue, defaultValue, }) => {
|
|
11
|
+
const parentRevision = (0, react_1.useContext)(RevisionContext).childResetRevision;
|
|
12
|
+
const [resetRevision, setResetRevision] = (0, react_1.useState)(0);
|
|
7
13
|
const [localValue, setLocalValue] = (0, react_1.useState)(() => {
|
|
8
|
-
return {
|
|
9
|
-
value,
|
|
10
|
-
zodValidation: schema.safeParse(value),
|
|
11
|
-
revision: 0,
|
|
12
|
-
};
|
|
14
|
+
return {};
|
|
13
15
|
});
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
const currentLocalValue = (0, react_1.useMemo)(() => {
|
|
17
|
+
var _a;
|
|
18
|
+
return ((_a = localValue[parentRevision]) !== null && _a !== void 0 ? _a : {
|
|
19
|
+
value: defaultValue,
|
|
20
|
+
keyStabilityRevision: 0,
|
|
21
|
+
zodValidation: schema.safeParse(value),
|
|
22
|
+
});
|
|
23
|
+
}, [defaultValue, localValue, parentRevision, schema, value]);
|
|
24
|
+
const stateRef = (0, react_1.useRef)(currentLocalValue);
|
|
25
|
+
stateRef.current = currentLocalValue;
|
|
26
|
+
const onChange = (0, react_1.useCallback)(
|
|
27
|
+
// Increment is to regenerate `key` attributes in array items,
|
|
28
|
+
// so should increment when changing array items
|
|
29
|
+
(updater, forceApply, increment) => {
|
|
17
30
|
const newValue = updater(stateRef.current.value);
|
|
18
31
|
const isSame = (0, deep_equal_1.deepEqual)(newValue, stateRef.current.value);
|
|
19
32
|
if (isSame) {
|
|
@@ -21,18 +34,46 @@ const useLocalState = ({ value, schema, setValue, }) => {
|
|
|
21
34
|
}
|
|
22
35
|
const safeParse = schema.safeParse(newValue);
|
|
23
36
|
if (safeParse.success || forceApply) {
|
|
24
|
-
setValue(updater, forceApply);
|
|
37
|
+
setValue(updater, forceApply, increment);
|
|
25
38
|
}
|
|
26
|
-
setLocalValue((
|
|
39
|
+
setLocalValue(() => {
|
|
27
40
|
const newState = {
|
|
28
|
-
|
|
41
|
+
keyStabilityRevision: currentLocalValue.keyStabilityRevision + (increment ? 1 : 0),
|
|
29
42
|
value: newValue,
|
|
30
43
|
zodValidation: safeParse,
|
|
31
44
|
};
|
|
32
45
|
stateRef.current = newState;
|
|
33
|
-
return
|
|
46
|
+
return {
|
|
47
|
+
...localValue,
|
|
48
|
+
[parentRevision]: newState,
|
|
49
|
+
};
|
|
34
50
|
});
|
|
35
|
-
}, [
|
|
36
|
-
|
|
51
|
+
}, [
|
|
52
|
+
currentLocalValue.keyStabilityRevision,
|
|
53
|
+
localValue,
|
|
54
|
+
parentRevision,
|
|
55
|
+
schema,
|
|
56
|
+
setValue,
|
|
57
|
+
]);
|
|
58
|
+
const contextValue = (0, react_1.useMemo)(() => {
|
|
59
|
+
return {
|
|
60
|
+
childResetRevision: resetRevision,
|
|
61
|
+
};
|
|
62
|
+
}, [resetRevision]);
|
|
63
|
+
const reset = (0, react_1.useCallback)(() => {
|
|
64
|
+
// Only need to do key stability for arrays, but
|
|
65
|
+
// since user is not editing right now, should be fine
|
|
66
|
+
onChange(() => defaultValue, true, true);
|
|
67
|
+
setResetRevision((old) => old + 1);
|
|
68
|
+
}, [defaultValue, onChange]);
|
|
69
|
+
const RevisionContextProvider = (0, react_1.useCallback)(({ children }) => {
|
|
70
|
+
return ((0, jsx_runtime_1.jsx)(RevisionContext.Provider, { value: contextValue, children: children }));
|
|
71
|
+
}, [contextValue]);
|
|
72
|
+
return {
|
|
73
|
+
localValue: currentLocalValue,
|
|
74
|
+
onChange,
|
|
75
|
+
reset,
|
|
76
|
+
RevisionContextProvider,
|
|
77
|
+
};
|
|
37
78
|
};
|
|
38
79
|
exports.useLocalState = useLocalState;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type JSONPath = (string | number)[];
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
export declare const optionRow: React.CSSProperties;
|
|
3
|
-
export declare const narrowOption: React.CSSProperties;
|
|
4
3
|
export declare const label: React.CSSProperties;
|
|
5
4
|
export declare const rightRow: React.CSSProperties;
|
|
6
5
|
export declare const input: React.CSSProperties;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fieldsetLabel = exports.input = exports.rightRow = exports.label = exports.
|
|
3
|
+
exports.fieldsetLabel = exports.input = exports.rightRow = exports.label = exports.optionRow = void 0;
|
|
4
4
|
const colors_1 = require("../../helpers/colors");
|
|
5
5
|
exports.optionRow = {
|
|
6
6
|
display: 'flex',
|
|
@@ -11,10 +11,6 @@ exports.optionRow = {
|
|
|
11
11
|
paddingTop: 8,
|
|
12
12
|
paddingBottom: 8,
|
|
13
13
|
};
|
|
14
|
-
exports.narrowOption = {
|
|
15
|
-
display: 'flex',
|
|
16
|
-
flexDirection: 'column',
|
|
17
|
-
};
|
|
18
14
|
exports.label = {
|
|
19
15
|
width: 170,
|
|
20
16
|
fontSize: 15,
|
|
@@ -38,8 +34,6 @@ exports.input = {
|
|
|
38
34
|
exports.fieldsetLabel = {
|
|
39
35
|
color: colors_1.LIGHT_TEXT,
|
|
40
36
|
fontSize: 14,
|
|
41
|
-
paddingLeft: 5,
|
|
42
|
-
paddingRight: 5,
|
|
43
37
|
display: 'flex',
|
|
44
38
|
flexDirection: 'row',
|
|
45
39
|
fontFamily: 'monospace',
|
|
@@ -6,7 +6,7 @@ export declare const addStillRenderJob: ({ compositionId, outName, imageFormat,
|
|
|
6
6
|
compositionId: string;
|
|
7
7
|
outName: string;
|
|
8
8
|
imageFormat: StillImageFormat;
|
|
9
|
-
jpegQuality: number
|
|
9
|
+
jpegQuality: number;
|
|
10
10
|
frame: number;
|
|
11
11
|
scale: number;
|
|
12
12
|
verbose: boolean;
|
|
@@ -55,5 +55,6 @@ export declare const openInFileExplorer: ({ directory }: {
|
|
|
55
55
|
}) => Promise<void>;
|
|
56
56
|
export declare const removeRenderJob: (job: RenderJob) => Promise<undefined>;
|
|
57
57
|
export declare const cancelRenderJob: (job: RenderJob) => Promise<import("../../../preview-server/render-queue/job").CancelRenderResponse>;
|
|
58
|
+
export declare const updateAvailable: (signal: AbortSignal) => Promise<import("../../../preview-server/render-queue/job").UpdateAvailableResponse>;
|
|
58
59
|
export declare const updateDefaultProps: (compositionId: string, defaultProps: unknown, enumPaths: EnumPath[]) => Promise<import("../../../preview-server/render-queue/job").UpdateDefaultPropsResponse>;
|
|
59
60
|
export declare const canUpdateDefaultProps: (compositionId: string) => Promise<import("../../../preview-server/render-queue/job").CanUpdateDefaultPropsResponse>;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.canUpdateDefaultProps = exports.updateDefaultProps = exports.cancelRenderJob = exports.removeRenderJob = exports.openInFileExplorer = exports.subscribeToFileExistenceWatcher = exports.unsubscribeFromFileExistenceWatcher = exports.addVideoRenderJob = exports.addStillRenderJob = void 0;
|
|
3
|
+
exports.canUpdateDefaultProps = exports.updateDefaultProps = exports.updateAvailable = exports.cancelRenderJob = exports.removeRenderJob = exports.openInFileExplorer = exports.subscribeToFileExistenceWatcher = exports.unsubscribeFromFileExistenceWatcher = exports.addVideoRenderJob = exports.addStillRenderJob = void 0;
|
|
4
4
|
const input_props_serialization_1 = require("../RenderModal/SchemaEditor/input-props-serialization");
|
|
5
|
-
const callApi = (endpoint, body) => {
|
|
5
|
+
const callApi = (endpoint, body, signal) => {
|
|
6
6
|
return new Promise((resolve, reject) => {
|
|
7
7
|
fetch(endpoint, {
|
|
8
8
|
method: 'post',
|
|
9
9
|
headers: {
|
|
10
10
|
'content-type': 'application/json',
|
|
11
11
|
},
|
|
12
|
+
signal,
|
|
12
13
|
body: JSON.stringify(body),
|
|
13
14
|
})
|
|
14
15
|
.then((res) => res.json())
|
|
@@ -104,6 +105,10 @@ const cancelRenderJob = (job) => {
|
|
|
104
105
|
});
|
|
105
106
|
};
|
|
106
107
|
exports.cancelRenderJob = cancelRenderJob;
|
|
108
|
+
const updateAvailable = (signal) => {
|
|
109
|
+
return callApi('/api/update-available', {}, signal);
|
|
110
|
+
};
|
|
111
|
+
exports.updateAvailable = updateAvailable;
|
|
107
112
|
const updateDefaultProps = (compositionId, defaultProps, enumPaths) => {
|
|
108
113
|
return callApi('/api/update-default-props', {
|
|
109
114
|
compositionId,
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RichTimelineToggle = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const is_current_selected_still_1 = require("../helpers/is-current-selected-still");
|
|
7
|
+
const timeline_1 = require("../icons/timeline");
|
|
8
|
+
const rich_timeline_1 = require("../state/rich-timeline");
|
|
9
|
+
const ControlButton_1 = require("./ControlButton");
|
|
10
|
+
const tooltip = 'Enable rich timeline. Go to remotion.dev/docs/timeline for more information.';
|
|
11
|
+
const RichTimelineToggle = () => {
|
|
12
|
+
const { richTimeline, setRichTimeline } = (0, react_1.useContext)(rich_timeline_1.RichTimelineContext);
|
|
13
|
+
const isStill = (0, is_current_selected_still_1.useIsStill)();
|
|
14
|
+
const onClick = (0, react_1.useCallback)(() => {
|
|
15
|
+
setRichTimeline((c) => {
|
|
16
|
+
(0, rich_timeline_1.persistRichTimelineOption)(!c);
|
|
17
|
+
return !c;
|
|
18
|
+
});
|
|
19
|
+
}, [setRichTimeline]);
|
|
20
|
+
if (isStill) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
return ((0, jsx_runtime_1.jsx)(ControlButton_1.ControlButton, { title: tooltip, "aria-label": tooltip, onClick: onClick, children: (0, jsx_runtime_1.jsx)(timeline_1.TimelineIcon, { style: {
|
|
24
|
+
width: 16,
|
|
25
|
+
height: 16,
|
|
26
|
+
color: richTimeline ? 'var(--blue)' : 'white',
|
|
27
|
+
} }) }));
|
|
28
|
+
};
|
|
29
|
+
exports.RichTimelineToggle = RichTimelineToggle;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
type SidebarPanel = 'input-props' | 'renders';
|
|
3
3
|
export declare const persistSelectedPanel: (panel: SidebarPanel) => void;
|
|
4
4
|
export declare const rightSidebarTabs: React.RefObject<{
|
|
5
5
|
selectRendersPanel: () => void;
|
|
@@ -26,7 +26,7 @@ const PropsEditor = ({ composition }) => {
|
|
|
26
26
|
});
|
|
27
27
|
}, [composition.defaultProps, composition.id, updateProps]);
|
|
28
28
|
const actualProps = (0, react_1.useMemo)(() => { var _a, _b; return (_b = (_a = props[composition.id]) !== null && _a !== void 0 ? _a : composition.defaultProps) !== null && _b !== void 0 ? _b : {}; }, [composition.defaultProps, composition.id, props]);
|
|
29
|
-
return ((0, jsx_runtime_1.jsx)(DataEditor_1.DataEditor, { unresolvedComposition: composition, inputProps: actualProps, setInputProps: setInputProps,
|
|
29
|
+
return ((0, jsx_runtime_1.jsx)(DataEditor_1.DataEditor, { unresolvedComposition: composition, inputProps: actualProps, setInputProps: setInputProps, mayShowSaveButton: true, propsEditType: "default-props" }, composition.id));
|
|
30
30
|
};
|
|
31
31
|
const localStorageKey = 'remotion.sidebarPanel';
|
|
32
32
|
const getSelectedPanel = () => {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export
|
|
2
|
+
export type SplitterDragState = false | {
|
|
3
3
|
x: number;
|
|
4
4
|
y: number;
|
|
5
5
|
};
|
|
6
|
-
export
|
|
7
|
-
export
|
|
6
|
+
export type SplitterOrientation = 'horizontal' | 'vertical';
|
|
7
|
+
export type TSplitterContext = {
|
|
8
8
|
flexValue: number;
|
|
9
9
|
setFlexValue: React.Dispatch<React.SetStateAction<number>>;
|
|
10
10
|
domRect: DOMRect | DOMRectReadOnly | null;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Thumbnail = 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 checkerboard_background_1 = require("../helpers/checkerboard-background");
|
|
8
|
+
const checkerboard_1 = require("../state/checkerboard");
|
|
9
|
+
const Thumbnail = ({ composition, targetHeight, targetWidth, frameToDisplay }) => {
|
|
10
|
+
const { height, width } = composition;
|
|
11
|
+
const heightRatio = targetHeight / height;
|
|
12
|
+
const widthRatio = targetWidth / width;
|
|
13
|
+
const ratio = Math.min(heightRatio, widthRatio);
|
|
14
|
+
const scale = ratio;
|
|
15
|
+
const actualWidth = width * scale;
|
|
16
|
+
const actualHeight = height * scale;
|
|
17
|
+
const correction = 0 - (1 - scale) / 2;
|
|
18
|
+
const xCorrection = correction * width;
|
|
19
|
+
const yCorrection = correction * height;
|
|
20
|
+
const [thumbnailId] = (0, react_1.useState)(() => String((0, remotion_1.random)(null)));
|
|
21
|
+
const { checkerboard } = (0, react_1.useContext)(checkerboard_1.CheckerboardContext);
|
|
22
|
+
const container = (0, react_1.useMemo)(() => {
|
|
23
|
+
return {
|
|
24
|
+
width: targetWidth,
|
|
25
|
+
height: targetHeight,
|
|
26
|
+
backgroundColor: 'rgba(0, 0, 0, 0.4)',
|
|
27
|
+
display: 'flex',
|
|
28
|
+
justifyContent: 'center',
|
|
29
|
+
alignItems: 'center',
|
|
30
|
+
};
|
|
31
|
+
}, [targetHeight, targetWidth]);
|
|
32
|
+
const outer = (0, react_1.useMemo)(() => {
|
|
33
|
+
return {
|
|
34
|
+
width: actualWidth,
|
|
35
|
+
height: actualHeight,
|
|
36
|
+
backgroundColor: (0, checkerboard_background_1.checkerboardBackgroundColor)(checkerboard),
|
|
37
|
+
backgroundImage: (0, checkerboard_background_1.checkerboardBackgroundImage)(checkerboard),
|
|
38
|
+
backgroundPosition: (0, checkerboard_background_1.getCheckerboardBackgroundPos)(25),
|
|
39
|
+
backgroundSize: (0, checkerboard_background_1.getCheckerboardBackgroundPos)(25),
|
|
40
|
+
};
|
|
41
|
+
}, [actualHeight, actualWidth, checkerboard]);
|
|
42
|
+
const inner = (0, react_1.useMemo)(() => {
|
|
43
|
+
return {
|
|
44
|
+
width,
|
|
45
|
+
height,
|
|
46
|
+
transform: `scale(${scale}) `,
|
|
47
|
+
overflow: 'hidden',
|
|
48
|
+
marginLeft: xCorrection,
|
|
49
|
+
marginTop: yCorrection,
|
|
50
|
+
display: 'flex',
|
|
51
|
+
color: 'black',
|
|
52
|
+
};
|
|
53
|
+
}, [height, scale, width, xCorrection, yCorrection]);
|
|
54
|
+
const timelineState = (0, react_1.useMemo)(() => {
|
|
55
|
+
return {
|
|
56
|
+
playing: false,
|
|
57
|
+
frame: frameToDisplay,
|
|
58
|
+
rootId: thumbnailId,
|
|
59
|
+
imperativePlaying: {
|
|
60
|
+
current: false,
|
|
61
|
+
},
|
|
62
|
+
playbackRate: 1,
|
|
63
|
+
setPlaybackRate: () => {
|
|
64
|
+
throw new Error('thumbnail');
|
|
65
|
+
},
|
|
66
|
+
audioAndVideoTags: { current: [] },
|
|
67
|
+
};
|
|
68
|
+
}, [frameToDisplay, thumbnailId]);
|
|
69
|
+
const props = (0, react_1.useMemo)(() => {
|
|
70
|
+
var _a;
|
|
71
|
+
return (_a = composition.defaultProps) !== null && _a !== void 0 ? _a : {};
|
|
72
|
+
}, [composition.defaultProps]);
|
|
73
|
+
const ThumbnailComponent = composition.component;
|
|
74
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: container, children: (0, jsx_runtime_1.jsx)(react_1.Suspense, { fallback: null, children: (0, jsx_runtime_1.jsx)("div", { style: outer, children: (0, jsx_runtime_1.jsx)("div", { style: inner, children: (0, jsx_runtime_1.jsx)(remotion_1.Internals.Timeline.TimelineContext.Provider, { value: timelineState, children: (0, jsx_runtime_1.jsx)(ThumbnailComponent, { ...props }) }) }) }) }) }));
|
|
75
|
+
};
|
|
76
|
+
exports.Thumbnail = Thumbnail;
|
|
@@ -10,21 +10,21 @@ const width = {
|
|
|
10
10
|
position: 'relative',
|
|
11
11
|
};
|
|
12
12
|
const icon = {
|
|
13
|
-
height:
|
|
14
|
-
width:
|
|
13
|
+
height: 14,
|
|
14
|
+
width: 14,
|
|
15
15
|
};
|
|
16
16
|
const Icon = () => ((0, jsx_runtime_1.jsx)("svg", { "aria-hidden": "true", focusable: "false", "data-prefix": "fas", "data-icon": "repeat", className: "svg-inline--fa fa-repeat fa-w-16", role: "img", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", style: icon, children: (0, jsx_runtime_1.jsx)("path", { fill: "currentColor", d: "M512 256c0 88.224-71.775 160-160 160H170.067l34.512 32.419c9.875 9.276 10.119 24.883.539 34.464l-10.775 10.775c-9.373 9.372-24.568 9.372-33.941 0l-92.686-92.686c-9.373-9.373-9.373-24.568 0-33.941l92.686-92.686c9.373-9.373 24.568-9.373 33.941 0l10.775 10.775c9.581 9.581 9.337 25.187-.539 34.464L170.067 352H352c52.935 0 96-43.065 96-96 0-13.958-2.996-27.228-8.376-39.204-4.061-9.039-2.284-19.626 4.723-26.633l12.183-12.183c11.499-11.499 30.965-8.526 38.312 5.982C505.814 205.624 512 230.103 512 256zM72.376 295.204C66.996 283.228 64 269.958 64 256c0-52.935 43.065-96 96-96h181.933l-34.512 32.419c-9.875 9.276-10.119 24.883-.539 34.464l10.775 10.775c9.373 9.372 24.568 9.372 33.941 0l92.686-92.686c9.373-9.373 9.373-24.568 0-33.941l-92.686-92.686c-9.373-9.373-24.568-9.373-33.941 0L306.882 29.12c-9.581 9.581-9.337 25.187.539 34.464L341.933 96H160C71.775 96 0 167.776 0 256c0 25.897 6.186 50.376 17.157 72.039 7.347 14.508 26.813 17.481 38.312 5.982l12.183-12.183c7.008-7.008 8.786-17.595 4.724-26.634z" }) }));
|
|
17
17
|
const topLine = {
|
|
18
18
|
top: 0,
|
|
19
|
-
height:
|
|
19
|
+
height: 5,
|
|
20
20
|
width: 1,
|
|
21
|
-
background: '
|
|
21
|
+
background: 'white',
|
|
22
22
|
};
|
|
23
23
|
const bottomLine = {
|
|
24
24
|
top: 0,
|
|
25
|
-
height:
|
|
25
|
+
height: 5,
|
|
26
26
|
width: 1,
|
|
27
|
-
background: '
|
|
27
|
+
background: 'white',
|
|
28
28
|
};
|
|
29
29
|
const topContainer = {
|
|
30
30
|
justifyContent: 'flex-start',
|