sugar-high 0.8.3 → 0.8.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.
Files changed (2) hide show
  1. package/lib/index.js +8 -7
  2. package/package.json +5 -2
package/lib/index.js CHANGED
@@ -659,20 +659,21 @@ function generate(tokens) {
659
659
  /** @type {Array<any>} */
660
660
  const lineTokens = (
661
661
  tokens
662
- .map(([type, value]) => (
663
- {
662
+ .map(([type, value]) => {
663
+ const tokenType = TokenTypes[type]
664
+ return {
664
665
  type: 'element',
665
666
  tagName: 'span',
666
667
  children: [{
667
- type, // token type
668
- value: value, // to encode
668
+ type: 'text', // text node
669
+ value, // to encode
669
670
  }],
670
671
  properties: {
671
- className: `sh__token--${TokenTypes[type]}`,
672
- style: { color: `var(--sh-${TokenTypes[type]})` },
672
+ className: `sh__token--${tokenType}`,
673
+ style: { color: `var(--sh-${tokenType})` },
673
674
  },
674
675
  }
675
- ))
676
+ })
676
677
  )
677
678
  lines.push(createLine(lineTokens))
678
679
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sugar-high",
3
- "version": "0.8.3",
3
+ "version": "0.8.4",
4
4
  "type": "module",
5
5
  "types": "./lib/index.d.ts",
6
6
  "main": "./lib/index.js",
@@ -17,7 +17,7 @@
17
17
  "devDependencies": {
18
18
  "@types/node": "22.10.7",
19
19
  "@types/react": "19.0.7",
20
- "codice": "^0.5.0",
20
+ "codice": "^1.0.0-beta.0",
21
21
  "next": "15.1.5",
22
22
  "react": "^19.0.0",
23
23
  "react-dom": "^19.0.0",
@@ -25,5 +25,8 @@
25
25
  "typescript": "5.7.3",
26
26
  "vitest": "^3.0.2"
27
27
  },
28
+ "resolutions": {
29
+ "sugar-high": "link:./"
30
+ },
28
31
  "packageManager": "pnpm@8.7.1"
29
32
  }