@radix-ui/react-collection 1.0.3 → 1.1.0-rc.2
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/index.d.mts +28 -15
- package/dist/index.d.ts +28 -15
- package/dist/index.js +91 -108
- package/dist/index.js.map +7 -1
- package/dist/index.mjs +68 -106
- package/dist/index.mjs.map +7 -1
- package/package.json +7 -7
- package/dist/index.d.ts.map +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,22 +1,35 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
4
|
+
import * as Radix from '@radix-ui/react-primitive';
|
|
5
|
+
|
|
6
|
+
declare type Scope<C = any> = {
|
|
7
|
+
[scopeName: string]: React.Context<C>[];
|
|
8
|
+
} | undefined;
|
|
9
|
+
declare type ScopeHook = (scope: Scope) => {
|
|
10
|
+
[__scopeProp: string]: Scope;
|
|
11
|
+
};
|
|
12
|
+
interface CreateScope {
|
|
13
|
+
scopeName: string;
|
|
14
|
+
(): ScopeHook;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
declare type SlotProps = Radix.ComponentPropsWithoutRef<typeof Slot>;
|
|
18
|
+
interface CollectionProps extends SlotProps {
|
|
6
19
|
scope: any;
|
|
7
20
|
}
|
|
8
|
-
|
|
9
|
-
readonly Provider:
|
|
10
|
-
children?:
|
|
21
|
+
declare function createCollection<ItemElement extends HTMLElement, ItemData = {}>(name: string): readonly [{
|
|
22
|
+
readonly Provider: React__default.FC<{
|
|
23
|
+
children?: React__default.ReactNode;
|
|
11
24
|
scope: any;
|
|
12
25
|
}>;
|
|
13
|
-
readonly Slot:
|
|
14
|
-
readonly ItemSlot:
|
|
15
|
-
children:
|
|
26
|
+
readonly Slot: React__default.ForwardRefExoticComponent<CollectionProps & React__default.RefAttributes<HTMLElement>>;
|
|
27
|
+
readonly ItemSlot: React__default.ForwardRefExoticComponent<React__default.PropsWithoutRef<ItemData & {
|
|
28
|
+
children: React__default.ReactNode;
|
|
16
29
|
scope: any;
|
|
17
|
-
}> &
|
|
30
|
+
}> & React__default.RefAttributes<ItemElement>>;
|
|
18
31
|
}, (scope: any) => () => ({
|
|
19
|
-
ref:
|
|
20
|
-
} & ItemData)[],
|
|
32
|
+
ref: React__default.RefObject<ItemElement>;
|
|
33
|
+
} & ItemData)[], CreateScope];
|
|
21
34
|
|
|
22
|
-
|
|
35
|
+
export { type CollectionProps, createCollection };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,22 +1,35 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
4
|
+
import * as Radix from '@radix-ui/react-primitive';
|
|
5
|
+
|
|
6
|
+
declare type Scope<C = any> = {
|
|
7
|
+
[scopeName: string]: React.Context<C>[];
|
|
8
|
+
} | undefined;
|
|
9
|
+
declare type ScopeHook = (scope: Scope) => {
|
|
10
|
+
[__scopeProp: string]: Scope;
|
|
11
|
+
};
|
|
12
|
+
interface CreateScope {
|
|
13
|
+
scopeName: string;
|
|
14
|
+
(): ScopeHook;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
declare type SlotProps = Radix.ComponentPropsWithoutRef<typeof Slot>;
|
|
18
|
+
interface CollectionProps extends SlotProps {
|
|
6
19
|
scope: any;
|
|
7
20
|
}
|
|
8
|
-
|
|
9
|
-
readonly Provider:
|
|
10
|
-
children?:
|
|
21
|
+
declare function createCollection<ItemElement extends HTMLElement, ItemData = {}>(name: string): readonly [{
|
|
22
|
+
readonly Provider: React__default.FC<{
|
|
23
|
+
children?: React__default.ReactNode;
|
|
11
24
|
scope: any;
|
|
12
25
|
}>;
|
|
13
|
-
readonly Slot:
|
|
14
|
-
readonly ItemSlot:
|
|
15
|
-
children:
|
|
26
|
+
readonly Slot: React__default.ForwardRefExoticComponent<CollectionProps & React__default.RefAttributes<HTMLElement>>;
|
|
27
|
+
readonly ItemSlot: React__default.ForwardRefExoticComponent<React__default.PropsWithoutRef<ItemData & {
|
|
28
|
+
children: React__default.ReactNode;
|
|
16
29
|
scope: any;
|
|
17
|
-
}> &
|
|
30
|
+
}> & React__default.RefAttributes<ItemElement>>;
|
|
18
31
|
}, (scope: any) => () => ({
|
|
19
|
-
ref:
|
|
20
|
-
} & ItemData)[],
|
|
32
|
+
ref: React__default.RefObject<ItemElement>;
|
|
33
|
+
} & ItemData)[], CreateScope];
|
|
21
34
|
|
|
22
|
-
|
|
35
|
+
export { type CollectionProps, createCollection };
|
package/dist/index.js
CHANGED
|
@@ -1,117 +1,100 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
(() => {
|
|
4
|
+
var __create = Object.create;
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
11
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
12
|
+
}) : x)(function(x) {
|
|
13
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
14
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
15
|
+
});
|
|
16
|
+
var __copyProps = (to, from, except, desc) => {
|
|
17
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
18
|
+
for (let key of __getOwnPropNames(from))
|
|
19
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
20
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
21
|
+
}
|
|
22
|
+
return to;
|
|
23
|
+
};
|
|
24
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
25
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
26
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
27
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
28
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
29
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
30
|
+
mod
|
|
31
|
+
));
|
|
17
32
|
|
|
18
|
-
//
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const [createCollectionContext, createCollectionScope] =
|
|
27
|
-
const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const itemMap = ($parcel$interopDefault($hnlpS$react)).useRef(new Map()).current;
|
|
37
|
-
return /*#__PURE__*/ ($parcel$interopDefault($hnlpS$react)).createElement(CollectionProviderImpl, {
|
|
38
|
-
scope: scope,
|
|
39
|
-
itemMap: itemMap,
|
|
40
|
-
collectionRef: ref
|
|
41
|
-
}, children);
|
|
33
|
+
// packages/react/collection/src/Collection.tsx
|
|
34
|
+
var import_react = __toESM(__require("react"));
|
|
35
|
+
var import_react_context = __require("@radix-ui/react-context");
|
|
36
|
+
var import_react_compose_refs = __require("@radix-ui/react-compose-refs");
|
|
37
|
+
var import_react_slot = __require("@radix-ui/react-slot");
|
|
38
|
+
var import_jsx_runtime = __require("react/jsx-runtime");
|
|
39
|
+
function createCollection(name) {
|
|
40
|
+
const PROVIDER_NAME = name + "CollectionProvider";
|
|
41
|
+
const [createCollectionContext, createCollectionScope] = (0, import_react_context.createContextScope)(PROVIDER_NAME);
|
|
42
|
+
const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(
|
|
43
|
+
PROVIDER_NAME,
|
|
44
|
+
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
|
45
|
+
);
|
|
46
|
+
const CollectionProvider = (props) => {
|
|
47
|
+
const { scope, children } = props;
|
|
48
|
+
const ref = import_react.default.useRef(null);
|
|
49
|
+
const itemMap = import_react.default.useRef(/* @__PURE__ */ new Map()).current;
|
|
50
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });
|
|
42
51
|
};
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
* ---------------------------------------------------------------------------------------------*/ const COLLECTION_SLOT_NAME = name + 'CollectionSlot';
|
|
49
|
-
const CollectionSlot = /*#__PURE__*/ ($parcel$interopDefault($hnlpS$react)).forwardRef((props, forwardedRef)=>{
|
|
50
|
-
const { scope: scope , children: children } = props;
|
|
52
|
+
CollectionProvider.displayName = PROVIDER_NAME;
|
|
53
|
+
const COLLECTION_SLOT_NAME = name + "CollectionSlot";
|
|
54
|
+
const CollectionSlot = import_react.default.forwardRef(
|
|
55
|
+
(props, forwardedRef) => {
|
|
56
|
+
const { scope, children } = props;
|
|
51
57
|
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
|
52
|
-
const composedRefs =
|
|
53
|
-
return
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
const CollectionItemSlot = /*#__PURE__*/ ($parcel$interopDefault($hnlpS$react)).forwardRef((props, forwardedRef)=>{
|
|
65
|
-
const { scope: scope , children: children , ...itemData } = props;
|
|
66
|
-
const ref = ($parcel$interopDefault($hnlpS$react)).useRef(null);
|
|
67
|
-
const composedRefs = $hnlpS$radixuireactcomposerefs.useComposedRefs(forwardedRef, ref);
|
|
58
|
+
const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, context.collectionRef);
|
|
59
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_slot.Slot, { ref: composedRefs, children });
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
CollectionSlot.displayName = COLLECTION_SLOT_NAME;
|
|
63
|
+
const ITEM_SLOT_NAME = name + "CollectionItemSlot";
|
|
64
|
+
const ITEM_DATA_ATTR = "data-radix-collection-item";
|
|
65
|
+
const CollectionItemSlot = import_react.default.forwardRef(
|
|
66
|
+
(props, forwardedRef) => {
|
|
67
|
+
const { scope, children, ...itemData } = props;
|
|
68
|
+
const ref = import_react.default.useRef(null);
|
|
69
|
+
const composedRefs = (0, import_react_compose_refs.useComposedRefs)(forwardedRef, ref);
|
|
68
70
|
const context = useCollectionContext(ITEM_SLOT_NAME, scope);
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
...itemData
|
|
73
|
-
});
|
|
74
|
-
return ()=>void context.itemMap.delete(ref)
|
|
75
|
-
;
|
|
71
|
+
import_react.default.useEffect(() => {
|
|
72
|
+
context.itemMap.set(ref, { ref, ...itemData });
|
|
73
|
+
return () => void context.itemMap.delete(ref);
|
|
76
74
|
});
|
|
77
|
-
return
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
const orderedItems = items.sort((a, b)=>orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current)
|
|
95
|
-
);
|
|
96
|
-
return orderedItems;
|
|
97
|
-
}, [
|
|
98
|
-
context.collectionRef,
|
|
99
|
-
context.itemMap
|
|
100
|
-
]);
|
|
101
|
-
return getItems;
|
|
75
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_slot.Slot, { ...{ [ITEM_DATA_ATTR]: "" }, ref: composedRefs, children });
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
CollectionItemSlot.displayName = ITEM_SLOT_NAME;
|
|
79
|
+
function useCollection(scope) {
|
|
80
|
+
const context = useCollectionContext(name + "CollectionConsumer", scope);
|
|
81
|
+
const getItems = import_react.default.useCallback(() => {
|
|
82
|
+
const collectionNode = context.collectionRef.current;
|
|
83
|
+
if (!collectionNode) return [];
|
|
84
|
+
const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));
|
|
85
|
+
const items = Array.from(context.itemMap.values());
|
|
86
|
+
const orderedItems = items.sort(
|
|
87
|
+
(a, b) => orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current)
|
|
88
|
+
);
|
|
89
|
+
return orderedItems;
|
|
90
|
+
}, [context.collectionRef, context.itemMap]);
|
|
91
|
+
return getItems;
|
|
102
92
|
}
|
|
103
93
|
return [
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
ItemSlot: CollectionItemSlot
|
|
108
|
-
},
|
|
109
|
-
useCollection,
|
|
110
|
-
createCollectionScope
|
|
94
|
+
{ Provider: CollectionProvider, Slot: CollectionSlot, ItemSlot: CollectionItemSlot },
|
|
95
|
+
useCollection,
|
|
96
|
+
createCollectionScope
|
|
111
97
|
];
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
98
|
+
}
|
|
99
|
+
})();
|
|
117
100
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/Collection.tsx"],
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { Slot } from '@radix-ui/react-slot';\n\nimport type * as Radix from '@radix-ui/react-primitive';\n\ntype SlotProps = Radix.ComponentPropsWithoutRef<typeof Slot>;\ntype CollectionElement = HTMLElement;\ninterface CollectionProps extends SlotProps {\n scope: any;\n}\n\n// We have resorted to returning slots directly rather than exposing primitives that can then\n// be slotted like `<CollectionItem as={Slot}>\u2026</CollectionItem>`.\n// This is because we encountered issues with generic types that cannot be statically analysed\n// due to creating them dynamically via createCollection.\n\nfunction createCollection<ItemElement extends HTMLElement, ItemData = {}>(name: string) {\n /* -----------------------------------------------------------------------------------------------\n * CollectionProvider\n * ---------------------------------------------------------------------------------------------*/\n\n const PROVIDER_NAME = name + 'CollectionProvider';\n const [createCollectionContext, createCollectionScope] = createContextScope(PROVIDER_NAME);\n\n type ContextValue = {\n collectionRef: React.RefObject<CollectionElement>;\n itemMap: Map<React.RefObject<ItemElement>, { ref: React.RefObject<ItemElement> } & ItemData>;\n };\n\n const [CollectionProviderImpl, useCollectionContext] = createCollectionContext<ContextValue>(\n PROVIDER_NAME,\n { collectionRef: { current: null }, itemMap: new Map() }\n );\n\n const CollectionProvider: React.FC<{ children?: React.ReactNode; scope: any }> = (props) => {\n const { scope, children } = props;\n const ref = React.useRef<CollectionElement>(null);\n const itemMap = React.useRef<ContextValue['itemMap']>(new Map()).current;\n return (\n <CollectionProviderImpl scope={scope} itemMap={itemMap} collectionRef={ref}>\n {children}\n </CollectionProviderImpl>\n );\n };\n\n CollectionProvider.displayName = PROVIDER_NAME;\n\n /* -----------------------------------------------------------------------------------------------\n * CollectionSlot\n * ---------------------------------------------------------------------------------------------*/\n\n const COLLECTION_SLOT_NAME = name + 'CollectionSlot';\n\n const CollectionSlot = React.forwardRef<CollectionElement, CollectionProps>(\n (props, forwardedRef) => {\n const { scope, children } = props;\n const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);\n const composedRefs = useComposedRefs(forwardedRef, context.collectionRef);\n return <Slot ref={composedRefs}>{children}</Slot>;\n }\n );\n\n CollectionSlot.displayName = COLLECTION_SLOT_NAME;\n\n /* -----------------------------------------------------------------------------------------------\n * CollectionItem\n * ---------------------------------------------------------------------------------------------*/\n\n const ITEM_SLOT_NAME = name + 'CollectionItemSlot';\n const ITEM_DATA_ATTR = 'data-radix-collection-item';\n\n type CollectionItemSlotProps = ItemData & {\n children: React.ReactNode;\n scope: any;\n };\n\n const CollectionItemSlot = React.forwardRef<ItemElement, CollectionItemSlotProps>(\n (props, forwardedRef) => {\n const { scope, children, ...itemData } = props;\n const ref = React.useRef<ItemElement>(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const context = useCollectionContext(ITEM_SLOT_NAME, scope);\n\n React.useEffect(() => {\n context.itemMap.set(ref, { ref, ...(itemData as unknown as ItemData) });\n return () => void context.itemMap.delete(ref);\n });\n\n return (\n <Slot {...{ [ITEM_DATA_ATTR]: '' }} ref={composedRefs}>\n {children}\n </Slot>\n );\n }\n );\n\n CollectionItemSlot.displayName = ITEM_SLOT_NAME;\n\n /* -----------------------------------------------------------------------------------------------\n * useCollection\n * ---------------------------------------------------------------------------------------------*/\n\n function useCollection(scope: any) {\n const context = useCollectionContext(name + 'CollectionConsumer', scope);\n\n const getItems = React.useCallback(() => {\n const collectionNode = context.collectionRef.current;\n if (!collectionNode) return [];\n const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));\n const items = Array.from(context.itemMap.values());\n const orderedItems = items.sort(\n (a, b) => orderedNodes.indexOf(a.ref.current!) - orderedNodes.indexOf(b.ref.current!)\n );\n return orderedItems;\n }, [context.collectionRef, context.itemMap]);\n\n return getItems;\n }\n\n return [\n { Provider: CollectionProvider, Slot: CollectionSlot, ItemSlot: CollectionItemSlot },\n useCollection,\n createCollectionScope,\n ] as const;\n}\n\nexport { createCollection };\nexport type { CollectionProps };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qBAAkB;AAClB,6BAAmC;AACnC,kCAAgC;AAChC,0BAAqB;AAsCf;AAvBN,WAAS,iBAAiE,MAAc;AAKtF,UAAM,gBAAgB,OAAO;AAC7B,UAAM,CAAC,yBAAyB,qBAAqB,QAAI,yCAAmB,aAAa;AAOzF,UAAM,CAAC,wBAAwB,oBAAoB,IAAI;AAAA,MACrD;AAAA,MACA,EAAE,eAAe,EAAE,SAAS,KAAK,GAAG,SAAS,oBAAI,IAAI,EAAE;AAAA,IACzD;AAEA,UAAM,qBAA2E,CAAC,UAAU;AAC1F,YAAM,EAAE,OAAO,SAAS,IAAI;AAC5B,YAAM,MAAM,aAAAA,QAAM,OAA0B,IAAI;AAChD,YAAM,UAAU,aAAAA,QAAM,OAAgC,oBAAI,IAAI,CAAC,EAAE;AACjE,aACE,4CAAC,0BAAuB,OAAc,SAAkB,eAAe,KACpE,UACH;AAAA,IAEJ;AAEA,uBAAmB,cAAc;AAMjC,UAAM,uBAAuB,OAAO;AAEpC,UAAM,iBAAiB,aAAAA,QAAM;AAAA,MAC3B,CAAC,OAAO,iBAAiB;AACvB,cAAM,EAAE,OAAO,SAAS,IAAI;AAC5B,cAAM,UAAU,qBAAqB,sBAAsB,KAAK;AAChE,cAAM,mBAAe,2CAAgB,cAAc,QAAQ,aAAa;AACxE,eAAO,4CAAC,0BAAK,KAAK,cAAe,UAAS;AAAA,MAC5C;AAAA,IACF;AAEA,mBAAe,cAAc;AAM7B,UAAM,iBAAiB,OAAO;AAC9B,UAAM,iBAAiB;AAOvB,UAAM,qBAAqB,aAAAA,QAAM;AAAA,MAC/B,CAAC,OAAO,iBAAiB;AACvB,cAAM,EAAE,OAAO,UAAU,GAAG,SAAS,IAAI;AACzC,cAAM,MAAM,aAAAA,QAAM,OAAoB,IAAI;AAC1C,cAAM,mBAAe,2CAAgB,cAAc,GAAG;AACtD,cAAM,UAAU,qBAAqB,gBAAgB,KAAK;AAE1D,qBAAAA,QAAM,UAAU,MAAM;AACpB,kBAAQ,QAAQ,IAAI,KAAK,EAAE,KAAK,GAAI,SAAiC,CAAC;AACtE,iBAAO,MAAM,KAAK,QAAQ,QAAQ,OAAO,GAAG;AAAA,QAC9C,CAAC;AAED,eACE,4CAAC,0BAAM,GAAG,EAAE,CAAC,cAAc,GAAG,GAAG,GAAG,KAAK,cACtC,UACH;AAAA,MAEJ;AAAA,IACF;AAEA,uBAAmB,cAAc;AAMjC,aAAS,cAAc,OAAY;AACjC,YAAM,UAAU,qBAAqB,OAAO,sBAAsB,KAAK;AAEvE,YAAM,WAAW,aAAAA,QAAM,YAAY,MAAM;AACvC,cAAM,iBAAiB,QAAQ,cAAc;AAC7C,YAAI,CAAC,eAAgB,QAAO,CAAC;AAC7B,cAAM,eAAe,MAAM,KAAK,eAAe,iBAAiB,IAAI,cAAc,GAAG,CAAC;AACtF,cAAM,QAAQ,MAAM,KAAK,QAAQ,QAAQ,OAAO,CAAC;AACjD,cAAM,eAAe,MAAM;AAAA,UACzB,CAAC,GAAG,MAAM,aAAa,QAAQ,EAAE,IAAI,OAAQ,IAAI,aAAa,QAAQ,EAAE,IAAI,OAAQ;AAAA,QACtF;AACA,eAAO;AAAA,MACT,GAAG,CAAC,QAAQ,eAAe,QAAQ,OAAO,CAAC;AAE3C,aAAO;AAAA,IACT;AAEA,WAAO;AAAA,MACL,EAAE,UAAU,oBAAoB,MAAM,gBAAgB,UAAU,mBAAmB;AAAA,MACnF;AAAA,MACA;AAAA,IACF;AAAA,EACF;",
|
|
6
|
+
"names": ["React"]
|
|
7
|
+
}
|
package/dist/index.mjs
CHANGED
|
@@ -1,110 +1,72 @@
|
|
|
1
|
-
|
|
2
|
-
import {createContextScope as $6vYhU$createContextScope} from "@radix-ui/react-context";
|
|
3
|
-
import {useComposedRefs as $6vYhU$useComposedRefs} from "@radix-ui/react-compose-refs";
|
|
4
|
-
import {Slot as $6vYhU$Slot} from "@radix-ui/react-slot";
|
|
1
|
+
"use client";
|
|
5
2
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
/*#__PURE__*/ Object.assign(CollectionSlot, {
|
|
50
|
-
displayName: COLLECTION_SLOT_NAME
|
|
51
|
-
});
|
|
52
|
-
/* -----------------------------------------------------------------------------------------------
|
|
53
|
-
* CollectionItem
|
|
54
|
-
* ---------------------------------------------------------------------------------------------*/ const ITEM_SLOT_NAME = name + 'CollectionItemSlot';
|
|
55
|
-
const ITEM_DATA_ATTR = 'data-radix-collection-item';
|
|
56
|
-
const CollectionItemSlot = /*#__PURE__*/ $6vYhU$react.forwardRef((props, forwardedRef)=>{
|
|
57
|
-
const { scope: scope , children: children , ...itemData } = props;
|
|
58
|
-
const ref = $6vYhU$react.useRef(null);
|
|
59
|
-
const composedRefs = $6vYhU$useComposedRefs(forwardedRef, ref);
|
|
60
|
-
const context = useCollectionContext(ITEM_SLOT_NAME, scope);
|
|
61
|
-
$6vYhU$react.useEffect(()=>{
|
|
62
|
-
context.itemMap.set(ref, {
|
|
63
|
-
ref: ref,
|
|
64
|
-
...itemData
|
|
65
|
-
});
|
|
66
|
-
return ()=>void context.itemMap.delete(ref)
|
|
67
|
-
;
|
|
68
|
-
});
|
|
69
|
-
return /*#__PURE__*/ $6vYhU$react.createElement($6vYhU$Slot, {
|
|
70
|
-
[ITEM_DATA_ATTR]: '',
|
|
71
|
-
ref: composedRefs
|
|
72
|
-
}, children);
|
|
73
|
-
});
|
|
74
|
-
/*#__PURE__*/ Object.assign(CollectionItemSlot, {
|
|
75
|
-
displayName: ITEM_SLOT_NAME
|
|
76
|
-
});
|
|
77
|
-
/* -----------------------------------------------------------------------------------------------
|
|
78
|
-
* useCollection
|
|
79
|
-
* ---------------------------------------------------------------------------------------------*/ function useCollection(scope) {
|
|
80
|
-
const context = useCollectionContext(name + 'CollectionConsumer', scope);
|
|
81
|
-
const getItems = $6vYhU$react.useCallback(()=>{
|
|
82
|
-
const collectionNode = context.collectionRef.current;
|
|
83
|
-
if (!collectionNode) return [];
|
|
84
|
-
const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));
|
|
85
|
-
const items = Array.from(context.itemMap.values());
|
|
86
|
-
const orderedItems = items.sort((a, b)=>orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current)
|
|
87
|
-
);
|
|
88
|
-
return orderedItems;
|
|
89
|
-
}, [
|
|
90
|
-
context.collectionRef,
|
|
91
|
-
context.itemMap
|
|
92
|
-
]);
|
|
93
|
-
return getItems;
|
|
3
|
+
// packages/react/collection/src/Collection.tsx
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { createContextScope } from "@radix-ui/react-context";
|
|
6
|
+
import { useComposedRefs } from "@radix-ui/react-compose-refs";
|
|
7
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
function createCollection(name) {
|
|
10
|
+
const PROVIDER_NAME = name + "CollectionProvider";
|
|
11
|
+
const [createCollectionContext, createCollectionScope] = createContextScope(PROVIDER_NAME);
|
|
12
|
+
const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(
|
|
13
|
+
PROVIDER_NAME,
|
|
14
|
+
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
|
15
|
+
);
|
|
16
|
+
const CollectionProvider = (props) => {
|
|
17
|
+
const { scope, children } = props;
|
|
18
|
+
const ref = React.useRef(null);
|
|
19
|
+
const itemMap = React.useRef(/* @__PURE__ */ new Map()).current;
|
|
20
|
+
return /* @__PURE__ */ jsx(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });
|
|
21
|
+
};
|
|
22
|
+
CollectionProvider.displayName = PROVIDER_NAME;
|
|
23
|
+
const COLLECTION_SLOT_NAME = name + "CollectionSlot";
|
|
24
|
+
const CollectionSlot = React.forwardRef(
|
|
25
|
+
(props, forwardedRef) => {
|
|
26
|
+
const { scope, children } = props;
|
|
27
|
+
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
|
28
|
+
const composedRefs = useComposedRefs(forwardedRef, context.collectionRef);
|
|
29
|
+
return /* @__PURE__ */ jsx(Slot, { ref: composedRefs, children });
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
CollectionSlot.displayName = COLLECTION_SLOT_NAME;
|
|
33
|
+
const ITEM_SLOT_NAME = name + "CollectionItemSlot";
|
|
34
|
+
const ITEM_DATA_ATTR = "data-radix-collection-item";
|
|
35
|
+
const CollectionItemSlot = React.forwardRef(
|
|
36
|
+
(props, forwardedRef) => {
|
|
37
|
+
const { scope, children, ...itemData } = props;
|
|
38
|
+
const ref = React.useRef(null);
|
|
39
|
+
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
40
|
+
const context = useCollectionContext(ITEM_SLOT_NAME, scope);
|
|
41
|
+
React.useEffect(() => {
|
|
42
|
+
context.itemMap.set(ref, { ref, ...itemData });
|
|
43
|
+
return () => void context.itemMap.delete(ref);
|
|
44
|
+
});
|
|
45
|
+
return /* @__PURE__ */ jsx(Slot, { ...{ [ITEM_DATA_ATTR]: "" }, ref: composedRefs, children });
|
|
94
46
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
47
|
+
);
|
|
48
|
+
CollectionItemSlot.displayName = ITEM_SLOT_NAME;
|
|
49
|
+
function useCollection(scope) {
|
|
50
|
+
const context = useCollectionContext(name + "CollectionConsumer", scope);
|
|
51
|
+
const getItems = React.useCallback(() => {
|
|
52
|
+
const collectionNode = context.collectionRef.current;
|
|
53
|
+
if (!collectionNode) return [];
|
|
54
|
+
const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));
|
|
55
|
+
const items = Array.from(context.itemMap.values());
|
|
56
|
+
const orderedItems = items.sort(
|
|
57
|
+
(a, b) => orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current)
|
|
58
|
+
);
|
|
59
|
+
return orderedItems;
|
|
60
|
+
}, [context.collectionRef, context.itemMap]);
|
|
61
|
+
return getItems;
|
|
62
|
+
}
|
|
63
|
+
return [
|
|
64
|
+
{ Provider: CollectionProvider, Slot: CollectionSlot, ItemSlot: CollectionItemSlot },
|
|
65
|
+
useCollection,
|
|
66
|
+
createCollectionScope
|
|
67
|
+
];
|
|
104
68
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
export {$e02a7d9cb1dc128c$export$c74125a8e3af6bb2 as createCollection};
|
|
69
|
+
export {
|
|
70
|
+
createCollection
|
|
71
|
+
};
|
|
110
72
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/Collection.tsx"],
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { Slot } from '@radix-ui/react-slot';\n\nimport type * as Radix from '@radix-ui/react-primitive';\n\ntype SlotProps = Radix.ComponentPropsWithoutRef<typeof Slot>;\ntype CollectionElement = HTMLElement;\ninterface CollectionProps extends SlotProps {\n scope: any;\n}\n\n// We have resorted to returning slots directly rather than exposing primitives that can then\n// be slotted like `<CollectionItem as={Slot}>\u2026</CollectionItem>`.\n// This is because we encountered issues with generic types that cannot be statically analysed\n// due to creating them dynamically via createCollection.\n\nfunction createCollection<ItemElement extends HTMLElement, ItemData = {}>(name: string) {\n /* -----------------------------------------------------------------------------------------------\n * CollectionProvider\n * ---------------------------------------------------------------------------------------------*/\n\n const PROVIDER_NAME = name + 'CollectionProvider';\n const [createCollectionContext, createCollectionScope] = createContextScope(PROVIDER_NAME);\n\n type ContextValue = {\n collectionRef: React.RefObject<CollectionElement>;\n itemMap: Map<React.RefObject<ItemElement>, { ref: React.RefObject<ItemElement> } & ItemData>;\n };\n\n const [CollectionProviderImpl, useCollectionContext] = createCollectionContext<ContextValue>(\n PROVIDER_NAME,\n { collectionRef: { current: null }, itemMap: new Map() }\n );\n\n const CollectionProvider: React.FC<{ children?: React.ReactNode; scope: any }> = (props) => {\n const { scope, children } = props;\n const ref = React.useRef<CollectionElement>(null);\n const itemMap = React.useRef<ContextValue['itemMap']>(new Map()).current;\n return (\n <CollectionProviderImpl scope={scope} itemMap={itemMap} collectionRef={ref}>\n {children}\n </CollectionProviderImpl>\n );\n };\n\n CollectionProvider.displayName = PROVIDER_NAME;\n\n /* -----------------------------------------------------------------------------------------------\n * CollectionSlot\n * ---------------------------------------------------------------------------------------------*/\n\n const COLLECTION_SLOT_NAME = name + 'CollectionSlot';\n\n const CollectionSlot = React.forwardRef<CollectionElement, CollectionProps>(\n (props, forwardedRef) => {\n const { scope, children } = props;\n const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);\n const composedRefs = useComposedRefs(forwardedRef, context.collectionRef);\n return <Slot ref={composedRefs}>{children}</Slot>;\n }\n );\n\n CollectionSlot.displayName = COLLECTION_SLOT_NAME;\n\n /* -----------------------------------------------------------------------------------------------\n * CollectionItem\n * ---------------------------------------------------------------------------------------------*/\n\n const ITEM_SLOT_NAME = name + 'CollectionItemSlot';\n const ITEM_DATA_ATTR = 'data-radix-collection-item';\n\n type CollectionItemSlotProps = ItemData & {\n children: React.ReactNode;\n scope: any;\n };\n\n const CollectionItemSlot = React.forwardRef<ItemElement, CollectionItemSlotProps>(\n (props, forwardedRef) => {\n const { scope, children, ...itemData } = props;\n const ref = React.useRef<ItemElement>(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const context = useCollectionContext(ITEM_SLOT_NAME, scope);\n\n React.useEffect(() => {\n context.itemMap.set(ref, { ref, ...(itemData as unknown as ItemData) });\n return () => void context.itemMap.delete(ref);\n });\n\n return (\n <Slot {...{ [ITEM_DATA_ATTR]: '' }} ref={composedRefs}>\n {children}\n </Slot>\n );\n }\n );\n\n CollectionItemSlot.displayName = ITEM_SLOT_NAME;\n\n /* -----------------------------------------------------------------------------------------------\n * useCollection\n * ---------------------------------------------------------------------------------------------*/\n\n function useCollection(scope: any) {\n const context = useCollectionContext(name + 'CollectionConsumer', scope);\n\n const getItems = React.useCallback(() => {\n const collectionNode = context.collectionRef.current;\n if (!collectionNode) return [];\n const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));\n const items = Array.from(context.itemMap.values());\n const orderedItems = items.sort(\n (a, b) => orderedNodes.indexOf(a.ref.current!) - orderedNodes.indexOf(b.ref.current!)\n );\n return orderedItems;\n }, [context.collectionRef, context.itemMap]);\n\n return getItems;\n }\n\n return [\n { Provider: CollectionProvider, Slot: CollectionSlot, ItemSlot: CollectionItemSlot },\n useCollection,\n createCollectionScope,\n ] as const;\n}\n\nexport { createCollection };\nexport type { CollectionProps };\n"],
|
|
5
|
+
"mappings": ";;;AAAA,OAAO,WAAW;AAClB,SAAS,0BAA0B;AACnC,SAAS,uBAAuB;AAChC,SAAS,YAAY;AAsCf;AAvBN,SAAS,iBAAiE,MAAc;AAKtF,QAAM,gBAAgB,OAAO;AAC7B,QAAM,CAAC,yBAAyB,qBAAqB,IAAI,mBAAmB,aAAa;AAOzF,QAAM,CAAC,wBAAwB,oBAAoB,IAAI;AAAA,IACrD;AAAA,IACA,EAAE,eAAe,EAAE,SAAS,KAAK,GAAG,SAAS,oBAAI,IAAI,EAAE;AAAA,EACzD;AAEA,QAAM,qBAA2E,CAAC,UAAU;AAC1F,UAAM,EAAE,OAAO,SAAS,IAAI;AAC5B,UAAM,MAAM,MAAM,OAA0B,IAAI;AAChD,UAAM,UAAU,MAAM,OAAgC,oBAAI,IAAI,CAAC,EAAE;AACjE,WACE,oBAAC,0BAAuB,OAAc,SAAkB,eAAe,KACpE,UACH;AAAA,EAEJ;AAEA,qBAAmB,cAAc;AAMjC,QAAM,uBAAuB,OAAO;AAEpC,QAAM,iBAAiB,MAAM;AAAA,IAC3B,CAAC,OAAO,iBAAiB;AACvB,YAAM,EAAE,OAAO,SAAS,IAAI;AAC5B,YAAM,UAAU,qBAAqB,sBAAsB,KAAK;AAChE,YAAM,eAAe,gBAAgB,cAAc,QAAQ,aAAa;AACxE,aAAO,oBAAC,QAAK,KAAK,cAAe,UAAS;AAAA,IAC5C;AAAA,EACF;AAEA,iBAAe,cAAc;AAM7B,QAAM,iBAAiB,OAAO;AAC9B,QAAM,iBAAiB;AAOvB,QAAM,qBAAqB,MAAM;AAAA,IAC/B,CAAC,OAAO,iBAAiB;AACvB,YAAM,EAAE,OAAO,UAAU,GAAG,SAAS,IAAI;AACzC,YAAM,MAAM,MAAM,OAAoB,IAAI;AAC1C,YAAM,eAAe,gBAAgB,cAAc,GAAG;AACtD,YAAM,UAAU,qBAAqB,gBAAgB,KAAK;AAE1D,YAAM,UAAU,MAAM;AACpB,gBAAQ,QAAQ,IAAI,KAAK,EAAE,KAAK,GAAI,SAAiC,CAAC;AACtE,eAAO,MAAM,KAAK,QAAQ,QAAQ,OAAO,GAAG;AAAA,MAC9C,CAAC;AAED,aACE,oBAAC,QAAM,GAAG,EAAE,CAAC,cAAc,GAAG,GAAG,GAAG,KAAK,cACtC,UACH;AAAA,IAEJ;AAAA,EACF;AAEA,qBAAmB,cAAc;AAMjC,WAAS,cAAc,OAAY;AACjC,UAAM,UAAU,qBAAqB,OAAO,sBAAsB,KAAK;AAEvE,UAAM,WAAW,MAAM,YAAY,MAAM;AACvC,YAAM,iBAAiB,QAAQ,cAAc;AAC7C,UAAI,CAAC,eAAgB,QAAO,CAAC;AAC7B,YAAM,eAAe,MAAM,KAAK,eAAe,iBAAiB,IAAI,cAAc,GAAG,CAAC;AACtF,YAAM,QAAQ,MAAM,KAAK,QAAQ,QAAQ,OAAO,CAAC;AACjD,YAAM,eAAe,MAAM;AAAA,QACzB,CAAC,GAAG,MAAM,aAAa,QAAQ,EAAE,IAAI,OAAQ,IAAI,aAAa,QAAQ,EAAE,IAAI,OAAQ;AAAA,MACtF;AACA,aAAO;AAAA,IACT,GAAG,CAAC,QAAQ,eAAe,QAAQ,OAAO,CAAC;AAE3C,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL,EAAE,UAAU,oBAAoB,MAAM,gBAAgB,UAAU,mBAAmB;AAAA,IACnF;AAAA,IACA;AAAA,EACF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@radix-ui/react-collection",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.1.0-rc.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -28,11 +28,10 @@
|
|
|
28
28
|
"version": "yarn version"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@
|
|
32
|
-
"@radix-ui/react-
|
|
33
|
-
"@radix-ui/react-
|
|
34
|
-
"@radix-ui/react-
|
|
35
|
-
"@radix-ui/react-slot": "1.0.2"
|
|
31
|
+
"@radix-ui/react-compose-refs": "1.1.0-rc.2",
|
|
32
|
+
"@radix-ui/react-context": "1.1.0-rc.2",
|
|
33
|
+
"@radix-ui/react-primitive": "1.1.0-rc.2",
|
|
34
|
+
"@radix-ui/react-slot": "1.1.0-rc.2"
|
|
36
35
|
},
|
|
37
36
|
"peerDependencies": {
|
|
38
37
|
"@types/react": "*",
|
|
@@ -55,5 +54,6 @@
|
|
|
55
54
|
},
|
|
56
55
|
"bugs": {
|
|
57
56
|
"url": "https://github.com/radix-ui/primitives/issues"
|
|
58
|
-
}
|
|
57
|
+
},
|
|
58
|
+
"stableVersion": "1.0.3"
|
|
59
59
|
}
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +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"}
|