node_modules ignore

This commit is contained in:
2025-05-08 23:43:47 +02:00
parent e19d52f172
commit 4574544c9f
65041 changed files with 10593536 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
import React from "react";
import { Slot } from "@radix-ui/react-slot";
import * as Radix from "@radix-ui/react-primitive";
type SlotProps = Radix.ComponentPropsWithoutRef<typeof Slot>;
export interface CollectionProps extends SlotProps {
scope: any;
}
export function createCollection<ItemElement extends HTMLElement, ItemData = {}>(name: string): readonly [{
readonly Provider: React.FC<{
children?: React.ReactNode;
scope: any;
}>;
readonly Slot: React.ForwardRefExoticComponent<CollectionProps & React.RefAttributes<HTMLElement>>;
readonly ItemSlot: React.ForwardRefExoticComponent<React.PropsWithoutRef<ItemData & {
children: React.ReactNode;
scope: any;
}> & React.RefAttributes<ItemElement>>;
}, (scope: any) => () => ({
ref: React.RefObject<ItemElement>;
} & ItemData)[], import("@radix-ui/react-context").CreateScope];
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,22 @@
import React from "react";
import { Slot } from "@radix-ui/react-slot";
import * as Radix from "@radix-ui/react-primitive";
type SlotProps = Radix.ComponentPropsWithoutRef<typeof Slot>;
export interface CollectionProps extends SlotProps {
scope: any;
}
export function createCollection<ItemElement extends HTMLElement, ItemData = {}>(name: string): readonly [{
readonly Provider: React.FC<{
children?: React.ReactNode;
scope: any;
}>;
readonly Slot: React.ForwardRefExoticComponent<CollectionProps & React.RefAttributes<HTMLElement>>;
readonly ItemSlot: React.ForwardRefExoticComponent<React.PropsWithoutRef<ItemData & {
children: React.ReactNode;
scope: any;
}> & React.RefAttributes<ItemElement>>;
}, (scope: any) => () => ({
ref: React.RefObject<ItemElement>;
} & ItemData)[], import("@radix-ui/react-context").CreateScope];
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1 @@
{"mappings":";;;AAOA,iBAAiB,MAAM,wBAAwB,CAAC,WAAW,CAAC,CAAC;AAE7D,gCAA0B,SAAQ,SAAS;IACzC,KAAK,EAAE,GAAG,CAAC;CACZ;AAOD,iCAA0B,WAAW,SAAS,WAAW,EAAE,QAAQ,GAAG,EAAE,EAAE,IAAI,EAAE,MAAM;;mBAkBpC,MAAM,SAAS;eAAS,GAAG;;;;kBAsC/D,MAAM,SAAS;eAClB,GAAG;;WA6BkB,GAAG;SA5EmB,MAAM,SAAS,CAAC,WAAW,CAAC;kFAkGjF","sources":["packages/react/collection/src/packages/react/collection/src/Collection.tsx","packages/react/collection/src/packages/react/collection/src/index.ts","packages/react/collection/src/index.ts"],"sourcesContent":[null,null,"export { createCollection } from './Collection';\nexport type { CollectionProps } from './Collection';\n"],"names":[],"version":3,"file":"index.d.ts.map"}

View File

@@ -0,0 +1,117 @@
var $hnlpS$react = require("react");
var $hnlpS$radixuireactcontext = require("@radix-ui/react-context");
var $hnlpS$radixuireactcomposerefs = require("@radix-ui/react-compose-refs");
var $hnlpS$radixuireactslot = require("@radix-ui/react-slot");
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
function $parcel$interopDefault(a) {
return a && a.__esModule ? a.default : a;
}
$parcel$export(module.exports, "createCollection", () => $1a96635ec239608b$export$c74125a8e3af6bb2);
// We have resorted to returning slots directly rather than exposing primitives that can then
// be slotted like `<CollectionItem as={Slot}>…</CollectionItem>`.
// This is because we encountered issues with generic types that cannot be statically analysed
// due to creating them dynamically via createCollection.
function $1a96635ec239608b$export$c74125a8e3af6bb2(name) {
/* -----------------------------------------------------------------------------------------------
* CollectionProvider
* ---------------------------------------------------------------------------------------------*/ const PROVIDER_NAME = name + 'CollectionProvider';
const [createCollectionContext, createCollectionScope] = $hnlpS$radixuireactcontext.createContextScope(PROVIDER_NAME);
const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(PROVIDER_NAME, {
collectionRef: {
current: null
},
itemMap: new Map()
});
const CollectionProvider = (props)=>{
const { scope: scope , children: children } = props;
const ref = ($parcel$interopDefault($hnlpS$react)).useRef(null);
const itemMap = ($parcel$interopDefault($hnlpS$react)).useRef(new Map()).current;
return /*#__PURE__*/ ($parcel$interopDefault($hnlpS$react)).createElement(CollectionProviderImpl, {
scope: scope,
itemMap: itemMap,
collectionRef: ref
}, children);
};
/*#__PURE__*/ Object.assign(CollectionProvider, {
displayName: PROVIDER_NAME
});
/* -----------------------------------------------------------------------------------------------
* CollectionSlot
* ---------------------------------------------------------------------------------------------*/ const COLLECTION_SLOT_NAME = name + 'CollectionSlot';
const CollectionSlot = /*#__PURE__*/ ($parcel$interopDefault($hnlpS$react)).forwardRef((props, forwardedRef)=>{
const { scope: scope , children: children } = props;
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
const composedRefs = $hnlpS$radixuireactcomposerefs.useComposedRefs(forwardedRef, context.collectionRef);
return /*#__PURE__*/ ($parcel$interopDefault($hnlpS$react)).createElement($hnlpS$radixuireactslot.Slot, {
ref: composedRefs
}, children);
});
/*#__PURE__*/ Object.assign(CollectionSlot, {
displayName: COLLECTION_SLOT_NAME
});
/* -----------------------------------------------------------------------------------------------
* CollectionItem
* ---------------------------------------------------------------------------------------------*/ const ITEM_SLOT_NAME = name + 'CollectionItemSlot';
const ITEM_DATA_ATTR = 'data-radix-collection-item';
const CollectionItemSlot = /*#__PURE__*/ ($parcel$interopDefault($hnlpS$react)).forwardRef((props, forwardedRef)=>{
const { scope: scope , children: children , ...itemData } = props;
const ref = ($parcel$interopDefault($hnlpS$react)).useRef(null);
const composedRefs = $hnlpS$radixuireactcomposerefs.useComposedRefs(forwardedRef, ref);
const context = useCollectionContext(ITEM_SLOT_NAME, scope);
($parcel$interopDefault($hnlpS$react)).useEffect(()=>{
context.itemMap.set(ref, {
ref: ref,
...itemData
});
return ()=>void context.itemMap.delete(ref)
;
});
return /*#__PURE__*/ ($parcel$interopDefault($hnlpS$react)).createElement($hnlpS$radixuireactslot.Slot, {
[ITEM_DATA_ATTR]: '',
ref: composedRefs
}, children);
});
/*#__PURE__*/ Object.assign(CollectionItemSlot, {
displayName: ITEM_SLOT_NAME
});
/* -----------------------------------------------------------------------------------------------
* useCollection
* ---------------------------------------------------------------------------------------------*/ function useCollection(scope) {
const context = useCollectionContext(name + 'CollectionConsumer', scope);
const getItems = ($parcel$interopDefault($hnlpS$react)).useCallback(()=>{
const collectionNode = context.collectionRef.current;
if (!collectionNode) return [];
const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));
const items = Array.from(context.itemMap.values());
const orderedItems = items.sort((a, b)=>orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current)
);
return orderedItems;
}, [
context.collectionRef,
context.itemMap
]);
return getItems;
}
return [
{
Provider: CollectionProvider,
Slot: CollectionSlot,
ItemSlot: CollectionItemSlot
},
useCollection,
createCollectionScope
];
}
//# sourceMappingURL=index.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,110 @@
import $6vYhU$react from "react";
import {createContextScope as $6vYhU$createContextScope} from "@radix-ui/react-context";
import {useComposedRefs as $6vYhU$useComposedRefs} from "@radix-ui/react-compose-refs";
import {Slot as $6vYhU$Slot} from "@radix-ui/react-slot";
// We have resorted to returning slots directly rather than exposing primitives that can then
// be slotted like `<CollectionItem as={Slot}>…</CollectionItem>`.
// This is because we encountered issues with generic types that cannot be statically analysed
// due to creating them dynamically via createCollection.
function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2(name) {
/* -----------------------------------------------------------------------------------------------
* CollectionProvider
* ---------------------------------------------------------------------------------------------*/ const PROVIDER_NAME = name + 'CollectionProvider';
const [createCollectionContext, createCollectionScope] = $6vYhU$createContextScope(PROVIDER_NAME);
const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(PROVIDER_NAME, {
collectionRef: {
current: null
},
itemMap: new Map()
});
const CollectionProvider = (props)=>{
const { scope: scope , children: children } = props;
const ref = $6vYhU$react.useRef(null);
const itemMap = $6vYhU$react.useRef(new Map()).current;
return /*#__PURE__*/ $6vYhU$react.createElement(CollectionProviderImpl, {
scope: scope,
itemMap: itemMap,
collectionRef: ref
}, children);
};
/*#__PURE__*/ Object.assign(CollectionProvider, {
displayName: PROVIDER_NAME
});
/* -----------------------------------------------------------------------------------------------
* CollectionSlot
* ---------------------------------------------------------------------------------------------*/ const COLLECTION_SLOT_NAME = name + 'CollectionSlot';
const CollectionSlot = /*#__PURE__*/ $6vYhU$react.forwardRef((props, forwardedRef)=>{
const { scope: scope , children: children } = props;
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
const composedRefs = $6vYhU$useComposedRefs(forwardedRef, context.collectionRef);
return /*#__PURE__*/ $6vYhU$react.createElement($6vYhU$Slot, {
ref: composedRefs
}, children);
});
/*#__PURE__*/ Object.assign(CollectionSlot, {
displayName: COLLECTION_SLOT_NAME
});
/* -----------------------------------------------------------------------------------------------
* CollectionItem
* ---------------------------------------------------------------------------------------------*/ const ITEM_SLOT_NAME = name + 'CollectionItemSlot';
const ITEM_DATA_ATTR = 'data-radix-collection-item';
const CollectionItemSlot = /*#__PURE__*/ $6vYhU$react.forwardRef((props, forwardedRef)=>{
const { scope: scope , children: children , ...itemData } = props;
const ref = $6vYhU$react.useRef(null);
const composedRefs = $6vYhU$useComposedRefs(forwardedRef, ref);
const context = useCollectionContext(ITEM_SLOT_NAME, scope);
$6vYhU$react.useEffect(()=>{
context.itemMap.set(ref, {
ref: ref,
...itemData
});
return ()=>void context.itemMap.delete(ref)
;
});
return /*#__PURE__*/ $6vYhU$react.createElement($6vYhU$Slot, {
[ITEM_DATA_ATTR]: '',
ref: composedRefs
}, children);
});
/*#__PURE__*/ Object.assign(CollectionItemSlot, {
displayName: ITEM_SLOT_NAME
});
/* -----------------------------------------------------------------------------------------------
* useCollection
* ---------------------------------------------------------------------------------------------*/ function useCollection(scope) {
const context = useCollectionContext(name + 'CollectionConsumer', scope);
const getItems = $6vYhU$react.useCallback(()=>{
const collectionNode = context.collectionRef.current;
if (!collectionNode) return [];
const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));
const items = Array.from(context.itemMap.values());
const orderedItems = items.sort((a, b)=>orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current)
);
return orderedItems;
}, [
context.collectionRef,
context.itemMap
]);
return getItems;
}
return [
{
Provider: CollectionProvider,
Slot: CollectionSlot,
ItemSlot: CollectionItemSlot
},
useCollection,
createCollectionScope
];
}
export {$e02a7d9cb1dc128c$export$c74125a8e3af6bb2 as createCollection};
//# sourceMappingURL=index.mjs.map

File diff suppressed because one or more lines are too long