@remotion/studio 4.0.507 → 4.0.509

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 (191) hide show
  1. package/dist/FastRefreshProvider.js +13 -9
  2. package/dist/Studio.d.ts +5 -0
  3. package/dist/Studio.js +2 -2
  4. package/dist/components/Canvas.js +35 -5
  5. package/dist/components/CodingAgentIcon.d.ts +3 -1
  6. package/dist/components/CodingAgentIcon.js +4 -9
  7. package/dist/components/ColorPicker/AlphaSlider.js +2 -2
  8. package/dist/components/ColorPicker/HueSlider.js +2 -2
  9. package/dist/components/ColorPicker/SaturationValueArea.js +2 -2
  10. package/dist/components/ConfigureDefaultEditorModal.js +1 -1
  11. package/dist/components/ContextMenu.d.ts +1 -0
  12. package/dist/components/ContextMenu.js +32 -5
  13. package/dist/components/EditorContent.js +4 -3
  14. package/dist/components/EditorGuides/Guide.js +2 -2
  15. package/dist/components/EditorRuler/index.js +2 -2
  16. package/dist/components/ExplorerPanel.js +19 -1
  17. package/dist/components/InlineAction.d.ts +2 -1
  18. package/dist/components/InlineAction.js +3 -3
  19. package/dist/components/InspectorLocationCopy.js +1 -1
  20. package/dist/components/InspectorOpenInEditor.d.ts +1 -0
  21. package/dist/components/InspectorOpenInEditor.js +52 -8
  22. package/dist/components/InspectorPanel/AlignmentControls.js +2 -2
  23. package/dist/components/InspectorPanel/CompositionInspector.js +3 -1
  24. package/dist/components/InspectorPanel/SequenceSelectionInspector.js +3 -3
  25. package/dist/components/InspectorPanel/styles.js +1 -1
  26. package/dist/components/InspectorSequenceSection.js +36 -4
  27. package/dist/components/Menu/MenuItem.js +2 -2
  28. package/dist/components/MenuBuildIndicator.js +1 -1
  29. package/dist/components/ModalContainer.js +1 -1
  30. package/dist/components/Modals.js +2 -9
  31. package/dist/components/NewComposition/InputDragger.js +2 -2
  32. package/dist/components/NewComposition/NewComposition.d.ts +2 -0
  33. package/dist/components/NewComposition/NewComposition.js +38 -6
  34. package/dist/components/NewComposition/get-new-composition-defaults.d.ts +1 -1
  35. package/dist/components/NewComposition/get-new-composition-defaults.js +9 -1
  36. package/dist/components/PlayPause.d.ts +1 -1
  37. package/dist/components/PlayPause.js +61 -12
  38. package/dist/components/RenderButton.js +16 -12
  39. package/dist/components/RenderModal/GuiRenderStatus.js +23 -6
  40. package/dist/components/RenderModal/InfoBubble.d.ts +1 -0
  41. package/dist/components/RenderModal/InfoBubble.js +6 -4
  42. package/dist/components/RenderModal/InfoTooltip.d.ts +1 -0
  43. package/dist/components/RenderModal/InfoTooltip.js +12 -12
  44. package/dist/components/RenderModal/SchemaEditor/SchemaLabel.d.ts +5 -0
  45. package/dist/components/RenderModal/SchemaEditor/SchemaLabel.js +16 -3
  46. package/dist/components/RenderModal/SchemaEditor/ZodArrayEditor.js +1 -1
  47. package/dist/components/RenderModal/SchemaEditor/ZodBooleanEditor.d.ts +2 -0
  48. package/dist/components/RenderModal/SchemaEditor/ZodBooleanEditor.js +3 -2
  49. package/dist/components/RenderModal/SchemaEditor/ZodColorEditor.js +1 -1
  50. package/dist/components/RenderModal/SchemaEditor/ZodDateEditor.js +1 -1
  51. package/dist/components/RenderModal/SchemaEditor/ZodDiscriminatedUnionEditor.js +2 -1
  52. package/dist/components/RenderModal/SchemaEditor/ZodEnumEditor.js +1 -1
  53. package/dist/components/RenderModal/SchemaEditor/ZodMatrixEditor.js +1 -1
  54. package/dist/components/RenderModal/SchemaEditor/ZodNonEditableValue.js +1 -1
  55. package/dist/components/RenderModal/SchemaEditor/ZodNumberEditor.js +1 -1
  56. package/dist/components/RenderModal/SchemaEditor/ZodObjectEditor.js +1 -1
  57. package/dist/components/RenderModal/SchemaEditor/ZodOrNullishEditor.js +6 -1
  58. package/dist/components/RenderModal/SchemaEditor/ZodStaticFileEditor.js +1 -1
  59. package/dist/components/RenderModal/SchemaEditor/ZodStringEditor.js +1 -1
  60. package/dist/components/RenderModal/SchemaEditor/ZodSwitch.js +1 -1
  61. package/dist/components/RenderModal/SchemaEditor/ZodTextareaEditor.js +1 -1
  62. package/dist/components/RenderModal/SchemaEditor/ZodTupleEditor.js +1 -1
  63. package/dist/components/RenderModal/SchemaEditor/zod-schema-type.d.ts +1 -0
  64. package/dist/components/RenderModal/SchemaEditor/zod-schema-type.js +12 -1
  65. package/dist/components/SelectedOutlineCanvasRotation.d.ts +9 -0
  66. package/dist/components/SelectedOutlineCanvasRotation.js +239 -0
  67. package/dist/components/SelectedOutlineCropControls.js +2 -2
  68. package/dist/components/SelectedOutlineElement.d.ts +2 -1
  69. package/dist/components/SelectedOutlineElement.js +40 -5
  70. package/dist/components/SelectedOutlineOverlay.d.ts +1 -1
  71. package/dist/components/SelectedOutlineOverlay.js +55 -26
  72. package/dist/components/SelectedOutlinePolygon.d.ts +1 -0
  73. package/dist/components/SelectedOutlinePolygon.js +6 -5
  74. package/dist/components/SelectedOutlineRenderer.d.ts +1 -0
  75. package/dist/components/SelectedOutlineRenderer.js +24 -7
  76. package/dist/components/SelectedOutlineRotationCornerHandle.d.ts +6 -0
  77. package/dist/components/SelectedOutlineRotationCornerHandle.js +9 -7
  78. package/dist/components/SelectedOutlineScaleEdgeLine.d.ts +2 -0
  79. package/dist/components/SelectedOutlineScaleEdgeLine.js +11 -7
  80. package/dist/components/SelectedOutlineTransformOriginHandle.js +50 -24
  81. package/dist/components/SelectedOutlineUvControls.js +8 -8
  82. package/dist/components/SequencePropsSubscriptionProvider.js +8 -0
  83. package/dist/components/SettingsModalFooter.js +1 -1
  84. package/dist/components/Splitter/SplitterHandle.js +2 -2
  85. package/dist/components/Tabs/index.d.ts +2 -0
  86. package/dist/components/Tabs/index.js +2 -2
  87. package/dist/components/Timeline/EasingEditorModal.js +2 -2
  88. package/dist/components/Timeline/SequencePropsObserver.js +97 -1
  89. package/dist/components/Timeline/SubscribeToNodePaths.js +4 -2
  90. package/dist/components/Timeline/Timeline.js +55 -1
  91. package/dist/components/Timeline/TimelineClipboardKeybindings.js +99 -35
  92. package/dist/components/Timeline/TimelineDragHandler.js +2 -2
  93. package/dist/components/Timeline/TimelineEffectItem.js +1 -4
  94. package/dist/components/Timeline/TimelineEffectPropItem.js +7 -0
  95. package/dist/components/Timeline/TimelineFieldRowContent.js +10 -3
  96. package/dist/components/Timeline/TimelineInOutDragHandler.js +2 -2
  97. package/dist/components/Timeline/TimelineLayerEye.js +2 -2
  98. package/dist/components/Timeline/TimelineRotationField.js +84 -12
  99. package/dist/components/Timeline/TimelineScaleField.js +58 -4
  100. package/dist/components/Timeline/TimelineSelection.d.ts +4 -0
  101. package/dist/components/Timeline/TimelineSelection.js +47 -4
  102. package/dist/components/Timeline/TimelineSequenceItem.js +43 -25
  103. package/dist/components/Timeline/TimelineSequencePropItem.js +12 -3
  104. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +6 -6
  105. package/dist/components/Timeline/TimelineTransformOriginField.js +78 -4
  106. package/dist/components/Timeline/TimelineTranslateField.js +55 -15
  107. package/dist/components/Timeline/Transform3DModeContext.d.ts +1 -0
  108. package/dist/components/Timeline/Transform3DModeContext.js +5 -0
  109. package/dist/components/Timeline/delete-selected-timeline-item.js +0 -6
  110. package/dist/components/Timeline/get-sequence-context-menu-items.js +14 -6
  111. package/dist/components/Timeline/keyframe-clipboard.d.ts +5 -1
  112. package/dist/components/Timeline/keyframe-clipboard.js +3 -2
  113. package/dist/components/Timeline/save-sequence-prop.js +16 -7
  114. package/dist/components/Timeline/sequence-prop-clipboard.d.ts +31 -0
  115. package/dist/components/Timeline/sequence-prop-clipboard.js +142 -0
  116. package/dist/components/Timeline/sequence-props-subscription-store.d.ts +2 -1
  117. package/dist/components/Timeline/sequence-props-subscription-store.js +5 -2
  118. package/dist/components/Timeline/timeline-field-display-utils.js +2 -2
  119. package/dist/components/Timeline/timeline-field-row-layout.d.ts +6 -0
  120. package/dist/components/Timeline/timeline-field-row-layout.js +16 -1
  121. package/dist/components/Timeline/timeline-rotation-utils.d.ts +16 -0
  122. package/dist/components/Timeline/timeline-rotation-utils.js +145 -4
  123. package/dist/components/Timeline/timeline-translate-utils.d.ts +3 -2
  124. package/dist/components/Timeline/timeline-translate-utils.js +8 -4
  125. package/dist/components/Timeline/transform-3d-mode.d.ts +6 -0
  126. package/dist/components/Timeline/transform-3d-mode.js +36 -0
  127. package/dist/components/Timeline/transform-origin-utils.d.ts +4 -0
  128. package/dist/components/Timeline/transform-origin-utils.js +12 -6
  129. package/dist/components/Timeline/update-selected-easing.js +8 -0
  130. package/dist/components/Timeline/use-open-sequence-in-apps.js +3 -1
  131. package/dist/components/Timeline/use-resolved-stack-react-to-change.d.ts +5 -1
  132. package/dist/components/Timeline/use-resolved-stack-react-to-change.js +67 -10
  133. package/dist/components/Timeline/use-sequence-props-subscription.d.ts +3 -1
  134. package/dist/components/Timeline/use-sequence-props-subscription.js +7 -2
  135. package/dist/components/Timeline/use-timeline-keyframe-drag.js +4 -4
  136. package/dist/components/call-api.js +2 -0
  137. package/dist/components/canvas-rotation-cursor.d.ts +1 -0
  138. package/dist/components/canvas-rotation-cursor.js +14 -0
  139. package/dist/components/folder-menu-items.js +1 -0
  140. package/dist/components/get-open-in-menu-items.d.ts +8 -1
  141. package/dist/components/get-open-in-menu-items.js +93 -8
  142. package/dist/components/import-assets.js +7 -0
  143. package/dist/components/root-composition-menu-items.js +1 -0
  144. package/dist/components/selected-outline-control-layout.d.ts +14 -0
  145. package/dist/components/selected-outline-control-layout.js +94 -0
  146. package/dist/components/selected-outline-drag.d.ts +11 -5
  147. package/dist/components/selected-outline-drag.js +80 -42
  148. package/dist/components/selected-outline-measurement.d.ts +5 -0
  149. package/dist/components/selected-outline-measurement.js +28 -1
  150. package/dist/components/selected-outline-types.d.ts +6 -0
  151. package/dist/components/use-default-editor-info.js +28 -3
  152. package/dist/esm/{chunk-ptnd65a9.js → chunk-jdn6nkbk.js} +10087 -7919
  153. package/dist/esm/{chunk-fgedsvhb.js → chunk-r46yxrjr.js} +1 -2
  154. package/dist/esm/index.mjs +357 -2
  155. package/dist/esm/internals.mjs +10086 -7918
  156. package/dist/esm/previewEntry.mjs +9926 -7758
  157. package/dist/esm/renderEntry.mjs +4 -2
  158. package/dist/helpers/get-box-quads-polyfill-internals.js +10 -2
  159. package/dist/helpers/get-canvas-capture-import.d.ts +7 -0
  160. package/dist/helpers/get-canvas-capture-import.js +43 -0
  161. package/dist/helpers/get-git-menu-item.d.ts +1 -1
  162. package/dist/helpers/get-git-menu-item.js +33 -3
  163. package/dist/helpers/inserted-element-selection.d.ts +12 -0
  164. package/dist/helpers/inserted-element-selection.js +29 -0
  165. package/dist/helpers/open-in-editor.d.ts +3 -1
  166. package/dist/helpers/open-in-editor.js +5 -1
  167. package/dist/helpers/pointer-session.d.ts +6 -2
  168. package/dist/helpers/pointer-session.js +29 -12
  169. package/dist/helpers/preview-server-events.js +4 -0
  170. package/dist/helpers/sequence-node-path-mutations.d.ts +4 -0
  171. package/dist/helpers/sequence-node-path-mutations.js +31 -0
  172. package/dist/helpers/use-create-composition.d.ts +15 -2
  173. package/dist/helpers/use-create-composition.js +11 -17
  174. package/dist/helpers/use-menu-structure.js +1 -0
  175. package/dist/icons/cube.d.ts +4 -0
  176. package/dist/icons/cube.js +6 -0
  177. package/dist/icons/finder.d.ts +4 -0
  178. package/dist/icons/finder.js +8 -0
  179. package/dist/icons/github.d.ts +4 -0
  180. package/dist/icons/github.js +11 -0
  181. package/dist/icons/terminal.d.ts +6 -0
  182. package/dist/icons/terminal.js +46 -0
  183. package/dist/index.d.ts +15 -0
  184. package/dist/index.js +8 -0
  185. package/dist/renderEntry.js +2 -2
  186. package/dist/state/modals.d.ts +9 -1
  187. package/dist/state/transform-3d-mode.d.ts +10 -0
  188. package/dist/state/transform-3d-mode.js +27 -0
  189. package/dist/state/z-index.d.ts +0 -1
  190. package/dist/state/z-index.js +28 -37
  191. package/package.json +12 -12
@@ -23,7 +23,7 @@ const container = {
23
23
  fontSize: 14,
24
24
  verticalAlign: 'text-bottom',
25
25
  };
26
- const InfoBubble = ({ title, children }) => {
26
+ const InfoBubble = ({ title, children, horizontalAlignment = 'left' }) => {
27
27
  const [hovered, setIsHovered] = (0, react_1.useState)(false);
28
28
  const [opened, setOpened] = (0, react_1.useState)(false);
29
29
  const ref = (0, react_1.useRef)(null);
@@ -95,9 +95,11 @@ const InfoBubble = ({ title, children }) => {
95
95
  position: 'fixed',
96
96
  bottom: size.windowSize.height - size.top,
97
97
  }),
98
- left: size.left,
98
+ ...(horizontalAlignment === 'left'
99
+ ? { left: size.left }
100
+ : { right: size.windowSize.width - (size.left + size.width) }),
99
101
  };
100
- }, [layout, opened, size]);
102
+ }, [horizontalAlignment, layout, opened, size]);
101
103
  const style = (0, react_1.useMemo)(() => {
102
104
  return {
103
105
  ...container,
@@ -112,7 +114,7 @@ const InfoBubble = ({ title, children }) => {
112
114
  }, []);
113
115
  return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
114
116
  jsx_runtime_1.jsx("button", { ref: ref, tabIndex: tabIndex, style: style, title: title, type: "button", children: jsx_runtime_1.jsx("svg", { style: icon, viewBox: "0 0 512 512", children: jsx_runtime_1.jsx("path", { fill: hovered ? colors_1.WHITE : colors_1.LIGHT_TEXT, d: "M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM216 336c-13.3 0-24 10.7-24 24s10.7 24 24 24h80c13.3 0 24-10.7 24-24s-10.7-24-24-24h-8V248c0-13.3-10.7-24-24-24H216c-13.3 0-24 10.7-24 24s10.7 24 24 24h24v64H216zm40-144a32 32 0 1 0 0-64 32 32 0 1 0 0 64z" }) }) }), portalStyle
115
- ? react_dom_1.default.createPortal(jsx_runtime_1.jsx("div", { style: styles_1.outerPortal, className: "css-reset", children: jsx_runtime_1.jsx(z_index_1.HigherZIndex, { onOutsideClick: onHide, onEscape: onHide, children: jsx_runtime_1.jsx("div", { style: portalStyle, children: jsx_runtime_1.jsx(InfoTooltip_1.InfoTooltip, { backgroundColor: colors_1.INPUT_BACKGROUND, arrowDirection: layout, children: children }) }) }) }), (0, portals_1.getPortal)(currentZIndex))
117
+ ? react_dom_1.default.createPortal(jsx_runtime_1.jsx("div", { style: styles_1.outerPortal, className: "css-reset", children: jsx_runtime_1.jsx(z_index_1.HigherZIndex, { onOutsideClick: onHide, onEscape: onHide, children: jsx_runtime_1.jsx("div", { style: portalStyle, children: jsx_runtime_1.jsx(InfoTooltip_1.InfoTooltip, { backgroundColor: colors_1.INPUT_BACKGROUND, arrowDirection: layout, horizontalAlignment: horizontalAlignment, children: children }) }) }) }), (0, portals_1.getPortal)(currentZIndex))
116
118
  : null] }));
117
119
  };
118
120
  exports.InfoBubble = InfoBubble;
@@ -3,4 +3,5 @@ export declare const InfoTooltip: React.FC<{
3
3
  readonly children: React.ReactNode;
4
4
  readonly arrowDirection: 'up' | 'down';
5
5
  readonly backgroundColor: string;
6
+ readonly horizontalAlignment: 'left' | 'right';
6
7
  }>;
@@ -10,17 +10,8 @@ const arrow = {
10
10
  height: 7,
11
11
  display: 'block',
12
12
  overflow: 'visible',
13
- marginLeft: 7,
14
13
  };
15
- const arrowUp = {
16
- ...arrow,
17
- transform: `translateY(1px)`,
18
- };
19
- const arrowDown = {
20
- ...arrow,
21
- marginTop: -1,
22
- };
23
- const InfoTooltip = ({ children, arrowDirection, backgroundColor }) => {
14
+ const InfoTooltip = ({ children, arrowDirection, backgroundColor, horizontalAlignment }) => {
24
15
  const container = (0, react_1.useMemo)(() => {
25
16
  return {
26
17
  boxShadow: arrowDirection === 'down' ? styles_1.SHADOW_TOWARDS_TOP : styles_1.SHADOW_TOWARDS_BOTTOM,
@@ -32,11 +23,20 @@ const InfoTooltip = ({ children, arrowDirection, backgroundColor }) => {
32
23
  borderRadius: '4px',
33
24
  };
34
25
  }, [arrowDirection, backgroundColor]);
26
+ const arrowStyle = (0, react_1.useMemo)(() => {
27
+ return {
28
+ ...arrow,
29
+ ...(horizontalAlignment === 'left' ? { marginLeft: 7 } : { marginRight: 7 }),
30
+ ...(arrowDirection === 'up'
31
+ ? { transform: `translateY(1px)` }
32
+ : { marginTop: -1 }),
33
+ };
34
+ }, [arrowDirection, horizontalAlignment]);
35
35
  return (jsx_runtime_1.jsxs("div", { style: {
36
36
  display: 'flex',
37
37
  flexDirection: arrowDirection === 'up' ? 'column-reverse' : 'column',
38
- alignItems: 'flex-start',
38
+ alignItems: horizontalAlignment === 'left' ? 'flex-start' : 'flex-end',
39
39
  }, children: [
40
- jsx_runtime_1.jsx("div", { style: container, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: children }), arrowDirection === 'down' ? (jsx_runtime_1.jsx("svg", { viewBox: "0 0 14 7", style: arrowDown, children: jsx_runtime_1.jsx("path", { d: `M 14 0 L 7 7 L 0 0`, fill: backgroundColor, strokeLinecap: "butt", stroke: colors_1.BLACK_HEX, strokeWidth: 0.5 }) })) : null, arrowDirection === 'up' ? (jsx_runtime_1.jsx("svg", { viewBox: "0 0 14 7", style: arrowUp, children: jsx_runtime_1.jsx("path", { d: `M 0 7 L 7 0 L 14 7`, fill: backgroundColor, strokeLinecap: "butt", stroke: colors_1.BLACK_HEX, strokeWidth: 0.5 }) })) : null] }));
40
+ jsx_runtime_1.jsx("div", { style: container, className: is_menu_item_1.VERTICAL_SCROLLBAR_CLASSNAME, children: children }), arrowDirection === 'down' ? (jsx_runtime_1.jsx("svg", { viewBox: "0 0 14 7", style: arrowStyle, children: jsx_runtime_1.jsx("path", { d: `M 14 0 L 7 7 L 0 0`, fill: backgroundColor, strokeLinecap: "butt", stroke: colors_1.BLACK_HEX, strokeWidth: 0.5 }) })) : null, arrowDirection === 'up' ? (jsx_runtime_1.jsx("svg", { viewBox: "0 0 14 7", style: arrowStyle, children: jsx_runtime_1.jsx("path", { d: `M 0 7 L 7 0 L 14 7`, fill: backgroundColor, strokeLinecap: "butt", stroke: colors_1.BLACK_HEX, strokeWidth: 0.5 }) })) : null] }));
41
41
  };
42
42
  exports.InfoTooltip = InfoTooltip;
@@ -1,9 +1,14 @@
1
1
  import React from 'react';
2
2
  import type { JSONPath } from './zod-types';
3
+ export declare const SchemaDescriptionOverrideContext: React.Context<{
4
+ readonly jsonPath: JSONPath;
5
+ readonly description: string;
6
+ } | null>;
3
7
  export declare const SchemaLabel: React.FC<{
4
8
  readonly jsonPath: JSONPath;
5
9
  readonly onRemove: null | (() => void);
6
10
  readonly valid: boolean;
7
11
  readonly suffix: string | null;
8
12
  readonly handleClick: null | (() => void);
13
+ readonly description: string | null;
9
14
  }>;
@@ -1,13 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SchemaLabel = void 0;
3
+ exports.SchemaLabel = exports.SchemaDescriptionOverrideContext = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const colors_1 = require("../../../helpers/colors");
7
7
  const layout_1 = require("../../layout");
8
+ const InfoBubble_1 = require("../InfoBubble");
8
9
  const InlineRemoveButton_1 = require("../InlineRemoveButton");
9
10
  const get_schema_label_1 = require("./get-schema-label");
10
11
  const scroll_to_default_props_path_1 = require("./scroll-to-default-props-path");
12
+ exports.SchemaDescriptionOverrideContext = (0, react_1.createContext)(null);
11
13
  const compactStyles = {
12
14
  fontSize: 12,
13
15
  color: colors_1.LIGHT_TEXT,
@@ -17,8 +19,19 @@ const compactStyles = {
17
19
  alignItems: 'center',
18
20
  flex: 1,
19
21
  };
20
- const SchemaLabel = ({ jsonPath, onRemove, valid, suffix, handleClick }) => {
22
+ const descriptionStyle = {
23
+ fontSize: 12,
24
+ maxWidth: 360,
25
+ overflowWrap: 'anywhere',
26
+ padding: 10,
27
+ };
28
+ const SchemaLabel = ({ jsonPath, onRemove, valid, suffix, handleClick, description }) => {
21
29
  const [clickableButtonHovered, setClickableButtonHovered] = (0, react_1.useState)(false);
30
+ const descriptionOverride = (0, react_1.useContext)(exports.SchemaDescriptionOverrideContext);
31
+ const displayedDescription = (descriptionOverride === null || descriptionOverride === void 0 ? void 0 : descriptionOverride.jsonPath.length) === jsonPath.length &&
32
+ descriptionOverride.jsonPath.every((part, index) => part === jsonPath[index])
33
+ ? descriptionOverride.description
34
+ : description;
22
35
  const labelStyle = (0, react_1.useMemo)(() => {
23
36
  return {
24
37
  fontFamily: 'monospace',
@@ -36,6 +49,6 @@ const SchemaLabel = ({ jsonPath, onRemove, valid, suffix, handleClick }) => {
36
49
  const labelContent = (jsx_runtime_1.jsxs("span", { style: labelStyle, children: [(0, get_schema_label_1.getSchemaLabel)(jsonPath), " ", suffix ? suffix : null] }));
37
50
  return (jsx_runtime_1.jsxs("div", { style: compactStyles, className: scroll_to_default_props_path_1.DEFAULT_PROPS_PATH_CLASSNAME, "data-json-path": jsonPath.join('.'), children: [handleClick ? (
38
51
  // Minus the padding that a button has (user agent padding-line-start)
39
- jsx_runtime_1.jsx("button", { onPointerEnter: onClickablePointerEnter, onPointerLeave: onClickablePointerLeave, type: "button", onClick: handleClick, style: { border: 'none', padding: 0 }, children: labelContent })) : (labelContent), jsx_runtime_1.jsx(layout_1.Flex, {}), onRemove ? jsx_runtime_1.jsx(InlineRemoveButton_1.InlineRemoveButton, { onClick: onRemove }) : null] }));
52
+ jsx_runtime_1.jsx("button", { onPointerEnter: onClickablePointerEnter, onPointerLeave: onClickablePointerLeave, type: "button", onClick: handleClick, style: { border: 'none', padding: 0 }, children: labelContent })) : (labelContent), displayedDescription ? (jsx_runtime_1.jsx(InfoBubble_1.InfoBubble, { title: "Field description", horizontalAlignment: "right", children: jsx_runtime_1.jsx("div", { style: descriptionStyle, children: displayedDescription }) })) : null, jsx_runtime_1.jsx(layout_1.Flex, {}), onRemove ? jsx_runtime_1.jsx(InlineRemoveButton_1.InlineRemoveButton, { onClick: onRemove }) : null] }));
40
53
  };
41
54
  exports.SchemaLabel = SchemaLabel;
@@ -63,7 +63,7 @@ const ZodArrayEditor = ({ schema, jsonPath, setValue, value, onRemove, mayPad })
63
63
  jsx_runtime_1.jsx("div", { style: {
64
64
  display: 'flex',
65
65
  flexDirection: 'row',
66
- }, children: jsx_runtime_1.jsx(SchemaLabel_1.SchemaLabel, { jsonPath: jsonPath, onRemove: onRemove, suffix: suffix, valid: zodValidation.success, handleClick: () => setExpanded(!expanded) }) }), expanded ? (jsx_runtime_1.jsxs(SchemaVerticalGuide_1.SchemaVerticalGuide, { isRoot: false, children: [value.map((child, i) => {
66
+ }, children: jsx_runtime_1.jsx(SchemaLabel_1.SchemaLabel, { jsonPath: jsonPath, onRemove: onRemove, suffix: suffix, description: (0, zod_schema_type_1.getUserFacingDescription)(schema), valid: zodValidation.success, handleClick: () => setExpanded(!expanded) }) }), expanded ? (jsx_runtime_1.jsxs(SchemaVerticalGuide_1.SchemaVerticalGuide, { isRoot: false, children: [value.map((child, i) => {
67
67
  return (
68
68
  // eslint-disable-next-line react/no-array-index-key
69
69
  jsx_runtime_1.jsxs(react_1.default.Fragment, { children: [
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import { type AnyZodSchema } from './zod-schema-type';
2
3
  import type { JSONPath } from './zod-types';
3
4
  import type { UpdaterFunction } from './ZodSwitch';
4
5
  export declare const ZodBooleanEditor: React.FC<{
@@ -7,4 +8,5 @@ export declare const ZodBooleanEditor: React.FC<{
7
8
  readonly setValue: UpdaterFunction<boolean>;
8
9
  readonly onRemove: null | (() => void);
9
10
  readonly mayPad: boolean;
11
+ readonly schema: AnyZodSchema;
10
12
  }>;
@@ -6,15 +6,16 @@ const react_1 = require("react");
6
6
  const Checkbox_1 = require("../../Checkbox");
7
7
  const Fieldset_1 = require("./Fieldset");
8
8
  const SchemaLabel_1 = require("./SchemaLabel");
9
+ const zod_schema_type_1 = require("./zod-schema-type");
9
10
  const fullWidth = {
10
11
  width: '100%',
11
12
  };
12
- const ZodBooleanEditor = ({ jsonPath, value, setValue, onRemove, mayPad }) => {
13
+ const ZodBooleanEditor = ({ jsonPath, value, setValue, onRemove, mayPad, schema }) => {
13
14
  const onToggle = (0, react_1.useCallback)((e) => {
14
15
  setValue(() => e.target.checked, { shouldSave: true });
15
16
  }, [setValue]);
16
17
  return (jsx_runtime_1.jsxs(Fieldset_1.Fieldset, { shouldPad: mayPad, children: [
17
- jsx_runtime_1.jsx(SchemaLabel_1.SchemaLabel, { handleClick: null, jsonPath: jsonPath, onRemove: onRemove, valid: true, suffix: null }), jsx_runtime_1.jsx("div", { style: fullWidth, children: jsx_runtime_1.jsx(Checkbox_1.Checkbox, { name: jsonPath.join('.'), checked: value, onChange: onToggle, disabled: false }) })
18
+ jsx_runtime_1.jsx(SchemaLabel_1.SchemaLabel, { handleClick: null, jsonPath: jsonPath, onRemove: onRemove, valid: true, suffix: null, description: (0, zod_schema_type_1.getUserFacingDescription)(schema) }), jsx_runtime_1.jsx("div", { style: fullWidth, children: jsx_runtime_1.jsx(Checkbox_1.Checkbox, { name: jsonPath.join('.'), checked: value, onChange: onToggle, disabled: false }) })
18
19
  ] }));
19
20
  };
20
21
  exports.ZodBooleanEditor = ZodBooleanEditor;
@@ -30,7 +30,7 @@ const ZodColorEditor = ({ jsonPath, value, setValue, schema, onRemove, mayPad })
30
30
  }, [setValue, value]);
31
31
  const status = localValue.success ? 'ok' : 'error';
32
32
  return (jsx_runtime_1.jsxs(Fieldset_1.Fieldset, { shouldPad: mayPad, children: [
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: [
33
+ jsx_runtime_1.jsx(SchemaLabel_1.SchemaLabel, { handleClick: null, jsonPath: jsonPath, onRemove: onRemove, valid: localValue.success, suffix: null, description: (0, zod_schema_type_1.getUserFacingDescription)(schema) }), jsx_runtime_1.jsxs("div", { style: fullWidth, children: [
34
34
  jsx_runtime_1.jsxs(layout_1.Row, { align: "center", children: [
35
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 })
@@ -54,7 +54,7 @@ const ZodDateEditor = ({ jsonPath, value, setValue, schema, onRemove, mayPad })
54
54
  }, [setValue]);
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
- 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: [
57
+ jsx_runtime_1.jsx(SchemaLabel_1.SchemaLabel, { handleClick: null, jsonPath: jsonPath, onRemove: onRemove, valid: zodValidation.success, suffix: null, description: (0, zod_schema_type_1.getUserFacingDescription)(schema) }), jsx_runtime_1.jsxs("div", { style: fullWidth, children: [
58
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
  ] }));
@@ -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], size: "small" })
50
+ jsx_runtime_1.jsx(SchemaLabel_1.SchemaLabel, { handleClick: null, jsonPath: [...jsonPath, discriminator], onRemove: onRemove, suffix: null, description: (0, zod_schema_type_1.getUserFacingDescription)(schema), valid: zodValidation.success }), jsx_runtime_1.jsx(ComboBox_1.Combobox, { title: "Select type", values: comboBoxValues, selectedId: value[discriminator], size: "small" })
51
51
  ] }, 'replacement')),
52
52
  };
53
53
  }, [
@@ -56,6 +56,7 @@ const ZodDiscriminatedUnionEditor = ({ schema, setValue, value, mayPad, jsonPath
56
56
  mayPad,
57
57
  onRemove,
58
58
  discriminator,
59
+ schema,
59
60
  value,
60
61
  zodValidation.success,
61
62
  ]);
@@ -39,7 +39,7 @@ const ZodEnumEditor = ({ schema, jsonPath, setValue, value, onRemove, mayPad })
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: mayPad, 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, size: "small" }) }), 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, description: (0, zod_schema_type_1.getUserFacingDescription)(schema) }), jsx_runtime_1.jsx("div", { style: isRoot ? undefined : container, children: jsx_runtime_1.jsx(ComboBox_1.Combobox, { values: comboBoxValues, selectedId: value, title: value, size: "small" }) }), jsx_runtime_1.jsx(ZodFieldValidation_1.ZodFieldValidation, { path: jsonPath, zodValidation: zodValidation })
43
43
  ] }));
44
44
  };
45
45
  exports.ZodEnumEditor = ZodEnumEditor;
@@ -78,7 +78,7 @@ const ZodMatrixEditor = ({ schema, jsonPath, setValue, value, onRemove, mayPad }
78
78
  }, []);
79
79
  }, [value, dimensions]);
80
80
  return (jsx_runtime_1.jsxs(Fieldset_1.Fieldset, { shouldPad: mayPad, children: [
81
- jsx_runtime_1.jsx(SchemaLabel_1.SchemaLabel, { jsonPath: jsonPath, onRemove: onRemove, suffix: suffix, valid: zodValidation.success, handleClick: () => setExpanded(!expanded) }), expanded ? (jsx_runtime_1.jsxs(SchemaVerticalGuide_1.SchemaVerticalGuide, { isRoot: false, children: [chunkedItems.map((row, rowIndex) => {
81
+ jsx_runtime_1.jsx(SchemaLabel_1.SchemaLabel, { jsonPath: jsonPath, onRemove: onRemove, suffix: suffix, description: (0, zod_schema_type_1.getUserFacingDescription)(schema), valid: zodValidation.success, handleClick: () => setExpanded(!expanded) }), expanded ? (jsx_runtime_1.jsxs(SchemaVerticalGuide_1.SchemaVerticalGuide, { isRoot: false, children: [chunkedItems.map((row, rowIndex) => {
82
82
  return (jsx_runtime_1.jsx(react_1.default.Fragment
83
83
  // eslint-disable-next-line react/no-array-index-key
84
84
  , { children: jsx_runtime_1.jsx("div", { style: rowStyle, children: row.map((item, _index) => {
@@ -21,7 +21,7 @@ const wideEmptyLabel = {
21
21
  };
22
22
  const ZonNonEditableValue = ({ jsonPath, label, mayPad }) => {
23
23
  return (jsx_runtime_1.jsxs(Fieldset_1.Fieldset, { shouldPad: mayPad, children: [
24
- jsx_runtime_1.jsx(SchemaLabel_1.SchemaLabel, { handleClick: null, jsonPath: jsonPath, onRemove: null, valid: true, suffix: null }), jsx_runtime_1.jsx("div", { style: fullWidth, children: jsx_runtime_1.jsx("em", { style: wideEmptyLabel, children: label }) })
24
+ jsx_runtime_1.jsx(SchemaLabel_1.SchemaLabel, { handleClick: null, jsonPath: jsonPath, onRemove: null, valid: true, suffix: null, description: null }), jsx_runtime_1.jsx("div", { style: fullWidth, children: jsx_runtime_1.jsx("em", { style: wideEmptyLabel, children: label }) })
25
25
  ] }));
26
26
  };
27
27
  exports.ZonNonEditableValue = ZonNonEditableValue;
@@ -25,7 +25,7 @@ const ZodNumberEditor = ({ jsonPath, value, schema, setValue, onRemove, mayPad }
25
25
  }, [setValue]);
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
- 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: [
28
+ jsx_runtime_1.jsx(SchemaLabel_1.SchemaLabel, { handleClick: null, jsonPath: jsonPath, onRemove: onRemove, valid: zodValidation.success, suffix: null, description: (0, zod_schema_type_1.getUserFacingDescription)(schema) }), jsx_runtime_1.jsxs("div", { style: fullWidth, children: [
29
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
  ] }));
@@ -60,7 +60,7 @@ const ZodObjectEditor = ({ schema, jsonPath, setValue, value, onRemove, mayPad,
60
60
  return expanded ? ' {' : ' {...}';
61
61
  }, [expanded]);
62
62
  const zodValidation = (0, react_2.useMemo)(() => (0, zod_schema_type_1.zodSafeParse)(schema, value), [schema, value]);
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) => {
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, description: (0, zod_schema_type_1.getUserFacingDescription)(schema), valid: zodValidation.success, handleClick: () => setExpanded(!expanded) })), expanded ? (jsx_runtime_1.jsx(SchemaVerticalGuide_1.SchemaVerticalGuide, { isRoot: isRoot, children: keys.map((key) => {
64
64
  if (discriminatedUnionReplacement &&
65
65
  key === discriminatedUnionReplacement.discriminator) {
66
66
  return discriminatedUnionReplacement.markup;
@@ -25,6 +25,7 @@ const checkBoxWrapper = {
25
25
  marginTop: '5px',
26
26
  };
27
27
  const ZodOrNullishEditor = ({ jsonPath, schema, setValue, value, onRemove, nullishValue, mayPad, innerSchema, }) => {
28
+ var _a;
28
29
  const z = (0, get_zod_if_possible_1.useZodIfPossible)();
29
30
  if (!z) {
30
31
  throw new Error('expected zod');
@@ -32,13 +33,17 @@ const ZodOrNullishEditor = ({ jsonPath, schema, setValue, value, onRemove, nulli
32
33
  const zodTypes = (0, get_zod_if_possible_1.useZodTypesIfPossible)();
33
34
  const isChecked = value === nullishValue;
34
35
  const zodValidation = (0, react_1.useMemo)(() => (0, zod_schema_type_1.zodSafeParse)(schema, value), [schema, value]);
36
+ const description = (0, zod_schema_type_1.getUserFacingDescription)(schema);
37
+ const descriptionOverride = (0, react_1.useMemo)(() => {
38
+ return description ? { jsonPath, description } : null;
39
+ }, [description, jsonPath]);
35
40
  const onCheckBoxChange = (0, react_2.useCallback)((e) => {
36
41
  const val = e.target.checked
37
42
  ? nullishValue
38
43
  : (0, create_zod_values_1.createZodValues)(innerSchema, z, zodTypes);
39
44
  setValue(() => val, { shouldSave: true });
40
45
  }, [innerSchema, nullishValue, setValue, z, zodTypes]);
41
- return (jsx_runtime_1.jsxs(Fieldset_1.Fieldset, { shouldPad: mayPad, children: [value === nullishValue ? (jsx_runtime_1.jsx(SchemaLabel_1.SchemaLabel, { handleClick: null, jsonPath: jsonPath, onRemove: onRemove, valid: zodValidation.success, suffix: null })) : (jsx_runtime_1.jsx(ZodSwitch_1.ZodSwitch, { value: value, setValue: setValue, jsonPath: jsonPath, schema: innerSchema, onRemove: onRemove, mayPad: false })), jsx_runtime_1.jsxs("label", { style: checkBoxWrapper, children: [
46
+ return (jsx_runtime_1.jsxs(Fieldset_1.Fieldset, { shouldPad: mayPad, children: [value === nullishValue ? (jsx_runtime_1.jsx(SchemaLabel_1.SchemaLabel, { handleClick: null, jsonPath: jsonPath, onRemove: onRemove, valid: zodValidation.success, suffix: null, description: (_a = (0, zod_schema_type_1.getUserFacingDescription)(schema)) !== null && _a !== void 0 ? _a : (0, zod_schema_type_1.getUserFacingDescription)(innerSchema) })) : descriptionOverride ? (jsx_runtime_1.jsx(SchemaLabel_1.SchemaDescriptionOverrideContext.Provider, { value: descriptionOverride, children: jsx_runtime_1.jsx(ZodSwitch_1.ZodSwitch, { value: value, setValue: setValue, jsonPath: jsonPath, schema: innerSchema, onRemove: onRemove, mayPad: false }) })) : (jsx_runtime_1.jsx(ZodSwitch_1.ZodSwitch, { value: value, setValue: setValue, jsonPath: jsonPath, schema: innerSchema, onRemove: onRemove, mayPad: false })), jsx_runtime_1.jsxs("label", { style: checkBoxWrapper, children: [
42
47
  jsx_runtime_1.jsx(Checkbox_1.Checkbox, { checked: isChecked, onChange: onCheckBoxChange, disabled: false, name: jsonPath.join('.') }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), jsx_runtime_1.jsxs("code", { style: labelStyle, children: ["<", String(nullishValue), ">"] })
43
48
  ] })
44
49
  ] }));
@@ -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, size: "small" }) }), 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, description: (0, zod_schema_type_1.getUserFacingDescription)(schema) }), jsx_runtime_1.jsx("div", { style: isRoot ? undefined : container, children: jsx_runtime_1.jsx(ComboBox_1.Combobox, { values: comboBoxValues, selectedId: value, title: value, size: "small" }) }), jsx_runtime_1.jsx(ZodFieldValidation_1.ZodFieldValidation, { path: jsonPath, zodValidation: zodValidation })
42
42
  ] }));
43
43
  };
44
44
  exports.ZodStaticFileEditor = ZodStaticFileEditor;
@@ -26,7 +26,7 @@ const ZodStringEditor = ({ jsonPath, value, setValue, schema, onRemove, mayPad }
26
26
  setValue(() => value, { shouldSave: true });
27
27
  }, [setValue, value]);
28
28
  return (jsx_runtime_1.jsxs(Fieldset_1.Fieldset, { shouldPad: mayPad, children: [
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: [
29
+ jsx_runtime_1.jsx(SchemaLabel_1.SchemaLabel, { handleClick: null, jsonPath: jsonPath, onRemove: onRemove, valid: zodValidation.success, suffix: null, description: (0, zod_schema_type_1.getUserFacingDescription)(schema) }), jsx_runtime_1.jsxs("div", { style: fullWidth, children: [
30
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
  ] }));
@@ -52,7 +52,7 @@ const ZodSwitch = ({ schema, jsonPath, value, setValue, onRemove, mayPad }) => {
52
52
  return (jsx_runtime_1.jsx(ZodNumberEditor_1.ZodNumberEditor, { value: value, setValue: setValue, jsonPath: jsonPath, schema: schema, onRemove: onRemove, mayPad: mayPad }));
53
53
  }
54
54
  if (typeName === 'boolean') {
55
- return (jsx_runtime_1.jsx(ZodBooleanEditor_1.ZodBooleanEditor, { value: value, setValue: setValue, jsonPath: jsonPath, onRemove: onRemove, mayPad: mayPad }));
55
+ return (jsx_runtime_1.jsx(ZodBooleanEditor_1.ZodBooleanEditor, { value: value, setValue: setValue, jsonPath: jsonPath, onRemove: onRemove, mayPad: mayPad, schema: schema }));
56
56
  }
57
57
  if (typeName === 'undefined') {
58
58
  return (jsx_runtime_1.jsx(ZodNonEditableValue_1.ZonNonEditableValue, { jsonPath: jsonPath, label: 'undefined', mayPad: mayPad }));
@@ -66,7 +66,7 @@ const ZodTextareaEditor = ({ jsonPath, value, setValue, schema, onRemove, mayPad
66
66
  }, [setValue, value]);
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
- 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: [
69
+ jsx_runtime_1.jsx(SchemaLabel_1.SchemaLabel, { handleClick: null, jsonPath: jsonPath, onRemove: onRemove, valid: zodValidation.success, suffix: null, description: (0, zod_schema_type_1.getUserFacingDescription)(schema) }), jsx_runtime_1.jsxs("div", { style: fullWidth, children: [
70
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
  ] }));
@@ -63,7 +63,7 @@ const ZodTupleEditor = ({ schema, jsonPath, setValue, value, onRemove, mayPad })
63
63
  jsx_runtime_1.jsx("div", { style: {
64
64
  display: 'flex',
65
65
  flexDirection: 'row',
66
- }, children: jsx_runtime_1.jsx(SchemaLabel_1.SchemaLabel, { jsonPath: jsonPath, onRemove: onRemove, suffix: suffix, valid: zodValidation.success, handleClick: () => setExpanded(!expanded) }) }), expanded ? (jsx_runtime_1.jsxs(SchemaVerticalGuide_1.SchemaVerticalGuide, { isRoot: false, children: [value.map((child, i) => {
66
+ }, children: jsx_runtime_1.jsx(SchemaLabel_1.SchemaLabel, { jsonPath: jsonPath, onRemove: onRemove, suffix: suffix, description: (0, zod_schema_type_1.getUserFacingDescription)(schema), valid: zodValidation.success, handleClick: () => setExpanded(!expanded) }) }), expanded ? (jsx_runtime_1.jsxs(SchemaVerticalGuide_1.SchemaVerticalGuide, { isRoot: false, children: [value.map((child, i) => {
67
67
  return (
68
68
  // eslint-disable-next-line react/no-array-index-key
69
69
  jsx_runtime_1.jsxs(react_1.default.Fragment, { children: [
@@ -63,6 +63,7 @@ export declare const getZodSchemaType: (schema: AnyZodSchema) => ZodSchemaType;
63
63
  * v4: schema.description
64
64
  */
65
65
  export declare const getZodSchemaDescription: (schema: AnyZodSchema) => string | undefined;
66
+ export declare const getUserFacingDescription: (schema: AnyZodSchema) => string | null;
66
67
  /**
67
68
  * Get the shape of an object schema.
68
69
  * v3: _def.shape() (function)
@@ -9,7 +9,7 @@
9
9
  * and accessor helpers that abstract v3/v4 `_def` property differences.
10
10
  */
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.getBrandedInner = exports.getPipelineInput = exports.getPipelineOutput = exports.getRecordKeyType = exports.getRecordValueType = exports.getTupleItems = exports.getIntersectionSchemas = exports.getDiscriminatedOption = exports.getDiscriminatedOptionKeys = exports.getDiscriminator = exports.getDefaultValue = exports.getUnionOptions = exports.getFirstEnumValue = exports.getEnumValues = exports.getLiteralValue = exports.getEffectsInner = exports.getInnerType = exports.getArrayElement = exports.getObjectShape = exports.getZodSchemaDescription = exports.getZodSchemaType = exports.isZodV3Schema = exports.getZodDef = exports.zodSafeParse = void 0;
12
+ exports.getBrandedInner = exports.getPipelineInput = exports.getPipelineOutput = exports.getRecordKeyType = exports.getRecordValueType = exports.getTupleItems = exports.getIntersectionSchemas = exports.getDiscriminatedOption = exports.getDiscriminatedOptionKeys = exports.getDiscriminator = exports.getDefaultValue = exports.getUnionOptions = exports.getFirstEnumValue = exports.getEnumValues = exports.getLiteralValue = exports.getEffectsInner = exports.getInnerType = exports.getArrayElement = exports.getObjectShape = exports.getUserFacingDescription = exports.getZodSchemaDescription = exports.getZodSchemaType = exports.isZodV3Schema = exports.getZodDef = exports.zodSafeParse = void 0;
13
13
  /**
14
14
  * Call safeParse on any Zod schema (v3 or v4).
15
15
  * All Zod schemas have safeParse at runtime, but some v4 internal types
@@ -106,6 +106,17 @@ const getZodSchemaDescription = (schema) => {
106
106
  return schema.description;
107
107
  };
108
108
  exports.getZodSchemaDescription = getZodSchemaDescription;
109
+ // Branded types (zColor(), zTextarea(), zMatrix()) store their marker in the
110
+ // description, so those must not surface as user-facing text.
111
+ const REMOTION_BRAND_PREFIX = '__remotion-';
112
+ const getUserFacingDescription = (schema) => {
113
+ const description = (0, exports.getZodSchemaDescription)(schema);
114
+ if (!description || description.startsWith(REMOTION_BRAND_PREFIX)) {
115
+ return null;
116
+ }
117
+ return description;
118
+ };
119
+ exports.getUserFacingDescription = getUserFacingDescription;
109
120
  /**
110
121
  * Get the shape of an object schema.
111
122
  * v3: _def.shape() (function)
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import type { SelectedOutline } from './selected-outline-geometry';
3
+ import { type SelectedOutlineLayoutTarget, type SelectedOutlineTarget } from './selected-outline-types';
4
+ export declare const SelectedOutlineCanvasRotation: React.FC<{
5
+ readonly getLatestTargetByKey: (key: string) => SelectedOutlineTarget | undefined;
6
+ readonly layoutTarget: SelectedOutlineLayoutTarget;
7
+ readonly onDraggingChange: (dragging: boolean) => void;
8
+ readonly outline: SelectedOutline;
9
+ }>;