sugar-high 0.7.0 → 0.7.2

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/lib/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export function highlight(code: string): string
2
2
  export function tokenize(code: string): Array<[number, string]>
3
+ export function generate(tokens: string[]): Array<[number, string]>
package/lib/index.js CHANGED
@@ -435,6 +435,11 @@ function tokenize(code) {
435
435
  }
436
436
  // `=` in property=<value>
437
437
  if (next === '=' && !inStringContent()) {
438
+ // if current is not a space, ensure `prop` is a property
439
+ if (isSpaces(current)) {
440
+ append(T_SPACE, current)
441
+ current = ''
442
+ }
438
443
  const prop = current ? (current + curr) : curr
439
444
  if (isIdentifier(prop)) {
440
445
  current = prop
@@ -578,7 +583,7 @@ function tokenize(code) {
578
583
 
579
584
  /**
580
585
  * @param {Array<[number, string]>} tokens
581
- * @return {Array<any>}
586
+ * @return {Array<[number, string]>}
582
587
  */
583
588
  function generate(tokens) {
584
589
  const lines = []
@@ -587,8 +592,6 @@ function generate(tokens) {
587
592
  *
588
593
  */
589
594
  const createLine = (children) =>
590
- // generateType === 'html'
591
- // ? `<span class="sh__line">${content}</span>`
592
595
  ({
593
596
  type: 'element',
594
597
  tagName: 'span',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sugar-high",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
4
4
  "type": "module",
5
5
  "types": "./lib/index.d.ts",
6
6
  "exports": {
@@ -19,11 +19,11 @@
19
19
  },
20
20
  "devDependencies": {
21
21
  "codice": "^0.2.0",
22
- "next": "14.2.3",
22
+ "next": "15.0.1",
23
23
  "react": "^18.3.1",
24
24
  "react-dom": "^18.3.1",
25
25
  "sugar-high": "link:./",
26
- "vitest": "^1.2.2"
26
+ "vitest": "^2.1.3"
27
27
  },
28
28
  "packageManager": "pnpm@8.7.1"
29
29
  }