@remotion/studio 4.0.506 → 4.0.508
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/FastRefreshProvider.js +13 -9
- package/dist/api/copy-render-output-to-asset.d.ts +4 -0
- package/dist/api/copy-render-output-to-asset.js +11 -0
- package/dist/components/AssetSelector.js +19 -4
- package/dist/components/AssetSelectorItem.js +2 -2
- package/dist/components/CodingAgentIcon.d.ts +6 -0
- package/dist/components/CodingAgentIcon.js +12 -0
- package/dist/components/ConfigureDefaultEditorModal.d.ts +1 -3
- package/dist/components/ConfigureDefaultEditorModal.js +67 -77
- package/dist/components/ConfigureLicenseModal.d.ts +1 -4
- package/dist/components/ConfigureLicenseModal.js +89 -81
- package/dist/components/ContextMenu.d.ts +1 -0
- package/dist/components/ContextMenu.js +42 -13
- package/dist/components/EditorContent.js +4 -3
- package/dist/components/EditorContexts.js +6 -5
- package/dist/components/ExpandedTracksProvider.js +10 -53
- package/dist/components/InlineAction.d.ts +2 -1
- package/dist/components/InlineAction.js +3 -3
- package/dist/components/InspectorLocationCopy.js +8 -8
- package/dist/components/InspectorOpenInEditor.d.ts +2 -0
- package/dist/components/InspectorOpenInEditor.js +81 -50
- package/dist/components/InspectorPanel/AlignmentControls.js +2 -2
- package/dist/components/InspectorPanel/CompositionInspector.js +3 -1
- package/dist/components/InspectorPanel/SequenceInspectorHeader.d.ts +3 -0
- package/dist/components/InspectorPanel/SequenceInspectorHeader.js +22 -4
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +1 -1
- package/dist/components/InspectorPanel/styles.js +1 -1
- package/dist/components/InspectorSequenceSection.js +36 -4
- package/dist/components/Menu/MenuSectionHeader.d.ts +4 -0
- package/dist/components/Menu/MenuSectionHeader.js +20 -0
- package/dist/components/Menu/SubMenu.js +13 -2
- package/dist/components/Menu/menu-tree-context.d.ts +3 -0
- package/dist/components/Menu/menu-tree-context.js +13 -0
- package/dist/components/MenuBuildIndicator.js +1 -1
- package/dist/components/NewComposition/ComboBox.d.ts +6 -1
- package/dist/components/NewComposition/MenuContent.js +27 -19
- package/dist/components/NewComposition/menu-typeahead.js +2 -2
- package/dist/components/PlayPause.d.ts +1 -1
- package/dist/components/PlayPause.js +61 -12
- package/dist/components/Preview.js +29 -4
- package/dist/components/RenderButton.js +16 -12
- package/dist/components/RenderModal/GuiRenderStatus.js +23 -6
- package/dist/components/RenderModal/InfoBubble.d.ts +1 -0
- package/dist/components/RenderModal/InfoBubble.js +6 -4
- package/dist/components/RenderModal/InfoTooltip.d.ts +1 -0
- package/dist/components/RenderModal/InfoTooltip.js +12 -12
- package/dist/components/RenderModal/SchemaEditor/SchemaLabel.d.ts +5 -0
- package/dist/components/RenderModal/SchemaEditor/SchemaLabel.js +16 -3
- package/dist/components/RenderModal/SchemaEditor/ZodArrayEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodBooleanEditor.d.ts +2 -0
- package/dist/components/RenderModal/SchemaEditor/ZodBooleanEditor.js +3 -2
- package/dist/components/RenderModal/SchemaEditor/ZodColorEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodDateEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodDiscriminatedUnionEditor.js +2 -1
- package/dist/components/RenderModal/SchemaEditor/ZodEnumEditor.d.ts +1 -0
- package/dist/components/RenderModal/SchemaEditor/ZodEnumEditor.js +3 -3
- package/dist/components/RenderModal/SchemaEditor/ZodMatrixEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodNonEditableValue.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodNumberEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodObjectEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodOrNullishEditor.js +8 -3
- package/dist/components/RenderModal/SchemaEditor/ZodStaticFileEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodStringEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodSwitch.js +2 -2
- package/dist/components/RenderModal/SchemaEditor/ZodTextareaEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodTupleEditor.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/zod-schema-type.d.ts +1 -0
- package/dist/components/RenderModal/SchemaEditor/zod-schema-type.js +12 -1
- package/dist/components/RenderModal/ServerRenderModal.js +4 -0
- package/dist/components/RenderQueue/RenderQueueItem.js +8 -2
- package/dist/components/RenderQueue/actions.d.ts +4 -2
- package/dist/components/RenderQueue/actions.js +4 -2
- package/dist/components/RenderQueue/index.js +3 -4
- package/dist/components/RenderQueue/use-render-output-file-drag.d.ts +8 -0
- package/dist/components/RenderQueue/use-render-output-file-drag.js +121 -0
- package/dist/components/SegmentedControl.js +0 -1
- package/dist/components/SelectedOutlineCanvasRotation.d.ts +9 -0
- package/dist/components/SelectedOutlineCanvasRotation.js +237 -0
- package/dist/components/SelectedOutlineElement.d.ts +16 -18
- package/dist/components/SelectedOutlineElement.js +144 -931
- package/dist/components/SelectedOutlineKeyboardControls.d.ts +7 -0
- package/dist/components/SelectedOutlineKeyboardControls.js +261 -0
- package/dist/components/SelectedOutlineOverlay.d.ts +7 -14
- package/dist/components/SelectedOutlineOverlay.js +378 -864
- package/dist/components/SelectedOutlinePolygon.d.ts +26 -0
- package/dist/components/SelectedOutlinePolygon.js +360 -0
- package/dist/components/SelectedOutlineRenderer.d.ts +19 -0
- package/dist/components/SelectedOutlineRenderer.js +225 -0
- package/dist/components/SelectedOutlineRotationCornerHandle.d.ts +17 -0
- package/dist/components/SelectedOutlineRotationCornerHandle.js +271 -0
- package/dist/components/SelectedOutlineScaleEdgeLine.d.ts +17 -0
- package/dist/components/SelectedOutlineScaleEdgeLine.js +215 -0
- package/dist/components/SelectedOutlineSnapIndicators.d.ts +9 -0
- package/dist/components/SelectedOutlineSnapIndicators.js +29 -0
- package/dist/components/SelectedOutlineTransformOriginHandle.d.ts +9 -0
- package/dist/components/SelectedOutlineTransformOriginHandle.js +312 -0
- package/dist/components/SelectedOutlineUvControls.d.ts +3 -9
- package/dist/components/SelectedOutlineUvControls.js +57 -12
- package/dist/components/SequencePropsSubscriptionProvider.js +8 -0
- package/dist/components/SettingsContext.d.ts +15 -0
- package/dist/components/SettingsContext.js +116 -0
- package/dist/components/SettingsModal.js +10 -4
- package/dist/components/SettingsModalFooter.d.ts +1 -3
- package/dist/components/SettingsModalFooter.js +4 -6
- package/dist/components/ShowOutlinesProvider.js +2 -3
- package/dist/components/Timeline/EasingEditorModal.js +66 -22
- package/dist/components/Timeline/SequencePropsObserver.js +97 -1
- package/dist/components/Timeline/SubscribeToNodePaths.js +4 -2
- package/dist/components/Timeline/Timeline.js +22 -5
- package/dist/components/Timeline/TimelineDuplicateCount.d.ts +4 -0
- package/dist/components/Timeline/TimelineDuplicateCount.js +28 -0
- package/dist/components/Timeline/TimelineEffectItem.js +1 -4
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +3 -23
- package/dist/components/Timeline/TimelineExpandedTrackKeyframes.d.ts +4 -2
- package/dist/components/Timeline/TimelineExpandedTrackKeyframes.js +11 -1
- package/dist/components/Timeline/TimelineFieldRowContent.js +10 -3
- package/dist/components/Timeline/TimelineRotationField.js +84 -12
- package/dist/components/Timeline/TimelineScaleField.js +58 -4
- package/dist/components/Timeline/TimelineSelection.d.ts +4 -0
- package/dist/components/Timeline/TimelineSelection.js +45 -2
- package/dist/components/Timeline/TimelineSequence.js +28 -25
- package/dist/components/Timeline/TimelineSequenceItem.js +91 -28
- package/dist/components/Timeline/TimelineSequencePropItem.js +5 -2
- package/dist/components/Timeline/TimelineTrack.js +2 -1
- package/dist/components/Timeline/TimelineTransformOriginField.js +78 -4
- package/dist/components/Timeline/TimelineTranslateField.js +55 -15
- package/dist/components/Timeline/Transform3DModeContext.d.ts +1 -0
- package/dist/components/Timeline/Transform3DModeContext.js +5 -0
- package/dist/components/Timeline/delete-selected-timeline-item.js +0 -6
- package/dist/components/Timeline/get-sequence-context-menu-items.d.ts +6 -3
- package/dist/components/Timeline/get-sequence-context-menu-items.js +69 -57
- package/dist/components/Timeline/sequence-props-subscription-store.d.ts +2 -1
- package/dist/components/Timeline/sequence-props-subscription-store.js +5 -2
- package/dist/components/Timeline/timeline-field-display-utils.js +2 -2
- package/dist/components/Timeline/timeline-field-row-layout.d.ts +6 -0
- package/dist/components/Timeline/timeline-field-row-layout.js +16 -1
- package/dist/components/Timeline/timeline-rotation-utils.d.ts +16 -0
- package/dist/components/Timeline/timeline-rotation-utils.js +145 -4
- package/dist/components/Timeline/timeline-translate-utils.d.ts +3 -2
- package/dist/components/Timeline/timeline-translate-utils.js +8 -4
- package/dist/components/Timeline/transform-3d-mode.d.ts +6 -0
- package/dist/components/Timeline/transform-3d-mode.js +36 -0
- package/dist/components/Timeline/transform-origin-utils.d.ts +4 -0
- package/dist/components/Timeline/transform-origin-utils.js +12 -6
- package/dist/components/Timeline/use-expanded-track-keyframe-rows.js +36 -4
- package/dist/components/Timeline/{use-open-sequence-in-editor.d.ts → use-open-sequence-in-apps.d.ts} +4 -1
- package/dist/components/Timeline/{use-open-sequence-in-editor.js → use-open-sequence-in-apps.js} +21 -5
- package/dist/components/Timeline/use-resolved-stack-react-to-change.d.ts +5 -1
- package/dist/components/Timeline/use-resolved-stack-react-to-change.js +45 -9
- package/dist/components/Timeline/use-sequence-props-subscription.d.ts +3 -1
- package/dist/components/Timeline/use-sequence-props-subscription.js +7 -2
- package/dist/components/Timeline/use-timeline-expanded-tree.d.ts +4 -0
- package/dist/components/Timeline/use-timeline-expanded-tree.js +45 -1
- package/dist/components/call-api.js +2 -0
- package/dist/components/canvas-rotation-cursor.d.ts +1 -0
- package/dist/components/canvas-rotation-cursor.js +14 -0
- package/dist/components/get-open-in-menu-items.d.ts +17 -0
- package/dist/components/get-open-in-menu-items.js +144 -0
- package/dist/components/selected-outline-drag.d.ts +11 -5
- package/dist/components/selected-outline-drag.js +80 -42
- package/dist/components/selected-outline-measurement.d.ts +7 -2
- package/dist/components/selected-outline-measurement.js +28 -1
- package/dist/components/selected-outline-order.d.ts +12 -0
- package/dist/components/selected-outline-order.js +251 -0
- package/dist/components/selected-outline-types.d.ts +15 -10
- package/dist/components/svg-point-to-client-point.d.ts +2 -0
- package/dist/components/svg-point-to-client-point.js +10 -0
- package/dist/components/use-auto-save-config.d.ts +8 -0
- package/dist/components/use-auto-save-config.js +74 -0
- package/dist/components/use-default-editor-info.d.ts +1 -0
- package/dist/components/use-default-editor-info.js +10 -30
- package/dist/esm/{chunk-jefhcs5z.js → chunk-fgedsvhb.js} +1 -2
- package/dist/esm/{chunk-b49ec3nz.js → chunk-zpn4m49r.js} +12924 -10139
- package/dist/esm/index.mjs +357 -2
- package/dist/esm/internals.mjs +12923 -10138
- package/dist/esm/previewEntry.mjs +12771 -9986
- package/dist/esm/renderEntry.mjs +2 -2
- package/dist/helpers/are-sequence-node-path-infos-equal.d.ts +2 -0
- package/dist/helpers/are-sequence-node-path-infos-equal.js +27 -0
- package/dist/helpers/calculate-timeline.js +3 -3
- package/dist/helpers/client-id.js +8 -1
- package/dist/helpers/format-file-location.d.ts +1 -1
- package/dist/helpers/format-file-location.js +3 -3
- package/dist/helpers/get-box-quads-polyfill-internals.js +10 -2
- package/dist/helpers/migrate-expanded-tracks-for-subscription-key.js +3 -3
- package/dist/helpers/open-in-editor.d.ts +4 -1
- package/dist/helpers/open-in-editor.js +9 -1
- package/dist/helpers/preview-server-events.js +4 -0
- package/dist/helpers/sequence-node-path-mutations.d.ts +4 -0
- package/dist/helpers/sequence-node-path-mutations.js +31 -0
- package/dist/helpers/studio-runtime-config.js +3 -0
- package/dist/helpers/timeline-node-path-key.d.ts +2 -0
- package/dist/helpers/timeline-node-path-key.js +3 -1
- package/dist/helpers/use-asset-drag-events.d.ts +2 -1
- package/dist/helpers/use-asset-drag-events.js +14 -6
- package/dist/helpers/use-menu-structure.js +2 -2
- package/dist/helpers/use-runtime-values.d.ts +1 -3
- package/dist/icons/cube.d.ts +4 -0
- package/dist/icons/cube.js +6 -0
- package/dist/icons/finder.d.ts +4 -0
- package/dist/icons/finder.js +8 -0
- package/dist/icons/terminal.d.ts +6 -0
- package/dist/icons/terminal.js +46 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +8 -0
- package/dist/state/timeline-sequence-hover.d.ts +9 -3
- package/dist/state/timeline-sequence-hover.js +63 -12
- package/dist/state/transform-3d-mode.d.ts +10 -0
- package/dist/state/transform-3d-mode.js +27 -0
- package/dist/state/z-index.js +5 -8
- package/package.json +12 -12
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FastRefreshProvider = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const studio_shared_1 = require("@remotion/studio-shared");
|
|
5
6
|
const react_1 = require("react");
|
|
7
|
+
const react_dom_1 = require("react-dom");
|
|
6
8
|
const fast_refresh_context_1 = require("./fast-refresh-context");
|
|
7
9
|
const FastRefreshProvider = ({ children }) => {
|
|
8
10
|
const [fastRefreshes, setFastRefreshes] = (0, react_1.useState)(0);
|
|
@@ -11,15 +13,17 @@ const FastRefreshProvider = ({ children }) => {
|
|
|
11
13
|
setManualRefreshes((i) => i + 1);
|
|
12
14
|
}, []);
|
|
13
15
|
(0, react_1.useEffect)(() => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
const onReactRefreshFinished = () => {
|
|
17
|
+
// Commit consumers and their layout effects before the browser paints
|
|
18
|
+
// the refreshed composition with stale node-path statuses.
|
|
19
|
+
(0, react_dom_1.flushSync)(() => {
|
|
20
|
+
setFastRefreshes((i) => i + 1);
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
window.addEventListener(studio_shared_1.REACT_REFRESH_FINISHED_EVENT, onReactRefreshFinished);
|
|
24
|
+
return () => {
|
|
25
|
+
window.removeEventListener(studio_shared_1.REACT_REFRESH_FINISHED_EVENT, onReactRefreshFinished);
|
|
26
|
+
};
|
|
23
27
|
}, []);
|
|
24
28
|
const value = (0, react_1.useMemo)(() => ({ fastRefreshes, manualRefreshes, increaseManualRefreshes }), [fastRefreshes, manualRefreshes, increaseManualRefreshes]);
|
|
25
29
|
return (jsx_runtime_1.jsx(fast_refresh_context_1.FastRefreshContext.Provider, { value: value, children: children }));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.copyRenderOutputToAsset = void 0;
|
|
4
|
+
const call_api_1 = require("../components/call-api");
|
|
5
|
+
const copyRenderOutputToAsset = ({ outputPath, assetPath, }) => {
|
|
6
|
+
return (0, call_api_1.callApi)('/api/copy-render-output-to-asset', {
|
|
7
|
+
outputPath,
|
|
8
|
+
assetPath,
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
exports.copyRenderOutputToAsset = copyRenderOutputToAsset;
|
|
@@ -36,6 +36,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
exports.AssetSelector = void 0;
|
|
37
37
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
38
|
const react_1 = require("react");
|
|
39
|
+
const copy_render_output_to_asset_1 = require("../api/copy-render-output-to-asset");
|
|
39
40
|
const write_static_file_1 = require("../api/write-static-file");
|
|
40
41
|
const browser_studio_operations_1 = require("../helpers/browser-studio-operations");
|
|
41
42
|
const client_id_1 = require("../helpers/client-id");
|
|
@@ -109,25 +110,39 @@ const AssetSelector = ({ readOnlyStudio }) => {
|
|
|
109
110
|
setDropLocation,
|
|
110
111
|
});
|
|
111
112
|
const onDragOver = (0, react_1.useCallback)((e) => {
|
|
112
|
-
if (!(0, use_asset_drag_events_1.
|
|
113
|
+
if (!(0, use_asset_drag_events_1.isAssetUploadDragEvent)(e)) {
|
|
113
114
|
return;
|
|
114
115
|
}
|
|
115
116
|
e.preventDefault();
|
|
116
117
|
}, []);
|
|
117
118
|
const onDrop = (0, react_1.useCallback)(async (e) => {
|
|
118
119
|
try {
|
|
119
|
-
if (!(0, use_asset_drag_events_1.
|
|
120
|
+
if (!(0, use_asset_drag_events_1.isAssetUploadDragEvent)(e)) {
|
|
120
121
|
setDropLocation(null);
|
|
121
122
|
return;
|
|
122
123
|
}
|
|
123
124
|
e.preventDefault();
|
|
124
125
|
e.stopPropagation();
|
|
126
|
+
const assetPath = dropLocation !== null && dropLocation !== void 0 ? dropLocation : null;
|
|
127
|
+
const renderOutput = (0, use_asset_drag_events_1.getRenderOutputDragData)(e.dataTransfer);
|
|
128
|
+
if (renderOutput) {
|
|
129
|
+
const destination = [assetPath, renderOutput.fileName]
|
|
130
|
+
.filter(Boolean)
|
|
131
|
+
.join('/');
|
|
132
|
+
const result = await (0, copy_render_output_to_asset_1.copyRenderOutputToAsset)({
|
|
133
|
+
outputPath: renderOutput.outputPath,
|
|
134
|
+
assetPath: destination,
|
|
135
|
+
});
|
|
136
|
+
(0, NotificationCenter_1.showNotification)(result.created
|
|
137
|
+
? `Created ${destination}`
|
|
138
|
+
: `${destination} already exists`, 3000);
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
125
141
|
const { files } = e.dataTransfer;
|
|
126
142
|
if (files.length === 0) {
|
|
127
143
|
setDropLocation(null);
|
|
128
144
|
return;
|
|
129
145
|
}
|
|
130
|
-
const assetPath = dropLocation !== null && dropLocation !== void 0 ? dropLocation : null;
|
|
131
146
|
const makePath = (file) => {
|
|
132
147
|
return [assetPath, file.name].filter(Boolean).join('/');
|
|
133
148
|
};
|
|
@@ -161,7 +176,7 @@ const AssetSelector = ({ readOnlyStudio }) => {
|
|
|
161
176
|
setDropLocation(null);
|
|
162
177
|
}
|
|
163
178
|
}, [dropLocation, staticFiles]);
|
|
164
|
-
return (jsx_runtime_1.jsxs("div", { style: container, onDragOver: shouldAllowUpload ? onDragOver : undefined, onDrop: shouldAllowUpload ? onDrop : undefined, children: [
|
|
179
|
+
return (jsx_runtime_1.jsxs("div", { "data-asset-selector": true, style: container, onDragOver: shouldAllowUpload ? onDragOver : undefined, onDrop: shouldAllowUpload ? onDrop : undefined, children: [
|
|
165
180
|
jsx_runtime_1.jsx(ExplorerQuickSwitcherTrigger_1.ExplorerQuickSwitcherTrigger, { mode: "assets", showShortcut: true, tabIndex: tabIndex }), staticFiles.length === 0 ? (publicFolderExists ? (jsx_runtime_1.jsx("div", { style: emptyState, children: jsx_runtime_1.jsxs("div", { style: label, children: ["To add assets, place a file in the", ' ', jsx_runtime_1.jsx("code", { style: styles_1.inlineCodeSnippet, children: "public" }),
|
|
166
181
|
" folder of your project or drag and drop a file here."] }) })) : (jsx_runtime_1.jsx("div", { style: emptyState, children: jsx_runtime_1.jsxs("div", { style: label, children: ["To add assets, create a folder called", ' ', jsx_runtime_1.jsx("code", { style: styles_1.inlineCodeSnippet, children: "public" }),
|
|
167
182
|
" in the root of your project and place a file in it."] }) }))) : (jsx_runtime_1.jsx("div", { className: "__remotion-vertical-scrollbar", style: {
|
|
@@ -226,7 +226,7 @@ const AssetFolderItem = ({ tabIndex, item, level, parentFolder, toggleFolder, dr
|
|
|
226
226
|
backgroundColor: isDropDiv ? colors_1.WHITE_ALPHA_06 : colors_1.BACKGROUND,
|
|
227
227
|
}, children: [
|
|
228
228
|
jsx_runtime_1.jsx("div", { style: folderStyle, onPointerEnter: onPointerEnter, onPointerLeave: onPointerLeave, tabIndex: tabIndex, title: item.name, onClick: onClick, onDragEnter: (event) => {
|
|
229
|
-
if (!(0, use_asset_drag_events_1.
|
|
229
|
+
if (!(0, use_asset_drag_events_1.isAssetUploadDragEvent)(event)) {
|
|
230
230
|
return;
|
|
231
231
|
}
|
|
232
232
|
if (!item.expanded) {
|
|
@@ -235,7 +235,7 @@ const AssetFolderItem = ({ tabIndex, item, level, parentFolder, toggleFolder, dr
|
|
|
235
235
|
}, 1000);
|
|
236
236
|
}
|
|
237
237
|
}, onDragLeave: (event) => {
|
|
238
|
-
if (!(0, use_asset_drag_events_1.
|
|
238
|
+
if (!(0, use_asset_drag_events_1.isAssetUploadDragEvent)(event)) {
|
|
239
239
|
return;
|
|
240
240
|
}
|
|
241
241
|
if (openFolderTimerRef.current) {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CodingAgentIcon = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const apps_1 = require("../icons/apps");
|
|
6
|
+
const CodingAgentIcon = ({ codingAgentId, size }) => {
|
|
7
|
+
if (codingAgentId === null) {
|
|
8
|
+
return jsx_runtime_1.jsx(apps_1.AppsIcon, { height: size, width: size });
|
|
9
|
+
}
|
|
10
|
+
return (jsx_runtime_1.jsx("img", { alt: "", "aria-hidden": true, "data-coding-agent-icon": codingAgentId, draggable: false, src: `/api/app-icon/coding-agent/${codingAgentId}.png`, style: { flexShrink: 0, height: size, width: size } }));
|
|
11
|
+
};
|
|
12
|
+
exports.CodingAgentIcon = CodingAgentIcon;
|
|
@@ -5,13 +5,13 @@ 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 Checkmark_1 = require("../icons/Checkmark");
|
|
8
|
-
const
|
|
9
|
-
const
|
|
8
|
+
const editor_1 = require("../icons/editor");
|
|
9
|
+
const CodingAgentIcon_1 = require("./CodingAgentIcon");
|
|
10
10
|
const layout_1 = require("./layout");
|
|
11
|
-
const ModalButton_1 = require("./ModalButton");
|
|
12
11
|
const ComboBox_1 = require("./NewComposition/ComboBox");
|
|
13
12
|
const ValidationMessage_1 = require("./NewComposition/ValidationMessage");
|
|
14
|
-
const
|
|
13
|
+
const SettingsContext_1 = require("./SettingsContext");
|
|
14
|
+
const use_auto_save_config_1 = require("./use-auto-save-config");
|
|
15
15
|
const container = {
|
|
16
16
|
display: 'flex',
|
|
17
17
|
flex: 1,
|
|
@@ -30,7 +30,7 @@ const description = {
|
|
|
30
30
|
margin: 0,
|
|
31
31
|
};
|
|
32
32
|
const title = {
|
|
33
|
-
color: colors_1.
|
|
33
|
+
color: colors_1.LIGHT_TEXT,
|
|
34
34
|
fontFamily: 'sans-serif',
|
|
35
35
|
fontSize: 14,
|
|
36
36
|
lineHeight: 1.5,
|
|
@@ -40,8 +40,8 @@ const comboBoxStyle = {
|
|
|
40
40
|
boxSizing: 'border-box',
|
|
41
41
|
width: '100%',
|
|
42
42
|
};
|
|
43
|
-
const
|
|
44
|
-
display: '
|
|
43
|
+
const appLabel = {
|
|
44
|
+
display: 'flex',
|
|
45
45
|
alignItems: 'center',
|
|
46
46
|
gap: 8,
|
|
47
47
|
maxWidth: '100%',
|
|
@@ -51,7 +51,7 @@ const customEditorLabel = {
|
|
|
51
51
|
fontSize: 'inherit',
|
|
52
52
|
lineHeight: 'inherit',
|
|
53
53
|
};
|
|
54
|
-
const
|
|
54
|
+
const appName = {
|
|
55
55
|
minWidth: 0,
|
|
56
56
|
overflow: 'hidden',
|
|
57
57
|
textOverflow: 'ellipsis',
|
|
@@ -62,12 +62,11 @@ const customEditorName = {
|
|
|
62
62
|
lineHeight: 'inherit',
|
|
63
63
|
};
|
|
64
64
|
const NO_PREFERENCE_ID = 'no-preference';
|
|
65
|
-
const DefaultEditorSettings = (
|
|
66
|
-
const
|
|
67
|
-
const [codingAgentInfo, setCodingAgentInfo] = (0, react_1.useState)(null);
|
|
65
|
+
const DefaultEditorSettings = () => {
|
|
66
|
+
const { codingAgentInfo, editorInfo, error: settingsError, revision, } = (0, SettingsContext_1.useSettings)();
|
|
68
67
|
const [selectedEditor, setSelectedEditor] = (0, react_1.useState)(null);
|
|
69
68
|
const [selectedCodingAgent, setSelectedCodingAgent] = (0, react_1.useState)(null);
|
|
70
|
-
const [
|
|
69
|
+
const [syncedRevision, setSyncedRevision] = (0, react_1.useState)(-1);
|
|
71
70
|
const [error, setError] = (0, react_1.useState)(null);
|
|
72
71
|
const editorValues = (0, react_1.useMemo)(() => {
|
|
73
72
|
var _a;
|
|
@@ -89,9 +88,9 @@ const DefaultEditorSettings = ({ onSaved }) => {
|
|
|
89
88
|
return {
|
|
90
89
|
id: editor.id,
|
|
91
90
|
keyHint: null,
|
|
92
|
-
label:
|
|
93
|
-
jsx_runtime_1.jsx(
|
|
94
|
-
] }))
|
|
91
|
+
label: (jsx_runtime_1.jsxs("span", { style: appLabel, children: [
|
|
92
|
+
jsx_runtime_1.jsx(editor_1.EditorIcon, { editorId: editor.id, size: 18 }), jsx_runtime_1.jsx("span", { style: appName, children: editor.name })
|
|
93
|
+
] })),
|
|
95
94
|
leftItem: selectedEditor === editor.id ? jsx_runtime_1.jsx(Checkmark_1.Checkmark, {}) : null,
|
|
96
95
|
onClick: () => {
|
|
97
96
|
setSelectedEditor(editor.id);
|
|
@@ -125,7 +124,9 @@ const DefaultEditorSettings = ({ onSaved }) => {
|
|
|
125
124
|
return {
|
|
126
125
|
id: codingAgent.id,
|
|
127
126
|
keyHint: null,
|
|
128
|
-
label:
|
|
127
|
+
label: (jsx_runtime_1.jsxs("span", { style: appLabel, children: [
|
|
128
|
+
jsx_runtime_1.jsx(CodingAgentIcon_1.CodingAgentIcon, { codingAgentId: codingAgent.id, size: 18 }), jsx_runtime_1.jsx("span", { style: appName, children: codingAgent.name })
|
|
129
|
+
] })),
|
|
129
130
|
leftItem: selectedCodingAgent === codingAgent.id ? jsx_runtime_1.jsx(Checkmark_1.Checkmark, {}) : null,
|
|
130
131
|
onClick: () => {
|
|
131
132
|
setSelectedCodingAgent(codingAgent.id);
|
|
@@ -140,70 +141,59 @@ const DefaultEditorSettings = ({ onSaved }) => {
|
|
|
140
141
|
return [noPreference, ...installedCodingAgents];
|
|
141
142
|
}, [codingAgentInfo === null || codingAgentInfo === void 0 ? void 0 : codingAgentInfo.installedCodingAgents, selectedCodingAgent]);
|
|
142
143
|
(0, react_1.useEffect)(() => {
|
|
143
|
-
const controller = new AbortController();
|
|
144
|
-
Promise.all([
|
|
145
|
-
(0, call_api_1.callApi)('/api/default-editor-info', {}, controller.signal),
|
|
146
|
-
(0, call_api_1.callApi)('/api/default-coding-agent-info', {}, controller.signal),
|
|
147
|
-
])
|
|
148
|
-
.then(([editorResponse, codingAgentResponse]) => {
|
|
149
|
-
setEditorInfo(editorResponse);
|
|
150
|
-
setSelectedEditor(editorResponse.defaultEditor !== null &&
|
|
151
|
-
editorResponse.installedEditors.some(({ id }) => id === editorResponse.defaultEditor)
|
|
152
|
-
? editorResponse.defaultEditor
|
|
153
|
-
: null);
|
|
154
|
-
setCodingAgentInfo(codingAgentResponse);
|
|
155
|
-
setSelectedCodingAgent(codingAgentResponse.defaultCodingAgent !== null &&
|
|
156
|
-
codingAgentResponse.installedCodingAgents.some(({ id }) => id === codingAgentResponse.defaultCodingAgent)
|
|
157
|
-
? codingAgentResponse.defaultCodingAgent
|
|
158
|
-
: null);
|
|
159
|
-
})
|
|
160
|
-
.catch((err) => {
|
|
161
|
-
if (controller.signal.aborted) {
|
|
162
|
-
return;
|
|
163
|
-
}
|
|
164
|
-
setError(err.message);
|
|
165
|
-
});
|
|
166
|
-
return () => controller.abort();
|
|
167
|
-
}, []);
|
|
168
|
-
const submit = (0, react_1.useCallback)(async () => {
|
|
169
144
|
if (editorInfo === null || codingAgentInfo === null) {
|
|
170
145
|
return;
|
|
171
146
|
}
|
|
172
|
-
|
|
147
|
+
setSelectedEditor(editorInfo.defaultEditor !== null &&
|
|
148
|
+
editorInfo.installedEditors.some(({ id }) => id === editorInfo.defaultEditor)
|
|
149
|
+
? editorInfo.defaultEditor
|
|
150
|
+
: null);
|
|
151
|
+
setSelectedCodingAgent(codingAgentInfo.defaultCodingAgent !== null &&
|
|
152
|
+
codingAgentInfo.installedCodingAgents.some(({ id }) => id === codingAgentInfo.defaultCodingAgent)
|
|
153
|
+
? codingAgentInfo.defaultCodingAgent
|
|
154
|
+
: null);
|
|
155
|
+
setSyncedRevision(revision);
|
|
173
156
|
setError(null);
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
157
|
+
}, [codingAgentInfo, editorInfo, revision]);
|
|
158
|
+
const updates = (0, react_1.useMemo)(() => {
|
|
159
|
+
// The browser only receives an opaque ID for a custom editor. Omitting the
|
|
160
|
+
// update preserves its executable and arguments in the existing config call.
|
|
161
|
+
const editorUpdate = selectedEditor === 'custom'
|
|
162
|
+
? []
|
|
163
|
+
: [
|
|
164
|
+
selectedEditor === null
|
|
165
|
+
? { setter: 'setDefaultEditor', type: 'delete' }
|
|
166
|
+
: {
|
|
167
|
+
setter: 'setDefaultEditor',
|
|
168
|
+
type: 'set',
|
|
169
|
+
value: selectedEditor,
|
|
170
|
+
},
|
|
171
|
+
];
|
|
172
|
+
return [
|
|
173
|
+
...editorUpdate,
|
|
174
|
+
selectedCodingAgent === null
|
|
175
|
+
? { setter: 'setDefaultCodingAgent', type: 'delete' }
|
|
176
|
+
: {
|
|
177
|
+
setter: 'setDefaultCodingAgent',
|
|
178
|
+
type: 'set',
|
|
179
|
+
value: selectedCodingAgent,
|
|
180
|
+
},
|
|
181
|
+
];
|
|
182
|
+
}, [selectedCodingAgent, selectedEditor]);
|
|
183
|
+
const ready = editorInfo !== null &&
|
|
184
|
+
codingAgentInfo !== null &&
|
|
185
|
+
syncedRevision === revision;
|
|
186
|
+
(0, use_auto_save_config_1.useAutoSaveConfig)({
|
|
187
|
+
enabled: ready,
|
|
188
|
+
onError: setError,
|
|
189
|
+
ready,
|
|
190
|
+
syncRevision: syncedRevision,
|
|
191
|
+
updates,
|
|
192
|
+
});
|
|
193
|
+
const displayedError = error !== null && error !== void 0 ? error : settingsError;
|
|
194
|
+
return (jsx_runtime_1.jsx("div", { style: container, children: jsx_runtime_1.jsxs("div", { style: content, children: [
|
|
195
|
+
jsx_runtime_1.jsx("p", { style: title, children: "Default editor" }), jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), editorInfo === null && displayedError === null ? (jsx_runtime_1.jsx("p", { style: description, children: "Loading installed editors..." })) : null, (editorInfo === null || editorInfo === void 0 ? void 0 : editorInfo.installedEditors.length) === 0 ? (jsx_runtime_1.jsx("p", { style: description, children: "No supported editors were found on this computer." })) : null, editorInfo === null ? null : (jsx_runtime_1.jsx(ComboBox_1.Combobox, { values: editorValues, selectedId: selectedEditor !== null && selectedEditor !== void 0 ? selectedEditor : NO_PREFERENCE_ID, style: comboBoxStyle, title: "Default editor" })), jsx_runtime_1.jsx(layout_1.Spacing, { y: 2, block: true }), jsx_runtime_1.jsx("p", { style: title, children: "Default coding agent" }), jsx_runtime_1.jsx(layout_1.Spacing, { y: 1, block: true }), codingAgentInfo === null && displayedError === null ? (jsx_runtime_1.jsx("p", { style: description, children: "Loading installed coding agents..." })) : null, (codingAgentInfo === null || codingAgentInfo === void 0 ? void 0 : codingAgentInfo.installedCodingAgents.length) === 0 ? (jsx_runtime_1.jsx("p", { style: description, children: "No supported coding agents were found on this computer." })) : null, codingAgentInfo === null ? null : (jsx_runtime_1.jsx(ComboBox_1.Combobox, { values: codingAgentValues, selectedId: selectedCodingAgent !== null && selectedCodingAgent !== void 0 ? selectedCodingAgent : NO_PREFERENCE_ID, style: comboBoxStyle, title: "Default coding agent" })), displayedError ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
196
|
+
jsx_runtime_1.jsx(layout_1.Spacing, { y: 1.5 }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { message: displayedError, align: "flex-start", type: "error" })
|
|
197
|
+
] })) : null] }) }));
|
|
208
198
|
};
|
|
209
199
|
exports.DefaultEditorSettings = DefaultEditorSettings;
|
|
@@ -4,14 +4,13 @@ exports.LicenseSettings = 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
|
-
const call_api_1 = require("./call-api");
|
|
8
7
|
const Checkbox_1 = require("./Checkbox");
|
|
9
8
|
const layout_1 = require("./layout");
|
|
10
9
|
const LicenseKeyValidation_1 = require("./LicenseKeyValidation");
|
|
11
|
-
const ModalButton_1 = require("./ModalButton");
|
|
12
10
|
const RemInput_1 = require("./NewComposition/RemInput");
|
|
13
11
|
const ValidationMessage_1 = require("./NewComposition/ValidationMessage");
|
|
14
|
-
const
|
|
12
|
+
const SettingsContext_1 = require("./SettingsContext");
|
|
13
|
+
const use_auto_save_config_1 = require("./use-auto-save-config");
|
|
15
14
|
const container = {
|
|
16
15
|
display: 'flex',
|
|
17
16
|
flex: 1,
|
|
@@ -60,19 +59,34 @@ const inputLabel = {
|
|
|
60
59
|
marginBottom: 6,
|
|
61
60
|
marginTop: 10,
|
|
62
61
|
};
|
|
63
|
-
const LicenseSettings = (
|
|
64
|
-
const
|
|
62
|
+
const LicenseSettings = () => {
|
|
63
|
+
const { error: settingsError, publicLicenseKey, revision } = (0, SettingsContext_1.useSettings)();
|
|
64
|
+
const initialLicenseType = publicLicenseKey === 'free-license'
|
|
65
65
|
? 'free'
|
|
66
|
-
:
|
|
66
|
+
: publicLicenseKey === null
|
|
67
67
|
? null
|
|
68
68
|
: 'company';
|
|
69
69
|
const [licenseType, setLicenseType] = (0, react_1.useState)(initialLicenseType);
|
|
70
|
-
const [companyLicenseKey, setCompanyLicenseKey] = (0, react_1.useState)(initialLicenseType === 'company' ? (
|
|
71
|
-
const [
|
|
70
|
+
const [companyLicenseKey, setCompanyLicenseKey] = (0, react_1.useState)(initialLicenseType === 'company' ? (publicLicenseKey !== null && publicLicenseKey !== void 0 ? publicLicenseKey : '') : '');
|
|
71
|
+
const [companyLicenseKeyToSave, setCompanyLicenseKeyToSave] = (0, react_1.useState)(companyLicenseKey);
|
|
72
72
|
const [error, setError] = (0, react_1.useState)(null);
|
|
73
|
+
const [syncedRevision, setSyncedRevision] = (0, react_1.useState)(revision);
|
|
73
74
|
const [isValidatingLicenseKey, setIsValidatingLicenseKey] = (0, react_1.useState)(false);
|
|
74
75
|
const [remoteValidationMessage, setRemoteValidationMessage] = (0, react_1.useState)(null);
|
|
75
76
|
const [licenseKeyDetails, setLicenseKeyDetails] = (0, react_1.useState)(null);
|
|
77
|
+
(0, react_1.useEffect)(() => {
|
|
78
|
+
const nextLicenseType = publicLicenseKey === 'free-license'
|
|
79
|
+
? 'free'
|
|
80
|
+
: publicLicenseKey === null
|
|
81
|
+
? null
|
|
82
|
+
: 'company';
|
|
83
|
+
const nextCompanyLicenseKey = nextLicenseType === 'company' ? (publicLicenseKey !== null && publicLicenseKey !== void 0 ? publicLicenseKey : '') : '';
|
|
84
|
+
setLicenseType(nextLicenseType);
|
|
85
|
+
setCompanyLicenseKey(nextCompanyLicenseKey);
|
|
86
|
+
setCompanyLicenseKeyToSave(nextCompanyLicenseKey);
|
|
87
|
+
setSyncedRevision(revision);
|
|
88
|
+
setError(null);
|
|
89
|
+
}, [publicLicenseKey, revision]);
|
|
76
90
|
const toggleLicenseType = (0, react_1.useCallback)((newLicenseType) => {
|
|
77
91
|
setLicenseType((currentLicenseType) => currentLicenseType === newLicenseType ? null : newLicenseType);
|
|
78
92
|
setError(null);
|
|
@@ -83,15 +97,6 @@ const LicenseSettings = ({ initialPublicLicenseKey, onSaved }) => {
|
|
|
83
97
|
const toggleCompanyLicense = (0, react_1.useCallback)(() => {
|
|
84
98
|
toggleLicenseType('company');
|
|
85
99
|
}, [toggleLicenseType]);
|
|
86
|
-
const publicLicenseKey = (0, react_1.useMemo)(() => {
|
|
87
|
-
if (licenseType === 'free') {
|
|
88
|
-
return 'free-license';
|
|
89
|
-
}
|
|
90
|
-
if (licenseType === 'company') {
|
|
91
|
-
return companyLicenseKey.trim();
|
|
92
|
-
}
|
|
93
|
-
return '';
|
|
94
|
-
}, [companyLicenseKey, licenseType]);
|
|
95
100
|
const localLicenseKeyValidation = (0, react_1.useMemo)(() => (0, LicenseKeyValidation_1.validateLicenseKey)(companyLicenseKey.trim()), [companyLicenseKey]);
|
|
96
101
|
(0, react_1.useEffect)(() => {
|
|
97
102
|
let cancelled = false;
|
|
@@ -131,72 +136,75 @@ const LicenseSettings = ({ initialPublicLicenseKey, onSaved }) => {
|
|
|
131
136
|
const companyLicenseKeyIsValid = localLicenseKeyValidation.valid &&
|
|
132
137
|
(licenseKeyDetails === null || licenseKeyDetails === void 0 ? void 0 : licenseKeyDetails.isValid) === true &&
|
|
133
138
|
!isValidatingLicenseKey;
|
|
134
|
-
const
|
|
135
|
-
if (
|
|
136
|
-
|
|
137
|
-
? 'Select a license type.'
|
|
138
|
-
: 'Enter your public license key.');
|
|
139
|
-
return;
|
|
140
|
-
}
|
|
141
|
-
if (licenseType === 'company' && !companyLicenseKeyIsValid) {
|
|
142
|
-
return;
|
|
139
|
+
const publicLicenseKeyToSave = (0, react_1.useMemo)(() => {
|
|
140
|
+
if (licenseType === 'free') {
|
|
141
|
+
return 'free-license';
|
|
143
142
|
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
try {
|
|
147
|
-
const response = await (0, call_api_1.callApi)('/api/update-public-license', {
|
|
148
|
-
publicLicenseKey,
|
|
149
|
-
});
|
|
150
|
-
if (!response.success) {
|
|
151
|
-
setError(response.reason);
|
|
152
|
-
setIsSubmitting(false);
|
|
153
|
-
return;
|
|
154
|
-
}
|
|
155
|
-
onSaved();
|
|
143
|
+
if (licenseType === 'company') {
|
|
144
|
+
return companyLicenseKeyToSave;
|
|
156
145
|
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
146
|
+
return '';
|
|
147
|
+
}, [companyLicenseKeyToSave, licenseType]);
|
|
148
|
+
const updates = (0, react_1.useMemo)(() => {
|
|
149
|
+
if (licenseType === null) {
|
|
150
|
+
return [{ setter: 'setPublicLicenseKey', type: 'delete' }];
|
|
160
151
|
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
152
|
+
return [
|
|
153
|
+
{
|
|
154
|
+
setter: 'setPublicLicenseKey',
|
|
155
|
+
type: 'set',
|
|
156
|
+
value: publicLicenseKeyToSave,
|
|
157
|
+
},
|
|
158
|
+
];
|
|
159
|
+
}, [licenseType, publicLicenseKeyToSave]);
|
|
160
|
+
(0, use_auto_save_config_1.useAutoSaveConfig)({
|
|
161
|
+
enabled: licenseType === null ||
|
|
162
|
+
(publicLicenseKeyToSave.length > 0 &&
|
|
163
|
+
(licenseType !== 'company' ||
|
|
164
|
+
(companyLicenseKeyToSave === companyLicenseKey.trim() &&
|
|
165
|
+
companyLicenseKeyIsValid))),
|
|
166
|
+
onError: setError,
|
|
167
|
+
ready: syncedRevision === revision,
|
|
168
|
+
syncRevision: syncedRevision,
|
|
169
|
+
updates,
|
|
170
|
+
});
|
|
171
|
+
const displayedError = error !== null && error !== void 0 ? error : settingsError;
|
|
172
|
+
return (jsx_runtime_1.jsx("div", { style: container, children: jsx_runtime_1.jsxs("div", { style: content, children: [
|
|
173
|
+
jsx_runtime_1.jsxs("p", { style: description, children: ["Remotion is free to use if you are an individual or company with a headcount of 3 or less.",
|
|
174
|
+
jsx_runtime_1.jsx("br", {}),
|
|
175
|
+
"If used in an organization with 4 people or more, a", ' ', jsx_runtime_1.jsx("a", { style: descriptionLink, href: "https://remotion.pro/license", children: "Company License" }), ' needs to be obtained.'] }), jsx_runtime_1.jsx(layout_1.Spacing, { y: 2 }), jsx_runtime_1.jsxs("div", { style: checkboxRow, onClick: (event) => {
|
|
176
|
+
if (!(event.target instanceof HTMLInputElement)) {
|
|
177
|
+
toggleFreeLicense();
|
|
178
|
+
}
|
|
179
|
+
}, children: [
|
|
180
|
+
jsx_runtime_1.jsx(Checkbox_1.Checkbox, { checked: licenseType === 'free', onChange: toggleFreeLicense, 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" })
|
|
181
|
+
] }), jsx_runtime_1.jsxs("div", { style: checkboxRow, onClick: (event) => {
|
|
182
|
+
if (!(event.target instanceof HTMLInputElement)) {
|
|
183
|
+
toggleCompanyLicense();
|
|
184
|
+
}
|
|
185
|
+
}, children: [
|
|
186
|
+
jsx_runtime_1.jsx(Checkbox_1.Checkbox, { checked: licenseType === 'company', onChange: toggleCompanyLicense, 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" })
|
|
187
|
+
] }), licenseType === 'company' ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
188
|
+
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",
|
|
189
|
+
jsx_runtime_1.jsx(RemInput_1.RemotionInput, { status: localLicenseKeyValidation.message ||
|
|
190
|
+
remoteValidationMessage ||
|
|
191
|
+
(licenseKeyDetails !== null &&
|
|
192
|
+
!(0, LicenseKeyValidation_1.hasActiveCompanyLicense)(licenseKeyDetails))
|
|
193
|
+
? 'error'
|
|
194
|
+
: 'ok', rightAlign: false, value: companyLicenseKey, onChange: (event) => {
|
|
195
|
+
setCompanyLicenseKey(event.target.value);
|
|
196
|
+
setError(null);
|
|
197
|
+
}, onBlur: () => {
|
|
198
|
+
setCompanyLicenseKeyToSave(companyLicenseKey.trim());
|
|
199
|
+
}, placeholder: "rm_pub_...", autoFocus: true })
|
|
200
|
+
] }), localLicenseKeyValidation.message ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
201
|
+
jsx_runtime_1.jsx(layout_1.Spacing, { y: 1 }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { message: localLicenseKeyValidation.message, align: "flex-start", type: "error" })
|
|
202
|
+
] })) : null, remoteValidationMessage ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
203
|
+
jsx_runtime_1.jsx(layout_1.Spacing, { y: 1 }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { message: remoteValidationMessage, align: "flex-start", type: "error" })
|
|
204
|
+
] })) : null, isValidatingLicenseKey ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
205
|
+
jsx_runtime_1.jsx(layout_1.Spacing, { y: 1 }), jsx_runtime_1.jsx("p", { style: description, children: "Loading license key details..." })
|
|
206
|
+
] })) : null, licenseKeyDetails ? (jsx_runtime_1.jsx(LicenseKeyValidation_1.LicenseKeyDetailsDisplay, { details: licenseKeyDetails })) : null] })) : null, displayedError ? (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
207
|
+
jsx_runtime_1.jsx(layout_1.Spacing, { y: 1.5 }), jsx_runtime_1.jsx(ValidationMessage_1.ValidationMessage, { message: displayedError, align: "flex-start", type: "error" })
|
|
208
|
+
] })) : null] }) }));
|
|
201
209
|
};
|
|
202
210
|
exports.LicenseSettings = LicenseSettings;
|
|
@@ -14,5 +14,6 @@ export declare const ContextMenu: React.ForwardRefExoticComponent<ContextMenuPro
|
|
|
14
14
|
export declare const ContextMenuForTarget: React.FC<{
|
|
15
15
|
readonly triggerRef: React.RefObject<HTMLElement | SVGElement | null>;
|
|
16
16
|
readonly getItems: ContextMenuItemsFactory;
|
|
17
|
+
readonly onOpenChange?: (open: boolean) => void;
|
|
17
18
|
}>;
|
|
18
19
|
export {};
|