@remotion/studio 4.0.504 → 4.0.506
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/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/AssetSelectorItem.js +3 -3
- package/dist/components/AudioWaveform.d.ts +1 -1
- package/dist/components/AudioWaveform.js +36 -3
- package/dist/components/Canvas.js +2 -0
- package/dist/components/CompositionContextButton.d.ts +1 -1
- package/dist/components/CompositionContextButton.js +2 -2
- package/dist/components/CompositionSelector.js +3 -3
- package/dist/components/CompositionSelectorItem.js +5 -5
- package/dist/components/ConfigureDefaultEditorModal.d.ts +3 -1
- package/dist/components/ConfigureDefaultEditorModal.js +90 -32
- package/dist/components/ConfigureLicenseModal.d.ts +2 -1
- package/dist/components/ConfigureLicenseModal.js +40 -32
- package/dist/components/ConfirmationDialog.js +2 -2
- package/dist/components/ContextMenu.d.ts +5 -7
- package/dist/components/ContextMenu.js +54 -21
- package/dist/components/Editor.js +2 -0
- package/dist/components/EditorGuides/Guide.js +2 -2
- package/dist/components/EffectPickerModal.js +3 -3
- package/dist/components/GlobalKeybindings.js +3 -2
- package/dist/components/InlineAction.d.ts +1 -1
- package/dist/components/InlineAction.js +14 -13
- package/dist/components/InlineCaptionInspector.d.ts +2 -2
- package/dist/components/InlineDropdown.d.ts +4 -2
- package/dist/components/InlineDropdown.js +23 -6
- package/dist/components/InspectorOpenInEditor.d.ts +1 -0
- package/dist/components/InspectorOpenInEditor.js +33 -9
- package/dist/components/InspectorPanel/AlignmentControls.js +5 -2
- package/dist/components/InspectorPanel/CompositionInspector.js +15 -1
- package/dist/components/InspectorPanel/ConnectedCompositionsSection.js +3 -3
- package/dist/components/InspectorPanel/EasingInspector.js +7 -4
- package/dist/components/InspectorPanel/KeyframeInspector.js +5 -1
- package/dist/components/InspectorPanel/SequenceSelectionInspector.js +1 -1
- package/dist/components/InspectorPanel/common.d.ts +1 -0
- package/dist/components/InspectorPanel/common.js +25 -35
- package/dist/components/InspectorPanel/use-composition-actions.js +4 -1
- package/dist/components/InspectorSequenceSection.js +5 -5
- package/dist/components/InstallPackage.js +1 -1
- package/dist/components/Menu/MenuItem.js +16 -12
- package/dist/components/MenuBuildIndicator.js +12 -58
- package/dist/components/MenuCompositionName.js +3 -63
- package/dist/components/MenuToolbar.js +22 -2
- 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/DismissableModal.js +1 -1
- package/dist/components/NewComposition/InputDragger.d.ts +1 -0
- package/dist/components/NewComposition/InputDragger.js +5 -4
- package/dist/components/NewComposition/MenuContent.d.ts +1 -1
- package/dist/components/NewComposition/RenameStaticFile.js +1 -1
- package/dist/components/NewComposition/menu-typeahead.d.ts +1 -1
- package/dist/components/OverrideInputProps.js +1 -1
- package/dist/components/PlayPause.js +3 -2
- package/dist/components/PlaybackKeyboardShortcutsManager.js +7 -5
- package/dist/components/PlaybackRateSelector.js +3 -9
- package/dist/components/PreviewToolbar.js +7 -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 -2
- package/dist/components/RenderButton.js +95 -43
- package/dist/components/RenderModal/RenderStatusModal.js +1 -1
- package/dist/components/RenderModal/ServerRenderModal.js +1 -1
- package/dist/components/RenderModal/WebRenderModal.js +3 -2
- package/dist/components/RenderQueue/RenderQueueError.js +1 -1
- 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/SelectedOutlineElement.js +10 -11
- package/dist/components/SelectedOutlineOverlay.js +67 -20
- package/dist/components/SettingsModal.d.ts +7 -0
- package/dist/components/SettingsModal.js +50 -0
- package/dist/components/SettingsModalFooter.d.ts +4 -0
- package/dist/components/SettingsModalFooter.js +46 -0
- package/dist/components/SidebarRenderButton.js +1 -1
- package/dist/components/SizeSelector.js +3 -9
- package/dist/components/SvgImportDialog.js +2 -2
- package/dist/components/TimeValue.js +1 -1
- package/dist/components/Timeline/Timeline.js +5 -4
- package/dist/components/Timeline/TimelineAssetField.js +1 -1
- package/dist/components/Timeline/TimelineDragHandler.js +6 -3
- package/dist/components/Timeline/TimelineEffectItem.js +6 -2
- package/dist/components/Timeline/TimelineEffectPropItem.js +11 -6
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.d.ts +6 -6
- package/dist/components/Timeline/TimelineExpandedKeyframeRow.js +32 -1
- package/dist/components/Timeline/TimelineExpandedRow.d.ts +4 -2
- package/dist/components/Timeline/TimelineExpandedRow.js +2 -2
- package/dist/components/Timeline/TimelineFontFamilyField.js +3 -1
- package/dist/components/Timeline/TimelineHeightContainer.d.ts +1 -0
- package/dist/components/Timeline/TimelineHeightContainer.js +2 -2
- package/dist/components/Timeline/TimelineInOutDragHandler.js +3 -3
- package/dist/components/Timeline/TimelineKeyframeControls.js +1 -0
- package/dist/components/Timeline/TimelineKeyframeEasingLine.d.ts +4 -2
- package/dist/components/Timeline/TimelineKeyframeEasingLine.js +30 -28
- package/dist/components/Timeline/TimelineList.d.ts +1 -0
- package/dist/components/Timeline/TimelineList.js +2 -3
- package/dist/components/Timeline/TimelineScaleField.js +1 -1
- package/dist/components/Timeline/TimelineSelection.js +1 -0
- package/dist/components/Timeline/TimelineSequence.js +34 -28
- package/dist/components/Timeline/TimelineSequenceItem.d.ts +3 -3
- package/dist/components/Timeline/TimelineSequenceItem.js +61 -56
- package/dist/components/Timeline/TimelineSequencePropItem.d.ts +10 -2
- package/dist/components/Timeline/TimelineSequencePropItem.js +64 -12
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.d.ts +2 -2
- package/dist/components/Timeline/TimelineSequenceRightEdgeDragHandle.js +39 -6
- package/dist/components/Timeline/TimelineTimeIndicators.js +36 -3
- package/dist/components/Timeline/TimelineVideoInfo.d.ts +1 -1
- package/dist/components/Timeline/TimelineVideoInfo.js +36 -3
- package/dist/components/Timeline/TimelineZoomControls.d.ts +2 -2
- package/dist/components/Timeline/TimelineZoomControls.js +39 -12
- 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 +4 -0
- package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.d.ts +1 -1
- package/dist/components/Timeline/use-sequence-freeze-frame-menu-item.js +7 -18
- package/dist/components/Timeline/use-timeline-asset-drop.js +1 -0
- package/dist/components/Timeline/use-timeline-expanded-tree.d.ts +1 -0
- package/dist/components/Timeline/use-timeline-expanded-tree.js +5 -0
- package/dist/components/Timeline/use-timeline-height.d.ts +2 -1
- package/dist/components/Timeline/use-timeline-height.js +23 -2
- package/dist/components/TimelineCombobox.d.ts +11 -0
- package/dist/components/TimelineCombobox.js +181 -0
- package/dist/components/TimelineInOutToggle.js +5 -1
- package/dist/components/TopPanel.js +22 -7
- package/dist/components/UpdateCheck.js +1 -1
- package/dist/components/effect-drag-and-drop.js +1 -1
- 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-types.d.ts +1 -1
- package/dist/esm/{chunk-43m68z1k.js → chunk-b49ec3nz.js} +12436 -11482
- package/dist/esm/internals.mjs +12436 -11482
- package/dist/esm/previewEntry.mjs +9671 -8717
- package/dist/esm/renderEntry.mjs +1 -1
- package/dist/helpers/client-id.d.ts +3 -1
- package/dist/helpers/client-id.js +21 -4
- package/dist/helpers/hoverable.d.ts +11 -0
- package/dist/helpers/hoverable.js +70 -0
- package/dist/helpers/inject-css.js +3 -0
- package/dist/helpers/install-required-package.d.ts +3 -3
- package/dist/helpers/install-required-package.js +1 -6
- package/dist/helpers/studio-fit-padding.d.ts +1 -1
- package/dist/helpers/studio-fit-padding.js +1 -1
- package/dist/helpers/timeline-layout.d.ts +2 -1
- package/dist/helpers/timeline-layout.js +5 -2
- package/dist/helpers/use-is-fullscreen.d.ts +1 -0
- package/dist/helpers/use-is-fullscreen.js +25 -0
- package/dist/helpers/use-menu-structure.js +26 -43
- package/dist/helpers/use-runtime-values.d.ts +11 -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/icons/canvas-zoom.d.ts +10 -0
- package/dist/icons/canvas-zoom.js +21 -0
- package/dist/icons/playback-rate.d.ts +5 -0
- package/dist/icons/playback-rate.js +31 -0
- package/dist/icons/search.d.ts +5 -0
- package/dist/icons/search.js +10 -0
- package/dist/state/modals.d.ts +5 -6
- package/dist/state/modals.js +5 -3
- package/package.json +12 -12
package/dist/esm/renderEntry.mjs
CHANGED
|
@@ -212,7 +212,7 @@ var renderContent = (Root) => {
|
|
|
212
212
|
renderToDOM(/* @__PURE__ */ jsx("div", {
|
|
213
213
|
children: /* @__PURE__ */ jsx(DelayedSpinner, {})
|
|
214
214
|
}));
|
|
215
|
-
import("./chunk-
|
|
215
|
+
import("./chunk-b49ec3nz.js").then(({ StudioInternals }) => {
|
|
216
216
|
window.remotion_isStudio = true;
|
|
217
217
|
window.remotion_isReadOnlyStudio = true;
|
|
218
218
|
window.remotion_inputProps = "{}";
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type EventSourceEvent } from '@remotion/studio-shared';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { type PreviewServerConnectionState } from './preview-server-events';
|
|
4
4
|
type Context = {
|
|
5
5
|
previewServerState: PreviewServerConnectionState;
|
|
6
|
+
configFileChangeRevision: number;
|
|
6
7
|
subscribeToEvent: (type: EventSourceEvent['type'], listener: (event: EventSourceEvent) => void) => () => void;
|
|
7
8
|
};
|
|
8
9
|
export declare const StudioServerConnectionCtx: React.Context<Context>;
|
|
9
10
|
export declare const PreviewServerConnection: React.FC<{
|
|
10
11
|
readonly children: React.ReactNode;
|
|
11
12
|
}>;
|
|
13
|
+
export declare const useStudioConfigRevision: () => number;
|
|
12
14
|
export {};
|
|
@@ -36,8 +36,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
36
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.PreviewServerConnection = exports.StudioServerConnectionCtx = void 0;
|
|
39
|
+
exports.useStudioConfigRevision = exports.PreviewServerConnection = exports.StudioServerConnectionCtx = void 0;
|
|
40
40
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
41
|
+
const studio_shared_1 = require("@remotion/studio-shared");
|
|
41
42
|
const react_1 = __importStar(require("react"));
|
|
42
43
|
const remotion_1 = require("remotion");
|
|
43
44
|
const NotificationCenter_1 = require("../components/Notifications/NotificationCenter");
|
|
@@ -49,6 +50,7 @@ exports.StudioServerConnectionCtx = react_1.default.createContext({
|
|
|
49
50
|
previewServerState: {
|
|
50
51
|
type: 'init',
|
|
51
52
|
},
|
|
53
|
+
configFileChangeRevision: 0,
|
|
52
54
|
subscribeToEvent: () => {
|
|
53
55
|
throw new Error('Context not initalized');
|
|
54
56
|
},
|
|
@@ -68,14 +70,24 @@ const PreviewServerConnection = ({ children }) => {
|
|
|
68
70
|
const [state, setState] = react_1.default.useState({
|
|
69
71
|
type: 'init',
|
|
70
72
|
});
|
|
73
|
+
const [configFileChangeRevision, setConfigFileChangeRevision] = react_1.default.useState(0);
|
|
71
74
|
(0, react_1.useEffect)(() => {
|
|
72
75
|
const handleEvent = (newEvent) => {
|
|
73
76
|
var _a, _b;
|
|
74
77
|
if (newEvent.type === 'new-input-props' ||
|
|
75
|
-
newEvent.type === 'new-env-variables'
|
|
76
|
-
newEvent.type === 'config-file-changed') {
|
|
78
|
+
newEvent.type === 'new-env-variables') {
|
|
77
79
|
(0, url_state_1.reloadUrl)();
|
|
78
80
|
}
|
|
81
|
+
if (newEvent.type === 'config-file-changed') {
|
|
82
|
+
window.remotion_renderDefaults = newEvent.renderDefaults;
|
|
83
|
+
window.remotion_studioConfig = newEvent.studioRuntimeConfig;
|
|
84
|
+
window.remotion_editorName = newEvent.editorName;
|
|
85
|
+
setConfigFileChangeRevision((revision) => revision + 1);
|
|
86
|
+
(0, NotificationCenter_1.showNotification)((0, studio_shared_1.getConfigFileChangeMessage)(newEvent.changeType), 4000);
|
|
87
|
+
}
|
|
88
|
+
if (newEvent.type === 'config-file-reload-failed') {
|
|
89
|
+
(0, NotificationCenter_1.showNotification)(newEvent.errorMessage, 4000);
|
|
90
|
+
}
|
|
79
91
|
if (newEvent.type === 'init') {
|
|
80
92
|
latestUndoRedoEvent.current = {
|
|
81
93
|
type: 'undo-redo-stack-changed',
|
|
@@ -131,9 +143,14 @@ const PreviewServerConnection = ({ children }) => {
|
|
|
131
143
|
const context = (0, react_1.useMemo)(() => {
|
|
132
144
|
return {
|
|
133
145
|
previewServerState: state,
|
|
146
|
+
configFileChangeRevision,
|
|
134
147
|
subscribeToEvent,
|
|
135
148
|
};
|
|
136
|
-
}, [state, subscribeToEvent]);
|
|
149
|
+
}, [configFileChangeRevision, state, subscribeToEvent]);
|
|
137
150
|
return (jsx_runtime_1.jsx(exports.StudioServerConnectionCtx.Provider, { value: context, children: children }));
|
|
138
151
|
};
|
|
139
152
|
exports.PreviewServerConnection = PreviewServerConnection;
|
|
153
|
+
const useStudioConfigRevision = () => {
|
|
154
|
+
return react_1.default.useContext(exports.StudioServerConnectionCtx).configFileChangeRevision;
|
|
155
|
+
};
|
|
156
|
+
exports.useStudioConfigRevision = useStudioConfigRevision;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
export declare const HOVERABLE_CLASS_NAME = "__remotion-hoverable";
|
|
3
|
+
export declare const HOVER_GROUP_CLASS_NAME = "__remotion-hover-group";
|
|
4
|
+
export declare const HOVER_GROUP_REVEAL_CLASS_NAME = "__remotion-hover-group-reveal";
|
|
5
|
+
export declare const hoverableStyle: ({ idleBackground, hoverBackground, idleColor, hoverColor, }: {
|
|
6
|
+
idleBackground: string;
|
|
7
|
+
hoverBackground: string;
|
|
8
|
+
idleColor: string;
|
|
9
|
+
hoverColor: string;
|
|
10
|
+
}) => React.CSSProperties;
|
|
11
|
+
export declare const makeHoverableCSS: () => string;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeHoverableCSS = exports.hoverableStyle = exports.HOVER_GROUP_REVEAL_CLASS_NAME = exports.HOVER_GROUP_CLASS_NAME = exports.HOVERABLE_CLASS_NAME = void 0;
|
|
4
|
+
const colors_1 = require("./colors");
|
|
5
|
+
// Purely visual hover styling must be driven by CSS `:hover` rather than
|
|
6
|
+
// React state: When the Studio runs in an <iframe> (like in Browser Studio),
|
|
7
|
+
// browsers can fail to deliver `pointerleave` when the pointer exits the
|
|
8
|
+
// frame, which would leave a state-driven hover background stuck forever.
|
|
9
|
+
// CSS `:hover` is maintained by the browser and self-corrects.
|
|
10
|
+
// https://github.com/remotion-dev/remotion/issues/9886
|
|
11
|
+
exports.HOVERABLE_CLASS_NAME = '__remotion-hoverable';
|
|
12
|
+
exports.HOVER_GROUP_CLASS_NAME = '__remotion-hover-group';
|
|
13
|
+
exports.HOVER_GROUP_REVEAL_CLASS_NAME = '__remotion-hover-group-reveal';
|
|
14
|
+
const BG_VARIABLE = '--remotion-hoverable-bg';
|
|
15
|
+
const HOVER_BG_VARIABLE = '--remotion-hoverable-hover-bg';
|
|
16
|
+
const COLOR_VARIABLE = '--remotion-hoverable-color';
|
|
17
|
+
const HOVER_COLOR_VARIABLE = '--remotion-hoverable-hover-color';
|
|
18
|
+
// To disable the hover effect (e.g. for a disabled control), pass the idle
|
|
19
|
+
// values as the hover values.
|
|
20
|
+
const hoverableStyle = ({ idleBackground, hoverBackground, idleColor, hoverColor, }) => {
|
|
21
|
+
return {
|
|
22
|
+
[BG_VARIABLE]: idleBackground,
|
|
23
|
+
[HOVER_BG_VARIABLE]: hoverBackground,
|
|
24
|
+
[COLOR_VARIABLE]: idleColor,
|
|
25
|
+
[HOVER_COLOR_VARIABLE]: hoverColor,
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
exports.hoverableStyle = hoverableStyle;
|
|
29
|
+
// The doubled class names give these rules a higher specificity than the
|
|
30
|
+
// `.css-reset, .css-reset *` rule which sets `color` and `background` on
|
|
31
|
+
// every descendant - the injection order of the two stylesheets is not
|
|
32
|
+
// deterministic.
|
|
33
|
+
// The `*` selectors re-establish color inheritance inside the hoverable
|
|
34
|
+
// element so that text and `currentColor`-based icons follow the hover state.
|
|
35
|
+
const hoverable = `.${exports.HOVERABLE_CLASS_NAME}.${exports.HOVERABLE_CLASS_NAME}`;
|
|
36
|
+
const hoverGroup = `.${exports.HOVER_GROUP_CLASS_NAME}`;
|
|
37
|
+
const reveal = `.${exports.HOVER_GROUP_REVEAL_CLASS_NAME}.${exports.HOVER_GROUP_REVEAL_CLASS_NAME}`;
|
|
38
|
+
const makeHoverableCSS = () => `
|
|
39
|
+
${hoverable} {
|
|
40
|
+
background-color: var(${BG_VARIABLE}, ${colors_1.TRANSPARENT});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
${hoverable},
|
|
44
|
+
${hoverable} * {
|
|
45
|
+
color: var(${COLOR_VARIABLE}, inherit);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@media (hover: hover) {
|
|
49
|
+
${hoverable}:hover,
|
|
50
|
+
${hoverGroup}:hover ${hoverable} {
|
|
51
|
+
background-color: var(${HOVER_BG_VARIABLE}, var(${BG_VARIABLE}, ${colors_1.TRANSPARENT}));
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
${hoverable}:hover,
|
|
55
|
+
${hoverable}:hover *,
|
|
56
|
+
${hoverGroup}:hover ${hoverable},
|
|
57
|
+
${hoverGroup}:hover ${hoverable} * {
|
|
58
|
+
color: var(${HOVER_COLOR_VARIABLE}, var(${COLOR_VARIABLE}, inherit));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
${hoverGroup} ${reveal} {
|
|
62
|
+
opacity: 0;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
${hoverGroup}:hover ${reveal} {
|
|
66
|
+
opacity: 1;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
`;
|
|
70
|
+
exports.makeHoverableCSS = makeHoverableCSS;
|
|
@@ -4,6 +4,7 @@ exports.injectCSS = void 0;
|
|
|
4
4
|
const remotion_1 = require("remotion");
|
|
5
5
|
const scroll_to_default_props_path_1 = require("../components/RenderModal/SchemaEditor/scroll-to-default-props-path");
|
|
6
6
|
const colors_1 = require("./colors");
|
|
7
|
+
const hoverable_1 = require("./hoverable");
|
|
7
8
|
const makeDefaultGlobalCSS = () => {
|
|
8
9
|
const dragAreaFactor = 2;
|
|
9
10
|
const fromMiddle = 50 / dragAreaFactor;
|
|
@@ -153,6 +154,8 @@ const makeDefaultGlobalCSS = () => {
|
|
|
153
154
|
color: var(--remotion-cli-internals-blue) !important;
|
|
154
155
|
transition: color 0.2s ease-in-out;
|
|
155
156
|
}
|
|
157
|
+
|
|
158
|
+
${(0, hoverable_1.makeHoverableCSS)()}
|
|
156
159
|
`.trim();
|
|
157
160
|
};
|
|
158
161
|
let injected = false;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const getMissingPackages: (dependencies:
|
|
3
|
-
export declare const installRequiredPackages: (dependencies:
|
|
1
|
+
import type { PackageInstallSpec } from '@remotion/studio-shared';
|
|
2
|
+
export declare const getMissingPackages: (dependencies: readonly PackageInstallSpec[]) => PackageInstallSpec[];
|
|
3
|
+
export declare const installRequiredPackages: (dependencies: readonly PackageInstallSpec[]) => Promise<void>;
|
|
@@ -4,12 +4,7 @@ exports.installRequiredPackages = exports.getMissingPackages = void 0;
|
|
|
4
4
|
const install_package_1 = require("../api/install-package");
|
|
5
5
|
const NotificationCenter_1 = require("../components/Notifications/NotificationCenter");
|
|
6
6
|
let installQueue = Promise.resolve();
|
|
7
|
-
const uniqueDependencies = (dependencies) => Array.from(new Map(dependencies.map((dependency) =>
|
|
8
|
-
const normalized = typeof dependency === 'string'
|
|
9
|
-
? { name: dependency, version: null }
|
|
10
|
-
: dependency;
|
|
11
|
-
return [normalized.name, normalized];
|
|
12
|
-
})).values());
|
|
7
|
+
const uniqueDependencies = (dependencies) => Array.from(new Map(dependencies.map((dependency) => [dependency.name, dependency])).values());
|
|
13
8
|
const getMissingPackages = (dependencies) => {
|
|
14
9
|
var _a;
|
|
15
10
|
const installedPackages = (_a = window.remotion_installedPackages) !== null && _a !== void 0 ? _a : [];
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.calculateStudioCanvasTransformation = exports.calculateStudioScale = exports.getStudioCurrentScaleContext = exports.getStudioPaddedCanvasSize = exports.STUDIO_FIT_PADDING = void 0;
|
|
4
4
|
const player_1 = require("@remotion/player");
|
|
5
5
|
const remotion_1 = require("remotion");
|
|
6
|
-
exports.STUDIO_FIT_PADDING =
|
|
6
|
+
exports.STUDIO_FIT_PADDING = 8;
|
|
7
7
|
const getPadding = (length) => {
|
|
8
8
|
return Math.min(exports.STUDIO_FIT_PADDING, Math.max(0, (length - 1) / 2));
|
|
9
9
|
};
|
|
@@ -31,7 +31,7 @@ export type TimelineTreeNode = {
|
|
|
31
31
|
readonly label: string;
|
|
32
32
|
readonly field: AnySchemaFieldInfo | null;
|
|
33
33
|
};
|
|
34
|
-
export declare const buildTimelineTree: ({ sequence, nodePathInfo, getDragOverrides, getEffectDragOverrides, propStatuses, includeTextContent, includeSourceControls, }: {
|
|
34
|
+
export declare const buildTimelineTree: ({ sequence, nodePathInfo, getDragOverrides, getEffectDragOverrides, propStatuses, includeTextContent, includeSourceControls, runtimeValues, }: {
|
|
35
35
|
sequence: TSequence;
|
|
36
36
|
nodePathInfo: SequenceNodePathInfo;
|
|
37
37
|
getDragOverrides: GetDragOverrides;
|
|
@@ -39,6 +39,7 @@ export declare const buildTimelineTree: ({ sequence, nodePathInfo, getDragOverri
|
|
|
39
39
|
propStatuses: PropStatuses;
|
|
40
40
|
includeTextContent: boolean;
|
|
41
41
|
includeSourceControls: boolean;
|
|
42
|
+
runtimeValues: Readonly<Record<string, unknown>> | null;
|
|
42
43
|
}) => TimelineTreeNode[];
|
|
43
44
|
export type FlatTreeRow = {
|
|
44
45
|
readonly node: TimelineTreeNode;
|
|
@@ -14,13 +14,15 @@ exports.TIMELINE_ITEM_BORDER_BOTTOM = 1;
|
|
|
14
14
|
exports.TIMELINE_TRACK_EXPANDED_HEIGHT = 100;
|
|
15
15
|
exports.TREE_GROUP_ROW_HEIGHT = 22;
|
|
16
16
|
exports.EXPANDED_SECTION_PADDING_RIGHT = 10;
|
|
17
|
-
const buildTimelineTree = ({ sequence, nodePathInfo, getDragOverrides, getEffectDragOverrides, propStatuses, includeTextContent, includeSourceControls, }) => {
|
|
17
|
+
const buildTimelineTree = ({ sequence, nodePathInfo, getDragOverrides, getEffectDragOverrides, propStatuses, includeTextContent, includeSourceControls, runtimeValues, }) => {
|
|
18
18
|
var _a;
|
|
19
19
|
const roots = [];
|
|
20
20
|
const { sequenceSubscriptionKey, index, auxiliaryKeys, supportsEffects } = nodePathInfo;
|
|
21
21
|
const controlFields = (0, studio_shared_1.getFieldsToShow)({
|
|
22
22
|
schema: sequence.controls.schema,
|
|
23
|
-
currentRuntimeValueDotNotation:
|
|
23
|
+
currentRuntimeValueDotNotation: runtimeValues !== null
|
|
24
|
+
? runtimeValues
|
|
25
|
+
: sequence.controls.runtimeValues.getSnapshot(),
|
|
24
26
|
getDragOverrides,
|
|
25
27
|
propStatuses,
|
|
26
28
|
nodePath: sequenceSubscriptionKey,
|
|
@@ -140,6 +142,7 @@ const getExpandedTrackHeight = ({ sequence, nodePathInfo, getIsExpanded, propSta
|
|
|
140
142
|
propStatuses,
|
|
141
143
|
includeTextContent: false,
|
|
142
144
|
includeSourceControls: false,
|
|
145
|
+
runtimeValues: null,
|
|
143
146
|
});
|
|
144
147
|
const flat = (0, exports.flattenVisibleTreeNodes)({ nodes: tree, getIsExpanded });
|
|
145
148
|
if (flat.length === 0) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useIsFullscreen: () => boolean;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useIsFullscreen = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const getIsFullscreen = () => {
|
|
6
|
+
var _a;
|
|
7
|
+
return Boolean((_a = document.fullscreenElement) !== null && _a !== void 0 ? _a : document
|
|
8
|
+
.webkitFullscreenElement);
|
|
9
|
+
};
|
|
10
|
+
const useIsFullscreen = () => {
|
|
11
|
+
const [isFullscreen, setIsFullscreen] = (0, react_1.useState)(getIsFullscreen);
|
|
12
|
+
(0, react_1.useEffect)(() => {
|
|
13
|
+
const onFullscreenChange = () => {
|
|
14
|
+
setIsFullscreen(getIsFullscreen());
|
|
15
|
+
};
|
|
16
|
+
document.addEventListener('fullscreenchange', onFullscreenChange);
|
|
17
|
+
document.addEventListener('webkitfullscreenchange', onFullscreenChange);
|
|
18
|
+
return () => {
|
|
19
|
+
document.removeEventListener('fullscreenchange', onFullscreenChange);
|
|
20
|
+
document.removeEventListener('webkitfullscreenchange', onFullscreenChange);
|
|
21
|
+
};
|
|
22
|
+
}, []);
|
|
23
|
+
return isFullscreen;
|
|
24
|
+
};
|
|
25
|
+
exports.useIsFullscreen = useIsFullscreen;
|
|
@@ -39,18 +39,11 @@ const use_keybinding_1 = require("./use-keybinding");
|
|
|
39
39
|
const openExternal = (link) => {
|
|
40
40
|
window.open(link, '_blank');
|
|
41
41
|
};
|
|
42
|
-
const
|
|
43
|
-
transform: `rotate(90deg)`,
|
|
42
|
+
const inheritColor = {
|
|
44
43
|
color: 'inherit',
|
|
45
44
|
};
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
};
|
|
49
|
-
const iconPath = {
|
|
50
|
-
color: 'inherit',
|
|
51
|
-
};
|
|
52
|
-
const ICON_SIZE = 16;
|
|
53
|
-
const getFileMenu = ({ readOnlyStudio, closeMenu, previewServerState, setSelectedModal, }) => {
|
|
45
|
+
const ICON_SIZE = 14;
|
|
46
|
+
const getFileMenu = ({ readOnlyStudio, closeMenu, editorName, previewServerState, setSelectedModal, }) => {
|
|
54
47
|
const fileManagerName = (0, get_file_manager_name_1.getFileManagerName)(window.remotion_fileSystemPlatform);
|
|
55
48
|
const browserStudioOperations = (0, browser_studio_operations_1.getBrowserStudioOperations)();
|
|
56
49
|
const downloadProject = browserStudioOperations === null || browserStudioOperations === void 0 ? void 0 : browserStudioOperations.downloadProject;
|
|
@@ -151,11 +144,11 @@ const getFileMenu = ({ readOnlyStudio, closeMenu, previewServerState, setSelecte
|
|
|
151
144
|
id: 'open-project-divider',
|
|
152
145
|
}
|
|
153
146
|
: null,
|
|
154
|
-
|
|
147
|
+
editorName && !readOnlyStudio
|
|
155
148
|
? {
|
|
156
149
|
id: 'open-in-editor',
|
|
157
150
|
value: 'open-in-editor',
|
|
158
|
-
label: `Open in ${
|
|
151
|
+
label: `Open in ${editorName}`,
|
|
159
152
|
onClick: async () => {
|
|
160
153
|
await (0, open_in_editor_1.openInEditor)({
|
|
161
154
|
originalFileName: `${window.remotion_cwd}`,
|
|
@@ -166,13 +159,13 @@ const getFileMenu = ({ readOnlyStudio, closeMenu, previewServerState, setSelecte
|
|
|
166
159
|
}, null)
|
|
167
160
|
.then(({ success }) => {
|
|
168
161
|
if (!success) {
|
|
169
|
-
(0, NotificationCenter_1.showNotification)(`Could not open ${
|
|
162
|
+
(0, NotificationCenter_1.showNotification)(`Could not open ${editorName}`, 2000);
|
|
170
163
|
}
|
|
171
164
|
})
|
|
172
165
|
.catch((err) => {
|
|
173
166
|
// eslint-disable-next-line no-console
|
|
174
167
|
console.error(err);
|
|
175
|
-
(0, NotificationCenter_1.showNotification)(`Could not open ${
|
|
168
|
+
(0, NotificationCenter_1.showNotification)(`Could not open ${editorName}`, 2000);
|
|
176
169
|
});
|
|
177
170
|
},
|
|
178
171
|
type: 'item',
|
|
@@ -261,7 +254,7 @@ const getRenderMenuItems = ({ closeMenu, previewServerState, readOnlyStudio, })
|
|
|
261
254
|
};
|
|
262
255
|
const useMenuStructure = (closeMenu, readOnlyStudio) => {
|
|
263
256
|
var _a;
|
|
264
|
-
const { setSelectedModal } = (0, react_1.useContext)(modals_1.
|
|
257
|
+
const { setSelectedModal } = (0, react_1.useContext)(modals_1.SetSelectedModalContext);
|
|
265
258
|
const { checkerboard, setCheckerboard } = (0, react_1.useContext)(checkerboard_1.CheckerboardContext);
|
|
266
259
|
const { editorZoomGestures, setEditorZoomGestures } = (0, react_1.useContext)(editor_zoom_gestures_1.EditorZoomGesturesContext);
|
|
267
260
|
const { editorShowRulers, setEditorShowRulers } = (0, react_1.useContext)(editor_rulers_1.EditorShowRulersContext);
|
|
@@ -270,6 +263,9 @@ const useMenuStructure = (closeMenu, readOnlyStudio) => {
|
|
|
270
263
|
const { size, setSize } = (0, react_1.useContext)(remotion_1.Internals.PreviewSizeContext);
|
|
271
264
|
const { canvasContent, compositions } = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
272
265
|
const { type } = (0, react_1.useContext)(client_id_1.StudioServerConnectionCtx).previewServerState;
|
|
266
|
+
const editorName = window.remotion_editorName;
|
|
267
|
+
const keyboardShortcutsDisabled = (0, use_keybinding_1.areKeyboardShortcutsDisabled)();
|
|
268
|
+
const studioAskAIEnabled = (0, studio_runtime_config_1.getStudioAskAIEnabled)();
|
|
273
269
|
const canConfigureDefaultEditor = !readOnlyStudio &&
|
|
274
270
|
type === 'connected' &&
|
|
275
271
|
(0, browser_studio_operations_1.getBrowserStudioOperations)() === null;
|
|
@@ -302,7 +298,7 @@ const useMenuStructure = (closeMenu, readOnlyStudio) => {
|
|
|
302
298
|
let struct = [
|
|
303
299
|
{
|
|
304
300
|
id: 'remotion',
|
|
305
|
-
label: (jsx_runtime_1.jsx(layout_1.Row, { align: "center", justify: "center", style:
|
|
301
|
+
label: (jsx_runtime_1.jsx(layout_1.Row, { align: "center", justify: "center", style: inheritColor, children: jsx_runtime_1.jsx("svg", { width: ICON_SIZE, height: ICON_SIZE, viewBox: "0 0 415 426", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: inheritColor, children: jsx_runtime_1.jsx("path", { d: "M93.4691 0.0367432C84.4873 0.520935 77.2494 1.93634 69.9553 4.69266C66.3176 6.05219 60.3548 9.0134 57.0734 11.062C43.3476 19.6103 32.8846 32.4606 27.428 47.4154C26.3405 50.3766 23.3966 59.8188 21.5027 66.3185C8.88329 109.768 1.7204 157.277 0.182822 207.561C-0.0609408 215.569 -0.0609408 234.639 0.182822 242.517C1.21413 275.854 4.42055 305.949 10.2334 336.641C12.596 349.063 16.3837 365.75 18.5776 373.33C23.059 388.732 32.2095 401.843 45.2227 411.453C53.9419 417.896 63.8425 422.217 74.8118 424.34C80.0996 425.365 87.075 425.83 92.2127 425.495C99.3194 425.029 113.42 423.148 124.877 421.118C176.517 411.974 224.22 395.604 267.478 372.175C294.874 357.332 318.294 341.26 340.888 321.761C363.408 302.355 382.609 281.478 399.504 258.049C403.423 252.63 405.392 249.464 407.361 245.478C412.424 235.198 414.805 224.974 414.786 213.539C414.786 202.886 412.761 193.425 408.392 183.741C406.292 179.066 404.286 175.714 399.785 169.345C383.21 145.898 364.815 125.467 342.389 105.614C307.624 74.8481 266.335 49.613 220.226 30.9334C210.232 26.8921 200.387 23.335 188.537 19.4799C163.448 11.3413 132.396 4.28293 106.126 0.763062C102.001 0.204346 96.3942 -0.112244 93.4691 0.0367432Z", fill: colors_1.CURRENT_COLOR, style: inheritColor }) }) })),
|
|
306
302
|
leaveLeftPadding: false,
|
|
307
303
|
items: [
|
|
308
304
|
{
|
|
@@ -333,34 +329,17 @@ const useMenuStructure = (closeMenu, readOnlyStudio) => {
|
|
|
333
329
|
subMenu: null,
|
|
334
330
|
quickSwitcherLabel: 'Help: Changelog',
|
|
335
331
|
},
|
|
336
|
-
canConfigureDefaultEditor
|
|
337
|
-
? {
|
|
338
|
-
id: 'default-editor',
|
|
339
|
-
value: 'default-editor',
|
|
340
|
-
label: 'Configure default editor...',
|
|
341
|
-
onClick: () => {
|
|
342
|
-
closeMenu();
|
|
343
|
-
setSelectedModal({
|
|
344
|
-
type: 'configure-default-editor',
|
|
345
|
-
});
|
|
346
|
-
},
|
|
347
|
-
type: 'item',
|
|
348
|
-
keyHint: null,
|
|
349
|
-
leftItem: null,
|
|
350
|
-
subMenu: null,
|
|
351
|
-
quickSwitcherLabel: 'Configure default editor...',
|
|
352
|
-
}
|
|
353
|
-
: null,
|
|
354
332
|
{
|
|
355
|
-
id: '
|
|
356
|
-
value: '
|
|
357
|
-
label: '
|
|
333
|
+
id: 'settings',
|
|
334
|
+
value: 'settings',
|
|
335
|
+
label: 'Settings...',
|
|
358
336
|
onClick: () => {
|
|
359
337
|
var _a;
|
|
360
338
|
var _b;
|
|
361
339
|
closeMenu();
|
|
362
340
|
setSelectedModal({
|
|
363
|
-
type: '
|
|
341
|
+
type: 'settings',
|
|
342
|
+
initialTab: canConfigureDefaultEditor ? 'apps' : 'license',
|
|
364
343
|
initialPublicLicenseKey: (_b = (_a = window.remotion_renderDefaults) === null || _a === void 0 ? void 0 : _a.publicLicenseKey) !== null && _b !== void 0 ? _b : null,
|
|
365
344
|
});
|
|
366
345
|
},
|
|
@@ -368,7 +347,7 @@ const useMenuStructure = (closeMenu, readOnlyStudio) => {
|
|
|
368
347
|
keyHint: null,
|
|
369
348
|
leftItem: null,
|
|
370
349
|
subMenu: null,
|
|
371
|
-
quickSwitcherLabel: '
|
|
350
|
+
quickSwitcherLabel: 'Settings...',
|
|
372
351
|
disabled: readOnlyStudio || type !== 'connected',
|
|
373
352
|
},
|
|
374
353
|
{
|
|
@@ -409,6 +388,7 @@ const useMenuStructure = (closeMenu, readOnlyStudio) => {
|
|
|
409
388
|
getFileMenu({
|
|
410
389
|
readOnlyStudio,
|
|
411
390
|
closeMenu,
|
|
391
|
+
editorName,
|
|
412
392
|
previewServerState: type,
|
|
413
393
|
setSelectedModal,
|
|
414
394
|
}),
|
|
@@ -496,7 +476,7 @@ const useMenuStructure = (closeMenu, readOnlyStudio) => {
|
|
|
496
476
|
},
|
|
497
477
|
{
|
|
498
478
|
id: 'enable-snapping',
|
|
499
|
-
keyHint:
|
|
479
|
+
keyHint: keyboardShortcutsDisabled ? null : 'Shift+M',
|
|
500
480
|
label: 'Enable Snapping',
|
|
501
481
|
onClick: () => {
|
|
502
482
|
closeMenu();
|
|
@@ -783,7 +763,7 @@ const useMenuStructure = (closeMenu, readOnlyStudio) => {
|
|
|
783
763
|
label: 'Tools',
|
|
784
764
|
leaveLeftPadding: false,
|
|
785
765
|
items: [
|
|
786
|
-
|
|
766
|
+
studioAskAIEnabled
|
|
787
767
|
? {
|
|
788
768
|
id: 'ask-ai',
|
|
789
769
|
value: 'ask-ai',
|
|
@@ -846,7 +826,7 @@ const useMenuStructure = (closeMenu, readOnlyStudio) => {
|
|
|
846
826
|
{
|
|
847
827
|
id: 'shortcuts',
|
|
848
828
|
value: 'shortcuts',
|
|
849
|
-
label:
|
|
829
|
+
label: keyboardShortcutsDisabled
|
|
850
830
|
? 'Shortcuts (disabled)'
|
|
851
831
|
: 'Shortcuts',
|
|
852
832
|
onClick: () => {
|
|
@@ -863,7 +843,7 @@ const useMenuStructure = (closeMenu, readOnlyStudio) => {
|
|
|
863
843
|
leftItem: null,
|
|
864
844
|
subMenu: null,
|
|
865
845
|
type: 'item',
|
|
866
|
-
quickSwitcherLabel:
|
|
846
|
+
quickSwitcherLabel: keyboardShortcutsDisabled
|
|
867
847
|
? 'Show all Keyboard Shortcuts (disabled)'
|
|
868
848
|
: 'Show all Keyboard Shortcuts',
|
|
869
849
|
},
|
|
@@ -1032,6 +1012,9 @@ const useMenuStructure = (closeMenu, readOnlyStudio) => {
|
|
|
1032
1012
|
isFullscreenSupported,
|
|
1033
1013
|
remotion_packageManager,
|
|
1034
1014
|
mobileLayout,
|
|
1015
|
+
editorName,
|
|
1016
|
+
keyboardShortcutsDisabled,
|
|
1017
|
+
studioAskAIEnabled,
|
|
1035
1018
|
size.size,
|
|
1036
1019
|
setSize,
|
|
1037
1020
|
setEditorZoomGestures,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { SequenceRegistrationControls } from 'remotion';
|
|
2
|
+
type RuntimeValueSelectorResult = string | number | boolean | bigint | symbol | null | undefined;
|
|
3
|
+
export declare const useRuntimeValues: (controls: SequenceRegistrationControls | null) => Readonly<Record<string, unknown>>;
|
|
4
|
+
export declare const useRuntimeValue: (controls: SequenceRegistrationControls | null, key: string) => unknown;
|
|
5
|
+
export declare const useRuntimeValueSelector: <T extends RuntimeValueSelectorResult>({ controls, selector, isEqual, }: {
|
|
6
|
+
controls: SequenceRegistrationControls | null;
|
|
7
|
+
selector: (values: Readonly<Record<string, unknown>>) => T;
|
|
8
|
+
isEqual?: ((first: T, second: T) => boolean) | undefined;
|
|
9
|
+
}) => T;
|
|
10
|
+
export declare const useRuntimeValueSnapshots: (controls: readonly SequenceRegistrationControls[]) => readonly Readonly<Record<string, unknown>>[];
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useRuntimeValueSnapshots = exports.useRuntimeValueSelector = exports.useRuntimeValue = exports.useRuntimeValues = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const EMPTY_RUNTIME_VALUES = {};
|
|
6
|
+
const EMPTY_RUNTIME_VALUE_STORE = {
|
|
7
|
+
getSnapshot: () => EMPTY_RUNTIME_VALUES,
|
|
8
|
+
subscribe: () => () => undefined,
|
|
9
|
+
};
|
|
10
|
+
const useRuntimeValues = (controls) => {
|
|
11
|
+
var _a;
|
|
12
|
+
const store = (_a = controls === null || controls === void 0 ? void 0 : controls.runtimeValues) !== null && _a !== void 0 ? _a : EMPTY_RUNTIME_VALUE_STORE;
|
|
13
|
+
return (0, react_1.useSyncExternalStore)(store.subscribe, store.getSnapshot, store.getSnapshot);
|
|
14
|
+
};
|
|
15
|
+
exports.useRuntimeValues = useRuntimeValues;
|
|
16
|
+
const useRuntimeValue = (controls, key) => {
|
|
17
|
+
var _a;
|
|
18
|
+
const store = (_a = controls === null || controls === void 0 ? void 0 : controls.runtimeValues) !== null && _a !== void 0 ? _a : EMPTY_RUNTIME_VALUE_STORE;
|
|
19
|
+
const getSnapshot = (0, react_1.useCallback)(() => store.getSnapshot()[key], [key, store]);
|
|
20
|
+
return (0, react_1.useSyncExternalStore)(store.subscribe, getSnapshot, getSnapshot);
|
|
21
|
+
};
|
|
22
|
+
exports.useRuntimeValue = useRuntimeValue;
|
|
23
|
+
const useRuntimeValueSelector = ({ controls, selector, isEqual = Object.is, }) => {
|
|
24
|
+
var _a;
|
|
25
|
+
const store = (_a = controls === null || controls === void 0 ? void 0 : controls.runtimeValues) !== null && _a !== void 0 ? _a : EMPTY_RUNTIME_VALUE_STORE;
|
|
26
|
+
const selectedStore = (0, react_1.useMemo)(() => {
|
|
27
|
+
let lastSource = store.getSnapshot();
|
|
28
|
+
let lastSelection = selector(lastSource);
|
|
29
|
+
const getSnapshot = () => {
|
|
30
|
+
const nextSource = store.getSnapshot();
|
|
31
|
+
if (nextSource === lastSource) {
|
|
32
|
+
return lastSelection;
|
|
33
|
+
}
|
|
34
|
+
lastSource = nextSource;
|
|
35
|
+
const nextSelection = selector(nextSource);
|
|
36
|
+
if (!isEqual(lastSelection, nextSelection)) {
|
|
37
|
+
lastSelection = nextSelection;
|
|
38
|
+
}
|
|
39
|
+
return lastSelection;
|
|
40
|
+
};
|
|
41
|
+
return {
|
|
42
|
+
getSnapshot,
|
|
43
|
+
subscribe: store.subscribe,
|
|
44
|
+
};
|
|
45
|
+
}, [isEqual, selector, store]);
|
|
46
|
+
return (0, react_1.useSyncExternalStore)(selectedStore.subscribe, selectedStore.getSnapshot, selectedStore.getSnapshot);
|
|
47
|
+
};
|
|
48
|
+
exports.useRuntimeValueSelector = useRuntimeValueSelector;
|
|
49
|
+
const useRuntimeValueSnapshots = (controls) => {
|
|
50
|
+
const stores = (0, react_1.useMemo)(() => controls.map((control) => control.runtimeValues), [controls]);
|
|
51
|
+
const aggregateStore = (0, react_1.useMemo)(() => {
|
|
52
|
+
let lastSnapshots = stores.map((store) => store.getSnapshot());
|
|
53
|
+
const getSnapshot = () => {
|
|
54
|
+
const nextSnapshots = stores.map((store) => store.getSnapshot());
|
|
55
|
+
if (nextSnapshots.length === lastSnapshots.length &&
|
|
56
|
+
nextSnapshots.every((snapshot, index) => snapshot === lastSnapshots[index])) {
|
|
57
|
+
return lastSnapshots;
|
|
58
|
+
}
|
|
59
|
+
lastSnapshots = nextSnapshots;
|
|
60
|
+
return lastSnapshots;
|
|
61
|
+
};
|
|
62
|
+
return {
|
|
63
|
+
getSnapshot,
|
|
64
|
+
subscribe: (listener) => {
|
|
65
|
+
const unsubscribers = stores.map((store) => store.subscribe(listener));
|
|
66
|
+
return () => {
|
|
67
|
+
for (const unsubscribe of unsubscribers) {
|
|
68
|
+
unsubscribe();
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
}, [stores]);
|
|
74
|
+
return (0, react_1.useSyncExternalStore)(aggregateStore.subscribe, aggregateStore.getSnapshot, aggregateStore.getSnapshot);
|
|
75
|
+
};
|
|
76
|
+
exports.useRuntimeValueSnapshots = useRuntimeValueSnapshots;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AppsIcon = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const colors_1 = require("../helpers/colors");
|
|
6
|
+
const AppsIcon = ({ color, ...props }) => (jsx_runtime_1.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 640 640", ...props, children: jsx_runtime_1.jsx("path", { fill: color !== null && color !== void 0 ? color : colors_1.CURRENT_COLOR_LOWERCASE, d: "M144 128C135.2 128 128 135.2 128 144L128 240C128 248.8 135.2 256 144 256L240 256C248.8 256 256 248.8 256 240L256 144C256 135.2 248.8 128 240 128L144 128zM96 144C96 117.5 117.5 96 144 96L240 96C266.5 96 288 117.5 288 144L288 240C288 266.5 266.5 288 240 288L144 288C117.5 288 96 266.5 96 240L96 144zM144 384C135.2 384 128 391.2 128 400L128 496C128 504.8 135.2 512 144 512L240 512C248.8 512 256 504.8 256 496L256 400C256 391.2 248.8 384 240 384L144 384zM96 400C96 373.5 117.5 352 144 352L240 352C266.5 352 288 373.5 288 400L288 496C288 522.5 266.5 544 240 544L144 544C117.5 544 96 522.5 96 496L96 400zM496 128L400 128C391.2 128 384 135.2 384 144L384 240C384 248.8 391.2 256 400 256L496 256C504.8 256 512 248.8 512 240L512 144C512 135.2 504.8 128 496 128zM400 96L496 96C522.5 96 544 117.5 544 144L544 240C544 266.5 522.5 288 496 288L400 288C373.5 288 352 266.5 352 240L352 144C352 117.5 373.5 96 400 96zM400 384C391.2 384 384 391.2 384 400L384 496C384 504.8 391.2 512 400 512L496 512C504.8 512 512 504.8 512 496L512 400C512 391.2 504.8 384 496 384L400 384zM352 400C352 373.5 373.5 352 400 352L496 352C522.5 352 544 373.5 544 400L544 496C544 522.5 522.5 544 496 544L400 544C373.5 544 352 522.5 352 496L352 400z" }) }));
|
|
7
|
+
exports.AppsIcon = AppsIcon;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BrowseElementsIcon = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
// Font Awesome Pro v7.3.1, Copyright 2026 Fonticons, Inc.
|
|
6
|
+
// https://fontawesome.com/license (Commercial License)
|
|
7
|
+
const BrowseElementsIcon = ({ color, ...props }) => {
|
|
8
|
+
return (jsx_runtime_1.jsx("svg", { ...props, xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 640 640", children: jsx_runtime_1.jsx("path", { fill: color, d: "M320 96L224 256L416 256L320 96zM320 64C331.2 64 341.7 69.9 347.4 79.5L443.4 239.5C449.3 249.4 449.5 261.7 443.8 271.7C438.1 281.7 427.5 288 416 288L224 288C212.5 288 201.8 281.8 196.2 271.8C190.6 261.8 190.7 249.5 196.6 239.6L292.6 79.6C298.3 69.9 308.8 64 320 64zM192 528C236.2 528 272 492.2 272 448C272 403.8 236.2 368 192 368C147.8 368 112 403.8 112 448C112 492.2 147.8 528 192 528zM192 336C253.9 336 304 386.1 304 448C304 509.9 253.9 560 192 560C130.1 560 80 509.9 80 448C80 386.1 130.1 336 192 336zM504 384L392 384C387.6 384 384 387.6 384 392L384 504C384 508.4 387.6 512 392 512L504 512C508.4 512 512 508.4 512 504L512 392C512 387.6 508.4 384 504 384zM392 352L504 352C526.1 352 544 369.9 544 392L544 504C544 526.1 526.1 544 504 544L392 544C369.9 544 352 526.1 352 504L352 392C352 369.9 369.9 352 392 352z" }) }));
|
|
9
|
+
};
|
|
10
|
+
exports.BrowseElementsIcon = BrowseElementsIcon;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const CanvasZoomIcon: React.FC<{
|
|
3
|
+
readonly color: string;
|
|
4
|
+
}>;
|
|
5
|
+
export declare const CanvasFitIcon: React.FC<{
|
|
6
|
+
readonly color: string;
|
|
7
|
+
}>;
|
|
8
|
+
export declare const CanvasZoomOutIcon: React.FC<{
|
|
9
|
+
readonly color: string;
|
|
10
|
+
}>;
|