@tilia/react 1.1.1 → 1.1.2-canary.20241227T173254

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/README.md CHANGED
@@ -103,6 +103,7 @@ Please check the documentation for [@tilia/core](../core/README.md) for technica
103
103
 
104
104
  ### Changelog (for @tilia/core)
105
105
 
106
+ - 2024-12-27 **1.2.4** Add support for ready after clear.
106
107
  - 2024-12-24 **1.2.3** Rewrite tracking to fix notify and clear before ready.
107
108
  - 2024-12-18 **1.2.2** Fix readonly tracking: should not proxy.
108
109
  - 2024-12-18 **1.2.1** Fix bug to not track prototype methods.
package/dist/index.cjs.js CHANGED
@@ -1,2 +1,38 @@
1
- var u=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var m=(e,t)=>{for(var r in t)u(e,r,{get:t[r],enumerable:!0})},l=(e,t,r,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of f(t))!a.call(e,n)&&n!==r&&u(e,n,{get:()=>t[n],enumerable:!(c=s(t,n))||c.enumerable});return e};var p=e=>l(u({},"__esModule",{value:!0}),e);var x={};m(x,{observe:()=>o.observe,tilia:()=>o.tilia,useTilia:()=>_});module.exports=p(x);var i=require("react"),o=require("@tilia/core");function _(e){let[,t]=(0,i.useState)(0),r=(0,o._connect)(e,()=>t(c=>c+1));return(0,i.useEffect)(function(){return(0,o._ready)(r),()=>(0,o._clear)(r)}),e}
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/index.js
20
+ var src_exports = {};
21
+ __export(src_exports, {
22
+ observe: () => import_core.observe,
23
+ tilia: () => import_core.tilia,
24
+ useTilia: () => useTilia
25
+ });
26
+ module.exports = __toCommonJS(src_exports);
27
+ var import_react = require("react");
28
+ var import_core = require("@tilia/core");
29
+ function useTilia(p) {
30
+ const [, setCount] = (0, import_react.useState)(0);
31
+ const o = (0, import_core._connect)(p, () => setCount((i) => i + 1));
32
+ (0, import_react.useEffect)(function() {
33
+ (0, import_core._ready)(o);
34
+ return () => (0, import_core._clear)(o);
35
+ });
36
+ return p;
37
+ }
2
38
  //# sourceMappingURL=index.cjs.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/index.js"],
4
4
  "sourcesContent": ["import { useState, useEffect } from \"react\";\nimport { _connect, _ready, _clear, tilia, observe } from \"@tilia/core\";\n\nexport function useTilia(p) {\n const [, setCount] = useState(0);\n const o = _connect(p, () => setCount((i) => i + 1));\n useEffect(function () {\n _ready(o);\n return () => _clear(o);\n });\n return p;\n}\n\nexport { tilia, observe };\n"],
5
- "mappings": "4ZAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,sDAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAoC,iBACpCC,EAAyD,uBAElD,SAASH,EAASI,EAAG,CAC1B,GAAM,CAAC,CAAEC,CAAQ,KAAI,YAAS,CAAC,EACzBC,KAAI,YAASF,EAAG,IAAMC,EAAUE,GAAMA,EAAI,CAAC,CAAC,EAClD,sBAAU,UAAY,CACpB,mBAAOD,CAAC,EACD,OAAM,UAAOA,CAAC,CACvB,CAAC,EACMF,CACT",
6
- "names": ["src_exports", "__export", "useTilia", "__toCommonJS", "import_react", "import_core", "p", "setCount", "o", "i"]
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAoC;AACpC,kBAAyD;AAElD,SAAS,SAAS,GAAG;AAC1B,QAAM,CAAC,EAAE,QAAQ,QAAI,uBAAS,CAAC;AAC/B,QAAM,QAAI,sBAAS,GAAG,MAAM,SAAS,CAAC,MAAM,IAAI,CAAC,CAAC;AAClD,8BAAU,WAAY;AACpB,4BAAO,CAAC;AACR,WAAO,UAAM,oBAAO,CAAC;AAAA,EACvB,CAAC;AACD,SAAO;AACT;",
6
+ "names": []
7
7
  }
package/dist/index.esm.js CHANGED
@@ -1,2 +1,18 @@
1
- import{useState as n,useEffect as c}from"react";import{_connect as i,_ready as u,_clear as s,tilia as m,observe as l}from"@tilia/core";function p(t){let[,o]=n(0),e=i(t,()=>o(r=>r+1));return c(function(){return u(e),()=>s(e)}),t}export{l as observe,m as tilia,p as useTilia};
1
+ // src/index.js
2
+ import { useState, useEffect } from "react";
3
+ import { _connect, _ready, _clear, tilia, observe } from "@tilia/core";
4
+ function useTilia(p) {
5
+ const [, setCount] = useState(0);
6
+ const o = _connect(p, () => setCount((i) => i + 1));
7
+ useEffect(function() {
8
+ _ready(o);
9
+ return () => _clear(o);
10
+ });
11
+ return p;
12
+ }
13
+ export {
14
+ observe,
15
+ tilia,
16
+ useTilia
17
+ };
2
18
  //# sourceMappingURL=index.esm.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/index.js"],
4
4
  "sourcesContent": ["import { useState, useEffect } from \"react\";\nimport { _connect, _ready, _clear, tilia, observe } from \"@tilia/core\";\n\nexport function useTilia(p) {\n const [, setCount] = useState(0);\n const o = _connect(p, () => setCount((i) => i + 1));\n useEffect(function () {\n _ready(o);\n return () => _clear(o);\n });\n return p;\n}\n\nexport { tilia, observe };\n"],
5
- "mappings": "AAAA,OAAS,YAAAA,EAAU,aAAAC,MAAiB,QACpC,OAAS,YAAAC,EAAU,UAAAC,EAAQ,UAAAC,EAAQ,SAAAC,EAAO,WAAAC,MAAe,cAElD,SAASC,EAASC,EAAG,CAC1B,GAAM,CAAC,CAAEC,CAAQ,EAAIT,EAAS,CAAC,EACzBU,EAAIR,EAASM,EAAG,IAAMC,EAAUE,GAAMA,EAAI,CAAC,CAAC,EAClD,OAAAV,EAAU,UAAY,CACpB,OAAAE,EAAOO,CAAC,EACD,IAAMN,EAAOM,CAAC,CACvB,CAAC,EACMF,CACT",
6
- "names": ["useState", "useEffect", "_connect", "_ready", "_clear", "tilia", "observe", "useTilia", "p", "setCount", "o", "i"]
5
+ "mappings": ";AAAA,SAAS,UAAU,iBAAiB;AACpC,SAAS,UAAU,QAAQ,QAAQ,OAAO,eAAe;AAElD,SAAS,SAAS,GAAG;AAC1B,QAAM,CAAC,EAAE,QAAQ,IAAI,SAAS,CAAC;AAC/B,QAAM,IAAI,SAAS,GAAG,MAAM,SAAS,CAAC,MAAM,IAAI,CAAC,CAAC;AAClD,YAAU,WAAY;AACpB,WAAO,CAAC;AACR,WAAO,MAAM,OAAO,CAAC;AAAA,EACvB,CAAC;AACD,SAAO;AACT;",
6
+ "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tilia/react",
3
- "version": "1.1.1",
3
+ "version": "1.1.2-canary.20241227T173254",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.esm.js",
6
6
  "types": "./dist/index.d.ts",
@@ -24,6 +24,6 @@
24
24
  "react": "*"
25
25
  },
26
26
  "dependencies": {
27
- "@tilia/core": "^1.2.3"
27
+ "@tilia/core": "1.2.4-canary.20241227T173254"
28
28
  }
29
29
  }