@thi.ng/rdom 0.12.11 → 0.12.13

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**: 2023-10-11T10:05:08Z
3
+ - **Last updated**: 2023-10-18T18:06: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,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.13](https://github.com/thi-ng/umbrella/tree/@thi.ng/rdom@0.12.13) (2023-10-18)
13
+
14
+ #### 🩹 Bug fixes
15
+
16
+ - update $text() to set el.textContent, simplify ([7cd6cc0](https://github.com/thi-ng/umbrella/commit/7cd6cc0))
17
+
12
18
  ## [0.12.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/rdom@0.12.0) (2023-08-22)
13
19
 
14
20
  #### 🚀 Features
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: 3.90 KB
281
+ Package sizes (brotli'd, pre-treeshake): ESM: 3.88 KB
282
282
 
283
283
  ## Dependencies
284
284
 
@@ -312,6 +312,7 @@ A selection:
312
312
  | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/parse-playground.png" width="240"/> | Parser grammar livecoding editor/playground & codegen | [Demo](https://demo.thi.ng/umbrella/parse-playground/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/parse-playground) |
313
313
  | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/pixel-gradients.jpg" width="240"/> | Randomized 4-point 2D color gradient image generator | [Demo](https://demo.thi.ng/umbrella/pixel-gradients/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/pixel-gradients) |
314
314
  | <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) |
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) |
315
316
  | | 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) |
316
317
  | <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) |
317
318
  | <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) |
@@ -319,6 +320,7 @@ A selection:
319
320
  | <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) |
320
321
  | | 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) |
321
322
  | <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) |
323
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/related-images.jpg" width="240"/> | Responsive image gallery with tag-based Jaccard similarity ranking | [Demo](https://demo.thi.ng/umbrella/related-images/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/related-images) |
322
324
  | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/render-audio.png" width="240"/> | Generative audio synth offline renderer and WAV file export | [Demo](https://demo.thi.ng/umbrella/render-audio/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/render-audio) |
323
325
  | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/rstream-sync.png" width="240"/> | Minimal rstream sync() example using rdom | [Demo](https://demo.thi.ng/umbrella/rstream-sync/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/rstream-sync) |
324
326
  | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/stacked-layout.png" width="240"/> | Responsive & reactively computed stacked column layout | [Demo](https://demo.thi.ng/umbrella/stacked-layout/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/stacked-layout) |
package/dom.d.ts CHANGED
@@ -96,11 +96,10 @@ export declare const $moveTo: (newParent: Element, el: Element | Comment, idx?:
96
96
  */
97
97
  export declare const $clear: (el: Element) => Element;
98
98
  /**
99
- * Same as `el.innerText = body`, however if `body` is an
99
+ * Same as `el.textContent = body`, however if `body` is an
100
100
  * [`IDeref`](https://docs.thi.ng/umbrella/api/interfaces/IDeref.html) it'll be
101
- * automatically deref'd and coerced to a string. If `body === undefined` an
102
- * empty string will be used. For SVG elements a new child text DOM node will be
103
- * created.
101
+ * first automatically deref'd and coerced to a string. If `body === undefined`
102
+ * an empty string will be used.
104
103
  *
105
104
  * @param el -
106
105
  * @param body -
package/dom.js CHANGED
@@ -195,24 +195,17 @@ export const $moveTo = (newParent, el, idx = -1) => {
195
195
  */
196
196
  export const $clear = (el) => ((el.innerHTML = ""), el);
197
197
  /**
198
- * Same as `el.innerText = body`, however if `body` is an
198
+ * Same as `el.textContent = body`, however if `body` is an
199
199
  * [`IDeref`](https://docs.thi.ng/umbrella/api/interfaces/IDeref.html) it'll be
200
- * automatically deref'd and coerced to a string. If `body === undefined` an
201
- * empty string will be used. For SVG elements a new child text DOM node will be
202
- * created.
200
+ * first automatically deref'd and coerced to a string. If `body === undefined`
201
+ * an empty string will be used.
203
202
  *
204
203
  * @param el -
205
204
  * @param body -
206
205
  */
207
206
  export const $text = (el, body) => {
208
207
  body = deref(body);
209
- body = body !== undefined ? String(body) : "";
210
- if (el.namespaceURI === XML_SVG) {
211
- $clear(el).appendChild(document.createTextNode(body));
212
- }
213
- else {
214
- el.innerText = body;
215
- }
208
+ el.textContent = body !== undefined ? String(body) : "";
216
209
  };
217
210
  /**
218
211
  * Same as `el.innerHtml = body`, use with caution! If `body` is an
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/rdom",
3
- "version": "0.12.11",
3
+ "version": "0.12.13",
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",
@@ -41,7 +41,7 @@
41
41
  "@thi.ng/hiccup": "^5.0.1",
42
42
  "@thi.ng/paths": "^5.1.44",
43
43
  "@thi.ng/prefixes": "^2.2.1",
44
- "@thi.ng/rstream": "^8.1.9",
44
+ "@thi.ng/rstream": "^8.2.0",
45
45
  "@thi.ng/strings": "^3.6.0"
46
46
  },
47
47
  "devDependencies": {
@@ -142,5 +142,5 @@
142
142
  ],
143
143
  "year": 2020
144
144
  },
145
- "gitHead": "e9f04908dc37ae9e29320f098d195f9f8445a1ad\n"
145
+ "gitHead": "46e445c09f2909d1aeaa9fdc8d8b3aa61c114db2\n"
146
146
  }