@thi.ng/hiccup 5.2.9 → 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 +10 -1
- package/README.md +1 -1
- package/attribs.d.ts +1 -1
- package/attribs.js +4 -3
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
- **Last updated**: 2024-08-
|
|
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/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
[](https://mastodon.thi.ng/@toxi)
|
|
8
8
|
|
|
9
9
|
> [!NOTE]
|
|
10
|
-
> This is one of
|
|
10
|
+
> This is one of 199 standalone projects, maintained as part
|
|
11
11
|
> of the [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo
|
|
12
12
|
> and anti-framework.
|
|
13
13
|
>
|
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
|
-
|
|
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.
|
|
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",
|
|
@@ -36,14 +36,14 @@
|
|
|
36
36
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@thi.ng/api": "^8.11.
|
|
40
|
-
"@thi.ng/checks": "^3.6.
|
|
41
|
-
"@thi.ng/errors": "^2.5.
|
|
42
|
-
"@thi.ng/strings": "^3.8.
|
|
39
|
+
"@thi.ng/api": "^8.11.9",
|
|
40
|
+
"@thi.ng/checks": "^3.6.11",
|
|
41
|
+
"@thi.ng/errors": "^2.5.15",
|
|
42
|
+
"@thi.ng/strings": "^3.8.4"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@microsoft/api-extractor": "^7.47.5",
|
|
46
|
-
"@thi.ng/atom": "^5.3.
|
|
46
|
+
"@thi.ng/atom": "^5.3.9",
|
|
47
47
|
"esbuild": "^0.23.0",
|
|
48
48
|
"typedoc": "^0.26.5",
|
|
49
49
|
"typescript": "^5.5.4"
|
|
@@ -128,5 +128,5 @@
|
|
|
128
128
|
],
|
|
129
129
|
"year": 2016
|
|
130
130
|
},
|
|
131
|
-
"gitHead": "
|
|
131
|
+
"gitHead": "0d01681c64f5459647ab06f197f70dc90fb64cc9\n"
|
|
132
132
|
}
|