@tamagui/use-event 1.107.0 → 1.108.0-1722728147390

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.
@@ -1,7 +1,8 @@
1
+ var __create = Object.create;
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
5
6
  var __export = (target, all) => {
6
7
  for (var name in all)
7
8
  __defProp(target, name, { get: all[name], enumerable: !0 });
@@ -11,18 +12,25 @@ var __export = (target, all) => {
11
12
  !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
13
  return to;
13
14
  };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
16
+ // If the importer is in node compatibility mode or this is not an ESM
17
+ // file that has been converted to a CommonJS file using a Babel-
18
+ // compatible transform (i.e. "__esModule" has not been set), then set
19
+ // "default" to the CommonJS "module.exports" for node compatibility.
20
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
21
+ mod
22
+ )), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
23
  var useGet_exports = {};
16
24
  __export(useGet_exports, {
17
25
  useGet: () => useGet
18
26
  });
19
27
  module.exports = __toCommonJS(useGet_exports);
20
- var import_constants = require("@tamagui/constants"), import_react = require("react");
28
+ var import_constants = require("@tamagui/constants"), React = __toESM(require("react"));
21
29
  function useGet(currentValue, initialValue, forwardToFunction) {
22
- const curRef = (0, import_react.useRef)(initialValue ?? currentValue);
30
+ const curRef = React.useRef(initialValue ?? currentValue);
23
31
  return (0, import_constants.useIsomorphicLayoutEffect)(() => {
24
32
  curRef.current = currentValue;
25
- }), (0, import_react.useCallback)(
33
+ }), React.useCallback(
26
34
  forwardToFunction ? (...args) => curRef.current?.apply(null, args) : () => curRef.current,
27
35
  []
28
36
  );
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/useGet.ts"],
4
- "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAA0C,+BAC1C,eAAoC;AAI7B,SAAS,OACd,cACA,cACA,mBACS;AACT,QAAM,aAAS,qBAAY,gBAAgB,YAAY;AACvD,yDAA0B,MAAM;AAC9B,WAAO,UAAU;AAAA,EACnB,CAAC,OAEM;AAAA,IACL,oBACI,IAAI,SAAS,OAAO,SAAS,MAAM,MAAM,IAAI,IAC7C,MAAM,OAAO;AAAA,IACjB,CAAC;AAAA,EACH;AACF;",
4
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAA0C,+BAC1C,QAAuB;AAIhB,SAAS,OACd,cACA,cACA,mBACS;AACT,QAAM,SAAS,MAAM,OAAY,gBAAgB,YAAY;AAC7D,yDAA0B,MAAM;AAC9B,WAAO,UAAU;AAAA,EACnB,CAAC,GAEM,MAAM;AAAA,IACX,oBACI,IAAI,SAAS,OAAO,SAAS,MAAM,MAAM,IAAI,IAC7C,MAAM,OAAO;AAAA,IACjB,CAAC;AAAA,EACH;AACF;",
5
5
  "names": []
6
6
  }
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
+ var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
6
7
  var __export = (target, all) => {
7
8
  for (var name in all)
8
9
  __defProp(target, name, { get: all[name], enumerable: !0 });
@@ -12,18 +13,25 @@ var __export = (target, all) => {
12
13
  !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
14
  return to;
14
15
  };
15
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
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);
16
24
  var useGet_exports = {};
17
25
  __export(useGet_exports, {
18
26
  useGet: () => useGet
19
27
  });
20
28
  module.exports = __toCommonJS(useGet_exports);
21
- var import_constants = require("@tamagui/constants"), import_react = require("react");
29
+ var import_constants = require("@tamagui/constants"), React = __toESM(require("react"));
22
30
  function useGet(currentValue, initialValue, forwardToFunction) {
23
- var curRef = (0, import_react.useRef)(initialValue ?? currentValue);
31
+ var curRef = React.useRef(initialValue ?? currentValue);
24
32
  return (0, import_constants.useIsomorphicLayoutEffect)(function() {
25
33
  curRef.current = currentValue;
26
- }), (0, import_react.useCallback)(forwardToFunction ? function() {
34
+ }), React.useCallback(forwardToFunction ? function() {
27
35
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++)
28
36
  args[_key] = arguments[_key];
29
37
  var _curRef_current;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/Users/n8/tamagui/code/core/use-event/src/useGet.ts"],
4
- "mappings": ";;;;;;;;;;;;;;;AAAA;;;;;uBAA0C,+BAC1C,eAAoC;AAI7B,SAASA,OACdC,cACAC,cACAC,mBAA2B;AAE3B,MAAMC,aAASC,qBAAYH,gBAAgBD,YAAAA;AAC3CK,yDAA0B,WAAA;AACxBF,WAAOG,UAAUN;EACnB,CAAA,OAEOO,0BACLL,oBACI,WAAA;sCAAIM,OAAAA,IAAAA,MAAAA,IAAAA,GAAAA,OAAAA,GAAAA,OAAAA,MAAAA;AAAAA,WAAAA,IAAAA,IAAAA,UAAAA,IAAAA;QAASL;YAAAA,kBAAAA,OAAOG,aAAO,QAAdH,oBAAAA,SAAAA,SAAAA,gBAAgBM,MAAM,MAAMD,IAAAA;MACzC,WAAA;WAAML,OAAOG;KACjB,CAAA,CAAE;AAEN;",
5
- "names": ["useGet", "currentValue", "initialValue", "forwardToFunction", "curRef", "useRef", "useIsomorphicLayoutEffect", "current", "useCallback", "args", "apply"]
4
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;uBAA0C,+BAC1C,QAAuB;AAIhB,SAASA,OACdC,cACAC,cACAC,mBAA2B;AAE3B,MAAMC,SAASC,MAAMC,OAAYJ,gBAAgBD,YAAAA;AACjDM,yDAA0B,WAAA;AACxBH,WAAOI,UAAUP;EACnB,CAAA,GAEOI,MAAMI,YACXN,oBACI,WAAA;sCAAIO,OAAAA,IAAAA,MAAAA,IAAAA,GAAAA,OAAAA,GAAAA,OAAAA,MAAAA;AAAAA,WAAAA,IAAAA,IAAAA,UAAAA,IAAAA;QAASN;YAAAA,kBAAAA,OAAOI,aAAO,QAAdJ,oBAAAA,SAAAA,SAAAA,gBAAgBO,MAAM,MAAMD,IAAAA;MACzC,WAAA;WAAMN,OAAOI;KACjB,CAAA,CAAE;AAEN;",
5
+ "names": ["useGet", "currentValue", "initialValue", "forwardToFunction", "curRef", "React", "useRef", "useIsomorphicLayoutEffect", "current", "useCallback", "args", "apply"]
6
6
  }
@@ -1,10 +1,10 @@
1
1
  import { useIsomorphicLayoutEffect } from "@tamagui/constants";
2
- import { useCallback, useRef } from "react";
2
+ import * as React from "react";
3
3
  function useGet(currentValue, initialValue, forwardToFunction) {
4
- const curRef = useRef(initialValue ?? currentValue);
4
+ const curRef = React.useRef(initialValue ?? currentValue);
5
5
  return useIsomorphicLayoutEffect(() => {
6
6
  curRef.current = currentValue;
7
- }), useCallback(
7
+ }), React.useCallback(
8
8
  forwardToFunction ? (...args) => curRef.current?.apply(null, args) : () => curRef.current,
9
9
  []
10
10
  );
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/useGet.ts"],
4
- "mappings": "AAAA,SAAS,iCAAiC;AAC1C,SAAS,aAAa,cAAc;AAI7B,SAAS,OACd,cACA,cACA,mBACS;AACT,QAAM,SAAS,OAAY,gBAAgB,YAAY;AACvD,mCAA0B,MAAM;AAC9B,WAAO,UAAU;AAAA,EACnB,CAAC,GAEM;AAAA,IACL,oBACI,IAAI,SAAS,OAAO,SAAS,MAAM,MAAM,IAAI,IAC7C,MAAM,OAAO;AAAA,IACjB,CAAC;AAAA,EACH;AACF;",
4
+ "mappings": "AAAA,SAAS,iCAAiC;AAC1C,YAAY,WAAW;AAIhB,SAAS,OACd,cACA,cACA,mBACS;AACT,QAAM,SAAS,MAAM,OAAY,gBAAgB,YAAY;AAC7D,mCAA0B,MAAM;AAC9B,WAAO,UAAU;AAAA,EACnB,CAAC,GAEM,MAAM;AAAA,IACX,oBACI,IAAI,SAAS,OAAO,SAAS,MAAM,MAAM,IAAI,IAC7C,MAAM,OAAO;AAAA,IACjB,CAAC;AAAA,EACH;AACF;",
5
5
  "names": []
6
6
  }
@@ -1,10 +1,10 @@
1
1
  import { useIsomorphicLayoutEffect } from "@tamagui/constants";
2
- import { useCallback, useRef } from "react";
2
+ import * as React from "react";
3
3
  function useGet(currentValue, initialValue, forwardToFunction) {
4
- const curRef = useRef(initialValue ?? currentValue);
4
+ const curRef = React.useRef(initialValue ?? currentValue);
5
5
  return useIsomorphicLayoutEffect(() => {
6
6
  curRef.current = currentValue;
7
- }), useCallback(forwardToFunction ? (...args) => curRef.current?.apply(null, args) : () => curRef.current, []);
7
+ }), React.useCallback(forwardToFunction ? (...args) => curRef.current?.apply(null, args) : () => curRef.current, []);
8
8
  }
9
9
  export { useGet };
10
10
  //# sourceMappingURL=useGet.mjs.map
@@ -1 +1 @@
1
- {"version":3,"names":["useIsomorphicLayoutEffect","useCallback","useRef","useGet","currentValue","initialValue","forwardToFunction","curRef","current","args","apply"],"sources":["../../src/useGet.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,yBAAA,QAAiC;AAC1C,SAASC,WAAA,EAAaC,MAAA,QAAc;AAI7B,SAASC,OACdC,YAAA,EACAC,YAAA,EACAC,iBAAA,EACS;EACT,MAAMC,MAAA,GAASL,MAAA,CAAYG,YAAA,IAAgBD,YAAY;EACvD,OAAAJ,yBAAA,CAA0B,MAAM;IAC9BO,MAAA,CAAOC,OAAA,GAAUJ,YAAA;EACnB,CAAC,GAEMH,WAAA,CACLK,iBAAA,GACI,IAAIG,IAAA,KAASF,MAAA,CAAOC,OAAA,EAASE,KAAA,CAAM,MAAMD,IAAI,IAC7C,MAAMF,MAAA,CAAOC,OAAA,EACjB,EACF;AACF","ignoreList":[]}
1
+ {"version":3,"names":["useIsomorphicLayoutEffect","React","useGet","currentValue","initialValue","forwardToFunction","curRef","useRef","current","useCallback","args","apply"],"sources":["../../src/useGet.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,yBAAA,QAAiC;AAC1C,YAAYC,KAAA,MAAW;AAIhB,SAASC,OACdC,YAAA,EACAC,YAAA,EACAC,iBAAA,EACS;EACT,MAAMC,MAAA,GAASL,KAAA,CAAMM,MAAA,CAAYH,YAAA,IAAgBD,YAAY;EAC7D,OAAAH,yBAAA,CAA0B,MAAM;IAC9BM,MAAA,CAAOE,OAAA,GAAUL,YAAA;EACnB,CAAC,GAEMF,KAAA,CAAMQ,WAAA,CACXJ,iBAAA,GACI,IAAIK,IAAA,KAASJ,MAAA,CAAOE,OAAA,EAASG,KAAA,CAAM,MAAMD,IAAI,IAC7C,MAAMJ,MAAA,CAAOE,OAAA,EACjB,EACF;AACF","ignoreList":[]}
@@ -1,10 +1,10 @@
1
1
  import { useIsomorphicLayoutEffect } from "@tamagui/constants";
2
- import { useCallback, useRef } from "react";
2
+ import * as React from "react";
3
3
  function useGet(currentValue, initialValue, forwardToFunction) {
4
- var curRef = useRef(initialValue ?? currentValue);
4
+ var curRef = React.useRef(initialValue ?? currentValue);
5
5
  return useIsomorphicLayoutEffect(function() {
6
6
  curRef.current = currentValue;
7
- }), useCallback(forwardToFunction ? function() {
7
+ }), React.useCallback(forwardToFunction ? function() {
8
8
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++)
9
9
  args[_key] = arguments[_key];
10
10
  var _curRef_current;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/Users/n8/tamagui/code/core/use-event/src/useGet.ts"],
4
- "mappings": "AAAA,SAASA,iCAAiC;AAC1C,SAASC,aAAaC,cAAc;AAI7B,SAASC,OACdC,cACAC,cACAC,mBAA2B;AAE3B,MAAMC,SAASL,OAAYG,gBAAgBD,YAAAA;AAC3CJ,mCAA0B,WAAA;AACxBO,WAAOC,UAAUJ;EACnB,CAAA,GAEOH,YACLK,oBACI,WAAA;sCAAIG,OAAAA,IAAAA,MAAAA,IAAAA,GAAAA,OAAAA,GAAAA,OAAAA,MAAAA;AAAAA,WAAAA,IAAAA,IAAAA,UAAAA,IAAAA;QAASF;YAAAA,kBAAAA,OAAOC,aAAO,QAAdD,oBAAAA,SAAAA,SAAAA,gBAAgBG,MAAM,MAAMD,IAAAA;MACzC,WAAA;WAAMF,OAAOC;KACjB,CAAA,CAAE;AAEN;",
5
- "names": ["useIsomorphicLayoutEffect", "useCallback", "useRef", "useGet", "currentValue", "initialValue", "forwardToFunction", "curRef", "current", "args", "apply"]
4
+ "mappings": "AAAA,SAASA,iCAAiC;AAC1C,YAAYC,WAAW;AAIhB,SAASC,OACdC,cACAC,cACAC,mBAA2B;AAE3B,MAAMC,SAASL,MAAMM,OAAYH,gBAAgBD,YAAAA;AACjDH,mCAA0B,WAAA;AACxBM,WAAOE,UAAUL;EACnB,CAAA,GAEOF,MAAMQ,YACXJ,oBACI,WAAA;sCAAIK,OAAAA,IAAAA,MAAAA,IAAAA,GAAAA,OAAAA,GAAAA,OAAAA,MAAAA;AAAAA,WAAAA,IAAAA,IAAAA,UAAAA,IAAAA;QAASJ;YAAAA,kBAAAA,OAAOE,aAAO,QAAdF,oBAAAA,SAAAA,SAAAA,gBAAgBK,MAAM,MAAMD,IAAAA;MACzC,WAAA;WAAMJ,OAAOE;KACjB,CAAA,CAAE;AAEN;",
5
+ "names": ["useIsomorphicLayoutEffect", "React", "useGet", "currentValue", "initialValue", "forwardToFunction", "curRef", "useRef", "current", "useCallback", "args", "apply"]
6
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/use-event",
3
- "version": "1.107.0",
3
+ "version": "1.108.0-1722728147390",
4
4
  "types": "./types/index.d.ts",
5
5
  "main": "dist/cjs",
6
6
  "module": "dist/esm",
@@ -18,11 +18,11 @@
18
18
  "clean:build": "tamagui-build clean:build"
19
19
  },
20
20
  "devDependencies": {
21
- "@tamagui/build": "1.107.0",
21
+ "@tamagui/build": "1.108.0-1722728147390",
22
22
  "react": "^18.2.0 || ^19.0.0"
23
23
  },
24
24
  "dependencies": {
25
- "@tamagui/constants": "1.107.0"
25
+ "@tamagui/constants": "1.108.0-1722728147390"
26
26
  },
27
27
  "exports": {
28
28
  "./package.json": "./package.json",
package/src/useGet.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { useIsomorphicLayoutEffect } from '@tamagui/constants'
2
- import { useCallback, useRef } from 'react'
2
+ import * as React from 'react'
3
3
 
4
4
  // keeps a reference to the current value easily
5
5
 
@@ -8,12 +8,12 @@ export function useGet<A>(
8
8
  initialValue?: any,
9
9
  forwardToFunction?: boolean
10
10
  ): () => A {
11
- const curRef = useRef<any>(initialValue ?? currentValue)
11
+ const curRef = React.useRef<any>(initialValue ?? currentValue)
12
12
  useIsomorphicLayoutEffect(() => {
13
13
  curRef.current = currentValue
14
14
  })
15
15
 
16
- return useCallback(
16
+ return React.useCallback(
17
17
  forwardToFunction
18
18
  ? (...args) => curRef.current?.apply(null, args)
19
19
  : () => curRef.current,