@remotion/studio 4.0.478 → 4.0.479

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (171) hide show
  1. package/dist/components/AssetSelector.js +8 -14
  2. package/dist/components/Button.d.ts +1 -0
  3. package/dist/components/Button.js +8 -5
  4. package/dist/components/CompactExplanation.d.ts +12 -0
  5. package/dist/components/CompactExplanation.js +52 -0
  6. package/dist/components/CompositionSelector.js +2 -4
  7. package/dist/components/CurrentAsset.d.ts +3 -1
  8. package/dist/components/CurrentAsset.js +42 -34
  9. package/dist/components/CurrentComposition.d.ts +1 -1
  10. package/dist/components/CurrentComposition.js +38 -31
  11. package/dist/components/DefaultPropsEditor.d.ts +12 -2
  12. package/dist/components/DefaultPropsEditor.js +2 -2
  13. package/dist/components/EffectPickerModal.d.ts +5 -0
  14. package/dist/components/EffectPickerModal.js +179 -0
  15. package/dist/components/InspectorInfoHeader.d.ts +11 -0
  16. package/dist/components/InspectorInfoHeader.js +55 -0
  17. package/dist/components/InspectorPanel/DefaultInspector.d.ts +8 -0
  18. package/dist/components/InspectorPanel/DefaultInspector.js +93 -0
  19. package/dist/components/InspectorPanel/EasingInspector.d.ts +5 -0
  20. package/dist/components/InspectorPanel/EasingInspector.js +41 -0
  21. package/dist/components/InspectorPanel/GuideInspector.d.ts +7 -0
  22. package/dist/components/InspectorPanel/GuideInspector.js +55 -0
  23. package/dist/components/InspectorPanel/KeyframeInspector.d.ts +7 -0
  24. package/dist/components/InspectorPanel/KeyframeInspector.js +109 -0
  25. package/dist/components/InspectorPanel/SelectedInspector.d.ts +5 -0
  26. package/dist/components/InspectorPanel/SelectedInspector.js +26 -0
  27. package/dist/components/InspectorPanel/SequenceSelectionInspector.d.ts +5 -0
  28. package/dist/components/InspectorPanel/SequenceSelectionInspector.js +116 -0
  29. package/dist/components/InspectorPanel/common.d.ts +15 -0
  30. package/dist/components/InspectorPanel/common.js +18 -0
  31. package/dist/components/InspectorPanel/inspector-selection.d.ts +10 -0
  32. package/dist/components/InspectorPanel/inspector-selection.js +34 -0
  33. package/dist/components/InspectorPanel/styles.d.ts +27 -0
  34. package/dist/components/InspectorPanel/styles.js +178 -0
  35. package/dist/components/InspectorPanel/use-track-for-selection.d.ts +2 -0
  36. package/dist/components/InspectorPanel/use-track-for-selection.js +22 -0
  37. package/dist/components/InspectorPanel.d.ts +8 -0
  38. package/dist/components/InspectorPanel.js +26 -0
  39. package/dist/components/InspectorPanelLayout.d.ts +1 -0
  40. package/dist/components/InspectorPanelLayout.js +4 -0
  41. package/dist/components/InspectorSequenceSection.d.ts +16 -0
  42. package/dist/components/InspectorSequenceSection.js +147 -0
  43. package/dist/components/InspectorSourceLocation.d.ts +7 -0
  44. package/dist/components/InspectorSourceLocation.js +71 -0
  45. package/dist/components/Modals.js +3 -3
  46. package/dist/components/NewComposition/InputDragger.js +1 -1
  47. package/dist/components/NewComposition/RemInput.d.ts +1 -0
  48. package/dist/components/NewComposition/RemInput.js +8 -2
  49. package/dist/components/NewComposition/RemTextarea.d.ts +1 -0
  50. package/dist/components/NewComposition/RemTextarea.js +8 -2
  51. package/dist/components/NewComposition/ValidationMessage.d.ts +3 -0
  52. package/dist/components/NewComposition/ValidationMessage.js +16 -5
  53. package/dist/components/OptionsPanel.d.ts +1 -1
  54. package/dist/components/OptionsPanel.js +8 -17
  55. package/dist/components/QuickSwitcher/QuickSwitcherContent.js +2 -7
  56. package/dist/components/QuickSwitcher/QuickSwitcherResult.js +3 -10
  57. package/dist/components/QuickSwitcher/shared.d.ts +4 -0
  58. package/dist/components/QuickSwitcher/shared.js +24 -0
  59. package/dist/components/RenderModal/DataEditor.d.ts +29 -2
  60. package/dist/components/RenderModal/DataEditor.js +107 -56
  61. package/dist/components/RenderModal/RenderModalJSONPropsEditor.d.ts +1 -0
  62. package/dist/components/RenderModal/RenderModalJSONPropsEditor.js +25 -7
  63. package/dist/components/RenderModal/SchemaEditor/Fieldset.d.ts +2 -1
  64. package/dist/components/RenderModal/SchemaEditor/Fieldset.js +10 -5
  65. package/dist/components/RenderModal/SchemaEditor/SchemaEditor.d.ts +4 -0
  66. package/dist/components/RenderModal/SchemaEditor/SchemaEditor.js +27 -4
  67. package/dist/components/RenderModal/SchemaEditor/SchemaErrorMessages.d.ts +12 -4
  68. package/dist/components/RenderModal/SchemaEditor/SchemaErrorMessages.js +23 -9
  69. package/dist/components/RenderModal/SchemaEditor/SchemaLabel.js +3 -3
  70. package/dist/components/RenderModal/SchemaEditor/SchemaSeparationLine.js +8 -1
  71. package/dist/components/RenderModal/SchemaEditor/ZodColorEditor.js +1 -1
  72. package/dist/components/RenderModal/SchemaEditor/ZodDateEditor.js +1 -1
  73. package/dist/components/RenderModal/SchemaEditor/ZodDiscriminatedUnionEditor.js +1 -1
  74. package/dist/components/RenderModal/SchemaEditor/ZodEnumEditor.js +1 -1
  75. package/dist/components/RenderModal/SchemaEditor/ZodErrorMessages.d.ts +1 -0
  76. package/dist/components/RenderModal/SchemaEditor/ZodErrorMessages.js +23 -6
  77. package/dist/components/RenderModal/SchemaEditor/ZodFieldValidation.js +2 -2
  78. package/dist/components/RenderModal/SchemaEditor/ZodNonEditableValue.js +2 -1
  79. package/dist/components/RenderModal/SchemaEditor/ZodNumberEditor.js +1 -1
  80. package/dist/components/RenderModal/SchemaEditor/ZodObjectEditor.js +9 -11
  81. package/dist/components/RenderModal/SchemaEditor/ZodOrNullishEditor.js +1 -1
  82. package/dist/components/RenderModal/SchemaEditor/ZodStaticFileEditor.js +1 -1
  83. package/dist/components/RenderModal/SchemaEditor/ZodStringEditor.js +1 -1
  84. package/dist/components/RenderModal/SchemaEditor/ZodTextareaEditor.js +1 -1
  85. package/dist/components/RenderModal/WarningIndicatorButton.d.ts +1 -0
  86. package/dist/components/RenderModal/WarningIndicatorButton.js +17 -4
  87. package/dist/components/RenderModal/get-render-modal-warnings.d.ts +2 -1
  88. package/dist/components/RenderModal/get-render-modal-warnings.js +6 -3
  89. package/dist/components/RendersTab.js +1 -1
  90. package/dist/components/SegmentedControl.d.ts +3 -0
  91. package/dist/components/SegmentedControl.js +11 -5
  92. package/dist/components/SelectedOutlineElement.js +57 -24
  93. package/dist/components/SelectedOutlineOverlay.d.ts +1 -1
  94. package/dist/components/SelectedOutlineOverlay.js +41 -29
  95. package/dist/components/SelectedOutlineUvControls.d.ts +9 -0
  96. package/dist/components/SelectedOutlineUvControls.js +64 -10
  97. package/dist/components/Tabs/index.js +4 -4
  98. package/dist/components/Timeline/EasingEditorModal.d.ts +5 -4
  99. package/dist/components/Timeline/EasingEditorModal.js +597 -124
  100. package/dist/components/Timeline/KeyframeSettingsModal.d.ts +2 -2
  101. package/dist/components/Timeline/SubscribeToNodePaths.d.ts +2 -2
  102. package/dist/components/Timeline/TimelineClipboardKeybindings.d.ts +15 -3
  103. package/dist/components/Timeline/TimelineClipboardKeybindings.js +85 -1
  104. package/dist/components/Timeline/TimelineDeleteKeybindings.js +10 -3
  105. package/dist/components/Timeline/TimelineEffectItem.d.ts +2 -2
  106. package/dist/components/Timeline/TimelineEffectPropItem.d.ts +8 -0
  107. package/dist/components/Timeline/TimelineEffectPropItem.js +24 -20
  108. package/dist/components/Timeline/TimelineExpandedRow.d.ts +5 -2
  109. package/dist/components/Timeline/TimelineExpandedRow.js +4 -4
  110. package/dist/components/Timeline/TimelineExpandedSection.d.ts +1 -1
  111. package/dist/components/Timeline/TimelineExpandedSection.js +5 -19
  112. package/dist/components/Timeline/TimelineKeyframeControls.d.ts +8 -2
  113. package/dist/components/Timeline/TimelineKeyframeControls.js +24 -3
  114. package/dist/components/Timeline/TimelineKeyframeEasingLine.js +2 -47
  115. package/dist/components/Timeline/TimelineKeyframedValue.d.ts +1 -1
  116. package/dist/components/Timeline/TimelineKeyframedValue.js +8 -10
  117. package/dist/components/Timeline/TimelineNumberField.js +5 -11
  118. package/dist/components/Timeline/TimelineRotationField.js +5 -6
  119. package/dist/components/Timeline/TimelineScaleField.js +4 -8
  120. package/dist/components/Timeline/TimelineSelection.d.ts +6 -0
  121. package/dist/components/Timeline/TimelineSelection.js +109 -14
  122. package/dist/components/Timeline/TimelineSequence.js +19 -3
  123. package/dist/components/Timeline/TimelineSequenceItem.js +12 -67
  124. package/dist/components/Timeline/TimelineSequencePropItem.d.ts +12 -2
  125. package/dist/components/Timeline/TimelineSequencePropItem.js +56 -52
  126. package/dist/components/Timeline/TimelineTransformOriginField.js +4 -5
  127. package/dist/components/Timeline/TimelineTranslateField.js +4 -5
  128. package/dist/components/Timeline/TimelineUvCoordinateField.js +4 -4
  129. package/dist/components/Timeline/call-add-keyframe.d.ts +4 -4
  130. package/dist/components/Timeline/call-delete-keyframe.d.ts +4 -4
  131. package/dist/components/Timeline/call-move-keyframe.d.ts +2 -2
  132. package/dist/components/Timeline/call-update-keyframe-settings.d.ts +3 -3
  133. package/dist/components/Timeline/delete-selected-timeline-item.d.ts +2 -1
  134. package/dist/components/Timeline/delete-selected-timeline-item.js +27 -1
  135. package/dist/components/Timeline/parse-keyframe-field-from-node-path.js +2 -2
  136. package/dist/components/Timeline/reset-selected-timeline-props.d.ts +3 -3
  137. package/dist/components/Timeline/reset-selected-timeline-props.js +19 -5
  138. package/dist/components/Timeline/save-effect-prop.d.ts +2 -2
  139. package/dist/components/Timeline/save-sequence-prop.d.ts +2 -2
  140. package/dist/components/Timeline/sequence-props-subscription-store.d.ts +3 -3
  141. package/dist/components/Timeline/timeline-field-display-utils.d.ts +5 -0
  142. package/dist/components/Timeline/timeline-field-display-utils.js +244 -0
  143. package/dist/components/Timeline/update-selected-easing.d.ts +47 -4
  144. package/dist/components/Timeline/update-selected-easing.js +40 -9
  145. package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.d.ts +13 -0
  146. package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.js +73 -0
  147. package/dist/components/Timeline/use-sequence-props-subscription.d.ts +3 -3
  148. package/dist/components/Timeline/use-timeline-expanded-tree.d.ts +11 -0
  149. package/dist/components/Timeline/use-timeline-expanded-tree.js +33 -0
  150. package/dist/components/VisualControls/VisualControlsContent.d.ts +1 -1
  151. package/dist/components/VisualControls/VisualControlsContent.js +4 -5
  152. package/dist/components/effect-drag-and-drop.d.ts +10 -0
  153. package/dist/components/effect-drag-and-drop.js +17 -8
  154. package/dist/components/effect-picker-search.d.ts +5 -0
  155. package/dist/components/effect-picker-search.js +77 -0
  156. package/dist/components/selected-outline-drag.d.ts +21 -2
  157. package/dist/components/selected-outline-drag.js +31 -6
  158. package/dist/components/selected-outline-types.d.ts +7 -7
  159. package/dist/components/selected-outline-uv.d.ts +4 -3
  160. package/dist/components/selected-outline-uv.js +6 -2
  161. package/dist/esm/{chunk-hrw9799x.js → chunk-fge2mq5p.js} +16535 -13311
  162. package/dist/esm/internals.mjs +16535 -13311
  163. package/dist/esm/previewEntry.mjs +17141 -13917
  164. package/dist/esm/renderEntry.mjs +1 -1
  165. package/dist/helpers/render-codec-label.d.ts +2 -0
  166. package/dist/helpers/render-codec-label.js +49 -0
  167. package/dist/helpers/timeline-layout.d.ts +4 -4
  168. package/dist/helpers/use-media-metadata.d.ts +8 -2
  169. package/dist/helpers/use-media-metadata.js +17 -4
  170. package/dist/state/modals.d.ts +9 -4
  171. package/package.json +12 -12
@@ -1,18 +1,23 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Fieldset = exports.SCHEMA_EDITOR_FIELDSET_PADDING = void 0;
3
+ exports.Fieldset = exports.getSchemaEditorFieldsetPadding = 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
- exports.SCHEMA_EDITOR_FIELDSET_PADDING = 10;
6
+ exports.SCHEMA_EDITOR_FIELDSET_PADDING = 6;
7
+ const getSchemaEditorFieldsetPadding = () => {
8
+ return exports.SCHEMA_EDITOR_FIELDSET_PADDING;
9
+ };
10
+ exports.getSchemaEditorFieldsetPadding = getSchemaEditorFieldsetPadding;
7
11
  const AlreadyPaddedRightContext = (0, react_1.createContext)(false);
8
12
  const Fieldset = ({ children, shouldPad }) => {
9
13
  const alreadyPadded = (0, react_1.useContext)(AlreadyPaddedRightContext);
10
14
  const style = (0, react_1.useMemo)(() => {
11
15
  if (shouldPad) {
16
+ const padding = (0, exports.getSchemaEditorFieldsetPadding)();
12
17
  return {
13
- padding: exports.SCHEMA_EDITOR_FIELDSET_PADDING,
14
- paddingTop: exports.SCHEMA_EDITOR_FIELDSET_PADDING / 2,
15
- paddingRight: alreadyPadded ? 0 : exports.SCHEMA_EDITOR_FIELDSET_PADDING,
18
+ padding,
19
+ paddingTop: padding / 2,
20
+ paddingRight: alreadyPadded ? 0 : padding,
16
21
  };
17
22
  }
18
23
  return {};
@@ -1,8 +1,12 @@
1
1
  import React from 'react';
2
+ import { type SchemaErrorMode } from './SchemaErrorMessages';
2
3
  import type { AnyZodSchema } from './zod-schema-type';
3
4
  import type { UpdaterFunction } from './ZodSwitch';
4
5
  export declare const SchemaEditor: React.FC<{
5
6
  readonly schema: AnyZodSchema;
6
7
  readonly value: Record<string, unknown>;
7
8
  readonly setValue: UpdaterFunction<Record<string, unknown>>;
9
+ readonly scrollableContainer?: boolean;
10
+ readonly contentInset?: number;
11
+ readonly errorMode?: SchemaErrorMode;
8
12
  }>;
@@ -4,6 +4,7 @@ exports.SchemaEditor = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const get_zod_if_possible_1 = require("../../get-zod-if-possible");
6
6
  const is_menu_item_1 = require("../../Menu/is-menu-item");
7
+ const Fieldset_1 = require("./Fieldset");
7
8
  const SchemaErrorMessages_1 = require("./SchemaErrorMessages");
8
9
  const scroll_to_default_props_path_1 = require("./scroll-to-default-props-path");
9
10
  const zod_schema_type_1 = require("./zod-schema-type");
@@ -14,18 +15,40 @@ const scrollable = {
14
15
  flexDirection: 'column',
15
16
  overflowY: 'auto',
16
17
  };
17
- const SchemaEditor = ({ schema, value, setValue }) => {
18
+ const notScrollable = {
19
+ display: 'flex',
20
+ flexDirection: 'column',
21
+ };
22
+ const getContainerStyle = ({ contentInset, scrollableContainer, }) => {
23
+ const base = scrollableContainer ? scrollable : notScrollable;
24
+ if (contentInset === undefined) {
25
+ return base;
26
+ }
27
+ const fieldsetPadding = (0, Fieldset_1.getSchemaEditorFieldsetPadding)();
28
+ const rootInset = Math.max(0, contentInset - fieldsetPadding);
29
+ return {
30
+ ...base,
31
+ boxSizing: 'border-box',
32
+ paddingLeft: rootInset,
33
+ paddingRight: rootInset,
34
+ };
35
+ };
36
+ const SchemaEditor = ({ schema, value, setValue, scrollableContainer = true, contentInset, errorMode = 'full', }) => {
18
37
  const z = (0, get_zod_if_possible_1.useZodIfPossible)();
19
38
  if (!z) {
20
39
  throw new Error('expected zod');
21
40
  }
22
41
  const typeName = (0, zod_schema_type_1.getZodSchemaType)(schema);
23
42
  if (typeName !== 'object' && typeName !== 'discriminatedUnion') {
24
- return jsx_runtime_1.jsx(SchemaErrorMessages_1.TopLevelZodValue, { typeReceived: typeName });
43
+ return jsx_runtime_1.jsx(SchemaErrorMessages_1.TopLevelZodValue, { typeReceived: typeName, mode: errorMode });
25
44
  }
45
+ const containerStyle = getContainerStyle({
46
+ contentInset,
47
+ scrollableContainer,
48
+ });
26
49
  if (typeName === 'discriminatedUnion') {
27
- return (jsx_runtime_1.jsx("div", { ref: scroll_to_default_props_path_1.defaultPropsEditorScrollableAreaRef, style: scrollable, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: jsx_runtime_1.jsx(ZodDiscriminatedUnionEditor_1.ZodDiscriminatedUnionEditor, { schema: schema, setValue: setValue, value: value, mayPad: true, jsonPath: [], onRemove: null }) }));
50
+ return (jsx_runtime_1.jsx("div", { ref: scroll_to_default_props_path_1.defaultPropsEditorScrollableAreaRef, style: containerStyle, className: scrollableContainer ? is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME : undefined, children: jsx_runtime_1.jsx(ZodDiscriminatedUnionEditor_1.ZodDiscriminatedUnionEditor, { schema: schema, setValue: setValue, value: value, mayPad: true, jsonPath: [], onRemove: null }) }));
28
51
  }
29
- return (jsx_runtime_1.jsx("div", { ref: scroll_to_default_props_path_1.defaultPropsEditorScrollableAreaRef, style: scrollable, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: jsx_runtime_1.jsx(ZodObjectEditor_1.ZodObjectEditor, { discriminatedUnionReplacement: null, value: value, setValue: setValue, jsonPath: [], schema: schema, onRemove: null, mayPad: true }) }));
52
+ return (jsx_runtime_1.jsx("div", { ref: scroll_to_default_props_path_1.defaultPropsEditorScrollableAreaRef, style: containerStyle, className: scrollableContainer ? is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME : undefined, children: jsx_runtime_1.jsx(ZodObjectEditor_1.ZodObjectEditor, { discriminatedUnionReplacement: null, value: value, setValue: setValue, jsonPath: [], schema: schema, onRemove: null, mayPad: true }) }));
30
53
  };
31
54
  exports.SchemaEditor = SchemaEditor;
@@ -1,7 +1,14 @@
1
1
  import type { ZodSafeParseResult } from './zod-schema-type';
2
- export declare const ZodNotInstalled: () => import("react/jsx-runtime").JSX.Element;
3
- export declare const NoSchemaDefined: () => import("react/jsx-runtime").JSX.Element;
4
- export declare const NoDefaultProps: () => import("react/jsx-runtime").JSX.Element;
2
+ export type SchemaErrorMode = 'full' | 'compact';
3
+ export declare const ZodNotInstalled: React.FC<{
4
+ readonly mode?: SchemaErrorMode;
5
+ }>;
6
+ export declare const NoSchemaDefined: React.FC<{
7
+ readonly mode?: SchemaErrorMode;
8
+ }>;
9
+ export declare const NoDefaultProps: React.FC<{
10
+ readonly mode?: SchemaErrorMode;
11
+ }>;
5
12
  export declare const InvalidDefaultProps: React.FC<{
6
13
  zodValidationResult: ZodSafeParseResult;
7
14
  }>;
@@ -9,5 +16,6 @@ export declare const InvalidSchema: React.FC<{
9
16
  zodValidationResult: ZodSafeParseResult;
10
17
  }>;
11
18
  export declare const TopLevelZodValue: React.FC<{
12
- typeReceived: string;
19
+ readonly typeReceived: string;
20
+ readonly mode?: SchemaErrorMode;
13
21
  }>;
@@ -2,9 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TopLevelZodValue = exports.InvalidSchema = exports.InvalidDefaultProps = exports.NoDefaultProps = exports.NoSchemaDefined = exports.ZodNotInstalled = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
- // Schema error messages for studio editor
6
5
  const colors_1 = require("../../../helpers/colors");
7
6
  const Button_1 = require("../../Button");
7
+ const CompactExplanation_1 = require("../../CompactExplanation");
8
8
  const layout_1 = require("../../layout");
9
9
  const styles_1 = require("../../Menu/styles");
10
10
  const ZodErrorMessages_1 = require("./ZodErrorMessages");
@@ -12,10 +12,9 @@ const explainer = {
12
12
  display: 'flex',
13
13
  flex: 1,
14
14
  flexDirection: 'column',
15
- padding: '0 12px',
16
- justifyContent: 'center',
17
- alignItems: 'center',
18
- textAlign: 'center',
15
+ padding: 12,
16
+ alignItems: 'flex-start',
17
+ textAlign: 'left',
19
18
  background: colors_1.BACKGROUND,
20
19
  };
21
20
  const errorExplanation = {
@@ -36,7 +35,13 @@ const errorContainer = {
36
35
  const openDocs = () => {
37
36
  window.open('https://www.remotion.dev/docs/schemas');
38
37
  };
39
- const ZodNotInstalled = () => {
38
+ const CompactSchemaError = ({ children }) => {
39
+ return (jsx_runtime_1.jsx(CompactExplanation_1.CompactExplanation, { learnMoreHref: "https://www.remotion.dev/docs/schemas", learnMoreAriaLabel: "Learn more about schemas", children: children }));
40
+ };
41
+ const ZodNotInstalled = ({ mode = 'full' }) => {
42
+ if (mode === 'compact') {
43
+ return jsx_runtime_1.jsx(CompactSchemaError, { children: "Install zod to edit props." });
44
+ }
40
45
  return (jsx_runtime_1.jsxs("div", { style: explainer, children: [
41
46
  jsx_runtime_1.jsxs("div", { style: errorExplanation, children: ["Install ",
42
47
  jsx_runtime_1.jsx("code", { style: styles_1.inlineCodeSnippet, children: "zod" }),
@@ -44,7 +49,10 @@ const ZodNotInstalled = () => {
44
49
  ] }));
45
50
  };
46
51
  exports.ZodNotInstalled = ZodNotInstalled;
47
- const NoSchemaDefined = () => {
52
+ const NoSchemaDefined = ({ mode = 'full' }) => {
53
+ if (mode === 'compact') {
54
+ return (jsx_runtime_1.jsx(CompactSchemaError, { children: "Add a schema prop to edit props." }));
55
+ }
48
56
  return (jsx_runtime_1.jsxs("div", { style: explainer, children: [
49
57
  jsx_runtime_1.jsxs("div", { style: errorExplanation, children: ["Make the props of this composition interactively editable by adding a", ' ', jsx_runtime_1.jsx("code", { style: styles_1.inlineCodeSnippet, children: "schema" }),
50
58
  " prop to the", ' ', jsx_runtime_1.jsx("code", { style: styles_1.inlineCodeSnippet, children: '<Composition>' }),
@@ -52,7 +60,10 @@ const NoSchemaDefined = () => {
52
60
  ] }));
53
61
  };
54
62
  exports.NoSchemaDefined = NoSchemaDefined;
55
- const NoDefaultProps = () => {
63
+ const NoDefaultProps = ({ mode = 'full' }) => {
64
+ if (mode === 'compact') {
65
+ return (jsx_runtime_1.jsx(CompactSchemaError, { children: "Add defaultProps to edit the schema." }));
66
+ }
56
67
  return (jsx_runtime_1.jsxs("div", { style: explainer, children: [
57
68
  jsx_runtime_1.jsxs("div", { style: errorExplanation, children: ["The schema can not be edited because the", ' ', jsx_runtime_1.jsx("code", { style: styles_1.inlineCodeSnippet, children: "defaultProps" }),
58
69
  " prop in the", ' ', jsx_runtime_1.jsx("code", { style: styles_1.inlineCodeSnippet, children: '<Composition>' }),
@@ -76,7 +87,10 @@ const InvalidSchema = ({ zodValidationResult }) => {
76
87
  ] }));
77
88
  };
78
89
  exports.InvalidSchema = InvalidSchema;
79
- const TopLevelZodValue = ({ typeReceived }) => {
90
+ const TopLevelZodValue = ({ typeReceived, mode = 'full' }) => {
91
+ if (mode === 'compact') {
92
+ return (jsx_runtime_1.jsx(CompactSchemaError, { children: "Use z.object() or z.discriminatedUnion() for the top-level schema." }));
93
+ }
80
94
  return (jsx_runtime_1.jsxs("div", { style: explainer, children: [
81
95
  jsx_runtime_1.jsxs("div", { style: errorExplanation, children: ["The top-level type of the schema must be", ' ', jsx_runtime_1.jsx("code", { style: codeSnippet, children: "z.object()" }),
82
96
  " or", ' ', jsx_runtime_1.jsx("code", { style: codeSnippet, children: "z.discriminatedUnion()" }),
@@ -9,7 +9,7 @@ const InlineRemoveButton_1 = require("../InlineRemoveButton");
9
9
  const get_schema_label_1 = require("./get-schema-label");
10
10
  const scroll_to_default_props_path_1 = require("./scroll-to-default-props-path");
11
11
  const compactStyles = {
12
- fontSize: 15,
12
+ fontSize: 12,
13
13
  color: colors_1.LIGHT_TEXT,
14
14
  fontFamily: 'sans-serif',
15
15
  display: 'flex',
@@ -22,13 +22,13 @@ const SchemaLabel = ({ jsonPath, onRemove, valid, suffix, handleClick }) => {
22
22
  const labelStyle = (0, react_1.useMemo)(() => {
23
23
  return {
24
24
  fontFamily: 'monospace',
25
- fontSize: 14,
25
+ fontSize: 12,
26
26
  color: valid
27
27
  ? clickableButtonHovered
28
28
  ? 'white'
29
29
  : colors_1.LIGHT_TEXT
30
30
  : colors_1.FAIL_COLOR,
31
- lineHeight: '24px',
31
+ lineHeight: '20px',
32
32
  };
33
33
  }, [clickableButtonHovered, valid]);
34
34
  const onClickablePointerEnter = (0, react_1.useCallback)(() => {
@@ -57,7 +57,11 @@ const SchemaArrayItemSeparationLine = ({ onChange, index, schema, isLast, showAd
57
57
  }, [isLast, outerHovered]);
58
58
  const inner = (0, react_1.useMemo)(() => {
59
59
  return {
60
+ alignItems: 'center',
60
61
  background: colors_1.BACKGROUND,
62
+ display: 'flex',
63
+ height: exports.VERTICAL_GUIDE_HEIGHT,
64
+ justifyContent: 'center',
61
65
  paddingLeft: 10,
62
66
  paddingRight: 10,
63
67
  };
@@ -85,7 +89,10 @@ const SchemaArrayItemSeparationLine = ({ onChange, index, schema, isLast, showAd
85
89
  display: 'flex',
86
90
  flexDirection: 'column',
87
91
  alignItems: 'flex-end',
88
- }, children: [showAddButton && (jsx_runtime_1.jsx("div", { style: dynamicAddButtonStyle, onPointerEnter: onOuterMouseEnter, onPointerLeave: onOuterMouseLeave, children: jsx_runtime_1.jsx("div", { onClick: onAdd, style: inner, onPointerEnter: onInnerMouseEnter, onPointerLeave: onInnerMouseLeave, children: jsx_runtime_1.jsx(plus_1.Plus, { color: innerHovered ? 'white' : colors_1.LIGHT_TEXT, style: { height: exports.VERTICAL_GUIDE_HEIGHT / 2 } }) }) })), jsx_runtime_1.jsx("div", { style: arraySeparationLine })
92
+ }, children: [showAddButton && (jsx_runtime_1.jsx("div", { style: dynamicAddButtonStyle, onPointerEnter: onOuterMouseEnter, onPointerLeave: onOuterMouseLeave, children: jsx_runtime_1.jsx("div", { onClick: onAdd, style: inner, onPointerEnter: onInnerMouseEnter, onPointerLeave: onInnerMouseLeave, children: jsx_runtime_1.jsx(plus_1.Plus, { color: innerHovered ? 'white' : colors_1.LIGHT_TEXT, style: {
93
+ display: 'block',
94
+ height: exports.VERTICAL_GUIDE_HEIGHT / 2,
95
+ } }) }) })), jsx_runtime_1.jsx("div", { style: arraySeparationLine })
89
96
  ] }), isLast ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
90
97
  jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), jsx_runtime_1.jsx("div", { style: {
91
98
  ...layout_2.fieldSetText,
@@ -32,7 +32,7 @@ const ZodColorEditor = ({ jsonPath, value, setValue, schema, onRemove, mayPad })
32
32
  return (jsx_runtime_1.jsxs(Fieldset_1.Fieldset, { shouldPad: mayPad, children: [
33
33
  jsx_runtime_1.jsx(SchemaLabel_1.SchemaLabel, { handleClick: null, jsonPath: jsonPath, onRemove: onRemove, valid: localValue.success, suffix: null }), jsx_runtime_1.jsxs("div", { style: fullWidth, children: [
34
34
  jsx_runtime_1.jsxs(layout_1.Row, { align: "center", children: [
35
- jsx_runtime_1.jsx(ColorPicker_1.ColorPicker, { value: value, status: status, onChange: onPickerChange, onChangeComplete: onPickerComplete, width: 45, height: 39, name: jsonPath.join('.') }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1, block: true }), jsx_runtime_1.jsx(RemInput_1.RemotionInput, { value: value, status: status, placeholder: jsonPath.join('.'), onChange: onTextChange, onBlur: onTextBlur, rightAlign: false })
35
+ jsx_runtime_1.jsx(ColorPicker_1.ColorPicker, { value: value, status: status, onChange: onPickerChange, onChangeComplete: onPickerComplete, width: 45, height: 39, name: jsonPath.join('.') }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1, block: true }), jsx_runtime_1.jsx(RemInput_1.RemotionInput, { value: value, status: status, placeholder: jsonPath.join('.'), onChange: onTextChange, onBlur: onTextBlur, rightAlign: false, small: true })
36
36
  ] }), jsx_runtime_1.jsx(ZodFieldValidation_1.ZodFieldValidation, { path: jsonPath, zodValidation: localValue })
37
37
  ] })
38
38
  ] }));
@@ -55,7 +55,7 @@ const ZodDateEditor = ({ jsonPath, value, setValue, schema, onRemove, mayPad })
55
55
  const zodValidation = (0, react_1.useMemo)(() => (0, zod_schema_type_1.zodSafeParse)(schema, value), [schema, value]);
56
56
  return (jsx_runtime_1.jsxs(Fieldset_1.Fieldset, { shouldPad: mayPad, children: [
57
57
  jsx_runtime_1.jsx(SchemaLabel_1.SchemaLabel, { handleClick: null, jsonPath: jsonPath, onRemove: onRemove, valid: zodValidation.success, suffix: null }), jsx_runtime_1.jsxs("div", { style: fullWidth, children: [
58
- jsx_runtime_1.jsx(RemInput_1.RemotionInput, { value: formatDate(value), type: "datetime-local", status: zodValidation.success ? 'ok' : 'error', placeholder: jsonPath.join('.'), onChange: onChange, onBlur: onBlur, style: inputStyle, rightAlign: false }), jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsx("div", { style: explainer, children: "Date is in local format" }), jsx_runtime_1.jsx(ZodFieldValidation_1.ZodFieldValidation, { path: jsonPath, zodValidation: zodValidation })
58
+ jsx_runtime_1.jsx(RemInput_1.RemotionInput, { value: formatDate(value), type: "datetime-local", status: zodValidation.success ? 'ok' : 'error', placeholder: jsonPath.join('.'), onChange: onChange, onBlur: onBlur, style: inputStyle, rightAlign: false, small: true }), jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), jsx_runtime_1.jsx("div", { style: explainer, children: "Date is in local format" }), jsx_runtime_1.jsx(ZodFieldValidation_1.ZodFieldValidation, { path: jsonPath, zodValidation: zodValidation })
59
59
  ] })
60
60
  ] }));
61
61
  };
@@ -47,7 +47,7 @@ const ZodDiscriminatedUnionEditor = ({ schema, setValue, value, mayPad, jsonPath
47
47
  return {
48
48
  discriminator,
49
49
  markup: (jsx_runtime_1.jsxs(Fieldset_1.Fieldset, { shouldPad: mayPad, children: [
50
- jsx_runtime_1.jsx(SchemaLabel_1.SchemaLabel, { handleClick: null, jsonPath: [...jsonPath, discriminator], onRemove: onRemove, suffix: null, valid: zodValidation.success }), jsx_runtime_1.jsx(ComboBox_1.Combobox, { title: "Select type", values: comboBoxValues, selectedId: value[discriminator] })
50
+ jsx_runtime_1.jsx(SchemaLabel_1.SchemaLabel, { handleClick: null, jsonPath: [...jsonPath, discriminator], onRemove: onRemove, suffix: null, valid: zodValidation.success }), jsx_runtime_1.jsx(ComboBox_1.Combobox, { title: "Select type", values: comboBoxValues, selectedId: value[discriminator], small: true })
51
51
  ] }, 'replacement')),
52
52
  };
53
53
  }, [
@@ -39,7 +39,7 @@ const ZodEnumEditor = ({ schema, jsonPath, setValue, value, onRemove }) => {
39
39
  }, [enumValues, onChange, value]);
40
40
  const zodValidation = (0, react_1.useMemo)(() => (0, zod_schema_type_1.zodSafeParse)(schema, value), [schema, value]);
41
41
  return (jsx_runtime_1.jsxs(Fieldset_1.Fieldset, { shouldPad: true, children: [
42
- jsx_runtime_1.jsx(SchemaLabel_1.SchemaLabel, { handleClick: null, jsonPath: jsonPath, onRemove: onRemove, valid: zodValidation.success, suffix: null }), jsx_runtime_1.jsx("div", { style: isRoot ? undefined : container, children: jsx_runtime_1.jsx(ComboBox_1.Combobox, { values: comboBoxValues, selectedId: value, title: value }) }), jsx_runtime_1.jsx(ZodFieldValidation_1.ZodFieldValidation, { path: jsonPath, zodValidation: zodValidation })
42
+ jsx_runtime_1.jsx(SchemaLabel_1.SchemaLabel, { handleClick: null, jsonPath: jsonPath, onRemove: onRemove, valid: zodValidation.success, suffix: null }), jsx_runtime_1.jsx("div", { style: isRoot ? undefined : container, children: jsx_runtime_1.jsx(ComboBox_1.Combobox, { values: comboBoxValues, selectedId: value, title: value, small: true }) }), jsx_runtime_1.jsx(ZodFieldValidation_1.ZodFieldValidation, { path: jsonPath, zodValidation: zodValidation })
43
43
  ] }));
44
44
  };
45
45
  exports.ZodEnumEditor = ZodEnumEditor;
@@ -3,4 +3,5 @@ import type { ZodSafeParseResult } from './zod-schema-type';
3
3
  export declare const ZodErrorMessages: React.FC<{
4
4
  readonly zodValidationResult: ZodSafeParseResult;
5
5
  readonly viewTab: 'schema' | 'json';
6
+ readonly size?: 'default' | 'compact';
6
7
  }>;
@@ -10,6 +10,10 @@ const schemaLabel = {
10
10
  fontSize: 14,
11
11
  color: colors_1.LIGHT_TEXT,
12
12
  };
13
+ const compactSchemaLabel = {
14
+ ...schemaLabel,
15
+ fontSize: 12,
16
+ };
13
17
  const jsonLabel = {
14
18
  color: 'white',
15
19
  fontSize: 13,
@@ -17,29 +21,42 @@ const jsonLabel = {
17
21
  display: 'flex',
18
22
  alignItems: 'center',
19
23
  };
24
+ const compactJsonLabel = {
25
+ ...jsonLabel,
26
+ fontSize: 12,
27
+ };
20
28
  const triangleStyle = {
21
29
  width: 12,
22
30
  height: 12,
23
31
  flexShrink: 0,
24
32
  fill: colors_1.FAIL_COLOR,
25
33
  };
26
- const ZodErrorMessages = ({ zodValidationResult, viewTab }) => {
34
+ const compactTriangleStyle = {
35
+ ...triangleStyle,
36
+ width: 10,
37
+ height: 10,
38
+ };
39
+ const ZodErrorMessages = ({ zodValidationResult, viewTab, size = 'default' }) => {
27
40
  if (zodValidationResult.success) {
28
41
  throw new Error('Expected error');
29
42
  }
30
43
  const style = (0, react_1.useMemo)(() => {
31
- return viewTab === 'json' ? jsonLabel : schemaLabel;
32
- }, [viewTab]);
44
+ if (viewTab === 'json') {
45
+ return size === 'compact' ? compactJsonLabel : jsonLabel;
46
+ }
47
+ return size === 'compact' ? compactSchemaLabel : schemaLabel;
48
+ }, [size, viewTab]);
33
49
  const code = (0, react_1.useMemo)(() => {
34
50
  return {
35
- ...schemaLabel,
51
+ ...(size === 'compact' ? compactSchemaLabel : schemaLabel),
36
52
  fontFamily: 'monospace',
37
53
  };
38
- }, []);
54
+ }, [size]);
55
+ const finalTriangleStyle = size === 'compact' ? compactTriangleStyle : triangleStyle;
39
56
  if (viewTab === 'json') {
40
57
  return (jsx_runtime_1.jsx("div", { children: zodValidationResult.error.issues.map((error) => {
41
58
  return (jsx_runtime_1.jsxs("div", { style: style, children: [
42
- jsx_runtime_1.jsx(ValidationMessage_1.WarningTriangle, { style: triangleStyle }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), error.path.length === 0 ? 'Root' : error.path.join('.'), ":", ' ', error.message] }, error.path.join('.')));
59
+ jsx_runtime_1.jsx(ValidationMessage_1.WarningTriangle, { style: finalTriangleStyle }), jsx_runtime_1.jsx(layout_1.Spacing, { x: size === 'compact' ? 0.75 : 1 }), error.path.length === 0 ? 'Root' : error.path.join('.'), ":", ' ', error.message] }, error.path.join('.')));
43
60
  }) }));
44
61
  }
45
62
  return (jsx_runtime_1.jsx("div", { children: zodValidationResult.error.issues.map((error) => {
@@ -14,14 +14,14 @@ const stackTrace = {
14
14
  padding: 10,
15
15
  };
16
16
  const stackTraceLabel = {
17
- fontSize: 14,
17
+ fontSize: 12,
18
18
  };
19
19
  const ZodFieldValidation = ({ zodValidation, path }) => {
20
20
  if (zodValidation.success) {
21
21
  return null;
22
22
  }
23
23
  return (jsx_runtime_1.jsxs("div", { style: legend, children: [
24
- jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: zodValidation.error.format()._errors[0], type: "error" }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), jsx_runtime_1.jsx(InfoBubble_1.InfoBubble, { title: "Zod validation failure", children: jsx_runtime_1.jsxs("div", { style: stackTrace, children: [
24
+ jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { align: "flex-start", message: zodValidation.error.format()._errors[0], type: "error", size: "compact" }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), jsx_runtime_1.jsx(InfoBubble_1.InfoBubble, { title: "Zod validation failure", children: jsx_runtime_1.jsxs("div", { style: stackTrace, children: [
25
25
  jsx_runtime_1.jsx("div", { style: stackTraceLabel, children: "Zod Validation has failed:" }), zodValidation.error.issues.map((error, index) => (
26
26
  // eslint-disable-next-line react/no-array-index-key
27
27
  jsx_runtime_1.jsxs("div", { style: stackTraceLabel, children: ["Type: ", error.code, " ",
@@ -16,7 +16,8 @@ const emptyLabel = {
16
16
  };
17
17
  const wideEmptyLabel = {
18
18
  ...emptyLabel,
19
- lineHeight: '37px',
19
+ fontSize: 12,
20
+ lineHeight: '28px',
20
21
  };
21
22
  const ZonNonEditableValue = ({ jsonPath, label, mayPad }) => {
22
23
  return (jsx_runtime_1.jsxs(Fieldset_1.Fieldset, { shouldPad: mayPad, children: [
@@ -26,7 +26,7 @@ const ZodNumberEditor = ({ jsonPath, value, schema, setValue, onRemove, mayPad }
26
26
  const zodValidation = (0, react_1.useMemo)(() => (0, zod_schema_type_1.zodSafeParse)(schema, value), [schema, value]);
27
27
  return (jsx_runtime_1.jsxs(Fieldset_1.Fieldset, { shouldPad: mayPad, children: [
28
28
  jsx_runtime_1.jsx(SchemaLabel_1.SchemaLabel, { handleClick: null, jsonPath: jsonPath, onRemove: onRemove, valid: zodValidation.success, suffix: null }), jsx_runtime_1.jsxs("div", { style: fullWidth, children: [
29
- jsx_runtime_1.jsx(InputDragger_1.InputDragger, { type: 'number', value: value, style: fullWidth, status: zodValidation.success ? 'ok' : 'error', placeholder: jsonPath.join('.'), onTextChange: onTextChange, onValueChange: onNumberChange, onValueChangeEnd: onNumberChangeEnd, min: (0, zod_number_constraints_1.getZodNumberMinimum)(schema), max: (0, zod_number_constraints_1.getZodNumberMaximum)(schema), step: (0, zod_number_constraints_1.getZodNumberStep)(schema), rightAlign: false }), jsx_runtime_1.jsx(ZodFieldValidation_1.ZodFieldValidation, { path: jsonPath, zodValidation: zodValidation })
29
+ jsx_runtime_1.jsx(InputDragger_1.InputDragger, { type: 'number', value: value, style: fullWidth, status: zodValidation.success ? 'ok' : 'error', placeholder: jsonPath.join('.'), onTextChange: onTextChange, onValueChange: onNumberChange, onValueChangeEnd: onNumberChangeEnd, min: (0, zod_number_constraints_1.getZodNumberMinimum)(schema), max: (0, zod_number_constraints_1.getZodNumberMaximum)(schema), step: (0, zod_number_constraints_1.getZodNumberStep)(schema), rightAlign: false, small: true }), jsx_runtime_1.jsx(ZodFieldValidation_1.ZodFieldValidation, { path: jsonPath, zodValidation: zodValidation })
30
30
  ] })
31
31
  ] }));
32
32
  };
@@ -40,7 +40,6 @@ const react_2 = __importStar(require("react"));
40
40
  const layout_1 = require("../layout");
41
41
  const Fieldset_1 = require("./Fieldset");
42
42
  const SchemaLabel_1 = require("./SchemaLabel");
43
- const SchemaSeparationLine_1 = require("./SchemaSeparationLine");
44
43
  const SchemaVerticalGuide_1 = require("./SchemaVerticalGuide");
45
44
  const zod_schema_type_1 = require("./zod-schema-type");
46
45
  const zod_schema_type_2 = require("./zod-schema-type");
@@ -61,20 +60,19 @@ const ZodObjectEditor = ({ schema, jsonPath, setValue, value, onRemove, mayPad,
61
60
  return expanded ? ' {' : ' {...}';
62
61
  }, [expanded]);
63
62
  const zodValidation = (0, react_2.useMemo)(() => (0, zod_schema_type_1.zodSafeParse)(schema, value), [schema, value]);
64
- return (jsx_runtime_1.jsxs(Fieldset_1.Fieldset, { shouldPad: !isRoot && mayPad, children: [isRoot ? null : (jsx_runtime_1.jsx(SchemaLabel_1.SchemaLabel, { jsonPath: jsonPath, onRemove: onRemove, suffix: suffix, valid: zodValidation.success, handleClick: () => setExpanded(!expanded) })), expanded ? (jsx_runtime_1.jsx(SchemaVerticalGuide_1.SchemaVerticalGuide, { isRoot: isRoot, children: keys.map((key, i) => {
63
+ return (jsx_runtime_1.jsxs(Fieldset_1.Fieldset, { shouldPad: !isRoot && mayPad, children: [isRoot ? null : (jsx_runtime_1.jsx(SchemaLabel_1.SchemaLabel, { jsonPath: jsonPath, onRemove: onRemove, suffix: suffix, valid: zodValidation.success, handleClick: () => setExpanded(!expanded) })), expanded ? (jsx_runtime_1.jsx(SchemaVerticalGuide_1.SchemaVerticalGuide, { isRoot: isRoot, children: keys.map((key) => {
65
64
  if (discriminatedUnionReplacement &&
66
65
  key === discriminatedUnionReplacement.discriminator) {
67
66
  return discriminatedUnionReplacement.markup;
68
67
  }
69
- return (jsx_runtime_1.jsxs(react_2.default.Fragment, { children: [
70
- jsx_runtime_1.jsx(ZodSwitch_1.ZodSwitch, { mayPad: true, jsonPath: [...jsonPath, key], schema: shape[key], value: value[key], setValue: (val, { shouldSave }) => {
71
- onChange((oldVal) => {
72
- return {
73
- ...oldVal,
74
- [key]: typeof val === 'function' ? val(oldVal[key]) : val,
75
- };
76
- }, { shouldSave });
77
- }, onRemove: null }), i === keys.length - 1 ? null : jsx_runtime_1.jsx(SchemaSeparationLine_1.SchemaSeparationLine, {})] }, key));
68
+ return (jsx_runtime_1.jsx(react_2.default.Fragment, { children: jsx_runtime_1.jsx(ZodSwitch_1.ZodSwitch, { mayPad: true, jsonPath: [...jsonPath, key], schema: shape[key], value: value[key], setValue: (val, { shouldSave }) => {
69
+ onChange((oldVal) => {
70
+ return {
71
+ ...oldVal,
72
+ [key]: typeof val === 'function' ? val(oldVal[key]) : val,
73
+ };
74
+ }, { shouldSave });
75
+ }, onRemove: null }) }, key));
78
76
  }) })) : null, isRoot || !expanded ? null : jsx_runtime_1.jsx("div", { style: layout_1.fieldsetLabel, children: '}' })] }));
79
77
  };
80
78
  exports.ZodObjectEditor = ZodObjectEditor;
@@ -15,7 +15,7 @@ const zod_schema_type_1 = require("./zod-schema-type");
15
15
  const ZodSwitch_1 = require("./ZodSwitch");
16
16
  const labelStyle = {
17
17
  fontFamily: 'sans-serif',
18
- fontSize: 14,
18
+ fontSize: 12,
19
19
  color: colors_1.LIGHT_TEXT,
20
20
  };
21
21
  const checkBoxWrapper = {
@@ -38,7 +38,7 @@ const ZodStaticFileEditor = ({ schema, jsonPath, setValue, value, onRemove, mayP
38
38
  });
39
39
  }, [onChange, staticFiles, value]);
40
40
  return (jsx_runtime_1.jsxs(Fieldset_1.Fieldset, { shouldPad: mayPad, children: [
41
- jsx_runtime_1.jsx(SchemaLabel_1.SchemaLabel, { handleClick: null, jsonPath: jsonPath, onRemove: onRemove, valid: zodValidation.success, suffix: null }), jsx_runtime_1.jsx("div", { style: isRoot ? undefined : container, children: jsx_runtime_1.jsx(ComboBox_1.Combobox, { values: comboBoxValues, selectedId: value, title: value }) }), jsx_runtime_1.jsx(ZodFieldValidation_1.ZodFieldValidation, { path: jsonPath, zodValidation: zodValidation })
41
+ jsx_runtime_1.jsx(SchemaLabel_1.SchemaLabel, { handleClick: null, jsonPath: jsonPath, onRemove: onRemove, valid: zodValidation.success, suffix: null }), jsx_runtime_1.jsx("div", { style: isRoot ? undefined : container, children: jsx_runtime_1.jsx(ComboBox_1.Combobox, { values: comboBoxValues, selectedId: value, title: value, small: true }) }), jsx_runtime_1.jsx(ZodFieldValidation_1.ZodFieldValidation, { path: jsonPath, zodValidation: zodValidation })
42
42
  ] }));
43
43
  };
44
44
  exports.ZodStaticFileEditor = ZodStaticFileEditor;
@@ -27,7 +27,7 @@ const ZodStringEditor = ({ jsonPath, value, setValue, schema, onRemove, mayPad }
27
27
  }, [setValue, value]);
28
28
  return (jsx_runtime_1.jsxs(Fieldset_1.Fieldset, { shouldPad: mayPad, children: [
29
29
  jsx_runtime_1.jsx(SchemaLabel_1.SchemaLabel, { handleClick: null, jsonPath: jsonPath, onRemove: onRemove, valid: zodValidation.success, suffix: null }), jsx_runtime_1.jsxs("div", { style: fullWidth, children: [
30
- jsx_runtime_1.jsx(RemInput_1.RemotionInput, { value: value, status: zodValidation.success ? 'ok' : 'error', placeholder: jsonPath.join('.'), onChange: onChange, onBlur: onBlur, rightAlign: false, name: jsonPath.join('.') }), jsx_runtime_1.jsx(ZodFieldValidation_1.ZodFieldValidation, { path: jsonPath, zodValidation: zodValidation })
30
+ jsx_runtime_1.jsx(RemInput_1.RemotionInput, { value: value, status: zodValidation.success ? 'ok' : 'error', placeholder: jsonPath.join('.'), onChange: onChange, onBlur: onBlur, rightAlign: false, name: jsonPath.join('.'), small: true }), jsx_runtime_1.jsx(ZodFieldValidation_1.ZodFieldValidation, { path: jsonPath, zodValidation: zodValidation })
31
31
  ] })
32
32
  ] }));
33
33
  };
@@ -67,7 +67,7 @@ const ZodTextareaEditor = ({ jsonPath, value, setValue, schema, onRemove, mayPad
67
67
  const zodValidation = react_1.default.useMemo(() => (0, zod_schema_type_1.zodSafeParse)(schema, value), [schema, value]);
68
68
  return (jsx_runtime_1.jsxs(Fieldset_1.Fieldset, { shouldPad: mayPad, children: [
69
69
  jsx_runtime_1.jsx(SchemaLabel_1.SchemaLabel, { handleClick: null, jsonPath: jsonPath, onRemove: onRemove, valid: zodValidation.success, suffix: null }), jsx_runtime_1.jsxs("div", { style: fullWidth, children: [
70
- jsx_runtime_1.jsx(RemTextarea_1.RemTextarea, { onChange: onChange, onBlur: onBlur, value: value, status: zodValidation ? 'ok' : 'error', placeholder: jsonPath.join('.'), name: jsonPath.join('.'), style: textareaStyle }), jsx_runtime_1.jsx(ZodFieldValidation_1.ZodFieldValidation, { path: jsonPath, zodValidation: zodValidation })
70
+ jsx_runtime_1.jsx(RemTextarea_1.RemTextarea, { onChange: onChange, onBlur: onBlur, value: value, status: zodValidation ? 'ok' : 'error', placeholder: jsonPath.join('.'), name: jsonPath.join('.'), style: textareaStyle, small: true }), jsx_runtime_1.jsx(ZodFieldValidation_1.ZodFieldValidation, { path: jsonPath, zodValidation: zodValidation })
71
71
  ] })
72
72
  ] }));
73
73
  };
@@ -3,4 +3,5 @@ export declare const WarningIndicatorButton: React.FC<{
3
3
  readonly setShowWarning: React.Dispatch<React.SetStateAction<boolean>>;
4
4
  readonly showWarning: boolean;
5
5
  readonly warningCount: number;
6
+ readonly size?: 'default' | 'compact';
6
7
  }>;
@@ -21,31 +21,44 @@ const style = {
21
21
  paddingTop: 4,
22
22
  paddingBottom: 4,
23
23
  };
24
+ const compactStyle = {
25
+ ...style,
26
+ fontSize: 11,
27
+ paddingBottom: 2,
28
+ paddingLeft: 6,
29
+ paddingRight: 6,
30
+ paddingTop: 2,
31
+ };
24
32
  const triangleStyle = {
25
33
  width: 12,
26
34
  height: 12,
27
35
  flexShrink: 0,
28
36
  fill: colors_1.WARNING_COLOR,
29
37
  };
38
+ const compactTriangleStyle = {
39
+ ...triangleStyle,
40
+ height: 10,
41
+ width: 10,
42
+ };
30
43
  const WarningTriangle = (props) => {
31
44
  return (jsx_runtime_1.jsx("svg", { viewBox: "0 0 576 512", ...props, children: jsx_runtime_1.jsx("path", { d: "M248.747 204.705l6.588 112c.373 6.343 5.626 11.295 11.979 11.295h41.37a12 12 0 0 0 11.979-11.295l6.588-112c.405-6.893-5.075-12.705-11.979-12.705h-54.547c-6.903 0-12.383 5.812-11.978 12.705zM330 384c0 23.196-18.804 42-42 42s-42-18.804-42-42 18.804-42 42-42 42 18.804 42 42zm-.423-360.015c-18.433-31.951-64.687-32.009-83.154 0L6.477 440.013C-11.945 471.946 11.118 512 48.054 512H527.94c36.865 0 60.035-39.993 41.577-71.987L329.577 23.985zM53.191 455.002L282.803 57.008c2.309-4.002 8.085-4.002 10.394 0l229.612 397.993c2.308 4-.579 8.998-5.197 8.998H58.388c-4.617.001-7.504-4.997-5.197-8.997z" }) }));
32
45
  };
33
- const WarningIndicatorButton = ({ setShowWarning, showWarning, warningCount }) => {
46
+ const WarningIndicatorButton = ({ setShowWarning, showWarning, warningCount, size = 'default' }) => {
34
47
  const onClick = (0, react_1.useCallback)(() => {
35
48
  setShowWarning((s) => !s);
36
49
  }, [setShowWarning]);
37
50
  const buttonStyle = (0, react_1.useMemo)(() => {
38
51
  return {
39
- ...style,
52
+ ...(size === 'compact' ? compactStyle : style),
40
53
  backgroundColor: showWarning ? colors_1.INPUT_BACKGROUND : 'transparent',
41
54
  borderColor: showWarning
42
55
  ? colors_1.INPUT_BORDER_COLOR_HOVERED
43
56
  : colors_1.INPUT_BORDER_COLOR_UNHOVERED,
44
57
  color: showWarning ? 'white' : colors_1.LIGHT_TEXT,
45
58
  };
46
- }, [showWarning]);
59
+ }, [showWarning, size]);
47
60
  return (jsx_runtime_1.jsxs("button", { type: "button", style: buttonStyle, onClick: onClick, children: [
48
- jsx_runtime_1.jsx(WarningTriangle, { style: triangleStyle }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), warningCount, jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), jsx_runtime_1.jsx(caret_1.AngleDown, { down: showWarning })
61
+ jsx_runtime_1.jsx(WarningTriangle, { style: size === 'compact' ? compactTriangleStyle : triangleStyle }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 0.5 }), warningCount, jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), jsx_runtime_1.jsx(caret_1.AngleDown, { down: showWarning })
49
62
  ] }));
50
63
  };
51
64
  exports.WarningIndicatorButton = WarningIndicatorButton;
@@ -12,7 +12,7 @@ export type TypeCanSaveState = {
12
12
  reason: string;
13
13
  determined: boolean;
14
14
  };
15
- export declare const getRenderModalWarnings: ({ cliProps, canSaveDefaultProps, isCustomDateUsed, customFileUsed, jsMapUsed, jsSetUsed, inJSONEditor, propsEditType, }: {
15
+ export declare const getRenderModalWarnings: ({ cliProps, canSaveDefaultProps, isCustomDateUsed, customFileUsed, jsMapUsed, jsSetUsed, inJSONEditor, propsEditType, showCannotSaveDefaultPropsWarning, }: {
16
16
  cliProps: unknown;
17
17
  canSaveDefaultProps: TypeCanSaveState | null;
18
18
  isCustomDateUsed: boolean;
@@ -21,4 +21,5 @@ export declare const getRenderModalWarnings: ({ cliProps, canSaveDefaultProps, i
21
21
  jsSetUsed: boolean;
22
22
  inJSONEditor: boolean;
23
23
  propsEditType: PropsEditType;
24
+ showCannotSaveDefaultPropsWarning: boolean;
24
25
  }) => RenderModalWarning[];
@@ -19,7 +19,10 @@ const getInputPropsWarning = ({ cliProps, propsEditType, }) => {
19
19
  }
20
20
  return null;
21
21
  };
22
- const getCannotSaveDefaultProps = (canSaveDefaultProps) => {
22
+ const getCannotSaveDefaultProps = (canSaveDefaultProps, showCannotSaveDefaultPropsWarning) => {
23
+ if (!showCannotSaveDefaultPropsWarning) {
24
+ return null;
25
+ }
23
26
  if (canSaveDefaultProps === null) {
24
27
  return null;
25
28
  }
@@ -59,10 +62,10 @@ const setUsed = (used, inJSONEditor) => {
59
62
  }
60
63
  return null;
61
64
  };
62
- const getRenderModalWarnings = ({ cliProps, canSaveDefaultProps, isCustomDateUsed, customFileUsed, jsMapUsed, jsSetUsed, inJSONEditor, propsEditType, }) => {
65
+ const getRenderModalWarnings = ({ cliProps, canSaveDefaultProps, isCustomDateUsed, customFileUsed, jsMapUsed, jsSetUsed, inJSONEditor, propsEditType, showCannotSaveDefaultPropsWarning, }) => {
63
66
  return [
64
67
  warningOrNull('input-props-override', getInputPropsWarning({ cliProps, propsEditType })),
65
- getCannotSaveDefaultProps(canSaveDefaultProps),
68
+ getCannotSaveDefaultProps(canSaveDefaultProps, showCannotSaveDefaultPropsWarning),
66
69
  warningOrNull('custom-date-used', customDateUsed(isCustomDateUsed, inJSONEditor)),
67
70
  warningOrNull('static-file-used', staticFileUsed(customFileUsed, inJSONEditor)),
68
71
  warningOrNull('map-used', mapUsed(jsMapUsed, inJSONEditor)),
@@ -10,7 +10,7 @@ const Tabs_1 = require("./Tabs");
10
10
  const row = {
11
11
  display: 'flex',
12
12
  flexDirection: 'row',
13
- fontSize: 14,
13
+ fontSize: 'inherit',
14
14
  color: 'inherit',
15
15
  alignItems: 'center',
16
16
  flex: 1,
@@ -5,7 +5,10 @@ export type SegmentedControlItem = {
5
5
  key: string;
6
6
  selected: boolean;
7
7
  };
8
+ type SegmentedControlSize = 'default' | 'compact';
8
9
  export declare const SegmentedControl: React.FC<{
9
10
  readonly items: SegmentedControlItem[];
10
11
  readonly needsWrapping: boolean;
12
+ readonly size?: SegmentedControlSize;
11
13
  }>;
14
+ export {};