@terrazzo/parser 0.1.2 → 0.1.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @terrazzo/parser
2
2
 
3
+ ## 0.1.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#347](https://github.com/terrazzoapp/terrazzo/pull/347) [`b90287c`](https://github.com/terrazzoapp/terrazzo/commit/b90287cb13dc3bfdb24b8d6698931c7d156c3638) Thanks [@tomasfrancisco](https://github.com/tomasfrancisco)! - Add support for inset shadows
8
+
9
+ - Updated dependencies [[`b90287c`](https://github.com/terrazzoapp/terrazzo/commit/b90287cb13dc3bfdb24b8d6698931c7d156c3638)]:
10
+ - @terrazzo/token-tools@0.1.3
11
+
3
12
  ## 0.1.2
4
13
 
5
14
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@terrazzo/parser",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Parser/validator for the Design Tokens Community Group (DTCG) standard.",
5
5
  "type": "module",
6
6
  "author": {
@@ -39,7 +39,7 @@
39
39
  "picocolors": "^1.1.1",
40
40
  "wildcard-match": "^5.1.3",
41
41
  "yaml": "^2.6.0",
42
- "@terrazzo/token-tools": "^0.1.2"
42
+ "@terrazzo/token-tools": "^0.1.3"
43
43
  },
44
44
  "devDependencies": {
45
45
  "esbuild": "^0.23.1",
@@ -102,6 +102,7 @@ export default function normalizeValue(token) {
102
102
  offsetY: normalizeValue({ $type: 'dimension', $value: layer.offsetY ?? 0 }),
103
103
  blur: normalizeValue({ $type: 'dimension', $value: layer.blur ?? 0 }),
104
104
  spread: normalizeValue({ $type: 'dimension', $value: layer.spread ?? 0 }),
105
+ inset: layer.inset === true,
105
106
  }));
106
107
  }
107
108
  case 'strokeStyle': {
package/parse/validate.js CHANGED
@@ -461,6 +461,19 @@ export function validateNumber($value, node, { filename, src, logger }) {
461
461
  }
462
462
  }
463
463
 
464
+ /**
465
+ * Verify a Boolean token is valid
466
+ * @param {ValueNode} $value
467
+ * @param {AnyNode} node
468
+ * @param {ValidateOptions} options
469
+ * @return {void}
470
+ */
471
+ export function validateBoolean($value, node, { filename, src, logger }) {
472
+ if ($value.type !== 'Boolean') {
473
+ logger.error({ message: `Expected boolean, received ${$value.type}`, filename, node: $value, src });
474
+ }
475
+ }
476
+
464
477
  /**
465
478
  * Verify a Shadow token’s value is valid
466
479
  * @param {ValueNode} $value
@@ -481,6 +494,7 @@ export function validateShadowLayer($value, node, { filename, src, logger }) {
481
494
  offsetY: { validator: validateDimension, required: true },
482
495
  blur: { validator: validateDimension },
483
496
  spread: { validator: validateDimension },
497
+ inset: { validator: validateBoolean },
484
498
  },
485
499
  node,
486
500
  { filename, src, logger },