@remotion/studio 4.0.497 → 4.0.499

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 (84) hide show
  1. package/dist/components/AssetSelectorItem.js +31 -3
  2. package/dist/components/Canvas.js +162 -7
  3. package/dist/components/Checkbox.js +1 -1
  4. package/dist/components/CompositionSelector.js +13 -10
  5. package/dist/components/CompositionSelectorItem.js +21 -13
  6. package/dist/components/ConfigureLicenseModal.d.ts +4 -0
  7. package/dist/components/ConfigureLicenseModal.js +194 -0
  8. package/dist/components/Editor.d.ts +0 -1
  9. package/dist/components/Editor.js +2 -3
  10. package/dist/components/EditorContent.js +1 -1
  11. package/dist/components/EditorRuler/Ruler.js +5 -3
  12. package/dist/components/ForceSpecificCursor.js +13 -1
  13. package/dist/components/InspectorPanel/CompositionInspector.js +2 -1
  14. package/dist/components/InspectorPanel/SequenceSelectionInspector.js +4 -4
  15. package/dist/components/InspectorPanel/use-composition-actions.js +1 -1
  16. package/dist/components/LicenseKeyValidation.d.ts +17 -0
  17. package/dist/components/LicenseKeyValidation.js +113 -0
  18. package/dist/components/Modals.js +2 -1
  19. package/dist/components/NewComposition/InputDragger.d.ts +27 -0
  20. package/dist/components/NewComposition/InputDragger.js +151 -23
  21. package/dist/components/RenderButton.js +0 -1
  22. package/dist/components/RenderModal/WebRenderModal.js +14 -8
  23. package/dist/components/SelectedOutlineOverlay.js +1 -1
  24. package/dist/components/Splitter/SplitterContainer.d.ts +2 -0
  25. package/dist/components/Splitter/SplitterContainer.js +5 -1
  26. package/dist/components/Splitter/SplitterContext.d.ts +2 -0
  27. package/dist/components/Splitter/SplitterContext.js +2 -0
  28. package/dist/components/Splitter/SplitterElement.js +6 -1
  29. package/dist/components/Splitter/SplitterHandle.js +27 -2
  30. package/dist/components/Timeline/MaxTimelineTracks.d.ts +0 -1
  31. package/dist/components/Timeline/MaxTimelineTracks.js +3 -3
  32. package/dist/components/Timeline/Timeline.js +10 -9
  33. package/dist/components/Timeline/TimelineDragHandler.js +1 -1
  34. package/dist/components/Timeline/TimelineInOutDragHandler.js +25 -1
  35. package/dist/components/Timeline/TimelineLayerEye.js +4 -1
  36. package/dist/components/Timeline/TimelineSelection.js +1 -1
  37. package/dist/components/Timeline/TimelineSequence.js +12 -7
  38. package/dist/components/Timeline/TimelineSequenceItem.js +5 -5
  39. package/dist/components/Timeline/TimelineSequenceName.js +1 -0
  40. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +13 -1
  41. package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +68 -12
  42. package/dist/components/Timeline/call-update-keyframe-settings.d.ts +17 -0
  43. package/dist/components/Timeline/call-update-keyframe-settings.js +43 -1
  44. package/dist/components/Timeline/update-selected-easing.js +26 -23
  45. package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.d.ts +5 -0
  46. package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.js +16 -9
  47. package/dist/components/Timeline/use-timeline-asset-drop.js +1 -1
  48. package/dist/components/Timeline/use-timeline-keyframe-drag.js +6 -4
  49. package/dist/components/TopPanel.js +2 -1
  50. package/dist/components/composition-drop-preview.d.ts +33 -0
  51. package/dist/components/composition-drop-preview.js +67 -0
  52. package/dist/components/drop-handler-data.d.ts +1 -1
  53. package/dist/components/drop-handler-data.js +27 -60
  54. package/dist/components/effect-drag-and-drop.d.ts +1 -1
  55. package/dist/components/effect-drag-and-drop.js +7 -55
  56. package/dist/components/element-drag-and-drop.d.ts +1 -1
  57. package/dist/components/element-drag-and-drop.js +5 -17
  58. package/dist/components/handle-drop.js +0 -1
  59. package/dist/components/import-assets.d.ts +7 -8
  60. package/dist/components/import-assets.js +2 -9
  61. package/dist/esm/{chunk-5wj95bdd.js → chunk-pk1zwsn1.js} +5972 -4763
  62. package/dist/esm/index.mjs +0 -19
  63. package/dist/esm/internals.mjs +5972 -4763
  64. package/dist/esm/previewEntry.mjs +10765 -9556
  65. package/dist/esm/renderEntry.mjs +1 -1
  66. package/dist/helpers/get-effective-translation.d.ts +13 -1
  67. package/dist/helpers/get-effective-translation.js +12 -6
  68. package/dist/helpers/interactivity-enabled.d.ts +1 -1
  69. package/dist/helpers/interactivity-enabled.js +2 -2
  70. package/dist/helpers/retry-payload.js +0 -1
  71. package/dist/helpers/ruler-canvas-size.d.ts +7 -0
  72. package/dist/helpers/ruler-canvas-size.js +14 -1
  73. package/dist/helpers/use-image-metadata.d.ts +1 -0
  74. package/dist/helpers/use-image-metadata.js +8 -5
  75. package/dist/helpers/use-media-metadata.d.ts +1 -0
  76. package/dist/helpers/use-media-metadata.js +8 -5
  77. package/dist/helpers/use-menu-structure.js +9 -3
  78. package/dist/state/modals.d.ts +3 -1
  79. package/dist/visual-controls/VisualControls.js +1 -1
  80. package/package.json +13 -12
  81. package/dist/components/RenderModal/WebRenderModalLicense.d.ts +0 -9
  82. package/dist/components/RenderModal/WebRenderModalLicense.js +0 -189
  83. package/dist/components/RenderModal/WebRenderModalLicenseKeyDetails.d.ts +0 -13
  84. package/dist/components/RenderModal/WebRenderModalLicenseKeyDetails.js +0 -60
@@ -0,0 +1,194 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ConfigureLicenseModal = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const colors_1 = require("../helpers/colors");
7
+ const modals_1 = require("../state/modals");
8
+ const call_api_1 = require("./call-api");
9
+ const Checkbox_1 = require("./Checkbox");
10
+ const layout_1 = require("./layout");
11
+ const LicenseKeyValidation_1 = require("./LicenseKeyValidation");
12
+ const ModalButton_1 = require("./ModalButton");
13
+ const ModalContainer_1 = require("./ModalContainer");
14
+ const ModalFooter_1 = require("./ModalFooter");
15
+ const ModalHeader_1 = require("./ModalHeader");
16
+ const RemInput_1 = require("./NewComposition/RemInput");
17
+ const ValidationMessage_1 = require("./NewComposition/ValidationMessage");
18
+ const content = {
19
+ padding: 16,
20
+ width: 540,
21
+ maxWidth: 'calc(100vw - 40px)',
22
+ };
23
+ const description = {
24
+ color: colors_1.LIGHT_TEXT,
25
+ fontFamily: 'sans-serif',
26
+ fontSize: 14,
27
+ lineHeight: 1.5,
28
+ margin: 0,
29
+ marginTop: 10,
30
+ };
31
+ const descriptionLink = {
32
+ color: colors_1.WHITE,
33
+ fontFamily: 'sans-serif',
34
+ fontSize: 14,
35
+ lineHeight: '21px',
36
+ };
37
+ const checkboxRow = {
38
+ display: 'flex',
39
+ flexDirection: 'row',
40
+ alignItems: 'center',
41
+ cursor: 'pointer',
42
+ marginTop: 5,
43
+ marginBottom: 5,
44
+ };
45
+ const checkboxLabel = {
46
+ color: colors_1.LIGHT_TEXT,
47
+ fontFamily: 'sans-serif',
48
+ fontSize: 14,
49
+ lineHeight: '20px',
50
+ cursor: 'pointer',
51
+ userSelect: 'none',
52
+ };
53
+ const inputLabel = {
54
+ color: colors_1.LIGHT_TEXT,
55
+ display: 'block',
56
+ fontFamily: 'sans-serif',
57
+ fontSize: 13,
58
+ lineHeight: '20px',
59
+ marginBottom: 6,
60
+ marginTop: 10,
61
+ };
62
+ const ConfigureLicenseModal = ({ initialPublicLicenseKey }) => {
63
+ const { setSelectedModal } = (0, react_1.useContext)(modals_1.ModalsContext);
64
+ const initialLicenseType = initialPublicLicenseKey === 'free-license'
65
+ ? 'free'
66
+ : initialPublicLicenseKey === null
67
+ ? null
68
+ : 'company';
69
+ const [licenseType, setLicenseType] = (0, react_1.useState)(initialLicenseType);
70
+ const [companyLicenseKey, setCompanyLicenseKey] = (0, react_1.useState)(initialLicenseType === 'company' ? (initialPublicLicenseKey !== null && initialPublicLicenseKey !== void 0 ? initialPublicLicenseKey : '') : '');
71
+ const [isSubmitting, setIsSubmitting] = (0, react_1.useState)(false);
72
+ const [error, setError] = (0, react_1.useState)(null);
73
+ const [isValidatingLicenseKey, setIsValidatingLicenseKey] = (0, react_1.useState)(false);
74
+ const [remoteValidationMessage, setRemoteValidationMessage] = (0, react_1.useState)(null);
75
+ const [licenseKeyDetails, setLicenseKeyDetails] = (0, react_1.useState)(null);
76
+ const dismiss = (0, react_1.useCallback)(() => {
77
+ setSelectedModal(null);
78
+ }, [setSelectedModal]);
79
+ const chooseFreeLicense = (0, react_1.useCallback)(() => {
80
+ setLicenseType('free');
81
+ setError(null);
82
+ }, []);
83
+ const chooseCompanyLicense = (0, react_1.useCallback)(() => {
84
+ setLicenseType('company');
85
+ setError(null);
86
+ }, []);
87
+ const publicLicenseKey = (0, react_1.useMemo)(() => {
88
+ if (licenseType === 'free') {
89
+ return 'free-license';
90
+ }
91
+ if (licenseType === 'company') {
92
+ return companyLicenseKey.trim();
93
+ }
94
+ return '';
95
+ }, [companyLicenseKey, licenseType]);
96
+ const localLicenseKeyValidation = (0, react_1.useMemo)(() => (0, LicenseKeyValidation_1.validateLicenseKey)(companyLicenseKey.trim()), [companyLicenseKey]);
97
+ (0, react_1.useEffect)(() => {
98
+ let cancelled = false;
99
+ setLicenseKeyDetails(null);
100
+ setRemoteValidationMessage(null);
101
+ if (licenseType !== 'company' || !localLicenseKeyValidation.valid) {
102
+ setIsValidatingLicenseKey(false);
103
+ return () => {
104
+ cancelled = true;
105
+ };
106
+ }
107
+ setIsValidatingLicenseKey(true);
108
+ (0, LicenseKeyValidation_1.fetchLicenseKeyDetails)(companyLicenseKey.trim())
109
+ .then((details) => {
110
+ if (cancelled) {
111
+ return;
112
+ }
113
+ setIsValidatingLicenseKey(false);
114
+ if (details.isValid) {
115
+ setLicenseKeyDetails(details);
116
+ }
117
+ else {
118
+ setRemoteValidationMessage('License key is invalid or has been reset');
119
+ }
120
+ })
121
+ .catch(() => {
122
+ if (cancelled) {
123
+ return;
124
+ }
125
+ setIsValidatingLicenseKey(false);
126
+ setRemoteValidationMessage('Failed to fetch license key details');
127
+ });
128
+ return () => {
129
+ cancelled = true;
130
+ };
131
+ }, [companyLicenseKey, licenseType, localLicenseKeyValidation.valid]);
132
+ const companyLicenseKeyIsValid = localLicenseKeyValidation.valid &&
133
+ (licenseKeyDetails === null || licenseKeyDetails === void 0 ? void 0 : licenseKeyDetails.isValid) === true &&
134
+ !isValidatingLicenseKey;
135
+ const submit = (0, react_1.useCallback)(async () => {
136
+ if (publicLicenseKey.length === 0) {
137
+ setError(licenseType === null
138
+ ? 'Select a license type.'
139
+ : 'Enter your public license key.');
140
+ return;
141
+ }
142
+ if (licenseType === 'company' && !companyLicenseKeyIsValid) {
143
+ return;
144
+ }
145
+ setIsSubmitting(true);
146
+ setError(null);
147
+ try {
148
+ const response = await (0, call_api_1.callApi)('/api/update-public-license', {
149
+ publicLicenseKey,
150
+ });
151
+ if (!response.success) {
152
+ setError(response.reason);
153
+ setIsSubmitting(false);
154
+ return;
155
+ }
156
+ dismiss();
157
+ }
158
+ catch (err) {
159
+ setError(err.message);
160
+ setIsSubmitting(false);
161
+ }
162
+ }, [companyLicenseKeyIsValid, dismiss, licenseType, publicLicenseKey]);
163
+ return (jsx_runtime_1.jsxs(ModalContainer_1.ModalContainer, { onEscape: dismiss, onOutsideClick: dismiss, children: [
164
+ jsx_runtime_1.jsx(ModalHeader_1.ModalHeader, { title: "Configure License", onClose: dismiss }), jsx_runtime_1.jsxs("div", { style: content, children: [
165
+ jsx_runtime_1.jsxs("p", { style: description, children: ["Remotion is free if you are an individual or company with a headcount of 3 or less. See", ' ', jsx_runtime_1.jsx("a", { style: descriptionLink, href: "https://remotion.dev/license", children: "LICENSE.md" }),
166
+ "."] }), jsx_runtime_1.jsx(layout_1.Spacing, { y: 2 }), jsx_runtime_1.jsxs("div", { style: checkboxRow, onClick: chooseFreeLicense, children: [
167
+ jsx_runtime_1.jsx(Checkbox_1.Checkbox, { checked: licenseType === 'free', onChange: chooseFreeLicense, name: "free-license", rounded: true }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), jsx_runtime_1.jsx("div", { style: checkboxLabel, children: "I am eligible for the Free License" })
168
+ ] }), jsx_runtime_1.jsxs("div", { style: checkboxRow, onClick: chooseCompanyLicense, children: [
169
+ jsx_runtime_1.jsx(Checkbox_1.Checkbox, { checked: licenseType === 'company', onChange: chooseCompanyLicense, name: "company-license", rounded: true }), jsx_runtime_1.jsx(layout_1.Spacing, { x: 1 }), jsx_runtime_1.jsx("div", { style: checkboxLabel, children: "I need a Company License" })
170
+ ] }), licenseType === 'company' ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
171
+ jsx_runtime_1.jsxs("p", { style: description, children: ["Visit", ' ', jsx_runtime_1.jsx("a", { style: descriptionLink, href: "https://remotion.pro/license", children: "remotion.pro/license" }), ' ', "to obtain a license key. Enter the public license key from", ' "License Keys".'] }), jsx_runtime_1.jsxs("label", { style: inputLabel, children: ["Public license key",
172
+ jsx_runtime_1.jsx(RemInput_1.RemotionInput, { status: localLicenseKeyValidation.message ||
173
+ remoteValidationMessage ||
174
+ (licenseKeyDetails !== null &&
175
+ !(0, LicenseKeyValidation_1.hasActiveCompanyLicense)(licenseKeyDetails))
176
+ ? 'error'
177
+ : 'ok', rightAlign: false, value: companyLicenseKey, onChange: (event) => {
178
+ setCompanyLicenseKey(event.target.value);
179
+ setError(null);
180
+ }, placeholder: "rm_pub_...", autoFocus: true })
181
+ ] }), localLicenseKeyValidation.message ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
182
+ jsx_runtime_1.jsx(layout_1.Spacing, { y: 1 }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { message: localLicenseKeyValidation.message, align: "flex-start", type: "error" })
183
+ ] })) : null, remoteValidationMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
184
+ jsx_runtime_1.jsx(layout_1.Spacing, { y: 1 }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { message: remoteValidationMessage, align: "flex-start", type: "error" })
185
+ ] })) : null, isValidatingLicenseKey ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
186
+ jsx_runtime_1.jsx(layout_1.Spacing, { y: 1 }), jsx_runtime_1.jsx("p", { style: description, children: "Loading license key details..." })
187
+ ] })) : null, licenseKeyDetails ? (jsx_runtime_1.jsx(LicenseKeyValidation_1.LicenseKeyDetailsDisplay, { details: licenseKeyDetails })) : null] })) : null, error ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
188
+ jsx_runtime_1.jsx(layout_1.Spacing, { y: 1.5 }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { message: error, align: "flex-start", type: "error" })
189
+ ] })) : null] }), jsx_runtime_1.jsx(ModalFooter_1.ModalFooterContainer, { children: jsx_runtime_1.jsx(layout_1.Row, { justify: "flex-end", children: jsx_runtime_1.jsx(ModalButton_1.ModalButton, { onClick: submit, disabled: isSubmitting ||
190
+ publicLicenseKey.length === 0 ||
191
+ (licenseType === 'company' && !companyLicenseKeyIsValid), autoFocus: licenseType !== 'company', children: isSubmitting ? 'Submitting...' : 'Submit and reload' }) }) })
192
+ ] }));
193
+ };
194
+ exports.ConfigureLicenseModal = ConfigureLicenseModal;
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- export declare const BUFFER_STATE_DELAY_IN_MILLISECONDS: number;
3
2
  export declare const Editor: React.FC<{
4
3
  readonly Root: React.FC;
5
4
  readonly readOnlyStudio: boolean;
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.Editor = exports.BUFFER_STATE_DELAY_IN_MILLISECONDS = void 0;
36
+ exports.Editor = void 0;
37
37
  const jsx_runtime_1 = require("react/jsx-runtime");
38
38
  const player_1 = require("@remotion/player");
39
39
  const react_1 = __importStar(require("react"));
@@ -63,7 +63,6 @@ const background = {
63
63
  flexDirection: 'column',
64
64
  position: 'absolute',
65
65
  };
66
- exports.BUFFER_STATE_DELAY_IN_MILLISECONDS = (0, studio_runtime_config_1.getStudioBufferStateDelayInMilliseconds)();
67
66
  const Editor = ({ Root, readOnlyStudio }) => {
68
67
  const [drawElement, setDrawElement] = (0, react_1.useState)(null);
69
68
  const size = player_1.PlayerInternals.useElementSize(drawElement, {
@@ -98,7 +97,7 @@ const Editor = ({ Root, readOnlyStudio }) => {
98
97
  const editor = (jsx_runtime_1.jsx(z_index_1.HigherZIndex, { onEscape: noop_1.noop, onOutsideClick: noop_1.noop, children: jsx_runtime_1.jsx(timeline_zoom_1.TimelineZoomContext, { children: jsx_runtime_1.jsxs(SequencePropsSubscriptionProvider_1.SequencePropsSubscriptionProvider, { children: [
99
98
  jsx_runtime_1.jsxs(remotion_1.Internals.CurrentScaleContext.Provider, { value: value, children: [
100
99
  jsx_runtime_1.jsx(ForceSpecificCursor_1.ForceSpecificCursor, {}), jsx_runtime_1.jsx(scale_lock_1.ScaleLockProvider, { children: jsx_runtime_1.jsxs("div", { style: background, children: [
101
- jsx_runtime_1.jsx(remotion_1.Internals.CompositionRenderErrorContext.Provider, { value: compositionRenderErrorContextValue, children: canvasMounted ? jsx_runtime_1.jsx(MemoRoot, {}) : null }), jsx_runtime_1.jsx(remotion_1.Internals.CanUseRemotionHooksProvider, { children: jsx_runtime_1.jsx(RenderErrorContext_1.RenderErrorContext.Provider, { value: renderErrorContextValue, children: jsx_runtime_1.jsx(EditorContent_1.EditorContent, { readOnlyStudio: readOnlyStudio, children: jsx_runtime_1.jsx(TopPanel_1.TopPanel, { drawRef: setDrawRef, bufferStateDelayInMilliseconds: exports.BUFFER_STATE_DELAY_IN_MILLISECONDS, onMounted: onMounted, readOnlyStudio: readOnlyStudio }) }) }) })
100
+ jsx_runtime_1.jsx(remotion_1.Internals.CompositionRenderErrorContext.Provider, { value: compositionRenderErrorContextValue, children: canvasMounted ? jsx_runtime_1.jsx(MemoRoot, {}) : null }), jsx_runtime_1.jsx(remotion_1.Internals.CanUseRemotionHooksProvider, { children: jsx_runtime_1.jsx(RenderErrorContext_1.RenderErrorContext.Provider, { value: renderErrorContextValue, children: jsx_runtime_1.jsx(EditorContent_1.EditorContent, { readOnlyStudio: readOnlyStudio, children: jsx_runtime_1.jsx(TopPanel_1.TopPanel, { drawRef: setDrawRef, bufferStateDelayInMilliseconds: (0, studio_runtime_config_1.getStudioBufferStateDelayInMilliseconds)(), onMounted: onMounted, readOnlyStudio: readOnlyStudio }) }) }) })
102
101
  ] }) })
103
102
  ] }), jsx_runtime_1.jsx(Modals_1.Modals, { readOnlyStudio: readOnlyStudio }), jsx_runtime_1.jsx(NotificationCenter_1.NotificationCenter, {})
104
103
  ] }) }) }));
@@ -35,7 +35,7 @@ const StudioClearSelectionArea = ({ children }) => {
35
35
  const EditorContent = ({ readOnlyStudio, children }) => {
36
36
  const { canvasContent } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
37
37
  const showTimeline = canvasContent !== null && canvasContent.type === 'composition';
38
- const content = (jsx_runtime_1.jsxs(SplitterContainer_1.SplitterContainer, { orientation: "horizontal", id: "top-to-bottom", maxFlex: 0.9, minFlex: 0.2, defaultFlex: 0.75, children: [
38
+ const content = (jsx_runtime_1.jsxs(SplitterContainer_1.SplitterContainer, { orientation: "horizontal", id: "top-to-bottom", maxFlex: 0.9, minFlex: 0.2, defaultFlex: 0.75, maxFlexerSize: null, maxAntiFlexerSize: null, children: [
39
39
  jsx_runtime_1.jsx(SplitterElement_1.SplitterElement, { sticky: null, type: "flexer", children: children }), jsx_runtime_1.jsx(SplitterHandle_1.SplitterHandle, { allowToCollapse: "none", onCollapse: noop }), jsx_runtime_1.jsx(SplitterElement_1.SplitterElement, { sticky: null, type: "anti-flexer", children: showTimeline ? jsx_runtime_1.jsx(Timeline_1.Timeline, {}) : jsx_runtime_1.jsx(TimelineEmptyState_1.TimelineEmptyState, {}) })
40
40
  ] }));
41
41
  return (jsx_runtime_1.jsx(TimelineSelection_1.TimelineSelectionProvider, { children: jsx_runtime_1.jsxs(StudioClearSelectionArea, { children: [
@@ -6,8 +6,8 @@ const remotion_1 = require("remotion");
6
6
  const colors_1 = require("../../helpers/colors");
7
7
  const editor_guide_selection_1 = require("../../helpers/editor-guide-selection");
8
8
  const editor_ruler_1 = require("../../helpers/editor-ruler");
9
+ const ruler_canvas_size_1 = require("../../helpers/ruler-canvas-size");
9
10
  const editor_guides_1 = require("../../state/editor-guides");
10
- const editor_rulers_1 = require("../../state/editor-rulers");
11
11
  const ForceSpecificCursor_1 = require("../ForceSpecificCursor");
12
12
  const should_clear_selection_on_pointer_down_1 = require("../Timeline/should-clear-selection-on-pointer-down");
13
13
  const TimelineSelection_1 = require("../Timeline/TimelineSelection");
@@ -30,8 +30,10 @@ const Ruler = ({ scale, points, originOffset, startMarking, size, markingGaps, o
30
30
  hoveredGuideId,
31
31
  draggingGuideId,
32
32
  }), [draggingGuideId, guidesList, hoveredGuideId, selectedItems]);
33
- const rulerWidth = isVerticalRuler ? editor_rulers_1.RULER_WIDTH : size.width - editor_rulers_1.RULER_WIDTH;
34
- const rulerHeight = isVerticalRuler ? size.height - editor_rulers_1.RULER_WIDTH : editor_rulers_1.RULER_WIDTH;
33
+ const { width: rulerWidth, height: rulerHeight } = (0, ruler_canvas_size_1.getRulerCanvasSize)({
34
+ orientation,
35
+ size,
36
+ });
35
37
  (0, react_1.useEffect)(() => {
36
38
  (0, editor_ruler_1.drawMarkingOnRulerCanvas)({
37
39
  scale,
@@ -37,17 +37,29 @@ exports.ForceSpecificCursor = exports.stopForcingSpecificCursor = exports.forceS
37
37
  const jsx_runtime_1 = require("react/jsx-runtime");
38
38
  const react_1 = __importStar(require("react"));
39
39
  const ref = react_1.default.createRef();
40
+ const removeAutomaticCleanupListeners = () => {
41
+ window.removeEventListener('pointerup', exports.stopForcingSpecificCursor, true);
42
+ window.removeEventListener('pointercancel', exports.stopForcingSpecificCursor, true);
43
+ window.removeEventListener('blur', exports.stopForcingSpecificCursor, true);
44
+ };
40
45
  const forceSpecificCursor = (cursor) => {
41
46
  if (!ref.current) {
42
47
  throw new Error('ForceSpecificCursor is not mounted');
43
48
  }
44
49
  ref.current.style.cursor = cursor;
45
50
  ref.current.style.pointerEvents = 'auto';
51
+ // The component which initiated the drag may unmount before it gets a chance
52
+ // to handle the end of the gesture. Keep this fallback independent from the
53
+ // initiator so the cursor overlay can never remain stuck.
54
+ window.addEventListener('pointerup', exports.stopForcingSpecificCursor, true);
55
+ window.addEventListener('pointercancel', exports.stopForcingSpecificCursor, true);
56
+ window.addEventListener('blur', exports.stopForcingSpecificCursor, true);
46
57
  };
47
58
  exports.forceSpecificCursor = forceSpecificCursor;
48
59
  const stopForcingSpecificCursor = () => {
60
+ removeAutomaticCleanupListeners();
49
61
  if (!ref.current) {
50
- throw new Error('ForceSpecificCursor is not mounted');
62
+ return;
51
63
  }
52
64
  ref.current.style.cursor = '';
53
65
  ref.current.style.pointerEvents = 'none';
@@ -94,7 +94,8 @@ const CompositionDefaultPropsSection = ({ composition, currentDefaultProps, setD
94
94
  };
95
95
  const CompositionVisualControlsSection = () => {
96
96
  const { handles: visualControlHandles } = (0, react_1.useContext)(VisualControls_1.VisualControlsContext);
97
- const hasVisualControls = interactivity_enabled_1.studioInteractivityEnabled && Object.keys(visualControlHandles).length > 0;
97
+ const hasVisualControls = (0, interactivity_enabled_1.isStudioInteractivityEnabled)() &&
98
+ Object.keys(visualControlHandles).length > 0;
98
99
  if (!hasVisualControls) {
99
100
  return null;
100
101
  }
@@ -44,7 +44,7 @@ const SplitSequenceAction = ({ selection, track }) => {
44
44
  splitFrame: timelinePosition,
45
45
  propStatuses: sequencePropStatuses,
46
46
  }), [selection, sequencePropStatuses, timelinePosition, track.sequence]);
47
- const canSplit = interactivity_enabled_1.studioInteractivityEnabled &&
47
+ const canSplit = (0, interactivity_enabled_1.isStudioInteractivityEnabled)() &&
48
48
  sequencePropStatuses !== undefined &&
49
49
  eligibility.canSplit;
50
50
  const onSplit = (0, react_1.useCallback)(() => {
@@ -56,7 +56,7 @@ const SplitSequenceAction = ({ selection, track }) => {
56
56
  splitFrame: timelinePosition,
57
57
  }).catch(() => undefined);
58
58
  }, [canSplit, eligibility, timelinePosition]);
59
- const disabledReason = !interactivity_enabled_1.studioInteractivityEnabled
59
+ const disabledReason = !(0, interactivity_enabled_1.isStudioInteractivityEnabled)()
60
60
  ? 'Studio is read-only'
61
61
  : sequencePropStatuses === undefined
62
62
  ? 'Waiting for sequence prop status'
@@ -73,7 +73,7 @@ const SequenceSourceActions = ({ selection, track, validatedSource }) => {
73
73
  const confirm = (0, ConfirmationDialog_1.useConfirmationDialog)();
74
74
  const propStatusesForOverride = (0, react_1.useMemo)(() => remotion_1.Internals.getPropStatusesCtx(propStatuses, selection.nodePathInfo.sequenceSubscriptionKey), [propStatuses, selection.nodePathInfo.sequenceSubscriptionKey]);
75
75
  const freezeFrameMenuItem = (0, use_sequence_freeze_frame_menu_item_1.useSequenceFreezeFrameMenuItem)({
76
- clientId: previewServerState.type === 'connected' && interactivity_enabled_1.studioInteractivityEnabled
76
+ clientId: previewServerState.type === 'connected' && (0, interactivity_enabled_1.isStudioInteractivityEnabled)()
77
77
  ? previewServerState.clientId
78
78
  : null,
79
79
  nodePath: selection.nodePathInfo.sequenceSubscriptionKey,
@@ -84,7 +84,7 @@ const SequenceSourceActions = ({ selection, track, validatedSource }) => {
84
84
  timelinePosition,
85
85
  validatedSource,
86
86
  });
87
- const sourceActionsDisabled = previewServerState.type !== 'connected' || !interactivity_enabled_1.studioInteractivityEnabled;
87
+ const sourceActionsDisabled = previewServerState.type !== 'connected' || !(0, interactivity_enabled_1.isStudioInteractivityEnabled)();
88
88
  const onDuplicate = (0, react_1.useCallback)(() => {
89
89
  if (sourceActionsDisabled) {
90
90
  return;
@@ -18,7 +18,7 @@ const useCompositionActions = () => {
18
18
  const [isAddingAsset, setIsAddingAsset] = (0, react_1.useState)(false);
19
19
  const { previewServerState } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx);
20
20
  const previewConnected = previewServerState.type === 'connected';
21
- const previewInteractive = previewConnected && interactivity_enabled_1.studioInteractivityEnabled;
21
+ const previewInteractive = previewConnected && (0, interactivity_enabled_1.isStudioInteractivityEnabled)();
22
22
  const currentCompositionId = (canvasContent === null || canvasContent === void 0 ? void 0 : canvasContent.type) === 'composition' ? canvasContent.compositionId : null;
23
23
  const currentComposition = (0, react_1.useMemo)(() => {
24
24
  var _a;
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ export type LicenseKeyDetails = {
3
+ readonly isValid: boolean;
4
+ readonly hasActiveSubscription: boolean | null;
5
+ readonly projectName: string;
6
+ readonly projectSlug: string;
7
+ };
8
+ export declare const hasActiveCompanyLicense: (details: LicenseKeyDetails) => boolean;
9
+ export type LicenseKeyValidationResult = {
10
+ readonly valid: boolean;
11
+ readonly message: string | null;
12
+ };
13
+ export declare const validateLicenseKey: (key: string) => LicenseKeyValidationResult;
14
+ export declare const fetchLicenseKeyDetails: (licenseKey: string) => Promise<LicenseKeyDetails>;
15
+ export declare const LicenseKeyDetailsDisplay: React.FC<{
16
+ readonly details: LicenseKeyDetails;
17
+ }>;
@@ -0,0 +1,113 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LicenseKeyDetailsDisplay = exports.fetchLicenseKeyDetails = exports.validateLicenseKey = exports.hasActiveCompanyLicense = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const colors_1 = require("../helpers/colors");
6
+ const check_circle_filled_1 = require("../icons/check-circle-filled");
7
+ const common_1 = require("./InspectorPanel/common");
8
+ const LICENSE_KEY_LENGTH = 55;
9
+ const LICENSE_KEY_PREFIX = 'rm_pub_';
10
+ const PRO_HOST = 'https://www.remotion.pro';
11
+ const hasActiveCompanyLicense = (details) => {
12
+ return details.hasActiveSubscription === true;
13
+ };
14
+ exports.hasActiveCompanyLicense = hasActiveCompanyLicense;
15
+ const validateLicenseKey = (key) => {
16
+ if (key.length === 0) {
17
+ return { valid: false, message: null };
18
+ }
19
+ if (!key.startsWith(LICENSE_KEY_PREFIX)) {
20
+ return {
21
+ valid: false,
22
+ message: `License key must start with "${LICENSE_KEY_PREFIX}"`,
23
+ };
24
+ }
25
+ const afterPrefix = key.slice(LICENSE_KEY_PREFIX.length);
26
+ if (!/^[a-zA-Z0-9]*$/.test(afterPrefix)) {
27
+ return {
28
+ valid: false,
29
+ message: 'License key must contain only alphanumeric characters after the prefix',
30
+ };
31
+ }
32
+ if (key.length !== LICENSE_KEY_LENGTH) {
33
+ return {
34
+ valid: false,
35
+ message: `License key must be ${LICENSE_KEY_LENGTH} characters long`,
36
+ };
37
+ }
38
+ return { valid: true, message: null };
39
+ };
40
+ exports.validateLicenseKey = validateLicenseKey;
41
+ const fetchLicenseKeyDetails = async (licenseKey) => {
42
+ const response = await fetch(`${PRO_HOST}/api/validate-license-key`, {
43
+ method: 'POST',
44
+ body: JSON.stringify({
45
+ licenseKey,
46
+ }),
47
+ headers: {
48
+ 'Content-Type': 'application/json',
49
+ },
50
+ });
51
+ return response.json();
52
+ };
53
+ exports.fetchLicenseKeyDetails = fetchLicenseKeyDetails;
54
+ const actionStyle = {
55
+ cursor: 'pointer',
56
+ marginLeft: 0,
57
+ marginRight: 0,
58
+ width: '100%',
59
+ };
60
+ const actionContent = {
61
+ alignItems: 'center',
62
+ color: 'inherit',
63
+ display: 'flex',
64
+ fontFamily: 'sans-serif',
65
+ fontSize: 13,
66
+ gap: 8,
67
+ lineHeight: '18px',
68
+ minWidth: 0,
69
+ width: '100%',
70
+ };
71
+ const actionText = {
72
+ color: 'inherit',
73
+ flex: 1,
74
+ fontFamily: 'sans-serif',
75
+ fontSize: 13,
76
+ lineHeight: '18px',
77
+ minWidth: 0,
78
+ overflow: 'hidden',
79
+ textOverflow: 'ellipsis',
80
+ whiteSpace: 'nowrap',
81
+ };
82
+ const actionLabel = {
83
+ color: 'inherit',
84
+ flexShrink: 0,
85
+ fontFamily: 'sans-serif',
86
+ fontSize: 13,
87
+ lineHeight: '18px',
88
+ };
89
+ const inactiveLicenseText = {
90
+ ...actionText,
91
+ color: colors_1.FAIL_COLOR,
92
+ };
93
+ const iconStyle = {
94
+ width: 14,
95
+ height: 14,
96
+ flexShrink: 0,
97
+ };
98
+ const ErrorIcon = () => {
99
+ return (jsx_runtime_1.jsx("svg", { style: iconStyle, viewBox: "0 0 512 512", children: jsx_runtime_1.jsx("path", { fill: colors_1.FAIL_COLOR, d: "M0 160V352L160 512H352L512 352V160L352 0H160L0 160zm353.9 32l-17 17-47 47 47 47 17 17L320 353.9l-17-17-47-47-47 47-17 17L158.1 320l17-17 47-47-47-47-17-17L192 158.1l17 17 47 47 47-47 17-17L353.9 192z" }) }));
100
+ };
101
+ const LicenseKeyDetailsDisplay = ({ details }) => {
102
+ const projectUrl = `${PRO_HOST}/projects/${details.projectSlug}`;
103
+ const usageUrl = `${projectUrl}/usage#client-renders-usage`;
104
+ const hasActiveLicense = (0, exports.hasActiveCompanyLicense)(details);
105
+ return (jsx_runtime_1.jsxs("div", { children: [jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: false, onClick: () => window.open(usageUrl, '_blank', 'noopener,noreferrer'), renderIcon: (color) => (jsx_runtime_1.jsx(check_circle_filled_1.CheckCircleFilled, { style: { ...iconStyle, fill: color } })), style: actionStyle, title: "View license usage", children: jsx_runtime_1.jsxs("span", { style: actionContent, children: [
106
+ jsx_runtime_1.jsxs("span", { style: actionText, children: ["Belongs to ", details.projectName] }), jsx_runtime_1.jsx("span", { style: actionLabel, children: "View usage" })
107
+ ] }) }), jsx_runtime_1.jsx(common_1.InspectorInlineAction, { disabled: false, onClick: () => window.open(projectUrl, '_blank', 'noopener,noreferrer'), renderIcon: (color) => hasActiveLicense ? (jsx_runtime_1.jsx(check_circle_filled_1.CheckCircleFilled, { style: { ...iconStyle, fill: color } })) : (jsx_runtime_1.jsx(ErrorIcon, {})), style: actionStyle, title: "Manage Company License", children: jsx_runtime_1.jsxs("span", { style: actionContent, children: [
108
+ jsx_runtime_1.jsx("span", { style: hasActiveLicense ? actionText : inactiveLicenseText, children: hasActiveLicense
109
+ ? 'Active Company License'
110
+ : 'No active Company License' }), jsx_runtime_1.jsx("span", { style: actionLabel, children: "Manage" })
111
+ ] }) })] }));
112
+ };
113
+ exports.LicenseKeyDetailsDisplay = LicenseKeyDetailsDisplay;
@@ -10,6 +10,7 @@ const client_id_1 = require("../helpers/client-id");
10
10
  const studio_runtime_config_1 = require("../helpers/studio-runtime-config");
11
11
  const modals_1 = require("../state/modals");
12
12
  const AskAiModal_1 = require("./AskAiModal");
13
+ const ConfigureLicenseModal_1 = require("./ConfigureLicenseModal");
13
14
  const ConfirmationDialog_1 = require("./ConfirmationDialog");
14
15
  const EffectPickerModal_1 = require("./EffectPickerModal");
15
16
  const InstallPackage_1 = require("./InstallPackage");
@@ -33,7 +34,7 @@ const Modals = ({ readOnlyStudio }) => {
33
34
  const { selectedModal: modalContextType } = (0, react_1.useContext)(modals_1.ModalsContext);
34
35
  const canRender = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx).previewServerState.type ===
35
36
  'connected';
36
- return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [modalContextType && modalContextType.type === 'new-comp' && (jsx_runtime_1.jsx(NewComposition_1.NewComposition, { folderName: modalContextType.folderName, parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'new-folder' && (jsx_runtime_1.jsx(NewFolder_1.NewFolder, { parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'duplicate-comp' && (jsx_runtime_1.jsx(DuplicateComposition_1.DuplicateComposition, { compositionType: modalContextType.compositionType, compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'delete-comp' && (jsx_runtime_1.jsx(DeleteComposition_1.DeleteComposition, { compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'rename-comp' && (jsx_runtime_1.jsx(RenameComposition_1.RenameComposition, { compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'delete-folder' && (jsx_runtime_1.jsx(DeleteFolder_1.DeleteFolder, { folderName: modalContextType.folderName, parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'rename-folder' && (jsx_runtime_1.jsx(RenameFolder_1.RenameFolder, { folderName: modalContextType.folderName, parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'rename-static-file' && (jsx_runtime_1.jsx(RenameStaticFile_1.RenameStaticFileModal, { relativePath: modalContextType.relativePath })), modalContextType && modalContextType.type === 'input-props-override' && (jsx_runtime_1.jsx(OverrideInputProps_1.OverrideInputPropsModal, {})), modalContextType && modalContextType.type === 'web-render' && (jsx_runtime_1.jsx(WebRenderModal_1.WebRenderModalWithLoader, { ...modalContextType })), modalContextType &&
37
+ return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [modalContextType && modalContextType.type === 'new-comp' && (jsx_runtime_1.jsx(NewComposition_1.NewComposition, { folderName: modalContextType.folderName, parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'new-folder' && (jsx_runtime_1.jsx(NewFolder_1.NewFolder, { parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'duplicate-comp' && (jsx_runtime_1.jsx(DuplicateComposition_1.DuplicateComposition, { compositionType: modalContextType.compositionType, compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'delete-comp' && (jsx_runtime_1.jsx(DeleteComposition_1.DeleteComposition, { compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'rename-comp' && (jsx_runtime_1.jsx(RenameComposition_1.RenameComposition, { compositionId: modalContextType.compositionId })), modalContextType && modalContextType.type === 'delete-folder' && (jsx_runtime_1.jsx(DeleteFolder_1.DeleteFolder, { folderName: modalContextType.folderName, parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'rename-folder' && (jsx_runtime_1.jsx(RenameFolder_1.RenameFolder, { folderName: modalContextType.folderName, parentName: modalContextType.parentName, stack: modalContextType.stack })), modalContextType && modalContextType.type === 'rename-static-file' && (jsx_runtime_1.jsx(RenameStaticFile_1.RenameStaticFileModal, { relativePath: modalContextType.relativePath })), modalContextType && modalContextType.type === 'input-props-override' && (jsx_runtime_1.jsx(OverrideInputProps_1.OverrideInputPropsModal, {})), modalContextType && modalContextType.type === 'configure-license' && (jsx_runtime_1.jsx(ConfigureLicenseModal_1.ConfigureLicenseModal, { initialPublicLicenseKey: modalContextType.initialPublicLicenseKey })), modalContextType && modalContextType.type === 'web-render' && (jsx_runtime_1.jsx(WebRenderModal_1.WebRenderModalWithLoader, { ...modalContextType })), modalContextType &&
37
38
  modalContextType.type === 'server-render' &&
38
39
  (canRender || modalContextType.readOnlyStudio) ? (jsx_runtime_1.jsx(ServerRenderModal_1.RenderModalWithLoader, { readOnlyStudio: (_a = modalContextType.readOnlyStudio) !== null && _a !== void 0 ? _a : false, initialFrame: modalContextType.initialFrame, initialDarkMode: modalContextType.initialDarkMode, compositionId: modalContextType.compositionId, initialVideoImageFormat: modalContextType.initialVideoImageFormat, initialJpegQuality: modalContextType.initialJpegQuality, initialScale: modalContextType.initialScale, initialLogLevel: modalContextType.initialLogLevel, initialOffthreadVideoCacheSizeInBytes: modalContextType.initialOffthreadVideoCacheSizeInBytes, initialOffthreadVideoThreads: modalContextType.initialOffthreadVideoThreads, initialMediaCacheSizeInBytes: modalContextType.initialMediaCacheSizeInBytes, initialConcurrency: modalContextType.initialConcurrency, maxConcurrency: modalContextType.maxConcurrency, minConcurrency: modalContextType.minConcurrency, initialStillImageFormat: modalContextType.initialStillImageFormat, initialMuted: modalContextType.initialMuted, initialEnforceAudioTrack: modalContextType.initialEnforceAudioTrack, initialProResProfile: modalContextType.initialProResProfile, initialx264Preset: modalContextType.initialx264Preset, initialGopSize: modalContextType.initialGopSize, initialPixelFormat: modalContextType.initialPixelFormat, initialAudioBitrate: modalContextType.initialAudioBitrate, initialVideoBitrate: modalContextType.initialVideoBitrate, initialEveryNthFrame: modalContextType.initialEveryNthFrame, initialNumberOfGifLoops: modalContextType.initialNumberOfGifLoops, initialDelayRenderTimeout: modalContextType.initialDelayRenderTimeout, initialEnvVariables: modalContextType.initialEnvVariables, initialDisableWebSecurity: modalContextType.initialDisableWebSecurity, initialGl: modalContextType.initialOpenGlRenderer, initialHeadless: modalContextType.initialHeadless, initialIgnoreCertificateErrors: modalContextType.initialIgnoreCertificateErrors, initialEncodingBufferSize: modalContextType.initialEncodingBufferSize, initialEncodingMaxRate: modalContextType.initialEncodingMaxRate, initialUserAgent: modalContextType.initialUserAgent, initialColorSpace: modalContextType.initialColorSpace, initialMultiProcessOnLinux: modalContextType.initialMultiProcessOnLinux, initialRepro: modalContextType.initialRepro, initialBeep: modalContextType.initialBeep, initialForSeamlessAacConcatenation: modalContextType.initialForSeamlessAacConcatenation, defaultProps: modalContextType.defaultProps, inFrameMark: modalContextType.inFrameMark, outFrameMark: modalContextType.outFrameMark, defaultConfigurationAudioCodec: modalContextType.defaultConfigurationAudioCodec, defaultConfigurationVideoCodec: modalContextType.defaultConfigurationVideoCodec, renderTypeOfLastRender: modalContextType.renderTypeOfLastRender, defaultMetadata: modalContextType.defaulMetadata, initialHardwareAcceleration: modalContextType.initialHardwareAcceleration, initialSampleRate: modalContextType.initialSampleRate, initialChromeMode: modalContextType.initialChromeMode, renderDefaults: modalContextType.renderDefaults })) : null, modalContextType && modalContextType.type === 'render-progress' && (jsx_runtime_1.jsx(RenderStatusModal_1.RenderStatusModal, { jobId: modalContextType.jobId })), modalContextType && modalContextType.type === 'update' && (jsx_runtime_1.jsx(UpdateModal_1.UpdateModal, { info: modalContextType.info, knownBugs: modalContextType.knownBugs })), modalContextType && modalContextType.type === 'install-packages' && (jsx_runtime_1.jsx(InstallPackage_1.InstallPackageModal, { packageManager: modalContextType.packageManager })), modalContextType && modalContextType.type === 'quick-switcher' && (jsx_runtime_1.jsx(QuickSwitcher_1.default, { readOnlyStudio: readOnlyStudio, invocationTimestamp: modalContextType.invocationTimestamp, initialMode: modalContextType.mode })), modalContextType && modalContextType.type === 'add-effect' && (jsx_runtime_1.jsx(EffectPickerModal_1.EffectPickerModal, { state: modalContextType })), modalContextType && modalContextType.type === 'confirmation-dialog' && (jsx_runtime_1.jsx(ConfirmationDialog_1.ConfirmationDialog, { state: modalContextType })), modalContextType && modalContextType.type === 'svg-import-dialog' && (jsx_runtime_1.jsx(SvgImportDialog_1.SvgImportDialog, { state: modalContextType })), (0, studio_runtime_config_1.getStudioAskAIEnabled)() && jsx_runtime_1.jsx(AskAiModal_1.AskAiModal, {})] }));
39
40
  };
@@ -1,7 +1,33 @@
1
1
  import type { InputHTMLAttributes } from 'react';
2
2
  import React from 'react';
3
3
  import type { RemInputStatus } from './RemInput';
4
+ type InputDraggerValidationResult = {
5
+ readonly valid: true;
6
+ readonly value: number;
7
+ } | {
8
+ readonly valid: false;
9
+ readonly message: string;
10
+ };
4
11
  export declare const inputDraggerContainerStyle: React.CSSProperties;
12
+ export declare const parseInputDraggerNumber: (value: string) => number | null;
13
+ export declare const isInputDraggerValueAlignedToStep: ({ min, step, value, }: {
14
+ readonly min: string | number | undefined;
15
+ readonly step: string | number | undefined;
16
+ readonly value: number;
17
+ }) => boolean;
18
+ export declare const validateInputDraggerValue: ({ max, min, step, value, }: {
19
+ readonly max: string | number | undefined;
20
+ readonly min: string | number | undefined;
21
+ readonly step: string | number | undefined;
22
+ readonly value: string;
23
+ }) => InputDraggerValidationResult;
24
+ export declare const deriveInputDraggerArrowValue: ({ direction, max, min, step, value, }: {
25
+ readonly direction: -1 | 1;
26
+ readonly max: string | number | undefined;
27
+ readonly min: string | number | undefined;
28
+ readonly step: string | number | undefined;
29
+ readonly value: number;
30
+ }) => number;
5
31
  export declare const deriveInputDraggerStep: ({ min, snapToStep, step, }: {
6
32
  readonly min: string | number | undefined;
7
33
  readonly snapToStep: boolean;
@@ -33,3 +59,4 @@ export declare const InputDragger: React.ForwardRefExoticComponent<InputHTMLAttr
33
59
  readonly dragDecimalPlaces?: number | undefined;
34
60
  readonly dragSensitivity?: number | undefined;
35
61
  } & React.RefAttributes<HTMLButtonElement>>;
62
+ export {};