@remotion/studio 4.0.505 → 4.0.507
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/api/copy-render-output-to-asset.d.ts +4 -0
- package/dist/api/copy-render-output-to-asset.js +11 -0
- package/dist/api/install-package.d.ts +2 -3
- package/dist/api/install-package.js +1 -3
- package/dist/api/visual-control.d.ts +3 -0
- package/dist/api/visual-control.js +3 -0
- package/dist/components/AssetSelector.js +19 -4
- package/dist/components/AssetSelectorItem.js +3 -3
- package/dist/components/Canvas.js +2 -0
- package/dist/components/CodingAgentIcon.d.ts +4 -0
- package/dist/components/CodingAgentIcon.js +17 -0
- package/dist/components/CompositionSelector.js +1 -1
- package/dist/components/CompositionSelectorItem.js +1 -1
- package/dist/components/ConfigureDefaultEditorModal.d.ts +1 -1
- package/dist/components/ConfigureDefaultEditorModal.js +117 -69
- package/dist/components/ConfigureLicenseModal.d.ts +1 -3
- package/dist/components/ConfigureLicenseModal.js +105 -89
- package/dist/components/ConfirmationDialog.js +2 -2
- package/dist/components/ContextMenu.js +10 -8
- package/dist/components/Editor.js +2 -0
- package/dist/components/EditorContexts.js +6 -5
- package/dist/components/EffectPickerModal.js +1 -1
- package/dist/components/ExpandedTracksProvider.js +10 -53
- package/dist/components/GlobalKeybindings.js +3 -2
- package/dist/components/InlineCaptionInspector.d.ts +2 -2
- package/dist/components/InlineDropdown.d.ts +2 -1
- package/dist/components/InlineDropdown.js +10 -4
- package/dist/components/InspectorLocationCopy.js +8 -8
- package/dist/components/InspectorOpenInEditor.d.ts +2 -0
- package/dist/components/InspectorOpenInEditor.js +63 -49
- package/dist/components/InspectorPanel/AlignmentControls.js +5 -2
- package/dist/components/InspectorPanel/CompositionInspector.js +15 -1
- package/dist/components/InspectorPanel/ConnectedCompositionsSection.js +1 -1
- package/dist/components/InspectorPanel/EasingInspector.js +7 -4
- package/dist/components/InspectorPanel/KeyframeInspector.js +5 -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/common.d.ts +1 -0
- package/dist/components/InspectorPanel/common.js +2 -2
- package/dist/components/InspectorPanel/use-composition-actions.js +4 -1
- package/dist/components/InspectorSequenceSection.js +4 -4
- package/dist/components/InstallPackage.js +1 -1
- 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 -0
- package/dist/components/MenuToolbar.js +1 -1
- package/dist/components/ModalFooter.d.ts +1 -0
- package/dist/components/ModalFooter.js +6 -2
- package/dist/components/ModalHeader.js +1 -1
- package/dist/components/Modals.js +18 -7
- package/dist/components/ModalsProvider.js +5 -6
- package/dist/components/NewComposition/CodemodFooter.js +1 -1
- package/dist/components/NewComposition/ComboBox.d.ts +6 -1
- package/dist/components/NewComposition/DismissableModal.js +1 -1
- package/dist/components/NewComposition/MenuContent.js +27 -19
- package/dist/components/NewComposition/RenameStaticFile.js +1 -1
- package/dist/components/NewComposition/menu-typeahead.js +2 -2
- package/dist/components/OverrideInputProps.js +1 -1
- package/dist/components/PlayPause.js +2 -1
- package/dist/components/PlaybackKeyboardShortcutsManager.js +7 -5
- package/dist/components/Preview.js +29 -4
- package/dist/components/PreviewToolbarOverflowButton.js +4 -2
- package/dist/components/QuickSwitcher/ExplorerQuickSwitcherTrigger.js +1 -1
- package/dist/components/QuickSwitcher/QuickSwitcherContent.js +1 -1
- package/dist/components/RenderButton.d.ts +3 -3
- package/dist/components/RenderButton.js +42 -7
- package/dist/components/RenderModal/RenderStatusModal.js +1 -1
- package/dist/components/RenderModal/SchemaEditor/ZodEnumEditor.d.ts +1 -0
- package/dist/components/RenderModal/SchemaEditor/ZodEnumEditor.js +2 -2
- package/dist/components/RenderModal/SchemaEditor/ZodOrNullishEditor.js +3 -3
- package/dist/components/RenderModal/SchemaEditor/ZodSwitch.js +1 -1
- package/dist/components/RenderModal/ServerRenderModal.js +5 -1
- package/dist/components/RenderModal/WebRenderModal.js +3 -2
- package/dist/components/RenderQueue/RenderQueueError.js +1 -1
- package/dist/components/RenderQueue/RenderQueueItem.js +8 -2
- package/dist/components/RenderQueue/RenderQueueItemStatus.js +1 -1
- package/dist/components/RenderQueue/RenderQueueProgressMessage.js +1 -1
- package/dist/components/RenderQueue/RenderQueueRepeat.js +1 -1
- 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/SelectedOutlineElement.d.ts +14 -17
- package/dist/components/SelectedOutlineElement.js +113 -931
- package/dist/components/SelectedOutlineKeyboardControls.d.ts +7 -0
- package/dist/components/SelectedOutlineKeyboardControls.js +261 -0
- package/dist/components/SelectedOutlineOverlay.d.ts +6 -13
- package/dist/components/SelectedOutlineOverlay.js +360 -832
- package/dist/components/SelectedOutlinePolygon.d.ts +25 -0
- package/dist/components/SelectedOutlinePolygon.js +359 -0
- package/dist/components/SelectedOutlineRenderer.d.ts +18 -0
- package/dist/components/SelectedOutlineRenderer.js +208 -0
- package/dist/components/SelectedOutlineRotationCornerHandle.d.ts +16 -0
- package/dist/components/SelectedOutlineRotationCornerHandle.js +269 -0
- package/dist/components/SelectedOutlineScaleEdgeLine.d.ts +16 -0
- package/dist/components/SelectedOutlineScaleEdgeLine.js +211 -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 +286 -0
- package/dist/components/SelectedOutlineUvControls.d.ts +3 -9
- package/dist/components/SelectedOutlineUvControls.js +57 -12
- package/dist/components/SettingsContext.d.ts +15 -0
- package/dist/components/SettingsContext.js +116 -0
- package/dist/components/SettingsModal.d.ts +7 -0
- package/dist/components/SettingsModal.js +56 -0
- package/dist/components/SettingsModalFooter.d.ts +2 -0
- package/dist/components/SettingsModalFooter.js +44 -0
- package/dist/components/ShowOutlinesProvider.js +2 -3
- package/dist/components/SidebarRenderButton.js +1 -1
- package/dist/components/SvgImportDialog.js +2 -2
- package/dist/components/TimeValue.js +1 -1
- package/dist/components/Timeline/EasingEditorModal.js +66 -22
- package/dist/components/Timeline/Timeline.js +23 -5
- package/dist/components/Timeline/TimelineAssetField.js +1 -1
- package/dist/components/Timeline/TimelineDragHandler.js +3 -3
- package/dist/components/Timeline/TimelineDuplicateCount.d.ts +4 -0
- package/dist/components/Timeline/TimelineDuplicateCount.js +28 -0
- package/dist/components/Timeline/TimelineEffectPropItem.js +5 -3
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +3 -23
- package/dist/components/Timeline/TimelineExpandedRow.d.ts +4 -2
- package/dist/components/Timeline/TimelineExpandedRow.js +2 -2
- package/dist/components/Timeline/TimelineExpandedTrackKeyframes.d.ts +4 -2
- package/dist/components/Timeline/TimelineExpandedTrackKeyframes.js +11 -1
- package/dist/components/Timeline/TimelineFontFamilyField.js +3 -1
- package/dist/components/Timeline/TimelineKeyframeControls.js +1 -0
- package/dist/components/Timeline/TimelineSelection.js +1 -0
- package/dist/components/Timeline/TimelineSequence.js +28 -25
- package/dist/components/Timeline/TimelineSequenceItem.js +74 -58
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +1 -1
- package/dist/components/Timeline/TimelineTrack.js +2 -1
- package/dist/components/Timeline/get-sequence-context-menu-items.d.ts +6 -3
- package/dist/components/Timeline/get-sequence-context-menu-items.js +58 -53
- package/dist/components/Timeline/reset-selected-timeline-props.js +1 -1
- package/dist/components/Timeline/should-subscribe-to-sequence-props.d.ts +1 -1
- package/dist/components/Timeline/timeline-asset-link.d.ts +2 -2
- package/dist/components/Timeline/timeline-asset-link.js +2 -2
- package/dist/components/Timeline/use-expanded-track-keyframe-rows.js +38 -2
- 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} +20 -4
- package/dist/components/Timeline/use-timeline-asset-drop.js +1 -0
- package/dist/components/Timeline/use-timeline-expanded-tree.d.ts +5 -0
- package/dist/components/Timeline/use-timeline-expanded-tree.js +50 -1
- package/dist/components/Timeline/use-timeline-height.js +20 -0
- package/dist/components/TimelineInOutToggle.js +5 -1
- package/dist/components/TopPanel.js +16 -0
- package/dist/components/UpdateCheck.js +1 -1
- package/dist/components/effect-drag-and-drop.js +1 -1
- package/dist/components/get-open-in-menu-items.d.ts +12 -0
- package/dist/components/get-open-in-menu-items.js +83 -0
- package/dist/components/handle-drop.d.ts +2 -1
- package/dist/components/handle-drop.js +12 -2
- package/dist/components/import-assets.d.ts +18 -6
- package/dist/components/import-assets.js +76 -32
- package/dist/components/selected-outline-measurement.d.ts +2 -2
- 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 +9 -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-7pgk8h5m.js → chunk-ptnd65a9.js} +14596 -12725
- package/dist/esm/internals.mjs +14595 -12724
- package/dist/esm/previewEntry.mjs +12726 -10855
- 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.d.ts +3 -1
- package/dist/helpers/client-id.js +28 -4
- package/dist/helpers/format-file-location.d.ts +1 -1
- package/dist/helpers/format-file-location.js +3 -3
- package/dist/helpers/install-required-package.d.ts +3 -3
- package/dist/helpers/install-required-package.js +1 -6
- package/dist/helpers/migrate-expanded-tracks-for-subscription-key.js +3 -3
- package/dist/helpers/open-in-editor.d.ts +1 -0
- package/dist/helpers/open-in-editor.js +5 -1
- package/dist/helpers/studio-fit-padding.d.ts +1 -1
- package/dist/helpers/studio-fit-padding.js +1 -1
- package/dist/helpers/studio-runtime-config.js +3 -0
- package/dist/helpers/timeline-layout.d.ts +2 -1
- package/dist/helpers/timeline-layout.js +5 -2
- 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 +25 -35
- package/dist/helpers/use-runtime-values.d.ts +9 -0
- package/dist/helpers/use-runtime-values.js +76 -0
- package/dist/icons/apps.d.ts +2 -0
- package/dist/icons/apps.js +7 -0
- package/dist/icons/browse-elements.d.ts +4 -0
- package/dist/icons/browse-elements.js +10 -0
- package/dist/state/modals.d.ts +5 -6
- package/dist/state/modals.js +5 -3
- package/dist/state/timeline-sequence-hover.d.ts +9 -3
- package/dist/state/timeline-sequence-hover.js +63 -12
- package/package.json +12 -12
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
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 modals_1 = require("../state/modals");
|
|
8
|
-
const call_api_1 = require("./call-api");
|
|
9
7
|
const Checkbox_1 = require("./Checkbox");
|
|
10
8
|
const layout_1 = require("./layout");
|
|
11
9
|
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
10
|
const RemInput_1 = require("./NewComposition/RemInput");
|
|
17
11
|
const ValidationMessage_1 = require("./NewComposition/ValidationMessage");
|
|
12
|
+
const SettingsContext_1 = require("./SettingsContext");
|
|
13
|
+
const use_auto_save_config_1 = require("./use-auto-save-config");
|
|
14
|
+
const container = {
|
|
15
|
+
display: 'flex',
|
|
16
|
+
flex: 1,
|
|
17
|
+
flexDirection: 'column',
|
|
18
|
+
minWidth: 0,
|
|
19
|
+
};
|
|
18
20
|
const content = {
|
|
21
|
+
flex: 1,
|
|
19
22
|
padding: 16,
|
|
20
|
-
width: 540,
|
|
21
|
-
maxWidth: 'calc(100vw - 40px)',
|
|
22
23
|
};
|
|
23
24
|
const description = {
|
|
24
25
|
color: colors_1.LIGHT_TEXT,
|
|
@@ -26,7 +27,6 @@ const description = {
|
|
|
26
27
|
fontSize: 14,
|
|
27
28
|
lineHeight: 1.5,
|
|
28
29
|
margin: 0,
|
|
29
|
-
marginTop: 10,
|
|
30
30
|
};
|
|
31
31
|
const descriptionLink = {
|
|
32
32
|
color: colors_1.WHITE,
|
|
@@ -59,40 +59,44 @@ const inputLabel = {
|
|
|
59
59
|
marginBottom: 6,
|
|
60
60
|
marginTop: 10,
|
|
61
61
|
};
|
|
62
|
-
const
|
|
63
|
-
const {
|
|
64
|
-
const initialLicenseType =
|
|
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);
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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);
|
|
81
88
|
setError(null);
|
|
82
|
-
}, []);
|
|
83
|
-
const
|
|
84
|
-
setLicenseType(
|
|
89
|
+
}, [publicLicenseKey, revision]);
|
|
90
|
+
const toggleLicenseType = (0, react_1.useCallback)((newLicenseType) => {
|
|
91
|
+
setLicenseType((currentLicenseType) => currentLicenseType === newLicenseType ? null : newLicenseType);
|
|
85
92
|
setError(null);
|
|
86
93
|
}, []);
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
-
return '';
|
|
95
|
-
}, [companyLicenseKey, licenseType]);
|
|
94
|
+
const toggleFreeLicense = (0, react_1.useCallback)(() => {
|
|
95
|
+
toggleLicenseType('free');
|
|
96
|
+
}, [toggleLicenseType]);
|
|
97
|
+
const toggleCompanyLicense = (0, react_1.useCallback)(() => {
|
|
98
|
+
toggleLicenseType('company');
|
|
99
|
+
}, [toggleLicenseType]);
|
|
96
100
|
const localLicenseKeyValidation = (0, react_1.useMemo)(() => (0, LicenseKeyValidation_1.validateLicenseKey)(companyLicenseKey.trim()), [companyLicenseKey]);
|
|
97
101
|
(0, react_1.useEffect)(() => {
|
|
98
102
|
let cancelled = false;
|
|
@@ -132,63 +136,75 @@ const ConfigureLicenseModal = ({ initialPublicLicenseKey }) => {
|
|
|
132
136
|
const companyLicenseKeyIsValid = localLicenseKeyValidation.valid &&
|
|
133
137
|
(licenseKeyDetails === null || licenseKeyDetails === void 0 ? void 0 : licenseKeyDetails.isValid) === true &&
|
|
134
138
|
!isValidatingLicenseKey;
|
|
135
|
-
const
|
|
136
|
-
if (
|
|
137
|
-
|
|
138
|
-
? 'Select a license type.'
|
|
139
|
-
: 'Enter your public license key.');
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
|
-
if (licenseType === 'company' && !companyLicenseKeyIsValid) {
|
|
143
|
-
return;
|
|
139
|
+
const publicLicenseKeyToSave = (0, react_1.useMemo)(() => {
|
|
140
|
+
if (licenseType === 'free') {
|
|
141
|
+
return 'free-license';
|
|
144
142
|
}
|
|
145
|
-
|
|
146
|
-
|
|
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();
|
|
143
|
+
if (licenseType === 'company') {
|
|
144
|
+
return companyLicenseKeyToSave;
|
|
157
145
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
146
|
+
return '';
|
|
147
|
+
}, [companyLicenseKeyToSave, licenseType]);
|
|
148
|
+
const updates = (0, react_1.useMemo)(() => {
|
|
149
|
+
if (licenseType === null) {
|
|
150
|
+
return [{ setter: 'setPublicLicenseKey', type: 'delete' }];
|
|
161
151
|
}
|
|
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
|
-
|
|
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] }) }));
|
|
193
209
|
};
|
|
194
|
-
exports.
|
|
210
|
+
exports.LicenseSettings = LicenseSettings;
|
|
@@ -23,7 +23,7 @@ const footerStyle = {
|
|
|
23
23
|
minWidth: 0,
|
|
24
24
|
};
|
|
25
25
|
const useConfirmationDialog = () => {
|
|
26
|
-
const { setSelectedModal } = (0, react_1.useContext)(modals_1.
|
|
26
|
+
const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
|
|
27
27
|
return (0, react_1.useCallback)((options) => {
|
|
28
28
|
return new Promise((resolve) => {
|
|
29
29
|
var _a, _b;
|
|
@@ -50,7 +50,7 @@ const useConfirmationDialog = () => {
|
|
|
50
50
|
};
|
|
51
51
|
exports.useConfirmationDialog = useConfirmationDialog;
|
|
52
52
|
const ConfirmationDialog = ({ state }) => {
|
|
53
|
-
const { setSelectedModal } = (0, react_1.useContext)(modals_1.
|
|
53
|
+
const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
|
|
54
54
|
const settledRef = (0, react_1.useRef)(false);
|
|
55
55
|
const closeCurrentModal = (0, react_1.useCallback)(() => {
|
|
56
56
|
setSelectedModal((modal) => (modal === null || modal === void 0 ? void 0 : modal.type) === 'confirmation-dialog' && modal.id === state.id
|
|
@@ -44,6 +44,7 @@ const react_dom_1 = __importDefault(require("react-dom"));
|
|
|
44
44
|
const mobile_layout_1 = require("../helpers/mobile-layout");
|
|
45
45
|
const noop_1 = require("../helpers/noop");
|
|
46
46
|
const z_index_1 = require("../state/z-index");
|
|
47
|
+
const menu_tree_context_1 = require("./Menu/menu-tree-context");
|
|
47
48
|
const portals_1 = require("./Menu/portals");
|
|
48
49
|
const styles_1 = require("./Menu/styles");
|
|
49
50
|
const MenuContent_1 = require("./NewComposition/MenuContent");
|
|
@@ -70,8 +71,7 @@ const notifyContextMenuOpened = (id) => {
|
|
|
70
71
|
detail: id,
|
|
71
72
|
}));
|
|
72
73
|
};
|
|
73
|
-
const ContextMenuPortal = ({ sizeSource, currentZIndex, onHide, opened }) => {
|
|
74
|
-
const menuRef = (0, react_1.useRef)(null);
|
|
74
|
+
const ContextMenuPortal = ({ menuTreeId, sizeSource, currentZIndex, onHide, opened }) => {
|
|
75
75
|
const size = player_1.PlayerInternals.useElementSize(sizeSource, {
|
|
76
76
|
triggerOnWindowResize: true,
|
|
77
77
|
shouldApplyCssTransforms: true,
|
|
@@ -138,11 +138,11 @@ const ContextMenuPortal = ({ sizeSource, currentZIndex, onHide, opened }) => {
|
|
|
138
138
|
}, []);
|
|
139
139
|
(0, react_1.useEffect)(() => {
|
|
140
140
|
const dismissWithoutClickThrough = (event) => {
|
|
141
|
-
var _a;
|
|
142
141
|
if (event.button !== 0) {
|
|
143
142
|
return;
|
|
144
143
|
}
|
|
145
|
-
|
|
144
|
+
const target = event.target;
|
|
145
|
+
if ((0, menu_tree_context_1.isNodeInMenuTree)(target, menuTreeId)) {
|
|
146
146
|
return;
|
|
147
147
|
}
|
|
148
148
|
event.preventDefault();
|
|
@@ -154,7 +154,7 @@ const ContextMenuPortal = ({ sizeSource, currentZIndex, onHide, opened }) => {
|
|
|
154
154
|
return () => {
|
|
155
155
|
window.removeEventListener('pointerdown', dismissWithoutClickThrough, true);
|
|
156
156
|
};
|
|
157
|
-
}, [onHide]);
|
|
157
|
+
}, [menuTreeId, onHide]);
|
|
158
158
|
// Prevent deselection of a selected item
|
|
159
159
|
const onMenuPointerDown = (0, react_1.useCallback)((e) => {
|
|
160
160
|
e.stopPropagation();
|
|
@@ -162,11 +162,12 @@ const ContextMenuPortal = ({ sizeSource, currentZIndex, onHide, opened }) => {
|
|
|
162
162
|
if (!portalStyle) {
|
|
163
163
|
return null;
|
|
164
164
|
}
|
|
165
|
-
return react_dom_1.default.createPortal(jsx_runtime_1.jsx("div", { style: contextMenuFullScreenOverlay, children: jsx_runtime_1.jsx("div", { style: contextMenuOuterPortal, className: "css-reset", children: jsx_runtime_1.jsx(z_index_1.HigherZIndex, { onOutsideClick: onHide, onEscape: onHide, outsideClickButton: "primary", children: jsx_runtime_1.jsx("div", {
|
|
165
|
+
return react_dom_1.default.createPortal(jsx_runtime_1.jsx("div", { style: contextMenuFullScreenOverlay, children: jsx_runtime_1.jsx("div", { style: contextMenuOuterPortal, className: "css-reset", children: jsx_runtime_1.jsx(z_index_1.HigherZIndex, { onOutsideClick: onHide, onEscape: onHide, outsideClickButton: "primary", children: jsx_runtime_1.jsx("div", { "data-remotion-menu-tree-id": menuTreeId, style: portalStyle, onPointerDown: onMenuPointerDown, children: jsx_runtime_1.jsx(menu_tree_context_1.MenuTreeContext.Provider, { value: menuTreeId, children: jsx_runtime_1.jsx(MenuContent_1.MenuContent, { onNextMenu: noop_1.noop, onPreviousMenu: noop_1.noop, values: opened.values, onHide: onHide, leaveLeftSpace: true, preselectIndex: false, topItemCanBeUnselected: false, fixedHeight: null }) }) }) }) }) }), (0, portals_1.getPortal)(currentZIndex));
|
|
166
166
|
};
|
|
167
167
|
exports.ContextMenu = react_1.default.forwardRef(({ children, getItems, style = undefined, className = undefined, onPointerDown = undefined, }, forwardedRef) => {
|
|
168
168
|
const ref = (0, react_1.useRef)(null);
|
|
169
169
|
const idRef = (0, react_1.useRef)(nextContextMenuId++);
|
|
170
|
+
const menuTreeIdRef = (0, react_1.useRef)((0, menu_tree_context_1.getNextMenuTreeId)());
|
|
170
171
|
const invocationRef = (0, react_1.useRef)(0);
|
|
171
172
|
const getItemsRef = (0, react_1.useRef)(getItems);
|
|
172
173
|
getItemsRef.current = getItems;
|
|
@@ -232,11 +233,12 @@ exports.ContextMenu = react_1.default.forwardRef(({ children, getItems, style =
|
|
|
232
233
|
};
|
|
233
234
|
}, [onHide]);
|
|
234
235
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
235
|
-
jsx_runtime_1.jsx("div", { ref: setRef, onContextMenu: () => false, style: style, className: className, onPointerDown: onPointerDown, children: children }), opened.type === 'open' ? (jsx_runtime_1.jsx(ContextMenuPortal, { sizeSource: ref, currentZIndex: currentZIndex, onHide: onHide, opened: opened })) : null] }));
|
|
236
|
+
jsx_runtime_1.jsx("div", { ref: setRef, onContextMenu: () => false, style: style, className: className, onPointerDown: onPointerDown, children: children }), opened.type === 'open' ? (jsx_runtime_1.jsx(ContextMenuPortal, { menuTreeId: menuTreeIdRef.current, sizeSource: ref, currentZIndex: currentZIndex, onHide: onHide, opened: opened })) : null] }));
|
|
236
237
|
});
|
|
237
238
|
exports.ContextMenu.displayName = 'ContextMenu';
|
|
238
239
|
const ContextMenuForTarget = ({ triggerRef, getItems }) => {
|
|
239
240
|
const idRef = (0, react_1.useRef)(nextContextMenuId++);
|
|
241
|
+
const menuTreeIdRef = (0, react_1.useRef)((0, menu_tree_context_1.getNextMenuTreeId)());
|
|
240
242
|
const invocationRef = (0, react_1.useRef)(0);
|
|
241
243
|
const getItemsRef = (0, react_1.useRef)(getItems);
|
|
242
244
|
getItemsRef.current = getItems;
|
|
@@ -297,6 +299,6 @@ const ContextMenuForTarget = ({ triggerRef, getItems }) => {
|
|
|
297
299
|
window.removeEventListener(contextMenuOpenedEvent, onOtherContextMenuOpened);
|
|
298
300
|
};
|
|
299
301
|
}, [onHide]);
|
|
300
|
-
return opened.type === 'open' ? (jsx_runtime_1.jsx(ContextMenuPortal, { sizeSource: body, currentZIndex: currentZIndex, onHide: onHide, opened: opened })) : null;
|
|
302
|
+
return opened.type === 'open' ? (jsx_runtime_1.jsx(ContextMenuPortal, { menuTreeId: menuTreeIdRef.current, sizeSource: body, currentZIndex: currentZIndex, onHide: onHide, opened: opened })) : null;
|
|
301
303
|
};
|
|
302
304
|
exports.ContextMenuForTarget = ContextMenuForTarget;
|
|
@@ -38,6 +38,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
38
38
|
const player_1 = require("@remotion/player");
|
|
39
39
|
const react_1 = __importStar(require("react"));
|
|
40
40
|
const remotion_1 = require("remotion");
|
|
41
|
+
const client_id_1 = require("../helpers/client-id");
|
|
41
42
|
const colors_1 = require("../helpers/colors");
|
|
42
43
|
const noop_1 = require("../helpers/noop");
|
|
43
44
|
const studio_fit_padding_1 = require("../helpers/studio-fit-padding");
|
|
@@ -62,6 +63,7 @@ const background = {
|
|
|
62
63
|
position: 'absolute',
|
|
63
64
|
};
|
|
64
65
|
const Editor = ({ Root, readOnlyStudio }) => {
|
|
66
|
+
(0, client_id_1.useStudioConfigRevision)();
|
|
65
67
|
const [drawElement, setDrawElement] = (0, react_1.useState)(null);
|
|
66
68
|
const size = player_1.PlayerInternals.useElementSize(drawElement, {
|
|
67
69
|
triggerOnWindowResize: false,
|
|
@@ -18,6 +18,7 @@ const ModalsProvider_1 = require("./ModalsProvider");
|
|
|
18
18
|
const ClientRenderQueueProcessor_1 = require("./RenderQueue/ClientRenderQueueProcessor");
|
|
19
19
|
const context_1 = require("./RenderQueue/context");
|
|
20
20
|
const SetTimelineInOutProvider_1 = require("./SetTimelineInOutProvider");
|
|
21
|
+
const SettingsContext_1 = require("./SettingsContext");
|
|
21
22
|
const ShowGuidesProvider_1 = require("./ShowGuidesProvider");
|
|
22
23
|
const ShowOutlinesProvider_1 = require("./ShowOutlinesProvider");
|
|
23
24
|
const ShowRulersProvider_1 = require("./ShowRulersProvider");
|
|
@@ -25,10 +26,10 @@ const SnappingProvider_1 = require("./SnappingProvider");
|
|
|
25
26
|
const VisualControlsUndoSync_1 = require("./VisualControls/VisualControlsUndoSync");
|
|
26
27
|
const ZoomGesturesProvider_1 = require("./ZoomGesturesProvider");
|
|
27
28
|
const EditorContexts = ({ children }) => {
|
|
28
|
-
return (jsx_runtime_1.jsx(get_zod_if_possible_1.ZodProvider, { children: jsx_runtime_1.jsx(VisualControls_1.VisualControlsProvider, { children: jsx_runtime_1.
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
return (jsx_runtime_1.jsx(get_zod_if_possible_1.ZodProvider, { children: jsx_runtime_1.jsx(VisualControls_1.VisualControlsProvider, { children: jsx_runtime_1.jsx(client_id_1.PreviewServerConnection, { children: jsx_runtime_1.jsxs(SettingsContext_1.SettingsProvider, { children: [
|
|
30
|
+
jsx_runtime_1.jsx(VisualControlsUndoSync_1.VisualControlsUndoSync, {}), jsx_runtime_1.jsxs(context_1.RenderQueueContextProvider, { children: [
|
|
31
|
+
jsx_runtime_1.jsx(ClientRenderQueueProcessor_1.ClientRenderQueueProcessor, {}), jsx_runtime_1.jsx(keybindings_1.KeybindingContextProvider, { children: jsx_runtime_1.jsx(CheckerboardProvider_1.CheckerboardProvider, { children: jsx_runtime_1.jsx(ZoomGesturesProvider_1.ZoomGesturesProvider, { children: jsx_runtime_1.jsx(ShowRulersProvider_1.ShowRulersProvider, { children: jsx_runtime_1.jsx(ShowGuidesProvider_1.ShowGuidesProvider, { children: jsx_runtime_1.jsx(ShowOutlinesProvider_1.ShowOutlinesProvider, { children: jsx_runtime_1.jsx(SnappingProvider_1.SnappingProvider, { children: jsx_runtime_1.jsx(preview_size_1.PreviewSizeProvider, { children: jsx_runtime_1.jsx(ModalsProvider_1.ModalsProvider, { children: jsx_runtime_1.jsx(MediaVolumeProvider_1.MediaVolumeProvider, { children: jsx_runtime_1.jsx(player_1.PlayerInternals.PlayerEmitterProvider, { currentPlaybackRate: null, children: jsx_runtime_1.jsx(sidebar_1.SidebarContextProvider, { children: jsx_runtime_1.jsx(folders_1.FolderContextProvider, { children: jsx_runtime_1.jsx(highest_z_index_1.HighestZIndexProvider, { children: jsx_runtime_1.jsx(SetTimelineInOutProvider_1.SetTimelineInOutProvider, { children: jsx_runtime_1.jsx(ExpandedTracksProvider_1.ExpandedTracksProvider, { children: children }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) })
|
|
32
|
+
] })
|
|
33
|
+
] }) }) }) }));
|
|
33
34
|
};
|
|
34
35
|
exports.EditorContexts = EditorContexts;
|
|
@@ -155,7 +155,7 @@ const EffectPickerResult = ({ item, selected, onSelected }) => {
|
|
|
155
155
|
] }) }));
|
|
156
156
|
};
|
|
157
157
|
const EffectPickerContent = ({ state }) => {
|
|
158
|
-
const { setSelectedModal } = (0, react_1.useContext)(modals_1.
|
|
158
|
+
const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
|
|
159
159
|
const [aboutEffectsHovered, setAboutEffectsHovered] = (0, react_1.useState)(false);
|
|
160
160
|
const [query, setQuery] = (0, react_1.useState)('');
|
|
161
161
|
const [selectedIndex, setSelectedIndex] = (0, react_1.useState)(0);
|
|
@@ -4,46 +4,11 @@ exports.ExpandedTracksProvider = exports.ExpandedTracksSetterContext = exports.E
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const migrate_expanded_tracks_for_subscription_key_1 = require("../helpers/migrate-expanded-tracks-for-subscription-key");
|
|
7
|
+
const persist_boolean_map_1 = require("../helpers/persist-boolean-map");
|
|
7
8
|
const timeline_node_path_key_1 = require("../helpers/timeline-node-path-key");
|
|
8
|
-
const SESSION_STORAGE_KEY = 'remotion.editor.expandedTracks';
|
|
9
|
-
const onlyCollapsedTrackValues = (state) => {
|
|
10
|
-
const result = {};
|
|
11
|
-
for (const [key, value] of Object.entries(state)) {
|
|
12
|
-
if (value === false) {
|
|
13
|
-
result[key] = false;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
return result;
|
|
17
|
-
};
|
|
9
|
+
const SESSION_STORAGE_KEY = 'remotion.editor.expandedTracks.v2';
|
|
18
10
|
const loadExpandedTracks = () => {
|
|
19
|
-
|
|
20
|
-
return {};
|
|
21
|
-
}
|
|
22
|
-
try {
|
|
23
|
-
const raw = window.sessionStorage.getItem(SESSION_STORAGE_KEY);
|
|
24
|
-
if (raw === null) {
|
|
25
|
-
return {};
|
|
26
|
-
}
|
|
27
|
-
const parsed = JSON.parse(raw);
|
|
28
|
-
if (!parsed || typeof parsed !== 'object') {
|
|
29
|
-
return {};
|
|
30
|
-
}
|
|
31
|
-
return onlyCollapsedTrackValues(parsed);
|
|
32
|
-
}
|
|
33
|
-
catch (_a) {
|
|
34
|
-
return {};
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
const persistExpandedTracks = (state) => {
|
|
38
|
-
if (typeof window === 'undefined') {
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
try {
|
|
42
|
-
window.sessionStorage.setItem(SESSION_STORAGE_KEY, JSON.stringify(onlyCollapsedTrackValues(state)));
|
|
43
|
-
}
|
|
44
|
-
catch (_a) {
|
|
45
|
-
// Ignore quota errors or disabled storage.
|
|
46
|
-
}
|
|
11
|
+
return (0, persist_boolean_map_1.loadPersistedBooleanMap)(SESSION_STORAGE_KEY);
|
|
47
12
|
};
|
|
48
13
|
exports.ExpandedTracksGetterContext = (0, react_1.createContext)({
|
|
49
14
|
getIsExpanded: () => {
|
|
@@ -78,31 +43,23 @@ const ExpandedTracksProvider = ({ children }) => {
|
|
|
78
43
|
let changed = false;
|
|
79
44
|
const next = { ...prev };
|
|
80
45
|
for (const key of keysToExpand) {
|
|
81
|
-
if (next[key]
|
|
82
|
-
|
|
46
|
+
if (!next[key]) {
|
|
47
|
+
next[key] = true;
|
|
83
48
|
changed = true;
|
|
84
49
|
}
|
|
85
50
|
}
|
|
86
51
|
if (!changed) {
|
|
87
52
|
return prev;
|
|
88
53
|
}
|
|
89
|
-
|
|
54
|
+
(0, persist_boolean_map_1.persistBooleanMap)(SESSION_STORAGE_KEY, next);
|
|
90
55
|
return next;
|
|
91
56
|
});
|
|
92
57
|
}, []);
|
|
93
58
|
const toggleTrack = (0, react_1.useCallback)((nodePathInfo) => {
|
|
94
59
|
setExpandedTracks((prev) => {
|
|
95
|
-
var _a;
|
|
96
60
|
const key = (0, timeline_node_path_key_1.timelineNodePathInfoToKey)(nodePathInfo);
|
|
97
|
-
const next =
|
|
98
|
-
|
|
99
|
-
if (isExpanded) {
|
|
100
|
-
next[key] = false;
|
|
101
|
-
}
|
|
102
|
-
else {
|
|
103
|
-
delete next[key];
|
|
104
|
-
}
|
|
105
|
-
persistExpandedTracks(next);
|
|
61
|
+
const next = (0, persist_boolean_map_1.toggleBooleanMapKey)(prev, key);
|
|
62
|
+
(0, persist_boolean_map_1.persistBooleanMap)(SESSION_STORAGE_KEY, next);
|
|
106
63
|
return next;
|
|
107
64
|
});
|
|
108
65
|
}, []);
|
|
@@ -112,14 +69,14 @@ const ExpandedTracksProvider = ({ children }) => {
|
|
|
112
69
|
if (!next) {
|
|
113
70
|
return prev;
|
|
114
71
|
}
|
|
115
|
-
|
|
72
|
+
(0, persist_boolean_map_1.persistBooleanMap)(SESSION_STORAGE_KEY, next);
|
|
116
73
|
return next;
|
|
117
74
|
});
|
|
118
75
|
}, []);
|
|
119
76
|
const getterValue = (0, react_1.useMemo)(() => ({
|
|
120
77
|
getIsExpanded: (nodePathInfo) => {
|
|
121
78
|
var _a;
|
|
122
|
-
return (_a = expandedTracks[(0, timeline_node_path_key_1.timelineNodePathInfoToKey)(nodePathInfo)]) !== null && _a !== void 0 ? _a :
|
|
79
|
+
return (_a = expandedTracks[(0, timeline_node_path_key_1.timelineNodePathInfoToKey)(nodePathInfo)]) !== null && _a !== void 0 ? _a : false;
|
|
123
80
|
},
|
|
124
81
|
}), [expandedTracks]);
|
|
125
82
|
const setterValue = (0, react_1.useMemo)(() => ({
|
|
@@ -24,7 +24,7 @@ const sequencePropShortcuts = {
|
|
|
24
24
|
const hasOwnProperty = (obj, key) => Object.prototype.hasOwnProperty.call(obj, key);
|
|
25
25
|
const GlobalKeybindings = () => {
|
|
26
26
|
const keybindings = (0, use_keybinding_1.useKeybinding)();
|
|
27
|
-
const { setSelectedModal } = (0, react_1.useContext)(modals_1.
|
|
27
|
+
const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
|
|
28
28
|
const { setCheckerboard } = (0, react_1.useContext)(checkerboard_1.CheckerboardContext);
|
|
29
29
|
const { setEditorSnapping } = (0, react_1.useContext)(editor_snapping_1.EditorSnappingContext);
|
|
30
30
|
const currentSelection = (0, TimelineSelection_1.useCurrentTimelineSelectionStateAsRef)();
|
|
@@ -58,7 +58,8 @@ const GlobalKeybindings = () => {
|
|
|
58
58
|
if (!(track === null || track === void 0 ? void 0 : track.sequence.controls)) {
|
|
59
59
|
return false;
|
|
60
60
|
}
|
|
61
|
-
const { schema,
|
|
61
|
+
const { schema, runtimeValues } = track.sequence.controls;
|
|
62
|
+
const currentRuntimeValueDotNotation = runtimeValues.getSnapshot();
|
|
62
63
|
if (!hasOwnProperty(schema, fieldKey) &&
|
|
63
64
|
!hasOwnProperty(currentRuntimeValueDotNotation, fieldKey)) {
|
|
64
65
|
return false;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { Caption } from '@remotion/captions';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import type {
|
|
3
|
+
import type { SequencePropsSubscriptionKey, SequenceRegistrationControls } from 'remotion';
|
|
4
4
|
import type { CodePosition } from '../error-overlay/react-overlay/utils/get-source-map';
|
|
5
5
|
export declare const InlineCaptionInspector: React.FC<{
|
|
6
6
|
readonly captions: Caption[];
|
|
7
|
-
readonly controls:
|
|
7
|
+
readonly controls: SequenceRegistrationControls;
|
|
8
8
|
readonly nodePath: SequencePropsSubscriptionKey;
|
|
9
9
|
readonly readOnlyStudio: boolean;
|
|
10
10
|
readonly validatedLocation: CodePosition;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type InlineActionProps } from './InlineAction';
|
|
2
2
|
import type { ComboboxValue } from './NewComposition/ComboBox';
|
|
3
|
-
export declare const InlineDropdown: ({ values, getItems, unhoveredColor, ...props }: Omit<InlineActionProps, "onClick"> & {
|
|
3
|
+
export declare const InlineDropdown: ({ values, getItems, onOpenChange, unhoveredColor, ...props }: Omit<InlineActionProps, "onClick"> & {
|
|
4
4
|
readonly values?: ComboboxValue[] | undefined;
|
|
5
5
|
readonly getItems?: (() => ComboboxValue[]) | undefined;
|
|
6
|
+
readonly onOpenChange?: ((open: boolean) => void) | undefined;
|
|
6
7
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -16,7 +16,11 @@ const InlineAction_1 = require("./InlineAction");
|
|
|
16
16
|
const portals_1 = require("./Menu/portals");
|
|
17
17
|
const styles_1 = require("./Menu/styles");
|
|
18
18
|
const MenuContent_1 = require("./NewComposition/MenuContent");
|
|
19
|
-
const
|
|
19
|
+
const container = {
|
|
20
|
+
display: 'flex',
|
|
21
|
+
height: 24,
|
|
22
|
+
};
|
|
23
|
+
const InlineDropdown = ({ values, getItems, onOpenChange, unhoveredColor, ...props }) => {
|
|
20
24
|
var _a, _b;
|
|
21
25
|
const ref = (0, react_1.useRef)(null);
|
|
22
26
|
const [opened, setOpened] = (0, react_1.useState)({ type: 'not-open' });
|
|
@@ -40,7 +44,8 @@ const InlineDropdown = ({ values, getItems, unhoveredColor, ...props }) => {
|
|
|
40
44
|
top: e.clientY,
|
|
41
45
|
values: invocationValues,
|
|
42
46
|
});
|
|
43
|
-
|
|
47
|
+
onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(true);
|
|
48
|
+
}, [getItems, onOpenChange]);
|
|
44
49
|
const spaceToBottom = (0, react_1.useMemo)(() => {
|
|
45
50
|
if (size && opened.type === 'open') {
|
|
46
51
|
return size.windowSize.height - opened.top;
|
|
@@ -89,9 +94,10 @@ const InlineDropdown = ({ values, getItems, unhoveredColor, ...props }) => {
|
|
|
89
94
|
}, [opened, size, isMobileLayout, spaceToTop, spaceToBottom]);
|
|
90
95
|
const onHide = (0, react_1.useCallback)(() => {
|
|
91
96
|
setOpened({ type: 'not-open' });
|
|
92
|
-
|
|
97
|
+
onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(false);
|
|
98
|
+
}, [onOpenChange]);
|
|
93
99
|
return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
|
|
94
|
-
jsx_runtime_1.jsx("div", { ref: ref, children: jsx_runtime_1.jsx(InlineAction_1.InlineAction, { onClick: onClick, unhoveredColor: opened.type === 'open' ? colors_1.WHITE : unhoveredColor, ...props }) }), portalStyle && opened.type === 'open'
|
|
100
|
+
jsx_runtime_1.jsx("div", { ref: ref, style: container, children: jsx_runtime_1.jsx(InlineAction_1.InlineAction, { onClick: onClick, unhoveredColor: opened.type === 'open' ? colors_1.WHITE : unhoveredColor, ...props }) }), portalStyle && opened.type === 'open'
|
|
95
101
|
? react_dom_1.default.createPortal(jsx_runtime_1.jsx("div", { style: styles_1.fullScreenOverlay, children: 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(MenuContent_1.MenuContent, { onNextMenu: noop_1.noop, onPreviousMenu: noop_1.noop, values: (_b = (_a = opened.values) !== null && _a !== void 0 ? _a : values) !== null && _b !== void 0 ? _b : [], onHide: onHide, leaveLeftSpace: true, preselectIndex: false, topItemCanBeUnselected: false, fixedHeight: null }) }) }) }) }), (0, portals_1.getPortal)(currentZIndex))
|
|
96
102
|
: null] }));
|
|
97
103
|
};
|
|
@@ -38,8 +38,8 @@ const icon = {
|
|
|
38
38
|
const InspectorLocationCopy = ({ children, location, name, openInEditorLocation }) => {
|
|
39
39
|
const [hovered, setHovered] = (0, react_1.useState)(false);
|
|
40
40
|
const [focusedWithin, setFocusedWithin] = (0, react_1.useState)(false);
|
|
41
|
-
const
|
|
42
|
-
return (0, format_file_location_1.
|
|
41
|
+
const contextForAgents = (0, react_1.useMemo)(() => {
|
|
42
|
+
return (0, format_file_location_1.formatContextForAgents)({
|
|
43
43
|
location,
|
|
44
44
|
name,
|
|
45
45
|
root: window.remotion_cwd,
|
|
@@ -50,20 +50,20 @@ const InspectorLocationCopy = ({ children, location, name, openInEditorLocation
|
|
|
50
50
|
}, []);
|
|
51
51
|
const onCopy = (0, react_1.useCallback)((event) => {
|
|
52
52
|
event.stopPropagation();
|
|
53
|
-
if (!
|
|
53
|
+
if (!contextForAgents) {
|
|
54
54
|
return;
|
|
55
55
|
}
|
|
56
|
-
navigator.clipboard.writeText(
|
|
56
|
+
navigator.clipboard.writeText(contextForAgents).catch((err) => {
|
|
57
57
|
(0, NotificationCenter_1.showNotification)(`Could not copy to clipboard: ${err.message}`, 2000);
|
|
58
58
|
});
|
|
59
|
-
}, [
|
|
59
|
+
}, [contextForAgents]);
|
|
60
60
|
const showAction = hovered || focusedWithin;
|
|
61
|
-
return (jsx_runtime_1.jsxs("div", { style: row, onPointerEnter: () => setHovered(true), onPointerLeave: () => setHovered(false), onFocus: () => setFocusedWithin(true), onBlur: () => setFocusedWithin(false), children: [
|
|
62
|
-
jsx_runtime_1.jsx("div", { style: content, children: children }),
|
|
61
|
+
return (jsx_runtime_1.jsxs("div", { "aria-label": "Inspector source location", role: "group", style: row, onPointerEnter: () => setHovered(true), onPointerLeave: () => setHovered(false), onFocus: () => setFocusedWithin(true), onBlur: () => setFocusedWithin(false), children: [
|
|
62
|
+
jsx_runtime_1.jsx("div", { style: content, children: children }), contextForAgents || openInEditorLocation ? (jsx_runtime_1.jsxs("div", { style: {
|
|
63
63
|
...action,
|
|
64
64
|
opacity: showAction ? 1 : 0,
|
|
65
65
|
pointerEvents: showAction ? 'auto' : 'none',
|
|
66
66
|
}, children: [
|
|
67
|
-
jsx_runtime_1.jsx(InspectorOpenInEditor_1.InspectorOpenInEditor, { location: openInEditorLocation }),
|
|
67
|
+
jsx_runtime_1.jsx(InspectorOpenInEditor_1.InspectorOpenInEditor, { contextForAgents: contextForAgents, location: openInEditorLocation }), contextForAgents ? (jsx_runtime_1.jsx(InlineAction_1.InlineAction, { variant: null, onClick: onCopy, renderAction: renderCopyAction, title: "Copy context for agents" })) : null] })) : null] }));
|
|
68
68
|
};
|
|
69
69
|
exports.InspectorLocationCopy = InspectorLocationCopy;
|