@tamagui/use-controllable-state 2.0.0-rc.33 → 2.0.0-rc.34

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.
@@ -17,5 +17,5 @@ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
17
17
  }), mod);
18
18
  var index_exports = {};
19
19
  module.exports = __toCommonJS(index_exports);
20
- __reExport(index_exports, require("./useControllableState"), module.exports);
20
+ __reExport(index_exports, require("./useControllableState.native.js"), module.exports);
21
21
  //# sourceMappingURL=index.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__copyProps","to","from","except","desc","key","call","get","enumerable","__reExport","target","mod","secondTarget","__toCommonJS","value","index_exports","module","exports","require"],"sources":["index.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from == \"object\" || typeof from == \"function\")\n for (let key of __getOwnPropNames(from))\n !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n return to;\n}, __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, \"default\"), secondTarget && __copyProps(secondTarget, mod, \"default\"));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: !0 }), mod);\nvar index_exports = {};\nmodule.exports = __toCommonJS(index_exports);\n__reExport(index_exports, require(\"./useControllableState\"), module.exports);\n//# sourceMappingURL=index.js.map\n"],"mappings":"AAAA,YAAY;;AACZ,IAAIA,SAAS,GAAGC,MAAM,CAACC,cAAc;AACrC,IAAIC,gBAAgB,GA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O,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","index_exports","module","exports"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,aAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAP,YAAc,CAAAK,aAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["__create","Object","create","__defProp","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__getProtoOf","getPrototypeOf","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key","call","__toESM","mod","isNodeMode","__esModule","value","__toCommonJS","useControllableState_exports","useControllableState","module","exports","import_use_event","require","React","import_start_transition","emptyCallbackFn","_","param","prop","defaultProp","onChange","strategy","preventUpdate","transition","state","setState","useState","previous","useRef","propWins","onChangeCb","useEvent","idFn","transitionFn","startTransition","useEffect","current","setter","next","nextValue"],"sources":["useControllableState.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: !0 });\n}, __copyProps = (to, from, except, desc) => {\n if (from && typeof from == \"object\" || typeof from == \"function\")\n for (let key of __getOwnPropNames(from))\n !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: !0 }) : target,\n mod\n)), __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: !0 }), mod);\nvar useControllableState_exports = {};\n__export(useControllableState_exports, {\n useControllableState: () => useControllableState\n});\nmodule.exports = __toCommonJS(useControllableState_exports);\nvar import_use_event = require(\"@tamagui/use-event\"), React = __toESM(require(\"react\"), 1), import_start_transition = require(\"@tamagui/start-transition\"), emptyCallbackFn = function(_) {\n return _();\n};\nfunction useControllableState(param) {\n var { prop, defaultProp, onChange, strategy = \"prop-wins\", preventUpdate, transition } = param, [state, setState] = React.useState(prop ?? defaultProp), previous = React.useRef(state), propWins = strategy === \"prop-wins\" && prop !== void 0, value = propWins ? prop : state, onChangeCb = (0, import_use_event.useEvent)(onChange || idFn), transitionFn = transition ? import_start_transition.startTransition : emptyCallbackFn;\n React.useEffect(function() {\n prop !== void 0 && (previous.current = prop, transitionFn(function() {\n setState(prop);\n }));\n }, [\n prop\n ]), React.useEffect(function() {\n propWins || state !== previous.current && (previous.current = state, onChangeCb(state));\n }, [\n onChangeCb,\n state,\n propWins\n ]);\n var setter = (0, import_use_event.useEvent)(function(next) {\n if (!preventUpdate)\n if (propWins) {\n var nextValue = typeof next == \"function\" ? next(previous.current) : next;\n onChangeCb(nextValue);\n } else\n transitionFn(function() {\n setState(next);\n });\n });\n return [\n value,\n setter\n ];\n}\nvar idFn = function() {\n};\n//# sourceMappingURL=useControllableState.js.map\n"],"mappings":"AAAA,YAAY;;AACZ,IAAIA,QAAQ,GAAGC,MAAM,CAACC,MAAM;AAC5B,IAAIC,SAAS,GAAGF,MAAM,CAACG,cAAc;AACrC,IAAIC,gBAAgB,GAAGJ,MAAM,CAACK,wBAAwB;AACtD,IA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,EAAEnB,gBAAgB,CAACoB,QAAQ,EAAEX,QAAQ,IAAIY,IAAI,CAAC;IAAEC,YAAY,GAAGV,UAAU,GAAGT,uBAAuB,CAACoB,eAAe,GAAGnB,eAAe;EACtaF,KAAK,CAACsB,SAAS,CAAC,YAAW;IACzBjB,IAAI,KAAK,KAAK,CAAC,KAAKS,QAAQ,CAACS,OAAO,GAAGlB,IAAI,EAAEe,YAAY,CAAC,YAAW;MACnER,QAAQ,CAACP,IAAI,CAAC;IAChB,CAAC,CAAC,CAAC;EACL,CAAC,EAAE,CACDA,IAAI,CACL,CAAC,EAAEL,KAAK,CAACsB,SAAS,CAAC,YAAW;IAC7BN,QAAQ,IAAIL,KAAK,KAAKG,QAAQ,CAACS,OAAO,KAAKT,QAAQ,CAACS,OAAO,GAAGZ,KAAK,EAAEM,UAAU,CAACN,KAAK,CAAC,CAAC;EACzF,CAAC,EAAE,CACDM,UAAU,EACVN,KAAK,EACLK,QAAQ,CACT,CAAC;EACF,IAAIQ,MAAM,GAAG,CAAC,CAAC,EAAE1B,gBAAgB,CAACoB,QAAQ,EAAE,UAASO,IAAI,EAAE;IACzD,IAAI,CAAChB,aAAa,EAChB,IAAIO,QAAQ,EAAE;MACZ,IAAIU,SAAS,GAAG,OAAOD,IAAI,IAAI,UAAU,GAAGA,IAAI,CAACX,QAAQ,CAACS,OAAO,CAAC,GAAGE,IAAI;MACzER,UAAU,CAACS,SAAS,CAAC;IACvB,CAAC,MACCN,YAAY,CAAC,YAAW;MACtBR,QAAQ,CAACa,IAAI,CAAC;IAChB,CAAC,CAAC;EACR,CAAC,CAAC;EACF,OAAO,CACLjC,KAAK,EACLgC,MAAM,CACP;AACH;AACA,IAAIL,IAAI,GAAG,SAAAA,CAAA,EAAW,CACtB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","useControllableState_exports","__export","useControllableState","module","exports","import_use_event","require","React","__toESM","import_start_transition","emptyCallbackFn","_","param","prop","defaultProp","onChange","strategy","preventUpdate","transition","state","setState","useState","previous","useRef","propWins","onChangeCb","useEvent","idFn","transitionFn","startTransition","useEffect","current","setter","next","nextValue"],"sources":["../../src/useControllableState.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAAA;EAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;IAAAC,KAAA;EAAA,IAAAH,GAAA;AAAA,IAAAI,4BAAA;AAAAC,QAAA,CAAAD,4BAAA;EAAAE,oBAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAT,YAAyB,CAAAK,4BACzB;AAQA,IAAAK,gBAAM,GAAAC,OAAmB,CAAM,oBAAE;EAAAC,KAAA,GAAAC,OAAA,CAAAF,OAAA;EAAAG,uBAAA,GAAAH,OAAA;EAAAI,eAAA,YAAAA,CAAAC,CAAA;IAE1B,OAASA,CAAA;EAAwB;AACtC,SACAT,qBAAAU,KAAA;EACA;MAAAC,IAAA;MAAAC,WAAA;MAAAC,QAAA;MAAAC,QAAA;MAAAC,aAAA;MAAAC;IAAA,IAAAN,KAAA;IAAA,CAAAO,KAAA,EAAAC,QAAA,IAAAb,KAAA,CAAAc,QAAA,CAAAR,IAAA,IAAAC,WAAA;IAAAQ,QAAA,GAAAf,KAAA,CAAAgB,MAAA,CAAAJ,KAAA;IAAAK,QAAA,GAAAR,QAAA,oBAAAH,IAAA;IAAAd,KAAA,GAAAyB,QAAA,GAAAX,IAAA,GAAAM,KAAA;IAAAM,UAAA,OAAApB,gBAAA,CAAAqB,QAAA,EAAAX,QAAA,IAAAY,IAAA;IAAAC,YAAA,GAAAV,UAAA,GAAAT,uBAAA,CAAAoB,eAAA,GAAAnB,eAAA;EACAH,KAAA,CAAAuB,SAAW;IACXjB,IAAA,gBAAAS,QAAA,CAAAS,OAAA,GAAAlB,IAAA,EAAAe,YAAA;MACAR,QAAA,CAAAP,IAAA;IAQ+C;EAC/C,IAQAA,IAAM,CACJ,CAAI,EAAAN,KAAA,CAAAuB,SAAS,aACJ;IAEPN,QAAA,IAASL,KAAI,KAAAG,QAAA,CAAAS,OAAA,KAAAT,QAAA,CAAAS,OAAA,GAAAZ,KAAA,EAAAM,UAAA,CAAAN,KAAA;EAAA,GACd,CACHM,UAEA,EACMN,KAAA,EAKNK,QAAI,CAEJ;EACE,IAAAQ,MAAI,OAAA3B,gBAAA,CAAAqB,QAAA,YAAAO,IAAA;IACJ,KAAAhB,aAAc,EACZ,IAAAO,QAAM;MACN,IAAAU,SAAW,UAASD,IAAA,iBAAAA,IAAA,CAAAX,QAAA,CAAAS,OAAA,IAAAE,IAAA;MACtBR,UAAA,CAAAS,SAAA;IACE,OACEN,YAAS,aAAI;MACdR,QAAA,CAAAa,IAAA;IAEJ;EAED;EACF,QAEAlC,KAAM,EAAciC,MAAA,C","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/use-controllable-state",
3
- "version": "2.0.0-rc.33",
3
+ "version": "2.0.0-rc.34",
4
4
  "gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14",
5
5
  "source": "src/index.ts",
6
6
  "files": [
@@ -35,11 +35,11 @@
35
35
  "clean:build": "tamagui-build clean:build"
36
36
  },
37
37
  "dependencies": {
38
- "@tamagui/start-transition": "2.0.0-rc.33",
39
- "@tamagui/use-event": "2.0.0-rc.33"
38
+ "@tamagui/start-transition": "2.0.0-rc.34",
39
+ "@tamagui/use-event": "2.0.0-rc.34"
40
40
  },
41
41
  "devDependencies": {
42
- "@tamagui/build": "2.0.0-rc.33",
42
+ "@tamagui/build": "2.0.0-rc.34",
43
43
  "react": ">=19"
44
44
  },
45
45
  "peerDependencies": {