@thi.ng/hiccup 5.2.10 → 5.2.11

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-08-18T14:11:34Z
3
+ - **Last updated**: 2024-08-23T16:18:16Z
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,15 @@ 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
+ ### [5.2.11](https://github.com/thi-ng/umbrella/tree/@thi.ng/hiccup@5.2.11) (2024-08-23)
13
+
14
+ #### 🩹 Bug fixes
15
+
16
+ - update mergeClasses() arg types ([eaca539](https://github.com/thi-ng/umbrella/commit/eaca539))
17
+ - add support for SVGAnimatedString as `existing` arg
18
+ to enable full support for SVG elements
19
+ - update SVGAnimatedString handling in `mergeClasses()` ([540cc70](https://github.com/thi-ng/umbrella/commit/540cc70))
20
+
12
21
  ### [5.2.2](https://github.com/thi-ng/umbrella/tree/@thi.ng/hiccup@5.2.2) (2024-06-21)
13
22
 
14
23
  #### ♻️ Refactoring
package/attribs.d.ts CHANGED
@@ -36,7 +36,7 @@
36
36
  * @param existing -
37
37
  * @param val -
38
38
  */
39
- export declare const mergeClasses: (existing: string, val: any) => string;
39
+ export declare const mergeClasses: (existing: string | SVGAnimatedString, val: any) => string;
40
40
  /**
41
41
  * Takes an attrib object and optional element ID and CSS class names from Emmet-style
42
42
  * hiccup tag, then transforms and merges definitions, returns attribs.
package/attribs.js CHANGED
@@ -3,10 +3,11 @@ import { isArray } from "@thi.ng/checks/is-array";
3
3
  import { isString } from "@thi.ng/checks/is-string";
4
4
  const mergeClasses = (existing, val) => {
5
5
  val = deref(val);
6
- if (val == null) return existing;
6
+ const $existing = existing.baseVal != void 0 ? existing.baseVal : existing;
7
+ if (val == null) return $existing;
7
8
  if (isArray(val)) val = val.join(" ");
8
- if (isString(val)) return existing ? existing + " " + val : val;
9
- const classes = new Set(existing ? existing.split(" ") : void 0);
9
+ if (isString(val)) return $existing ? $existing + " " + val : val;
10
+ const classes = new Set($existing ? $existing.split(" ") : void 0);
10
11
  for (let id in val) {
11
12
  deref(val[id]) ? classes.add(id) : classes.delete(id);
12
13
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/hiccup",
3
- "version": "5.2.10",
3
+ "version": "5.2.11",
4
4
  "description": "HTML/SVG/XML serialization of nested data structures, iterables & closures",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -128,5 +128,5 @@
128
128
  ],
129
129
  "year": 2016
130
130
  },
131
- "gitHead": "f6e26ea1142525171de5d36b9c3119f2782bb437\n"
131
+ "gitHead": "0d01681c64f5459647ab06f197f70dc90fb64cc9\n"
132
132
  }