@tamagui/collection 1.88.0 → 1.88.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.
@@ -74,8 +74,4 @@ function createCollection(name) {
74
74
  useCollection
75
75
  ];
76
76
  }
77
- // Annotate the CommonJS export names for ESM import in node:
78
- 0 && (module.exports = {
79
- createCollection
80
- });
81
77
  //# sourceMappingURL=Collection.js.map
package/dist/cjs/index.js CHANGED
@@ -12,8 +12,4 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0
12
12
  var src_exports = {};
13
13
  module.exports = __toCommonJS(src_exports);
14
14
  __reExport(src_exports, require("./Collection"), module.exports);
15
- // Annotate the CommonJS export names for ESM import in node:
16
- 0 && (module.exports = {
17
- ...require("./Collection")
18
- });
19
15
  //# sourceMappingURL=index.js.map
@@ -1,15 +1,39 @@
1
- import { useComposedRefs } from "@tamagui/compose-refs";
2
- import { isWeb } from "@tamagui/constants";
3
- import { Slot, createStyledContext } from "@tamagui/core";
4
- import React from "react";
5
- import { jsx } from "react/jsx-runtime";
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: !0 });
10
+ }, __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from == "object" || typeof from == "function")
12
+ for (let key of __getOwnPropNames(from))
13
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ return to;
15
+ };
16
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
+ // If the importer is in node compatibility mode or this is not an ESM
18
+ // file that has been converted to a CommonJS file using a Babel-
19
+ // compatible transform (i.e. "__esModule" has not been set), then set
20
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
22
+ mod
23
+ )), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
24
+ var Collection_exports = {};
25
+ __export(Collection_exports, {
26
+ createCollection: () => createCollection
27
+ });
28
+ module.exports = __toCommonJS(Collection_exports);
29
+ var import_compose_refs = require("@tamagui/compose-refs"), import_constants = require("@tamagui/constants"), import_core = require("@tamagui/core"), import_react = __toESM(require("react")), import_jsx_runtime = require("react/jsx-runtime");
6
30
  function createCollection(name) {
7
- const { Provider: CollectionProviderImpl, useStyledContext: useCollectionContext } = createStyledContext({
31
+ const { Provider: CollectionProviderImpl, useStyledContext: useCollectionContext } = (0, import_core.createStyledContext)({
8
32
  collectionRef: { current: null },
9
33
  itemMap: /* @__PURE__ */ new Map()
10
34
  }), CollectionProvider = (props) => {
11
- const { __scopeCollection, children } = props, ref = React.useRef(null), itemMap = React.useRef(/* @__PURE__ */ new Map()).current;
12
- return /* @__PURE__ */ jsx(
35
+ const { __scopeCollection, children } = props, ref = import_react.default.useRef(null), itemMap = import_react.default.useRef(/* @__PURE__ */ new Map()).current;
36
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
13
37
  CollectionProviderImpl,
14
38
  {
15
39
  scope: __scopeCollection,
@@ -20,20 +44,20 @@ function createCollection(name) {
20
44
  );
21
45
  };
22
46
  CollectionProvider.displayName = "CollectionProvider";
23
- const COLLECTION_SLOT_NAME = name + "CollectionSlot", CollectionSlot = React.forwardRef((props, forwardedRef) => {
24
- const { __scopeCollection, children } = props, context = useCollectionContext(__scopeCollection), composedRefs = useComposedRefs(forwardedRef, context.collectionRef);
25
- return /* @__PURE__ */ jsx(Slot, { ref: composedRefs, children });
47
+ const COLLECTION_SLOT_NAME = name + "CollectionSlot", CollectionSlot = import_react.default.forwardRef((props, forwardedRef) => {
48
+ const { __scopeCollection, children } = props, context = useCollectionContext(__scopeCollection), composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, context.collectionRef);
49
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.Slot, { ref: composedRefs, children });
26
50
  });
27
51
  CollectionSlot.displayName = COLLECTION_SLOT_NAME;
28
- const ITEM_SLOT_NAME = name + "CollectionItemSlot", ITEM_DATA_ATTR = "data-collection-item", CollectionItemSlot = React.forwardRef((props, forwardedRef) => {
29
- const { __scopeCollection, children, ...itemData } = props, ref = React.useRef(null), composedRefs = useComposedRefs(forwardedRef, ref), context = useCollectionContext(__scopeCollection);
30
- return React.useEffect(() => (context.itemMap.set(ref, { ref, ...itemData }), () => void context.itemMap.delete(ref))), /* @__PURE__ */ jsx(Slot, { [ITEM_DATA_ATTR]: "", ref: composedRefs, children });
52
+ const ITEM_SLOT_NAME = name + "CollectionItemSlot", ITEM_DATA_ATTR = "data-collection-item", CollectionItemSlot = import_react.default.forwardRef((props, forwardedRef) => {
53
+ const { __scopeCollection, children, ...itemData } = props, ref = import_react.default.useRef(null), composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, ref), context = useCollectionContext(__scopeCollection);
54
+ return import_react.default.useEffect(() => (context.itemMap.set(ref, { ref, ...itemData }), () => void context.itemMap.delete(ref))), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.Slot, { [ITEM_DATA_ATTR]: "", ref: composedRefs, children });
31
55
  });
32
56
  CollectionItemSlot.displayName = ITEM_SLOT_NAME;
33
57
  function useCollection(__scopeCollection) {
34
58
  const context = useCollectionContext(__scopeCollection);
35
- return React.useCallback(() => {
36
- if (!isWeb)
59
+ return import_react.default.useCallback(() => {
60
+ if (!import_constants.isWeb)
37
61
  return [];
38
62
  const collectionNode = context.collectionRef.current;
39
63
  if (!collectionNode)
@@ -51,7 +75,8 @@ function createCollection(name) {
51
75
  useCollection
52
76
  ];
53
77
  }
54
- export {
78
+ // Annotate the CommonJS export names for ESM import in node:
79
+ 0 && (module.exports = {
55
80
  createCollection
56
- };
81
+ });
57
82
  //# sourceMappingURL=Collection.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/Collection.tsx"],
4
- "mappings": "AAAA,SAAS,uBAAuB;AAChC,SAAS,aAAa;AACtB,SAAsB,MAAsB,2BAA2B;AACvE,OAAO,WAAW;AA8CZ;AAnCN,SAAS,iBACP,MACA;AAmBA,QAAM,EAAE,UAAU,wBAAwB,kBAAkB,qBAAqB,IAC/E,oBAAkC;AAAA,IAChC,eAAe,EAAE,SAAS,KAAK;AAAA,IAC/B,SAAS,oBAAI,IAAI;AAAA,EACnB,CAAC,GAEG,qBAGD,CAAC,UAAU;AACd,UAAM,EAAE,mBAAmB,SAAS,IAAI,OAClC,MAAM,MAAM,OAA0B,IAAI,GAC1C,UAAU,MAAM,OAAgC,oBAAI,IAAI,CAAC,EAAE;AACjE,WACE;AAAA,MAAC;AAAA;AAAA,QACC,OAAO;AAAA,QACP;AAAA,QACA,eAAe;AAAA,QAEd;AAAA;AAAA,IACH;AAAA,EAEJ;AAEA,qBAAmB,cAAc;AAMjC,QAAM,uBAAuB,OAAO,kBAE9B,iBAAiB,MAAM,WAG3B,CAAC,OAAO,iBAAiB;AACzB,UAAM,EAAE,mBAAmB,SAAS,IAAI,OAClC,UAAU,qBAAqB,iBAAiB,GAChD,eAAe,gBAAgB,cAAc,QAAQ,aAAa;AACxE,WAAO,oBAAC,QAAK,KAAK,cAAe,UAAS;AAAA,EAC5C,CAAC;AAED,iBAAe,cAAc;AAM7B,QAAM,iBAAiB,OAAO,sBACxB,iBAAiB,wBAMjB,qBAAqB,MAAM,WAG/B,CAAC,OAAO,iBAAiB;AACzB,UAAM,EAAE,mBAAmB,UAAU,GAAG,SAAS,IAAI,OAC/C,MAAM,MAAM,OAAoB,IAAI,GACpC,eAAe,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,QAAQ,cAAc;AAC7C,UAAI,CAAC;AAAgB,eAAO,CAAC;AAC7B,YAAM,eAAe,MAAM;AAAA,QACzB,eAAe,iBAAiB,IAAI,cAAc,GAAG;AAAA,MACvD;AAOA,aANc,MAAM,KAAK,QAAQ,QAAQ,OAAO,CAAC,EACtB;AAAA,QACzB,CAAC,GAAG,MACF,aAAa,QAAQ,EAAE,IAAI,OAAuB,IAClD,aAAa,QAAQ,EAAE,IAAI,OAAuB;AAAA,MACtD;AAAA,IAEF,GAAG,CAAC,QAAQ,eAAe,QAAQ,OAAO,CAAC;AAAA,EAG7C;AAEA,SAAO;AAAA,IACL,EAAE,UAAU,oBAAoB,MAAM,gBAAgB,UAAU,mBAAmB;AAAA,IACnF;AAAA,EACF;AACF;",
5
+ "names": ["React"]
6
6
  }
@@ -1,2 +1,20 @@
1
- export * from "./Collection";
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from == "object" || typeof from == "function")
8
+ for (let key of __getOwnPropNames(from))
9
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ return to;
11
+ }, __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
12
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
13
+ var src_exports = {};
14
+ module.exports = __toCommonJS(src_exports);
15
+ __reExport(src_exports, require("./Collection"), module.exports);
16
+ // Annotate the CommonJS export names for ESM import in node:
17
+ 0 && (module.exports = {
18
+ ...require("./Collection")
19
+ });
2
20
  //# sourceMappingURL=index.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
- "mappings": "AAAA,cAAc;",
4
+ "mappings": ";;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,yBAAd;",
5
5
  "names": []
6
6
  }
@@ -2,27 +2,32 @@ import { useComposedRefs } from "@tamagui/compose-refs";
2
2
  import { isWeb } from "@tamagui/constants";
3
3
  import { Slot, createStyledContext } from "@tamagui/core";
4
4
  import React from "react";
5
+ import { jsx } from "react/jsx-runtime";
5
6
  function createCollection(name) {
6
7
  const { Provider: CollectionProviderImpl, useStyledContext: useCollectionContext } = createStyledContext({
7
8
  collectionRef: { current: null },
8
9
  itemMap: /* @__PURE__ */ new Map()
9
10
  }), CollectionProvider = (props) => {
10
11
  const { __scopeCollection, children } = props, ref = React.useRef(null), itemMap = React.useRef(/* @__PURE__ */ new Map()).current;
11
- return <CollectionProviderImpl
12
- scope={__scopeCollection}
13
- itemMap={itemMap}
14
- collectionRef={ref}
15
- >{children}</CollectionProviderImpl>;
12
+ return /* @__PURE__ */ jsx(
13
+ CollectionProviderImpl,
14
+ {
15
+ scope: __scopeCollection,
16
+ itemMap,
17
+ collectionRef: ref,
18
+ children
19
+ }
20
+ );
16
21
  };
17
22
  CollectionProvider.displayName = "CollectionProvider";
18
23
  const COLLECTION_SLOT_NAME = name + "CollectionSlot", CollectionSlot = React.forwardRef((props, forwardedRef) => {
19
24
  const { __scopeCollection, children } = props, context = useCollectionContext(__scopeCollection), composedRefs = useComposedRefs(forwardedRef, context.collectionRef);
20
- return <Slot ref={composedRefs}>{children}</Slot>;
25
+ return /* @__PURE__ */ jsx(Slot, { ref: composedRefs, children });
21
26
  });
22
27
  CollectionSlot.displayName = COLLECTION_SLOT_NAME;
23
28
  const ITEM_SLOT_NAME = name + "CollectionItemSlot", ITEM_DATA_ATTR = "data-collection-item", CollectionItemSlot = React.forwardRef((props, forwardedRef) => {
24
29
  const { __scopeCollection, children, ...itemData } = props, ref = React.useRef(null), composedRefs = useComposedRefs(forwardedRef, ref), context = useCollectionContext(__scopeCollection);
25
- return React.useEffect(() => (context.itemMap.set(ref, { ref, ...itemData }), () => void context.itemMap.delete(ref))), <Slot {...{ [ITEM_DATA_ATTR]: "" }} ref={composedRefs}>{children}</Slot>;
30
+ return React.useEffect(() => (context.itemMap.set(ref, { ref, ...itemData }), () => void context.itemMap.delete(ref))), /* @__PURE__ */ jsx(Slot, { [ITEM_DATA_ATTR]: "", ref: composedRefs, children });
26
31
  });
27
32
  CollectionItemSlot.displayName = ITEM_SLOT_NAME;
28
33
  function useCollection(__scopeCollection) {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/Collection.tsx"],
4
- "mappings": "AAAA,SAAS,uBAAuB;AAChC,SAAS,aAAa;AACtB,SAAsB,MAAsB,2BAA2B;AACvE,OAAO,WAAW;AAWlB,SAAS,iBACP,MACA;AAmBA,QAAM,EAAE,UAAU,wBAAwB,kBAAkB,qBAAqB,IAC/E,oBAAkC;AAAA,IAChC,eAAe,EAAE,SAAS,KAAK;AAAA,IAC/B,SAAS,oBAAI,IAAI;AAAA,EACnB,CAAC,GAEG,qBAGD,CAAC,UAAU;AACd,UAAM,EAAE,mBAAmB,SAAS,IAAI,OAClC,MAAM,MAAM,OAA0B,IAAI,GAC1C,UAAU,MAAM,OAAgC,oBAAI,IAAI,CAAC,EAAE;AACjE,WACE,CAAC;AAAA,MACC,OAAO;AAAA,MACP,SAAS;AAAA,MACT,eAAe;AAAA,MAEd,SACH,EANC;AAAA,EAQL;AAEA,qBAAmB,cAAc;AAMjC,QAAM,uBAAuB,OAAO,kBAE9B,iBAAiB,MAAM,WAG3B,CAAC,OAAO,iBAAiB;AACzB,UAAM,EAAE,mBAAmB,SAAS,IAAI,OAClC,UAAU,qBAAqB,iBAAiB,GAChD,eAAe,gBAAgB,cAAc,QAAQ,aAAa;AACxE,WAAO,CAAC,KAAK,KAAK,eAAe,SAAS,EAAlC;AAAA,EACV,CAAC;AAED,iBAAe,cAAc;AAM7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WAnBiB,MAAM,YAAY,MAAM;AACvC,UAAI,CAAC;AACH,eAAO,CAAC;AAGV,YAAM,iBAAiB,QAAQ,cAAc;AAC7C,UAAI,CAAC;AAAgB,eAAO,CAAC;AAC7B,YAAM,eAAe,MAAM;AAAA,QACzB,eAAe,iBAAiB,IAAI,cAAc,GAAG;AAAA,MACvD;AAOA,aANc,MAAM,KAAK,QAAQ,QAAQ,OAAO,CAAC,EACtB;AAAA,QACzB,CAAC,GAAG,MACF,aAAa,QAAQ,EAAE,IAAI,OAAuB,IAClD,aAAa,QAAQ,EAAE,IAAI,OAAuB;AAAA,MACtD;AAAA,IAEF,GAAG,CAAC,QAAQ,eAAe,QAAQ,OAAO,CAAC;AAAA,EAG7C;AAEA,SAAO;AAAA,IACL,EAAE,UAAU,oBAAoB,MAAM,gBAAgB,UAAU,mBAAmB;AAAA,IACnF;AAAA,EACF;AACF;",
5
5
  "names": []
6
6
  }
@@ -1,34 +1,63 @@
1
- import { useComposedRefs } from "@tamagui/compose-refs";
2
- import { isWeb } from "@tamagui/constants";
3
- import { Slot, createStyledContext } from "@tamagui/core";
4
- import React from "react";
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: !0 });
10
+ }, __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from == "object" || typeof from == "function")
12
+ for (let key of __getOwnPropNames(from))
13
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ return to;
15
+ };
16
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
+ // If the importer is in node compatibility mode or this is not an ESM
18
+ // file that has been converted to a CommonJS file using a Babel-
19
+ // compatible transform (i.e. "__esModule" has not been set), then set
20
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
22
+ mod
23
+ )), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
24
+ var Collection_exports = {};
25
+ __export(Collection_exports, {
26
+ createCollection: () => createCollection
27
+ });
28
+ module.exports = __toCommonJS(Collection_exports);
29
+ var import_compose_refs = require("@tamagui/compose-refs"), import_constants = require("@tamagui/constants"), import_core = require("@tamagui/core"), import_react = __toESM(require("react")), import_jsx_runtime = require("react/jsx-runtime");
5
30
  function createCollection(name) {
6
- const { Provider: CollectionProviderImpl, useStyledContext: useCollectionContext } = createStyledContext({
31
+ const { Provider: CollectionProviderImpl, useStyledContext: useCollectionContext } = (0, import_core.createStyledContext)({
7
32
  collectionRef: { current: null },
8
33
  itemMap: /* @__PURE__ */ new Map()
9
34
  }), CollectionProvider = (props) => {
10
- const { __scopeCollection, children } = props, ref = React.useRef(null), itemMap = React.useRef(/* @__PURE__ */ new Map()).current;
11
- return <CollectionProviderImpl
12
- scope={__scopeCollection}
13
- itemMap={itemMap}
14
- collectionRef={ref}
15
- >{children}</CollectionProviderImpl>;
35
+ const { __scopeCollection, children } = props, ref = import_react.default.useRef(null), itemMap = import_react.default.useRef(/* @__PURE__ */ new Map()).current;
36
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
37
+ CollectionProviderImpl,
38
+ {
39
+ scope: __scopeCollection,
40
+ itemMap,
41
+ collectionRef: ref,
42
+ children
43
+ }
44
+ );
16
45
  };
17
46
  CollectionProvider.displayName = "CollectionProvider";
18
- const COLLECTION_SLOT_NAME = name + "CollectionSlot", CollectionSlot = React.forwardRef((props, forwardedRef) => {
19
- const { __scopeCollection, children } = props, context = useCollectionContext(__scopeCollection), composedRefs = useComposedRefs(forwardedRef, context.collectionRef);
20
- return <Slot ref={composedRefs}>{children}</Slot>;
47
+ const COLLECTION_SLOT_NAME = name + "CollectionSlot", CollectionSlot = import_react.default.forwardRef((props, forwardedRef) => {
48
+ const { __scopeCollection, children } = props, context = useCollectionContext(__scopeCollection), composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, context.collectionRef);
49
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.Slot, { ref: composedRefs, children });
21
50
  });
22
51
  CollectionSlot.displayName = COLLECTION_SLOT_NAME;
23
- const ITEM_SLOT_NAME = name + "CollectionItemSlot", ITEM_DATA_ATTR = "data-collection-item", CollectionItemSlot = React.forwardRef((props, forwardedRef) => {
24
- const { __scopeCollection, children, ...itemData } = props, ref = React.useRef(null), composedRefs = useComposedRefs(forwardedRef, ref), context = useCollectionContext(__scopeCollection);
25
- return React.useEffect(() => (context.itemMap.set(ref, { ref, ...itemData }), () => void context.itemMap.delete(ref))), <Slot {...{ [ITEM_DATA_ATTR]: "" }} ref={composedRefs}>{children}</Slot>;
52
+ const ITEM_SLOT_NAME = name + "CollectionItemSlot", ITEM_DATA_ATTR = "data-collection-item", CollectionItemSlot = import_react.default.forwardRef((props, forwardedRef) => {
53
+ const { __scopeCollection, children, ...itemData } = props, ref = import_react.default.useRef(null), composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, ref), context = useCollectionContext(__scopeCollection);
54
+ return import_react.default.useEffect(() => (context.itemMap.set(ref, { ref, ...itemData }), () => void context.itemMap.delete(ref))), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.Slot, { [ITEM_DATA_ATTR]: "", ref: composedRefs, children });
26
55
  });
27
56
  CollectionItemSlot.displayName = ITEM_SLOT_NAME;
28
57
  function useCollection(__scopeCollection) {
29
58
  const context = useCollectionContext(__scopeCollection);
30
- return React.useCallback(() => {
31
- if (!isWeb)
59
+ return import_react.default.useCallback(() => {
60
+ if (!import_constants.isWeb)
32
61
  return [];
33
62
  const collectionNode = context.collectionRef.current;
34
63
  if (!collectionNode)
@@ -46,7 +75,8 @@ function createCollection(name) {
46
75
  useCollection
47
76
  ];
48
77
  }
49
- export {
78
+ // Annotate the CommonJS export names for ESM import in node:
79
+ 0 && (module.exports = {
50
80
  createCollection
51
- };
81
+ });
52
82
  //# sourceMappingURL=Collection.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/Collection.tsx"],
4
- "mappings": "AAAA,SAAS,uBAAuB;AAChC,SAAS,aAAa;AACtB,SAAsB,MAAsB,2BAA2B;AACvE,OAAO,WAAW;AAWlB,SAAS,iBACP,MACA;AAmBA,QAAM,EAAE,UAAU,wBAAwB,kBAAkB,qBAAqB,IAC/E,oBAAkC;AAAA,IAChC,eAAe,EAAE,SAAS,KAAK;AAAA,IAC/B,SAAS,oBAAI,IAAI;AAAA,EACnB,CAAC,GAEG,qBAGD,CAAC,UAAU;AACd,UAAM,EAAE,mBAAmB,SAAS,IAAI,OAClC,MAAM,MAAM,OAA0B,IAAI,GAC1C,UAAU,MAAM,OAAgC,oBAAI,IAAI,CAAC,EAAE;AACjE,WACE,CAAC;AAAA,MACC,OAAO;AAAA,MACP,SAAS;AAAA,MACT,eAAe;AAAA,MAEd,SACH,EANC;AAAA,EAQL;AAEA,qBAAmB,cAAc;AAMjC,QAAM,uBAAuB,OAAO,kBAE9B,iBAAiB,MAAM,WAG3B,CAAC,OAAO,iBAAiB;AACzB,UAAM,EAAE,mBAAmB,SAAS,IAAI,OAClC,UAAU,qBAAqB,iBAAiB,GAChD,eAAe,gBAAgB,cAAc,QAAQ,aAAa;AACxE,WAAO,CAAC,KAAK,KAAK,eAAe,SAAS,EAAlC;AAAA,EACV,CAAC;AAED,iBAAe,cAAc;AAM7B,QAAM,iBAAiB,OAAO,sBACxB,iBAAiB,wBAMjB,qBAAqB,MAAM,WAG/B,CAAC,OAAO,iBAAiB;AACzB,UAAM,EAAE,mBAAmB,UA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MAAM;AACvC,UAAI,CAAC;AACH,eAAO,CAAC;AAGV,YAAM,iBAAiB,QAAQ,cAAc;AAC7C,UAAI,CAAC;AAAgB,eAAO,CAAC;AAC7B,YAAM,eAAe,MAAM;AAAA,QACzB,eAAe,iBAAiB,IAAI,cAAc,GAAG;AAAA,MACvD;AAOA,aANc,MAAM,KAAK,QAAQ,QAAQ,OAAO,CAAC,EACtB;AAAA,QACzB,CAAC,GAAG,MACF,aAAa,QAAQ,EAAE,IAAI,OAAuB,IAClD,aAAa,QAAQ,EAAE,IAAI,OAAuB;AAAA,MACtD;AAAA,IAEF,GAAG,CAAC,QAAQ,eAAe,QAAQ,OAAO,CAAC;AAAA,EAG7C;AAEA,SAAO;AAAA,IACL,EAAE,UAAU,oBAAoB,MAAM,gBAAgB,UAAU,mBAAmB;AAAA,IACnF;AAAA,EACF;AACF;",
5
+ "names": ["React"]
6
6
  }
@@ -1,2 +1,20 @@
1
- export * from "./Collection";
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from == "object" || typeof from == "function")
8
+ for (let key of __getOwnPropNames(from))
9
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ return to;
11
+ }, __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
12
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
13
+ var src_exports = {};
14
+ module.exports = __toCommonJS(src_exports);
15
+ __reExport(src_exports, require("./Collection"), module.exports);
16
+ // Annotate the CommonJS export names for ESM import in node:
17
+ 0 && (module.exports = {
18
+ ...require("./Collection")
19
+ });
2
20
  //# sourceMappingURL=index.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
- "mappings": "AAAA,cAAc;",
4
+ "mappings": ";;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,yBAAd;",
5
5
  "names": []
6
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/collection",
3
- "version": "1.88.0",
3
+ "version": "1.88.2",
4
4
  "sideEffects": [
5
5
  "*.css"
6
6
  ],
@@ -32,19 +32,19 @@
32
32
  }
33
33
  },
34
34
  "dependencies": {
35
- "@tamagui/compose-refs": "1.88.0",
36
- "@tamagui/constants": "1.88.0",
37
- "@tamagui/core": "1.88.0",
38
- "@tamagui/create-context": "1.88.0",
39
- "@tamagui/polyfill-dev": "1.88.0",
40
- "@tamagui/stacks": "1.88.0",
41
- "@tamagui/use-controllable-state": "1.88.0"
35
+ "@tamagui/compose-refs": "1.88.2",
36
+ "@tamagui/constants": "1.88.2",
37
+ "@tamagui/core": "1.88.2",
38
+ "@tamagui/create-context": "1.88.2",
39
+ "@tamagui/polyfill-dev": "1.88.2",
40
+ "@tamagui/stacks": "1.88.2",
41
+ "@tamagui/use-controllable-state": "1.88.2"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "react": "*"
45
45
  },
46
46
  "devDependencies": {
47
- "@tamagui/build": "1.88.0",
47
+ "@tamagui/build": "1.88.2",
48
48
  "react": "^18.2.0"
49
49
  },
50
50
  "publishConfig": {