@tamagui/use-force-update 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.
package/dist/cjs/index.js CHANGED
@@ -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,17 +12,24 @@ 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 src_exports = {};
16
24
  __export(src_exports, {
17
25
  isServerSide: () => isServerSide,
18
26
  useForceUpdate: () => useForceUpdate
19
27
  });
20
28
  module.exports = __toCommonJS(src_exports);
21
- var import_react = require("react");
29
+ var import_react = __toESM(require("react"));
22
30
  const isServerSide = typeof window > "u", idFn = () => {
23
31
  };
24
32
  function useForceUpdate() {
25
- return isServerSide ? idFn : (0, import_react.useReducer)((x) => Math.random(), 0)[1];
33
+ return isServerSide ? idFn : import_react.default.useReducer((x) => Math.random(), 0)[1];
26
34
  }
27
35
  //# sourceMappingURL=index.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
- "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA2B;AAEpB,MAAM,eAC6B,OAAO,SAAW,KAEtD,OAAO,MAAM;AAAC;AAEb,SAAS,iBAAiB;AAC/B,SAAO,eAAe,WAAQ,yBAAW,CAAC,MAAM,KAAK,OAAO,GAAG,CAAC,EAAE,CAAC;AACrE;",
5
- "names": []
4
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAEX,MAAM,eAC6B,OAAO,SAAW,KAEtD,OAAO,MAAM;AAAC;AAEb,SAAS,iBAAiB;AAC/B,SAAO,eACH,OACC,aAAAA,QAAM,WAAW,CAAC,MAAM,KAAK,OAAO,GAAG,CAAC,EAAE,CAAC;AAClD;",
5
+ "names": ["React"]
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,17 +13,24 @@ 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 src_exports = {};
17
25
  __export(src_exports, {
18
26
  isServerSide: () => isServerSide,
19
27
  useForceUpdate: () => useForceUpdate
20
28
  });
21
29
  module.exports = __toCommonJS(src_exports);
22
- var import_react = require("react"), isServerSide = !1, idFn = function() {
30
+ var import_react = __toESM(require("react")), isServerSide = !1, idFn = function() {
23
31
  };
24
32
  function useForceUpdate() {
25
- return isServerSide ? idFn : (0, import_react.useReducer)(function(x) {
33
+ return isServerSide ? idFn : import_react.default.useReducer(function(x) {
26
34
  return Math.random();
27
35
  }, 0)[1];
28
36
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/Users/n8/tamagui/code/core/use-force-update/src/index.ts"],
4
- "mappings": ";;;;;;;;;;;;;;;AAAA;;;;;;mBAA2B,kBAEdA,eACXC,IAEIC,OAAO,WAAA;AAAO;AAEb,SAASC,iBAAAA;AACd,SAAOH,eAAeE,WAAQE,yBAAW,SAACC,GAAAA;WAAMC,KAAKC,OAAM;KAAI,CAAA,EAAG,CAAA;AACpE;",
5
- "names": ["isServerSide", "process", "idFn", "useForceUpdate", "useReducer", "x", "Math", "random"]
4
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;mBAAkB,2BAELA,eACXC,IAEIC,OAAO,WAAA;AAAO;AAEb,SAASC,iBAAAA;AACd,SAAOH,eACHE,OACCE,aAAAA,QAAMC,WAAW,SAACC,GAAAA;WAAMC,KAAKC,OAAM;KAAI,CAAA,EAAG,CAAA;AACjD;",
5
+ "names": ["isServerSide", "process", "idFn", "useForceUpdate", "React", "useReducer", "x", "Math", "random"]
6
6
  }
package/dist/esm/index.js CHANGED
@@ -1,8 +1,8 @@
1
- import { useReducer } from "react";
1
+ import React from "react";
2
2
  const isServerSide = typeof window > "u", idFn = () => {
3
3
  };
4
4
  function useForceUpdate() {
5
- return isServerSide ? idFn : useReducer((x) => Math.random(), 0)[1];
5
+ return isServerSide ? idFn : React.useReducer((x) => Math.random(), 0)[1];
6
6
  }
7
7
  export {
8
8
  isServerSide,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
- "mappings": "AAAA,SAAS,kBAAkB;AAEpB,MAAM,eAC6B,OAAO,SAAW,KAEtD,OAAO,MAAM;AAAC;AAEb,SAAS,iBAAiB;AAC/B,SAAO,eAAe,OAAQ,WAAW,CAAC,MAAM,KAAK,OAAO,GAAG,CAAC,EAAE,CAAC;AACrE;",
4
+ "mappings": "AAAA,OAAO,WAAW;AAEX,MAAM,eAC6B,OAAO,SAAW,KAEtD,OAAO,MAAM;AAAC;AAEb,SAAS,iBAAiB;AAC/B,SAAO,eACH,OACC,MAAM,WAAW,CAAC,MAAM,KAAK,OAAO,GAAG,CAAC,EAAE,CAAC;AAClD;",
5
5
  "names": []
6
6
  }
@@ -1,8 +1,8 @@
1
- import { useReducer } from "react";
1
+ import React from "react";
2
2
  const isServerSide = typeof window > "u",
3
3
  idFn = () => {};
4
4
  function useForceUpdate() {
5
- return isServerSide ? idFn : useReducer(x => Math.random(), 0)[1];
5
+ return isServerSide ? idFn : React.useReducer(x => Math.random(), 0)[1];
6
6
  }
7
7
  export { isServerSide, useForceUpdate };
8
8
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"names":["useReducer","isServerSide","window","idFn","useForceUpdate","x","Math","random"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,UAAA,QAAkB;AAEpB,MAAMC,YAAA,GAC6B,OAAOC,MAAA,GAAW;EAEtDC,IAAA,GAAOA,CAAA,KAAM,CAAC;AAEb,SAASC,eAAA,EAAiB;EAC/B,OAAOH,YAAA,GAAeE,IAAA,GAAQH,UAAA,CAAYK,CAAA,IAAMC,IAAA,CAAKC,MAAA,CAAO,GAAG,CAAC,EAAE,CAAC;AACrE","ignoreList":[]}
1
+ {"version":3,"names":["React","isServerSide","window","idFn","useForceUpdate","useReducer","x","Math","random"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,OAAOA,KAAA,MAAW;AAEX,MAAMC,YAAA,GAC6B,OAAOC,MAAA,GAAW;EAEtDC,IAAA,GAAOA,CAAA,KAAM,CAAC;AAEb,SAASC,eAAA,EAAiB;EAC/B,OAAOH,YAAA,GACHE,IAAA,GACCH,KAAA,CAAMK,UAAA,CAAYC,CAAA,IAAMC,IAAA,CAAKC,MAAA,CAAO,GAAG,CAAC,EAAE,CAAC;AAClD","ignoreList":[]}
@@ -1,8 +1,8 @@
1
- import { useReducer } from "react";
1
+ import React from "react";
2
2
  var isServerSide = !1, idFn = function() {
3
3
  };
4
4
  function useForceUpdate() {
5
- return isServerSide ? idFn : useReducer(function(x) {
5
+ return isServerSide ? idFn : React.useReducer(function(x) {
6
6
  return Math.random();
7
7
  }, 0)[1];
8
8
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/Users/n8/tamagui/code/core/use-force-update/src/index.ts"],
4
- "mappings": "AAAA,SAASA,kBAAkB;AAEpB,IAAMC,eACXC,IAEIC,OAAO,WAAA;AAAO;AAEb,SAASC,iBAAAA;AACd,SAAOH,eAAeE,OAAQH,WAAW,SAACK,GAAAA;WAAMC,KAAKC,OAAM;KAAI,CAAA,EAAG,CAAA;AACpE;",
5
- "names": ["useReducer", "isServerSide", "process", "idFn", "useForceUpdate", "x", "Math", "random"]
4
+ "mappings": "AAAA,OAAOA,WAAW;AAEX,IAAMC,eACXC,IAEIC,OAAO,WAAA;AAAO;AAEb,SAASC,iBAAAA;AACd,SAAOH,eACHE,OACCH,MAAMK,WAAW,SAACC,GAAAA;WAAMC,KAAKC,OAAM;KAAI,CAAA,EAAG,CAAA;AACjD;",
5
+ "names": ["React", "isServerSide", "process", "idFn", "useForceUpdate", "useReducer", "x", "Math", "random"]
6
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/use-force-update",
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",
@@ -27,7 +27,7 @@
27
27
  }
28
28
  },
29
29
  "devDependencies": {
30
- "@tamagui/build": "1.107.0",
30
+ "@tamagui/build": "1.108.0-1722728147390",
31
31
  "react": "^18.2.0 || ^19.0.0"
32
32
  },
33
33
  "publishConfig": {
package/src/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { useReducer } from 'react'
1
+ import React from 'react'
2
2
 
3
3
  export const isServerSide =
4
4
  process.env.TAMAGUI_TARGET === 'web' && typeof window === 'undefined'
@@ -6,5 +6,7 @@ export const isServerSide =
6
6
  const idFn = () => {}
7
7
 
8
8
  export function useForceUpdate() {
9
- return isServerSide ? idFn : (useReducer((x) => Math.random(), 0)[1] as () => void)
9
+ return isServerSide
10
+ ? idFn
11
+ : (React.useReducer((x) => Math.random(), 0)[1] as () => void)
10
12
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,SAC8C,CAAA;AAIvE,wBAAgB,cAAc,eAE7B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,SAC8C,CAAA;AAIvE,wBAAgB,cAAc,eAI7B"}