@tilia/react 1.5.1 → 1.6.0-canary.20250505T112706
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/index.cjs +41 -1
- package/dist/index.cjs.map +3 -3
- package/dist/index.d.ts +3 -4
- package/dist/index.mjs +21 -1
- package/dist/index.mjs.map +3 -3
- package/package.json +2 -2
- package/src/Tilia.res +1 -0
- package/src/Tilia.resi +1 -0
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,42 @@
|
|
|
1
|
-
var
|
|
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 index_exports = {};
|
|
21
|
+
__export(index_exports, {
|
|
22
|
+
clear: () => import_core2.clear,
|
|
23
|
+
compute: () => import_core2.compute,
|
|
24
|
+
observe: () => import_core2.observe,
|
|
25
|
+
tilia: () => import_core2.tilia,
|
|
26
|
+
track: () => import_core2.track,
|
|
27
|
+
useTilia: () => useTilia
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(index_exports);
|
|
30
|
+
var import_react = require("react");
|
|
31
|
+
var import_core = require("@tilia/core");
|
|
32
|
+
var import_core2 = require("@tilia/core");
|
|
33
|
+
function useTilia(p) {
|
|
34
|
+
const [, setCount] = (0, import_react.useState)(0);
|
|
35
|
+
const o = (0, import_core._connect)(p, () => setCount((i) => i + 1));
|
|
36
|
+
(0, import_react.useEffect)(function() {
|
|
37
|
+
(0, import_core._ready)(o);
|
|
38
|
+
return () => (0, import_core.clear)(o);
|
|
39
|
+
});
|
|
40
|
+
return p;
|
|
41
|
+
}
|
|
2
42
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.js"],
|
|
4
|
-
"sourcesContent": ["import { useState, useEffect } from \"react\";\nimport { _connect, _ready, clear } from \"@tilia/core\";\nexport { tilia, observe, track, clear } 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"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["
|
|
4
|
+
"sourcesContent": ["import { useState, useEffect } from \"react\";\nimport { _connect, _ready, clear } from \"@tilia/core\";\nexport { tilia, observe, track, clear, compute } 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"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAoC;AACpC,kBAAwC;AACxC,IAAAA,eAAsD;AAE/C,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,mBAAM,CAAC;AAAA,EACtB,CAAC;AACD,SAAO;AACT;",
|
|
6
|
+
"names": ["import_core"]
|
|
7
7
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
+
|
|
1
2
|
import type { observer } from "@tilia/core";
|
|
2
|
-
export function tilia<a extends object>(
|
|
3
|
-
tree: a,
|
|
4
|
-
flush?: (fn: () => void) => void
|
|
5
|
-
): a;
|
|
3
|
+
export function tilia<a extends object>(tree: a, flush?: (fn: () => void) => void): a;
|
|
6
4
|
export function observe<a>(tree: a, fn: (tree: a) => void): void;
|
|
5
|
+
export function compute<a>(tree: a, key: string, fn: (tree: a) => void): observer;
|
|
7
6
|
export function track<a>(tree: a, fn: (tree: a) => void): observer;
|
|
8
7
|
export function clear(observer: observer): void;
|
|
9
8
|
export const useTilia: <a>(tree: a) => a;
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
// src/index.js
|
|
2
|
+
import { useState, useEffect } from "react";
|
|
3
|
+
import { _connect, _ready, clear } from "@tilia/core";
|
|
4
|
+
import { tilia, observe, track, clear as clear2, compute } from "@tilia/core";
|
|
5
|
+
function useTilia(p) {
|
|
6
|
+
const [, setCount] = useState(0);
|
|
7
|
+
const o = _connect(p, () => setCount((i) => i + 1));
|
|
8
|
+
useEffect(function() {
|
|
9
|
+
_ready(o);
|
|
10
|
+
return () => clear(o);
|
|
11
|
+
});
|
|
12
|
+
return p;
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
clear2 as clear,
|
|
16
|
+
compute,
|
|
17
|
+
observe,
|
|
18
|
+
tilia,
|
|
19
|
+
track,
|
|
20
|
+
useTilia
|
|
21
|
+
};
|
|
2
22
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.js"],
|
|
4
|
-
"sourcesContent": ["import { useState, useEffect } from \"react\";\nimport { _connect, _ready, clear } from \"@tilia/core\";\nexport { tilia, observe, track, clear } 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"],
|
|
5
|
-
"mappings": "AAAA,
|
|
6
|
-
"names": ["
|
|
4
|
+
"sourcesContent": ["import { useState, useEffect } from \"react\";\nimport { _connect, _ready, clear } from \"@tilia/core\";\nexport { tilia, observe, track, clear, compute } 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"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,UAAU,iBAAiB;AACpC,SAAS,UAAU,QAAQ,aAAa;AACxC,SAAS,OAAO,SAAS,OAAO,SAAAA,QAAO,eAAe;AAE/C,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,MAAM,CAAC;AAAA,EACtB,CAAC;AACD,SAAO;AACT;",
|
|
6
|
+
"names": ["clear"]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tilia/react",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0-canary.20250505T112706",
|
|
4
4
|
"main": "./dist/index.cjs",
|
|
5
5
|
"module": "./dist/index.mjs",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -24,6 +24,6 @@
|
|
|
24
24
|
"react": "*"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@tilia/core": "1.
|
|
27
|
+
"@tilia/core": "1.6.0-canary.20250505T112706"
|
|
28
28
|
}
|
|
29
29
|
}
|
package/src/Tilia.res
CHANGED
package/src/Tilia.resi
CHANGED