juxscript 1.1.145 → 1.1.148
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/components/base/BaseComponent.d.ts +64 -0
- package/lib/components/base/BaseComponent.d.ts.map +1 -1
- package/lib/components/base/BaseComponent.js +99 -0
- package/lib/components/base/BaseComponent.ts +117 -1
- package/lib/styles/foundation.css +33 -16
- package/lib/styles/themes.css +73 -67
- package/machinery/compiler4.js +6 -0
- package/machinery/errors.js +188 -0
- package/package.json +1 -1
|
@@ -144,6 +144,70 @@ export declare abstract class BaseComponent<TState extends BaseState = BaseState
|
|
|
144
144
|
protected _isTriggerEvent(event: string): boolean;
|
|
145
145
|
protected _isCallbackEvent(event: string): boolean;
|
|
146
146
|
protected _triggerCallback(eventName: string, ...args: any[]): void;
|
|
147
|
+
/**
|
|
148
|
+
* Register a click event handler
|
|
149
|
+
*/
|
|
150
|
+
click(handler: (e: MouseEvent) => void): this;
|
|
151
|
+
/**
|
|
152
|
+
* Register a double-click event handler
|
|
153
|
+
*/
|
|
154
|
+
dblclick(handler: (e: MouseEvent) => void): this;
|
|
155
|
+
/**
|
|
156
|
+
* Register a change event handler
|
|
157
|
+
*/
|
|
158
|
+
change(handler: (e: Event) => void): this;
|
|
159
|
+
/**
|
|
160
|
+
* Register an input event handler
|
|
161
|
+
*/
|
|
162
|
+
input(handler: (e: Event) => void): this;
|
|
163
|
+
/**
|
|
164
|
+
* Register a mouseover event handler
|
|
165
|
+
*/
|
|
166
|
+
hover(handler: (e: MouseEvent) => void): this;
|
|
167
|
+
/**
|
|
168
|
+
* Register a mouseout event handler
|
|
169
|
+
*/
|
|
170
|
+
mouseout(handler: (e: MouseEvent) => void): this;
|
|
171
|
+
/**
|
|
172
|
+
* Register a mousedown event handler
|
|
173
|
+
*/
|
|
174
|
+
mousedown(handler: (e: MouseEvent) => void): this;
|
|
175
|
+
/**
|
|
176
|
+
* Register a mouseup event handler
|
|
177
|
+
*/
|
|
178
|
+
mouseup(handler: (e: MouseEvent) => void): this;
|
|
179
|
+
/**
|
|
180
|
+
* Register a focus event handler (renamed to onFocus to avoid conflict with focus() method)
|
|
181
|
+
*/
|
|
182
|
+
onFocus(handler: (e: FocusEvent) => void): this;
|
|
183
|
+
/**
|
|
184
|
+
* Register a blur event handler (renamed to onBlur to avoid conflict with blur() method)
|
|
185
|
+
*/
|
|
186
|
+
onBlur(handler: (e: FocusEvent) => void): this;
|
|
187
|
+
/**
|
|
188
|
+
* Register a keydown event handler
|
|
189
|
+
*/
|
|
190
|
+
keydown(handler: (e: KeyboardEvent) => void): this;
|
|
191
|
+
/**
|
|
192
|
+
* Register a keyup event handler
|
|
193
|
+
*/
|
|
194
|
+
keyup(handler: (e: KeyboardEvent) => void): this;
|
|
195
|
+
/**
|
|
196
|
+
* Register a keypress event handler
|
|
197
|
+
*/
|
|
198
|
+
keypress(handler: (e: KeyboardEvent) => void): this;
|
|
199
|
+
/**
|
|
200
|
+
* Register a submit event handler
|
|
201
|
+
*/
|
|
202
|
+
submit(handler: (e: Event) => void): this;
|
|
203
|
+
/**
|
|
204
|
+
* Register a scroll event handler
|
|
205
|
+
*/
|
|
206
|
+
scroll(handler: (e: Event) => void): this;
|
|
207
|
+
/**
|
|
208
|
+
* Register a contextmenu (right-click) event handler
|
|
209
|
+
*/
|
|
210
|
+
contextmenu(handler: (e: MouseEvent) => void): this;
|
|
147
211
|
/**
|
|
148
212
|
* Roll back to previous state
|
|
149
213
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseComponent.d.ts","sourceRoot":"","sources":["BaseComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAKlD,OAAO,EAAmB,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,SAAS;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,C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);
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
|
+
/* ═════════════════════════════════════════════════════════════════
|
|
347
|
+
* FLUENT EVENT SHORTHANDS
|
|
348
|
+
* ═════════════════════════════════════════════════════════════════ */
|
|
349
|
+
/**
|
|
350
|
+
* Register a click event handler
|
|
351
|
+
*/
|
|
352
|
+
click(handler) {
|
|
353
|
+
return this.bind('click', handler);
|
|
354
|
+
}
|
|
355
|
+
/**
|
|
356
|
+
* Register a double-click event handler
|
|
357
|
+
*/
|
|
358
|
+
dblclick(handler) {
|
|
359
|
+
return this.bind('dblclick', handler);
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
* Register a change event handler
|
|
363
|
+
*/
|
|
364
|
+
change(handler) {
|
|
365
|
+
return this.bind('change', handler);
|
|
366
|
+
}
|
|
367
|
+
/**
|
|
368
|
+
* Register an input event handler
|
|
369
|
+
*/
|
|
370
|
+
input(handler) {
|
|
371
|
+
return this.bind('input', handler);
|
|
372
|
+
}
|
|
373
|
+
/**
|
|
374
|
+
* Register a mouseover event handler
|
|
375
|
+
*/
|
|
376
|
+
hover(handler) {
|
|
377
|
+
return this.bind('mouseover', handler);
|
|
378
|
+
}
|
|
379
|
+
/**
|
|
380
|
+
* Register a mouseout event handler
|
|
381
|
+
*/
|
|
382
|
+
mouseout(handler) {
|
|
383
|
+
return this.bind('mouseout', handler);
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* Register a mousedown event handler
|
|
387
|
+
*/
|
|
388
|
+
mousedown(handler) {
|
|
389
|
+
return this.bind('mousedown', handler);
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* Register a mouseup event handler
|
|
393
|
+
*/
|
|
394
|
+
mouseup(handler) {
|
|
395
|
+
return this.bind('mouseup', handler);
|
|
396
|
+
}
|
|
397
|
+
/**
|
|
398
|
+
* Register a focus event handler (renamed to onFocus to avoid conflict with focus() method)
|
|
399
|
+
*/
|
|
400
|
+
onFocus(handler) {
|
|
401
|
+
return this.bind('focus', handler);
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* Register a blur event handler (renamed to onBlur to avoid conflict with blur() method)
|
|
405
|
+
*/
|
|
406
|
+
onBlur(handler) {
|
|
407
|
+
return this.bind('blur', handler);
|
|
408
|
+
}
|
|
409
|
+
/**
|
|
410
|
+
* Register a keydown event handler
|
|
411
|
+
*/
|
|
412
|
+
keydown(handler) {
|
|
413
|
+
return this.bind('keydown', handler);
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* Register a keyup event handler
|
|
417
|
+
*/
|
|
418
|
+
keyup(handler) {
|
|
419
|
+
return this.bind('keyup', handler);
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* Register a keypress event handler
|
|
423
|
+
*/
|
|
424
|
+
keypress(handler) {
|
|
425
|
+
return this.bind('keypress', handler);
|
|
426
|
+
}
|
|
427
|
+
/**
|
|
428
|
+
* Register a submit event handler
|
|
429
|
+
*/
|
|
430
|
+
submit(handler) {
|
|
431
|
+
return this.bind('submit', handler);
|
|
432
|
+
}
|
|
433
|
+
/**
|
|
434
|
+
* Register a scroll event handler
|
|
435
|
+
*/
|
|
436
|
+
scroll(handler) {
|
|
437
|
+
return this.bind('scroll', handler);
|
|
438
|
+
}
|
|
439
|
+
/**
|
|
440
|
+
* Register a contextmenu (right-click) event handler
|
|
441
|
+
*/
|
|
442
|
+
contextmenu(handler) {
|
|
443
|
+
return this.bind('contextmenu', handler);
|
|
444
|
+
}
|
|
346
445
|
/* ═════════════════════════════════════════════════════════════════
|
|
347
446
|
* TIME-TRAVEL DEBUGGING (PUBLIC API)
|
|
348
447
|
* ═════════════════════════════════════════════════════════════════ */
|
|
@@ -430,6 +430,122 @@ export abstract class BaseComponent<TState extends BaseState = BaseState> {
|
|
|
430
430
|
}
|
|
431
431
|
}
|
|
432
432
|
|
|
433
|
+
/* ═════════════════════════════════════════════════════════════════
|
|
434
|
+
* FLUENT EVENT SHORTHANDS
|
|
435
|
+
* ═════════════════════════════════════════════════════════════════ */
|
|
436
|
+
|
|
437
|
+
/**
|
|
438
|
+
* Register a click event handler
|
|
439
|
+
*/
|
|
440
|
+
click(handler: (e: MouseEvent) => void): this {
|
|
441
|
+
return this.bind('click', handler);
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* Register a double-click event handler
|
|
446
|
+
*/
|
|
447
|
+
dblclick(handler: (e: MouseEvent) => void): this {
|
|
448
|
+
return this.bind('dblclick', handler);
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
/**
|
|
452
|
+
* Register a change event handler
|
|
453
|
+
*/
|
|
454
|
+
change(handler: (e: Event) => void): this {
|
|
455
|
+
return this.bind('change', handler);
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
/**
|
|
459
|
+
* Register an input event handler
|
|
460
|
+
*/
|
|
461
|
+
input(handler: (e: Event) => void): this {
|
|
462
|
+
return this.bind('input', handler);
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
/**
|
|
466
|
+
* Register a mouseover event handler
|
|
467
|
+
*/
|
|
468
|
+
hover(handler: (e: MouseEvent) => void): this {
|
|
469
|
+
return this.bind('mouseover', handler);
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
/**
|
|
473
|
+
* Register a mouseout event handler
|
|
474
|
+
*/
|
|
475
|
+
mouseout(handler: (e: MouseEvent) => void): this {
|
|
476
|
+
return this.bind('mouseout', handler);
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
/**
|
|
480
|
+
* Register a mousedown event handler
|
|
481
|
+
*/
|
|
482
|
+
mousedown(handler: (e: MouseEvent) => void): this {
|
|
483
|
+
return this.bind('mousedown', handler);
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
/**
|
|
487
|
+
* Register a mouseup event handler
|
|
488
|
+
*/
|
|
489
|
+
mouseup(handler: (e: MouseEvent) => void): this {
|
|
490
|
+
return this.bind('mouseup', handler);
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
/**
|
|
494
|
+
* Register a focus event handler (renamed to onFocus to avoid conflict with focus() method)
|
|
495
|
+
*/
|
|
496
|
+
onFocus(handler: (e: FocusEvent) => void): this {
|
|
497
|
+
return this.bind('focus', handler);
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
/**
|
|
501
|
+
* Register a blur event handler (renamed to onBlur to avoid conflict with blur() method)
|
|
502
|
+
*/
|
|
503
|
+
onBlur(handler: (e: FocusEvent) => void): this {
|
|
504
|
+
return this.bind('blur', handler);
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
/**
|
|
508
|
+
* Register a keydown event handler
|
|
509
|
+
*/
|
|
510
|
+
keydown(handler: (e: KeyboardEvent) => void): this {
|
|
511
|
+
return this.bind('keydown', handler);
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
/**
|
|
515
|
+
* Register a keyup event handler
|
|
516
|
+
*/
|
|
517
|
+
keyup(handler: (e: KeyboardEvent) => void): this {
|
|
518
|
+
return this.bind('keyup', handler);
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
/**
|
|
522
|
+
* Register a keypress event handler
|
|
523
|
+
*/
|
|
524
|
+
keypress(handler: (e: KeyboardEvent) => void): this {
|
|
525
|
+
return this.bind('keypress', handler);
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
/**
|
|
529
|
+
* Register a submit event handler
|
|
530
|
+
*/
|
|
531
|
+
submit(handler: (e: Event) => void): this {
|
|
532
|
+
return this.bind('submit', handler);
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
/**
|
|
536
|
+
* Register a scroll event handler
|
|
537
|
+
*/
|
|
538
|
+
scroll(handler: (e: Event) => void): this {
|
|
539
|
+
return this.bind('scroll', handler);
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
/**
|
|
543
|
+
* Register a contextmenu (right-click) event handler
|
|
544
|
+
*/
|
|
545
|
+
contextmenu(handler: (e: MouseEvent) => void): this {
|
|
546
|
+
return this.bind('contextmenu', handler);
|
|
547
|
+
}
|
|
548
|
+
|
|
433
549
|
/* ═════════════════════════════════════════════════════════════════
|
|
434
550
|
* TIME-TRAVEL DEBUGGING (PUBLIC API)
|
|
435
551
|
* ═════════════════════════════════════════════════════════════════ */
|
|
@@ -765,4 +881,4 @@ export abstract class BaseComponent<TState extends BaseState = BaseState> {
|
|
|
765
881
|
}
|
|
766
882
|
|
|
767
883
|
// ✅ Type assertion for Animations (all components have animation methods)
|
|
768
|
-
export interface BaseComponent extends Animations {}
|
|
884
|
+
export interface BaseComponent extends Animations { }
|
|
@@ -43,14 +43,15 @@
|
|
|
43
43
|
|
|
44
44
|
/* ═════════════════════════════════════════════════════════════════
|
|
45
45
|
* 📏 SPACING SCALE (Base units for padding, gap, margins)
|
|
46
|
+
* ✅ MORE GENEROUS - Premium feel
|
|
46
47
|
* ═════════════════════════════════════════════════════════════════ */
|
|
47
|
-
--jux-space-xs: 0.
|
|
48
|
-
--jux-space-sm: 0.
|
|
49
|
-
--jux-space-md: 1rem;
|
|
50
|
-
--jux-space-lg: 1.5rem;
|
|
51
|
-
--jux-space-xl:
|
|
52
|
-
--jux-space-2xl:
|
|
53
|
-
--jux-space-3xl:
|
|
48
|
+
--jux-space-xs: 0.375rem; /* 6px */
|
|
49
|
+
--jux-space-sm: 0.75rem; /* 12px */
|
|
50
|
+
--jux-space-md: 1rem; /* 16px - ✅ Increased */
|
|
51
|
+
--jux-space-lg: 1.5rem; /* 24px - ✅ Increased */
|
|
52
|
+
--jux-space-xl: 2.5rem; /* 40px - ✅ Increased */
|
|
53
|
+
--jux-space-2xl: 3.5rem; /* 56px - ✅ Increased */
|
|
54
|
+
--jux-space-3xl: 5rem; /* 80px - ✅ Increased */
|
|
54
55
|
|
|
55
56
|
/* ═════════════════════════════════════════════════════════════════
|
|
56
57
|
* 🔤 TYPOGRAPHY SCALE
|
|
@@ -321,27 +322,32 @@ html {
|
|
|
321
322
|
.jux-button {
|
|
322
323
|
/* Colors */
|
|
323
324
|
background: var(--jux-brand-bg);
|
|
324
|
-
color: var(--jux-surface-from);
|
|
325
|
+
color: var(--jux-surface-from);
|
|
325
326
|
border: var(--jux-stroke) solid var(--jux-border-color);
|
|
326
327
|
|
|
327
328
|
/* Shape */
|
|
328
329
|
border-radius: var(--jux-radius);
|
|
329
330
|
|
|
330
|
-
/* Size */
|
|
331
|
-
padding:
|
|
331
|
+
/* Size - ✅ MORE GENEROUS PADDING */
|
|
332
|
+
padding: 0.75rem 1.5rem; /* ✅ 12px 24px - much better */
|
|
332
333
|
font-size: var(--jux-font-size);
|
|
333
|
-
font-weight: var(--jux-weight-
|
|
334
|
+
font-weight: var(--jux-weight-semibold); /* ✅ Bolder */
|
|
334
335
|
font-family: var(--jux-font-family);
|
|
336
|
+
letter-spacing: 0.025em; /* ✅ Subtle spacing for premium feel */
|
|
335
337
|
|
|
336
338
|
/* Layout */
|
|
337
339
|
display: inline-flex;
|
|
338
340
|
align-items: center;
|
|
339
341
|
gap: var(--jux-space-sm);
|
|
340
342
|
|
|
343
|
+
/* ✅ PREMIUM SHADOWS */
|
|
344
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08),
|
|
345
|
+
0 1px 2px rgba(0, 0, 0, 0.06);
|
|
346
|
+
|
|
341
347
|
/* Interaction */
|
|
342
348
|
cursor: pointer;
|
|
343
349
|
user-select: none;
|
|
344
|
-
transition: all 0.
|
|
350
|
+
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); /* ✅ Smoother easing */
|
|
345
351
|
line-height: 1;
|
|
346
352
|
text-decoration: none;
|
|
347
353
|
}
|
|
@@ -349,20 +355,28 @@ html {
|
|
|
349
355
|
/* States use burn calculations */
|
|
350
356
|
.jux-button:hover:not(:disabled) {
|
|
351
357
|
background: var(--jux-brand-color-hover);
|
|
358
|
+
transform: translateY(-1px); /* ✅ Subtle lift */
|
|
359
|
+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1),
|
|
360
|
+
0 2px 4px rgba(0, 0, 0, 0.06);
|
|
352
361
|
}
|
|
353
362
|
|
|
354
363
|
.jux-button:active:not(:disabled) {
|
|
355
364
|
background: var(--jux-brand-color-active);
|
|
365
|
+
transform: translateY(0); /* ✅ Press down */
|
|
366
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
|
|
356
367
|
}
|
|
357
368
|
|
|
358
369
|
.jux-button:focus {
|
|
359
370
|
outline: none;
|
|
360
|
-
box-shadow: 0 0 0 3px color-mix(in srgb, var(--jux-brand-bg) 30%, transparent 70%)
|
|
371
|
+
box-shadow: 0 0 0 3px color-mix(in srgb, var(--jux-brand-bg) 30%, transparent 70%),
|
|
372
|
+
0 1px 3px rgba(0, 0, 0, 0.08);
|
|
361
373
|
}
|
|
362
374
|
|
|
363
375
|
.jux-button:disabled {
|
|
364
376
|
opacity: var(--jux-burn-strong);
|
|
365
377
|
cursor: not-allowed;
|
|
378
|
+
transform: none;
|
|
379
|
+
box-shadow: none;
|
|
366
380
|
}
|
|
367
381
|
|
|
368
382
|
/* ══════════════════════════════════════════════════════════════════
|
|
@@ -456,7 +470,7 @@ html {
|
|
|
456
470
|
══════════════════════════════════════════════════════════════════ */
|
|
457
471
|
|
|
458
472
|
.jux-button-small {
|
|
459
|
-
padding:
|
|
473
|
+
padding: 0.5rem 1rem; /* ✅ 8px 16px */
|
|
460
474
|
font-size: calc(var(--jux-text-base) * var(--jux-size-sm));
|
|
461
475
|
}
|
|
462
476
|
|
|
@@ -465,7 +479,7 @@ html {
|
|
|
465
479
|
}
|
|
466
480
|
|
|
467
481
|
.jux-button-large {
|
|
468
|
-
padding:
|
|
482
|
+
padding: 1rem 2rem; /* ✅ 16px 32px */
|
|
469
483
|
font-size: calc(var(--jux-text-base) * var(--jux-size-lg));
|
|
470
484
|
}
|
|
471
485
|
|
|
@@ -479,11 +493,13 @@ html {
|
|
|
479
493
|
font-weight: var(--jux-weight-bold);
|
|
480
494
|
line-height: var(--jux-leading-tight);
|
|
481
495
|
color: var(--jux-text-color);
|
|
496
|
+
letter-spacing: -0.025em; /* ✅ Tighter for headings */
|
|
482
497
|
}
|
|
483
498
|
|
|
484
499
|
.jux-heading-1 {
|
|
485
500
|
font-size: var(--jux-text-4xl);
|
|
486
501
|
font-weight: var(--jux-weight-black);
|
|
502
|
+
letter-spacing: -0.04em; /* ✅ Even tighter for h1 */
|
|
487
503
|
}
|
|
488
504
|
|
|
489
505
|
.jux-heading-2 {
|
|
@@ -520,6 +536,7 @@ html {
|
|
|
520
536
|
font-family: var(--jux-font-family);
|
|
521
537
|
font-size: var(--jux-text-base);
|
|
522
538
|
font-weight: var(--jux-weight-normal);
|
|
523
|
-
line-height: var(--jux-leading-
|
|
539
|
+
line-height: var(--jux-leading-relaxed); /* ✅ More breathing room */
|
|
524
540
|
color: var(--jux-text-color);
|
|
541
|
+
max-width: 65ch; /* ✅ Better readability */
|
|
525
542
|
}
|
package/lib/styles/themes.css
CHANGED
|
@@ -41,14 +41,14 @@
|
|
|
41
41
|
--jux-radius-2xl: 1.5rem;
|
|
42
42
|
--jux-radius-full: 9999px;
|
|
43
43
|
|
|
44
|
-
/* Spacing -
|
|
45
|
-
--jux-space-xs: 0.5rem;
|
|
46
|
-
--jux-space-sm: 0.75rem;
|
|
47
|
-
--jux-space-md:
|
|
48
|
-
--jux-space-lg:
|
|
49
|
-
--jux-space-xl:
|
|
50
|
-
--jux-space-2xl:
|
|
51
|
-
--jux-space-3xl:
|
|
44
|
+
/* Spacing - ✅ MORE GENEROUS */
|
|
45
|
+
--jux-space-xs: 0.5rem; /* 8px */
|
|
46
|
+
--jux-space-sm: 0.75rem; /* 12px */
|
|
47
|
+
--jux-space-md: 1rem; /* 16px */
|
|
48
|
+
--jux-space-lg: 1.75rem; /* 28px - ✅ Increased */
|
|
49
|
+
--jux-space-xl: 2.5rem; /* 40px - ✅ Increased */
|
|
50
|
+
--jux-space-2xl: 3.5rem; /* 56px - ✅ Increased */
|
|
51
|
+
--jux-space-3xl: 5rem; /* 80px - ✅ Increased */
|
|
52
52
|
|
|
53
53
|
/* Typography - San Francisco inspired */
|
|
54
54
|
--jux-font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", sans-serif;
|
|
@@ -64,9 +64,9 @@
|
|
|
64
64
|
--jux-burn-muted: 0.3;
|
|
65
65
|
--jux-burn-strong: 0.6;
|
|
66
66
|
|
|
67
|
-
/* ✅ DEFAULT STACK SPACING */
|
|
68
|
-
--jux-gap-token: var(--jux-space-
|
|
69
|
-
--jux-pad-token: var(--jux-space-xl);
|
|
67
|
+
/* ✅ DEFAULT STACK SPACING - More breathing room */
|
|
68
|
+
--jux-gap-token: var(--jux-space-md); /* 16px */
|
|
69
|
+
--jux-pad-token: var(--jux-space-xl); /* 40px */
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
[data-swag="apple"][data-mode="dark"] {
|
|
@@ -85,8 +85,8 @@
|
|
|
85
85
|
--jux-border-to: #545456;
|
|
86
86
|
|
|
87
87
|
/* ✅ DEFAULT STACK SPACING */
|
|
88
|
-
--jux-gap-token: var(--jux-space-
|
|
89
|
-
--jux-pad-token: var(--jux-space-
|
|
88
|
+
--jux-gap-token: var(--jux-space-md);
|
|
89
|
+
--jux-pad-token: var(--jux-space-lg);
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
/* ══════════════════════════════════════════════════════════════════
|
|
@@ -94,17 +94,21 @@
|
|
|
94
94
|
══════════════════════════════════════════════════════════════════ */
|
|
95
95
|
|
|
96
96
|
[data-swag="google"][data-mode="light"] {
|
|
97
|
+
/* Brand Colors */
|
|
97
98
|
--jux-brand-from: #4285f4;
|
|
98
99
|
--jux-brand-to: #1a73e8;
|
|
99
100
|
--jux-brand-accent-from: #34a853;
|
|
100
101
|
--jux-brand-accent-to: #0d652d;
|
|
101
102
|
|
|
103
|
+
/* Surfaces */
|
|
102
104
|
--jux-surface-from: #ffffff;
|
|
103
105
|
--jux-surface-to: #f8f9fa;
|
|
104
106
|
|
|
107
|
+
/* Text */
|
|
105
108
|
--jux-text-from: #202124;
|
|
106
109
|
--jux-text-to: #5f6368;
|
|
107
110
|
|
|
111
|
+
/* Borders */
|
|
108
112
|
--jux-border-from: #dadce0;
|
|
109
113
|
--jux-border-to: #5f6368;
|
|
110
114
|
|
|
@@ -117,14 +121,14 @@
|
|
|
117
121
|
--jux-radius-2xl: 1.25rem;
|
|
118
122
|
--jux-radius-full: 9999px;
|
|
119
123
|
|
|
120
|
-
/* Spacing -
|
|
121
|
-
--jux-space-xs: 0.
|
|
122
|
-
--jux-space-sm: 0.
|
|
124
|
+
/* Spacing - ✅ MORE GENEROUS */
|
|
125
|
+
--jux-space-xs: 0.5rem;
|
|
126
|
+
--jux-space-sm: 0.75rem;
|
|
123
127
|
--jux-space-md: 1rem;
|
|
124
|
-
--jux-space-lg: 1.5rem;
|
|
125
|
-
--jux-space-xl:
|
|
126
|
-
--jux-space-2xl:
|
|
127
|
-
--jux-space-3xl:
|
|
128
|
+
--jux-space-lg: 1.5rem; /* ✅ Increased */
|
|
129
|
+
--jux-space-xl: 2.5rem; /* ✅ Increased */
|
|
130
|
+
--jux-space-2xl: 3.5rem; /* ✅ Increased */
|
|
131
|
+
--jux-space-3xl: 5rem; /* ✅ Increased */
|
|
128
132
|
|
|
129
133
|
/* Typography - Roboto */
|
|
130
134
|
--jux-font-sans: "Roboto", "Helvetica", "Arial", sans-serif;
|
|
@@ -141,8 +145,8 @@
|
|
|
141
145
|
--jux-burn-strong: 0.5;
|
|
142
146
|
|
|
143
147
|
/* ✅ DEFAULT STACK SPACING */
|
|
144
|
-
--jux-gap-token: var(--jux-space-md);
|
|
145
|
-
--jux-pad-token: var(--jux-space-lg);
|
|
148
|
+
--jux-gap-token: var(--jux-space-md); /* 16px */
|
|
149
|
+
--jux-pad-token: var(--jux-space-lg); /* 24px */
|
|
146
150
|
}
|
|
147
151
|
|
|
148
152
|
[data-swag="google"][data-mode="dark"] {
|
|
@@ -161,8 +165,8 @@
|
|
|
161
165
|
--jux-border-to: #5f6368;
|
|
162
166
|
|
|
163
167
|
/* ✅ DEFAULT STACK SPACING */
|
|
164
|
-
--jux-gap-token: var(--jux-space-
|
|
165
|
-
--jux-pad-token: var(--jux-space-
|
|
168
|
+
--jux-gap-token: var(--jux-space-sm);
|
|
169
|
+
--jux-pad-token: var(--jux-space-md);
|
|
166
170
|
}
|
|
167
171
|
|
|
168
172
|
/* ══════════════════════════════════════════════════════════════════
|
|
@@ -170,17 +174,21 @@
|
|
|
170
174
|
══════════════════════════════════════════════════════════════════ */
|
|
171
175
|
|
|
172
176
|
[data-swag="stripe"][data-mode="light"] {
|
|
177
|
+
/* Brand Colors */
|
|
173
178
|
--jux-brand-from: #635bff;
|
|
174
179
|
--jux-brand-to: #0a2540;
|
|
175
180
|
--jux-brand-accent-from: #00d4ff;
|
|
176
181
|
--jux-brand-accent-to: #0073e6;
|
|
177
182
|
|
|
183
|
+
/* Surfaces */
|
|
178
184
|
--jux-surface-from: #ffffff;
|
|
179
185
|
--jux-surface-to: #f6f9fc;
|
|
180
186
|
|
|
187
|
+
/* Text */
|
|
181
188
|
--jux-text-from: #0a2540;
|
|
182
189
|
--jux-text-to: #425466;
|
|
183
190
|
|
|
191
|
+
/* Borders */
|
|
184
192
|
--jux-border-from: #e3e8ee;
|
|
185
193
|
--jux-border-to: #cbd2d9;
|
|
186
194
|
|
|
@@ -193,7 +201,7 @@
|
|
|
193
201
|
--jux-radius-2xl: 1rem;
|
|
194
202
|
--jux-radius-full: 9999px;
|
|
195
203
|
|
|
196
|
-
/* Spacing -
|
|
204
|
+
/* Spacing - ✅ UNCHANGED (already tight) */
|
|
197
205
|
--jux-space-xs: 0.25rem;
|
|
198
206
|
--jux-space-sm: 0.5rem;
|
|
199
207
|
--jux-space-md: 1rem;
|
|
@@ -216,9 +224,9 @@
|
|
|
216
224
|
--jux-burn-muted: 0.3;
|
|
217
225
|
--jux-burn-strong: 0.5;
|
|
218
226
|
|
|
219
|
-
/* ✅ DEFAULT STACK SPACING */
|
|
220
|
-
--jux-gap-token: var(--jux-space-
|
|
221
|
-
--jux-pad-token: var(--jux-space-md);
|
|
227
|
+
/* ✅ DEFAULT STACK SPACING - Reduced */
|
|
228
|
+
--jux-gap-token: var(--jux-space-sm); /* 8px instead of 16px */
|
|
229
|
+
--jux-pad-token: var(--jux-space-md); /* 16px instead of 16px (same) */
|
|
222
230
|
}
|
|
223
231
|
|
|
224
232
|
[data-swag="stripe"][data-mode="dark"] {
|
|
@@ -237,7 +245,7 @@
|
|
|
237
245
|
--jux-border-to: #2d4a6f;
|
|
238
246
|
|
|
239
247
|
/* ✅ DEFAULT STACK SPACING */
|
|
240
|
-
--jux-gap-token: var(--jux-space-
|
|
248
|
+
--jux-gap-token: var(--jux-space-sm);
|
|
241
249
|
--jux-pad-token: var(--jux-space-md);
|
|
242
250
|
}
|
|
243
251
|
|
|
@@ -246,17 +254,21 @@
|
|
|
246
254
|
══════════════════════════════════════════════════════════════════ */
|
|
247
255
|
|
|
248
256
|
[data-swag="gumroad"][data-mode="light"] {
|
|
257
|
+
/* Brand Colors */
|
|
249
258
|
--jux-brand-from: #ff90e8;
|
|
250
259
|
--jux-brand-to: #ff5ac4;
|
|
251
260
|
--jux-brand-accent-from: #36d9b8;
|
|
252
261
|
--jux-brand-accent-to: #1ead8a;
|
|
253
262
|
|
|
263
|
+
/* Surfaces */
|
|
254
264
|
--jux-surface-from: #ffffff;
|
|
255
265
|
--jux-surface-to: #f9f9f9;
|
|
256
266
|
|
|
267
|
+
/* Text */
|
|
257
268
|
--jux-text-from: #000000;
|
|
258
269
|
--jux-text-to: #999999;
|
|
259
270
|
|
|
271
|
+
/* Borders */
|
|
260
272
|
--jux-border-from: #e6e6e6;
|
|
261
273
|
--jux-border-to: #cccccc;
|
|
262
274
|
|
|
@@ -269,32 +281,18 @@
|
|
|
269
281
|
--jux-radius-2xl: 2rem;
|
|
270
282
|
--jux-radius-full: 9999px;
|
|
271
283
|
|
|
272
|
-
/* Spacing -
|
|
273
|
-
--jux-space-xs: 0.
|
|
274
|
-
--jux-space-sm: 0.
|
|
275
|
-
--jux-space-md:
|
|
276
|
-
--jux-space-lg:
|
|
277
|
-
--jux-space-xl:
|
|
278
|
-
--jux-space-2xl:
|
|
279
|
-
--jux-space-3xl:
|
|
280
|
-
|
|
281
|
-
/*
|
|
282
|
-
--jux-
|
|
283
|
-
--jux-
|
|
284
|
-
--jux-weight-medium: 500;
|
|
285
|
-
--jux-weight-semibold: 600;
|
|
286
|
-
--jux-weight-bold: 700;
|
|
287
|
-
|
|
288
|
-
/* Burn Factors - Vibrant transitions */
|
|
289
|
-
--jux-burn-subtle: 0.05;
|
|
290
|
-
--jux-burn-hover: 0.1;
|
|
291
|
-
--jux-burn-active: 0.15;
|
|
292
|
-
--jux-burn-muted: 0.25;
|
|
293
|
-
--jux-burn-strong: 0.4;
|
|
294
|
-
|
|
295
|
-
/* ✅ DEFAULT STACK SPACING */
|
|
296
|
-
--jux-gap-token: var(--jux-space-xl);
|
|
297
|
-
--jux-pad-token: var(--jux-space-2xl);
|
|
284
|
+
/* Spacing - ✅ REDUCED (was way too generous) */
|
|
285
|
+
--jux-space-xs: 0.25rem; /* 4px */
|
|
286
|
+
--jux-space-sm: 0.5rem; /* 8px */
|
|
287
|
+
--jux-space-md: 0.75rem; /* 12px */
|
|
288
|
+
--jux-space-lg: 1.25rem; /* 20px */
|
|
289
|
+
--jux-space-xl: 2rem; /* 32px */
|
|
290
|
+
--jux-space-2xl: 2.5rem; /* 40px */
|
|
291
|
+
--jux-space-3xl: 4rem; /* 64px */
|
|
292
|
+
|
|
293
|
+
/* ✅ DEFAULT STACK SPACING - Much more reasonable */
|
|
294
|
+
--jux-gap-token: var(--jux-space-md); /* 12px instead of 48px */
|
|
295
|
+
--jux-pad-token: var(--jux-space-lg); /* 20px instead of 64px */
|
|
298
296
|
}
|
|
299
297
|
|
|
300
298
|
[data-swag="gumroad"][data-mode="dark"] {
|
|
@@ -313,8 +311,8 @@
|
|
|
313
311
|
--jux-border-to: #666666;
|
|
314
312
|
|
|
315
313
|
/* ✅ DEFAULT STACK SPACING */
|
|
316
|
-
--jux-gap-token: var(--jux-space-
|
|
317
|
-
--jux-pad-token: var(--jux-space-
|
|
314
|
+
--jux-gap-token: var(--jux-space-md);
|
|
315
|
+
--jux-pad-token: var(--jux-space-lg);
|
|
318
316
|
}
|
|
319
317
|
|
|
320
318
|
/* ══════════════════════════════════════════════════════════════════
|
|
@@ -322,17 +320,21 @@
|
|
|
322
320
|
══════════════════════════════════════════════════════════════════ */
|
|
323
321
|
|
|
324
322
|
[data-swag="meta"][data-mode="light"] {
|
|
323
|
+
/* Brand Colors */
|
|
325
324
|
--jux-brand-from: #0866ff;
|
|
326
325
|
--jux-brand-to: #0554e5;
|
|
327
326
|
--jux-brand-accent-from: #0bc15c;
|
|
328
327
|
--jux-brand-accent-to: #089e48;
|
|
329
328
|
|
|
329
|
+
/* Surfaces */
|
|
330
330
|
--jux-surface-from: #ffffff;
|
|
331
331
|
--jux-surface-to: #f0f2f5;
|
|
332
332
|
|
|
333
|
+
/* Text */
|
|
333
334
|
--jux-text-from: #050505;
|
|
334
335
|
--jux-text-to: #65676b;
|
|
335
336
|
|
|
337
|
+
/* Borders */
|
|
336
338
|
--jux-border-from: #ced0d4;
|
|
337
339
|
--jux-border-to: #bcc0c4;
|
|
338
340
|
|
|
@@ -345,7 +347,7 @@
|
|
|
345
347
|
--jux-radius-2xl: 1.25rem;
|
|
346
348
|
--jux-radius-full: 9999px;
|
|
347
349
|
|
|
348
|
-
/* Spacing -
|
|
350
|
+
/* Spacing - ✅ UNCHANGED (already balanced) */
|
|
349
351
|
--jux-space-xs: 0.25rem;
|
|
350
352
|
--jux-space-sm: 0.5rem;
|
|
351
353
|
--jux-space-md: 1rem;
|
|
@@ -368,9 +370,9 @@
|
|
|
368
370
|
--jux-burn-muted: 0.25;
|
|
369
371
|
--jux-burn-strong: 0.5;
|
|
370
372
|
|
|
371
|
-
/* ✅ DEFAULT STACK SPACING */
|
|
372
|
-
--jux-gap-token: var(--jux-space-
|
|
373
|
-
--jux-pad-token: var(--jux-space-
|
|
373
|
+
/* ✅ DEFAULT STACK SPACING - Reduced */
|
|
374
|
+
--jux-gap-token: var(--jux-space-sm); /* 8px instead of 16px */
|
|
375
|
+
--jux-pad-token: var(--jux-space-md); /* 16px instead of 24px */
|
|
374
376
|
}
|
|
375
377
|
|
|
376
378
|
[data-swag="meta"][data-mode="dark"] {
|
|
@@ -389,8 +391,8 @@
|
|
|
389
391
|
--jux-border-to: #4e4f50;
|
|
390
392
|
|
|
391
393
|
/* ✅ DEFAULT STACK SPACING */
|
|
392
|
-
--jux-gap-token: var(--jux-space-
|
|
393
|
-
--jux-pad-token: var(--jux-space-
|
|
394
|
+
--jux-gap-token: var(--jux-space-sm);
|
|
395
|
+
--jux-pad-token: var(--jux-space-md);
|
|
394
396
|
}
|
|
395
397
|
|
|
396
398
|
/* ══════════════════════════════════════════════════════════════════
|
|
@@ -398,17 +400,21 @@
|
|
|
398
400
|
══════════════════════════════════════════════════════════════════ */
|
|
399
401
|
|
|
400
402
|
[data-swag="notion"][data-mode="light"] {
|
|
403
|
+
/* Brand Colors */
|
|
401
404
|
--jux-brand-from: #000000;
|
|
402
405
|
--jux-brand-to: #2e2e2e;
|
|
403
406
|
--jux-brand-accent-from: #0f7b6c;
|
|
404
407
|
--jux-brand-accent-to: #0a5a4f;
|
|
405
408
|
|
|
409
|
+
/* Surfaces */
|
|
406
410
|
--jux-surface-from: #ffffff;
|
|
407
411
|
--jux-surface-to: #f7f6f3;
|
|
408
412
|
|
|
413
|
+
/* Text */
|
|
409
414
|
--jux-text-from: #37352f;
|
|
410
415
|
--jux-text-to: #9b9a97;
|
|
411
416
|
|
|
417
|
+
/* Borders */
|
|
412
418
|
--jux-border-from: #e9e9e7;
|
|
413
419
|
--jux-border-to: #d3d1cb;
|
|
414
420
|
|
|
@@ -421,7 +427,7 @@
|
|
|
421
427
|
--jux-radius-2xl: 0.75rem;
|
|
422
428
|
--jux-radius-full: 9999px;
|
|
423
429
|
|
|
424
|
-
/* Spacing -
|
|
430
|
+
/* Spacing - ✅ UNCHANGED (already compact) */
|
|
425
431
|
--jux-space-xs: 0.25rem;
|
|
426
432
|
--jux-space-sm: 0.5rem;
|
|
427
433
|
--jux-space-md: 0.75rem;
|
|
@@ -444,9 +450,9 @@
|
|
|
444
450
|
--jux-burn-muted: 0.35;
|
|
445
451
|
--jux-burn-strong: 0.6;
|
|
446
452
|
|
|
447
|
-
/* ✅ DEFAULT STACK SPACING */
|
|
448
|
-
--jux-gap-token: var(--jux-space-sm);
|
|
449
|
-
--jux-pad-token: var(--jux-space-md);
|
|
453
|
+
/* ✅ DEFAULT STACK SPACING - Already good */
|
|
454
|
+
--jux-gap-token: var(--jux-space-sm); /* 8px */
|
|
455
|
+
--jux-pad-token: var(--jux-space-md); /* 12px */
|
|
450
456
|
}
|
|
451
457
|
|
|
452
458
|
[data-swag="notion"][data-mode="dark"] {
|
package/machinery/compiler4.js
CHANGED
|
@@ -4,6 +4,7 @@ import { walk } from 'astray';
|
|
|
4
4
|
import fs from 'fs';
|
|
5
5
|
import path from 'path';
|
|
6
6
|
import { fileURLToPath } from 'url';
|
|
7
|
+
import { generateErrorCollector } from './errors.js';
|
|
7
8
|
|
|
8
9
|
const __filename = fileURLToPath(import.meta.url);
|
|
9
10
|
const __dirname = path.dirname(__filename);
|
|
@@ -616,6 +617,11 @@ export class JuxCompiler {
|
|
|
616
617
|
<meta charset="UTF-8">
|
|
617
618
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
618
619
|
<title>JUX Application</title>
|
|
620
|
+
${generateErrorCollector({
|
|
621
|
+
enabled: process.env.NODE_ENV !== 'production',
|
|
622
|
+
maxErrors: 50,
|
|
623
|
+
position: 'bottom-right'
|
|
624
|
+
})}
|
|
619
625
|
<script type="module" src="/bundle.js"></script>
|
|
620
626
|
</head>
|
|
621
627
|
<body>
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generates an injectable client-side error collector script.
|
|
3
|
+
* Catches runtime errors, unhandled promise rejections, and console.error calls.
|
|
4
|
+
* Displays them in a floating overlay panel in the browser.
|
|
5
|
+
*
|
|
6
|
+
* @param {Object} options
|
|
7
|
+
* @param {boolean} [options.enabled=true] - Whether to enable the collector
|
|
8
|
+
* @param {number} [options.maxErrors=50] - Max errors to keep in buffer
|
|
9
|
+
* @param {string} [options.position='bottom-right'] - Panel position
|
|
10
|
+
* @returns {string} Inline script to inject into HTML
|
|
11
|
+
*/
|
|
12
|
+
export function generateErrorCollector(options = {}) {
|
|
13
|
+
const {
|
|
14
|
+
enabled = true,
|
|
15
|
+
maxErrors = 50,
|
|
16
|
+
position = 'bottom-right'
|
|
17
|
+
} = options;
|
|
18
|
+
|
|
19
|
+
if (!enabled) return '';
|
|
20
|
+
|
|
21
|
+
return `
|
|
22
|
+
<script>
|
|
23
|
+
(function() {
|
|
24
|
+
var __juxErrors = [];
|
|
25
|
+
var __juxMaxErrors = ${maxErrors};
|
|
26
|
+
var __juxPanel = null;
|
|
27
|
+
var __juxList = null;
|
|
28
|
+
var __juxBadge = null;
|
|
29
|
+
var __juxVisible = false;
|
|
30
|
+
|
|
31
|
+
var posMap = {
|
|
32
|
+
'bottom-right': 'bottom:12px;right:12px;',
|
|
33
|
+
'bottom-left': 'bottom:12px;left:12px;',
|
|
34
|
+
'top-right': 'top:12px;right:12px;',
|
|
35
|
+
'top-left': 'top:12px;left:12px;'
|
|
36
|
+
};
|
|
37
|
+
var panelPos = posMap['${position}'] || posMap['bottom-right'];
|
|
38
|
+
|
|
39
|
+
function createPanel() {
|
|
40
|
+
// Toggle button / badge
|
|
41
|
+
__juxBadge = document.createElement('div');
|
|
42
|
+
__juxBadge.id = '__jux-error-badge';
|
|
43
|
+
__juxBadge.setAttribute('style',
|
|
44
|
+
'position:fixed;' + panelPos +
|
|
45
|
+
'z-index:99999;width:36px;height:36px;border-radius:50%;' +
|
|
46
|
+
'background:#e74c3c;color:#fff;font-size:14px;font-weight:bold;' +
|
|
47
|
+
'display:none;align-items:center;justify-content:center;cursor:pointer;' +
|
|
48
|
+
'font-family:monospace;box-shadow:0 2px 8px rgba(0,0,0,0.3);'
|
|
49
|
+
);
|
|
50
|
+
__juxBadge.textContent = '0';
|
|
51
|
+
__juxBadge.addEventListener('click', togglePanel);
|
|
52
|
+
document.body.appendChild(__juxBadge);
|
|
53
|
+
|
|
54
|
+
// Panel
|
|
55
|
+
__juxPanel = document.createElement('div');
|
|
56
|
+
__juxPanel.id = '__jux-error-panel';
|
|
57
|
+
__juxPanel.setAttribute('style',
|
|
58
|
+
'position:fixed;bottom:56px;right:12px;z-index:99998;' +
|
|
59
|
+
'width:480px;max-height:360px;background:#1e1e1e;color:#f8f8f8;' +
|
|
60
|
+
'border:1px solid #e74c3c;border-radius:8px;font-family:monospace;' +
|
|
61
|
+
'font-size:12px;display:none;flex-direction:column;' +
|
|
62
|
+
'box-shadow:0 4px 16px rgba(0,0,0,0.4);'
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
// Header
|
|
66
|
+
var header = document.createElement('div');
|
|
67
|
+
header.setAttribute('style',
|
|
68
|
+
'padding:8px 12px;background:#e74c3c;color:#fff;font-weight:bold;' +
|
|
69
|
+
'display:flex;justify-content:space-between;align-items:center;' +
|
|
70
|
+
'border-radius:7px 7px 0 0;'
|
|
71
|
+
);
|
|
72
|
+
header.innerHTML = '<span>⚠ Runtime Errors</span>';
|
|
73
|
+
|
|
74
|
+
var clearBtn = document.createElement('button');
|
|
75
|
+
clearBtn.textContent = 'Clear';
|
|
76
|
+
clearBtn.setAttribute('style',
|
|
77
|
+
'background:transparent;border:1px solid #fff;color:#fff;' +
|
|
78
|
+
'padding:2px 8px;border-radius:4px;cursor:pointer;font-size:11px;'
|
|
79
|
+
);
|
|
80
|
+
clearBtn.addEventListener('click', clearErrors);
|
|
81
|
+
header.appendChild(clearBtn);
|
|
82
|
+
|
|
83
|
+
__juxPanel.appendChild(header);
|
|
84
|
+
|
|
85
|
+
// List
|
|
86
|
+
__juxList = document.createElement('div');
|
|
87
|
+
__juxList.setAttribute('style',
|
|
88
|
+
'overflow-y:auto;max-height:300px;padding:8px;'
|
|
89
|
+
);
|
|
90
|
+
__juxPanel.appendChild(__juxList);
|
|
91
|
+
|
|
92
|
+
document.body.appendChild(__juxPanel);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function togglePanel() {
|
|
96
|
+
__juxVisible = !__juxVisible;
|
|
97
|
+
__juxPanel.style.display = __juxVisible ? 'flex' : 'none';
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function clearErrors() {
|
|
101
|
+
__juxErrors = [];
|
|
102
|
+
__juxList.innerHTML = '';
|
|
103
|
+
__juxBadge.textContent = '0';
|
|
104
|
+
__juxBadge.style.display = 'none';
|
|
105
|
+
__juxPanel.style.display = 'none';
|
|
106
|
+
__juxVisible = false;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function addError(type, message, source, line, col, stack) {
|
|
110
|
+
if (__juxErrors.length >= __juxMaxErrors) __juxErrors.shift();
|
|
111
|
+
|
|
112
|
+
var entry = {
|
|
113
|
+
type: type,
|
|
114
|
+
message: String(message || ''),
|
|
115
|
+
source: source || '',
|
|
116
|
+
line: line || 0,
|
|
117
|
+
col: col || 0,
|
|
118
|
+
stack: stack || '',
|
|
119
|
+
time: new Date().toLocaleTimeString()
|
|
120
|
+
};
|
|
121
|
+
__juxErrors.push(entry);
|
|
122
|
+
|
|
123
|
+
if (!__juxPanel) createPanel();
|
|
124
|
+
|
|
125
|
+
// Update badge
|
|
126
|
+
__juxBadge.textContent = String(__juxErrors.length);
|
|
127
|
+
__juxBadge.style.display = 'flex';
|
|
128
|
+
|
|
129
|
+
// Add to list
|
|
130
|
+
var item = document.createElement('div');
|
|
131
|
+
item.setAttribute('style',
|
|
132
|
+
'padding:6px 8px;margin-bottom:4px;background:#2d2d2d;border-radius:4px;' +
|
|
133
|
+
'border-left:3px solid ' + (type === 'error' ? '#e74c3c' : type === 'rejection' ? '#e67e22' : '#f39c12') + ';'
|
|
134
|
+
);
|
|
135
|
+
|
|
136
|
+
var label = type === 'error' ? '❌ Error' : type === 'rejection' ? '💥 Rejection' : '⚠ Console';
|
|
137
|
+
|
|
138
|
+
item.innerHTML =
|
|
139
|
+
'<div style="color:#888;font-size:10px;margin-bottom:2px;">' +
|
|
140
|
+
entry.time + ' • ' + label +
|
|
141
|
+
(entry.source ? ' • ' + entry.source + ':' + entry.line : '') +
|
|
142
|
+
'</div>' +
|
|
143
|
+
'<div style="word-break:break-word;">' + escapeHtml(entry.message) + '</div>' +
|
|
144
|
+
(entry.stack ? '<details style="margin-top:4px;"><summary style="cursor:pointer;color:#888;font-size:10px;">Stack trace</summary><pre style="margin:4px 0 0;font-size:10px;color:#aaa;white-space:pre-wrap;">' + escapeHtml(entry.stack) + '</pre></details>' : '');
|
|
145
|
+
|
|
146
|
+
__juxList.appendChild(item);
|
|
147
|
+
__juxList.scrollTop = __juxList.scrollHeight;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
function escapeHtml(str) {
|
|
151
|
+
return String(str).replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>');
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// --- Hooks ---
|
|
155
|
+
|
|
156
|
+
// 1. window.onerror
|
|
157
|
+
window.onerror = function(msg, source, line, col, err) {
|
|
158
|
+
addError('error', msg, source, line, col, err && err.stack ? err.stack : '');
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
// 2. Unhandled promise rejections
|
|
162
|
+
window.addEventListener('unhandledrejection', function(e) {
|
|
163
|
+
var reason = e.reason;
|
|
164
|
+
var msg = reason instanceof Error ? reason.message : String(reason);
|
|
165
|
+
var stack = reason instanceof Error ? reason.stack : '';
|
|
166
|
+
addError('rejection', msg, '', 0, 0, stack);
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
// 3. Intercept console.error
|
|
170
|
+
var _origConsoleError = console.error;
|
|
171
|
+
console.error = function() {
|
|
172
|
+
var args = Array.prototype.slice.call(arguments);
|
|
173
|
+
var msg = args.map(function(a) {
|
|
174
|
+
return typeof a === 'object' ? JSON.stringify(a, null, 2) : String(a);
|
|
175
|
+
}).join(' ');
|
|
176
|
+
addError('console', msg);
|
|
177
|
+
_origConsoleError.apply(console, arguments);
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
// Expose API for programmatic access
|
|
181
|
+
window.__juxErrors = {
|
|
182
|
+
list: function() { return __juxErrors.slice(); },
|
|
183
|
+
clear: clearErrors,
|
|
184
|
+
count: function() { return __juxErrors.length; }
|
|
185
|
+
};
|
|
186
|
+
})();
|
|
187
|
+
</script>`;
|
|
188
|
+
}
|