@thi.ng/rdom 1.3.3 → 1.4.0

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2024-04-26T13:32:20Z
3
+ - **Last updated**: 2024-05-08T18:24:31Z
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,13 @@ 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
+ ## [1.4.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/rdom@1.4.0) (2024-05-08)
13
+
14
+ #### 🚀 Features
15
+
16
+ - add rdom-klist example project, update readmes ([cd458ac](https://github.com/thi-ng/umbrella/commit/cd458ac))
17
+ - add rdom-klist example project, update readmes ([531437f](https://github.com/thi-ng/umbrella/commit/531437f))
18
+
12
19
  ### [1.3.3](https://github.com/thi-ng/umbrella/tree/@thi.ng/rdom@1.3.3) (2024-04-26)
13
20
 
14
21
  #### 🩹 Bug fixes
package/README.md CHANGED
@@ -315,7 +315,7 @@ Browser ESM import:
315
315
 
316
316
  [JSDelivr documentation](https://www.jsdelivr.com/)
317
317
 
318
- Package sizes (brotli'd, pre-treeshake): ESM: 4.24 KB
318
+ Package sizes (brotli'd, pre-treeshake): ESM: 4.23 KB
319
319
 
320
320
  ## Dependencies
321
321
 
@@ -362,8 +362,10 @@ directory are using this package:
362
362
  | <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) |
363
363
  | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/rdom-formgen.jpg" width="240"/> | Basic usage of the declarative rdom-forms generator | [Demo](https://demo.thi.ng/umbrella/rdom-formgen/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/rdom-formgen) |
364
364
  | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/rdom-key-sequences.jpg" width="240"/> | rstream & transducer-based FSM for converting key event sequences into high-level commands | [Demo](https://demo.thi.ng/umbrella/rdom-key-sequences/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/rdom-key-sequences) |
365
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/rdom-klist.png" width="240"/> | Basic usage of thi.ng/rdom keyed list component wrapper | [Demo](https://demo.thi.ng/umbrella/rdom-klist/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/rdom-klist) |
365
366
  | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/rdom-lazy-load.png" width="240"/> | Lazy loading components via @thi.ng/rdom | [Demo](https://demo.thi.ng/umbrella/rdom-lazy-load/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/rdom-lazy-load) |
366
367
  | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/rdom-lissajous.png" width="240"/> | rdom & hiccup-canvas interop test | [Demo](https://demo.thi.ng/umbrella/rdom-lissajous/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/rdom-lissajous) |
368
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/rdom-reactive-svg.jpg" width="240"/> | Animated SVG elements with reactive attributes | [Demo](https://demo.thi.ng/umbrella/rdom-reactive-svg/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/rdom-reactive-svg) |
367
369
  | | Full umbrella repo doc string search w/ paginated results | [Demo](https://demo.thi.ng/umbrella/rdom-search-docs/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/rdom-search-docs) |
368
370
  | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/rdom-svg-nodes.png" width="240"/> | rdom powered SVG graph with draggable nodes | [Demo](https://demo.thi.ng/umbrella/rdom-svg-nodes/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/rdom-svg-nodes) |
369
371
  | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/rdom-web-components.png" width="240"/> | Defining & using basic Web Components (with shadow DOM) via @thi.ng/rdom & @thi.ng/meta-css | [Demo](https://demo.thi.ng/umbrella/rdom-web-components/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/rdom-web-components) |
package/async.js CHANGED
@@ -15,8 +15,7 @@ class $Async {
15
15
  this.el = await this.inner.mount(parent, index, void 0);
16
16
  (async () => {
17
17
  for await (let x of this.src) {
18
- if (!this.el)
19
- return;
18
+ if (!this.el) return;
20
19
  this.update(x);
21
20
  }
22
21
  })();
@@ -27,16 +26,14 @@ class $Async {
27
26
  await this.inner.unmount();
28
27
  }
29
28
  update(x) {
30
- if (this.el)
31
- this.inner.update(x);
29
+ if (this.el) this.inner.update(x);
32
30
  }
33
31
  }
34
32
  const $asyncA = async (src, comp, path) => {
35
33
  const attribs = {};
36
34
  const setter = defSetterUnsafe(path);
37
35
  for await (let x of src) {
38
- if (comp.el)
39
- $attribs(comp.el, setter(attribs, x));
36
+ if (comp.el) $attribs(comp.el, setter(attribs, x));
40
37
  }
41
38
  };
42
39
  export {
package/compile.js CHANGED
@@ -19,13 +19,11 @@ const walk = (f, x, path = []) => {
19
19
  const isComplexComponent = (x) => {
20
20
  if (isPlainObject(x)) {
21
21
  for (const k in x) {
22
- if (isComplexComponent(x[k]))
23
- return true;
22
+ if (isComplexComponent(x[k])) return true;
24
23
  }
25
24
  } else if (isArray(x)) {
26
25
  for (let i = 0, n = x.length; i < n; i++) {
27
- if (isComplexComponent(x[i]))
28
- return true;
26
+ if (isComplexComponent(x[i])) return true;
29
27
  }
30
28
  }
31
29
  return isSubscribable(x) || isAsyncIterable(x) || isComponent(x) || isElement(x);
@@ -39,8 +37,7 @@ const complexComponent = (tree) => ({
39
37
  this.subs.push(x.subscribe(new $SubA(this, path)));
40
38
  } else if (isAsyncIterable(x)) {
41
39
  $asyncA(x, this, path);
42
- if (path.length === 1)
43
- delete attribs[path[0]];
40
+ if (path.length === 1) delete attribs[path[0]];
44
41
  }
45
42
  }, attribs);
46
43
  this.children = [];
package/klist.js CHANGED
@@ -32,8 +32,7 @@ class KList extends Component {
32
32
  this.cache = void 0;
33
33
  }
34
34
  async update(curr) {
35
- if (!curr)
36
- return;
35
+ if (!curr) return;
37
36
  const { keyFn, items, ctor, cache, el: parent } = this;
38
37
  const currItems = [];
39
38
  const currCache = /* @__PURE__ */ new Map();
package/list.js CHANGED
@@ -32,8 +32,7 @@ class List extends Component {
32
32
  this.prev = void 0;
33
33
  }
34
34
  async update(curr) {
35
- if (!curr)
36
- return;
35
+ if (!curr) return;
37
36
  const { ctor, equiv, items, prev, el: parent } = this;
38
37
  const nb = curr.length;
39
38
  let na = prev.length;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/rdom",
3
- "version": "1.3.3",
3
+ "version": "1.4.0",
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",
@@ -37,20 +37,20 @@
37
37
  "tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
38
38
  },
39
39
  "dependencies": {
40
- "@thi.ng/api": "^8.11.1",
41
- "@thi.ng/checks": "^3.6.3",
42
- "@thi.ng/errors": "^2.5.6",
43
- "@thi.ng/hiccup": "^5.2.0",
44
- "@thi.ng/paths": "^5.1.80",
45
- "@thi.ng/prefixes": "^2.3.18",
46
- "@thi.ng/rstream": "^8.4.3",
47
- "@thi.ng/strings": "^3.7.32"
40
+ "@thi.ng/api": "^8.11.2",
41
+ "@thi.ng/checks": "^3.6.4",
42
+ "@thi.ng/errors": "^2.5.7",
43
+ "@thi.ng/hiccup": "^5.2.1",
44
+ "@thi.ng/paths": "^5.1.81",
45
+ "@thi.ng/prefixes": "^2.3.19",
46
+ "@thi.ng/rstream": "^8.5.0",
47
+ "@thi.ng/strings": "^3.7.33"
48
48
  },
49
49
  "devDependencies": {
50
- "@microsoft/api-extractor": "^7.43.0",
51
- "esbuild": "^0.20.2",
52
- "typedoc": "^0.25.12",
53
- "typescript": "^5.4.3"
50
+ "@microsoft/api-extractor": "^7.43.2",
51
+ "esbuild": "^0.21.1",
52
+ "typedoc": "^0.25.13",
53
+ "typescript": "^5.4.5"
54
54
  },
55
55
  "keywords": [
56
56
  "async",
@@ -145,5 +145,5 @@
145
145
  ],
146
146
  "year": 2020
147
147
  },
148
- "gitHead": "0bec55821066c18eb977a7eabd42c0bb2b096d98\n"
148
+ "gitHead": "df34b4a9e650cc7323575356de207d78933bdcf3\n"
149
149
  }
package/sub.js CHANGED
@@ -30,8 +30,7 @@ class $Sub extends Subscription {
30
30
  this.next(x);
31
31
  }
32
32
  next(x) {
33
- if (this.el)
34
- this.inner.update(x);
33
+ if (this.el) this.inner.update(x);
35
34
  }
36
35
  }
37
36
  class $SubA extends Subscription {
@@ -43,8 +42,7 @@ class $SubA extends Subscription {
43
42
  setter;
44
43
  attr = {};
45
44
  next(a) {
46
- if (this.comp.el)
47
- $attribs(this.comp.el, this.setter(this.attr, a));
45
+ if (this.comp.el) $attribs(this.comp.el, this.setter(this.attr, a));
48
46
  }
49
47
  }
50
48
  export {
package/wrap.js CHANGED
@@ -12,8 +12,7 @@ const wrapper = (update) => (tag, attribs, body) => ({
12
12
  this.el = void 0;
13
13
  },
14
14
  update(body2) {
15
- if (this.el)
16
- update(this.el, body2);
15
+ if (this.el) update(this.el, body2);
17
16
  }
18
17
  });
19
18
  const $wrapText = wrapper($text);