@dsplay/template-manifest 1.0.2 → 1.0.3

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.
Files changed (2) hide show
  1. package/core.js +3 -1
  2. package/package.json +1 -1
package/core.js CHANGED
@@ -32,8 +32,10 @@ const COLOR_NAME_HINT = /colou?r/i;
32
32
  function guessSubtype(key, type) {
33
33
  if (type !== 'string') return undefined;
34
34
  if (VIDEO_NAME_HINT.test(key)) return 'video';
35
- if (IMAGE_NAME_HINT.test(key)) return 'image';
35
+ // check color first: a literal "color"/"colour" substring is a more specific signal than
36
+ // the generic bg_/_bg prefix IMAGE_NAME_HINT also matches (e.g. "bg_color_1", "bg_font_color")
36
37
  if (COLOR_NAME_HINT.test(key)) return 'color';
38
+ if (IMAGE_NAME_HINT.test(key)) return 'image';
37
39
  return undefined;
38
40
  }
39
41
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dsplay/template-manifest",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Statically scans a DSPLAY HTML template's source for its dsplay_template variables and captures its dsplay-data.js as example preview data, producing template-variables.json + template-example-data.json for the CMS to auto-detect variables and seed default preview values.",
5
5
  "type": "module",
6
6
  "main": "./core.js",