@pantoken/icons 0.1.3 → 0.1.4
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/dist/index.d.mts +5 -2
- package/dist/index.mjs +2 -1
- package/package.json +3 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { IconResolver } from "@pantoken/model";
|
|
2
|
-
|
|
3
2
|
//#region src/index.d.ts
|
|
4
3
|
/** A pantoken icon, derived from an `<image>` token. */
|
|
5
4
|
interface PantokenIcon {
|
|
@@ -7,7 +6,11 @@ interface PantokenIcon {
|
|
|
7
6
|
name: string;
|
|
8
7
|
/** The `url('data:image/svg+xml;utf8,…')` value, as stored in the IR. */
|
|
9
8
|
dataUri: string;
|
|
10
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* The decoded inline SVG markup, stripped of `<script>` elements and event-handler attributes.
|
|
11
|
+
* Originates from the vendored IR (pinned upstream). Safe for trusted injection contexts;
|
|
12
|
+
* consumers should not treat this as safe for injection into attacker-controlled HTML.
|
|
13
|
+
*/
|
|
11
14
|
svg: string;
|
|
12
15
|
/** The SVG `viewBox`, when known. */
|
|
13
16
|
viewBox?: string;
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { tokens } from "@pantoken/tokens";
|
|
2
|
+
import { sanitizeSvg } from "@pantoken/utils";
|
|
2
3
|
//#region src/index.ts
|
|
3
4
|
/**
|
|
4
5
|
* `@pantoken/icons` — an ergonomic view over the IR's `<image>` tokens.
|
|
@@ -34,7 +35,7 @@ function decode(dataUri) {
|
|
|
34
35
|
const icons = tokens.filter((t) => t.meta?.kind === "icon").map((t) => ({
|
|
35
36
|
name: t.name.slice(14),
|
|
36
37
|
dataUri: t.value,
|
|
37
|
-
svg: decode(t.value),
|
|
38
|
+
svg: sanitizeSvg(decode(t.value)),
|
|
38
39
|
viewBox: t.meta?.viewBox,
|
|
39
40
|
bidirectional: Boolean(t.meta?.bidirectional),
|
|
40
41
|
source: t.meta?.source
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pantoken/icons",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "An ergonomic view over the pantoken IR's <image> tokens: decoded SVGs and per-icon metadata.",
|
|
5
5
|
"homepage": "https://pantoken.iywahl.com",
|
|
6
6
|
"bugs": "https://github.com/thedannywahl/pantoken/issues",
|
|
@@ -30,7 +30,8 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@pantoken/model": "workspace:*",
|
|
33
|
-
"@pantoken/tokens": "workspace:*"
|
|
33
|
+
"@pantoken/tokens": "workspace:*",
|
|
34
|
+
"@pantoken/utils": "workspace:*"
|
|
34
35
|
},
|
|
35
36
|
"devDependencies": {
|
|
36
37
|
"@types/node": "catalog:",
|