@thi.ng/hiccup-svg 5.4.47 → 5.5.1

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**: 2025-07-21T08:21:58Z
3
+ - **Last updated**: 2025-07-30T22:32:35Z
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.
@@ -11,6 +11,14 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
11
11
  **Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
12
12
  and/or version bumps of transitive dependencies.
13
13
 
14
+ ## [5.5.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/hiccup-svg@5.5.0) (2025-07-26)
15
+
16
+ #### 🚀 Features
17
+
18
+ - add branch-level support for `__convert: false` ([a51d634](https://github.com/thi-ng/umbrella/commit/a51d634))
19
+ - update `convertTree()` to allow branch-local disabling of conversion
20
+ - add tests
21
+
14
22
  ### [5.4.13](https://github.com/thi-ng/umbrella/tree/@thi.ng/hiccup-svg@5.4.13) (2025-01-14)
15
23
 
16
24
  #### ♻️ Refactoring
package/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
  [![Mastodon Follow](https://img.shields.io/mastodon/follow/109331703950160316?domain=https%3A%2F%2Fmastodon.thi.ng&style=social)](https://mastodon.thi.ng/@toxi)
8
8
 
9
9
  > [!NOTE]
10
- > This is one of 209 standalone projects, maintained as part
10
+ > This is one of 210 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
  >
@@ -66,8 +66,9 @@ definitions and recursively converts it into an hiccup flavor which is ready for
66
66
  SVG serialization (i.e. using stringified geometry attribs). This conversion
67
67
  also involves translation & re-organization of various attributes. This function
68
68
  returns a new tree. The original remains untouched, as will any unrecognized
69
- tree / shape nodes (those will be transferred as-is to the result tree). See
70
- example below.
69
+ tree / shape nodes (those will be transferred as-is to the result tree).
70
+ Conversion can be explicitly disabled for individual elements (tree branches) by
71
+ setting the `__convert: false` control attribute. See example below.
71
72
 
72
73
  Tree conversion can be implicitly triggered by providing a `__convert: true`
73
74
  attribute to the root `svg()` element. This conversion also supports the
@@ -179,7 +180,7 @@ For Node.js REPL:
179
180
  const svg = await import("@thi.ng/hiccup-svg");
180
181
  ```
181
182
 
182
- Package sizes (brotli'd, pre-treeshake): ESM: 2.49 KB
183
+ Package sizes (brotli'd, pre-treeshake): ESM: 2.50 KB
183
184
 
184
185
  ## Dependencies
185
186
 
package/convert.d.ts CHANGED
@@ -7,6 +7,9 @@
7
7
  * remains untouched, as will any unrecognized tree/shape nodes.
8
8
  *
9
9
  * @remarks
10
+ * The `__convert` control attribute can be used to explicitly disable
11
+ * conversion for the given tree branch (i.e. use `{ __convert: false }`).
12
+ *
10
13
  * The `__prec` control attribute can be used (on a per-shape basis) to control
11
14
  * the formatting used for various floating point values (except color
12
15
  * conversions). See {@link setPrecision}. Child shapes (of a group) inherit the
package/convert.js CHANGED
@@ -45,6 +45,7 @@ const convertTree = (tree) => {
45
45
  return tree.map(convertTree);
46
46
  }
47
47
  let attribs = __convertAttribs(tree[1]);
48
+ if (attribs.__convert === false) return tree;
48
49
  if (attribs.__prec) {
49
50
  precisionStack.push(PRECISION);
50
51
  setPrecision(attribs.__prec);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/hiccup-svg",
3
- "version": "5.4.47",
3
+ "version": "5.5.1",
4
4
  "description": "SVG element functions for @thi.ng/hiccup & related tooling",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -39,10 +39,10 @@
39
39
  "tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
40
40
  },
41
41
  "dependencies": {
42
- "@thi.ng/api": "^8.11.32",
43
- "@thi.ng/checks": "^3.7.12",
44
- "@thi.ng/color": "^5.7.51",
45
- "@thi.ng/prefixes": "^2.3.49"
42
+ "@thi.ng/api": "^8.11.33",
43
+ "@thi.ng/checks": "^3.7.13",
44
+ "@thi.ng/color": "^5.7.53",
45
+ "@thi.ng/prefixes": "^2.3.50"
46
46
  },
47
47
  "devDependencies": {
48
48
  "esbuild": "^0.25.8",
@@ -142,5 +142,5 @@
142
142
  "parent": "@thi.ng/hiccup",
143
143
  "year": 2016
144
144
  },
145
- "gitHead": "c5c6b895169788c7f8b3d6d61ff76c0c6e5d2c2a\n"
145
+ "gitHead": "1df8a3a9061257ea73ccf1ab9cdf63c81a9f519f\n"
146
146
  }