juxscript 1.1.318 → 1.1.319
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":"codeparser.d.ts","sourceRoot":"","sources":["../../../lib/utils/codeparser.ts"],"names":[],"mappings":"AA2DA,MAAM,WAAW,UAAU;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,iBAAS,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAOxC;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAqB,GAAG,UAAU,EAAE,CAQrF;
|
|
1
|
+
{"version":3,"file":"codeparser.d.ts","sourceRoot":"","sources":["../../../lib/utils/codeparser.ts"],"names":[],"mappings":"AA2DA,MAAM,WAAW,UAAU;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,iBAAS,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAOxC;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAqB,GAAG,UAAU,EAAE,CAQrF;AAuPD;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,CAEnE;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAwD9C;;;;;;;AAED,wBAKE"}
|
|
@@ -225,7 +225,16 @@ function tokenizeLine(line) {
|
|
|
225
225
|
result += `<span class="${tokenClass}">${escaped}</span>`;
|
|
226
226
|
}
|
|
227
227
|
else {
|
|
228
|
-
|
|
228
|
+
// Check if it's a function call
|
|
229
|
+
let k = i + word.length;
|
|
230
|
+
while (k < len && line[k] === ' ')
|
|
231
|
+
k++;
|
|
232
|
+
if (line[k] === '(') {
|
|
233
|
+
result += `<span class="token-function">${escaped}</span>`;
|
|
234
|
+
}
|
|
235
|
+
else {
|
|
236
|
+
result += `<span class="token-identifier">${escaped}</span>`;
|
|
237
|
+
}
|
|
229
238
|
}
|
|
230
239
|
i += word.length;
|
|
231
240
|
continue;
|
|
@@ -237,6 +246,13 @@ function tokenizeLine(line) {
|
|
|
237
246
|
i += num.length;
|
|
238
247
|
continue;
|
|
239
248
|
}
|
|
249
|
+
// Dot/spread
|
|
250
|
+
if (char === '.') {
|
|
251
|
+
const op = consumeOperator(line, i);
|
|
252
|
+
result += `<span class="token-operator">${escapeHtml(op)}</span>`;
|
|
253
|
+
i += op.length;
|
|
254
|
+
continue;
|
|
255
|
+
}
|
|
240
256
|
// Operators (multi-char)
|
|
241
257
|
if (isOperator(char)) {
|
|
242
258
|
const op = consumeOperator(line, i);
|
|
@@ -306,100 +322,58 @@ export function getSyntaxHighlightCSS() {
|
|
|
306
322
|
return `
|
|
307
323
|
/* Semantic Code Highlighting */
|
|
308
324
|
.jux-code {
|
|
309
|
-
font-family: 'Consolas', 'Monaco', monospace;
|
|
310
|
-
font-size:
|
|
325
|
+
font-family: 'Consolas', 'Monaco', 'SF Mono', 'Fira Code', monospace;
|
|
326
|
+
font-size: 13px;
|
|
311
327
|
line-height: 1.6;
|
|
312
328
|
background: #1e1e1e;
|
|
329
|
+
color: #d4d4d4;
|
|
313
330
|
border-radius: 8px;
|
|
314
331
|
overflow: hidden;
|
|
315
|
-
margin:
|
|
332
|
+
margin: 0.5rem 0;
|
|
316
333
|
padding: 1rem;
|
|
317
334
|
overflow-x: auto;
|
|
318
335
|
}
|
|
319
|
-
|
|
320
336
|
.jux-code-lines {
|
|
321
337
|
display: block;
|
|
322
338
|
}
|
|
323
|
-
|
|
324
339
|
.jux-code-line {
|
|
325
340
|
display: flex;
|
|
326
341
|
align-items: flex-start;
|
|
327
342
|
min-height: 1.6em;
|
|
328
343
|
}
|
|
329
|
-
|
|
330
344
|
.jux-code-line:hover {
|
|
331
345
|
background-color: rgba(255, 255, 255, 0.03);
|
|
332
346
|
}
|
|
333
|
-
|
|
334
|
-
.jux-code-line-highlight {
|
|
335
|
-
background-color: rgba(255, 215, 0, 0.1);
|
|
336
|
-
border-left: 3px solid #ffd700;
|
|
337
|
-
padding-left: 0.5rem;
|
|
338
|
-
}
|
|
339
|
-
|
|
340
347
|
.jux-code-line-number {
|
|
341
348
|
display: inline-block;
|
|
342
|
-
min-width:
|
|
349
|
+
min-width: 2.5rem;
|
|
343
350
|
text-align: right;
|
|
344
351
|
padding-right: 1rem;
|
|
345
|
-
color: #
|
|
352
|
+
color: #555;
|
|
346
353
|
user-select: none;
|
|
347
354
|
flex-shrink: 0;
|
|
348
355
|
}
|
|
349
|
-
|
|
350
356
|
.jux-code-line-content {
|
|
351
357
|
flex: 1;
|
|
352
358
|
color: #d4d4d4;
|
|
353
359
|
white-space: pre;
|
|
354
|
-
overflow-x: auto;
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
.jux-code-no-numbers .jux-code-line-number {
|
|
358
|
-
display: none;
|
|
359
360
|
}
|
|
360
361
|
|
|
361
|
-
/*
|
|
362
|
-
.token-control
|
|
363
|
-
color: #
|
|
364
|
-
|
|
365
|
-
}
|
|
366
|
-
.token-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
}
|
|
370
|
-
.token-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
}
|
|
374
|
-
.token-
|
|
375
|
-
|
|
376
|
-
font-weight: 600;
|
|
377
|
-
}
|
|
378
|
-
.token-jux {
|
|
379
|
-
color: #56b6c2; /* Cyan - JUX-specific (jux, state, render) */
|
|
380
|
-
font-weight: 700;
|
|
381
|
-
}
|
|
382
|
-
.token-number {
|
|
383
|
-
color: #d19a66; /* Orange - numbers */
|
|
384
|
-
}
|
|
385
|
-
.token-string {
|
|
386
|
-
color: #98c379; /* Green - strings */
|
|
387
|
-
}
|
|
388
|
-
.token-comment {
|
|
389
|
-
color: #5c6370; /* Gray - comments */
|
|
390
|
-
font-style: italic;
|
|
391
|
-
}
|
|
392
|
-
.token-structural {
|
|
393
|
-
color: #abb2bf; /* Light gray - braces, brackets, parens */
|
|
394
|
-
font-weight: 600;
|
|
395
|
-
}
|
|
396
|
-
.token-delimiter {
|
|
397
|
-
color: #777; /* Dark gray - semicolons, commas, colons */
|
|
398
|
-
}
|
|
399
|
-
.token-operator {
|
|
400
|
-
color: #56b6c2; /* Cyan - operators (+, -, *, etc.) */
|
|
401
|
-
}
|
|
402
|
-
`;
|
|
362
|
+
/* Semantic token colors — One Dark inspired */
|
|
363
|
+
.token-control { color: #c678dd; font-weight: 600; }
|
|
364
|
+
.token-declaration { color: #61afef; font-weight: 600; }
|
|
365
|
+
.token-operator-keyword { color: #e06c75; font-weight: 600; }
|
|
366
|
+
.token-special { color: #e5c07b; font-weight: 600; }
|
|
367
|
+
.token-jux { color: #56b6c2; font-weight: 700; }
|
|
368
|
+
.token-number { color: #d19a66; }
|
|
369
|
+
.token-string { color: #98c379; }
|
|
370
|
+
.token-comment { color: #5c6370; font-style: italic; }
|
|
371
|
+
.token-function { color: #61afef; }
|
|
372
|
+
.token-identifier { color: #e06c75; }
|
|
373
|
+
.token-structural { color: #abb2bf; font-weight: 600; }
|
|
374
|
+
.token-delimiter { color: #777; }
|
|
375
|
+
.token-operator { color: #56b6c2; }
|
|
376
|
+
`;
|
|
403
377
|
}
|
|
404
378
|
export default {
|
|
405
379
|
parse: parseCode,
|