@thi.ng/rdom 0.12.19 → 0.12.22
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/CHANGELOG.md +7 -1
- package/README.md +2 -1
- package/component.js +1 -0
- package/klist.js +6 -1
- package/list.js +6 -0
- package/object.js +3 -0
- package/package.json +15 -16
- package/promise.js +3 -0
- package/replace.js +3 -0
- package/scheduler.js +2 -0
- package/sub.js +5 -1
- package/switch.js +8 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
- **Last updated**: 2023-11-
|
|
3
|
+
- **Last updated**: 2023-11-09T10:28:19Z
|
|
4
4
|
- **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
|
|
5
5
|
|
|
6
6
|
All notable changes to this project will be documented in this file.
|
|
@@ -9,6 +9,12 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
|
|
|
9
9
|
**Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
|
|
10
10
|
and/or version bumps of transitive dependencies.
|
|
11
11
|
|
|
12
|
+
### [0.12.21](https://github.com/thi-ng/umbrella/tree/@thi.ng/rdom@0.12.21) (2023-11-09)
|
|
13
|
+
|
|
14
|
+
#### ♻️ Refactoring
|
|
15
|
+
|
|
16
|
+
- update all tests (packages A-S) ([e3085e4](https://github.com/thi-ng/umbrella/commit/e3085e4))
|
|
17
|
+
|
|
12
18
|
### [0.12.13](https://github.com/thi-ng/umbrella/tree/@thi.ng/rdom@0.12.13) (2023-10-18)
|
|
13
19
|
|
|
14
20
|
#### 🩹 Bug fixes
|
package/README.md
CHANGED
|
@@ -278,7 +278,7 @@ For Node.js REPL:
|
|
|
278
278
|
const rdom = await import("@thi.ng/rdom");
|
|
279
279
|
```
|
|
280
280
|
|
|
281
|
-
Package sizes (brotli'd, pre-treeshake): ESM:
|
|
281
|
+
Package sizes (brotli'd, pre-treeshake): ESM: 4.07 KB
|
|
282
282
|
|
|
283
283
|
## Dependencies
|
|
284
284
|
|
|
@@ -313,6 +313,7 @@ directory are using this package:
|
|
|
313
313
|
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/pixel-sorting.png" width="240"/> | Interactive pixel sorting tool using thi.ng/color & thi.ng/pixel | [Demo](https://demo.thi.ng/umbrella/pixel-sorting/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/pixel-sorting) |
|
|
314
314
|
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/pointfree-geom.jpg" width="240"/> | Live coding playground for 2D geometry generation using @thi.ng/pointfree-lang | [Demo](https://demo.thi.ng/umbrella/pointfree-geom/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/pointfree-geom) |
|
|
315
315
|
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/poly-subdiv.jpg" width="240"/> | Animated, iterative polygon subdivisions & visualization | [Demo](https://demo.thi.ng/umbrella/poly-subdiv/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/poly-subdiv) |
|
|
316
|
+
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/procedural-text.jpg" width="240"/> | Procedural stochastic text generation via custom DSL, parse grammar & AST transformation | [Demo](https://demo.thi.ng/umbrella/procedural-text/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/procedural-text) |
|
|
316
317
|
| | Demonstates various rdom usage patterns | [Demo](https://demo.thi.ng/umbrella/rdom-basics/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/rdom-basics) |
|
|
317
318
|
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/rdom-delayed-update.jpg" width="240"/> | Dynamically loaded images w/ preloader state | [Demo](https://demo.thi.ng/umbrella/rdom-delayed-update/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/rdom-delayed-update) |
|
|
318
319
|
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/rdom-dnd.png" width="240"/> | rdom drag & drop example | [Demo](https://demo.thi.ng/umbrella/rdom-dnd/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/rdom-dnd) |
|
package/component.js
CHANGED
package/klist.js
CHANGED
|
@@ -57,13 +57,18 @@ import { $subWithID } from "./sub.js";
|
|
|
57
57
|
*/
|
|
58
58
|
export const $klist = (src, tag, attribs, childCtor, keyFn) => $subWithID(src, new KList(tag, attribs, childCtor, keyFn), __nextID("klist", src));
|
|
59
59
|
export class KList extends Component {
|
|
60
|
+
tag;
|
|
61
|
+
attribs;
|
|
62
|
+
ctor;
|
|
63
|
+
keyFn;
|
|
64
|
+
items = [];
|
|
65
|
+
cache;
|
|
60
66
|
constructor(tag, attribs, ctor, keyFn = (_, i) => i) {
|
|
61
67
|
super();
|
|
62
68
|
this.tag = tag;
|
|
63
69
|
this.attribs = attribs;
|
|
64
70
|
this.ctor = ctor;
|
|
65
71
|
this.keyFn = keyFn;
|
|
66
|
-
this.items = [];
|
|
67
72
|
}
|
|
68
73
|
async mount(parent, index, state) {
|
|
69
74
|
this.items = [];
|
package/list.js
CHANGED
|
@@ -51,6 +51,12 @@ import { $subWithID } from "./sub.js";
|
|
|
51
51
|
*/
|
|
52
52
|
export const $list = (src, tag, attribs, ctor, equiv) => $subWithID(src, new List(tag, attribs, ctor, equiv), __nextID("list", src));
|
|
53
53
|
export class List extends Component {
|
|
54
|
+
tag;
|
|
55
|
+
attribs;
|
|
56
|
+
ctor;
|
|
57
|
+
equiv;
|
|
58
|
+
prev;
|
|
59
|
+
items;
|
|
54
60
|
constructor(tag, attribs, ctor, equiv = (a, b) => a === b) {
|
|
55
61
|
super();
|
|
56
62
|
this.tag = tag;
|
package/object.js
CHANGED
|
@@ -76,6 +76,9 @@ export const $object = (src, opts, inner) => new $Object(src, opts, inner);
|
|
|
76
76
|
*/
|
|
77
77
|
export const $subObject = (src, opts, inner) => $subWithID(src, $object(src.deref() || {}, opts, inner), __nextID("obj", src));
|
|
78
78
|
export class $Object extends Component {
|
|
79
|
+
ctor;
|
|
80
|
+
obj;
|
|
81
|
+
inner;
|
|
79
82
|
constructor(src, opts, ctor) {
|
|
80
83
|
super();
|
|
81
84
|
this.ctor = ctor;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/rdom",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.22",
|
|
4
4
|
"description": "Lightweight, reactive, VDOM-less UI/DOM components with async lifecycle and @thi.ng/hiccup compatible",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -28,28 +28,27 @@
|
|
|
28
28
|
"clean": "rimraf --glob '*.js' '*.d.ts' '*.map' doc",
|
|
29
29
|
"doc": "typedoc --excludePrivate --excludeInternal --out doc src/index.ts",
|
|
30
30
|
"doc:ae": "mkdir -p .ae/doc .ae/temp && api-extractor run --local --verbose",
|
|
31
|
-
"doc:readme": "
|
|
32
|
-
"doc:stats": "tools:module-stats",
|
|
31
|
+
"doc:readme": "bun ../../tools/src/module-stats.ts && bun ../../tools/src/readme.ts",
|
|
33
32
|
"pub": "yarn npm publish --access public",
|
|
34
33
|
"pub:wip": "yarn npm publish --access public --no-git-tag-version",
|
|
35
|
-
"test": "
|
|
34
|
+
"test": "bun test"
|
|
36
35
|
},
|
|
37
36
|
"dependencies": {
|
|
38
|
-
"@thi.ng/api": "^8.9.
|
|
39
|
-
"@thi.ng/checks": "^3.4.
|
|
40
|
-
"@thi.ng/errors": "^2.4.
|
|
41
|
-
"@thi.ng/hiccup": "^5.0.
|
|
42
|
-
"@thi.ng/paths": "^5.1.
|
|
43
|
-
"@thi.ng/prefixes": "^2.2.
|
|
44
|
-
"@thi.ng/rstream": "^8.2.
|
|
45
|
-
"@thi.ng/strings": "^3.6.
|
|
37
|
+
"@thi.ng/api": "^8.9.8",
|
|
38
|
+
"@thi.ng/checks": "^3.4.8",
|
|
39
|
+
"@thi.ng/errors": "^2.4.2",
|
|
40
|
+
"@thi.ng/hiccup": "^5.0.7",
|
|
41
|
+
"@thi.ng/paths": "^5.1.49",
|
|
42
|
+
"@thi.ng/prefixes": "^2.2.4",
|
|
43
|
+
"@thi.ng/rstream": "^8.2.9",
|
|
44
|
+
"@thi.ng/strings": "^3.6.6"
|
|
46
45
|
},
|
|
47
46
|
"devDependencies": {
|
|
48
|
-
"@microsoft/api-extractor": "^7.38.
|
|
49
|
-
"@thi.ng/testament": "^0.
|
|
47
|
+
"@microsoft/api-extractor": "^7.38.2",
|
|
48
|
+
"@thi.ng/testament": "^0.4.1",
|
|
50
49
|
"rimraf": "^5.0.5",
|
|
51
50
|
"tools": "^0.0.1",
|
|
52
|
-
"typedoc": "^0.25.
|
|
51
|
+
"typedoc": "^0.25.3",
|
|
53
52
|
"typescript": "^5.2.2"
|
|
54
53
|
},
|
|
55
54
|
"keywords": [
|
|
@@ -142,5 +141,5 @@
|
|
|
142
141
|
],
|
|
143
142
|
"year": 2020
|
|
144
143
|
},
|
|
145
|
-
"gitHead": "
|
|
144
|
+
"gitHead": "669a3151e4302480244fe3e60eff5e732ea5b7a7\n"
|
|
146
145
|
}
|
package/promise.js
CHANGED
|
@@ -18,6 +18,9 @@ import { Component } from "./component.js";
|
|
|
18
18
|
*/
|
|
19
19
|
export const $promise = (prom, error) => new $Promise(prom, error);
|
|
20
20
|
export class $Promise extends Component {
|
|
21
|
+
promise;
|
|
22
|
+
error;
|
|
23
|
+
inner;
|
|
21
24
|
constructor(promise, error = (e) => e) {
|
|
22
25
|
super();
|
|
23
26
|
this.promise = promise;
|
package/replace.js
CHANGED
|
@@ -37,6 +37,9 @@ import { $wrapText } from "./wrap.js";
|
|
|
37
37
|
*/
|
|
38
38
|
export const $replace = (src) => $subWithID(src, new Replace(), __nextID("replace", src));
|
|
39
39
|
export class Replace extends Component {
|
|
40
|
+
parent;
|
|
41
|
+
inner;
|
|
42
|
+
index;
|
|
40
43
|
async mount(parent, index, val) {
|
|
41
44
|
this.parent = parent;
|
|
42
45
|
this.index = index;
|
package/scheduler.js
CHANGED
package/sub.js
CHANGED
|
@@ -19,6 +19,8 @@ export function $sub(src, tag, attribs) {
|
|
|
19
19
|
*/
|
|
20
20
|
export const $subWithID = (src, inner, id) => src.subscribe(new $Sub(inner, id));
|
|
21
21
|
export class $Sub extends Subscription {
|
|
22
|
+
inner;
|
|
23
|
+
el;
|
|
22
24
|
constructor(inner, id) {
|
|
23
25
|
super(undefined, { id: id || `rdom$sub-${__nextID()}` });
|
|
24
26
|
this.inner = inner;
|
|
@@ -40,10 +42,12 @@ export class $Sub extends Subscription {
|
|
|
40
42
|
}
|
|
41
43
|
}
|
|
42
44
|
export class $SubA extends Subscription {
|
|
45
|
+
comp;
|
|
46
|
+
setter;
|
|
47
|
+
attr = {};
|
|
43
48
|
constructor(comp, path, id) {
|
|
44
49
|
super(undefined, { id: id || `rdom$attr-${__nextID()}` });
|
|
45
50
|
this.comp = comp;
|
|
46
|
-
this.attr = {};
|
|
47
51
|
this.setter = defSetterUnsafe(path);
|
|
48
52
|
}
|
|
49
53
|
next(a) {
|
package/switch.js
CHANGED
|
@@ -83,6 +83,14 @@ export const $switch = (src, keyFn, ctors, error, loader) => $subWithID(src, new
|
|
|
83
83
|
*/
|
|
84
84
|
export const $refresh = (src, ctor, error, loader) => $subWithID(src, new Switch(() => 0, { 0: ctor }, error, loader), __nextID("refresh", src));
|
|
85
85
|
export class Switch extends Component {
|
|
86
|
+
keyFn;
|
|
87
|
+
ctors;
|
|
88
|
+
error;
|
|
89
|
+
loader;
|
|
90
|
+
val;
|
|
91
|
+
parent;
|
|
92
|
+
inner;
|
|
93
|
+
index;
|
|
86
94
|
constructor(keyFn, ctors, error = async (e) => $wrapText("span", {}, e), loader = async () => $wrapText("span", {
|
|
87
95
|
hidden: true,
|
|
88
96
|
})) {
|