@hirokisakabe/pom 5.0.0 → 5.0.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseXml.d.ts","sourceRoot":"","sources":["../../src/parseXml/parseXml.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAsC3C,qBAAa,aAAc,SAAQ,KAAK;IACtC,SAAgB,MAAM,EAAE,MAAM,EAAE,CAAC;gBACrB,MAAM,EAAE,MAAM,EAAE;CAM7B;
|
|
1
|
+
{"version":3,"file":"parseXml.d.ts","sourceRoot":"","sources":["../../src/parseXml/parseXml.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAsC3C,qBAAa,aAAc,SAAQ,KAAK;IACtC,SAAgB,MAAM,EAAE,MAAM,EAAE,CAAC;gBACrB,MAAM,EAAE,MAAM,EAAE;CAM7B;AAmoCD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,EAAE,CAiCrD"}
|
|
@@ -899,6 +899,12 @@ function convertPomNode(nodeType, tagName, attrs, childElements, textContent, er
|
|
|
899
899
|
if (!CONTAINER_TYPES.has(nodeType)) {
|
|
900
900
|
validateLeafNode(nodeType, result, errors);
|
|
901
901
|
}
|
|
902
|
+
// Normalize icon color: add # prefix if missing
|
|
903
|
+
if (nodeType === "icon" &&
|
|
904
|
+
typeof result.color === "string" &&
|
|
905
|
+
!result.color.startsWith("#")) {
|
|
906
|
+
result.color = `#${result.color}`;
|
|
907
|
+
}
|
|
902
908
|
return result;
|
|
903
909
|
}
|
|
904
910
|
/**
|
package/dist/types.js
CHANGED
|
@@ -367,7 +367,7 @@ const imageNodeSchema = basePOMNodeSchema.extend({
|
|
|
367
367
|
export const iconNameSchema = z.enum(Object.keys(ICON_DATA));
|
|
368
368
|
export const iconColorSchema = z
|
|
369
369
|
.string()
|
|
370
|
-
.regex(
|
|
370
|
+
.regex(/^#?[0-9a-fA-F]{3,8}$/)
|
|
371
371
|
.optional();
|
|
372
372
|
const iconNodeSchema = basePOMNodeSchema.extend({
|
|
373
373
|
type: z.literal("icon"),
|