@remotion/promo-pages 4.0.375 → 4.0.377
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/Homepage.js +294 -277
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/Homepage.js +294 -277
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/design.js +215 -199
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/homepage/Pricing.js +216 -200
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/template-modal-content.js +223 -207
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/templates.js +213 -197
- package/dist/design.js +215 -199
- package/dist/homepage/Pricing.js +216 -200
- package/dist/template-modal-content.js +223 -207
- package/dist/templates.js +213 -197
- package/package.json +12 -12
|
@@ -89,39 +89,41 @@ import {
|
|
|
89
89
|
import React11, { useCallback as useCallback5, useImperativeHandle as useImperativeHandle3, useRef as useRef3 } from "react";
|
|
90
90
|
import { jsx as jsx102 } from "react/jsx-runtime";
|
|
91
91
|
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
92
|
-
import { useContext as useContext14,
|
|
92
|
+
import { useContext as useContext14, useLayoutEffect as useLayoutEffect4, useState as useState9 } from "react";
|
|
93
93
|
import {
|
|
94
94
|
createContext as createContext12,
|
|
95
95
|
useCallback as useCallback6,
|
|
96
|
+
useImperativeHandle as useImperativeHandle5,
|
|
96
97
|
useLayoutEffect as useLayoutEffect3,
|
|
97
98
|
useMemo as useMemo11,
|
|
98
99
|
useState as useState8
|
|
99
100
|
} from "react";
|
|
101
|
+
import { flushSync } from "react-dom";
|
|
100
102
|
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
101
103
|
import { forwardRef as forwardRef6, useCallback as useCallback11, useContext as useContext27 } from "react";
|
|
102
104
|
import React12, { createContext as createContext13, useMemo as useMemo12 } from "react";
|
|
103
105
|
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
104
106
|
import { useContext as useContext15 } from "react";
|
|
105
|
-
import { createContext as createContext14, useEffect as
|
|
107
|
+
import { createContext as createContext14, useEffect as useEffect5, useState as useState10 } from "react";
|
|
106
108
|
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
107
109
|
import { createContext as createContext15, useMemo as useMemo13, useReducer } from "react";
|
|
108
110
|
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
109
111
|
import {
|
|
110
112
|
forwardRef as forwardRef4,
|
|
111
113
|
useContext as useContext25,
|
|
112
|
-
useEffect as
|
|
113
|
-
useImperativeHandle as
|
|
114
|
+
useEffect as useEffect13,
|
|
115
|
+
useImperativeHandle as useImperativeHandle6,
|
|
114
116
|
useMemo as useMemo21,
|
|
115
117
|
useRef as useRef12,
|
|
116
118
|
useState as useState15
|
|
117
119
|
} from "react";
|
|
118
|
-
import { useContext as useContext17, useLayoutEffect as
|
|
120
|
+
import { useContext as useContext17, useLayoutEffect as useLayoutEffect5, useRef as useRef7 } from "react";
|
|
119
121
|
import React15, {
|
|
120
122
|
createContext as createContext16,
|
|
121
123
|
createRef as createRef2,
|
|
122
124
|
useCallback as useCallback7,
|
|
123
125
|
useContext as useContext16,
|
|
124
|
-
useEffect as
|
|
126
|
+
useEffect as useEffect6,
|
|
125
127
|
useMemo as useMemo15,
|
|
126
128
|
useRef as useRef5,
|
|
127
129
|
useState as useState11
|
|
@@ -129,13 +131,13 @@ import React15, {
|
|
|
129
131
|
import { useMemo as useMemo14 } from "react";
|
|
130
132
|
import { jsx as jsx16, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
131
133
|
import { useRef as useRef6 } from "react";
|
|
132
|
-
import { useContext as useContext19, useEffect as
|
|
134
|
+
import { useContext as useContext19, useEffect as useEffect7, useMemo as useMemo16, useState as useState12 } from "react";
|
|
133
135
|
import { useContext as useContext18 } from "react";
|
|
134
136
|
import {
|
|
135
137
|
useCallback as useCallback10,
|
|
136
138
|
useContext as useContext22,
|
|
137
|
-
useEffect as
|
|
138
|
-
useLayoutEffect as
|
|
139
|
+
useEffect as useEffect11,
|
|
140
|
+
useLayoutEffect as useLayoutEffect7,
|
|
139
141
|
useRef as useRef11
|
|
140
142
|
} from "react";
|
|
141
143
|
import { useCallback as useCallback9, useMemo as useMemo19, useRef as useRef9 } from "react";
|
|
@@ -143,33 +145,33 @@ import { useContext as useContext21, useMemo as useMemo18 } from "react";
|
|
|
143
145
|
import React16, {
|
|
144
146
|
useCallback as useCallback8,
|
|
145
147
|
useContext as useContext20,
|
|
146
|
-
useEffect as
|
|
147
|
-
useLayoutEffect as
|
|
148
|
+
useEffect as useEffect8,
|
|
149
|
+
useLayoutEffect as useLayoutEffect6,
|
|
148
150
|
useMemo as useMemo17,
|
|
149
151
|
useRef as useRef8,
|
|
150
152
|
useState as useState13
|
|
151
153
|
} from "react";
|
|
152
154
|
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
153
155
|
import React17 from "react";
|
|
154
|
-
import { useEffect as
|
|
155
|
-
import { useEffect as
|
|
156
|
-
import { useContext as useContext23, useEffect as
|
|
156
|
+
import { useEffect as useEffect9, useState as useState14 } from "react";
|
|
157
|
+
import { useEffect as useEffect10, useRef as useRef10 } from "react";
|
|
158
|
+
import { useContext as useContext23, useEffect as useEffect12 } from "react";
|
|
157
159
|
import { createContext as createContext17, useContext as useContext24, useMemo as useMemo20 } from "react";
|
|
158
160
|
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
159
161
|
import {
|
|
160
162
|
forwardRef as forwardRef5,
|
|
161
163
|
useContext as useContext26,
|
|
162
|
-
useEffect as
|
|
163
|
-
useImperativeHandle as
|
|
164
|
-
useLayoutEffect as
|
|
164
|
+
useEffect as useEffect14,
|
|
165
|
+
useImperativeHandle as useImperativeHandle7,
|
|
166
|
+
useLayoutEffect as useLayoutEffect8,
|
|
165
167
|
useMemo as useMemo222,
|
|
166
168
|
useRef as useRef13
|
|
167
169
|
} from "react";
|
|
168
170
|
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
169
171
|
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
170
|
-
import { Suspense, useContext as useContext29, useEffect as
|
|
172
|
+
import { Suspense, useContext as useContext29, useEffect as useEffect16 } from "react";
|
|
171
173
|
import { createPortal } from "react-dom";
|
|
172
|
-
import { createContext as createContext18, useContext as useContext28, useEffect as
|
|
174
|
+
import { createContext as createContext18, useContext as useContext28, useEffect as useEffect15, useMemo as useMemo23 } from "react";
|
|
173
175
|
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
174
176
|
import { jsx as jsx222, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
175
177
|
import React21, { useMemo as useMemo24 } from "react";
|
|
@@ -180,8 +182,8 @@ import {
|
|
|
180
182
|
forwardRef as forwardRef8,
|
|
181
183
|
useCallback as useCallback13,
|
|
182
184
|
useContext as useContext30,
|
|
183
|
-
useImperativeHandle as
|
|
184
|
-
useLayoutEffect as
|
|
185
|
+
useImperativeHandle as useImperativeHandle8,
|
|
186
|
+
useLayoutEffect as useLayoutEffect9,
|
|
185
187
|
useRef as useRef14
|
|
186
188
|
} from "react";
|
|
187
189
|
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
@@ -189,23 +191,24 @@ import { createRef as createRef3 } from "react";
|
|
|
189
191
|
import React25 from "react";
|
|
190
192
|
import {
|
|
191
193
|
useCallback as useCallback14,
|
|
192
|
-
useImperativeHandle as
|
|
194
|
+
useImperativeHandle as useImperativeHandle9,
|
|
193
195
|
useMemo as useMemo25,
|
|
194
196
|
useRef as useRef15,
|
|
195
197
|
useState as useState17
|
|
196
198
|
} from "react";
|
|
197
199
|
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
198
|
-
import
|
|
200
|
+
import React26 from "react";
|
|
201
|
+
import { useEffect as useEffect17, useMemo as useMemo27, useState as useState18 } from "react";
|
|
199
202
|
import { createContext as createContext19, useContext as useContext31, useMemo as useMemo26 } from "react";
|
|
200
203
|
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
201
204
|
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
202
|
-
import
|
|
205
|
+
import React28, { createContext as createContext20 } from "react";
|
|
203
206
|
import { useCallback as useCallback16 } from "react";
|
|
204
207
|
import {
|
|
205
208
|
useCallback as useCallback15,
|
|
206
209
|
useContext as useContext32,
|
|
207
|
-
useEffect as
|
|
208
|
-
useLayoutEffect as
|
|
210
|
+
useEffect as useEffect18,
|
|
211
|
+
useLayoutEffect as useLayoutEffect10,
|
|
209
212
|
useMemo as useMemo28,
|
|
210
213
|
useState as useState19
|
|
211
214
|
} from "react";
|
|
@@ -213,30 +216,30 @@ import { jsx as jsx29 } from "react/jsx-runtime";
|
|
|
213
216
|
import {
|
|
214
217
|
forwardRef as forwardRef9,
|
|
215
218
|
useContext as useContext33,
|
|
216
|
-
useEffect as
|
|
217
|
-
useImperativeHandle as
|
|
219
|
+
useEffect as useEffect20,
|
|
220
|
+
useImperativeHandle as useImperativeHandle10,
|
|
218
221
|
useMemo as useMemo29,
|
|
219
222
|
useRef as useRef16,
|
|
220
223
|
useState as useState20
|
|
221
224
|
} from "react";
|
|
222
|
-
import { useEffect as
|
|
225
|
+
import { useEffect as useEffect19 } from "react";
|
|
223
226
|
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
224
227
|
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
225
|
-
import
|
|
228
|
+
import React32, { useMemo as useMemo30 } from "react";
|
|
226
229
|
import { jsx as jsx322 } from "react/jsx-runtime";
|
|
227
230
|
import { Children, forwardRef as forwardRef10, useMemo as useMemo31 } from "react";
|
|
228
|
-
import
|
|
229
|
-
import
|
|
231
|
+
import React33 from "react";
|
|
232
|
+
import React34, { createContext as createContext21 } from "react";
|
|
230
233
|
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
231
234
|
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
232
|
-
import
|
|
235
|
+
import React36 from "react";
|
|
233
236
|
import { forwardRef as forwardRef12, useCallback as useCallback17, useContext as useContext35 } from "react";
|
|
234
237
|
import {
|
|
235
238
|
forwardRef as forwardRef11,
|
|
236
239
|
useContext as useContext34,
|
|
237
|
-
useEffect as
|
|
238
|
-
useImperativeHandle as
|
|
239
|
-
useLayoutEffect as
|
|
240
|
+
useEffect as useEffect21,
|
|
241
|
+
useImperativeHandle as useImperativeHandle11,
|
|
242
|
+
useLayoutEffect as useLayoutEffect11,
|
|
240
243
|
useMemo as useMemo32,
|
|
241
244
|
useRef as useRef17
|
|
242
245
|
} from "react";
|
|
@@ -451,18 +454,18 @@ function exponentialBackoff(errorCount) {
|
|
|
451
454
|
return 1000 * 2 ** (errorCount - 1);
|
|
452
455
|
}
|
|
453
456
|
function useRemotionContexts() {
|
|
454
|
-
const compositionManagerCtx =
|
|
455
|
-
const timelineContext =
|
|
456
|
-
const setTimelineContext =
|
|
457
|
-
const sequenceContext =
|
|
458
|
-
const nonceContext =
|
|
459
|
-
const canUseRemotionHooksContext =
|
|
460
|
-
const preloadContext =
|
|
461
|
-
const resolveCompositionContext =
|
|
462
|
-
const renderAssetManagerContext =
|
|
463
|
-
const sequenceManagerContext =
|
|
464
|
-
const bufferManagerContext =
|
|
465
|
-
const logLevelContext =
|
|
457
|
+
const compositionManagerCtx = React32.useContext(CompositionManager);
|
|
458
|
+
const timelineContext = React32.useContext(TimelineContext);
|
|
459
|
+
const setTimelineContext = React32.useContext(SetTimelineContext);
|
|
460
|
+
const sequenceContext = React32.useContext(SequenceContext);
|
|
461
|
+
const nonceContext = React32.useContext(NonceContext);
|
|
462
|
+
const canUseRemotionHooksContext = React32.useContext(CanUseRemotionHooks);
|
|
463
|
+
const preloadContext = React32.useContext(PreloadContext);
|
|
464
|
+
const resolveCompositionContext = React32.useContext(ResolveCompositionContext);
|
|
465
|
+
const renderAssetManagerContext = React32.useContext(RenderAssetManager);
|
|
466
|
+
const sequenceManagerContext = React32.useContext(SequenceManager);
|
|
467
|
+
const bufferManagerContext = React32.useContext(BufferingContextReact);
|
|
468
|
+
const logLevelContext = React32.useContext(LogLevelContext);
|
|
466
469
|
return useMemo30(() => ({
|
|
467
470
|
compositionManagerCtx,
|
|
468
471
|
timelineContext,
|
|
@@ -753,7 +756,7 @@ var __defProp2, __export2 = (target, all) => {
|
|
|
753
756
|
});
|
|
754
757
|
}, useIsPlayer = () => {
|
|
755
758
|
return useContext(IsPlayerContext);
|
|
756
|
-
}, VERSION = "4.0.
|
|
759
|
+
}, VERSION = "4.0.377", checkMultipleRemotionVersions = () => {
|
|
757
760
|
if (typeof globalThis === "undefined") {
|
|
758
761
|
return;
|
|
759
762
|
}
|
|
@@ -1109,7 +1112,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
1109
1112
|
calculateMetadata,
|
|
1110
1113
|
signal,
|
|
1111
1114
|
defaultProps,
|
|
1112
|
-
originalProps,
|
|
1115
|
+
inputProps: originalProps,
|
|
1113
1116
|
compositionId,
|
|
1114
1117
|
compositionDurationInFrames,
|
|
1115
1118
|
compositionFps,
|
|
@@ -1246,7 +1249,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
1246
1249
|
const result = resolveVideoConfigOrCatch({
|
|
1247
1250
|
compositionId,
|
|
1248
1251
|
calculateMetadata,
|
|
1249
|
-
|
|
1252
|
+
inputProps: combinedProps,
|
|
1250
1253
|
signal,
|
|
1251
1254
|
defaultProps,
|
|
1252
1255
|
compositionDurationInFrames,
|
|
@@ -2427,7 +2430,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
2427
2430
|
return;
|
|
2428
2431
|
}
|
|
2429
2432
|
validateContent(artifact.content);
|
|
2430
|
-
}, RenderAssetManager, RenderAssetManagerProvider = ({ children }) => {
|
|
2433
|
+
}, RenderAssetManager, RenderAssetManagerProvider = ({ children, collectAssets }) => {
|
|
2431
2434
|
const [renderAssets, setRenderAssets] = useState8([]);
|
|
2432
2435
|
const registerRenderAsset = useCallback6((renderAsset) => {
|
|
2433
2436
|
validateRenderAsset(renderAsset);
|
|
@@ -2435,6 +2438,18 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
2435
2438
|
return [...assets, renderAsset];
|
|
2436
2439
|
});
|
|
2437
2440
|
}, []);
|
|
2441
|
+
if (collectAssets) {
|
|
2442
|
+
useImperativeHandle5(collectAssets, () => {
|
|
2443
|
+
return {
|
|
2444
|
+
collectAssets: () => {
|
|
2445
|
+
flushSync(() => {
|
|
2446
|
+
setRenderAssets([]);
|
|
2447
|
+
});
|
|
2448
|
+
return renderAssets;
|
|
2449
|
+
}
|
|
2450
|
+
};
|
|
2451
|
+
}, [renderAssets]);
|
|
2452
|
+
}
|
|
2438
2453
|
const unregisterRenderAsset = useCallback6((id) => {
|
|
2439
2454
|
setRenderAssets((assts) => {
|
|
2440
2455
|
return assts.filter((a) => a.id !== id);
|
|
@@ -2466,7 +2481,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
2466
2481
|
const [id] = useState9(() => {
|
|
2467
2482
|
return String(Math.random());
|
|
2468
2483
|
});
|
|
2469
|
-
|
|
2484
|
+
useLayoutEffect4(() => {
|
|
2470
2485
|
if (!env.isRendering) {
|
|
2471
2486
|
return;
|
|
2472
2487
|
}
|
|
@@ -2600,7 +2615,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
2600
2615
|
updaters.forEach((u) => u());
|
|
2601
2616
|
}, PrefetchProvider = ({ children }) => {
|
|
2602
2617
|
const [_preloads, _setPreloads] = useState10(() => preloads);
|
|
2603
|
-
|
|
2618
|
+
useEffect5(() => {
|
|
2604
2619
|
const updaterFunction = () => {
|
|
2605
2620
|
_setPreloads(preloads);
|
|
2606
2621
|
};
|
|
@@ -3193,7 +3208,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
3193
3208
|
audios.current = [];
|
|
3194
3209
|
rerenderAudios();
|
|
3195
3210
|
}, [numberOfAudioTags, rerenderAudios]);
|
|
3196
|
-
|
|
3211
|
+
useEffect6(() => {
|
|
3197
3212
|
return () => {
|
|
3198
3213
|
resetAudio();
|
|
3199
3214
|
};
|
|
@@ -3376,7 +3391,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
3376
3391
|
}
|
|
3377
3392
|
const { audioContext } = sharedAudioContext;
|
|
3378
3393
|
if (typeof window !== "undefined") {
|
|
3379
|
-
|
|
3394
|
+
useLayoutEffect5(() => {
|
|
3380
3395
|
if (!audioContext) {
|
|
3381
3396
|
return;
|
|
3382
3397
|
}
|
|
@@ -3505,7 +3520,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
3505
3520
|
});
|
|
3506
3521
|
}).join(",");
|
|
3507
3522
|
}, [duration, startsAt, volume, mediaVolume]);
|
|
3508
|
-
|
|
3523
|
+
useEffect7(() => {
|
|
3509
3524
|
if (typeof volume === "number" && volume !== initialVolume) {
|
|
3510
3525
|
warnOnce2(`Remotion: The ${mediaType} with src ${src} has changed it's volume. Prefer the callback syntax for setting volume to get better timeline display: https://www.remotion.dev/docs/audio/volume`);
|
|
3511
3526
|
}
|
|
@@ -3558,7 +3573,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
3558
3573
|
trimBefore: undefined,
|
|
3559
3574
|
playbackRate
|
|
3560
3575
|
});
|
|
3561
|
-
|
|
3576
|
+
useEffect7(() => {
|
|
3562
3577
|
if (!src) {
|
|
3563
3578
|
throw new Error("No src passed");
|
|
3564
3579
|
}
|
|
@@ -3648,7 +3663,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
3648
3663
|
}
|
|
3649
3664
|
};
|
|
3650
3665
|
}, []);
|
|
3651
|
-
|
|
3666
|
+
useEffect8(() => {
|
|
3652
3667
|
if (blocks.length > 0) {
|
|
3653
3668
|
onBufferingCallbacks.forEach((c) => c());
|
|
3654
3669
|
playbackLogging({
|
|
@@ -3660,7 +3675,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
3660
3675
|
}
|
|
3661
3676
|
}, [blocks]);
|
|
3662
3677
|
if (typeof window !== "undefined") {
|
|
3663
|
-
|
|
3678
|
+
useLayoutEffect6(() => {
|
|
3664
3679
|
if (blocks.length === 0) {
|
|
3665
3680
|
onResumeCallbacks.forEach((c) => c());
|
|
3666
3681
|
playbackLogging({
|
|
@@ -3684,7 +3699,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
3684
3699
|
});
|
|
3685
3700
|
}, useIsPlayerBuffering = (bufferManager) => {
|
|
3686
3701
|
const [isBuffering, setIsBuffering] = useState13(bufferManager.buffering.current);
|
|
3687
|
-
|
|
3702
|
+
useEffect8(() => {
|
|
3688
3703
|
const onBuffer = () => {
|
|
3689
3704
|
setIsBuffering(true);
|
|
3690
3705
|
};
|
|
@@ -3847,7 +3862,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
3847
3862
|
}) => {
|
|
3848
3863
|
const buffer = useBufferState();
|
|
3849
3864
|
const [isBuffering, setIsBuffering] = useState14(false);
|
|
3850
|
-
|
|
3865
|
+
useEffect9(() => {
|
|
3851
3866
|
let cleanupFns = [];
|
|
3852
3867
|
const { current } = element;
|
|
3853
3868
|
if (!current) {
|
|
@@ -3979,7 +3994,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
3979
3994
|
onVariableFpsVideoDetected
|
|
3980
3995
|
}) => {
|
|
3981
3996
|
const currentTime = useRef10(null);
|
|
3982
|
-
|
|
3997
|
+
useEffect10(() => {
|
|
3983
3998
|
const { current } = mediaRef;
|
|
3984
3999
|
if (current) {
|
|
3985
4000
|
currentTime.current = {
|
|
@@ -4161,7 +4176,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
4161
4176
|
return acceptableTimeshift ?? defaultAcceptableTimeshift;
|
|
4162
4177
|
})();
|
|
4163
4178
|
const isPlayerBuffering = useIsPlayerBuffering(buffering);
|
|
4164
|
-
|
|
4179
|
+
useEffect11(() => {
|
|
4165
4180
|
if (mediaRef.current?.paused) {
|
|
4166
4181
|
return;
|
|
4167
4182
|
}
|
|
@@ -4200,13 +4215,13 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
4200
4215
|
isPostmounting
|
|
4201
4216
|
]);
|
|
4202
4217
|
const env = useRemotionEnvironment();
|
|
4203
|
-
|
|
4218
|
+
useLayoutEffect7(() => {
|
|
4204
4219
|
const playbackRateToSet = Math.max(0, playbackRate);
|
|
4205
4220
|
if (mediaRef.current && mediaRef.current.playbackRate !== playbackRateToSet) {
|
|
4206
4221
|
mediaRef.current.playbackRate = playbackRateToSet;
|
|
4207
4222
|
}
|
|
4208
4223
|
}, [mediaRef, playbackRate]);
|
|
4209
|
-
|
|
4224
|
+
useEffect11(() => {
|
|
4210
4225
|
const tagName = mediaType === "audio" ? "<Html5Audio>" : "<Html5Video>";
|
|
4211
4226
|
if (!mediaRef.current) {
|
|
4212
4227
|
throw new Error(`No ${mediaType} ref found`);
|
|
@@ -4334,7 +4349,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
4334
4349
|
const logLevel = useLogLevel();
|
|
4335
4350
|
const mountTime = useMountTime();
|
|
4336
4351
|
const env = useRemotionEnvironment();
|
|
4337
|
-
|
|
4352
|
+
useEffect12(() => {
|
|
4338
4353
|
const tag = {
|
|
4339
4354
|
id,
|
|
4340
4355
|
play: (reason) => {
|
|
@@ -4522,12 +4537,12 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
4522
4537
|
volume: userPreferredVolume,
|
|
4523
4538
|
shouldUseWebAudioApi: useWebAudioApi ?? false
|
|
4524
4539
|
});
|
|
4525
|
-
|
|
4540
|
+
useImperativeHandle6(ref, () => {
|
|
4526
4541
|
return audioRef.current;
|
|
4527
4542
|
}, [audioRef]);
|
|
4528
4543
|
const currentOnDurationCallback = useRef12(onDuration);
|
|
4529
4544
|
currentOnDurationCallback.current = onDuration;
|
|
4530
|
-
|
|
4545
|
+
useEffect13(() => {
|
|
4531
4546
|
const { current } = audioRef;
|
|
4532
4547
|
if (!current) {
|
|
4533
4548
|
return;
|
|
@@ -4591,10 +4606,10 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
4591
4606
|
mediaVolume: 1
|
|
4592
4607
|
});
|
|
4593
4608
|
warnAboutTooHighVolume(volume);
|
|
4594
|
-
|
|
4609
|
+
useImperativeHandle7(ref, () => {
|
|
4595
4610
|
return audioRef.current;
|
|
4596
4611
|
}, []);
|
|
4597
|
-
|
|
4612
|
+
useEffect14(() => {
|
|
4598
4613
|
if (!props.src) {
|
|
4599
4614
|
throw new Error("No src passed");
|
|
4600
4615
|
}
|
|
@@ -4638,7 +4653,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
4638
4653
|
]);
|
|
4639
4654
|
const { src } = props;
|
|
4640
4655
|
const needsToRenderAudioTag = ref || _remotionInternalNeedsDurationCalculation;
|
|
4641
|
-
|
|
4656
|
+
useLayoutEffect8(() => {
|
|
4642
4657
|
if (window.process?.env?.NODE_ENV === "test") {
|
|
4643
4658
|
return;
|
|
4644
4659
|
}
|
|
@@ -4898,7 +4913,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
4898
4913
|
}
|
|
4899
4914
|
}, Fallback = () => {
|
|
4900
4915
|
const { continueRender: continueRender2, delayRender: delayRender2 } = useDelayRender();
|
|
4901
|
-
|
|
4916
|
+
useEffect16(() => {
|
|
4902
4917
|
const fallback = delayRender2("Waiting for Root component to unsuspend");
|
|
4903
4918
|
return () => continueRender2(fallback);
|
|
4904
4919
|
}, [continueRender2, delayRender2]);
|
|
@@ -4935,7 +4950,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
4935
4950
|
throw new Error("<Composition> mounted inside another composition. See https://remotion.dev/docs/wrong-composition-mount for help.");
|
|
4936
4951
|
}
|
|
4937
4952
|
const { folderName, parentName } = useContext29(FolderContext);
|
|
4938
|
-
|
|
4953
|
+
useEffect16(() => {
|
|
4939
4954
|
if (!id) {
|
|
4940
4955
|
throw new Error("No id for composition passed.");
|
|
4941
4956
|
}
|
|
@@ -4974,7 +4989,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
4974
4989
|
registerComposition,
|
|
4975
4990
|
unregisterComposition
|
|
4976
4991
|
]);
|
|
4977
|
-
|
|
4992
|
+
useEffect16(() => {
|
|
4978
4993
|
window.dispatchEvent(new CustomEvent(PROPS_UPDATED_EXTERNALLY, {
|
|
4979
4994
|
detail: {
|
|
4980
4995
|
resetUnsaved: id
|
|
@@ -5072,7 +5087,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
5072
5087
|
if (!_propsValid) {
|
|
5073
5088
|
throw new Error("typecheck error");
|
|
5074
5089
|
}
|
|
5075
|
-
|
|
5090
|
+
useImperativeHandle8(ref, () => {
|
|
5076
5091
|
return imageRef.current;
|
|
5077
5092
|
}, []);
|
|
5078
5093
|
const actualSrc = usePreload(src);
|
|
@@ -5114,7 +5129,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
5114
5129
|
if (typeof window !== "undefined") {
|
|
5115
5130
|
const isPremounting = Boolean(sequenceContext?.premounting);
|
|
5116
5131
|
const isPostmounting = Boolean(sequenceContext?.postmounting);
|
|
5117
|
-
|
|
5132
|
+
useLayoutEffect9(() => {
|
|
5118
5133
|
if (window.process?.env?.NODE_ENV === "test") {
|
|
5119
5134
|
if (imageRef.current) {
|
|
5120
5135
|
imageRef.current.src = actualSrc;
|
|
@@ -5239,7 +5254,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
5239
5254
|
return prevFolders.filter((p) => !(p.name === name && p.parent === parent));
|
|
5240
5255
|
});
|
|
5241
5256
|
}, []);
|
|
5242
|
-
|
|
5257
|
+
useImperativeHandle9(compositionsRef, () => {
|
|
5243
5258
|
return {
|
|
5244
5259
|
getCompositions: () => currentcompositionsRef.current
|
|
5245
5260
|
};
|
|
@@ -5332,7 +5347,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
5332
5347
|
`;
|
|
5333
5348
|
}, REMOTION_STUDIO_CONTAINER_ELEMENT = "__remotion-studio-container", getPreviewDomElement = () => {
|
|
5334
5349
|
return document.getElementById(REMOTION_STUDIO_CONTAINER_ELEMENT);
|
|
5335
|
-
}, Root = null, listeners, getRoot = () => {
|
|
5350
|
+
}, MaxMediaCacheSizeContext, Root = null, listeners, getRoot = () => {
|
|
5336
5351
|
return Root;
|
|
5337
5352
|
}, waitForRoot = (fn) => {
|
|
5338
5353
|
if (Root) {
|
|
@@ -5373,7 +5388,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
5373
5388
|
value,
|
|
5374
5389
|
children
|
|
5375
5390
|
});
|
|
5376
|
-
},
|
|
5391
|
+
}, RemotionRootContexts = ({
|
|
5377
5392
|
children,
|
|
5378
5393
|
numberOfAudioTags,
|
|
5379
5394
|
logLevel,
|
|
@@ -5399,7 +5414,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
5399
5414
|
}
|
|
5400
5415
|
};
|
|
5401
5416
|
}, []);
|
|
5402
|
-
|
|
5417
|
+
useEffect17(() => {
|
|
5403
5418
|
if (typeof __webpack_module__ !== "undefined") {
|
|
5404
5419
|
if (__webpack_module__.hot) {
|
|
5405
5420
|
__webpack_module__.hot.addStatusHandler((status) => {
|
|
@@ -5427,14 +5442,12 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
5427
5442
|
children: /* @__PURE__ */ jsx28(EditorPropsProvider, {
|
|
5428
5443
|
children: /* @__PURE__ */ jsx28(PrefetchProvider, {
|
|
5429
5444
|
children: /* @__PURE__ */ jsx28(SequenceManagerProvider, {
|
|
5430
|
-
children: /* @__PURE__ */ jsx28(
|
|
5431
|
-
|
|
5432
|
-
|
|
5433
|
-
|
|
5434
|
-
children: /* @__PURE__ */ jsx28(
|
|
5435
|
-
children
|
|
5436
|
-
children
|
|
5437
|
-
})
|
|
5445
|
+
children: /* @__PURE__ */ jsx28(SharedAudioContextProvider, {
|
|
5446
|
+
numberOfAudioTags,
|
|
5447
|
+
audioLatencyHint,
|
|
5448
|
+
children: /* @__PURE__ */ jsx28(DurationsContextProvider, {
|
|
5449
|
+
children: /* @__PURE__ */ jsx28(BufferingProvider, {
|
|
5450
|
+
children
|
|
5438
5451
|
})
|
|
5439
5452
|
})
|
|
5440
5453
|
})
|
|
@@ -5536,7 +5549,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
5536
5549
|
mediaVolume: 1
|
|
5537
5550
|
});
|
|
5538
5551
|
warnAboutTooHighVolume(volume);
|
|
5539
|
-
|
|
5552
|
+
useEffect18(() => {
|
|
5540
5553
|
if (!src) {
|
|
5541
5554
|
throw new Error("No src passed");
|
|
5542
5555
|
}
|
|
@@ -5593,7 +5606,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
5593
5606
|
}, [toneMapped, currentTime, src, transparent]);
|
|
5594
5607
|
const [imageSrc, setImageSrc] = useState19(null);
|
|
5595
5608
|
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
5596
|
-
|
|
5609
|
+
useLayoutEffect10(() => {
|
|
5597
5610
|
if (!window.remotion_videoEnabled) {
|
|
5598
5611
|
return;
|
|
5599
5612
|
}
|
|
@@ -5696,7 +5709,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
5696
5709
|
ref,
|
|
5697
5710
|
onVideoFrame
|
|
5698
5711
|
}) => {
|
|
5699
|
-
|
|
5712
|
+
useEffect19(() => {
|
|
5700
5713
|
const { current } = ref;
|
|
5701
5714
|
if (!current) {
|
|
5702
5715
|
return;
|
|
@@ -5833,7 +5846,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
5833
5846
|
duration,
|
|
5834
5847
|
fps
|
|
5835
5848
|
});
|
|
5836
|
-
|
|
5849
|
+
useImperativeHandle10(ref, () => {
|
|
5837
5850
|
return videoRef.current;
|
|
5838
5851
|
}, []);
|
|
5839
5852
|
useState20(() => playbackLogging({
|
|
@@ -5842,7 +5855,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
5842
5855
|
tag: "video",
|
|
5843
5856
|
mountTime
|
|
5844
5857
|
}));
|
|
5845
|
-
|
|
5858
|
+
useEffect20(() => {
|
|
5846
5859
|
const { current } = videoRef;
|
|
5847
5860
|
if (!current) {
|
|
5848
5861
|
return;
|
|
@@ -5873,7 +5886,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
5873
5886
|
const currentOnDurationCallback = useRef16(onDuration);
|
|
5874
5887
|
currentOnDurationCallback.current = onDuration;
|
|
5875
5888
|
useEmitVideoFrame({ ref: videoRef, onVideoFrame });
|
|
5876
|
-
|
|
5889
|
+
useEffect20(() => {
|
|
5877
5890
|
const { current } = videoRef;
|
|
5878
5891
|
if (!current) {
|
|
5879
5892
|
return;
|
|
@@ -5890,7 +5903,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
5890
5903
|
current.removeEventListener("loadedmetadata", onLoadedMetadata);
|
|
5891
5904
|
};
|
|
5892
5905
|
}, [src]);
|
|
5893
|
-
|
|
5906
|
+
useEffect20(() => {
|
|
5894
5907
|
const { current } = videoRef;
|
|
5895
5908
|
if (!current) {
|
|
5896
5909
|
return;
|
|
@@ -6135,9 +6148,9 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
6135
6148
|
throw new RangeError(`Cannot use frame ${frame}: Duration of composition is ${durationInFrames}, therefore the highest frame that can be rendered is ${durationInFrames - 1}`);
|
|
6136
6149
|
}
|
|
6137
6150
|
}, flattenChildren = (children) => {
|
|
6138
|
-
const childrenArray =
|
|
6151
|
+
const childrenArray = React33.Children.toArray(children);
|
|
6139
6152
|
return childrenArray.reduce((flatChildren, child) => {
|
|
6140
|
-
if (child.type ===
|
|
6153
|
+
if (child.type === React33.Fragment) {
|
|
6141
6154
|
return flatChildren.concat(flattenChildren(child.props.children));
|
|
6142
6155
|
}
|
|
6143
6156
|
flatChildren.push(child);
|
|
@@ -6154,7 +6167,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
6154
6167
|
children
|
|
6155
6168
|
});
|
|
6156
6169
|
}, useRequireToBeInsideSeries = () => {
|
|
6157
|
-
const isInsideSeries =
|
|
6170
|
+
const isInsideSeries = React34.useContext(IsInsideSeriesContext);
|
|
6158
6171
|
if (!isInsideSeries) {
|
|
6159
6172
|
throw new Error("This component must be inside a <Series /> component.");
|
|
6160
6173
|
}
|
|
@@ -6468,7 +6481,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
6468
6481
|
mediaVolume: 1
|
|
6469
6482
|
});
|
|
6470
6483
|
warnAboutTooHighVolume(volume);
|
|
6471
|
-
|
|
6484
|
+
useEffect21(() => {
|
|
6472
6485
|
if (!props2.src) {
|
|
6473
6486
|
throw new Error("No src passed");
|
|
6474
6487
|
}
|
|
@@ -6508,10 +6521,10 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
6508
6521
|
sequenceContext?.relativeFrom,
|
|
6509
6522
|
audioStreamIndex
|
|
6510
6523
|
]);
|
|
6511
|
-
|
|
6524
|
+
useImperativeHandle11(ref, () => {
|
|
6512
6525
|
return videoRef.current;
|
|
6513
6526
|
}, []);
|
|
6514
|
-
|
|
6527
|
+
useEffect21(() => {
|
|
6515
6528
|
if (!window.remotion_videoEnabled) {
|
|
6516
6529
|
return;
|
|
6517
6530
|
}
|
|
@@ -6595,7 +6608,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
6595
6608
|
]);
|
|
6596
6609
|
const { src } = props2;
|
|
6597
6610
|
if (environment.isRendering) {
|
|
6598
|
-
|
|
6611
|
+
useLayoutEffect11(() => {
|
|
6599
6612
|
if (window.process?.env?.NODE_ENV === "test") {
|
|
6600
6613
|
return;
|
|
6601
6614
|
}
|
|
@@ -7065,9 +7078,10 @@ var init_esm = __esm(() => {
|
|
|
7065
7078
|
OBJECTFIT_CONTAIN_CLASS_NAME: () => OBJECTFIT_CONTAIN_CLASS_NAME
|
|
7066
7079
|
});
|
|
7067
7080
|
injected = {};
|
|
7081
|
+
MaxMediaCacheSizeContext = React26.createContext(null);
|
|
7068
7082
|
listeners = [];
|
|
7069
7083
|
MediaEnabledContext = createContext19(null);
|
|
7070
|
-
CurrentScaleContext =
|
|
7084
|
+
CurrentScaleContext = React28.createContext(null);
|
|
7071
7085
|
PreviewSizeContext = createContext20({
|
|
7072
7086
|
setSize: () => {
|
|
7073
7087
|
return;
|
|
@@ -7078,6 +7092,7 @@ var init_esm = __esm(() => {
|
|
|
7078
7092
|
addSequenceStackTraces(OffthreadVideo);
|
|
7079
7093
|
compositionSelectorRef = createRef3();
|
|
7080
7094
|
Internals = {
|
|
7095
|
+
MaxMediaCacheSizeContext,
|
|
7081
7096
|
useUnsafeVideoConfig,
|
|
7082
7097
|
useFrameForVolumeProp,
|
|
7083
7098
|
useTimelinePosition,
|
|
@@ -7092,7 +7107,7 @@ var init_esm = __esm(() => {
|
|
|
7092
7107
|
CompositionSetters,
|
|
7093
7108
|
SequenceManager,
|
|
7094
7109
|
SequenceVisibilityToggleContext,
|
|
7095
|
-
|
|
7110
|
+
RemotionRootContexts,
|
|
7096
7111
|
CompositionManagerProvider,
|
|
7097
7112
|
useVideo,
|
|
7098
7113
|
getRoot,
|
|
@@ -7170,7 +7185,8 @@ var init_esm = __esm(() => {
|
|
|
7170
7185
|
useIsPlayerBuffering,
|
|
7171
7186
|
TimelinePosition: exports_timeline_position_state,
|
|
7172
7187
|
DelayRenderContextType,
|
|
7173
|
-
TimelineContext
|
|
7188
|
+
TimelineContext,
|
|
7189
|
+
RenderAssetManagerProvider
|
|
7174
7190
|
};
|
|
7175
7191
|
PERCENTAGE = NUMBER + "%";
|
|
7176
7192
|
IsInsideSeriesContext = createContext21(false);
|
|
@@ -8575,7 +8591,7 @@ var getDefaultConfig = () => {
|
|
|
8575
8591
|
var twMerge = /* @__PURE__ */ createTailwindMerge(getDefaultConfig);
|
|
8576
8592
|
|
|
8577
8593
|
// ../design/dist/esm/index.mjs
|
|
8578
|
-
import React7, { useEffect as
|
|
8594
|
+
import React7, { useEffect as useEffect22, useMemo as useMemo33, useState as useState21 } from "react";
|
|
8579
8595
|
|
|
8580
8596
|
// ../paths/dist/esm/index.mjs
|
|
8581
8597
|
var cutLInstruction = ({
|
|
@@ -12716,7 +12732,7 @@ var extrudeAndTransformElement = (options) => {
|
|
|
12716
12732
|
init_esm();
|
|
12717
12733
|
import { jsx as jsx37, Fragment } from "react/jsx-runtime";
|
|
12718
12734
|
import { jsx as jsx210, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
12719
|
-
import { useEffect as
|
|
12735
|
+
import { useEffect as useEffect23, useMemo as useMemo210, useRef as useRef18 } from "react";
|
|
12720
12736
|
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
12721
12737
|
import { jsx as jsx43, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
12722
12738
|
import React42 from "react";
|
|
@@ -12726,7 +12742,7 @@ import { jsx as jsx73, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
|
12726
12742
|
import React52 from "react";
|
|
12727
12743
|
import { jsx as jsx83 } from "react/jsx-runtime";
|
|
12728
12744
|
import { jsx as jsx93 } from "react/jsx-runtime";
|
|
12729
|
-
import * as
|
|
12745
|
+
import * as React342 from "react";
|
|
12730
12746
|
import * as ReactDOM4 from "react-dom";
|
|
12731
12747
|
import React9 from "react";
|
|
12732
12748
|
import * as React62 from "react";
|
|
@@ -12762,20 +12778,20 @@ import ReactDOM3 from "react-dom";
|
|
|
12762
12778
|
import { jsx as jsx192 } from "react/jsx-runtime";
|
|
12763
12779
|
import * as React24 from "react";
|
|
12764
12780
|
import * as React252 from "react";
|
|
12765
|
-
import * as
|
|
12781
|
+
import * as React262 from "react";
|
|
12766
12782
|
import { jsx as jsx202 } from "react/jsx-runtime";
|
|
12767
12783
|
import * as React332 from "react";
|
|
12768
12784
|
import * as React29 from "react";
|
|
12769
12785
|
import { useState as useState112 } from "react";
|
|
12770
|
-
import * as
|
|
12771
|
-
import * as
|
|
12786
|
+
import * as React27 from "react";
|
|
12787
|
+
import * as React282 from "react";
|
|
12772
12788
|
import * as React322 from "react";
|
|
12773
|
-
import * as
|
|
12789
|
+
import * as React31 from "react";
|
|
12774
12790
|
import * as React30 from "react";
|
|
12775
12791
|
import { Fragment as Fragment52, jsx as jsx212, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
12776
12792
|
import { forwardRef as forwardRef132, createElement as createElement7 } from "react";
|
|
12777
12793
|
import { forwardRef as forwardRef122, createElement as createElement6 } from "react";
|
|
12778
|
-
import * as
|
|
12794
|
+
import * as React35 from "react";
|
|
12779
12795
|
import { jsx as jsx223, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
12780
12796
|
import { jsx as jsx232 } from "react/jsx-runtime";
|
|
12781
12797
|
import { jsx as jsx242 } from "react/jsx-runtime";
|
|
@@ -12802,7 +12818,7 @@ var useHoverTransforms = (ref, disabled) => {
|
|
|
12802
12818
|
isActive: false
|
|
12803
12819
|
});
|
|
12804
12820
|
const eventTarget = useMemo33(() => new EventTarget, []);
|
|
12805
|
-
|
|
12821
|
+
useEffect22(() => {
|
|
12806
12822
|
if (disabled) {
|
|
12807
12823
|
eventTarget.dispatchEvent(new Event("disabled"));
|
|
12808
12824
|
} else {
|
|
@@ -12949,7 +12965,7 @@ var getAngle = (ref, coordinates) => {
|
|
|
12949
12965
|
var lastCoordinates = null;
|
|
12950
12966
|
var useMousePosition = (ref) => {
|
|
12951
12967
|
const [angle, setAngle] = useState21(getAngle(ref.current, lastCoordinates));
|
|
12952
|
-
|
|
12968
|
+
useEffect22(() => {
|
|
12953
12969
|
const element = ref.current;
|
|
12954
12970
|
if (!element) {
|
|
12955
12971
|
return;
|
|
@@ -13070,7 +13086,7 @@ var Spinner = ({ size, duration }) => {
|
|
|
13070
13086
|
};
|
|
13071
13087
|
}, [size]);
|
|
13072
13088
|
const pathsRef = useRef18([]);
|
|
13073
|
-
|
|
13089
|
+
useEffect23(() => {
|
|
13074
13090
|
const animate = () => {
|
|
13075
13091
|
const now = performance.now();
|
|
13076
13092
|
for (let index = 0;index < lines; index++) {
|
|
@@ -16148,7 +16164,7 @@ function usePrevious(value) {
|
|
|
16148
16164
|
}, [value]);
|
|
16149
16165
|
}
|
|
16150
16166
|
var NAME2 = "VisuallyHidden";
|
|
16151
|
-
var VisuallyHidden =
|
|
16167
|
+
var VisuallyHidden = React262.forwardRef((props, forwardedRef) => {
|
|
16152
16168
|
return /* @__PURE__ */ jsx202(Primitive.span, {
|
|
16153
16169
|
...props,
|
|
16154
16170
|
ref: forwardedRef,
|
|
@@ -16356,7 +16372,7 @@ function useCallbackRef2(initialValue, callback) {
|
|
|
16356
16372
|
ref.callback = callback;
|
|
16357
16373
|
return ref.facade;
|
|
16358
16374
|
}
|
|
16359
|
-
var useIsomorphicLayoutEffect = typeof window !== "undefined" ?
|
|
16375
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React27.useLayoutEffect : React27.useEffect;
|
|
16360
16376
|
var currentValues = new WeakMap;
|
|
16361
16377
|
function useMergeRefs(refs, defaultValue) {
|
|
16362
16378
|
var callbackRef = useCallbackRef2(defaultValue || null, function(newValue) {
|
|
@@ -16478,7 +16494,7 @@ var SideCar = function(_a) {
|
|
|
16478
16494
|
if (!Target) {
|
|
16479
16495
|
throw new Error("Sidecar medium not found");
|
|
16480
16496
|
}
|
|
16481
|
-
return
|
|
16497
|
+
return React282.createElement(Target, __assign({}, rest));
|
|
16482
16498
|
};
|
|
16483
16499
|
SideCar.isSideCarExport = true;
|
|
16484
16500
|
function exportSidecar(medium, exported) {
|
|
@@ -16673,7 +16689,7 @@ var getCurrentUseCounter = function() {
|
|
|
16673
16689
|
return isFinite(counter) ? counter : 0;
|
|
16674
16690
|
};
|
|
16675
16691
|
var useLockAttribute = function() {
|
|
16676
|
-
|
|
16692
|
+
React31.useEffect(function() {
|
|
16677
16693
|
document.body.setAttribute(lockAttribute, (getCurrentUseCounter() + 1).toString());
|
|
16678
16694
|
return function() {
|
|
16679
16695
|
var newCounter = getCurrentUseCounter() - 1;
|
|
@@ -16688,10 +16704,10 @@ var useLockAttribute = function() {
|
|
|
16688
16704
|
var RemoveScrollBar = function(_a) {
|
|
16689
16705
|
var { noRelative, noImportant, gapMode: _b } = _a, gapMode = _b === undefined ? "margin" : _b;
|
|
16690
16706
|
useLockAttribute();
|
|
16691
|
-
var gap =
|
|
16707
|
+
var gap = React31.useMemo(function() {
|
|
16692
16708
|
return getGapWidth(gapMode);
|
|
16693
16709
|
}, [gapMode]);
|
|
16694
|
-
return
|
|
16710
|
+
return React31.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? "!important" : "") });
|
|
16695
16711
|
};
|
|
16696
16712
|
var passiveSupported = false;
|
|
16697
16713
|
if (typeof window !== "undefined") {
|
|
@@ -16992,9 +17008,9 @@ var Select = (props) => {
|
|
|
16992
17008
|
required
|
|
16993
17009
|
} = props;
|
|
16994
17010
|
const popperScope = usePopperScope(__scopeSelect);
|
|
16995
|
-
const [trigger, setTrigger] =
|
|
16996
|
-
const [valueNode, setValueNode] =
|
|
16997
|
-
const [valueNodeHasChildren, setValueNodeHasChildren] =
|
|
17011
|
+
const [trigger, setTrigger] = React342.useState(null);
|
|
17012
|
+
const [valueNode, setValueNode] = React342.useState(null);
|
|
17013
|
+
const [valueNodeHasChildren, setValueNodeHasChildren] = React342.useState(false);
|
|
16998
17014
|
const direction = useDirection(dir);
|
|
16999
17015
|
const [open = false, setOpen] = useControllableState({
|
|
17000
17016
|
prop: openProp,
|
|
@@ -17006,9 +17022,9 @@ var Select = (props) => {
|
|
|
17006
17022
|
defaultProp: defaultValue,
|
|
17007
17023
|
onChange: onValueChange
|
|
17008
17024
|
});
|
|
17009
|
-
const triggerPointerDownPosRef =
|
|
17025
|
+
const triggerPointerDownPosRef = React342.useRef(null);
|
|
17010
17026
|
const isFormControl = trigger ? Boolean(trigger.closest("form")) : true;
|
|
17011
|
-
const [nativeOptionsSet, setNativeOptionsSet] =
|
|
17027
|
+
const [nativeOptionsSet, setNativeOptionsSet] = React342.useState(/* @__PURE__ */ new Set);
|
|
17012
17028
|
const nativeSelectKey = Array.from(nativeOptionsSet).map((option) => option.props.value).join(";");
|
|
17013
17029
|
return /* @__PURE__ */ jsx212(Root22, { ...popperScope, children: /* @__PURE__ */ jsxs4(SelectProvider, {
|
|
17014
17030
|
required,
|
|
@@ -17030,10 +17046,10 @@ var Select = (props) => {
|
|
|
17030
17046
|
children: [
|
|
17031
17047
|
/* @__PURE__ */ jsx212(Collection.Provider, { scope: __scopeSelect, children: /* @__PURE__ */ jsx212(SelectNativeOptionsProvider, {
|
|
17032
17048
|
scope: props.__scopeSelect,
|
|
17033
|
-
onNativeOptionAdd:
|
|
17049
|
+
onNativeOptionAdd: React342.useCallback((option) => {
|
|
17034
17050
|
setNativeOptionsSet((prev) => new Set(prev).add(option));
|
|
17035
17051
|
}, []),
|
|
17036
|
-
onNativeOptionRemove:
|
|
17052
|
+
onNativeOptionRemove: React342.useCallback((option) => {
|
|
17037
17053
|
setNativeOptionsSet((prev) => {
|
|
17038
17054
|
const optionsSet = new Set(prev);
|
|
17039
17055
|
optionsSet.delete(option);
|
|
@@ -17061,7 +17077,7 @@ var Select = (props) => {
|
|
|
17061
17077
|
};
|
|
17062
17078
|
Select.displayName = SELECT_NAME;
|
|
17063
17079
|
var TRIGGER_NAME = "SelectTrigger";
|
|
17064
|
-
var SelectTrigger =
|
|
17080
|
+
var SelectTrigger = React342.forwardRef((props, forwardedRef) => {
|
|
17065
17081
|
const { __scopeSelect, disabled = false, ...triggerProps } = props;
|
|
17066
17082
|
const popperScope = usePopperScope(__scopeSelect);
|
|
17067
17083
|
const context = useSelectContext(TRIGGER_NAME, __scopeSelect);
|
|
@@ -17129,7 +17145,7 @@ var SelectTrigger = React34.forwardRef((props, forwardedRef) => {
|
|
|
17129
17145
|
});
|
|
17130
17146
|
SelectTrigger.displayName = TRIGGER_NAME;
|
|
17131
17147
|
var VALUE_NAME = "SelectValue";
|
|
17132
|
-
var SelectValue =
|
|
17148
|
+
var SelectValue = React342.forwardRef((props, forwardedRef) => {
|
|
17133
17149
|
const { __scopeSelect, className, style, children, placeholder = "", ...valueProps } = props;
|
|
17134
17150
|
const context = useSelectContext(VALUE_NAME, __scopeSelect);
|
|
17135
17151
|
const { onValueNodeHasChildrenChange } = context;
|
|
@@ -17147,7 +17163,7 @@ var SelectValue = React34.forwardRef((props, forwardedRef) => {
|
|
|
17147
17163
|
});
|
|
17148
17164
|
SelectValue.displayName = VALUE_NAME;
|
|
17149
17165
|
var ICON_NAME = "SelectIcon";
|
|
17150
|
-
var SelectIcon =
|
|
17166
|
+
var SelectIcon = React342.forwardRef((props, forwardedRef) => {
|
|
17151
17167
|
const { __scopeSelect, children, ...iconProps } = props;
|
|
17152
17168
|
return /* @__PURE__ */ jsx212(Primitive.span, { "aria-hidden": true, ...iconProps, ref: forwardedRef, children: children || "▼" });
|
|
17153
17169
|
});
|
|
@@ -17158,9 +17174,9 @@ var SelectPortal = (props) => {
|
|
|
17158
17174
|
};
|
|
17159
17175
|
SelectPortal.displayName = PORTAL_NAME2;
|
|
17160
17176
|
var CONTENT_NAME2 = "SelectContent";
|
|
17161
|
-
var SelectContent =
|
|
17177
|
+
var SelectContent = React342.forwardRef((props, forwardedRef) => {
|
|
17162
17178
|
const context = useSelectContext(CONTENT_NAME2, props.__scopeSelect);
|
|
17163
|
-
const [fragment, setFragment] =
|
|
17179
|
+
const [fragment, setFragment] = React342.useState();
|
|
17164
17180
|
useLayoutEffect22(() => {
|
|
17165
17181
|
setFragment(new DocumentFragment);
|
|
17166
17182
|
}, []);
|
|
@@ -17174,7 +17190,7 @@ SelectContent.displayName = CONTENT_NAME2;
|
|
|
17174
17190
|
var CONTENT_MARGIN = 10;
|
|
17175
17191
|
var [SelectContentProvider, useSelectContentContext] = createSelectContext(CONTENT_NAME2);
|
|
17176
17192
|
var CONTENT_IMPL_NAME = "SelectContentImpl";
|
|
17177
|
-
var SelectContentImpl =
|
|
17193
|
+
var SelectContentImpl = React342.forwardRef((props, forwardedRef) => {
|
|
17178
17194
|
const {
|
|
17179
17195
|
__scopeSelect,
|
|
17180
17196
|
position = "item-aligned",
|
|
@@ -17194,20 +17210,20 @@ var SelectContentImpl = React34.forwardRef((props, forwardedRef) => {
|
|
|
17194
17210
|
...contentProps
|
|
17195
17211
|
} = props;
|
|
17196
17212
|
const context = useSelectContext(CONTENT_NAME2, __scopeSelect);
|
|
17197
|
-
const [content, setContent] =
|
|
17198
|
-
const [viewport, setViewport] =
|
|
17213
|
+
const [content, setContent] = React342.useState(null);
|
|
17214
|
+
const [viewport, setViewport] = React342.useState(null);
|
|
17199
17215
|
const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
|
|
17200
|
-
const [selectedItem, setSelectedItem] =
|
|
17201
|
-
const [selectedItemText, setSelectedItemText] =
|
|
17216
|
+
const [selectedItem, setSelectedItem] = React342.useState(null);
|
|
17217
|
+
const [selectedItemText, setSelectedItemText] = React342.useState(null);
|
|
17202
17218
|
const getItems = useCollection(__scopeSelect);
|
|
17203
|
-
const [isPositioned, setIsPositioned] =
|
|
17204
|
-
const firstValidItemFoundRef =
|
|
17205
|
-
|
|
17219
|
+
const [isPositioned, setIsPositioned] = React342.useState(false);
|
|
17220
|
+
const firstValidItemFoundRef = React342.useRef(false);
|
|
17221
|
+
React342.useEffect(() => {
|
|
17206
17222
|
if (content)
|
|
17207
17223
|
return hideOthers(content);
|
|
17208
17224
|
}, [content]);
|
|
17209
17225
|
useFocusGuards();
|
|
17210
|
-
const focusFirst2 =
|
|
17226
|
+
const focusFirst2 = React342.useCallback((candidates) => {
|
|
17211
17227
|
const [firstItem, ...restItems] = getItems().map((item) => item.ref.current);
|
|
17212
17228
|
const [lastItem] = restItems.slice(-1);
|
|
17213
17229
|
const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;
|
|
@@ -17224,14 +17240,14 @@ var SelectContentImpl = React34.forwardRef((props, forwardedRef) => {
|
|
|
17224
17240
|
return;
|
|
17225
17241
|
}
|
|
17226
17242
|
}, [getItems, viewport]);
|
|
17227
|
-
const focusSelectedItem =
|
|
17228
|
-
|
|
17243
|
+
const focusSelectedItem = React342.useCallback(() => focusFirst2([selectedItem, content]), [focusFirst2, selectedItem, content]);
|
|
17244
|
+
React342.useEffect(() => {
|
|
17229
17245
|
if (isPositioned) {
|
|
17230
17246
|
focusSelectedItem();
|
|
17231
17247
|
}
|
|
17232
17248
|
}, [isPositioned, focusSelectedItem]);
|
|
17233
17249
|
const { onOpenChange, triggerPointerDownPosRef } = context;
|
|
17234
|
-
|
|
17250
|
+
React342.useEffect(() => {
|
|
17235
17251
|
if (content) {
|
|
17236
17252
|
let pointerMoveDelta = { x: 0, y: 0 };
|
|
17237
17253
|
const handlePointerMove = (event) => {
|
|
@@ -17261,7 +17277,7 @@ var SelectContentImpl = React34.forwardRef((props, forwardedRef) => {
|
|
|
17261
17277
|
};
|
|
17262
17278
|
}
|
|
17263
17279
|
}, [content, onOpenChange, triggerPointerDownPosRef]);
|
|
17264
|
-
|
|
17280
|
+
React342.useEffect(() => {
|
|
17265
17281
|
const close = () => onOpenChange(false);
|
|
17266
17282
|
window.addEventListener("blur", close);
|
|
17267
17283
|
window.addEventListener("resize", close);
|
|
@@ -17278,7 +17294,7 @@ var SelectContentImpl = React34.forwardRef((props, forwardedRef) => {
|
|
|
17278
17294
|
setTimeout(() => nextItem.ref.current.focus());
|
|
17279
17295
|
}
|
|
17280
17296
|
});
|
|
17281
|
-
const itemRefCallback =
|
|
17297
|
+
const itemRefCallback = React342.useCallback((node, value, disabled) => {
|
|
17282
17298
|
const isFirstValidItem = !firstValidItemFoundRef.current && !disabled;
|
|
17283
17299
|
const isSelectedItem = context.value !== undefined && context.value === value;
|
|
17284
17300
|
if (isSelectedItem || isFirstValidItem) {
|
|
@@ -17287,8 +17303,8 @@ var SelectContentImpl = React34.forwardRef((props, forwardedRef) => {
|
|
|
17287
17303
|
firstValidItemFoundRef.current = true;
|
|
17288
17304
|
}
|
|
17289
17305
|
}, [context.value]);
|
|
17290
|
-
const handleItemLeave =
|
|
17291
|
-
const itemTextRefCallback =
|
|
17306
|
+
const handleItemLeave = React342.useCallback(() => content?.focus(), [content]);
|
|
17307
|
+
const itemTextRefCallback = React342.useCallback((node, value, disabled) => {
|
|
17292
17308
|
const isFirstValidItem = !firstValidItemFoundRef.current && !disabled;
|
|
17293
17309
|
const isSelectedItem = context.value !== undefined && context.value === value;
|
|
17294
17310
|
if (isSelectedItem || isFirstValidItem) {
|
|
@@ -17383,18 +17399,18 @@ var SelectContentImpl = React34.forwardRef((props, forwardedRef) => {
|
|
|
17383
17399
|
});
|
|
17384
17400
|
SelectContentImpl.displayName = CONTENT_IMPL_NAME;
|
|
17385
17401
|
var ITEM_ALIGNED_POSITION_NAME = "SelectItemAlignedPosition";
|
|
17386
|
-
var SelectItemAlignedPosition =
|
|
17402
|
+
var SelectItemAlignedPosition = React342.forwardRef((props, forwardedRef) => {
|
|
17387
17403
|
const { __scopeSelect, onPlaced, ...popperProps } = props;
|
|
17388
17404
|
const context = useSelectContext(CONTENT_NAME2, __scopeSelect);
|
|
17389
17405
|
const contentContext = useSelectContentContext(CONTENT_NAME2, __scopeSelect);
|
|
17390
|
-
const [contentWrapper, setContentWrapper] =
|
|
17391
|
-
const [content, setContent] =
|
|
17406
|
+
const [contentWrapper, setContentWrapper] = React342.useState(null);
|
|
17407
|
+
const [content, setContent] = React342.useState(null);
|
|
17392
17408
|
const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
|
|
17393
17409
|
const getItems = useCollection(__scopeSelect);
|
|
17394
|
-
const shouldExpandOnScrollRef =
|
|
17395
|
-
const shouldRepositionRef =
|
|
17410
|
+
const shouldExpandOnScrollRef = React342.useRef(false);
|
|
17411
|
+
const shouldRepositionRef = React342.useRef(true);
|
|
17396
17412
|
const { viewport, selectedItem, selectedItemText, focusSelectedItem } = contentContext;
|
|
17397
|
-
const position =
|
|
17413
|
+
const position = React342.useCallback(() => {
|
|
17398
17414
|
if (context.trigger && context.valueNode && contentWrapper && content && viewport && selectedItem && selectedItemText) {
|
|
17399
17415
|
const triggerRect = context.trigger.getBoundingClientRect();
|
|
17400
17416
|
const contentRect = content.getBoundingClientRect();
|
|
@@ -17475,12 +17491,12 @@ var SelectItemAlignedPosition = React34.forwardRef((props, forwardedRef) => {
|
|
|
17475
17491
|
onPlaced
|
|
17476
17492
|
]);
|
|
17477
17493
|
useLayoutEffect22(() => position(), [position]);
|
|
17478
|
-
const [contentZIndex, setContentZIndex] =
|
|
17494
|
+
const [contentZIndex, setContentZIndex] = React342.useState();
|
|
17479
17495
|
useLayoutEffect22(() => {
|
|
17480
17496
|
if (content)
|
|
17481
17497
|
setContentZIndex(window.getComputedStyle(content).zIndex);
|
|
17482
17498
|
}, [content]);
|
|
17483
|
-
const handleScrollButtonChange =
|
|
17499
|
+
const handleScrollButtonChange = React342.useCallback((node) => {
|
|
17484
17500
|
if (node && shouldRepositionRef.current === true) {
|
|
17485
17501
|
position();
|
|
17486
17502
|
focusSelectedItem?.();
|
|
@@ -17514,7 +17530,7 @@ var SelectItemAlignedPosition = React34.forwardRef((props, forwardedRef) => {
|
|
|
17514
17530
|
});
|
|
17515
17531
|
SelectItemAlignedPosition.displayName = ITEM_ALIGNED_POSITION_NAME;
|
|
17516
17532
|
var POPPER_POSITION_NAME = "SelectPopperPosition";
|
|
17517
|
-
var SelectPopperPosition =
|
|
17533
|
+
var SelectPopperPosition = React342.forwardRef((props, forwardedRef) => {
|
|
17518
17534
|
const {
|
|
17519
17535
|
__scopeSelect,
|
|
17520
17536
|
align = "start",
|
|
@@ -17544,12 +17560,12 @@ var SelectPopperPosition = React34.forwardRef((props, forwardedRef) => {
|
|
|
17544
17560
|
SelectPopperPosition.displayName = POPPER_POSITION_NAME;
|
|
17545
17561
|
var [SelectViewportProvider, useSelectViewportContext] = createSelectContext(CONTENT_NAME2, {});
|
|
17546
17562
|
var VIEWPORT_NAME = "SelectViewport";
|
|
17547
|
-
var SelectViewport =
|
|
17563
|
+
var SelectViewport = React342.forwardRef((props, forwardedRef) => {
|
|
17548
17564
|
const { __scopeSelect, nonce, ...viewportProps } = props;
|
|
17549
17565
|
const contentContext = useSelectContentContext(VIEWPORT_NAME, __scopeSelect);
|
|
17550
17566
|
const viewportContext = useSelectViewportContext(VIEWPORT_NAME, __scopeSelect);
|
|
17551
17567
|
const composedRefs = useComposedRefs(forwardedRef, contentContext.onViewportChange);
|
|
17552
|
-
const prevScrollTopRef =
|
|
17568
|
+
const prevScrollTopRef = React342.useRef(0);
|
|
17553
17569
|
return /* @__PURE__ */ jsxs4(Fragment52, { children: [
|
|
17554
17570
|
/* @__PURE__ */ jsx212("style", {
|
|
17555
17571
|
dangerouslySetInnerHTML: {
|
|
@@ -17598,14 +17614,14 @@ var SelectViewport = React34.forwardRef((props, forwardedRef) => {
|
|
|
17598
17614
|
SelectViewport.displayName = VIEWPORT_NAME;
|
|
17599
17615
|
var GROUP_NAME = "SelectGroup";
|
|
17600
17616
|
var [SelectGroupContextProvider, useSelectGroupContext] = createSelectContext(GROUP_NAME);
|
|
17601
|
-
var SelectGroup =
|
|
17617
|
+
var SelectGroup = React342.forwardRef((props, forwardedRef) => {
|
|
17602
17618
|
const { __scopeSelect, ...groupProps } = props;
|
|
17603
17619
|
const groupId = useId();
|
|
17604
17620
|
return /* @__PURE__ */ jsx212(SelectGroupContextProvider, { scope: __scopeSelect, id: groupId, children: /* @__PURE__ */ jsx212(Primitive.div, { role: "group", "aria-labelledby": groupId, ...groupProps, ref: forwardedRef }) });
|
|
17605
17621
|
});
|
|
17606
17622
|
SelectGroup.displayName = GROUP_NAME;
|
|
17607
17623
|
var LABEL_NAME = "SelectLabel";
|
|
17608
|
-
var SelectLabel =
|
|
17624
|
+
var SelectLabel = React342.forwardRef((props, forwardedRef) => {
|
|
17609
17625
|
const { __scopeSelect, ...labelProps } = props;
|
|
17610
17626
|
const groupContext = useSelectGroupContext(LABEL_NAME, __scopeSelect);
|
|
17611
17627
|
return /* @__PURE__ */ jsx212(Primitive.div, { id: groupContext.id, ...labelProps, ref: forwardedRef });
|
|
@@ -17613,7 +17629,7 @@ var SelectLabel = React34.forwardRef((props, forwardedRef) => {
|
|
|
17613
17629
|
SelectLabel.displayName = LABEL_NAME;
|
|
17614
17630
|
var ITEM_NAME = "SelectItem";
|
|
17615
17631
|
var [SelectItemContextProvider, useSelectItemContext] = createSelectContext(ITEM_NAME);
|
|
17616
|
-
var SelectItem =
|
|
17632
|
+
var SelectItem = React342.forwardRef((props, forwardedRef) => {
|
|
17617
17633
|
const {
|
|
17618
17634
|
__scopeSelect,
|
|
17619
17635
|
value,
|
|
@@ -17624,8 +17640,8 @@ var SelectItem = React34.forwardRef((props, forwardedRef) => {
|
|
|
17624
17640
|
const context = useSelectContext(ITEM_NAME, __scopeSelect);
|
|
17625
17641
|
const contentContext = useSelectContentContext(ITEM_NAME, __scopeSelect);
|
|
17626
17642
|
const isSelected = context.value === value;
|
|
17627
|
-
const [textValue, setTextValue] =
|
|
17628
|
-
const [isFocused, setIsFocused] =
|
|
17643
|
+
const [textValue, setTextValue] = React342.useState(textValueProp ?? "");
|
|
17644
|
+
const [isFocused, setIsFocused] = React342.useState(false);
|
|
17629
17645
|
const composedRefs = useComposedRefs(forwardedRef, (node) => contentContext.itemRefCallback?.(node, value, disabled));
|
|
17630
17646
|
const textId = useId();
|
|
17631
17647
|
const handleSelect = () => {
|
|
@@ -17643,7 +17659,7 @@ var SelectItem = React34.forwardRef((props, forwardedRef) => {
|
|
|
17643
17659
|
disabled,
|
|
17644
17660
|
textId,
|
|
17645
17661
|
isSelected,
|
|
17646
|
-
onItemTextChange:
|
|
17662
|
+
onItemTextChange: React342.useCallback((node) => {
|
|
17647
17663
|
setTextValue((prevTextValue) => prevTextValue || (node?.textContent ?? "").trim());
|
|
17648
17664
|
}, []),
|
|
17649
17665
|
children: /* @__PURE__ */ jsx212(Collection.ItemSlot, {
|
|
@@ -17692,16 +17708,16 @@ var SelectItem = React34.forwardRef((props, forwardedRef) => {
|
|
|
17692
17708
|
});
|
|
17693
17709
|
SelectItem.displayName = ITEM_NAME;
|
|
17694
17710
|
var ITEM_TEXT_NAME = "SelectItemText";
|
|
17695
|
-
var SelectItemText =
|
|
17711
|
+
var SelectItemText = React342.forwardRef((props, forwardedRef) => {
|
|
17696
17712
|
const { __scopeSelect, className, style, ...itemTextProps } = props;
|
|
17697
17713
|
const context = useSelectContext(ITEM_TEXT_NAME, __scopeSelect);
|
|
17698
17714
|
const contentContext = useSelectContentContext(ITEM_TEXT_NAME, __scopeSelect);
|
|
17699
17715
|
const itemContext = useSelectItemContext(ITEM_TEXT_NAME, __scopeSelect);
|
|
17700
17716
|
const nativeOptionsContext = useSelectNativeOptionsContext(ITEM_TEXT_NAME, __scopeSelect);
|
|
17701
|
-
const [itemTextNode, setItemTextNode] =
|
|
17717
|
+
const [itemTextNode, setItemTextNode] = React342.useState(null);
|
|
17702
17718
|
const composedRefs = useComposedRefs(forwardedRef, (node) => setItemTextNode(node), itemContext.onItemTextChange, (node) => contentContext.itemTextRefCallback?.(node, itemContext.value, itemContext.disabled));
|
|
17703
17719
|
const textContent = itemTextNode?.textContent;
|
|
17704
|
-
const nativeOption =
|
|
17720
|
+
const nativeOption = React342.useMemo(() => /* @__PURE__ */ jsx212("option", { value: itemContext.value, disabled: itemContext.disabled, children: textContent }, itemContext.value), [itemContext.disabled, itemContext.value, textContent]);
|
|
17705
17721
|
const { onNativeOptionAdd, onNativeOptionRemove } = nativeOptionsContext;
|
|
17706
17722
|
useLayoutEffect22(() => {
|
|
17707
17723
|
onNativeOptionAdd(nativeOption);
|
|
@@ -17714,17 +17730,17 @@ var SelectItemText = React34.forwardRef((props, forwardedRef) => {
|
|
|
17714
17730
|
});
|
|
17715
17731
|
SelectItemText.displayName = ITEM_TEXT_NAME;
|
|
17716
17732
|
var ITEM_INDICATOR_NAME = "SelectItemIndicator";
|
|
17717
|
-
var SelectItemIndicator =
|
|
17733
|
+
var SelectItemIndicator = React342.forwardRef((props, forwardedRef) => {
|
|
17718
17734
|
const { __scopeSelect, ...itemIndicatorProps } = props;
|
|
17719
17735
|
const itemContext = useSelectItemContext(ITEM_INDICATOR_NAME, __scopeSelect);
|
|
17720
17736
|
return itemContext.isSelected ? /* @__PURE__ */ jsx212(Primitive.span, { "aria-hidden": true, ...itemIndicatorProps, ref: forwardedRef }) : null;
|
|
17721
17737
|
});
|
|
17722
17738
|
SelectItemIndicator.displayName = ITEM_INDICATOR_NAME;
|
|
17723
17739
|
var SCROLL_UP_BUTTON_NAME = "SelectScrollUpButton";
|
|
17724
|
-
var SelectScrollUpButton =
|
|
17740
|
+
var SelectScrollUpButton = React342.forwardRef((props, forwardedRef) => {
|
|
17725
17741
|
const contentContext = useSelectContentContext(SCROLL_UP_BUTTON_NAME, props.__scopeSelect);
|
|
17726
17742
|
const viewportContext = useSelectViewportContext(SCROLL_UP_BUTTON_NAME, props.__scopeSelect);
|
|
17727
|
-
const [canScrollUp, setCanScrollUp] =
|
|
17743
|
+
const [canScrollUp, setCanScrollUp] = React342.useState(false);
|
|
17728
17744
|
const composedRefs = useComposedRefs(forwardedRef, viewportContext.onScrollButtonChange);
|
|
17729
17745
|
useLayoutEffect22(() => {
|
|
17730
17746
|
if (contentContext.viewport && contentContext.isPositioned) {
|
|
@@ -17752,10 +17768,10 @@ var SelectScrollUpButton = React34.forwardRef((props, forwardedRef) => {
|
|
|
17752
17768
|
});
|
|
17753
17769
|
SelectScrollUpButton.displayName = SCROLL_UP_BUTTON_NAME;
|
|
17754
17770
|
var SCROLL_DOWN_BUTTON_NAME = "SelectScrollDownButton";
|
|
17755
|
-
var SelectScrollDownButton =
|
|
17771
|
+
var SelectScrollDownButton = React342.forwardRef((props, forwardedRef) => {
|
|
17756
17772
|
const contentContext = useSelectContentContext(SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect);
|
|
17757
17773
|
const viewportContext = useSelectViewportContext(SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect);
|
|
17758
|
-
const [canScrollDown, setCanScrollDown] =
|
|
17774
|
+
const [canScrollDown, setCanScrollDown] = React342.useState(false);
|
|
17759
17775
|
const composedRefs = useComposedRefs(forwardedRef, viewportContext.onScrollButtonChange);
|
|
17760
17776
|
useLayoutEffect22(() => {
|
|
17761
17777
|
if (contentContext.viewport && contentContext.isPositioned) {
|
|
@@ -17783,18 +17799,18 @@ var SelectScrollDownButton = React34.forwardRef((props, forwardedRef) => {
|
|
|
17783
17799
|
}) : null;
|
|
17784
17800
|
});
|
|
17785
17801
|
SelectScrollDownButton.displayName = SCROLL_DOWN_BUTTON_NAME;
|
|
17786
|
-
var SelectScrollButtonImpl =
|
|
17802
|
+
var SelectScrollButtonImpl = React342.forwardRef((props, forwardedRef) => {
|
|
17787
17803
|
const { __scopeSelect, onAutoScroll, ...scrollIndicatorProps } = props;
|
|
17788
17804
|
const contentContext = useSelectContentContext("SelectScrollButton", __scopeSelect);
|
|
17789
|
-
const autoScrollTimerRef =
|
|
17805
|
+
const autoScrollTimerRef = React342.useRef(null);
|
|
17790
17806
|
const getItems = useCollection(__scopeSelect);
|
|
17791
|
-
const clearAutoScrollTimer =
|
|
17807
|
+
const clearAutoScrollTimer = React342.useCallback(() => {
|
|
17792
17808
|
if (autoScrollTimerRef.current !== null) {
|
|
17793
17809
|
window.clearInterval(autoScrollTimerRef.current);
|
|
17794
17810
|
autoScrollTimerRef.current = null;
|
|
17795
17811
|
}
|
|
17796
17812
|
}, []);
|
|
17797
|
-
|
|
17813
|
+
React342.useEffect(() => {
|
|
17798
17814
|
return () => clearAutoScrollTimer();
|
|
17799
17815
|
}, [clearAutoScrollTimer]);
|
|
17800
17816
|
useLayoutEffect22(() => {
|
|
@@ -17823,13 +17839,13 @@ var SelectScrollButtonImpl = React34.forwardRef((props, forwardedRef) => {
|
|
|
17823
17839
|
});
|
|
17824
17840
|
});
|
|
17825
17841
|
var SEPARATOR_NAME = "SelectSeparator";
|
|
17826
|
-
var SelectSeparator =
|
|
17842
|
+
var SelectSeparator = React342.forwardRef((props, forwardedRef) => {
|
|
17827
17843
|
const { __scopeSelect, ...separatorProps } = props;
|
|
17828
17844
|
return /* @__PURE__ */ jsx212(Primitive.div, { "aria-hidden": true, ...separatorProps, ref: forwardedRef });
|
|
17829
17845
|
});
|
|
17830
17846
|
SelectSeparator.displayName = SEPARATOR_NAME;
|
|
17831
17847
|
var ARROW_NAME2 = "SelectArrow";
|
|
17832
|
-
var SelectArrow =
|
|
17848
|
+
var SelectArrow = React342.forwardRef((props, forwardedRef) => {
|
|
17833
17849
|
const { __scopeSelect, ...arrowProps } = props;
|
|
17834
17850
|
const popperScope = usePopperScope(__scopeSelect);
|
|
17835
17851
|
const context = useSelectContext(ARROW_NAME2, __scopeSelect);
|
|
@@ -17840,12 +17856,12 @@ SelectArrow.displayName = ARROW_NAME2;
|
|
|
17840
17856
|
function shouldShowPlaceholder(value) {
|
|
17841
17857
|
return value === "" || value === undefined;
|
|
17842
17858
|
}
|
|
17843
|
-
var BubbleSelect =
|
|
17859
|
+
var BubbleSelect = React342.forwardRef((props, forwardedRef) => {
|
|
17844
17860
|
const { value, ...selectProps } = props;
|
|
17845
|
-
const ref =
|
|
17861
|
+
const ref = React342.useRef(null);
|
|
17846
17862
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
17847
17863
|
const prevValue = usePrevious(value);
|
|
17848
|
-
|
|
17864
|
+
React342.useEffect(() => {
|
|
17849
17865
|
const select = ref.current;
|
|
17850
17866
|
const selectProto = window.HTMLSelectElement.prototype;
|
|
17851
17867
|
const descriptor = Object.getOwnPropertyDescriptor(selectProto, "value");
|
|
@@ -17861,9 +17877,9 @@ var BubbleSelect = React34.forwardRef((props, forwardedRef) => {
|
|
|
17861
17877
|
BubbleSelect.displayName = "BubbleSelect";
|
|
17862
17878
|
function useTypeaheadSearch(onSearchChange) {
|
|
17863
17879
|
const handleSearchChange = useCallbackRef(onSearchChange);
|
|
17864
|
-
const searchRef =
|
|
17865
|
-
const timerRef =
|
|
17866
|
-
const handleTypeaheadSearch =
|
|
17880
|
+
const searchRef = React342.useRef("");
|
|
17881
|
+
const timerRef = React342.useRef(0);
|
|
17882
|
+
const handleTypeaheadSearch = React342.useCallback((key) => {
|
|
17867
17883
|
const search = searchRef.current + key;
|
|
17868
17884
|
handleSearchChange(search);
|
|
17869
17885
|
(function updateSearch(value) {
|
|
@@ -17873,11 +17889,11 @@ function useTypeaheadSearch(onSearchChange) {
|
|
|
17873
17889
|
timerRef.current = window.setTimeout(() => updateSearch(""), 1000);
|
|
17874
17890
|
})(search);
|
|
17875
17891
|
}, [handleSearchChange]);
|
|
17876
|
-
const resetTypeahead =
|
|
17892
|
+
const resetTypeahead = React342.useCallback(() => {
|
|
17877
17893
|
searchRef.current = "";
|
|
17878
17894
|
window.clearTimeout(timerRef.current);
|
|
17879
17895
|
}, []);
|
|
17880
|
-
|
|
17896
|
+
React342.useEffect(() => {
|
|
17881
17897
|
return () => window.clearTimeout(timerRef.current);
|
|
17882
17898
|
}, []);
|
|
17883
17899
|
return [searchRef, handleTypeaheadSearch, resetTypeahead];
|
|
@@ -17966,7 +17982,7 @@ var ChevronDown = createLucideIcon("ChevronDown", [
|
|
|
17966
17982
|
var ChevronUp = createLucideIcon("ChevronUp", [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]]);
|
|
17967
17983
|
var Select2 = Root222;
|
|
17968
17984
|
var SelectValue2 = Value;
|
|
17969
|
-
var SelectTrigger2 =
|
|
17985
|
+
var SelectTrigger2 = React35.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs5(Trigger, {
|
|
17970
17986
|
ref,
|
|
17971
17987
|
className: cn("flex h-10 w-full items-center justify-between rounded-md border-black border-2 border-b-4 bg-card-bg px-3 py-5 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1 font-brand", className),
|
|
17972
17988
|
...props,
|
|
@@ -17981,7 +17997,7 @@ var SelectTrigger2 = React352.forwardRef(({ className, children, ...props }, ref
|
|
|
17981
17997
|
]
|
|
17982
17998
|
}));
|
|
17983
17999
|
SelectTrigger2.displayName = Trigger.displayName;
|
|
17984
|
-
var SelectScrollUpButton2 =
|
|
18000
|
+
var SelectScrollUpButton2 = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx223(ScrollUpButton, {
|
|
17985
18001
|
ref,
|
|
17986
18002
|
className: cn("flex cursor-default items-center justify-center py-1", className),
|
|
17987
18003
|
...props,
|
|
@@ -17990,7 +18006,7 @@ var SelectScrollUpButton2 = React352.forwardRef(({ className, ...props }, ref) =
|
|
|
17990
18006
|
})
|
|
17991
18007
|
}));
|
|
17992
18008
|
SelectScrollUpButton2.displayName = ScrollUpButton.displayName;
|
|
17993
|
-
var SelectScrollDownButton2 =
|
|
18009
|
+
var SelectScrollDownButton2 = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx223(ScrollDownButton, {
|
|
17994
18010
|
ref,
|
|
17995
18011
|
className: cn("flex cursor-default items-center justify-center py-1", className),
|
|
17996
18012
|
...props,
|
|
@@ -17999,7 +18015,7 @@ var SelectScrollDownButton2 = React352.forwardRef(({ className, ...props }, ref)
|
|
|
17999
18015
|
})
|
|
18000
18016
|
}));
|
|
18001
18017
|
SelectScrollDownButton2.displayName = ScrollDownButton.displayName;
|
|
18002
|
-
var SelectContent2 =
|
|
18018
|
+
var SelectContent2 = React35.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsx223(Portal2, {
|
|
18003
18019
|
children: /* @__PURE__ */ jsxs5(Content2, {
|
|
18004
18020
|
ref,
|
|
18005
18021
|
className: cn(" border-2 border-black relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md font-brand bg-card-bg text-text shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", className),
|
|
@@ -18016,13 +18032,13 @@ var SelectContent2 = React352.forwardRef(({ className, children, position = "pop
|
|
|
18016
18032
|
})
|
|
18017
18033
|
}));
|
|
18018
18034
|
SelectContent2.displayName = Content2.displayName;
|
|
18019
|
-
var SelectLabel2 =
|
|
18035
|
+
var SelectLabel2 = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx223(Label, {
|
|
18020
18036
|
ref,
|
|
18021
18037
|
className: cn("py-1.5 pl-8 pr-2 text-sm font-semibold", className),
|
|
18022
18038
|
...props
|
|
18023
18039
|
}));
|
|
18024
18040
|
SelectLabel2.displayName = Label.displayName;
|
|
18025
|
-
var SelectItem2 =
|
|
18041
|
+
var SelectItem2 = React35.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs5(Item, {
|
|
18026
18042
|
ref,
|
|
18027
18043
|
className: cn("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-hidden focus:bg-slate-200 dark:focus:bg-white/10 data-disabled:pointer-events-none data-disabled:opacity-50 font-brand", className),
|
|
18028
18044
|
...props,
|
|
@@ -18041,7 +18057,7 @@ var SelectItem2 = React352.forwardRef(({ className, children, ...props }, ref) =
|
|
|
18041
18057
|
]
|
|
18042
18058
|
}));
|
|
18043
18059
|
SelectItem2.displayName = Item.displayName;
|
|
18044
|
-
var SelectSeparator2 =
|
|
18060
|
+
var SelectSeparator2 = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx223(Separator, {
|
|
18045
18061
|
ref,
|
|
18046
18062
|
className: cn("-mx-1 my-1 h-px bg-muted", className),
|
|
18047
18063
|
...props
|