@remotion/promo-pages 4.0.490 → 4.0.492
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 +1026 -618
- package/dist/components/Homepage.js +8 -4
- package/dist/components/homepage/CanvasSectionTitle.d.ts +4 -0
- package/dist/components/homepage/CanvasSectionTitle.js +14 -0
- package/dist/components/homepage/CommunityStatsItems.js +1 -1
- package/dist/components/homepage/Demo/Card.d.ts +3 -3
- package/dist/components/homepage/Demo/DisplayedEmoji.js +9 -3
- package/dist/components/homepage/EditorStarterSection.d.ts +3 -0
- package/dist/components/homepage/EditorStarterSection.js +8 -0
- package/dist/components/homepage/Pricing.d.ts +3 -0
- package/dist/components/homepage/Pricing.js +8 -2
- package/dist/components/homepage/WriteInReact.js +1 -2
- package/dist/design.js +520 -359
- package/dist/experts.js +358 -197
- package/dist/homepage/Pricing.js +537 -376
- package/dist/prompts/PromptsGallery.js +517 -356
- package/dist/prompts/PromptsShow.js +523 -362
- package/dist/prompts/PromptsSubmit.js +509 -348
- package/dist/team.js +496 -335
- package/dist/template-modal-content.js +537 -376
- package/dist/templates.js +537 -374
- package/package.json +13 -13
package/dist/team.js
CHANGED
|
@@ -214,9 +214,9 @@ var TitleTeamCards = () => {
|
|
|
214
214
|
};
|
|
215
215
|
|
|
216
216
|
// ../design/dist/esm/index.mjs
|
|
217
|
-
import * as
|
|
217
|
+
import * as React24 from "react";
|
|
218
218
|
import * as React3 from "react";
|
|
219
|
-
import { Fragment as
|
|
219
|
+
import { Fragment as Fragment22, jsx as jsx44 } from "react/jsx-runtime";
|
|
220
220
|
import React52, { useCallback as useCallback27, useRef as useRef210, useState as useState22 } from "react";
|
|
221
221
|
|
|
222
222
|
// ../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
@@ -1559,7 +1559,7 @@ var getDefaultConfig = () => {
|
|
|
1559
1559
|
var twMerge = /* @__PURE__ */ createTailwindMerge(getDefaultConfig);
|
|
1560
1560
|
|
|
1561
1561
|
// ../design/dist/esm/index.mjs
|
|
1562
|
-
import
|
|
1562
|
+
import React33, { useEffect as useEffect21, useMemo as useMemo42, useState as useState23 } from "react";
|
|
1563
1563
|
|
|
1564
1564
|
// ../paths/dist/esm/index.mjs
|
|
1565
1565
|
var cutLInstruction = ({
|
|
@@ -4352,6 +4352,7 @@ import * as React6 from "react";
|
|
|
4352
4352
|
import React7, { useMemo as useMemo6, useRef as useRef2 } from "react";
|
|
4353
4353
|
import { useContext as useContext8, useMemo as useMemo7 } from "react";
|
|
4354
4354
|
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
4355
|
+
import React9 from "react";
|
|
4355
4356
|
import {
|
|
4356
4357
|
forwardRef as forwardRef3,
|
|
4357
4358
|
useCallback as useCallback6,
|
|
@@ -4377,11 +4378,11 @@ import { useContext as useContext13 } from "react";
|
|
|
4377
4378
|
import { useContext as useContext12, useMemo as useMemo10 } from "react";
|
|
4378
4379
|
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
4379
4380
|
import { createContext as createContext14 } from "react";
|
|
4380
|
-
import
|
|
4381
|
+
import React12, { useCallback as useCallback5, useMemo as useMemo12, useRef as useRef4, useState as useState3 } from "react";
|
|
4381
4382
|
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
4382
|
-
import
|
|
4383
|
+
import React13, { createContext as createContext15 } from "react";
|
|
4383
4384
|
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
4384
|
-
import
|
|
4385
|
+
import React14, { forwardRef as forwardRef2, useContext as useContext16, useMemo as useMemo13, useState as useState4 } from "react";
|
|
4385
4386
|
import { useContext as useContext15, useRef as useRef5 } from "react";
|
|
4386
4387
|
import { createContext as createContext16 } from "react";
|
|
4387
4388
|
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
@@ -4393,7 +4394,7 @@ import {
|
|
|
4393
4394
|
useRef as useRef9,
|
|
4394
4395
|
useState as useState6
|
|
4395
4396
|
} from "react";
|
|
4396
|
-
import
|
|
4397
|
+
import React16, { useCallback as useCallback7, useImperativeHandle, useMemo as useMemo16, useRef as useRef8 } from "react";
|
|
4397
4398
|
import { useEffect as useEffect4, useMemo as useMemo15, useRef as useRef7 } from "react";
|
|
4398
4399
|
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
4399
4400
|
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
@@ -4409,7 +4410,7 @@ import {
|
|
|
4409
4410
|
} from "react";
|
|
4410
4411
|
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
4411
4412
|
import { forwardRef as forwardRef7, useCallback as useCallback14, useContext as useContext30 } from "react";
|
|
4412
|
-
import
|
|
4413
|
+
import React17, { createContext as createContext18, useMemo as useMemo18 } from "react";
|
|
4413
4414
|
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
4414
4415
|
import { useContext as useContext19 } from "react";
|
|
4415
4416
|
import { createContext as createContext19, useEffect as useEffect6, useState as useState9 } from "react";
|
|
@@ -4417,7 +4418,7 @@ import { jsx as jsx17 } from "react/jsx-runtime";
|
|
|
4417
4418
|
import { createContext as createContext20, useMemo as useMemo19, useReducer } from "react";
|
|
4418
4419
|
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
4419
4420
|
import { useCallback as useCallback13 } from "react";
|
|
4420
|
-
import
|
|
4421
|
+
import React23, {
|
|
4421
4422
|
forwardRef as forwardRef5,
|
|
4422
4423
|
useContext as useContext28,
|
|
4423
4424
|
useEffect as useEffect14,
|
|
@@ -4427,7 +4428,7 @@ import React22, {
|
|
|
4427
4428
|
useState as useState14
|
|
4428
4429
|
} from "react";
|
|
4429
4430
|
import { useContext as useContext21, useLayoutEffect as useLayoutEffect5, useRef as useRef14 } from "react";
|
|
4430
|
-
import
|
|
4431
|
+
import React20, {
|
|
4431
4432
|
createContext as createContext21,
|
|
4432
4433
|
createRef as createRef2,
|
|
4433
4434
|
useCallback as useCallback9,
|
|
@@ -4451,7 +4452,7 @@ import {
|
|
|
4451
4452
|
} from "react";
|
|
4452
4453
|
import { useCallback as useCallback11, useMemo as useMemo25, useRef as useRef16 } from "react";
|
|
4453
4454
|
import { useContext as useContext25, useMemo as useMemo24 } from "react";
|
|
4454
|
-
import
|
|
4455
|
+
import React21, {
|
|
4455
4456
|
useCallback as useCallback10,
|
|
4456
4457
|
useContext as useContext24,
|
|
4457
4458
|
useEffect as useEffect9,
|
|
@@ -4461,7 +4462,7 @@ import React20, {
|
|
|
4461
4462
|
useState as useState12
|
|
4462
4463
|
} from "react";
|
|
4463
4464
|
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
4464
|
-
import
|
|
4465
|
+
import React22 from "react";
|
|
4465
4466
|
import { useEffect as useEffect10, useState as useState13 } from "react";
|
|
4466
4467
|
import { useEffect as useEffect11, useRef as useRef17 } from "react";
|
|
4467
4468
|
import { useEffect as useEffect13 } from "react";
|
|
@@ -4519,10 +4520,10 @@ import {
|
|
|
4519
4520
|
useState as useState18
|
|
4520
4521
|
} from "react";
|
|
4521
4522
|
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
4522
|
-
import
|
|
4523
|
+
import React30, { forwardRef as forwardRef12, useCallback as useCallback20, useRef as useRef25 } from "react";
|
|
4523
4524
|
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
4524
4525
|
import { createRef as createRef3 } from "react";
|
|
4525
|
-
import
|
|
4526
|
+
import React31 from "react";
|
|
4526
4527
|
import {
|
|
4527
4528
|
useCallback as useCallback21,
|
|
4528
4529
|
useImperativeHandle as useImperativeHandle8,
|
|
@@ -4531,14 +4532,14 @@ import {
|
|
|
4531
4532
|
useState as useState19
|
|
4532
4533
|
} from "react";
|
|
4533
4534
|
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
4534
|
-
import
|
|
4535
|
+
import React32 from "react";
|
|
4535
4536
|
import { useMemo as useMemo34 } from "react";
|
|
4536
4537
|
import { createContext as createContext24, useContext as useContext34, useMemo as useMemo33 } from "react";
|
|
4537
4538
|
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
4538
4539
|
import { jsx as jsx322 } from "react/jsx-runtime";
|
|
4539
|
-
import
|
|
4540
|
-
import
|
|
4541
|
-
import
|
|
4540
|
+
import React34 from "react";
|
|
4541
|
+
import React35, { createContext as createContext25 } from "react";
|
|
4542
|
+
import React36, { useContext as useContext35 } from "react";
|
|
4542
4543
|
import { useCallback as useCallback24 } from "react";
|
|
4543
4544
|
import {
|
|
4544
4545
|
useCallback as useCallback22,
|
|
@@ -4549,7 +4550,7 @@ import {
|
|
|
4549
4550
|
useState as useState20
|
|
4550
4551
|
} from "react";
|
|
4551
4552
|
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
4552
|
-
import
|
|
4553
|
+
import React38, {
|
|
4553
4554
|
forwardRef as forwardRef13,
|
|
4554
4555
|
useCallback as useCallback23,
|
|
4555
4556
|
useContext as useContext37,
|
|
@@ -4562,16 +4563,15 @@ import React37, {
|
|
|
4562
4563
|
import { useEffect as useEffect18 } from "react";
|
|
4563
4564
|
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
4564
4565
|
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
4565
|
-
import
|
|
4566
|
+
import React40, { useMemo as useMemo37 } from "react";
|
|
4566
4567
|
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
4567
|
-
import {
|
|
4568
|
-
Children,
|
|
4568
|
+
import React42, {
|
|
4569
4569
|
forwardRef as forwardRef14,
|
|
4570
4570
|
useMemo as useMemo38
|
|
4571
4571
|
} from "react";
|
|
4572
|
-
import
|
|
4573
|
-
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
4574
|
-
import
|
|
4572
|
+
import React41 from "react";
|
|
4573
|
+
import { jsx as jsx37, jsxs as jsxs32, Fragment } from "react/jsx-runtime";
|
|
4574
|
+
import React43 from "react";
|
|
4575
4575
|
import { forwardRef as forwardRef16, useCallback as useCallback25, useContext as useContext39 } from "react";
|
|
4576
4576
|
import {
|
|
4577
4577
|
forwardRef as forwardRef15,
|
|
@@ -5649,6 +5649,7 @@ var InnerComposition = ({
|
|
|
5649
5649
|
}
|
|
5650
5650
|
const { folderName, parentName } = useContext9(FolderContext);
|
|
5651
5651
|
const stack = compProps.stack ?? null;
|
|
5652
|
+
const componentFromProps = "component" in compProps ? compProps.component : null;
|
|
5652
5653
|
useEffect2(() => {
|
|
5653
5654
|
if (!id) {
|
|
5654
5655
|
throw new Error("No id for composition passed.");
|
|
@@ -5666,6 +5667,7 @@ var InnerComposition = ({
|
|
|
5666
5667
|
defaultProps: serializeThenDeserializeInStudio(defaultProps ?? {}),
|
|
5667
5668
|
nonce: nonce.get(),
|
|
5668
5669
|
parentFolderName: parentName,
|
|
5670
|
+
componentFromProps,
|
|
5669
5671
|
schema: schema ?? null,
|
|
5670
5672
|
calculateMetadata: compProps.calculateMetadata ?? null,
|
|
5671
5673
|
stack
|
|
@@ -5684,6 +5686,7 @@ var InnerComposition = ({
|
|
|
5684
5686
|
width,
|
|
5685
5687
|
nonce,
|
|
5686
5688
|
parentName,
|
|
5689
|
+
componentFromProps,
|
|
5687
5690
|
schema,
|
|
5688
5691
|
compProps.calculateMetadata,
|
|
5689
5692
|
stack,
|
|
@@ -5742,11 +5745,30 @@ var Composition = (props) => {
|
|
|
5742
5745
|
});
|
|
5743
5746
|
};
|
|
5744
5747
|
var componentsToAddStacksTo = [];
|
|
5748
|
+
var sequenceComponent = null;
|
|
5745
5749
|
var getComponentsToAddStacksTo = () => componentsToAddStacksTo;
|
|
5746
5750
|
var addSequenceStackTraces = (component) => {
|
|
5747
5751
|
componentsToAddStacksTo.push(component);
|
|
5748
5752
|
};
|
|
5749
|
-
var
|
|
5753
|
+
var setSequenceComponent = (component) => {
|
|
5754
|
+
sequenceComponent = component;
|
|
5755
|
+
};
|
|
5756
|
+
var getSequenceComponent = () => sequenceComponent;
|
|
5757
|
+
var getSingleChildComponent = (children) => {
|
|
5758
|
+
const mountedChildren = React9.Children.toArray(children);
|
|
5759
|
+
if (mountedChildren.length !== 1) {
|
|
5760
|
+
return null;
|
|
5761
|
+
}
|
|
5762
|
+
const child = mountedChildren[0];
|
|
5763
|
+
if (!React9.isValidElement(child)) {
|
|
5764
|
+
return null;
|
|
5765
|
+
}
|
|
5766
|
+
if (typeof child.type !== "function" && typeof child.type !== "object") {
|
|
5767
|
+
return null;
|
|
5768
|
+
}
|
|
5769
|
+
return child.type;
|
|
5770
|
+
};
|
|
5771
|
+
var VERSION = "4.0.492";
|
|
5750
5772
|
var checkMultipleRemotionVersions = () => {
|
|
5751
5773
|
if (typeof globalThis === "undefined") {
|
|
5752
5774
|
return;
|
|
@@ -6346,7 +6368,7 @@ var sequenceSchemaDefaultLayoutNone = {
|
|
|
6346
6368
|
var PremountContext = createContext14({
|
|
6347
6369
|
premountFramesRemaining: 0
|
|
6348
6370
|
});
|
|
6349
|
-
var SequenceManager =
|
|
6371
|
+
var SequenceManager = React12.createContext({
|
|
6350
6372
|
registerSequence: () => {
|
|
6351
6373
|
throw new Error("SequenceManagerContext not initialized");
|
|
6352
6374
|
},
|
|
@@ -6355,19 +6377,19 @@ var SequenceManager = React11.createContext({
|
|
|
6355
6377
|
},
|
|
6356
6378
|
sequences: []
|
|
6357
6379
|
});
|
|
6358
|
-
var SequenceManagerRefContext =
|
|
6380
|
+
var SequenceManagerRefContext = React12.createContext({
|
|
6359
6381
|
current: []
|
|
6360
6382
|
});
|
|
6361
6383
|
var makeSequencePropsSubscriptionKey = (key) => {
|
|
6362
|
-
return `${key.nodePath.join(".")}
|
|
6384
|
+
return `${key.absolutePath}\x00${key.nodePath.join(".")}\x00${key.sequenceKeys.join(".")}\x00${key.effectKeys.map((keys) => keys.join(".")).join(".")}`;
|
|
6363
6385
|
};
|
|
6364
|
-
var VisualModePropStatusesContext =
|
|
6386
|
+
var VisualModePropStatusesContext = React12.createContext({
|
|
6365
6387
|
propStatuses: {}
|
|
6366
6388
|
});
|
|
6367
|
-
var VisualModePropStatusesRefContext =
|
|
6389
|
+
var VisualModePropStatusesRefContext = React12.createContext({
|
|
6368
6390
|
current: {}
|
|
6369
6391
|
});
|
|
6370
|
-
var VisualModeDragOverridesContext =
|
|
6392
|
+
var VisualModeDragOverridesContext = React12.createContext({
|
|
6371
6393
|
getDragOverrides: () => {
|
|
6372
6394
|
throw new Error("VisualModeDragOverridesContext not initialized");
|
|
6373
6395
|
},
|
|
@@ -6375,7 +6397,7 @@ var VisualModeDragOverridesContext = React11.createContext({
|
|
|
6375
6397
|
throw new Error("VisualModeDragOverridesContext not initialized");
|
|
6376
6398
|
}
|
|
6377
6399
|
});
|
|
6378
|
-
var VisualModeSettersContext =
|
|
6400
|
+
var VisualModeSettersContext = React12.createContext({
|
|
6379
6401
|
setDragOverrides: () => {
|
|
6380
6402
|
throw new Error("VisualModeSettersContext not initialized");
|
|
6381
6403
|
},
|
|
@@ -6539,7 +6561,7 @@ var IsNotInsideSeriesProvider = ({ children }) => {
|
|
|
6539
6561
|
});
|
|
6540
6562
|
};
|
|
6541
6563
|
var useRequireToBeInsideSeries = () => {
|
|
6542
|
-
const isInsideSeries =
|
|
6564
|
+
const isInsideSeries = React13.useContext(IsInsideSeriesContext);
|
|
6543
6565
|
if (!isInsideSeries) {
|
|
6544
6566
|
throw new Error("This component must be inside a <Series /> component.");
|
|
6545
6567
|
}
|
|
@@ -8608,6 +8630,9 @@ var computeEffectiveSchemaValuesDotNotation = ({
|
|
|
8608
8630
|
shouldResortToDefaultValueIfUndefined: false
|
|
8609
8631
|
});
|
|
8610
8632
|
}
|
|
8633
|
+
if (field?.type === "asset" && typeof value === "string" && value.startsWith(FILE_TOKEN)) {
|
|
8634
|
+
value = `${window.remotion_staticBase}/${value.slice(FILE_TOKEN.length)}`;
|
|
8635
|
+
}
|
|
8611
8636
|
if (value === undefined) {
|
|
8612
8637
|
propsToDelete.add(key);
|
|
8613
8638
|
}
|
|
@@ -8706,7 +8731,7 @@ var withInteractivitySchema = ({
|
|
|
8706
8731
|
const Wrapped = forwardRef2((props, ref) => {
|
|
8707
8732
|
const env = useRemotionEnvironment();
|
|
8708
8733
|
if (!env.isStudio || env.isReadOnlyStudio || env.isRendering) {
|
|
8709
|
-
return
|
|
8734
|
+
return React14.createElement(Component, {
|
|
8710
8735
|
...props,
|
|
8711
8736
|
controls: null,
|
|
8712
8737
|
ref
|
|
@@ -8717,7 +8742,7 @@ var withInteractivitySchema = ({
|
|
|
8717
8742
|
const nodePathMapping = useContext16(OverrideIdsToNodePathsGettersContext);
|
|
8718
8743
|
const frame = useCurrentFrame();
|
|
8719
8744
|
if (props.controls) {
|
|
8720
|
-
return
|
|
8745
|
+
return React14.createElement(Component, {
|
|
8721
8746
|
...props,
|
|
8722
8747
|
ref
|
|
8723
8748
|
});
|
|
@@ -8775,7 +8800,7 @@ var withInteractivitySchema = ({
|
|
|
8775
8800
|
schemaKeys: activeKeys,
|
|
8776
8801
|
propsToDelete
|
|
8777
8802
|
});
|
|
8778
|
-
return
|
|
8803
|
+
return React14.createElement(Component, {
|
|
8779
8804
|
...mergedProps,
|
|
8780
8805
|
controls,
|
|
8781
8806
|
ref
|
|
@@ -8801,6 +8826,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
8801
8826
|
_remotionInternalLoopDisplay: loopDisplay,
|
|
8802
8827
|
_remotionInternalStack: stack,
|
|
8803
8828
|
_remotionInternalDocumentationLink: documentationLink,
|
|
8829
|
+
_remotionInternalSingleChildComponent: singleChildComponent,
|
|
8804
8830
|
_remotionInternalPremountDisplay: premountDisplay,
|
|
8805
8831
|
_remotionInternalPostmountDisplay: postmountDisplay,
|
|
8806
8832
|
_remotionInternalIsMedia: isMedia,
|
|
@@ -8947,7 +8973,8 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
8947
8973
|
getStack: () => stackRef.current,
|
|
8948
8974
|
refForOutline: refForOutline ?? null,
|
|
8949
8975
|
isInsideSeries,
|
|
8950
|
-
frozenFrame: registeredFrozenFrame
|
|
8976
|
+
frozenFrame: registeredFrozenFrame,
|
|
8977
|
+
singleChildComponent: singleChildComponent ?? null
|
|
8951
8978
|
});
|
|
8952
8979
|
} else {
|
|
8953
8980
|
registerSequence({
|
|
@@ -8972,11 +8999,13 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
8972
8999
|
src: isMedia.data.src,
|
|
8973
9000
|
getStack: () => stackRef.current,
|
|
8974
9001
|
startMediaFrom: startMediaFrom ?? isMedia.data.startMediaFrom,
|
|
9002
|
+
mediaFrameAtSequenceZero,
|
|
8975
9003
|
volume: isMedia.data.volumes,
|
|
8976
9004
|
refForOutline: refForOutline ?? null,
|
|
8977
9005
|
isInsideSeries,
|
|
8978
9006
|
frozenFrame: registeredFrozenFrame,
|
|
8979
|
-
frozenMediaFrame
|
|
9007
|
+
frozenMediaFrame,
|
|
9008
|
+
singleChildComponent: singleChildComponent ?? null
|
|
8980
9009
|
});
|
|
8981
9010
|
}
|
|
8982
9011
|
return () => {
|
|
@@ -9003,7 +9032,8 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
9003
9032
|
effects: _remotionInternalEffects ?? EMPTY_EFFECTS,
|
|
9004
9033
|
refForOutline: refForOutline ?? null,
|
|
9005
9034
|
isInsideSeries,
|
|
9006
|
-
frozenFrame: registeredFrozenFrame
|
|
9035
|
+
frozenFrame: registeredFrozenFrame,
|
|
9036
|
+
singleChildComponent: singleChildComponent ?? null
|
|
9007
9037
|
});
|
|
9008
9038
|
return () => {
|
|
9009
9039
|
unregisterSequence(id);
|
|
@@ -9035,7 +9065,9 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
9035
9065
|
isInsideSeries,
|
|
9036
9066
|
registeredFrozenFrame,
|
|
9037
9067
|
startMediaFrom,
|
|
9038
|
-
|
|
9068
|
+
mediaFrameAtSequenceZero,
|
|
9069
|
+
frozenMediaFrame,
|
|
9070
|
+
singleChildComponent
|
|
9039
9071
|
]);
|
|
9040
9072
|
const endThreshold = Math.ceil(cumulatedFrom + from + durationInFrames - 1);
|
|
9041
9073
|
const content = absoluteFrame < cumulatedFrom + from ? null : absoluteFrame > endThreshold ? null : children;
|
|
@@ -9537,7 +9569,7 @@ var CanvasRefForwardingFunction = ({ width, height, fit, className, style, effec
|
|
|
9537
9569
|
...props
|
|
9538
9570
|
});
|
|
9539
9571
|
};
|
|
9540
|
-
var Canvas =
|
|
9572
|
+
var Canvas = React16.forwardRef(CanvasRefForwardingFunction);
|
|
9541
9573
|
var CACHE_SIZE = 5;
|
|
9542
9574
|
var getActualTime = ({
|
|
9543
9575
|
loopBehavior,
|
|
@@ -9698,6 +9730,12 @@ var resolveAnimatedImageSource = (src) => {
|
|
|
9698
9730
|
return new URL(src, window.origin).href;
|
|
9699
9731
|
};
|
|
9700
9732
|
var animatedImageSchema = {
|
|
9733
|
+
src: {
|
|
9734
|
+
type: "asset",
|
|
9735
|
+
default: undefined,
|
|
9736
|
+
description: "Source",
|
|
9737
|
+
keyframable: false
|
|
9738
|
+
},
|
|
9701
9739
|
...baseSchema,
|
|
9702
9740
|
playbackRate: {
|
|
9703
9741
|
type: "number",
|
|
@@ -10115,7 +10153,7 @@ var calculateMediaDuration = ({
|
|
|
10115
10153
|
};
|
|
10116
10154
|
var LoopContext = createContext18(null);
|
|
10117
10155
|
var useLoop = () => {
|
|
10118
|
-
return
|
|
10156
|
+
return React17.useContext(LoopContext);
|
|
10119
10157
|
};
|
|
10120
10158
|
var Loop = ({
|
|
10121
10159
|
durationInFrames,
|
|
@@ -10966,7 +11004,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
10966
11004
|
};
|
|
10967
11005
|
});
|
|
10968
11006
|
}, [audioContext, numberOfAudioTags]);
|
|
10969
|
-
const effectToUse =
|
|
11007
|
+
const effectToUse = React20.useInsertionEffect ?? React20.useLayoutEffect;
|
|
10970
11008
|
effectToUse(() => {
|
|
10971
11009
|
return () => {
|
|
10972
11010
|
requestAnimationFrame(() => {
|
|
@@ -10985,7 +11023,9 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
10985
11023
|
return;
|
|
10986
11024
|
}
|
|
10987
11025
|
if (data === undefined) {
|
|
10988
|
-
current.src
|
|
11026
|
+
if (current.src !== EMPTY_AUDIO) {
|
|
11027
|
+
current.src = EMPTY_AUDIO;
|
|
11028
|
+
}
|
|
10989
11029
|
return;
|
|
10990
11030
|
}
|
|
10991
11031
|
if (!data) {
|
|
@@ -11054,7 +11094,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
11054
11094
|
if (prevA.id === id) {
|
|
11055
11095
|
const isTheSame = compareProps(aud, prevA.props) && prevA.premounting === premounting && prevA.postmounting === postmounting;
|
|
11056
11096
|
if (isTheSame) {
|
|
11057
|
-
return prevA;
|
|
11097
|
+
return prevA.audioMounted === audioMounted ? prevA : { ...prevA, audioMounted };
|
|
11058
11098
|
}
|
|
11059
11099
|
changed = true;
|
|
11060
11100
|
return {
|
|
@@ -11066,7 +11106,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
11066
11106
|
audioMounted
|
|
11067
11107
|
};
|
|
11068
11108
|
}
|
|
11069
|
-
return prevA;
|
|
11109
|
+
return prevA.audioMounted === audioMounted ? prevA : { ...prevA, audioMounted };
|
|
11070
11110
|
});
|
|
11071
11111
|
if (changed) {
|
|
11072
11112
|
rerenderAudios();
|
|
@@ -11105,16 +11145,19 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
11105
11145
|
unregisterAudio,
|
|
11106
11146
|
updateAudio
|
|
11107
11147
|
]);
|
|
11148
|
+
const sharedAudioTagElements = useMemo21(() => {
|
|
11149
|
+
return refs.map(({ id, ref }) => {
|
|
11150
|
+
return /* @__PURE__ */ jsx19("audio", {
|
|
11151
|
+
ref,
|
|
11152
|
+
preload: "metadata",
|
|
11153
|
+
src: EMPTY_AUDIO
|
|
11154
|
+
}, id);
|
|
11155
|
+
});
|
|
11156
|
+
}, [refs]);
|
|
11108
11157
|
return /* @__PURE__ */ jsxs22(SharedAudioTagsContext.Provider, {
|
|
11109
11158
|
value: audioTagsValue,
|
|
11110
11159
|
children: [
|
|
11111
|
-
|
|
11112
|
-
return /* @__PURE__ */ jsx19("audio", {
|
|
11113
|
-
ref,
|
|
11114
|
-
preload: "metadata",
|
|
11115
|
-
src: EMPTY_AUDIO
|
|
11116
|
-
}, id);
|
|
11117
|
-
}),
|
|
11160
|
+
sharedAudioTagElements,
|
|
11118
11161
|
children
|
|
11119
11162
|
]
|
|
11120
11163
|
});
|
|
@@ -11131,7 +11174,7 @@ var useSharedAudio = ({
|
|
|
11131
11174
|
if (tagsCtx && tagsCtx.numberOfAudioTags > 0) {
|
|
11132
11175
|
return tagsCtx.registerAudio({ aud, audioId, premounting, postmounting });
|
|
11133
11176
|
}
|
|
11134
|
-
const el =
|
|
11177
|
+
const el = React20.createRef();
|
|
11135
11178
|
const mediaElementSourceNode = audioCtx?.audioContext ? makeSharedElementSourceNode({
|
|
11136
11179
|
audioContext: audioCtx.audioContext,
|
|
11137
11180
|
ref: el
|
|
@@ -11150,7 +11193,7 @@ var useSharedAudio = ({
|
|
|
11150
11193
|
}
|
|
11151
11194
|
};
|
|
11152
11195
|
});
|
|
11153
|
-
const effectToUse =
|
|
11196
|
+
const effectToUse = React20.useInsertionEffect ?? React20.useLayoutEffect;
|
|
11154
11197
|
if (typeof document !== "undefined") {
|
|
11155
11198
|
effectToUse(() => {
|
|
11156
11199
|
if (tagsCtx && tagsCtx.numberOfAudioTags > 0) {
|
|
@@ -11575,6 +11618,7 @@ var useMediaInTimeline = ({
|
|
|
11575
11618
|
showInTimeline: true,
|
|
11576
11619
|
nonce: nonce.get(),
|
|
11577
11620
|
startMediaFrom: 0 - startsAt,
|
|
11621
|
+
mediaFrameAtSequenceZero: null,
|
|
11578
11622
|
doesVolumeChange,
|
|
11579
11623
|
loopDisplay,
|
|
11580
11624
|
playbackRate,
|
|
@@ -11701,7 +11745,7 @@ var useBufferManager = (logLevel, mountTime) => {
|
|
|
11701
11745
|
return { addBlock, listenForBuffering, listenForResume, buffering };
|
|
11702
11746
|
}, [addBlock, buffering, listenForBuffering, listenForResume]);
|
|
11703
11747
|
};
|
|
11704
|
-
var BufferingContextReact =
|
|
11748
|
+
var BufferingContextReact = React21.createContext(null);
|
|
11705
11749
|
var BufferingProvider = ({ children }) => {
|
|
11706
11750
|
const { logLevel, mountTime } = useContext24(LogLevelContext);
|
|
11707
11751
|
const bufferManager = useBufferManager(logLevel ?? "info", mountTime);
|
|
@@ -11914,7 +11958,7 @@ var getMediaSyncAction = (input) => {
|
|
|
11914
11958
|
return { type: "none" };
|
|
11915
11959
|
};
|
|
11916
11960
|
var useCurrentTimeOfMediaTagWithUpdateTimeStamp = (mediaRef) => {
|
|
11917
|
-
const lastUpdate =
|
|
11961
|
+
const lastUpdate = React22.useRef({
|
|
11918
11962
|
time: mediaRef.current?.currentTime ?? 0,
|
|
11919
11963
|
lastUpdate: performance.now()
|
|
11920
11964
|
});
|
|
@@ -12667,7 +12711,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
12667
12711
|
volume: userPreferredVolume,
|
|
12668
12712
|
shouldUseWebAudioApi: useWebAudioApi ?? false
|
|
12669
12713
|
});
|
|
12670
|
-
const effectToUse =
|
|
12714
|
+
const effectToUse = React23.useInsertionEffect ?? React23.useLayoutEffect;
|
|
12671
12715
|
effectToUse(() => {
|
|
12672
12716
|
return () => {
|
|
12673
12717
|
requestAnimationFrame(() => {
|
|
@@ -13208,16 +13252,16 @@ var isMissingPaintRecordError = (error2) => {
|
|
|
13208
13252
|
return error2 instanceof DOMException && error2.name === "InvalidStateError";
|
|
13209
13253
|
};
|
|
13210
13254
|
var missingPaintRecordMessage = "HtmlInCanvas: Expected the element to be inside the viewport during rendering, but Chrome had no cached paint record for it.";
|
|
13211
|
-
var
|
|
13212
|
-
|
|
13255
|
+
var resizePaintTarget = ({
|
|
13256
|
+
target,
|
|
13213
13257
|
width,
|
|
13214
13258
|
height
|
|
13215
13259
|
}) => {
|
|
13216
|
-
if (
|
|
13217
|
-
|
|
13260
|
+
if (target.width !== width) {
|
|
13261
|
+
target.width = width;
|
|
13218
13262
|
}
|
|
13219
|
-
if (
|
|
13220
|
-
|
|
13263
|
+
if (target.height !== height) {
|
|
13264
|
+
target.height = height;
|
|
13221
13265
|
}
|
|
13222
13266
|
};
|
|
13223
13267
|
var defaultOnPaint = ({
|
|
@@ -13233,7 +13277,7 @@ var defaultOnPaint = ({
|
|
|
13233
13277
|
const transform = ctx.drawElementImage(elementImage, 0, 0);
|
|
13234
13278
|
element.style.transform = transform.toString();
|
|
13235
13279
|
};
|
|
13236
|
-
var HtmlInCanvasAncestorContext = createContext23(
|
|
13280
|
+
var HtmlInCanvasAncestorContext = createContext23(null);
|
|
13237
13281
|
var HtmlInCanvasContent = forwardRef9(({
|
|
13238
13282
|
width,
|
|
13239
13283
|
height,
|
|
@@ -13245,20 +13289,22 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
13245
13289
|
controls,
|
|
13246
13290
|
style
|
|
13247
13291
|
}, ref) => {
|
|
13248
|
-
const
|
|
13292
|
+
const ancestor = useContext31(HtmlInCanvasAncestorContext);
|
|
13249
13293
|
assertHtmlInCanvasDimensions(width, height);
|
|
13250
13294
|
const resolvedPixelDensity = resolveHtmlInCanvasPixelDensity(pixelDensity);
|
|
13251
13295
|
const canvasWidth = Math.ceil(width * resolvedPixelDensity);
|
|
13252
13296
|
const canvasHeight = Math.ceil(height * resolvedPixelDensity);
|
|
13253
13297
|
const { continueRender: continueRender2, cancelRender: cancelRender2 } = useDelayRender();
|
|
13254
|
-
const { isRendering } = useRemotionEnvironment();
|
|
13298
|
+
const { isClientSideRendering, isRendering } = useRemotionEnvironment();
|
|
13299
|
+
const canRetryMissingPaintRecord = !isRendering || isClientSideRendering;
|
|
13300
|
+
const usesDirectLayoutCanvas = onPaint === undefined && onInit === undefined;
|
|
13255
13301
|
if (!isHtmlInCanvasSupported()) {
|
|
13256
13302
|
cancelRender2(new Error(HTML_IN_CANVAS_UNSUPPORTED_MESSAGE));
|
|
13257
13303
|
}
|
|
13258
13304
|
const canvas2dRef = useRef22(null);
|
|
13259
|
-
const
|
|
13305
|
+
const paintTargetRef = useRef22(null);
|
|
13260
13306
|
const divRef = useRef22(null);
|
|
13261
|
-
const canvasSizeKey = `${width}x${height}@${resolvedPixelDensity}`;
|
|
13307
|
+
const canvasSizeKey = `${width}x${height}@${resolvedPixelDensity}-${usesDirectLayoutCanvas ? "direct" : "offscreen"}`;
|
|
13262
13308
|
const setLayoutCanvasRef = useCallback16((node) => {
|
|
13263
13309
|
canvas2dRef.current = node;
|
|
13264
13310
|
if (typeof ref === "function") {
|
|
@@ -13281,17 +13327,19 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
13281
13327
|
const initializedRef = useRef22(false);
|
|
13282
13328
|
const onInitCleanupRef = useRef22(null);
|
|
13283
13329
|
const unmountedRef = useRef22(false);
|
|
13330
|
+
const ancestorRef = useRef22(ancestor);
|
|
13331
|
+
ancestorRef.current = ancestor;
|
|
13284
13332
|
const onPaintCb = useCallback16(async () => {
|
|
13285
13333
|
const element = divRef.current;
|
|
13286
13334
|
if (!element) {
|
|
13287
13335
|
throw new Error("Canvas or scene element not found");
|
|
13288
13336
|
}
|
|
13289
|
-
const
|
|
13290
|
-
if (!
|
|
13291
|
-
throw new Error("HtmlInCanvas:
|
|
13337
|
+
const paintTarget = paintTargetRef.current;
|
|
13338
|
+
if (!paintTarget) {
|
|
13339
|
+
throw new Error("HtmlInCanvas: paint target is not ready because the canvas is remounting");
|
|
13292
13340
|
}
|
|
13293
|
-
|
|
13294
|
-
|
|
13341
|
+
resizePaintTarget({
|
|
13342
|
+
target: paintTarget,
|
|
13295
13343
|
width: canvasWidth,
|
|
13296
13344
|
height: canvasHeight
|
|
13297
13345
|
});
|
|
@@ -13302,22 +13350,30 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
13302
13350
|
}
|
|
13303
13351
|
const handle = delayRender("onPaint");
|
|
13304
13352
|
if (!initializedRef.current) {
|
|
13305
|
-
|
|
13306
|
-
|
|
13307
|
-
|
|
13308
|
-
}
|
|
13309
|
-
|
|
13310
|
-
|
|
13311
|
-
|
|
13353
|
+
const currentOnInit = onInitRef.current;
|
|
13354
|
+
if (!currentOnInit) {
|
|
13355
|
+
initializedRef.current = true;
|
|
13356
|
+
} else {
|
|
13357
|
+
let initImage;
|
|
13358
|
+
try {
|
|
13359
|
+
initImage = placeholderCanvas.captureElementImage(element);
|
|
13360
|
+
} catch (error2) {
|
|
13361
|
+
if (isMissingPaintRecordError(error2) && canRetryMissingPaintRecord) {
|
|
13362
|
+
continueRender2(handle);
|
|
13363
|
+
return;
|
|
13364
|
+
}
|
|
13365
|
+
if (isMissingPaintRecordError(error2)) {
|
|
13366
|
+
throw new Error(missingPaintRecordMessage);
|
|
13367
|
+
}
|
|
13312
13368
|
throw error2;
|
|
13313
13369
|
}
|
|
13314
|
-
}
|
|
13315
|
-
if (initImage) {
|
|
13316
13370
|
initializedRef.current = true;
|
|
13317
|
-
|
|
13318
|
-
|
|
13371
|
+
try {
|
|
13372
|
+
if (paintTarget instanceof HTMLCanvasElement) {
|
|
13373
|
+
throw new Error("HtmlInCanvas: onInit requires an OffscreenCanvas paint target");
|
|
13374
|
+
}
|
|
13319
13375
|
const cleanup = await currentOnInit({
|
|
13320
|
-
canvas:
|
|
13376
|
+
canvas: paintTarget,
|
|
13321
13377
|
element,
|
|
13322
13378
|
elementImage: initImage,
|
|
13323
13379
|
pixelDensity: resolvedPixelDensity
|
|
@@ -13330,15 +13386,16 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
13330
13386
|
} else {
|
|
13331
13387
|
onInitCleanupRef.current = cleanup;
|
|
13332
13388
|
}
|
|
13389
|
+
} finally {
|
|
13390
|
+
initImage.close();
|
|
13333
13391
|
}
|
|
13334
13392
|
}
|
|
13335
13393
|
}
|
|
13336
|
-
const handler = onPaintRef.current ?? defaultOnPaint;
|
|
13337
13394
|
let elImage;
|
|
13338
13395
|
try {
|
|
13339
13396
|
elImage = placeholderCanvas.captureElementImage(element);
|
|
13340
13397
|
} catch (error2) {
|
|
13341
|
-
if (isMissingPaintRecordError(error2) &&
|
|
13398
|
+
if (isMissingPaintRecordError(error2) && canRetryMissingPaintRecord) {
|
|
13342
13399
|
continueRender2(handle);
|
|
13343
13400
|
return;
|
|
13344
13401
|
}
|
|
@@ -13347,20 +13404,41 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
13347
13404
|
}
|
|
13348
13405
|
throw error2;
|
|
13349
13406
|
}
|
|
13350
|
-
|
|
13351
|
-
|
|
13352
|
-
|
|
13353
|
-
|
|
13354
|
-
|
|
13355
|
-
|
|
13356
|
-
|
|
13357
|
-
|
|
13358
|
-
|
|
13359
|
-
|
|
13360
|
-
|
|
13361
|
-
|
|
13362
|
-
|
|
13363
|
-
|
|
13407
|
+
try {
|
|
13408
|
+
const currentOnPaint = onPaintRef.current;
|
|
13409
|
+
if (currentOnPaint) {
|
|
13410
|
+
if (paintTarget instanceof HTMLCanvasElement) {
|
|
13411
|
+
throw new Error("HtmlInCanvas: onPaint requires an OffscreenCanvas paint target");
|
|
13412
|
+
}
|
|
13413
|
+
const paintResult = currentOnPaint({
|
|
13414
|
+
canvas: paintTarget,
|
|
13415
|
+
element,
|
|
13416
|
+
elementImage: elImage,
|
|
13417
|
+
pixelDensity: resolvedPixelDensity
|
|
13418
|
+
});
|
|
13419
|
+
if (paintResult) {
|
|
13420
|
+
await paintResult;
|
|
13421
|
+
}
|
|
13422
|
+
} else {
|
|
13423
|
+
defaultOnPaint({
|
|
13424
|
+
canvas: paintTarget,
|
|
13425
|
+
element,
|
|
13426
|
+
elementImage: elImage,
|
|
13427
|
+
pixelDensity: resolvedPixelDensity
|
|
13428
|
+
});
|
|
13429
|
+
}
|
|
13430
|
+
await runEffectChain({
|
|
13431
|
+
state: chainState.get(canvasWidth, canvasHeight),
|
|
13432
|
+
source: paintTarget,
|
|
13433
|
+
effects: effectsRef.current,
|
|
13434
|
+
output: paintTarget,
|
|
13435
|
+
width: canvasWidth,
|
|
13436
|
+
height: canvasHeight
|
|
13437
|
+
});
|
|
13438
|
+
} finally {
|
|
13439
|
+
elImage.close();
|
|
13440
|
+
}
|
|
13441
|
+
ancestorRef.current?.requestParentPaint();
|
|
13364
13442
|
continueRender2(handle);
|
|
13365
13443
|
} catch (error2) {
|
|
13366
13444
|
cancelRender2(error2);
|
|
@@ -13372,7 +13450,7 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
13372
13450
|
continueRender2,
|
|
13373
13451
|
cancelRender2,
|
|
13374
13452
|
resolvedPixelDensity,
|
|
13375
|
-
|
|
13453
|
+
canRetryMissingPaintRecord
|
|
13376
13454
|
]);
|
|
13377
13455
|
useLayoutEffect9(() => {
|
|
13378
13456
|
const placeholder = canvas2dRef.current;
|
|
@@ -13380,10 +13458,10 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
13380
13458
|
throw new Error("Canvas not found");
|
|
13381
13459
|
}
|
|
13382
13460
|
placeholder.layoutSubtree = true;
|
|
13383
|
-
const
|
|
13384
|
-
|
|
13385
|
-
|
|
13386
|
-
|
|
13461
|
+
const paintTarget = usesDirectLayoutCanvas ? placeholder : placeholder.transferControlToOffscreen();
|
|
13462
|
+
paintTargetRef.current = paintTarget;
|
|
13463
|
+
resizePaintTarget({
|
|
13464
|
+
target: paintTarget,
|
|
13387
13465
|
width: canvasWidth,
|
|
13388
13466
|
height: canvasHeight
|
|
13389
13467
|
});
|
|
@@ -13392,13 +13470,19 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
13392
13470
|
placeholder.addEventListener("paint", onPaintCb);
|
|
13393
13471
|
return () => {
|
|
13394
13472
|
placeholder.removeEventListener("paint", onPaintCb);
|
|
13395
|
-
|
|
13473
|
+
paintTargetRef.current = null;
|
|
13396
13474
|
initializedRef.current = false;
|
|
13397
13475
|
unmountedRef.current = true;
|
|
13398
13476
|
onInitCleanupRef.current?.();
|
|
13399
13477
|
onInitCleanupRef.current = null;
|
|
13400
13478
|
};
|
|
13401
|
-
}, [
|
|
13479
|
+
}, [
|
|
13480
|
+
onPaintCb,
|
|
13481
|
+
cancelRender2,
|
|
13482
|
+
canvasWidth,
|
|
13483
|
+
canvasHeight,
|
|
13484
|
+
usesDirectLayoutCanvas
|
|
13485
|
+
]);
|
|
13402
13486
|
const onPaintChangedRef = useRef22(false);
|
|
13403
13487
|
useLayoutEffect9(() => {
|
|
13404
13488
|
if (!onPaintChangedRef.current) {
|
|
@@ -13437,11 +13521,15 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
13437
13521
|
...style ?? {}
|
|
13438
13522
|
};
|
|
13439
13523
|
}, [height, style, width]);
|
|
13440
|
-
|
|
13441
|
-
|
|
13442
|
-
|
|
13524
|
+
const ancestorValue = useMemo30(() => {
|
|
13525
|
+
return {
|
|
13526
|
+
requestParentPaint: () => {
|
|
13527
|
+
canvas2dRef.current?.requestPaint?.();
|
|
13528
|
+
}
|
|
13529
|
+
};
|
|
13530
|
+
}, []);
|
|
13443
13531
|
return /* @__PURE__ */ jsx25(HtmlInCanvasAncestorContext.Provider, {
|
|
13444
|
-
value:
|
|
13532
|
+
value: ancestorValue,
|
|
13445
13533
|
children: /* @__PURE__ */ jsx25("canvas", {
|
|
13446
13534
|
ref: setLayoutCanvasRef,
|
|
13447
13535
|
width: canvasWidth,
|
|
@@ -14169,6 +14257,12 @@ var NativeImgInner = ({
|
|
|
14169
14257
|
};
|
|
14170
14258
|
var CanvasImageWithPrivateProps = CanvasImage;
|
|
14171
14259
|
var imgSchema = {
|
|
14260
|
+
src: {
|
|
14261
|
+
type: "asset",
|
|
14262
|
+
default: undefined,
|
|
14263
|
+
description: "Source",
|
|
14264
|
+
keyframable: false
|
|
14265
|
+
},
|
|
14172
14266
|
...baseSchema,
|
|
14173
14267
|
...transformSchema
|
|
14174
14268
|
};
|
|
@@ -14379,7 +14473,7 @@ var makeInteractiveElement = (tag, displayName) => {
|
|
|
14379
14473
|
_remotionInternalStack: stack,
|
|
14380
14474
|
_remotionInternalDocumentationLink: "https://www.remotion.dev/docs/interactive",
|
|
14381
14475
|
outlineRef: refForOutline,
|
|
14382
|
-
children:
|
|
14476
|
+
children: React30.createElement(tag, {
|
|
14383
14477
|
...props2,
|
|
14384
14478
|
ref: callbackRef
|
|
14385
14479
|
})
|
|
@@ -14443,7 +14537,7 @@ var Interactive = {
|
|
|
14443
14537
|
Text: makeInteractiveElement("text", "<Interactive.Text>"),
|
|
14444
14538
|
Ul: makeInteractiveElement("ul", "<Interactive.Ul>")
|
|
14445
14539
|
};
|
|
14446
|
-
var compositionsRef =
|
|
14540
|
+
var compositionsRef = React31.createRef();
|
|
14447
14541
|
var CompositionManagerProvider = ({
|
|
14448
14542
|
children,
|
|
14449
14543
|
onlyRenderComposition,
|
|
@@ -14592,7 +14686,7 @@ var REMOTION_STUDIO_CONTAINER_ELEMENT = "__remotion-studio-container";
|
|
|
14592
14686
|
var getPreviewDomElement = () => {
|
|
14593
14687
|
return document.getElementById(REMOTION_STUDIO_CONTAINER_ELEMENT);
|
|
14594
14688
|
};
|
|
14595
|
-
var MaxMediaCacheSizeContext =
|
|
14689
|
+
var MaxMediaCacheSizeContext = React32.createContext(null);
|
|
14596
14690
|
var Root = null;
|
|
14597
14691
|
var listeners = [];
|
|
14598
14692
|
var getRoot = () => {
|
|
@@ -14865,7 +14959,7 @@ var resolveVideoConfigOrCatch = (params) => {
|
|
|
14865
14959
|
};
|
|
14866
14960
|
}
|
|
14867
14961
|
};
|
|
14868
|
-
var SequenceStackTracesUpdateContext =
|
|
14962
|
+
var SequenceStackTracesUpdateContext = React34.createContext(() => {});
|
|
14869
14963
|
var getEnvVariables = () => {
|
|
14870
14964
|
if (getRemotionEnvironment().isRendering) {
|
|
14871
14965
|
const param = window.remotion_envVariables;
|
|
@@ -14891,7 +14985,7 @@ var setupEnvVariables = () => {
|
|
|
14891
14985
|
window.process.env[key] = env[key];
|
|
14892
14986
|
});
|
|
14893
14987
|
};
|
|
14894
|
-
var CurrentScaleContext =
|
|
14988
|
+
var CurrentScaleContext = React35.createContext(null);
|
|
14895
14989
|
var PreviewSizeContext = createContext25({
|
|
14896
14990
|
setSize: () => {
|
|
14897
14991
|
return;
|
|
@@ -14915,7 +15009,7 @@ var calculateScale = ({
|
|
|
14915
15009
|
}
|
|
14916
15010
|
return Number(previewSize);
|
|
14917
15011
|
};
|
|
14918
|
-
var PixelDensityContext =
|
|
15012
|
+
var PixelDensityContext = React36.createContext(null);
|
|
14919
15013
|
var getOffthreadVideoSource = ({
|
|
14920
15014
|
src,
|
|
14921
15015
|
transparent,
|
|
@@ -15182,7 +15276,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
15182
15276
|
ref: videoRef
|
|
15183
15277
|
});
|
|
15184
15278
|
}, [context.audioContext]);
|
|
15185
|
-
const effectToUse =
|
|
15279
|
+
const effectToUse = React38.useInsertionEffect ?? React38.useLayoutEffect;
|
|
15186
15280
|
effectToUse(() => {
|
|
15187
15281
|
return () => {
|
|
15188
15282
|
requestAnimationFrame(() => {
|
|
@@ -15558,20 +15652,20 @@ var OffthreadVideo = ({
|
|
|
15558
15652
|
addSequenceStackTraces(OffthreadVideo);
|
|
15559
15653
|
var WATCH_REMOTION_STATIC_FILES = "remotion_staticFilesChanged";
|
|
15560
15654
|
function useRemotionContexts() {
|
|
15561
|
-
const compositionManagerCtx =
|
|
15562
|
-
const timelineContext =
|
|
15563
|
-
const setTimelineContext =
|
|
15564
|
-
const sequenceContext =
|
|
15565
|
-
const nonceContext =
|
|
15566
|
-
const canUseRemotionHooksContext =
|
|
15567
|
-
const preloadContext =
|
|
15568
|
-
const resolveCompositionContext =
|
|
15569
|
-
const renderAssetManagerContext =
|
|
15570
|
-
const sequenceManagerContext =
|
|
15571
|
-
const sequenceManagerRefContext =
|
|
15572
|
-
const visualModePropStatusesRefContext =
|
|
15573
|
-
const bufferManagerContext =
|
|
15574
|
-
const logLevelContext =
|
|
15655
|
+
const compositionManagerCtx = React40.useContext(CompositionManager);
|
|
15656
|
+
const timelineContext = React40.useContext(TimelineContext);
|
|
15657
|
+
const setTimelineContext = React40.useContext(SetTimelineContext);
|
|
15658
|
+
const sequenceContext = React40.useContext(SequenceContext);
|
|
15659
|
+
const nonceContext = React40.useContext(NonceContext);
|
|
15660
|
+
const canUseRemotionHooksContext = React40.useContext(CanUseRemotionHooks);
|
|
15661
|
+
const preloadContext = React40.useContext(PreloadContext);
|
|
15662
|
+
const resolveCompositionContext = React40.useContext(ResolveCompositionContext);
|
|
15663
|
+
const renderAssetManagerContext = React40.useContext(RenderAssetManager);
|
|
15664
|
+
const sequenceManagerContext = React40.useContext(SequenceManager);
|
|
15665
|
+
const sequenceManagerRefContext = React40.useContext(SequenceManagerRefContext);
|
|
15666
|
+
const visualModePropStatusesRefContext = React40.useContext(VisualModePropStatusesRefContext);
|
|
15667
|
+
const bufferManagerContext = React40.useContext(BufferingContextReact);
|
|
15668
|
+
const logLevelContext = React40.useContext(LogLevelContext);
|
|
15575
15669
|
return useMemo37(() => ({
|
|
15576
15670
|
compositionManagerCtx,
|
|
15577
15671
|
timelineContext,
|
|
@@ -15745,6 +15839,8 @@ var Internals = {
|
|
|
15745
15839
|
BufferingProvider,
|
|
15746
15840
|
BufferingContextReact,
|
|
15747
15841
|
getComponentsToAddStacksTo,
|
|
15842
|
+
getSequenceComponent,
|
|
15843
|
+
getSingleChildComponent,
|
|
15748
15844
|
CurrentScaleContext,
|
|
15749
15845
|
PixelDensityContext,
|
|
15750
15846
|
PreviewSizeContext,
|
|
@@ -15802,75 +15898,139 @@ var Internals = {
|
|
|
15802
15898
|
fromField
|
|
15803
15899
|
};
|
|
15804
15900
|
var flattenChildren = (children) => {
|
|
15805
|
-
const childrenArray =
|
|
15901
|
+
const childrenArray = React41.Children.toArray(children);
|
|
15806
15902
|
return childrenArray.reduce((flatChildren, child) => {
|
|
15807
|
-
if (child.type ===
|
|
15903
|
+
if (child.type === React41.Fragment) {
|
|
15808
15904
|
return flatChildren.concat(flattenChildren(child.props.children));
|
|
15809
15905
|
}
|
|
15810
15906
|
flatChildren.push(child);
|
|
15811
15907
|
return flatChildren;
|
|
15812
15908
|
}, []);
|
|
15813
15909
|
};
|
|
15814
|
-
var
|
|
15910
|
+
var seriesSequenceSchema = {
|
|
15911
|
+
durationInFrames: Interactive.baseSchema.durationInFrames,
|
|
15912
|
+
name: Interactive.sequenceSchema.name,
|
|
15913
|
+
hidden: Interactive.sequenceSchema.hidden,
|
|
15914
|
+
showInTimeline: Interactive.sequenceSchema.showInTimeline,
|
|
15915
|
+
freeze: Interactive.baseSchema.freeze,
|
|
15916
|
+
layout: Interactive.sequenceSchema.layout
|
|
15917
|
+
};
|
|
15918
|
+
var SeriesSequenceInner = forwardRef14(({
|
|
15919
|
+
offset = 0,
|
|
15920
|
+
className = "",
|
|
15921
|
+
stack = null,
|
|
15922
|
+
_remotionInternalRender = null,
|
|
15923
|
+
...props2
|
|
15924
|
+
}, ref) => {
|
|
15815
15925
|
useRequireToBeInsideSeries();
|
|
15926
|
+
if (_remotionInternalRender) {
|
|
15927
|
+
return _remotionInternalRender({ ...props2, offset, className: className || undefined, stack }, ref);
|
|
15928
|
+
}
|
|
15816
15929
|
return /* @__PURE__ */ jsx37(IsNotInsideSeriesProvider, {
|
|
15817
|
-
children
|
|
15930
|
+
children: props2.children
|
|
15818
15931
|
});
|
|
15819
|
-
};
|
|
15820
|
-
var SeriesSequence =
|
|
15932
|
+
});
|
|
15933
|
+
var SeriesSequence = Interactive.withSchema({
|
|
15934
|
+
Component: SeriesSequenceInner,
|
|
15935
|
+
componentName: "<Series.Sequence>",
|
|
15936
|
+
componentIdentity: "dev.remotion.remotion.Series.Sequence",
|
|
15937
|
+
schema: seriesSequenceSchema,
|
|
15938
|
+
supportsEffects: false
|
|
15939
|
+
});
|
|
15821
15940
|
var SequenceWithoutSchemaWithRef = SequenceWithoutSchema;
|
|
15941
|
+
var validateSeriesSequenceProps = ({
|
|
15942
|
+
durationInFrames,
|
|
15943
|
+
offset: offsetProp,
|
|
15944
|
+
index,
|
|
15945
|
+
childrenLength
|
|
15946
|
+
}) => {
|
|
15947
|
+
const debugInfo = `index = ${index}, duration = ${durationInFrames}`;
|
|
15948
|
+
if (index !== childrenLength - 1 || durationInFrames !== Infinity) {
|
|
15949
|
+
validateDurationInFrames(durationInFrames, {
|
|
15950
|
+
component: `of a <Series.Sequence /> component`,
|
|
15951
|
+
allowFloats: true
|
|
15952
|
+
});
|
|
15953
|
+
}
|
|
15954
|
+
const offset = offsetProp ?? 0;
|
|
15955
|
+
if (Number.isNaN(offset)) {
|
|
15956
|
+
throw new TypeError(`The "offset" property of a <Series.Sequence /> must not be NaN, but got NaN (${debugInfo}).`);
|
|
15957
|
+
}
|
|
15958
|
+
if (!Number.isFinite(offset)) {
|
|
15959
|
+
throw new TypeError(`The "offset" property of a <Series.Sequence /> must be finite, but got ${offset} (${debugInfo}).`);
|
|
15960
|
+
}
|
|
15961
|
+
if (offset % 1 !== 0) {
|
|
15962
|
+
throw new TypeError(`The "offset" property of a <Series.Sequence /> must be finite, but got ${offset} (${debugInfo}).`);
|
|
15963
|
+
}
|
|
15964
|
+
return offset;
|
|
15965
|
+
};
|
|
15822
15966
|
var SeriesInner = (props2) => {
|
|
15823
15967
|
const childrenValue = useMemo38(() => {
|
|
15824
|
-
let startFrame = 0;
|
|
15825
15968
|
const flattenedChildren = flattenChildren(props2.children);
|
|
15826
|
-
|
|
15969
|
+
const renderChildren = (i, startFrame) => {
|
|
15970
|
+
if (i === flattenedChildren.length) {
|
|
15971
|
+
return null;
|
|
15972
|
+
}
|
|
15973
|
+
const child = flattenedChildren[i];
|
|
15827
15974
|
const castedChild = child;
|
|
15828
15975
|
if (typeof castedChild === "string") {
|
|
15829
15976
|
if (castedChild.trim() === "") {
|
|
15830
|
-
return
|
|
15977
|
+
return renderChildren(i + 1, startFrame);
|
|
15831
15978
|
}
|
|
15832
15979
|
throw new TypeError(`The <Series /> component only accepts a list of <Series.Sequence /> components as its children, but you passed a string "${castedChild}"`);
|
|
15833
15980
|
}
|
|
15834
15981
|
if (castedChild.type !== SeriesSequence) {
|
|
15835
15982
|
throw new TypeError(`The <Series /> component only accepts a list of <Series.Sequence /> components as its children, but got ${castedChild} instead`);
|
|
15836
15983
|
}
|
|
15837
|
-
const
|
|
15838
|
-
|
|
15839
|
-
|
|
15840
|
-
|
|
15841
|
-
|
|
15842
|
-
|
|
15843
|
-
name,
|
|
15844
|
-
...passedProps
|
|
15845
|
-
} = castedChild.props;
|
|
15846
|
-
if (i !== flattenedChildren.length - 1 || durationInFramesProp !== Infinity) {
|
|
15847
|
-
validateDurationInFrames(durationInFramesProp, {
|
|
15848
|
-
component: `of a <Series.Sequence /> component`,
|
|
15849
|
-
allowFloats: true
|
|
15850
|
-
});
|
|
15851
|
-
}
|
|
15852
|
-
const offset = castedChild.props.offset ?? 0;
|
|
15853
|
-
if (Number.isNaN(offset)) {
|
|
15854
|
-
throw new TypeError(`The "offset" property of a <Series.Sequence /> must not be NaN, but got NaN (${debugInfo}).`);
|
|
15855
|
-
}
|
|
15856
|
-
if (!Number.isFinite(offset)) {
|
|
15857
|
-
throw new TypeError(`The "offset" property of a <Series.Sequence /> must be finite, but got ${offset} (${debugInfo}).`);
|
|
15858
|
-
}
|
|
15859
|
-
if (offset % 1 !== 0) {
|
|
15860
|
-
throw new TypeError(`The "offset" property of a <Series.Sequence /> must be finite, but got ${offset} (${debugInfo}).`);
|
|
15861
|
-
}
|
|
15862
|
-
const currentStartFrame = startFrame + offset;
|
|
15863
|
-
startFrame += durationInFramesProp + offset;
|
|
15864
|
-
return /* @__PURE__ */ jsx37(SequenceWithoutSchemaWithRef, {
|
|
15865
|
-
ref: castedChild.ref,
|
|
15866
|
-
name: name || "<Series.Sequence>",
|
|
15867
|
-
_remotionInternalDocumentationLink: name ? undefined : "https://www.remotion.dev/docs/series",
|
|
15868
|
-
from: currentStartFrame,
|
|
15869
|
-
durationInFrames: durationInFramesProp,
|
|
15870
|
-
...passedProps,
|
|
15871
|
-
children: child
|
|
15984
|
+
const castedElement = castedChild;
|
|
15985
|
+
validateSeriesSequenceProps({
|
|
15986
|
+
durationInFrames: castedElement.props.durationInFrames,
|
|
15987
|
+
offset: castedElement.props.offset,
|
|
15988
|
+
index: i,
|
|
15989
|
+
childrenLength: flattenedChildren.length
|
|
15872
15990
|
});
|
|
15873
|
-
|
|
15991
|
+
return React42.cloneElement(castedElement, {
|
|
15992
|
+
_remotionInternalRender: (resolvedProps, ref) => {
|
|
15993
|
+
const durationInFramesProp = resolvedProps.durationInFrames;
|
|
15994
|
+
const {
|
|
15995
|
+
durationInFrames: _durationInFrames,
|
|
15996
|
+
children: sequenceChildren,
|
|
15997
|
+
offset: offsetProp,
|
|
15998
|
+
controls,
|
|
15999
|
+
stack,
|
|
16000
|
+
from: _from,
|
|
16001
|
+
name,
|
|
16002
|
+
...passedProps
|
|
16003
|
+
} = resolvedProps;
|
|
16004
|
+
const offset = validateSeriesSequenceProps({
|
|
16005
|
+
durationInFrames: durationInFramesProp,
|
|
16006
|
+
offset: offsetProp,
|
|
16007
|
+
index: i,
|
|
16008
|
+
childrenLength: flattenedChildren.length
|
|
16009
|
+
});
|
|
16010
|
+
const currentStartFrame = startFrame + offset;
|
|
16011
|
+
const nextStartFrame = startFrame + durationInFramesProp + offset;
|
|
16012
|
+
return /* @__PURE__ */ jsxs32(Fragment, {
|
|
16013
|
+
children: [
|
|
16014
|
+
/* @__PURE__ */ jsx37(SequenceWithoutSchemaWithRef, {
|
|
16015
|
+
ref,
|
|
16016
|
+
name: name || "<Series.Sequence>",
|
|
16017
|
+
_remotionInternalDocumentationLink: name ? undefined : "https://www.remotion.dev/docs/series",
|
|
16018
|
+
_remotionInternalStack: stack ?? undefined,
|
|
16019
|
+
controls: controls ?? undefined,
|
|
16020
|
+
from: currentStartFrame,
|
|
16021
|
+
durationInFrames: durationInFramesProp,
|
|
16022
|
+
...passedProps,
|
|
16023
|
+
children: /* @__PURE__ */ jsx37(IsNotInsideSeriesProvider, {
|
|
16024
|
+
children: sequenceChildren
|
|
16025
|
+
})
|
|
16026
|
+
}),
|
|
16027
|
+
renderChildren(i + 1, nextStartFrame)
|
|
16028
|
+
]
|
|
16029
|
+
});
|
|
16030
|
+
}
|
|
16031
|
+
});
|
|
16032
|
+
};
|
|
16033
|
+
return renderChildren(0, 0);
|
|
15874
16034
|
}, [props2.children]);
|
|
15875
16035
|
return /* @__PURE__ */ jsx37(IsInsideSeriesContainer, {
|
|
15876
16036
|
children: /* @__PURE__ */ jsx37(Sequence, {
|
|
@@ -15986,7 +16146,7 @@ var Still = (props2) => {
|
|
|
15986
16146
|
durationInFrames: 1,
|
|
15987
16147
|
fps: 1
|
|
15988
16148
|
};
|
|
15989
|
-
return
|
|
16149
|
+
return React43.createElement(Composition, newProps);
|
|
15990
16150
|
};
|
|
15991
16151
|
addSequenceStackTraces(Still);
|
|
15992
16152
|
var roundTo6Commas = (num) => {
|
|
@@ -16465,6 +16625,7 @@ var Config = new Proxy(proxyObj, {
|
|
|
16465
16625
|
});
|
|
16466
16626
|
Sequence.displayName = "Sequence";
|
|
16467
16627
|
addSequenceStackTraces(Sequence);
|
|
16628
|
+
setSequenceComponent(Sequence);
|
|
16468
16629
|
addSequenceStackTraces(Composition);
|
|
16469
16630
|
addSequenceStackTraces(Folder);
|
|
16470
16631
|
|
|
@@ -19388,18 +19549,18 @@ import { jsx as jsx53, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
|
19388
19549
|
import React62 from "react";
|
|
19389
19550
|
import { jsx as jsx63 } from "react/jsx-runtime";
|
|
19390
19551
|
import { jsx as jsx73 } from "react/jsx-runtime";
|
|
19391
|
-
import { jsx as jsx83, jsxs as
|
|
19552
|
+
import { jsx as jsx83, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
19392
19553
|
import { jsx as jsx93 } from "react/jsx-runtime";
|
|
19393
19554
|
import React72 from "react";
|
|
19394
19555
|
import { jsx as jsx103 } from "react/jsx-runtime";
|
|
19395
19556
|
import { jsx as jsx113 } from "react/jsx-runtime";
|
|
19396
19557
|
import { jsx as jsx123 } from "react/jsx-runtime";
|
|
19397
|
-
import * as
|
|
19558
|
+
import * as React362 from "react";
|
|
19398
19559
|
import * as ReactDOM4 from "react-dom";
|
|
19399
|
-
import
|
|
19560
|
+
import React11 from "react";
|
|
19400
19561
|
import * as React8 from "react";
|
|
19401
19562
|
import { jsx as jsx132 } from "react/jsx-runtime";
|
|
19402
|
-
import * as
|
|
19563
|
+
import * as React92 from "react";
|
|
19403
19564
|
import * as React10 from "react";
|
|
19404
19565
|
import { Fragment as Fragment5, jsx as jsx142 } from "react/jsx-runtime";
|
|
19405
19566
|
import { jsx as jsx152 } from "react/jsx-runtime";
|
|
@@ -19409,15 +19570,15 @@ import * as React162 from "react";
|
|
|
19409
19570
|
import * as React132 from "react";
|
|
19410
19571
|
import * as ReactDOM from "react-dom";
|
|
19411
19572
|
import { jsx as jsx172 } from "react/jsx-runtime";
|
|
19412
|
-
import * as
|
|
19413
|
-
import * as
|
|
19573
|
+
import * as React142 from "react";
|
|
19574
|
+
import * as React15 from "react";
|
|
19414
19575
|
import { jsx as jsx182 } from "react/jsx-runtime";
|
|
19415
|
-
import * as
|
|
19576
|
+
import * as React172 from "react";
|
|
19416
19577
|
import * as React18 from "react";
|
|
19417
19578
|
import { jsx as jsx192 } from "react/jsx-runtime";
|
|
19418
19579
|
import * as React202 from "react";
|
|
19419
|
-
import * as
|
|
19420
|
-
import * as
|
|
19580
|
+
import * as React19 from "react";
|
|
19581
|
+
import * as React242 from "react";
|
|
19421
19582
|
import * as React212 from "react";
|
|
19422
19583
|
import { useLayoutEffect as useLayoutEffect32, useEffect as useEffect82 } from "react";
|
|
19423
19584
|
import * as ReactDOM2 from "react-dom";
|
|
@@ -19435,7 +19596,7 @@ import { jsx as jsx232 } from "react/jsx-runtime";
|
|
|
19435
19596
|
import * as React352 from "react";
|
|
19436
19597
|
import * as React312 from "react";
|
|
19437
19598
|
import { useState as useState112 } from "react";
|
|
19438
|
-
import * as
|
|
19599
|
+
import * as React29 from "react";
|
|
19439
19600
|
import * as React302 from "react";
|
|
19440
19601
|
import * as React342 from "react";
|
|
19441
19602
|
import * as React332 from "react";
|
|
@@ -19443,22 +19604,22 @@ import * as React322 from "react";
|
|
|
19443
19604
|
import { Fragment as Fragment8, jsx as jsx242, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
19444
19605
|
import { forwardRef as forwardRef142, createElement as createElement7 } from "react";
|
|
19445
19606
|
import { forwardRef as forwardRef132, createElement as createElement6 } from "react";
|
|
19446
|
-
import * as
|
|
19607
|
+
import * as React37 from "react";
|
|
19447
19608
|
import { jsx as jsx252, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
19448
19609
|
import { jsx as jsx262 } from "react/jsx-runtime";
|
|
19449
19610
|
import * as React49 from "react";
|
|
19450
|
-
import * as
|
|
19611
|
+
import * as React382 from "react";
|
|
19451
19612
|
import { jsx as jsx272 } from "react/jsx-runtime";
|
|
19452
19613
|
import * as React47 from "react";
|
|
19453
19614
|
import React402 from "react";
|
|
19454
|
-
import * as
|
|
19455
|
-
import { Fragment as
|
|
19615
|
+
import * as React39 from "react";
|
|
19616
|
+
import { Fragment as Fragment222, jsx as jsx282 } from "react/jsx-runtime";
|
|
19456
19617
|
import { jsx as jsx292 } from "react/jsx-runtime";
|
|
19457
19618
|
import React210 from "react";
|
|
19458
19619
|
import { jsx as jsx2102 } from "react/jsx-runtime";
|
|
19459
19620
|
import * as React422 from "react";
|
|
19460
|
-
import * as
|
|
19461
|
-
import * as
|
|
19621
|
+
import * as React412 from "react";
|
|
19622
|
+
import * as React432 from "react";
|
|
19462
19623
|
import * as ReactDOM5 from "react-dom";
|
|
19463
19624
|
import { jsx as jsx302 } from "react/jsx-runtime";
|
|
19464
19625
|
import * as React44 from "react";
|
|
@@ -19510,7 +19671,7 @@ function useComposedRefs(...refs) {
|
|
|
19510
19671
|
return React3.useCallback(composeRefs(...refs), refs);
|
|
19511
19672
|
}
|
|
19512
19673
|
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
|
19513
|
-
var use =
|
|
19674
|
+
var use = React24[" use ".trim().toString()];
|
|
19514
19675
|
function isPromiseLike(value) {
|
|
19515
19676
|
return typeof value === "object" && value !== null && "then" in value;
|
|
19516
19677
|
}
|
|
@@ -19519,25 +19680,25 @@ function isLazyComponent(element) {
|
|
|
19519
19680
|
}
|
|
19520
19681
|
function createSlot(ownerName) {
|
|
19521
19682
|
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
|
19522
|
-
const Slot2 =
|
|
19683
|
+
const Slot2 = React24.forwardRef((props, forwardedRef) => {
|
|
19523
19684
|
let { children, ...slotProps } = props;
|
|
19524
19685
|
if (isLazyComponent(children) && typeof use === "function") {
|
|
19525
19686
|
children = use(children._payload);
|
|
19526
19687
|
}
|
|
19527
|
-
const childrenArray =
|
|
19688
|
+
const childrenArray = React24.Children.toArray(children);
|
|
19528
19689
|
const slottable = childrenArray.find(isSlottable);
|
|
19529
19690
|
if (slottable) {
|
|
19530
19691
|
const newElement = slottable.props.children;
|
|
19531
19692
|
const newChildren = childrenArray.map((child) => {
|
|
19532
19693
|
if (child === slottable) {
|
|
19533
|
-
if (
|
|
19534
|
-
return
|
|
19535
|
-
return
|
|
19694
|
+
if (React24.Children.count(newElement) > 1)
|
|
19695
|
+
return React24.Children.only(null);
|
|
19696
|
+
return React24.isValidElement(newElement) ? newElement.props.children : null;
|
|
19536
19697
|
} else {
|
|
19537
19698
|
return child;
|
|
19538
19699
|
}
|
|
19539
19700
|
});
|
|
19540
|
-
return /* @__PURE__ */ jsx44(SlotClone, { ...slotProps, ref: forwardedRef, children:
|
|
19701
|
+
return /* @__PURE__ */ jsx44(SlotClone, { ...slotProps, ref: forwardedRef, children: React24.isValidElement(newElement) ? React24.cloneElement(newElement, undefined, newChildren) : null });
|
|
19541
19702
|
}
|
|
19542
19703
|
return /* @__PURE__ */ jsx44(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
19543
19704
|
});
|
|
@@ -19546,20 +19707,20 @@ function createSlot(ownerName) {
|
|
|
19546
19707
|
}
|
|
19547
19708
|
var Slot = /* @__PURE__ */ createSlot("Slot");
|
|
19548
19709
|
function createSlotClone(ownerName) {
|
|
19549
|
-
const SlotClone =
|
|
19710
|
+
const SlotClone = React24.forwardRef((props, forwardedRef) => {
|
|
19550
19711
|
let { children, ...slotProps } = props;
|
|
19551
19712
|
if (isLazyComponent(children) && typeof use === "function") {
|
|
19552
19713
|
children = use(children._payload);
|
|
19553
19714
|
}
|
|
19554
|
-
if (
|
|
19715
|
+
if (React24.isValidElement(children)) {
|
|
19555
19716
|
const childrenRef = getElementRef(children);
|
|
19556
19717
|
const props2 = mergeProps(slotProps, children.props);
|
|
19557
|
-
if (children.type !==
|
|
19718
|
+
if (children.type !== React24.Fragment) {
|
|
19558
19719
|
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
19559
19720
|
}
|
|
19560
|
-
return
|
|
19721
|
+
return React24.cloneElement(children, props2);
|
|
19561
19722
|
}
|
|
19562
|
-
return
|
|
19723
|
+
return React24.Children.count(children) > 1 ? React24.Children.only(null) : null;
|
|
19563
19724
|
});
|
|
19564
19725
|
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
19565
19726
|
return SlotClone;
|
|
@@ -19567,7 +19728,7 @@ function createSlotClone(ownerName) {
|
|
|
19567
19728
|
var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
|
|
19568
19729
|
function createSlottable(ownerName) {
|
|
19569
19730
|
const Slottable2 = ({ children }) => {
|
|
19570
|
-
return /* @__PURE__ */ jsx44(
|
|
19731
|
+
return /* @__PURE__ */ jsx44(Fragment22, { children });
|
|
19571
19732
|
};
|
|
19572
19733
|
Slottable2.displayName = `${ownerName}.Slottable`;
|
|
19573
19734
|
Slottable2.__radixId = SLOTTABLE_IDENTIFIER;
|
|
@@ -19575,7 +19736,7 @@ function createSlottable(ownerName) {
|
|
|
19575
19736
|
}
|
|
19576
19737
|
var Slottable = /* @__PURE__ */ createSlottable("Slottable");
|
|
19577
19738
|
function isSlottable(child) {
|
|
19578
|
-
return
|
|
19739
|
+
return React24.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
|
19579
19740
|
}
|
|
19580
19741
|
function mergeProps(slotProps, childProps) {
|
|
19581
19742
|
const overrideProps = { ...childProps };
|
|
@@ -19632,7 +19793,7 @@ var getChildNodeFrom = (htmlElement) => {
|
|
|
19632
19793
|
return childNode;
|
|
19633
19794
|
};
|
|
19634
19795
|
var useHoverTransforms = (ref, disabled) => {
|
|
19635
|
-
const [state, setState] =
|
|
19796
|
+
const [state, setState] = React33.useState({
|
|
19636
19797
|
progress: 0,
|
|
19637
19798
|
isActive: false
|
|
19638
19799
|
});
|
|
@@ -19644,7 +19805,7 @@ var useHoverTransforms = (ref, disabled) => {
|
|
|
19644
19805
|
eventTarget.dispatchEvent(new Event("enabled"));
|
|
19645
19806
|
}
|
|
19646
19807
|
}, [disabled, eventTarget]);
|
|
19647
|
-
|
|
19808
|
+
React33.useEffect(() => {
|
|
19648
19809
|
const element = ref.current;
|
|
19649
19810
|
if (!element)
|
|
19650
19811
|
return;
|
|
@@ -19719,8 +19880,8 @@ var useHoverTransforms = (ref, disabled) => {
|
|
|
19719
19880
|
return state;
|
|
19720
19881
|
};
|
|
19721
19882
|
var useClickTransforms = (ref) => {
|
|
19722
|
-
const [hoverProgress, setHoverProgress] =
|
|
19723
|
-
|
|
19883
|
+
const [hoverProgress, setHoverProgress] = React33.useState(0);
|
|
19884
|
+
React33.useEffect(() => {
|
|
19724
19885
|
const element = getChildNodeFrom(ref.current);
|
|
19725
19886
|
if (!element) {
|
|
19726
19887
|
return;
|
|
@@ -20128,7 +20289,7 @@ var Counter = ({
|
|
|
20128
20289
|
setCount(Math.min(MAX_COUNT, roundedValue));
|
|
20129
20290
|
};
|
|
20130
20291
|
const shrink = String(count).length > 6;
|
|
20131
|
-
return /* @__PURE__ */
|
|
20292
|
+
return /* @__PURE__ */ jsxs33(Card, {
|
|
20132
20293
|
style: container2,
|
|
20133
20294
|
className: cn("w-[140px] flex flex-row overflow-hidden"),
|
|
20134
20295
|
children: [
|
|
@@ -20152,7 +20313,7 @@ var Counter = ({
|
|
|
20152
20313
|
}
|
|
20153
20314
|
}
|
|
20154
20315
|
}),
|
|
20155
|
-
/* @__PURE__ */
|
|
20316
|
+
/* @__PURE__ */ jsxs33("div", {
|
|
20156
20317
|
className: "flex flex-col h-full",
|
|
20157
20318
|
children: [
|
|
20158
20319
|
/* @__PURE__ */ jsx83("button", {
|
|
@@ -20296,7 +20457,7 @@ function composeRefs2(...refs) {
|
|
|
20296
20457
|
return (node) => refs.forEach((ref) => setRef22(ref, node));
|
|
20297
20458
|
}
|
|
20298
20459
|
function useComposedRefs2(...refs) {
|
|
20299
|
-
return
|
|
20460
|
+
return React92.useCallback(composeRefs2(...refs), refs);
|
|
20300
20461
|
}
|
|
20301
20462
|
var Slot2 = React10.forwardRef((props, forwardedRef) => {
|
|
20302
20463
|
const { children, ...slotProps } = props;
|
|
@@ -20378,13 +20539,13 @@ function createCollection(name) {
|
|
|
20378
20539
|
const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(PROVIDER_NAME, { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map });
|
|
20379
20540
|
const CollectionProvider = (props) => {
|
|
20380
20541
|
const { scope, children } = props;
|
|
20381
|
-
const ref =
|
|
20382
|
-
const itemMap =
|
|
20542
|
+
const ref = React11.useRef(null);
|
|
20543
|
+
const itemMap = React11.useRef(/* @__PURE__ */ new Map).current;
|
|
20383
20544
|
return /* @__PURE__ */ jsx152(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });
|
|
20384
20545
|
};
|
|
20385
20546
|
CollectionProvider.displayName = PROVIDER_NAME;
|
|
20386
20547
|
const COLLECTION_SLOT_NAME = name + "CollectionSlot";
|
|
20387
|
-
const CollectionSlot =
|
|
20548
|
+
const CollectionSlot = React11.forwardRef((props, forwardedRef) => {
|
|
20388
20549
|
const { scope, children } = props;
|
|
20389
20550
|
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
|
20390
20551
|
const composedRefs = useComposedRefs2(forwardedRef, context.collectionRef);
|
|
@@ -20393,12 +20554,12 @@ function createCollection(name) {
|
|
|
20393
20554
|
CollectionSlot.displayName = COLLECTION_SLOT_NAME;
|
|
20394
20555
|
const ITEM_SLOT_NAME = name + "CollectionItemSlot";
|
|
20395
20556
|
const ITEM_DATA_ATTR = "data-radix-collection-item";
|
|
20396
|
-
const CollectionItemSlot =
|
|
20557
|
+
const CollectionItemSlot = React11.forwardRef((props, forwardedRef) => {
|
|
20397
20558
|
const { scope, children, ...itemData } = props;
|
|
20398
|
-
const ref =
|
|
20559
|
+
const ref = React11.useRef(null);
|
|
20399
20560
|
const composedRefs = useComposedRefs2(forwardedRef, ref);
|
|
20400
20561
|
const context = useCollectionContext(ITEM_SLOT_NAME, scope);
|
|
20401
|
-
|
|
20562
|
+
React11.useEffect(() => {
|
|
20402
20563
|
context.itemMap.set(ref, { ref, ...itemData });
|
|
20403
20564
|
return () => void context.itemMap.delete(ref);
|
|
20404
20565
|
});
|
|
@@ -20407,7 +20568,7 @@ function createCollection(name) {
|
|
|
20407
20568
|
CollectionItemSlot.displayName = ITEM_SLOT_NAME;
|
|
20408
20569
|
function useCollection(scope) {
|
|
20409
20570
|
const context = useCollectionContext(name + "CollectionConsumer", scope);
|
|
20410
|
-
const getItems =
|
|
20571
|
+
const getItems = React11.useCallback(() => {
|
|
20411
20572
|
const collectionNode = context.collectionRef.current;
|
|
20412
20573
|
if (!collectionNode)
|
|
20413
20574
|
return [];
|
|
@@ -20464,15 +20625,15 @@ function dispatchDiscreteCustomEvent(target, event) {
|
|
|
20464
20625
|
ReactDOM.flushSync(() => target.dispatchEvent(event));
|
|
20465
20626
|
}
|
|
20466
20627
|
function useCallbackRef(callback) {
|
|
20467
|
-
const callbackRef =
|
|
20468
|
-
|
|
20628
|
+
const callbackRef = React142.useRef(callback);
|
|
20629
|
+
React142.useEffect(() => {
|
|
20469
20630
|
callbackRef.current = callback;
|
|
20470
20631
|
});
|
|
20471
|
-
return
|
|
20632
|
+
return React142.useMemo(() => (...args) => callbackRef.current?.(...args), []);
|
|
20472
20633
|
}
|
|
20473
20634
|
function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.document) {
|
|
20474
20635
|
const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);
|
|
20475
|
-
|
|
20636
|
+
React15.useEffect(() => {
|
|
20476
20637
|
const handleKeyDown = (event) => {
|
|
20477
20638
|
if (event.key === "Escape") {
|
|
20478
20639
|
onEscapeKeyDown(event);
|
|
@@ -20679,7 +20840,7 @@ function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
|
|
|
20679
20840
|
}
|
|
20680
20841
|
var count = 0;
|
|
20681
20842
|
function useFocusGuards() {
|
|
20682
|
-
|
|
20843
|
+
React172.useEffect(() => {
|
|
20683
20844
|
const edgeGuards = document.querySelectorAll("[data-radix-focus-guard]");
|
|
20684
20845
|
document.body.insertAdjacentElement("afterbegin", edgeGuards[0] ?? createFocusGuard());
|
|
20685
20846
|
document.body.insertAdjacentElement("beforeend", edgeGuards[1] ?? createFocusGuard());
|
|
@@ -20914,7 +21075,7 @@ function arrayRemove(array, item) {
|
|
|
20914
21075
|
function removeLinks(items) {
|
|
20915
21076
|
return items.filter((item) => item.tagName !== "A");
|
|
20916
21077
|
}
|
|
20917
|
-
var useLayoutEffect22 = Boolean(globalThis?.document) ?
|
|
21078
|
+
var useLayoutEffect22 = Boolean(globalThis?.document) ? React19.useLayoutEffect : () => {};
|
|
20918
21079
|
var useReactId = React202["useId".toString()] || (() => {
|
|
20919
21080
|
return;
|
|
20920
21081
|
});
|
|
@@ -22766,17 +22927,17 @@ var [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);
|
|
|
22766
22927
|
var [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);
|
|
22767
22928
|
var Popper = (props) => {
|
|
22768
22929
|
const { __scopePopper, children } = props;
|
|
22769
|
-
const [anchor, setAnchor] =
|
|
22930
|
+
const [anchor, setAnchor] = React242.useState(null);
|
|
22770
22931
|
return /* @__PURE__ */ jsx213(PopperProvider, { scope: __scopePopper, anchor, onAnchorChange: setAnchor, children });
|
|
22771
22932
|
};
|
|
22772
22933
|
Popper.displayName = POPPER_NAME;
|
|
22773
22934
|
var ANCHOR_NAME = "PopperAnchor";
|
|
22774
|
-
var PopperAnchor =
|
|
22935
|
+
var PopperAnchor = React242.forwardRef((props, forwardedRef) => {
|
|
22775
22936
|
const { __scopePopper, virtualRef, ...anchorProps } = props;
|
|
22776
22937
|
const context = usePopperContext(ANCHOR_NAME, __scopePopper);
|
|
22777
|
-
const ref =
|
|
22938
|
+
const ref = React242.useRef(null);
|
|
22778
22939
|
const composedRefs = useComposedRefs2(forwardedRef, ref);
|
|
22779
|
-
|
|
22940
|
+
React242.useEffect(() => {
|
|
22780
22941
|
context.onAnchorChange(virtualRef?.current || ref.current);
|
|
22781
22942
|
});
|
|
22782
22943
|
return virtualRef ? null : /* @__PURE__ */ jsx213(Primitive.div, { ...anchorProps, ref: composedRefs });
|
|
@@ -22784,7 +22945,7 @@ var PopperAnchor = React24.forwardRef((props, forwardedRef) => {
|
|
|
22784
22945
|
PopperAnchor.displayName = ANCHOR_NAME;
|
|
22785
22946
|
var CONTENT_NAME = "PopperContent";
|
|
22786
22947
|
var [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME);
|
|
22787
|
-
var PopperContent =
|
|
22948
|
+
var PopperContent = React242.forwardRef((props, forwardedRef) => {
|
|
22788
22949
|
const {
|
|
22789
22950
|
__scopePopper,
|
|
22790
22951
|
side = "bottom",
|
|
@@ -22802,9 +22963,9 @@ var PopperContent = React24.forwardRef((props, forwardedRef) => {
|
|
|
22802
22963
|
...contentProps
|
|
22803
22964
|
} = props;
|
|
22804
22965
|
const context = usePopperContext(CONTENT_NAME, __scopePopper);
|
|
22805
|
-
const [content, setContent] =
|
|
22966
|
+
const [content, setContent] = React242.useState(null);
|
|
22806
22967
|
const composedRefs = useComposedRefs2(forwardedRef, (node) => setContent(node));
|
|
22807
|
-
const [arrow4, setArrow] =
|
|
22968
|
+
const [arrow4, setArrow] = React242.useState(null);
|
|
22808
22969
|
const arrowSize = useSize(arrow4);
|
|
22809
22970
|
const arrowWidth = arrowSize?.width ?? 0;
|
|
22810
22971
|
const arrowHeight = arrowSize?.height ?? 0;
|
|
@@ -22864,7 +23025,7 @@ var PopperContent = React24.forwardRef((props, forwardedRef) => {
|
|
|
22864
23025
|
const arrowX = middlewareData.arrow?.x;
|
|
22865
23026
|
const arrowY = middlewareData.arrow?.y;
|
|
22866
23027
|
const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;
|
|
22867
|
-
const [contentZIndex, setContentZIndex] =
|
|
23028
|
+
const [contentZIndex, setContentZIndex] = React242.useState();
|
|
22868
23029
|
useLayoutEffect22(() => {
|
|
22869
23030
|
if (content)
|
|
22870
23031
|
setContentZIndex(window.getComputedStyle(content).zIndex);
|
|
@@ -22915,7 +23076,7 @@ var OPPOSITE_SIDE = {
|
|
|
22915
23076
|
bottom: "top",
|
|
22916
23077
|
left: "right"
|
|
22917
23078
|
};
|
|
22918
|
-
var PopperArrow =
|
|
23079
|
+
var PopperArrow = React242.forwardRef(function PopperArrow2(props, forwardedRef) {
|
|
22919
23080
|
const { __scopePopper, ...arrowProps } = props;
|
|
22920
23081
|
const contentContext = useContentContext(ARROW_NAME, __scopePopper);
|
|
22921
23082
|
const baseSide = OPPOSITE_SIDE[contentContext.placedSide];
|
|
@@ -23258,7 +23419,7 @@ function useCallbackRef2(initialValue, callback) {
|
|
|
23258
23419
|
ref.callback = callback;
|
|
23259
23420
|
return ref.facade;
|
|
23260
23421
|
}
|
|
23261
|
-
var useIsomorphicLayoutEffect = typeof window !== "undefined" ?
|
|
23422
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React29.useLayoutEffect : React29.useEffect;
|
|
23262
23423
|
var currentValues = new WeakMap;
|
|
23263
23424
|
function useMergeRefs(refs, defaultValue) {
|
|
23264
23425
|
var callbackRef = useCallbackRef2(defaultValue || null, function(newValue) {
|
|
@@ -23894,9 +24055,9 @@ var Select = (props) => {
|
|
|
23894
24055
|
required
|
|
23895
24056
|
} = props;
|
|
23896
24057
|
const popperScope = usePopperScope(__scopeSelect);
|
|
23897
|
-
const [trigger, setTrigger] =
|
|
23898
|
-
const [valueNode, setValueNode] =
|
|
23899
|
-
const [valueNodeHasChildren, setValueNodeHasChildren] =
|
|
24058
|
+
const [trigger, setTrigger] = React362.useState(null);
|
|
24059
|
+
const [valueNode, setValueNode] = React362.useState(null);
|
|
24060
|
+
const [valueNodeHasChildren, setValueNodeHasChildren] = React362.useState(false);
|
|
23900
24061
|
const direction = useDirection(dir);
|
|
23901
24062
|
const [open = false, setOpen] = useControllableState({
|
|
23902
24063
|
prop: openProp,
|
|
@@ -23908,9 +24069,9 @@ var Select = (props) => {
|
|
|
23908
24069
|
defaultProp: defaultValue,
|
|
23909
24070
|
onChange: onValueChange
|
|
23910
24071
|
});
|
|
23911
|
-
const triggerPointerDownPosRef =
|
|
24072
|
+
const triggerPointerDownPosRef = React362.useRef(null);
|
|
23912
24073
|
const isFormControl = trigger ? Boolean(trigger.closest("form")) : true;
|
|
23913
|
-
const [nativeOptionsSet, setNativeOptionsSet] =
|
|
24074
|
+
const [nativeOptionsSet, setNativeOptionsSet] = React362.useState(/* @__PURE__ */ new Set);
|
|
23914
24075
|
const nativeSelectKey = Array.from(nativeOptionsSet).map((option) => option.props.value).join(";");
|
|
23915
24076
|
return /* @__PURE__ */ jsx242(Root22, { ...popperScope, children: /* @__PURE__ */ jsxs42(SelectProvider, {
|
|
23916
24077
|
required,
|
|
@@ -23932,10 +24093,10 @@ var Select = (props) => {
|
|
|
23932
24093
|
children: [
|
|
23933
24094
|
/* @__PURE__ */ jsx242(Collection.Provider, { scope: __scopeSelect, children: /* @__PURE__ */ jsx242(SelectNativeOptionsProvider, {
|
|
23934
24095
|
scope: props.__scopeSelect,
|
|
23935
|
-
onNativeOptionAdd:
|
|
24096
|
+
onNativeOptionAdd: React362.useCallback((option) => {
|
|
23936
24097
|
setNativeOptionsSet((prev) => new Set(prev).add(option));
|
|
23937
24098
|
}, []),
|
|
23938
|
-
onNativeOptionRemove:
|
|
24099
|
+
onNativeOptionRemove: React362.useCallback((option) => {
|
|
23939
24100
|
setNativeOptionsSet((prev) => {
|
|
23940
24101
|
const optionsSet = new Set(prev);
|
|
23941
24102
|
optionsSet.delete(option);
|
|
@@ -23963,7 +24124,7 @@ var Select = (props) => {
|
|
|
23963
24124
|
};
|
|
23964
24125
|
Select.displayName = SELECT_NAME;
|
|
23965
24126
|
var TRIGGER_NAME = "SelectTrigger";
|
|
23966
|
-
var SelectTrigger =
|
|
24127
|
+
var SelectTrigger = React362.forwardRef((props, forwardedRef) => {
|
|
23967
24128
|
const { __scopeSelect, disabled = false, ...triggerProps } = props;
|
|
23968
24129
|
const popperScope = usePopperScope(__scopeSelect);
|
|
23969
24130
|
const context = useSelectContext(TRIGGER_NAME, __scopeSelect);
|
|
@@ -24031,7 +24192,7 @@ var SelectTrigger = React36.forwardRef((props, forwardedRef) => {
|
|
|
24031
24192
|
});
|
|
24032
24193
|
SelectTrigger.displayName = TRIGGER_NAME;
|
|
24033
24194
|
var VALUE_NAME = "SelectValue";
|
|
24034
|
-
var SelectValue =
|
|
24195
|
+
var SelectValue = React362.forwardRef((props, forwardedRef) => {
|
|
24035
24196
|
const { __scopeSelect, className, style, children, placeholder = "", ...valueProps } = props;
|
|
24036
24197
|
const context = useSelectContext(VALUE_NAME, __scopeSelect);
|
|
24037
24198
|
const { onValueNodeHasChildrenChange } = context;
|
|
@@ -24049,7 +24210,7 @@ var SelectValue = React36.forwardRef((props, forwardedRef) => {
|
|
|
24049
24210
|
});
|
|
24050
24211
|
SelectValue.displayName = VALUE_NAME;
|
|
24051
24212
|
var ICON_NAME = "SelectIcon";
|
|
24052
|
-
var SelectIcon =
|
|
24213
|
+
var SelectIcon = React362.forwardRef((props, forwardedRef) => {
|
|
24053
24214
|
const { __scopeSelect, children, ...iconProps } = props;
|
|
24054
24215
|
return /* @__PURE__ */ jsx242(Primitive.span, { "aria-hidden": true, ...iconProps, ref: forwardedRef, children: children || "▼" });
|
|
24055
24216
|
});
|
|
@@ -24060,9 +24221,9 @@ var SelectPortal = (props) => {
|
|
|
24060
24221
|
};
|
|
24061
24222
|
SelectPortal.displayName = PORTAL_NAME2;
|
|
24062
24223
|
var CONTENT_NAME2 = "SelectContent";
|
|
24063
|
-
var SelectContent =
|
|
24224
|
+
var SelectContent = React362.forwardRef((props, forwardedRef) => {
|
|
24064
24225
|
const context = useSelectContext(CONTENT_NAME2, props.__scopeSelect);
|
|
24065
|
-
const [fragment, setFragment] =
|
|
24226
|
+
const [fragment, setFragment] = React362.useState();
|
|
24066
24227
|
useLayoutEffect22(() => {
|
|
24067
24228
|
setFragment(new DocumentFragment);
|
|
24068
24229
|
}, []);
|
|
@@ -24076,7 +24237,7 @@ SelectContent.displayName = CONTENT_NAME2;
|
|
|
24076
24237
|
var CONTENT_MARGIN = 10;
|
|
24077
24238
|
var [SelectContentProvider, useSelectContentContext] = createSelectContext(CONTENT_NAME2);
|
|
24078
24239
|
var CONTENT_IMPL_NAME = "SelectContentImpl";
|
|
24079
|
-
var SelectContentImpl =
|
|
24240
|
+
var SelectContentImpl = React362.forwardRef((props, forwardedRef) => {
|
|
24080
24241
|
const {
|
|
24081
24242
|
__scopeSelect,
|
|
24082
24243
|
position = "item-aligned",
|
|
@@ -24096,20 +24257,20 @@ var SelectContentImpl = React36.forwardRef((props, forwardedRef) => {
|
|
|
24096
24257
|
...contentProps
|
|
24097
24258
|
} = props;
|
|
24098
24259
|
const context = useSelectContext(CONTENT_NAME2, __scopeSelect);
|
|
24099
|
-
const [content, setContent] =
|
|
24100
|
-
const [viewport, setViewport] =
|
|
24260
|
+
const [content, setContent] = React362.useState(null);
|
|
24261
|
+
const [viewport, setViewport] = React362.useState(null);
|
|
24101
24262
|
const composedRefs = useComposedRefs2(forwardedRef, (node) => setContent(node));
|
|
24102
|
-
const [selectedItem, setSelectedItem] =
|
|
24103
|
-
const [selectedItemText, setSelectedItemText] =
|
|
24263
|
+
const [selectedItem, setSelectedItem] = React362.useState(null);
|
|
24264
|
+
const [selectedItemText, setSelectedItemText] = React362.useState(null);
|
|
24104
24265
|
const getItems = useCollection(__scopeSelect);
|
|
24105
|
-
const [isPositioned, setIsPositioned] =
|
|
24106
|
-
const firstValidItemFoundRef =
|
|
24107
|
-
|
|
24266
|
+
const [isPositioned, setIsPositioned] = React362.useState(false);
|
|
24267
|
+
const firstValidItemFoundRef = React362.useRef(false);
|
|
24268
|
+
React362.useEffect(() => {
|
|
24108
24269
|
if (content)
|
|
24109
24270
|
return hideOthers(content);
|
|
24110
24271
|
}, [content]);
|
|
24111
24272
|
useFocusGuards();
|
|
24112
|
-
const focusFirst2 =
|
|
24273
|
+
const focusFirst2 = React362.useCallback((candidates) => {
|
|
24113
24274
|
const [firstItem, ...restItems] = getItems().map((item) => item.ref.current);
|
|
24114
24275
|
const [lastItem] = restItems.slice(-1);
|
|
24115
24276
|
const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;
|
|
@@ -24126,14 +24287,14 @@ var SelectContentImpl = React36.forwardRef((props, forwardedRef) => {
|
|
|
24126
24287
|
return;
|
|
24127
24288
|
}
|
|
24128
24289
|
}, [getItems, viewport]);
|
|
24129
|
-
const focusSelectedItem =
|
|
24130
|
-
|
|
24290
|
+
const focusSelectedItem = React362.useCallback(() => focusFirst2([selectedItem, content]), [focusFirst2, selectedItem, content]);
|
|
24291
|
+
React362.useEffect(() => {
|
|
24131
24292
|
if (isPositioned) {
|
|
24132
24293
|
focusSelectedItem();
|
|
24133
24294
|
}
|
|
24134
24295
|
}, [isPositioned, focusSelectedItem]);
|
|
24135
24296
|
const { onOpenChange, triggerPointerDownPosRef } = context;
|
|
24136
|
-
|
|
24297
|
+
React362.useEffect(() => {
|
|
24137
24298
|
if (content) {
|
|
24138
24299
|
let pointerMoveDelta = { x: 0, y: 0 };
|
|
24139
24300
|
const handlePointerMove = (event) => {
|
|
@@ -24163,7 +24324,7 @@ var SelectContentImpl = React36.forwardRef((props, forwardedRef) => {
|
|
|
24163
24324
|
};
|
|
24164
24325
|
}
|
|
24165
24326
|
}, [content, onOpenChange, triggerPointerDownPosRef]);
|
|
24166
|
-
|
|
24327
|
+
React362.useEffect(() => {
|
|
24167
24328
|
const close = () => onOpenChange(false);
|
|
24168
24329
|
window.addEventListener("blur", close);
|
|
24169
24330
|
window.addEventListener("resize", close);
|
|
@@ -24180,7 +24341,7 @@ var SelectContentImpl = React36.forwardRef((props, forwardedRef) => {
|
|
|
24180
24341
|
setTimeout(() => nextItem.ref.current.focus());
|
|
24181
24342
|
}
|
|
24182
24343
|
});
|
|
24183
|
-
const itemRefCallback =
|
|
24344
|
+
const itemRefCallback = React362.useCallback((node, value, disabled) => {
|
|
24184
24345
|
const isFirstValidItem = !firstValidItemFoundRef.current && !disabled;
|
|
24185
24346
|
const isSelectedItem = context.value !== undefined && context.value === value;
|
|
24186
24347
|
if (isSelectedItem || isFirstValidItem) {
|
|
@@ -24189,8 +24350,8 @@ var SelectContentImpl = React36.forwardRef((props, forwardedRef) => {
|
|
|
24189
24350
|
firstValidItemFoundRef.current = true;
|
|
24190
24351
|
}
|
|
24191
24352
|
}, [context.value]);
|
|
24192
|
-
const handleItemLeave =
|
|
24193
|
-
const itemTextRefCallback =
|
|
24353
|
+
const handleItemLeave = React362.useCallback(() => content?.focus(), [content]);
|
|
24354
|
+
const itemTextRefCallback = React362.useCallback((node, value, disabled) => {
|
|
24194
24355
|
const isFirstValidItem = !firstValidItemFoundRef.current && !disabled;
|
|
24195
24356
|
const isSelectedItem = context.value !== undefined && context.value === value;
|
|
24196
24357
|
if (isSelectedItem || isFirstValidItem) {
|
|
@@ -24285,18 +24446,18 @@ var SelectContentImpl = React36.forwardRef((props, forwardedRef) => {
|
|
|
24285
24446
|
});
|
|
24286
24447
|
SelectContentImpl.displayName = CONTENT_IMPL_NAME;
|
|
24287
24448
|
var ITEM_ALIGNED_POSITION_NAME = "SelectItemAlignedPosition";
|
|
24288
|
-
var SelectItemAlignedPosition =
|
|
24449
|
+
var SelectItemAlignedPosition = React362.forwardRef((props, forwardedRef) => {
|
|
24289
24450
|
const { __scopeSelect, onPlaced, ...popperProps } = props;
|
|
24290
24451
|
const context = useSelectContext(CONTENT_NAME2, __scopeSelect);
|
|
24291
24452
|
const contentContext = useSelectContentContext(CONTENT_NAME2, __scopeSelect);
|
|
24292
|
-
const [contentWrapper, setContentWrapper] =
|
|
24293
|
-
const [content, setContent] =
|
|
24453
|
+
const [contentWrapper, setContentWrapper] = React362.useState(null);
|
|
24454
|
+
const [content, setContent] = React362.useState(null);
|
|
24294
24455
|
const composedRefs = useComposedRefs2(forwardedRef, (node) => setContent(node));
|
|
24295
24456
|
const getItems = useCollection(__scopeSelect);
|
|
24296
|
-
const shouldExpandOnScrollRef =
|
|
24297
|
-
const shouldRepositionRef =
|
|
24457
|
+
const shouldExpandOnScrollRef = React362.useRef(false);
|
|
24458
|
+
const shouldRepositionRef = React362.useRef(true);
|
|
24298
24459
|
const { viewport, selectedItem, selectedItemText, focusSelectedItem } = contentContext;
|
|
24299
|
-
const position =
|
|
24460
|
+
const position = React362.useCallback(() => {
|
|
24300
24461
|
if (context.trigger && context.valueNode && contentWrapper && content && viewport && selectedItem && selectedItemText) {
|
|
24301
24462
|
const triggerRect = context.trigger.getBoundingClientRect();
|
|
24302
24463
|
const contentRect = content.getBoundingClientRect();
|
|
@@ -24377,12 +24538,12 @@ var SelectItemAlignedPosition = React36.forwardRef((props, forwardedRef) => {
|
|
|
24377
24538
|
onPlaced
|
|
24378
24539
|
]);
|
|
24379
24540
|
useLayoutEffect22(() => position(), [position]);
|
|
24380
|
-
const [contentZIndex, setContentZIndex] =
|
|
24541
|
+
const [contentZIndex, setContentZIndex] = React362.useState();
|
|
24381
24542
|
useLayoutEffect22(() => {
|
|
24382
24543
|
if (content)
|
|
24383
24544
|
setContentZIndex(window.getComputedStyle(content).zIndex);
|
|
24384
24545
|
}, [content]);
|
|
24385
|
-
const handleScrollButtonChange =
|
|
24546
|
+
const handleScrollButtonChange = React362.useCallback((node) => {
|
|
24386
24547
|
if (node && shouldRepositionRef.current === true) {
|
|
24387
24548
|
position();
|
|
24388
24549
|
focusSelectedItem?.();
|
|
@@ -24416,7 +24577,7 @@ var SelectItemAlignedPosition = React36.forwardRef((props, forwardedRef) => {
|
|
|
24416
24577
|
});
|
|
24417
24578
|
SelectItemAlignedPosition.displayName = ITEM_ALIGNED_POSITION_NAME;
|
|
24418
24579
|
var POPPER_POSITION_NAME = "SelectPopperPosition";
|
|
24419
|
-
var SelectPopperPosition =
|
|
24580
|
+
var SelectPopperPosition = React362.forwardRef((props, forwardedRef) => {
|
|
24420
24581
|
const {
|
|
24421
24582
|
__scopeSelect,
|
|
24422
24583
|
align = "start",
|
|
@@ -24446,12 +24607,12 @@ var SelectPopperPosition = React36.forwardRef((props, forwardedRef) => {
|
|
|
24446
24607
|
SelectPopperPosition.displayName = POPPER_POSITION_NAME;
|
|
24447
24608
|
var [SelectViewportProvider, useSelectViewportContext] = createSelectContext(CONTENT_NAME2, {});
|
|
24448
24609
|
var VIEWPORT_NAME = "SelectViewport";
|
|
24449
|
-
var SelectViewport =
|
|
24610
|
+
var SelectViewport = React362.forwardRef((props, forwardedRef) => {
|
|
24450
24611
|
const { __scopeSelect, nonce, ...viewportProps } = props;
|
|
24451
24612
|
const contentContext = useSelectContentContext(VIEWPORT_NAME, __scopeSelect);
|
|
24452
24613
|
const viewportContext = useSelectViewportContext(VIEWPORT_NAME, __scopeSelect);
|
|
24453
24614
|
const composedRefs = useComposedRefs2(forwardedRef, contentContext.onViewportChange);
|
|
24454
|
-
const prevScrollTopRef =
|
|
24615
|
+
const prevScrollTopRef = React362.useRef(0);
|
|
24455
24616
|
return /* @__PURE__ */ jsxs42(Fragment8, { children: [
|
|
24456
24617
|
/* @__PURE__ */ jsx242("style", {
|
|
24457
24618
|
dangerouslySetInnerHTML: {
|
|
@@ -24500,14 +24661,14 @@ var SelectViewport = React36.forwardRef((props, forwardedRef) => {
|
|
|
24500
24661
|
SelectViewport.displayName = VIEWPORT_NAME;
|
|
24501
24662
|
var GROUP_NAME = "SelectGroup";
|
|
24502
24663
|
var [SelectGroupContextProvider, useSelectGroupContext] = createSelectContext(GROUP_NAME);
|
|
24503
|
-
var SelectGroup =
|
|
24664
|
+
var SelectGroup = React362.forwardRef((props, forwardedRef) => {
|
|
24504
24665
|
const { __scopeSelect, ...groupProps } = props;
|
|
24505
24666
|
const groupId = useId();
|
|
24506
24667
|
return /* @__PURE__ */ jsx242(SelectGroupContextProvider, { scope: __scopeSelect, id: groupId, children: /* @__PURE__ */ jsx242(Primitive.div, { role: "group", "aria-labelledby": groupId, ...groupProps, ref: forwardedRef }) });
|
|
24507
24668
|
});
|
|
24508
24669
|
SelectGroup.displayName = GROUP_NAME;
|
|
24509
24670
|
var LABEL_NAME = "SelectLabel";
|
|
24510
|
-
var SelectLabel =
|
|
24671
|
+
var SelectLabel = React362.forwardRef((props, forwardedRef) => {
|
|
24511
24672
|
const { __scopeSelect, ...labelProps } = props;
|
|
24512
24673
|
const groupContext = useSelectGroupContext(LABEL_NAME, __scopeSelect);
|
|
24513
24674
|
return /* @__PURE__ */ jsx242(Primitive.div, { id: groupContext.id, ...labelProps, ref: forwardedRef });
|
|
@@ -24515,7 +24676,7 @@ var SelectLabel = React36.forwardRef((props, forwardedRef) => {
|
|
|
24515
24676
|
SelectLabel.displayName = LABEL_NAME;
|
|
24516
24677
|
var ITEM_NAME = "SelectItem";
|
|
24517
24678
|
var [SelectItemContextProvider, useSelectItemContext] = createSelectContext(ITEM_NAME);
|
|
24518
|
-
var SelectItem =
|
|
24679
|
+
var SelectItem = React362.forwardRef((props, forwardedRef) => {
|
|
24519
24680
|
const {
|
|
24520
24681
|
__scopeSelect,
|
|
24521
24682
|
value,
|
|
@@ -24526,8 +24687,8 @@ var SelectItem = React36.forwardRef((props, forwardedRef) => {
|
|
|
24526
24687
|
const context = useSelectContext(ITEM_NAME, __scopeSelect);
|
|
24527
24688
|
const contentContext = useSelectContentContext(ITEM_NAME, __scopeSelect);
|
|
24528
24689
|
const isSelected = context.value === value;
|
|
24529
|
-
const [textValue, setTextValue] =
|
|
24530
|
-
const [isFocused, setIsFocused] =
|
|
24690
|
+
const [textValue, setTextValue] = React362.useState(textValueProp ?? "");
|
|
24691
|
+
const [isFocused, setIsFocused] = React362.useState(false);
|
|
24531
24692
|
const composedRefs = useComposedRefs2(forwardedRef, (node) => contentContext.itemRefCallback?.(node, value, disabled));
|
|
24532
24693
|
const textId = useId();
|
|
24533
24694
|
const handleSelect = () => {
|
|
@@ -24545,7 +24706,7 @@ var SelectItem = React36.forwardRef((props, forwardedRef) => {
|
|
|
24545
24706
|
disabled,
|
|
24546
24707
|
textId,
|
|
24547
24708
|
isSelected,
|
|
24548
|
-
onItemTextChange:
|
|
24709
|
+
onItemTextChange: React362.useCallback((node) => {
|
|
24549
24710
|
setTextValue((prevTextValue) => prevTextValue || (node?.textContent ?? "").trim());
|
|
24550
24711
|
}, []),
|
|
24551
24712
|
children: /* @__PURE__ */ jsx242(Collection.ItemSlot, {
|
|
@@ -24594,16 +24755,16 @@ var SelectItem = React36.forwardRef((props, forwardedRef) => {
|
|
|
24594
24755
|
});
|
|
24595
24756
|
SelectItem.displayName = ITEM_NAME;
|
|
24596
24757
|
var ITEM_TEXT_NAME = "SelectItemText";
|
|
24597
|
-
var SelectItemText =
|
|
24758
|
+
var SelectItemText = React362.forwardRef((props, forwardedRef) => {
|
|
24598
24759
|
const { __scopeSelect, className, style, ...itemTextProps } = props;
|
|
24599
24760
|
const context = useSelectContext(ITEM_TEXT_NAME, __scopeSelect);
|
|
24600
24761
|
const contentContext = useSelectContentContext(ITEM_TEXT_NAME, __scopeSelect);
|
|
24601
24762
|
const itemContext = useSelectItemContext(ITEM_TEXT_NAME, __scopeSelect);
|
|
24602
24763
|
const nativeOptionsContext = useSelectNativeOptionsContext(ITEM_TEXT_NAME, __scopeSelect);
|
|
24603
|
-
const [itemTextNode, setItemTextNode] =
|
|
24764
|
+
const [itemTextNode, setItemTextNode] = React362.useState(null);
|
|
24604
24765
|
const composedRefs = useComposedRefs2(forwardedRef, (node) => setItemTextNode(node), itemContext.onItemTextChange, (node) => contentContext.itemTextRefCallback?.(node, itemContext.value, itemContext.disabled));
|
|
24605
24766
|
const textContent = itemTextNode?.textContent;
|
|
24606
|
-
const nativeOption =
|
|
24767
|
+
const nativeOption = React362.useMemo(() => /* @__PURE__ */ jsx242("option", { value: itemContext.value, disabled: itemContext.disabled, children: textContent }, itemContext.value), [itemContext.disabled, itemContext.value, textContent]);
|
|
24607
24768
|
const { onNativeOptionAdd, onNativeOptionRemove } = nativeOptionsContext;
|
|
24608
24769
|
useLayoutEffect22(() => {
|
|
24609
24770
|
onNativeOptionAdd(nativeOption);
|
|
@@ -24616,17 +24777,17 @@ var SelectItemText = React36.forwardRef((props, forwardedRef) => {
|
|
|
24616
24777
|
});
|
|
24617
24778
|
SelectItemText.displayName = ITEM_TEXT_NAME;
|
|
24618
24779
|
var ITEM_INDICATOR_NAME = "SelectItemIndicator";
|
|
24619
|
-
var SelectItemIndicator =
|
|
24780
|
+
var SelectItemIndicator = React362.forwardRef((props, forwardedRef) => {
|
|
24620
24781
|
const { __scopeSelect, ...itemIndicatorProps } = props;
|
|
24621
24782
|
const itemContext = useSelectItemContext(ITEM_INDICATOR_NAME, __scopeSelect);
|
|
24622
24783
|
return itemContext.isSelected ? /* @__PURE__ */ jsx242(Primitive.span, { "aria-hidden": true, ...itemIndicatorProps, ref: forwardedRef }) : null;
|
|
24623
24784
|
});
|
|
24624
24785
|
SelectItemIndicator.displayName = ITEM_INDICATOR_NAME;
|
|
24625
24786
|
var SCROLL_UP_BUTTON_NAME = "SelectScrollUpButton";
|
|
24626
|
-
var SelectScrollUpButton =
|
|
24787
|
+
var SelectScrollUpButton = React362.forwardRef((props, forwardedRef) => {
|
|
24627
24788
|
const contentContext = useSelectContentContext(SCROLL_UP_BUTTON_NAME, props.__scopeSelect);
|
|
24628
24789
|
const viewportContext = useSelectViewportContext(SCROLL_UP_BUTTON_NAME, props.__scopeSelect);
|
|
24629
|
-
const [canScrollUp, setCanScrollUp] =
|
|
24790
|
+
const [canScrollUp, setCanScrollUp] = React362.useState(false);
|
|
24630
24791
|
const composedRefs = useComposedRefs2(forwardedRef, viewportContext.onScrollButtonChange);
|
|
24631
24792
|
useLayoutEffect22(() => {
|
|
24632
24793
|
if (contentContext.viewport && contentContext.isPositioned) {
|
|
@@ -24654,10 +24815,10 @@ var SelectScrollUpButton = React36.forwardRef((props, forwardedRef) => {
|
|
|
24654
24815
|
});
|
|
24655
24816
|
SelectScrollUpButton.displayName = SCROLL_UP_BUTTON_NAME;
|
|
24656
24817
|
var SCROLL_DOWN_BUTTON_NAME = "SelectScrollDownButton";
|
|
24657
|
-
var SelectScrollDownButton =
|
|
24818
|
+
var SelectScrollDownButton = React362.forwardRef((props, forwardedRef) => {
|
|
24658
24819
|
const contentContext = useSelectContentContext(SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect);
|
|
24659
24820
|
const viewportContext = useSelectViewportContext(SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect);
|
|
24660
|
-
const [canScrollDown, setCanScrollDown] =
|
|
24821
|
+
const [canScrollDown, setCanScrollDown] = React362.useState(false);
|
|
24661
24822
|
const composedRefs = useComposedRefs2(forwardedRef, viewportContext.onScrollButtonChange);
|
|
24662
24823
|
useLayoutEffect22(() => {
|
|
24663
24824
|
if (contentContext.viewport && contentContext.isPositioned) {
|
|
@@ -24685,18 +24846,18 @@ var SelectScrollDownButton = React36.forwardRef((props, forwardedRef) => {
|
|
|
24685
24846
|
}) : null;
|
|
24686
24847
|
});
|
|
24687
24848
|
SelectScrollDownButton.displayName = SCROLL_DOWN_BUTTON_NAME;
|
|
24688
|
-
var SelectScrollButtonImpl =
|
|
24849
|
+
var SelectScrollButtonImpl = React362.forwardRef((props, forwardedRef) => {
|
|
24689
24850
|
const { __scopeSelect, onAutoScroll, ...scrollIndicatorProps } = props;
|
|
24690
24851
|
const contentContext = useSelectContentContext("SelectScrollButton", __scopeSelect);
|
|
24691
|
-
const autoScrollTimerRef =
|
|
24852
|
+
const autoScrollTimerRef = React362.useRef(null);
|
|
24692
24853
|
const getItems = useCollection(__scopeSelect);
|
|
24693
|
-
const clearAutoScrollTimer =
|
|
24854
|
+
const clearAutoScrollTimer = React362.useCallback(() => {
|
|
24694
24855
|
if (autoScrollTimerRef.current !== null) {
|
|
24695
24856
|
window.clearInterval(autoScrollTimerRef.current);
|
|
24696
24857
|
autoScrollTimerRef.current = null;
|
|
24697
24858
|
}
|
|
24698
24859
|
}, []);
|
|
24699
|
-
|
|
24860
|
+
React362.useEffect(() => {
|
|
24700
24861
|
return () => clearAutoScrollTimer();
|
|
24701
24862
|
}, [clearAutoScrollTimer]);
|
|
24702
24863
|
useLayoutEffect22(() => {
|
|
@@ -24725,13 +24886,13 @@ var SelectScrollButtonImpl = React36.forwardRef((props, forwardedRef) => {
|
|
|
24725
24886
|
});
|
|
24726
24887
|
});
|
|
24727
24888
|
var SEPARATOR_NAME = "SelectSeparator";
|
|
24728
|
-
var SelectSeparator =
|
|
24889
|
+
var SelectSeparator = React362.forwardRef((props, forwardedRef) => {
|
|
24729
24890
|
const { __scopeSelect, ...separatorProps } = props;
|
|
24730
24891
|
return /* @__PURE__ */ jsx242(Primitive.div, { "aria-hidden": true, ...separatorProps, ref: forwardedRef });
|
|
24731
24892
|
});
|
|
24732
24893
|
SelectSeparator.displayName = SEPARATOR_NAME;
|
|
24733
24894
|
var ARROW_NAME2 = "SelectArrow";
|
|
24734
|
-
var SelectArrow =
|
|
24895
|
+
var SelectArrow = React362.forwardRef((props, forwardedRef) => {
|
|
24735
24896
|
const { __scopeSelect, ...arrowProps } = props;
|
|
24736
24897
|
const popperScope = usePopperScope(__scopeSelect);
|
|
24737
24898
|
const context = useSelectContext(ARROW_NAME2, __scopeSelect);
|
|
@@ -24742,12 +24903,12 @@ SelectArrow.displayName = ARROW_NAME2;
|
|
|
24742
24903
|
function shouldShowPlaceholder(value) {
|
|
24743
24904
|
return value === "" || value === undefined;
|
|
24744
24905
|
}
|
|
24745
|
-
var BubbleSelect =
|
|
24906
|
+
var BubbleSelect = React362.forwardRef((props, forwardedRef) => {
|
|
24746
24907
|
const { value, ...selectProps } = props;
|
|
24747
|
-
const ref =
|
|
24908
|
+
const ref = React362.useRef(null);
|
|
24748
24909
|
const composedRefs = useComposedRefs2(forwardedRef, ref);
|
|
24749
24910
|
const prevValue = usePrevious(value);
|
|
24750
|
-
|
|
24911
|
+
React362.useEffect(() => {
|
|
24751
24912
|
const select = ref.current;
|
|
24752
24913
|
const selectProto = window.HTMLSelectElement.prototype;
|
|
24753
24914
|
const descriptor = Object.getOwnPropertyDescriptor(selectProto, "value");
|
|
@@ -24763,9 +24924,9 @@ var BubbleSelect = React36.forwardRef((props, forwardedRef) => {
|
|
|
24763
24924
|
BubbleSelect.displayName = "BubbleSelect";
|
|
24764
24925
|
function useTypeaheadSearch(onSearchChange) {
|
|
24765
24926
|
const handleSearchChange = useCallbackRef(onSearchChange);
|
|
24766
|
-
const searchRef =
|
|
24767
|
-
const timerRef =
|
|
24768
|
-
const handleTypeaheadSearch =
|
|
24927
|
+
const searchRef = React362.useRef("");
|
|
24928
|
+
const timerRef = React362.useRef(0);
|
|
24929
|
+
const handleTypeaheadSearch = React362.useCallback((key) => {
|
|
24769
24930
|
const search = searchRef.current + key;
|
|
24770
24931
|
handleSearchChange(search);
|
|
24771
24932
|
(function updateSearch(value) {
|
|
@@ -24775,11 +24936,11 @@ function useTypeaheadSearch(onSearchChange) {
|
|
|
24775
24936
|
timerRef.current = window.setTimeout(() => updateSearch(""), 1000);
|
|
24776
24937
|
})(search);
|
|
24777
24938
|
}, [handleSearchChange]);
|
|
24778
|
-
const resetTypeahead =
|
|
24939
|
+
const resetTypeahead = React362.useCallback(() => {
|
|
24779
24940
|
searchRef.current = "";
|
|
24780
24941
|
window.clearTimeout(timerRef.current);
|
|
24781
24942
|
}, []);
|
|
24782
|
-
|
|
24943
|
+
React362.useEffect(() => {
|
|
24783
24944
|
return () => window.clearTimeout(timerRef.current);
|
|
24784
24945
|
}, []);
|
|
24785
24946
|
return [searchRef, handleTypeaheadSearch, resetTypeahead];
|
|
@@ -24868,7 +25029,7 @@ var ChevronDown = createLucideIcon("ChevronDown", [
|
|
|
24868
25029
|
var ChevronUp = createLucideIcon("ChevronUp", [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]]);
|
|
24869
25030
|
var Select2 = Root222;
|
|
24870
25031
|
var SelectValue2 = Value;
|
|
24871
|
-
var SelectTrigger2 =
|
|
25032
|
+
var SelectTrigger2 = React37.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs52(Trigger, {
|
|
24872
25033
|
ref,
|
|
24873
25034
|
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),
|
|
24874
25035
|
...props,
|
|
@@ -24883,7 +25044,7 @@ var SelectTrigger2 = React372.forwardRef(({ className, children, ...props }, ref
|
|
|
24883
25044
|
]
|
|
24884
25045
|
}));
|
|
24885
25046
|
SelectTrigger2.displayName = Trigger.displayName;
|
|
24886
|
-
var SelectScrollUpButton2 =
|
|
25047
|
+
var SelectScrollUpButton2 = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx252(ScrollUpButton, {
|
|
24887
25048
|
ref,
|
|
24888
25049
|
className: cn("flex cursor-default items-center justify-center py-1", className),
|
|
24889
25050
|
...props,
|
|
@@ -24892,7 +25053,7 @@ var SelectScrollUpButton2 = React372.forwardRef(({ className, ...props }, ref) =
|
|
|
24892
25053
|
})
|
|
24893
25054
|
}));
|
|
24894
25055
|
SelectScrollUpButton2.displayName = ScrollUpButton.displayName;
|
|
24895
|
-
var SelectScrollDownButton2 =
|
|
25056
|
+
var SelectScrollDownButton2 = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx252(ScrollDownButton, {
|
|
24896
25057
|
ref,
|
|
24897
25058
|
className: cn("flex cursor-default items-center justify-center py-1", className),
|
|
24898
25059
|
...props,
|
|
@@ -24901,7 +25062,7 @@ var SelectScrollDownButton2 = React372.forwardRef(({ className, ...props }, ref)
|
|
|
24901
25062
|
})
|
|
24902
25063
|
}));
|
|
24903
25064
|
SelectScrollDownButton2.displayName = ScrollDownButton.displayName;
|
|
24904
|
-
var SelectContent2 =
|
|
25065
|
+
var SelectContent2 = React37.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsx252(Portal2, {
|
|
24905
25066
|
children: /* @__PURE__ */ jsxs52(Content2, {
|
|
24906
25067
|
ref,
|
|
24907
25068
|
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),
|
|
@@ -24918,13 +25079,13 @@ var SelectContent2 = React372.forwardRef(({ className, children, position = "pop
|
|
|
24918
25079
|
})
|
|
24919
25080
|
}));
|
|
24920
25081
|
SelectContent2.displayName = Content2.displayName;
|
|
24921
|
-
var SelectLabel2 =
|
|
25082
|
+
var SelectLabel2 = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx252(Label, {
|
|
24922
25083
|
ref,
|
|
24923
25084
|
className: cn("py-1.5 pl-8 pr-2 text-sm font-semibold", className),
|
|
24924
25085
|
...props
|
|
24925
25086
|
}));
|
|
24926
25087
|
SelectLabel2.displayName = Label.displayName;
|
|
24927
|
-
var SelectItem2 =
|
|
25088
|
+
var SelectItem2 = React37.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs52(Item, {
|
|
24928
25089
|
ref,
|
|
24929
25090
|
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),
|
|
24930
25091
|
...props,
|
|
@@ -24943,7 +25104,7 @@ var SelectItem2 = React372.forwardRef(({ className, children, ...props }, ref) =
|
|
|
24943
25104
|
]
|
|
24944
25105
|
}));
|
|
24945
25106
|
SelectItem2.displayName = Item.displayName;
|
|
24946
|
-
var SelectSeparator2 =
|
|
25107
|
+
var SelectSeparator2 = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx252(Separator, {
|
|
24947
25108
|
ref,
|
|
24948
25109
|
className: cn("-mx-1 my-1 h-px bg-muted", className),
|
|
24949
25110
|
...props
|
|
@@ -24976,19 +25137,19 @@ function composeEventHandlers2(originalEventHandler, ourEventHandler, { checkFor
|
|
|
24976
25137
|
function createContextScope2(scopeName, createContextScopeDeps = []) {
|
|
24977
25138
|
let defaultContexts = [];
|
|
24978
25139
|
function createContext32(rootComponentName, defaultContext) {
|
|
24979
|
-
const BaseContext =
|
|
25140
|
+
const BaseContext = React382.createContext(defaultContext);
|
|
24980
25141
|
const index2 = defaultContexts.length;
|
|
24981
25142
|
defaultContexts = [...defaultContexts, defaultContext];
|
|
24982
25143
|
const Provider = (props) => {
|
|
24983
25144
|
const { scope, children, ...context } = props;
|
|
24984
25145
|
const Context = scope?.[scopeName]?.[index2] || BaseContext;
|
|
24985
|
-
const value =
|
|
25146
|
+
const value = React382.useMemo(() => context, Object.values(context));
|
|
24986
25147
|
return /* @__PURE__ */ jsx272(Context.Provider, { value, children });
|
|
24987
25148
|
};
|
|
24988
25149
|
Provider.displayName = rootComponentName + "Provider";
|
|
24989
25150
|
function useContext222(consumerName, scope) {
|
|
24990
25151
|
const Context = scope?.[scopeName]?.[index2] || BaseContext;
|
|
24991
|
-
const context =
|
|
25152
|
+
const context = React382.useContext(Context);
|
|
24992
25153
|
if (context)
|
|
24993
25154
|
return context;
|
|
24994
25155
|
if (defaultContext !== undefined)
|
|
@@ -24999,11 +25160,11 @@ function createContextScope2(scopeName, createContextScopeDeps = []) {
|
|
|
24999
25160
|
}
|
|
25000
25161
|
const createScope = () => {
|
|
25001
25162
|
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
25002
|
-
return
|
|
25163
|
+
return React382.createContext(defaultContext);
|
|
25003
25164
|
});
|
|
25004
25165
|
return function useScope(scope) {
|
|
25005
25166
|
const contexts = scope?.[scopeName] || scopeContexts;
|
|
25006
|
-
return
|
|
25167
|
+
return React382.useMemo(() => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }), [scope, contexts]);
|
|
25007
25168
|
};
|
|
25008
25169
|
};
|
|
25009
25170
|
createScope.scopeName = scopeName;
|
|
@@ -25024,7 +25185,7 @@ function composeContextScopes2(...scopes) {
|
|
|
25024
25185
|
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
25025
25186
|
return { ...nextScopes2, ...currentScope };
|
|
25026
25187
|
}, {});
|
|
25027
|
-
return
|
|
25188
|
+
return React382.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
25028
25189
|
};
|
|
25029
25190
|
};
|
|
25030
25191
|
createScope.scopeName = baseScope.scopeName;
|
|
@@ -25032,22 +25193,22 @@ function composeContextScopes2(...scopes) {
|
|
|
25032
25193
|
}
|
|
25033
25194
|
function createSlot2(ownerName) {
|
|
25034
25195
|
const SlotClone2 = /* @__PURE__ */ createSlotClone2(ownerName);
|
|
25035
|
-
const Slot22 =
|
|
25196
|
+
const Slot22 = React39.forwardRef((props, forwardedRef) => {
|
|
25036
25197
|
const { children, ...slotProps } = props;
|
|
25037
|
-
const childrenArray =
|
|
25198
|
+
const childrenArray = React39.Children.toArray(children);
|
|
25038
25199
|
const slottable = childrenArray.find(isSlottable3);
|
|
25039
25200
|
if (slottable) {
|
|
25040
25201
|
const newElement = slottable.props.children;
|
|
25041
25202
|
const newChildren = childrenArray.map((child) => {
|
|
25042
25203
|
if (child === slottable) {
|
|
25043
|
-
if (
|
|
25044
|
-
return
|
|
25045
|
-
return
|
|
25204
|
+
if (React39.Children.count(newElement) > 1)
|
|
25205
|
+
return React39.Children.only(null);
|
|
25206
|
+
return React39.isValidElement(newElement) ? newElement.props.children : null;
|
|
25046
25207
|
} else {
|
|
25047
25208
|
return child;
|
|
25048
25209
|
}
|
|
25049
25210
|
});
|
|
25050
|
-
return /* @__PURE__ */ jsx282(SlotClone2, { ...slotProps, ref: forwardedRef, children:
|
|
25211
|
+
return /* @__PURE__ */ jsx282(SlotClone2, { ...slotProps, ref: forwardedRef, children: React39.isValidElement(newElement) ? React39.cloneElement(newElement, undefined, newChildren) : null });
|
|
25051
25212
|
}
|
|
25052
25213
|
return /* @__PURE__ */ jsx282(SlotClone2, { ...slotProps, ref: forwardedRef, children });
|
|
25053
25214
|
});
|
|
@@ -25055,24 +25216,24 @@ function createSlot2(ownerName) {
|
|
|
25055
25216
|
return Slot22;
|
|
25056
25217
|
}
|
|
25057
25218
|
function createSlotClone2(ownerName) {
|
|
25058
|
-
const SlotClone2 =
|
|
25219
|
+
const SlotClone2 = React39.forwardRef((props, forwardedRef) => {
|
|
25059
25220
|
const { children, ...slotProps } = props;
|
|
25060
|
-
if (
|
|
25221
|
+
if (React39.isValidElement(children)) {
|
|
25061
25222
|
const childrenRef = getElementRef3(children);
|
|
25062
25223
|
const props2 = mergeProps3(slotProps, children.props);
|
|
25063
|
-
if (children.type !==
|
|
25224
|
+
if (children.type !== React39.Fragment) {
|
|
25064
25225
|
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
25065
25226
|
}
|
|
25066
|
-
return
|
|
25227
|
+
return React39.cloneElement(children, props2);
|
|
25067
25228
|
}
|
|
25068
|
-
return
|
|
25229
|
+
return React39.Children.count(children) > 1 ? React39.Children.only(null) : null;
|
|
25069
25230
|
});
|
|
25070
25231
|
SlotClone2.displayName = `${ownerName}.SlotClone`;
|
|
25071
25232
|
return SlotClone2;
|
|
25072
25233
|
}
|
|
25073
25234
|
var SLOTTABLE_IDENTIFIER2 = Symbol("radix.slottable");
|
|
25074
25235
|
function isSlottable3(child) {
|
|
25075
|
-
return
|
|
25236
|
+
return React39.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER2;
|
|
25076
25237
|
}
|
|
25077
25238
|
function mergeProps3(slotProps, childProps) {
|
|
25078
25239
|
const overrideProps = { ...childProps };
|
|
@@ -25466,7 +25627,7 @@ function toSafeIndex(array, index2) {
|
|
|
25466
25627
|
function toSafeInteger(number) {
|
|
25467
25628
|
return number !== number || number === 0 ? 0 : Math.trunc(number);
|
|
25468
25629
|
}
|
|
25469
|
-
var useLayoutEffect222 = globalThis?.document ?
|
|
25630
|
+
var useLayoutEffect222 = globalThis?.document ? React412.useLayoutEffect : () => {};
|
|
25470
25631
|
var useReactId2 = React422[" useId ".trim().toString()] || (() => {
|
|
25471
25632
|
return;
|
|
25472
25633
|
});
|
|
@@ -25500,7 +25661,7 @@ var NODES2 = [
|
|
|
25500
25661
|
];
|
|
25501
25662
|
var Primitive2 = NODES2.reduce((primitive, node) => {
|
|
25502
25663
|
const Slot3 = createSlot2(`Primitive.${node}`);
|
|
25503
|
-
const Node2 =
|
|
25664
|
+
const Node2 = React432.forwardRef((props, forwardedRef) => {
|
|
25504
25665
|
const { asChild, ...primitiveProps } = props;
|
|
25505
25666
|
const Comp = asChild ? Slot3 : node;
|
|
25506
25667
|
if (typeof window !== "undefined") {
|