athena-ui-js 2.2.0 → 2.4.0
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/README.md +82 -3
- package/docs/styling.md +21 -1
- package/package.json +9 -1
- package/src/athena-ui.js +7 -1
- package/src/code.js +9 -0
- package/src/libs/config/config.js +1 -1
- package/src/libs/core/codeDiff.js +119 -0
- package/src/libs/core/codeLanguages.js +277 -0
- package/src/libs/core/gridLayout.js +102 -0
- package/src/libs/core/i18n.js +88 -0
- package/src/res/themes/default/style.css +656 -0
- package/src/res/themes/tokens.css +52 -0
- package/src/widgets.js +7 -0
- package/types/athena-ui.d.ts +6 -0
- package/types/code.d.ts +4 -0
- package/types/libs/config/config.d.ts +3 -3
- package/types/libs/core/codeDiff.d.ts +32 -0
- package/types/libs/core/codeLanguages.d.ts +58 -0
- package/types/libs/core/gridLayout.d.ts +45 -0
- package/types/libs/core/motion.d.ts +123 -123
- package/types/libs/core/theme.d.ts +41 -41
- package/types/libs/hephaestus/chartGenerator/chartGenerator.d.ts +95 -95
- package/types/libs/hephaestus/codeGenerator/codeEditor.d.ts +60 -0
- package/types/libs/hephaestus/codeGenerator/codeGenerator.d.ts +99 -0
- package/types/libs/hephaestus/componentGenerator/componentGenerator.d.ts +238 -238
- package/types/libs/hephaestus/router/router.d.ts +71 -71
- package/types/libs/hephaestus/tableGenerator/tableGenerator.d.ts +123 -123
- package/types/libs/hephaestus/widgetGrid/widgetGrid.d.ts +117 -0
- package/types/motion.d.ts +1 -1
- package/types/widgets.d.ts +2 -0
|
@@ -2374,4 +2374,660 @@ dialog.dialog[open]::backdrop {
|
|
|
2374
2374
|
animation: athena-pop var(--athena-duration-slow) var(--athena-ease-out) backwards;
|
|
2375
2375
|
}
|
|
2376
2376
|
|
|
2377
|
+
|
|
2378
|
+
/* ------------------------------------------------------------ Widgets
|
|
2379
|
+
createWidgetGrid: a CSS grid. The columns, the row height and the gap are classes (wg-cols-12, wg-rh-80, wg-gap-12) and so is the place of every
|
|
2380
|
+
widget (wg-x-1, wg-y-1, wg-w-3, wg-h-2), written into a constructed style sheet: no style attribute, so a strict Content-Security-Policy is fine.
|
|
2381
|
+
The controls of the edit mode (handle, buttons, resize edges) exist in every widget and are shown only in .is-editable. */
|
|
2382
|
+
|
|
2383
|
+
.athena-widget-grid {
|
|
2384
|
+
display: grid;
|
|
2385
|
+
position: relative;
|
|
2386
|
+
align-items: stretch;
|
|
2387
|
+
}
|
|
2388
|
+
|
|
2389
|
+
.widget {
|
|
2390
|
+
position: relative;
|
|
2391
|
+
display: flex;
|
|
2392
|
+
flex-direction: column;
|
|
2393
|
+
min-width: 0;
|
|
2394
|
+
min-height: 0;
|
|
2395
|
+
border: var(--athena-border-width) solid var(--athena-line);
|
|
2396
|
+
border-radius: var(--athena-radius);
|
|
2397
|
+
background: var(--athena-surface);
|
|
2398
|
+
color: var(--athena-fg);
|
|
2399
|
+
overflow: hidden;
|
|
2400
|
+
transition: box-shadow var(--athena-duration-fast) var(--athena-ease-standard), border-color var(--athena-duration-fast) var(--athena-ease-standard);
|
|
2401
|
+
}
|
|
2402
|
+
|
|
2403
|
+
.widget-header {
|
|
2404
|
+
display: flex;
|
|
2405
|
+
align-items: center;
|
|
2406
|
+
gap: 6px;
|
|
2407
|
+
padding: 6px 10px;
|
|
2408
|
+
border-bottom: var(--athena-border-width) solid var(--athena-line);
|
|
2409
|
+
background: var(--athena-surface-alt);
|
|
2410
|
+
}
|
|
2411
|
+
|
|
2412
|
+
.widget-title {
|
|
2413
|
+
flex: 1;
|
|
2414
|
+
min-width: 0;
|
|
2415
|
+
margin: 0;
|
|
2416
|
+
font-size: 0.95rem;
|
|
2417
|
+
font-weight: 600;
|
|
2418
|
+
overflow: hidden;
|
|
2419
|
+
text-overflow: ellipsis;
|
|
2420
|
+
white-space: nowrap;
|
|
2421
|
+
}
|
|
2422
|
+
|
|
2423
|
+
.widget-body {
|
|
2424
|
+
flex: 1;
|
|
2425
|
+
min-height: 0;
|
|
2426
|
+
padding: 10px;
|
|
2427
|
+
overflow: auto;
|
|
2428
|
+
}
|
|
2429
|
+
|
|
2430
|
+
.widget-note {
|
|
2431
|
+
margin: 0;
|
|
2432
|
+
color: var(--athena-muted);
|
|
2433
|
+
}
|
|
2434
|
+
|
|
2435
|
+
.widget.is-unknown,
|
|
2436
|
+
.widget.is-failed {
|
|
2437
|
+
border-style: dashed;
|
|
2438
|
+
}
|
|
2439
|
+
|
|
2440
|
+
.widget-handle,
|
|
2441
|
+
.widget-actions,
|
|
2442
|
+
.widget-resize {
|
|
2443
|
+
display: none;
|
|
2444
|
+
}
|
|
2445
|
+
|
|
2446
|
+
.widget-actions {
|
|
2447
|
+
gap: 2px;
|
|
2448
|
+
}
|
|
2449
|
+
|
|
2450
|
+
.widget-handle,
|
|
2451
|
+
.widget-action {
|
|
2452
|
+
padding: 2px 6px;
|
|
2453
|
+
border: var(--athena-border-width) solid transparent;
|
|
2454
|
+
border-radius: var(--athena-radius);
|
|
2455
|
+
background: transparent;
|
|
2456
|
+
color: var(--athena-fg);
|
|
2457
|
+
font: inherit;
|
|
2458
|
+
line-height: 1.2;
|
|
2459
|
+
cursor: pointer;
|
|
2460
|
+
}
|
|
2461
|
+
|
|
2462
|
+
.widget-handle:hover,
|
|
2463
|
+
.widget-action:hover {
|
|
2464
|
+
background: var(--athena-hover);
|
|
2465
|
+
}
|
|
2466
|
+
|
|
2467
|
+
.widget-handle:focus-visible,
|
|
2468
|
+
.widget-action:focus-visible {
|
|
2469
|
+
outline: var(--athena-focus-width) solid var(--athena-focus);
|
|
2470
|
+
outline-offset: 1px;
|
|
2471
|
+
}
|
|
2472
|
+
|
|
2473
|
+
.widget-handle {
|
|
2474
|
+
cursor: grab;
|
|
2475
|
+
touch-action: none;
|
|
2476
|
+
}
|
|
2477
|
+
|
|
2478
|
+
.widget-handle[aria-pressed="true"] {
|
|
2479
|
+
background: var(--athena-accent);
|
|
2480
|
+
color: var(--athena-accent-fg);
|
|
2481
|
+
}
|
|
2482
|
+
|
|
2483
|
+
.is-editable .widget-handle {
|
|
2484
|
+
display: inline-block;
|
|
2485
|
+
}
|
|
2486
|
+
|
|
2487
|
+
.is-editable .widget-actions {
|
|
2488
|
+
display: flex;
|
|
2489
|
+
}
|
|
2490
|
+
|
|
2491
|
+
.is-editable .widget {
|
|
2492
|
+
border-color: var(--athena-border);
|
|
2493
|
+
}
|
|
2494
|
+
|
|
2495
|
+
.is-editable .widget.is-locked .widget-handle,
|
|
2496
|
+
.is-editable .widget.is-locked .widget-resize {
|
|
2497
|
+
display: none;
|
|
2498
|
+
}
|
|
2499
|
+
|
|
2500
|
+
.is-editable .widget.is-locked .widget-title::after {
|
|
2501
|
+
content: " 🔒";
|
|
2502
|
+
}
|
|
2503
|
+
|
|
2504
|
+
.widget.is-dragging {
|
|
2505
|
+
z-index: 2;
|
|
2506
|
+
border-color: var(--athena-accent);
|
|
2507
|
+
box-shadow: var(--athena-shadow);
|
|
2508
|
+
}
|
|
2509
|
+
|
|
2510
|
+
.is-editable .widget-resize {
|
|
2511
|
+
display: block;
|
|
2512
|
+
position: absolute;
|
|
2513
|
+
z-index: 1;
|
|
2514
|
+
touch-action: none;
|
|
2515
|
+
}
|
|
2516
|
+
|
|
2517
|
+
.widget-resize-n,
|
|
2518
|
+
.widget-resize-s {
|
|
2519
|
+
left: 12px;
|
|
2520
|
+
right: 12px;
|
|
2521
|
+
height: 8px;
|
|
2522
|
+
cursor: ns-resize;
|
|
2523
|
+
}
|
|
2524
|
+
|
|
2525
|
+
.widget-resize-e,
|
|
2526
|
+
.widget-resize-w {
|
|
2527
|
+
top: 12px;
|
|
2528
|
+
bottom: 12px;
|
|
2529
|
+
width: 8px;
|
|
2530
|
+
cursor: ew-resize;
|
|
2531
|
+
}
|
|
2532
|
+
|
|
2533
|
+
.widget-resize-n { top: 0; }
|
|
2534
|
+
.widget-resize-s { bottom: 0; }
|
|
2535
|
+
.widget-resize-e { right: 0; }
|
|
2536
|
+
.widget-resize-w { left: 0; }
|
|
2537
|
+
|
|
2538
|
+
.widget-resize-ne,
|
|
2539
|
+
.widget-resize-nw,
|
|
2540
|
+
.widget-resize-se,
|
|
2541
|
+
.widget-resize-sw {
|
|
2542
|
+
width: 14px;
|
|
2543
|
+
height: 14px;
|
|
2544
|
+
}
|
|
2545
|
+
|
|
2546
|
+
.widget-resize-ne { top: 0; right: 0; cursor: nesw-resize; }
|
|
2547
|
+
.widget-resize-nw { top: 0; left: 0; cursor: nwse-resize; }
|
|
2548
|
+
.widget-resize-se { bottom: 0; right: 0; cursor: nwse-resize; }
|
|
2549
|
+
.widget-resize-sw { bottom: 0; left: 0; cursor: nesw-resize; }
|
|
2550
|
+
|
|
2551
|
+
.widget-resize-se::after {
|
|
2552
|
+
content: "";
|
|
2553
|
+
position: absolute;
|
|
2554
|
+
right: 3px;
|
|
2555
|
+
bottom: 3px;
|
|
2556
|
+
width: 8px;
|
|
2557
|
+
height: 8px;
|
|
2558
|
+
border-right: 2px solid var(--athena-muted);
|
|
2559
|
+
border-bottom: 2px solid var(--athena-muted);
|
|
2560
|
+
}
|
|
2561
|
+
|
|
2562
|
+
|
|
2563
|
+
/* ------------------------------------------------------------ Code
|
|
2564
|
+
highlightCode, generateCodeBlock, createCodeEditor and createDiffView. The colours of the tokens are the --athena-tok-* tokens. Line numbers are CSS counters
|
|
2565
|
+
(they are not copied); the editor is a transparent <textarea> over a highlighted <pre> in one scroller, so both must have the same font, padding and tab size. */
|
|
2566
|
+
|
|
2567
|
+
.athena-code,
|
|
2568
|
+
.code-editor-input {
|
|
2569
|
+
font: 0.875rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
|
|
2570
|
+
letter-spacing: normal;
|
|
2571
|
+
tab-size: 4;
|
|
2572
|
+
white-space: pre;
|
|
2573
|
+
overflow-wrap: normal;
|
|
2574
|
+
}
|
|
2575
|
+
|
|
2576
|
+
.athena-code.code-wrap,
|
|
2577
|
+
.code-editor.code-wrap .code-editor-input {
|
|
2578
|
+
white-space: pre-wrap;
|
|
2579
|
+
overflow-wrap: break-word;
|
|
2580
|
+
}
|
|
2581
|
+
|
|
2582
|
+
.athena-code {
|
|
2583
|
+
margin: 0;
|
|
2584
|
+
padding: 10px 0;
|
|
2585
|
+
overflow: auto;
|
|
2586
|
+
border-radius: var(--athena-radius);
|
|
2587
|
+
background: var(--athena-surface-alt);
|
|
2588
|
+
color: var(--athena-fg);
|
|
2589
|
+
counter-reset: line;
|
|
2590
|
+
}
|
|
2591
|
+
|
|
2592
|
+
.athena-code code {
|
|
2593
|
+
display: block;
|
|
2594
|
+
min-width: max-content;
|
|
2595
|
+
font: inherit;
|
|
2596
|
+
}
|
|
2597
|
+
|
|
2598
|
+
.athena-code.code-wrap code {
|
|
2599
|
+
min-width: 0;
|
|
2600
|
+
}
|
|
2601
|
+
|
|
2602
|
+
.code-line {
|
|
2603
|
+
display: block;
|
|
2604
|
+
min-height: 1lh;
|
|
2605
|
+
padding: 0 12px;
|
|
2606
|
+
}
|
|
2607
|
+
|
|
2608
|
+
.tok-comment { color: var(--athena-tok-comment); }
|
|
2609
|
+
.tok-string { color: var(--athena-tok-string); }
|
|
2610
|
+
.tok-number { color: var(--athena-tok-number); }
|
|
2611
|
+
.tok-keyword { color: var(--athena-tok-keyword); }
|
|
2612
|
+
.tok-literal { color: var(--athena-tok-literal); }
|
|
2613
|
+
.tok-function { color: var(--athena-tok-function); }
|
|
2614
|
+
.tok-type { color: var(--athena-tok-type); }
|
|
2615
|
+
.tok-property { color: var(--athena-tok-property); }
|
|
2616
|
+
.tok-tag { color: var(--athena-tok-tag); }
|
|
2617
|
+
.tok-attribute { color: var(--athena-tok-attribute); }
|
|
2618
|
+
.tok-variable { color: var(--athena-tok-variable); }
|
|
2619
|
+
.tok-selector { color: var(--athena-tok-selector); }
|
|
2620
|
+
.tok-meta { color: var(--athena-tok-meta); }
|
|
2621
|
+
.tok-entity { color: var(--athena-tok-entity); }
|
|
2622
|
+
.tok-builtin { color: var(--athena-tok-builtin); }
|
|
2623
|
+
.tok-operator { color: var(--athena-tok-operator); }
|
|
2624
|
+
.tok-punctuation { color: var(--athena-tok-punctuation); }
|
|
2625
|
+
.tok-comment { font-style: italic; }
|
|
2626
|
+
.tok-tag, .tok-keyword { font-weight: 600; }
|
|
2627
|
+
|
|
2628
|
+
.code-digits-1 { --code-gutter: 2ch; }
|
|
2629
|
+
.code-digits-2 { --code-gutter: 2ch; }
|
|
2630
|
+
.code-digits-3 { --code-gutter: 3ch; }
|
|
2631
|
+
.code-digits-4 { --code-gutter: 4ch; }
|
|
2632
|
+
.code-digits-5 { --code-gutter: 5ch; }
|
|
2633
|
+
.code-digits-6 { --code-gutter: 6ch; }
|
|
2634
|
+
.code-digits-7 { --code-gutter: 7ch; }
|
|
2635
|
+
|
|
2636
|
+
.athena-code.has-line-numbers .code-line::before {
|
|
2637
|
+
content: counter(line);
|
|
2638
|
+
counter-increment: line;
|
|
2639
|
+
display: inline-block;
|
|
2640
|
+
position: sticky;
|
|
2641
|
+
left: 0;
|
|
2642
|
+
width: var(--code-gutter, 2ch);
|
|
2643
|
+
margin-right: 1.5ch;
|
|
2644
|
+
text-align: right;
|
|
2645
|
+
text-indent: 0;
|
|
2646
|
+
color: var(--athena-muted);
|
|
2647
|
+
background: var(--athena-surface-alt);
|
|
2648
|
+
user-select: none;
|
|
2649
|
+
}
|
|
2650
|
+
|
|
2651
|
+
.athena-code.has-line-numbers.code-wrap .code-line {
|
|
2652
|
+
padding-left: calc(12px + var(--code-gutter, 2ch) + 1.5ch);
|
|
2653
|
+
text-indent: calc(-1 * (var(--code-gutter, 2ch) + 1.5ch));
|
|
2654
|
+
}
|
|
2655
|
+
|
|
2656
|
+
.code-line.is-highlighted {
|
|
2657
|
+
background: color-mix(in srgb, var(--athena-accent) 14%, transparent);
|
|
2658
|
+
}
|
|
2659
|
+
|
|
2660
|
+
.code-tab-1 .athena-code,
|
|
2661
|
+
.code-tab-1 .code-editor-input { tab-size: 1; }
|
|
2662
|
+
.code-tab-2 .athena-code,
|
|
2663
|
+
.code-tab-2 .code-editor-input { tab-size: 2; }
|
|
2664
|
+
.code-tab-3 .athena-code,
|
|
2665
|
+
.code-tab-3 .code-editor-input { tab-size: 3; }
|
|
2666
|
+
.code-tab-4 .athena-code,
|
|
2667
|
+
.code-tab-4 .code-editor-input { tab-size: 4; }
|
|
2668
|
+
.code-tab-5 .athena-code,
|
|
2669
|
+
.code-tab-5 .code-editor-input { tab-size: 5; }
|
|
2670
|
+
.code-tab-6 .athena-code,
|
|
2671
|
+
.code-tab-6 .code-editor-input { tab-size: 6; }
|
|
2672
|
+
.code-tab-7 .athena-code,
|
|
2673
|
+
.code-tab-7 .code-editor-input { tab-size: 7; }
|
|
2674
|
+
.code-tab-8 .athena-code,
|
|
2675
|
+
.code-tab-8 .code-editor-input { tab-size: 8; }
|
|
2676
|
+
.code-tab-9 .athena-code,
|
|
2677
|
+
.code-tab-9 .code-editor-input { tab-size: 9; }
|
|
2678
|
+
.code-tab-10 .athena-code,
|
|
2679
|
+
.code-tab-10 .code-editor-input { tab-size: 10; }
|
|
2680
|
+
.code-tab-11 .athena-code,
|
|
2681
|
+
.code-tab-11 .code-editor-input { tab-size: 11; }
|
|
2682
|
+
.code-tab-12 .athena-code,
|
|
2683
|
+
.code-tab-12 .code-editor-input { tab-size: 12; }
|
|
2684
|
+
.code-tab-13 .athena-code,
|
|
2685
|
+
.code-tab-13 .code-editor-input { tab-size: 13; }
|
|
2686
|
+
.code-tab-14 .athena-code,
|
|
2687
|
+
.code-tab-14 .code-editor-input { tab-size: 14; }
|
|
2688
|
+
.code-tab-15 .athena-code,
|
|
2689
|
+
.code-tab-15 .code-editor-input { tab-size: 15; }
|
|
2690
|
+
.code-tab-16 .athena-code,
|
|
2691
|
+
.code-tab-16 .code-editor-input { tab-size: 16; }
|
|
2692
|
+
|
|
2693
|
+
/* A block: the language, a copy button, the code */
|
|
2694
|
+
.code-block {
|
|
2695
|
+
margin: 0 0 1rem;
|
|
2696
|
+
border: var(--athena-border-width) solid var(--athena-line);
|
|
2697
|
+
border-radius: var(--athena-radius);
|
|
2698
|
+
overflow: hidden;
|
|
2699
|
+
}
|
|
2700
|
+
|
|
2701
|
+
.code-block-header {
|
|
2702
|
+
display: flex;
|
|
2703
|
+
align-items: center;
|
|
2704
|
+
justify-content: space-between;
|
|
2705
|
+
gap: 8px;
|
|
2706
|
+
padding: 4px 8px 4px 12px;
|
|
2707
|
+
border-bottom: var(--athena-border-width) solid var(--athena-line);
|
|
2708
|
+
background: var(--athena-surface);
|
|
2709
|
+
color: var(--athena-muted);
|
|
2710
|
+
font-size: 0.8rem;
|
|
2711
|
+
}
|
|
2712
|
+
|
|
2713
|
+
.code-block .athena-code {
|
|
2714
|
+
border-radius: 0;
|
|
2715
|
+
}
|
|
2716
|
+
|
|
2717
|
+
.code-block-copy,
|
|
2718
|
+
.code-find-button {
|
|
2719
|
+
padding: 2px 8px;
|
|
2720
|
+
border: var(--athena-border-width) solid var(--athena-line);
|
|
2721
|
+
border-radius: var(--athena-radius);
|
|
2722
|
+
background: var(--athena-bg);
|
|
2723
|
+
color: var(--athena-fg);
|
|
2724
|
+
font: inherit;
|
|
2725
|
+
cursor: pointer;
|
|
2726
|
+
}
|
|
2727
|
+
|
|
2728
|
+
.code-block-copy:hover,
|
|
2729
|
+
.code-find-button:hover {
|
|
2730
|
+
background: var(--athena-hover);
|
|
2731
|
+
}
|
|
2732
|
+
|
|
2733
|
+
.code-block-copy:focus-visible,
|
|
2734
|
+
.code-find-button:focus-visible,
|
|
2735
|
+
.code-find-input:focus-visible,
|
|
2736
|
+
.athena-code:focus-visible {
|
|
2737
|
+
outline: var(--athena-focus-width) solid var(--athena-focus);
|
|
2738
|
+
outline-offset: 1px;
|
|
2739
|
+
}
|
|
2740
|
+
|
|
2741
|
+
/* The editor */
|
|
2742
|
+
.code-editor {
|
|
2743
|
+
position: relative;
|
|
2744
|
+
display: flex;
|
|
2745
|
+
flex-direction: column;
|
|
2746
|
+
border: var(--athena-border-width) solid var(--athena-line);
|
|
2747
|
+
border-radius: var(--athena-radius);
|
|
2748
|
+
background: var(--athena-surface-alt);
|
|
2749
|
+
}
|
|
2750
|
+
|
|
2751
|
+
.code-editor:focus-within {
|
|
2752
|
+
outline: var(--athena-focus-width) solid var(--athena-focus);
|
|
2753
|
+
outline-offset: 1px;
|
|
2754
|
+
}
|
|
2755
|
+
|
|
2756
|
+
.code-editor-scroll {
|
|
2757
|
+
display: grid;
|
|
2758
|
+
grid-template-columns: minmax(100%, max-content);
|
|
2759
|
+
grid-template-rows: minmax(100%, auto);
|
|
2760
|
+
position: relative;
|
|
2761
|
+
min-height: var(--code-editor-min-height, 8rem);
|
|
2762
|
+
max-height: var(--code-editor-max-height, 32rem);
|
|
2763
|
+
overflow: auto;
|
|
2764
|
+
cursor: text;
|
|
2765
|
+
}
|
|
2766
|
+
|
|
2767
|
+
.code-editor.code-wrap .code-editor-scroll {
|
|
2768
|
+
grid-template-columns: minmax(0, 100%);
|
|
2769
|
+
}
|
|
2770
|
+
|
|
2771
|
+
.code-editor-highlight {
|
|
2772
|
+
grid-area: 1 / 1;
|
|
2773
|
+
overflow: visible;
|
|
2774
|
+
border-radius: 0;
|
|
2775
|
+
pointer-events: none;
|
|
2776
|
+
}
|
|
2777
|
+
|
|
2778
|
+
.code-editor-highlight code {
|
|
2779
|
+
min-width: 0;
|
|
2780
|
+
}
|
|
2781
|
+
|
|
2782
|
+
.code-editor-input {
|
|
2783
|
+
grid-area: 1 / 1;
|
|
2784
|
+
box-sizing: border-box;
|
|
2785
|
+
width: 100%;
|
|
2786
|
+
height: 100%;
|
|
2787
|
+
margin: 0;
|
|
2788
|
+
padding: 10px 12px;
|
|
2789
|
+
border: 0;
|
|
2790
|
+
outline: 0;
|
|
2791
|
+
resize: none;
|
|
2792
|
+
overflow: hidden;
|
|
2793
|
+
background: transparent;
|
|
2794
|
+
color: transparent;
|
|
2795
|
+
caret-color: var(--athena-fg);
|
|
2796
|
+
}
|
|
2797
|
+
|
|
2798
|
+
.code-editor-highlight.has-line-numbers ~ .code-editor-input {
|
|
2799
|
+
padding-left: calc(12px + var(--code-gutter, 2ch) + 1.5ch);
|
|
2800
|
+
}
|
|
2801
|
+
|
|
2802
|
+
.code-editor-input::selection {
|
|
2803
|
+
background: color-mix(in srgb, var(--athena-accent) 35%, transparent);
|
|
2804
|
+
color: transparent;
|
|
2805
|
+
}
|
|
2806
|
+
|
|
2807
|
+
.code-editor.is-readonly .code-editor-input {
|
|
2808
|
+
cursor: default;
|
|
2809
|
+
}
|
|
2810
|
+
|
|
2811
|
+
.code-editor-highlight.is-plain {
|
|
2812
|
+
white-space: pre;
|
|
2813
|
+
}
|
|
2814
|
+
|
|
2815
|
+
.code-line.is-current {
|
|
2816
|
+
background: color-mix(in srgb, var(--athena-fg) 7%, transparent);
|
|
2817
|
+
}
|
|
2818
|
+
|
|
2819
|
+
.code-line.is-locked-line {
|
|
2820
|
+
background: color-mix(in srgb, var(--athena-muted) 14%, transparent);
|
|
2821
|
+
}
|
|
2822
|
+
|
|
2823
|
+
.code-line.has-marker {
|
|
2824
|
+
text-decoration: underline wavy;
|
|
2825
|
+
text-decoration-thickness: 1px;
|
|
2826
|
+
text-underline-offset: 3px;
|
|
2827
|
+
}
|
|
2828
|
+
|
|
2829
|
+
.code-line.marker-error { text-decoration-color: var(--athena-danger); }
|
|
2830
|
+
.code-line.marker-warning { text-decoration-color: var(--athena-warning); }
|
|
2831
|
+
.code-line.marker-info { text-decoration-color: var(--athena-info); }
|
|
2832
|
+
.code-line.marker-error::before { color: var(--athena-danger); font-weight: 700; }
|
|
2833
|
+
.code-line.marker-warning::before { color: var(--athena-warning); font-weight: 700; }
|
|
2834
|
+
|
|
2835
|
+
.code-editor-status {
|
|
2836
|
+
display: flex;
|
|
2837
|
+
justify-content: space-between;
|
|
2838
|
+
gap: 12px;
|
|
2839
|
+
padding: 2px 10px;
|
|
2840
|
+
border-top: var(--athena-border-width) solid var(--athena-line);
|
|
2841
|
+
color: var(--athena-muted);
|
|
2842
|
+
font-size: 0.8rem;
|
|
2843
|
+
}
|
|
2844
|
+
|
|
2845
|
+
.code-find {
|
|
2846
|
+
display: flex;
|
|
2847
|
+
flex-direction: column;
|
|
2848
|
+
gap: 4px;
|
|
2849
|
+
padding: 6px 8px;
|
|
2850
|
+
border-bottom: var(--athena-border-width) solid var(--athena-line);
|
|
2851
|
+
background: var(--athena-surface);
|
|
2852
|
+
}
|
|
2853
|
+
|
|
2854
|
+
.code-find[hidden],
|
|
2855
|
+
.code-find-row[hidden] {
|
|
2856
|
+
display: none;
|
|
2857
|
+
}
|
|
2858
|
+
|
|
2859
|
+
.code-find-row {
|
|
2860
|
+
display: flex;
|
|
2861
|
+
flex-wrap: wrap;
|
|
2862
|
+
align-items: center;
|
|
2863
|
+
gap: 4px;
|
|
2864
|
+
}
|
|
2865
|
+
|
|
2866
|
+
.code-find-input {
|
|
2867
|
+
flex: 1;
|
|
2868
|
+
min-width: 8rem;
|
|
2869
|
+
padding: 3px 6px;
|
|
2870
|
+
border: var(--athena-border-width) solid var(--athena-line);
|
|
2871
|
+
border-radius: var(--athena-radius);
|
|
2872
|
+
background: var(--athena-bg);
|
|
2873
|
+
color: var(--athena-fg);
|
|
2874
|
+
font: inherit;
|
|
2875
|
+
}
|
|
2876
|
+
|
|
2877
|
+
.code-find-input[aria-invalid="true"] {
|
|
2878
|
+
border-color: var(--athena-danger);
|
|
2879
|
+
}
|
|
2880
|
+
|
|
2881
|
+
.code-find-button[aria-pressed="true"] {
|
|
2882
|
+
background: var(--athena-accent);
|
|
2883
|
+
color: var(--athena-accent-fg);
|
|
2884
|
+
}
|
|
2885
|
+
|
|
2886
|
+
.code-find-count {
|
|
2887
|
+
min-width: 6ch;
|
|
2888
|
+
color: var(--athena-muted);
|
|
2889
|
+
font-size: 0.8rem;
|
|
2890
|
+
}
|
|
2891
|
+
|
|
2892
|
+
.code-completions {
|
|
2893
|
+
position: absolute;
|
|
2894
|
+
top: var(--code-completion-top, 0);
|
|
2895
|
+
left: var(--code-completion-left, 0);
|
|
2896
|
+
z-index: 5;
|
|
2897
|
+
min-width: 12rem;
|
|
2898
|
+
max-height: 12rem;
|
|
2899
|
+
margin: 0;
|
|
2900
|
+
padding: 2px;
|
|
2901
|
+
overflow: auto;
|
|
2902
|
+
list-style: none;
|
|
2903
|
+
border: var(--athena-border-width) solid var(--athena-border);
|
|
2904
|
+
border-radius: var(--athena-radius);
|
|
2905
|
+
background: var(--athena-bg);
|
|
2906
|
+
color: var(--athena-fg);
|
|
2907
|
+
box-shadow: var(--athena-shadow);
|
|
2908
|
+
}
|
|
2909
|
+
|
|
2910
|
+
.code-completions[hidden] {
|
|
2911
|
+
display: none;
|
|
2912
|
+
}
|
|
2913
|
+
|
|
2914
|
+
.code-completion {
|
|
2915
|
+
display: flex;
|
|
2916
|
+
justify-content: space-between;
|
|
2917
|
+
gap: 16px;
|
|
2918
|
+
padding: 2px 8px;
|
|
2919
|
+
border-radius: var(--athena-radius);
|
|
2920
|
+
font: 0.85rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
2921
|
+
cursor: pointer;
|
|
2922
|
+
}
|
|
2923
|
+
|
|
2924
|
+
.code-completion-detail {
|
|
2925
|
+
color: var(--athena-muted);
|
|
2926
|
+
}
|
|
2927
|
+
|
|
2928
|
+
.code-completion.is-active {
|
|
2929
|
+
background: var(--athena-accent);
|
|
2930
|
+
color: var(--athena-accent-fg);
|
|
2931
|
+
}
|
|
2932
|
+
|
|
2933
|
+
.code-completion.is-active .code-completion-detail {
|
|
2934
|
+
color: inherit;
|
|
2935
|
+
}
|
|
2936
|
+
|
|
2937
|
+
::highlight(athena-code-bracket) {
|
|
2938
|
+
background-color: color-mix(in srgb, var(--athena-accent) 40%, transparent);
|
|
2939
|
+
}
|
|
2940
|
+
|
|
2941
|
+
::highlight(athena-code-find) {
|
|
2942
|
+
background-color: color-mix(in srgb, var(--athena-warning) 35%, transparent);
|
|
2943
|
+
}
|
|
2944
|
+
|
|
2945
|
+
::highlight(athena-code-find-current) {
|
|
2946
|
+
background-color: color-mix(in srgb, var(--athena-warning) 75%, transparent);
|
|
2947
|
+
}
|
|
2948
|
+
|
|
2949
|
+
/* The diff view */
|
|
2950
|
+
.code-diff {
|
|
2951
|
+
border: var(--athena-border-width) solid var(--athena-line);
|
|
2952
|
+
border-radius: var(--athena-radius);
|
|
2953
|
+
overflow: hidden;
|
|
2954
|
+
}
|
|
2955
|
+
|
|
2956
|
+
.code-diff-header {
|
|
2957
|
+
display: flex;
|
|
2958
|
+
gap: 12px;
|
|
2959
|
+
padding: 4px 12px;
|
|
2960
|
+
border-bottom: var(--athena-border-width) solid var(--athena-line);
|
|
2961
|
+
background: var(--athena-surface);
|
|
2962
|
+
font-size: 0.8rem;
|
|
2963
|
+
}
|
|
2964
|
+
|
|
2965
|
+
.code-diff[data-mode="split"] .code-diff-header {
|
|
2966
|
+
display: grid;
|
|
2967
|
+
grid-template-columns: auto auto 1fr 1fr;
|
|
2968
|
+
}
|
|
2969
|
+
|
|
2970
|
+
.code-diff-stat.is-added { color: var(--athena-success); }
|
|
2971
|
+
.code-diff-stat.is-removed { color: var(--athena-danger); }
|
|
2972
|
+
|
|
2973
|
+
.code-diff-code {
|
|
2974
|
+
border-radius: 0;
|
|
2975
|
+
padding: 0;
|
|
2976
|
+
}
|
|
2977
|
+
|
|
2978
|
+
.code-diff-row {
|
|
2979
|
+
display: grid;
|
|
2980
|
+
grid-template-columns: 1fr;
|
|
2981
|
+
}
|
|
2982
|
+
|
|
2983
|
+
.code-diff-body.is-split .code-diff-row {
|
|
2984
|
+
grid-template-columns: 1fr 1fr;
|
|
2985
|
+
}
|
|
2986
|
+
|
|
2987
|
+
.code-diff-cell {
|
|
2988
|
+
display: grid;
|
|
2989
|
+
grid-template-columns: 4ch 2ch 1fr;
|
|
2990
|
+
gap: 0 4px;
|
|
2991
|
+
padding: 0 8px;
|
|
2992
|
+
}
|
|
2993
|
+
|
|
2994
|
+
.code-diff-cell .code-line {
|
|
2995
|
+
padding: 0;
|
|
2996
|
+
}
|
|
2997
|
+
|
|
2998
|
+
.code-diff-cell.is-added { background: color-mix(in srgb, var(--athena-success) 16%, transparent); }
|
|
2999
|
+
.code-diff-cell.is-removed { background: color-mix(in srgb, var(--athena-danger) 16%, transparent); }
|
|
3000
|
+
.code-diff-cell.is-empty { background: color-mix(in srgb, var(--athena-muted) 8%, transparent); }
|
|
3001
|
+
|
|
3002
|
+
.code-diff-number,
|
|
3003
|
+
.code-diff-mark {
|
|
3004
|
+
color: var(--athena-muted);
|
|
3005
|
+
text-align: right;
|
|
3006
|
+
user-select: none;
|
|
3007
|
+
}
|
|
3008
|
+
|
|
3009
|
+
.code-diff-mark {
|
|
3010
|
+
text-align: center;
|
|
3011
|
+
}
|
|
3012
|
+
|
|
3013
|
+
.code-diff-row.is-skip {
|
|
3014
|
+
padding: 2px 12px;
|
|
3015
|
+
background: var(--athena-surface);
|
|
3016
|
+
}
|
|
3017
|
+
|
|
3018
|
+
.code-diff-skip {
|
|
3019
|
+
padding: 0;
|
|
3020
|
+
border: 0;
|
|
3021
|
+
background: none;
|
|
3022
|
+
color: var(--athena-accent);
|
|
3023
|
+
font: inherit;
|
|
3024
|
+
cursor: pointer;
|
|
3025
|
+
}
|
|
3026
|
+
|
|
3027
|
+
.code-diff-empty {
|
|
3028
|
+
margin: 0;
|
|
3029
|
+
padding: 8px 12px;
|
|
3030
|
+
color: var(--athena-muted);
|
|
3031
|
+
}
|
|
3032
|
+
|
|
2377
3033
|
}
|
|
@@ -29,6 +29,24 @@
|
|
|
29
29
|
--athena-warning: #9a6700;
|
|
30
30
|
--athena-info: #2471a3;
|
|
31
31
|
--athena-shadow: 0 4px 14px rgb(0 0 0 / 18%);
|
|
32
|
+
/* code highlighting: at least 4.5:1 on --athena-surface-alt (a test checks it) */
|
|
33
|
+
--athena-tok-comment: #5a6270;
|
|
34
|
+
--athena-tok-string: #0b6e3a;
|
|
35
|
+
--athena-tok-number: #a24b00;
|
|
36
|
+
--athena-tok-keyword: #7a2a9e;
|
|
37
|
+
--athena-tok-literal: #0b5fa5;
|
|
38
|
+
--athena-tok-function: #1f55b0;
|
|
39
|
+
--athena-tok-type: #0f6b6b;
|
|
40
|
+
--athena-tok-property: #9b2c5b;
|
|
41
|
+
--athena-tok-tag: #a3201f;
|
|
42
|
+
--athena-tok-attribute: #8a5300;
|
|
43
|
+
--athena-tok-variable: #0a6a8a;
|
|
44
|
+
--athena-tok-selector: #7a2a9e;
|
|
45
|
+
--athena-tok-meta: #6b4eae;
|
|
46
|
+
--athena-tok-entity: #0a6a8a;
|
|
47
|
+
--athena-tok-builtin: #0b5fa5;
|
|
48
|
+
--athena-tok-operator: #3b4048;
|
|
49
|
+
--athena-tok-punctuation: #5a6270;
|
|
32
50
|
|
|
33
51
|
/* shape and spacing */
|
|
34
52
|
--athena-radius: 6px;
|
|
@@ -94,6 +112,23 @@
|
|
|
94
112
|
--athena-warning: #e0b04a;
|
|
95
113
|
--athena-info: #5b9bd5;
|
|
96
114
|
--athena-shadow: 0 4px 14px rgb(0 0 0 / 55%);
|
|
115
|
+
--athena-tok-comment: #8b95a5;
|
|
116
|
+
--athena-tok-string: #8fd39c;
|
|
117
|
+
--athena-tok-number: #f0a56a;
|
|
118
|
+
--athena-tok-keyword: #c9a0f0;
|
|
119
|
+
--athena-tok-literal: #7fb8f0;
|
|
120
|
+
--athena-tok-function: #8fb4ff;
|
|
121
|
+
--athena-tok-type: #5fd0c8;
|
|
122
|
+
--athena-tok-property: #f08bb0;
|
|
123
|
+
--athena-tok-tag: #ff8f8f;
|
|
124
|
+
--athena-tok-attribute: #e8b86d;
|
|
125
|
+
--athena-tok-variable: #6fd0f0;
|
|
126
|
+
--athena-tok-selector: #c9a0f0;
|
|
127
|
+
--athena-tok-meta: #b4a0f0;
|
|
128
|
+
--athena-tok-entity: #6fd0f0;
|
|
129
|
+
--athena-tok-builtin: #7fb8f0;
|
|
130
|
+
--athena-tok-operator: #c3c8d0;
|
|
131
|
+
--athena-tok-punctuation: #9aa3b0;
|
|
97
132
|
}
|
|
98
133
|
|
|
99
134
|
/* ... or, when nothing was chosen, by the system */
|
|
@@ -117,5 +152,22 @@
|
|
|
117
152
|
--athena-warning: #e0b04a;
|
|
118
153
|
--athena-info: #5b9bd5;
|
|
119
154
|
--athena-shadow: 0 4px 14px rgb(0 0 0 / 55%);
|
|
155
|
+
--athena-tok-comment: #8b95a5;
|
|
156
|
+
--athena-tok-string: #8fd39c;
|
|
157
|
+
--athena-tok-number: #f0a56a;
|
|
158
|
+
--athena-tok-keyword: #c9a0f0;
|
|
159
|
+
--athena-tok-literal: #7fb8f0;
|
|
160
|
+
--athena-tok-function: #8fb4ff;
|
|
161
|
+
--athena-tok-type: #5fd0c8;
|
|
162
|
+
--athena-tok-property: #f08bb0;
|
|
163
|
+
--athena-tok-tag: #ff8f8f;
|
|
164
|
+
--athena-tok-attribute: #e8b86d;
|
|
165
|
+
--athena-tok-variable: #6fd0f0;
|
|
166
|
+
--athena-tok-selector: #c9a0f0;
|
|
167
|
+
--athena-tok-meta: #b4a0f0;
|
|
168
|
+
--athena-tok-entity: #6fd0f0;
|
|
169
|
+
--athena-tok-builtin: #7fb8f0;
|
|
170
|
+
--athena-tok-operator: #c3c8d0;
|
|
171
|
+
--athena-tok-punctuation: #9aa3b0;
|
|
120
172
|
}
|
|
121
173
|
}
|