@lemoncat7/dsh-knowledge 2.9.3 → 2.9.5
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 +4 -0
- package/docs/dsh-015-compatibility.md +21 -0
- package/docs/releases/2.9.5.md +11 -0
- package/lib/client.d.ts.map +1 -1
- package/lib/client.js +295 -743
- package/lib/client.js.map +4 -4
- package/lib/docked-panel-compat.d.ts +13 -0
- package/lib/docked-panel-compat.d.ts.map +1 -0
- package/lib/docked-panel-compat.js +116 -0
- package/lib/docked-panel-compat.js.map +1 -0
- package/lib/knowledge-activity-controller.d.ts.map +1 -1
- package/lib/knowledge-activity-controller.js +36 -0
- package/lib/knowledge-activity-controller.js.map +1 -1
- package/lib/knowledge-activity-state.d.ts +2 -2
- package/lib/knowledge-activity-state.d.ts.map +1 -1
- package/lib/knowledge-activity-state.js +5 -3
- package/lib/knowledge-activity-state.js.map +1 -1
- package/lib/main-panel-compat.d.ts +5 -0
- package/lib/main-panel-compat.d.ts.map +1 -0
- package/lib/main-panel-compat.js +38 -0
- package/lib/main-panel-compat.js.map +1 -0
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -25,7 +25,7 @@ __export(client_exports, {
|
|
|
25
25
|
inject: () => inject
|
|
26
26
|
});
|
|
27
27
|
module.exports = __toCommonJS(client_exports);
|
|
28
|
-
var
|
|
28
|
+
var import_react6 = require("react");
|
|
29
29
|
|
|
30
30
|
// src/writeback/status-client.ts
|
|
31
31
|
var WritebackStatusClient = class {
|
|
@@ -305,9 +305,10 @@ function knowledgeDesignCss(scope = ":root", dark = ':root[data-color-scheme="da
|
|
|
305
305
|
}
|
|
306
306
|
|
|
307
307
|
// src/knowledge-activity-state.ts
|
|
308
|
-
function availableActivitySession(state) {
|
|
308
|
+
function availableActivitySession(state, docked = false) {
|
|
309
309
|
const current = state.current;
|
|
310
|
-
|
|
310
|
+
if (current === void 0 || state.byId[current] === void 0) return void 0;
|
|
311
|
+
return docked || state.byId[current]?.blank === false ? String(current) : void 0;
|
|
311
312
|
}
|
|
312
313
|
function mergeActivitySelection(previous, next) {
|
|
313
314
|
const merged = { ...previous, ...next };
|
|
@@ -317,660 +318,156 @@ function mergeActivitySelection(previous, next) {
|
|
|
317
318
|
return merged;
|
|
318
319
|
}
|
|
319
320
|
|
|
320
|
-
// src/
|
|
321
|
-
var
|
|
322
|
-
|
|
323
|
-
.
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
)
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
.
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
/* The official footer slot is a horizontal list. Only opt its immediate
|
|
424
|
-
container into wrapping; leave neighboring plugin controls untouched. */
|
|
425
|
-
:has(> .dsh-knowledge-launcher) { flex-wrap: wrap; }
|
|
426
|
-
/* The host's collapsed footer is shrink-to-fit. Bound it to the rail rather
|
|
427
|
-
than centering our button inside a width determined by neighboring plugins. */
|
|
428
|
-
:has(> .dsh-knowledge-launcher--rail) { width: 100% !important; max-width: 100%; min-width: 0; }
|
|
429
|
-
|
|
430
|
-
.dsh-knowledge-launcher {
|
|
431
|
-
display: flex;
|
|
432
|
-
flex: 0 0 100%;
|
|
433
|
-
order: -1;
|
|
434
|
-
min-width: 0;
|
|
435
|
-
gap: 4px;
|
|
436
|
-
padding-block: 4px;
|
|
437
|
-
box-sizing: border-box;
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
.dsh-knowledge-launcher--rail { flex-direction: column; align-items: center; }
|
|
441
|
-
|
|
442
|
-
.dsh-knowledge-trigger {
|
|
443
|
-
position: relative;
|
|
444
|
-
flex: 1 1 auto;
|
|
445
|
-
min-width: 0;
|
|
446
|
-
display: flex;
|
|
447
|
-
align-items: center;
|
|
448
|
-
gap: 8px;
|
|
449
|
-
width: auto;
|
|
450
|
-
height: 36px;
|
|
451
|
-
margin: 0;
|
|
452
|
-
padding: 6px 10px;
|
|
453
|
-
box-sizing: border-box;
|
|
454
|
-
border: 0;
|
|
455
|
-
border-radius: 12px;
|
|
456
|
-
overflow: hidden;
|
|
457
|
-
background: transparent;
|
|
458
|
-
color: var(--knowledge-text);
|
|
459
|
-
cursor: pointer;
|
|
460
|
-
font: inherit;
|
|
461
|
-
font-size: 14px;
|
|
462
|
-
line-height: 22px;
|
|
463
|
-
white-space: nowrap;
|
|
464
|
-
isolation: isolate;
|
|
465
|
-
transition:
|
|
466
|
-
color 120ms ease,
|
|
467
|
-
background-color 120ms ease,
|
|
468
|
-
box-shadow 160ms ease;
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
.dsh-knowledge-trigger:hover {
|
|
472
|
-
background: var(--knowledge-hover);
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
.dsh-knowledge-trigger:focus-visible,
|
|
476
|
-
.dsh-knowledge-writeback-notice button:focus-visible {
|
|
477
|
-
outline: 2px solid var(--knowledge-accent);
|
|
478
|
-
outline-offset: 2px;
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
.dsh-knowledge-trigger.is-active {
|
|
482
|
-
background: var(--knowledge-control);
|
|
483
|
-
color: var(--knowledge-text);
|
|
484
|
-
box-shadow: 0 1px 2px rgb(0 0 0 / 7%), inset 0 1px 0 rgb(255 255 255 / 28%);
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
.dsh-knowledge-trigger--rail {
|
|
488
|
-
width: 36px;
|
|
489
|
-
height: 36px;
|
|
490
|
-
margin: 8px 0 10px;
|
|
491
|
-
padding: 0;
|
|
492
|
-
justify-content: center;
|
|
493
|
-
gap: 0;
|
|
494
|
-
border-radius: 50%;
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
.dsh-knowledge-trigger--rail { margin-inline: auto; }
|
|
498
|
-
|
|
499
|
-
.dsh-knowledge-launcher .dsh-knowledge-trigger--rail { flex: none; margin-block: 0; }
|
|
500
|
-
.dsh-knowledge-panel-trigger { flex: 0 0 36px; width: 36px; padding: 0; justify-content: center; }
|
|
501
|
-
.dsh-knowledge-panel-trigger:disabled { opacity: .4; cursor: default; background: transparent; }
|
|
502
|
-
.dsh-knowledge-launcher--rail .dsh-knowledge-panel-trigger { flex: none; border-radius: 50%; }
|
|
503
|
-
|
|
504
|
-
@media (prefers-reduced-motion: reduce) {
|
|
505
|
-
.dsh-knowledge-trigger { transition: none; }
|
|
506
|
-
}
|
|
507
|
-
|
|
508
|
-
.dsh-knowledge-workspace {
|
|
509
|
-
width: 100%;
|
|
510
|
-
height: 100%;
|
|
511
|
-
min-width: 0;
|
|
512
|
-
min-height: 0;
|
|
513
|
-
display: flex;
|
|
514
|
-
flex-direction: column;
|
|
515
|
-
overflow: hidden;
|
|
516
|
-
background: var(--knowledge-canvas);
|
|
517
|
-
}
|
|
518
|
-
|
|
519
|
-
.dsh-knowledge-workspace-header {
|
|
520
|
-
position: relative;
|
|
521
|
-
z-index: 2;
|
|
522
|
-
flex: none;
|
|
523
|
-
display: flex;
|
|
524
|
-
align-items: center;
|
|
525
|
-
justify-content: space-between;
|
|
526
|
-
gap: 16px;
|
|
527
|
-
min-height: 52px;
|
|
528
|
-
margin: 8px 10px 0;
|
|
529
|
-
padding: 7px 14px;
|
|
530
|
-
box-sizing: border-box;
|
|
531
|
-
border: 1px solid var(--knowledge-border);
|
|
532
|
-
border-radius: 14px 14px 11px 11px;
|
|
533
|
-
background: transparent;
|
|
534
|
-
box-shadow: var(--knowledge-glass-shadow);
|
|
535
|
-
-webkit-backdrop-filter: var(--knowledge-host-glass-filter);
|
|
536
|
-
backdrop-filter: var(--knowledge-host-glass-filter);
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
.dsh-knowledge-workspace-header > div {
|
|
540
|
-
display: flex;
|
|
541
|
-
align-items: center;
|
|
542
|
-
gap: 10px;
|
|
543
|
-
min-width: 0;
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
.dsh-knowledge-workspace-header [data-knowledge-workspace-close] {
|
|
547
|
-
-webkit-appearance: none;
|
|
548
|
-
appearance: none;
|
|
549
|
-
display: grid;
|
|
550
|
-
place-items: center;
|
|
551
|
-
box-sizing: border-box;
|
|
552
|
-
flex: none;
|
|
553
|
-
width: 30px;
|
|
554
|
-
height: 30px;
|
|
555
|
-
margin: 0;
|
|
556
|
-
padding: 0;
|
|
557
|
-
border: 1px solid transparent;
|
|
558
|
-
border-radius: 9px;
|
|
559
|
-
color: var(--knowledge-text-secondary);
|
|
560
|
-
background: transparent;
|
|
561
|
-
font: inherit;
|
|
562
|
-
line-height: 1;
|
|
563
|
-
-webkit-tap-highlight-color: transparent;
|
|
564
|
-
cursor: pointer;
|
|
565
|
-
transition: color 120ms ease, background-color 120ms ease, border-color 120ms ease;
|
|
566
|
-
}
|
|
567
|
-
|
|
568
|
-
.dsh-knowledge-workspace-header [data-knowledge-workspace-close]:hover {
|
|
569
|
-
border-color: var(--knowledge-border);
|
|
570
|
-
color: var(--knowledge-text);
|
|
571
|
-
background: var(--knowledge-control);
|
|
572
|
-
}
|
|
573
|
-
|
|
574
|
-
.dsh-knowledge-workspace-header [data-knowledge-workspace-close]:active { border-color: var(--knowledge-text-secondary); }
|
|
575
|
-
.dsh-knowledge-workspace-header [data-knowledge-workspace-close]:focus-visible {
|
|
576
|
-
outline: 2px solid var(--knowledge-accent);
|
|
577
|
-
outline-offset: 2px;
|
|
578
|
-
}
|
|
579
|
-
.dsh-knowledge-workspace-header [data-knowledge-workspace-close] > svg {
|
|
580
|
-
display: block;
|
|
581
|
-
pointer-events: none;
|
|
582
|
-
}
|
|
583
|
-
|
|
584
|
-
.dsh-knowledge-workspace-header > div > span {
|
|
585
|
-
display: grid;
|
|
586
|
-
min-width: 0;
|
|
587
|
-
gap: 2px;
|
|
588
|
-
}
|
|
589
|
-
|
|
590
|
-
.dsh-knowledge-workspace-header h2,
|
|
591
|
-
.dsh-knowledge-workspace-header p {
|
|
592
|
-
margin: 0;
|
|
593
|
-
}
|
|
594
|
-
|
|
595
|
-
.dsh-knowledge-workspace-header h2 {
|
|
596
|
-
color: var(--knowledge-text);
|
|
597
|
-
font-size: 15px;
|
|
598
|
-
line-height: 22px;
|
|
599
|
-
font-weight: 600;
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
.dsh-knowledge-workspace-header p {
|
|
603
|
-
color: var(--knowledge-text-secondary);
|
|
604
|
-
font-size: 11px;
|
|
605
|
-
line-height: 16px;
|
|
606
|
-
}
|
|
607
|
-
|
|
608
|
-
.dsh-knowledge-frame {
|
|
609
|
-
flex: 1;
|
|
610
|
-
display: block;
|
|
611
|
-
width: 100%;
|
|
612
|
-
min-height: 0;
|
|
613
|
-
margin: 0;
|
|
614
|
-
border: 0;
|
|
615
|
-
border-radius: 0;
|
|
616
|
-
background: transparent;
|
|
617
|
-
box-shadow: none;
|
|
618
|
-
-webkit-backdrop-filter: none;
|
|
619
|
-
backdrop-filter: none;
|
|
620
|
-
}
|
|
621
|
-
|
|
622
|
-
.dsh-knowledge-panel-state {
|
|
623
|
-
flex: 1;
|
|
624
|
-
display: flex;
|
|
625
|
-
align-items: center;
|
|
626
|
-
justify-content: center;
|
|
627
|
-
gap: 16px;
|
|
628
|
-
min-height: 0;
|
|
629
|
-
margin: 8px 10px 10px;
|
|
630
|
-
padding: 32px;
|
|
631
|
-
box-sizing: border-box;
|
|
632
|
-
border: 1px solid var(--knowledge-border);
|
|
633
|
-
border-radius: 15px;
|
|
634
|
-
background: var(--knowledge-pane);
|
|
635
|
-
box-shadow: var(--knowledge-glass-shadow);
|
|
636
|
-
-webkit-backdrop-filter: var(--knowledge-host-glass-filter);
|
|
637
|
-
backdrop-filter: var(--knowledge-host-glass-filter);
|
|
638
|
-
color: var(--knowledge-text);
|
|
639
|
-
}
|
|
640
|
-
|
|
641
|
-
.dsh-knowledge-panel-state-icon {
|
|
642
|
-
flex: none;
|
|
643
|
-
display: inline-flex;
|
|
644
|
-
align-items: center;
|
|
645
|
-
justify-content: center;
|
|
646
|
-
width: 40px;
|
|
647
|
-
height: 40px;
|
|
648
|
-
border-radius: 12px;
|
|
649
|
-
background: var(--knowledge-hover);
|
|
650
|
-
color: var(--knowledge-text-secondary);
|
|
651
|
-
font-size: 18px;
|
|
652
|
-
font-weight: 600;
|
|
653
|
-
}
|
|
654
|
-
|
|
655
|
-
.dsh-knowledge-panel-state > div { max-width: 560px; }
|
|
656
|
-
.dsh-knowledge-panel-state h3 { margin: 0 0 6px; font-size: 17px; line-height: 24px; font-weight: 600; }
|
|
657
|
-
.dsh-knowledge-panel-state p { margin: 0; color: var(--knowledge-text-secondary); font-size: 13px; line-height: 20px; }
|
|
658
|
-
.dsh-knowledge-panel-state button {
|
|
659
|
-
min-width: 72px;
|
|
660
|
-
min-height: 32px;
|
|
661
|
-
margin-top: 16px;
|
|
662
|
-
padding: 6px 14px;
|
|
663
|
-
border: 0;
|
|
664
|
-
border-radius: 10px;
|
|
665
|
-
background: var(--knowledge-accent);
|
|
666
|
-
color: var(--knowledge-on-accent);
|
|
667
|
-
cursor: pointer;
|
|
668
|
-
font: inherit;
|
|
669
|
-
}
|
|
670
|
-
.dsh-knowledge-panel-state button:focus-visible {
|
|
671
|
-
outline: 2px solid var(--knowledge-accent);
|
|
672
|
-
outline-offset: 2px;
|
|
673
|
-
}
|
|
674
|
-
|
|
675
|
-
.dsh-knowledge-settings-card {
|
|
676
|
-
list-style: none;
|
|
677
|
-
overflow: hidden;
|
|
678
|
-
border: 1px solid var(--knowledge-border);
|
|
679
|
-
border-radius: 14px;
|
|
680
|
-
background:
|
|
681
|
-
linear-gradient(145deg, color-mix(in srgb, var(--knowledge-glare-light) 16%, transparent), transparent 58%),
|
|
682
|
-
var(--knowledge-pane);
|
|
683
|
-
color: var(--knowledge-text);
|
|
684
|
-
box-shadow: var(--knowledge-glass-shadow), 0 8px 24px rgb(0 0 0 / 5%);
|
|
685
|
-
-webkit-backdrop-filter: var(--knowledge-glass-filter);
|
|
686
|
-
backdrop-filter: var(--knowledge-glass-filter);
|
|
687
|
-
transition: border-color 120ms ease, background-color 120ms ease;
|
|
688
|
-
}
|
|
689
|
-
.dsh-knowledge-settings-card:hover {
|
|
690
|
-
border-color: color-mix(in srgb, var(--knowledge-border) 68%, var(--knowledge-text-secondary));
|
|
691
|
-
}
|
|
692
|
-
.dsh-knowledge-settings-card--open {
|
|
693
|
-
border-color: color-mix(in srgb, var(--knowledge-border) 68%, var(--knowledge-text-secondary));
|
|
694
|
-
background: var(--knowledge-pane);
|
|
695
|
-
}
|
|
696
|
-
.dsh-knowledge-settings-header { display: flex; width: 100%; align-items: center; gap: 12px; padding: 14px 16px; border: 0; border-radius: 12px; background: transparent; color: inherit; text-align: left; cursor: pointer; font: inherit; }
|
|
697
|
-
.dsh-knowledge-settings-header:focus-visible {
|
|
698
|
-
outline: 2px solid var(--knowledge-accent);
|
|
699
|
-
outline-offset: -2px;
|
|
700
|
-
}
|
|
701
|
-
.dsh-knowledge-settings-actions button:focus-visible,
|
|
702
|
-
.dsh-knowledge-settings-load-error button:focus-visible {
|
|
703
|
-
outline: 2px solid var(--knowledge-accent);
|
|
704
|
-
outline-offset: 2px;
|
|
705
|
-
}
|
|
706
|
-
.dsh-knowledge-settings-header > span:first-child { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 4px; }
|
|
707
|
-
.dsh-knowledge-settings-header strong { font-size: 15px; font-weight: 600; line-height: 1.4; }
|
|
708
|
-
.dsh-knowledge-settings-header small { color: var(--knowledge-text-tertiary); font-size: 13px; line-height: 1.5; }
|
|
709
|
-
.dsh-knowledge-source-picker small,
|
|
710
|
-
.dsh-knowledge-remote-fields small { color: var(--knowledge-text-secondary); font-size: 12px; }
|
|
711
|
-
.dsh-knowledge-settings-summary { display: flex; flex: none; align-items: center; gap: 10px; color: var(--knowledge-text-tertiary); font-size: 12px; }
|
|
712
|
-
.dsh-knowledge-settings-summary i { width: 8px; height: 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform 160ms ease; }
|
|
713
|
-
.dsh-knowledge-settings-card--open .dsh-knowledge-settings-summary i { transform: rotate(225deg); }
|
|
714
|
-
|
|
715
|
-
.dsh-knowledge-settings-body {
|
|
716
|
-
display: grid;
|
|
717
|
-
gap: 18px;
|
|
718
|
-
margin: 0 16px;
|
|
719
|
-
padding-bottom: 8px;
|
|
720
|
-
border-top: 1px solid var(--knowledge-border);
|
|
721
|
-
}
|
|
722
|
-
|
|
723
|
-
.dsh-knowledge-source-picker {
|
|
724
|
-
min-width: 0;
|
|
725
|
-
display: grid;
|
|
726
|
-
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
727
|
-
gap: 10px;
|
|
728
|
-
margin: 18px 0 0;
|
|
729
|
-
padding: 0;
|
|
730
|
-
border: 0;
|
|
731
|
-
}
|
|
732
|
-
|
|
733
|
-
.dsh-knowledge-source-picker legend { margin-bottom: 8px; padding: 0; color: inherit; font-size: 13px; font-weight: 600; }
|
|
734
|
-
.dsh-knowledge-source-picker label {
|
|
735
|
-
display: flex;
|
|
736
|
-
gap: 10px;
|
|
737
|
-
padding: 13px;
|
|
738
|
-
border: 1px solid var(--knowledge-border);
|
|
739
|
-
border-radius: 14px;
|
|
740
|
-
cursor: pointer;
|
|
741
|
-
}
|
|
742
|
-
.dsh-knowledge-source-picker label.is-selected {
|
|
743
|
-
border-color: var(--knowledge-accent);
|
|
744
|
-
background: color-mix(in srgb, var(--knowledge-accent) 7%, transparent);
|
|
745
|
-
}
|
|
746
|
-
.dsh-knowledge-source-picker label.is-disabled {
|
|
747
|
-
cursor: default;
|
|
748
|
-
opacity: .55;
|
|
749
|
-
}
|
|
750
|
-
.dsh-knowledge-source-picker label:focus-within {
|
|
751
|
-
outline: 2px solid var(--knowledge-accent);
|
|
752
|
-
outline-offset: 2px;
|
|
753
|
-
}
|
|
754
|
-
.dsh-knowledge-source-picker input {
|
|
755
|
-
-webkit-appearance: none;
|
|
756
|
-
appearance: none;
|
|
757
|
-
width: 16px;
|
|
758
|
-
height: 16px;
|
|
759
|
-
display: inline-grid;
|
|
760
|
-
place-content: center;
|
|
761
|
-
flex: none;
|
|
762
|
-
margin: 2px 0 0;
|
|
763
|
-
border: 1px solid var(--knowledge-border);
|
|
764
|
-
border-radius: 50%;
|
|
765
|
-
background: var(--knowledge-control);
|
|
766
|
-
color: var(--knowledge-on-accent);
|
|
767
|
-
cursor: pointer;
|
|
768
|
-
transition: border-color .15s ease, background-color .15s ease;
|
|
769
|
-
}
|
|
770
|
-
.dsh-knowledge-source-picker input::before {
|
|
771
|
-
content: "";
|
|
772
|
-
width: 6px;
|
|
773
|
-
height: 6px;
|
|
774
|
-
border-radius: 50%;
|
|
775
|
-
background: currentColor;
|
|
776
|
-
opacity: 0;
|
|
777
|
-
transform: scale(.55);
|
|
778
|
-
transition: opacity .12s ease, transform .15s cubic-bezier(.2, .8, .2, 1);
|
|
779
|
-
}
|
|
780
|
-
.dsh-knowledge-source-picker input:checked { border-color: var(--knowledge-accent); background: var(--knowledge-accent); }
|
|
781
|
-
.dsh-knowledge-source-picker input:checked::before { opacity: 1; transform: scale(1); }
|
|
782
|
-
.dsh-knowledge-source-picker input:disabled { cursor: default; }
|
|
783
|
-
.dsh-knowledge-source-picker span { display: grid; gap: 3px; }
|
|
784
|
-
|
|
785
|
-
.dsh-knowledge-remote-fields { display: grid; grid-template-columns: 1.25fr 1fr; gap: 12px; }
|
|
786
|
-
.dsh-knowledge-remote-fields label,
|
|
787
|
-
.dsh-knowledge-timeout-field { display: grid; gap: 6px; color: var(--knowledge-text-secondary); font-size: 12px; }
|
|
788
|
-
.dsh-knowledge-remote-fields input,
|
|
789
|
-
.dsh-knowledge-timeout-field input {
|
|
790
|
-
-webkit-appearance: none;
|
|
791
|
-
appearance: none;
|
|
792
|
-
min-height: 38px;
|
|
793
|
-
box-sizing: border-box;
|
|
794
|
-
padding: 8px 11px;
|
|
795
|
-
border: 1px solid var(--knowledge-border);
|
|
796
|
-
border-radius: 10px;
|
|
797
|
-
outline: none;
|
|
798
|
-
background: var(--knowledge-control);
|
|
799
|
-
color: var(--knowledge-text);
|
|
800
|
-
font: inherit;
|
|
801
|
-
}
|
|
802
|
-
.dsh-knowledge-remote-fields input:focus,
|
|
803
|
-
.dsh-knowledge-timeout-field input:focus { border-color: var(--knowledge-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--knowledge-accent) 16%, transparent); }
|
|
804
|
-
.dsh-knowledge-remote-fields input:-webkit-autofill,
|
|
805
|
-
.dsh-knowledge-remote-fields input:-webkit-autofill:hover,
|
|
806
|
-
.dsh-knowledge-remote-fields input:-webkit-autofill:focus {
|
|
807
|
-
-webkit-text-fill-color: var(--knowledge-text);
|
|
808
|
-
box-shadow: 0 0 0 1000px var(--knowledge-control) inset;
|
|
809
|
-
caret-color: var(--knowledge-text);
|
|
810
|
-
}
|
|
811
|
-
.dsh-knowledge-timeout-field input::-webkit-inner-spin-button,
|
|
812
|
-
.dsh-knowledge-timeout-field input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
|
|
813
|
-
.dsh-knowledge-timeout-field { max-width: 240px; }
|
|
814
|
-
.dsh-knowledge-field-error { color: var(--knowledge-danger) !important; }
|
|
815
|
-
|
|
816
|
-
.dsh-knowledge-settings-message,
|
|
817
|
-
.dsh-knowledge-settings-note { margin: 0; color: var(--knowledge-text-secondary); font-size: 12px; }
|
|
818
|
-
.dsh-knowledge-settings-message.is-success { color: var(--knowledge-success); }
|
|
819
|
-
.dsh-knowledge-settings-message.is-error { color: var(--knowledge-danger); }
|
|
820
|
-
.dsh-knowledge-settings-load-error {
|
|
821
|
-
display: flex;
|
|
822
|
-
align-items: center;
|
|
823
|
-
justify-content: space-between;
|
|
824
|
-
gap: 12px;
|
|
825
|
-
margin-top: 18px;
|
|
826
|
-
padding: 12px 14px;
|
|
827
|
-
border-radius: 12px;
|
|
828
|
-
background: color-mix(in srgb, var(--knowledge-danger) 8%, transparent);
|
|
829
|
-
color: var(--knowledge-danger);
|
|
830
|
-
font-size: 13px;
|
|
831
|
-
}
|
|
832
|
-
.dsh-knowledge-settings-load-error p { margin: 0; }
|
|
833
|
-
.dsh-knowledge-settings-load-error button {
|
|
834
|
-
flex: none;
|
|
835
|
-
min-height: 30px;
|
|
836
|
-
padding: 5px 10px;
|
|
837
|
-
border: 0;
|
|
838
|
-
border-radius: 9px;
|
|
839
|
-
background: var(--knowledge-control);
|
|
840
|
-
color: var(--knowledge-text);
|
|
841
|
-
cursor: pointer;
|
|
842
|
-
font: inherit;
|
|
843
|
-
}
|
|
844
|
-
.dsh-knowledge-settings-actions { display: flex; justify-content: flex-end; gap: 8px; }
|
|
845
|
-
.dsh-knowledge-settings-actions button {
|
|
846
|
-
min-height: 34px;
|
|
847
|
-
padding: 7px 13px;
|
|
848
|
-
border: 0;
|
|
849
|
-
border-radius: 10px;
|
|
850
|
-
background: var(--knowledge-hover);
|
|
851
|
-
color: var(--knowledge-text);
|
|
852
|
-
cursor: pointer;
|
|
853
|
-
font: inherit;
|
|
854
|
-
font-size: 13px;
|
|
855
|
-
}
|
|
856
|
-
.dsh-knowledge-settings-actions button.is-primary { background: var(--knowledge-accent); color: var(--knowledge-on-accent); }
|
|
857
|
-
.dsh-knowledge-settings-actions button:disabled { cursor: default; opacity: .45; }
|
|
858
|
-
|
|
859
|
-
@media (max-width: 720px) {
|
|
860
|
-
.dsh-knowledge-source-picker,
|
|
861
|
-
.dsh-knowledge-remote-fields { grid-template-columns: 1fr; }
|
|
862
|
-
.dsh-knowledge-settings-summary { font-size: 0; }
|
|
321
|
+
// src/docked-panel-compat.tsx
|
|
322
|
+
var import_react = require("react");
|
|
323
|
+
function supportsDockedPanels(ctx) {
|
|
324
|
+
return typeof ctx.layout.selectPanel === "function";
|
|
325
|
+
}
|
|
326
|
+
function createDockedPanel(ctx, id, title, render, notify) {
|
|
327
|
+
const records = /* @__PURE__ */ new Map();
|
|
328
|
+
let pending;
|
|
329
|
+
let frame;
|
|
330
|
+
let disposed = false;
|
|
331
|
+
let sidebar;
|
|
332
|
+
const cancel = () => {
|
|
333
|
+
if (frame !== void 0) window.cancelAnimationFrame(frame);
|
|
334
|
+
frame = void 0;
|
|
335
|
+
pending = void 0;
|
|
336
|
+
};
|
|
337
|
+
function Body(props) {
|
|
338
|
+
const { tab } = props.useTabInfo();
|
|
339
|
+
const sessionId = String(props.sessionId);
|
|
340
|
+
(0, import_react.useEffect)(() => {
|
|
341
|
+
let entries2 = records.get(sessionId);
|
|
342
|
+
if (entries2 === void 0) {
|
|
343
|
+
entries2 = /* @__PURE__ */ new Map();
|
|
344
|
+
records.set(sessionId, entries2);
|
|
345
|
+
}
|
|
346
|
+
const entry = { visible: tab.visible, close: () => tab.actions.close() };
|
|
347
|
+
entries2.set(tab.id, entry);
|
|
348
|
+
const remove = () => {
|
|
349
|
+
if (entries2?.get(tab.id) !== entry) return;
|
|
350
|
+
entries2.delete(tab.id);
|
|
351
|
+
if (entries2.size === 0) records.delete(sessionId);
|
|
352
|
+
notify();
|
|
353
|
+
};
|
|
354
|
+
tab.signal.addEventListener("abort", remove, { once: true });
|
|
355
|
+
notify();
|
|
356
|
+
return () => {
|
|
357
|
+
tab.signal.removeEventListener("abort", remove);
|
|
358
|
+
remove();
|
|
359
|
+
};
|
|
360
|
+
}, [sessionId, tab.id, tab.visible, tab.signal]);
|
|
361
|
+
return tab.visible ? render(props) : null;
|
|
362
|
+
}
|
|
363
|
+
const fiber = ctx.inject(["sidebarRight", "sidebarRightTabs"], (child) => {
|
|
364
|
+
sidebar = child.get("sidebarRight");
|
|
365
|
+
const registry = child.get("sidebarRightTabs");
|
|
366
|
+
const slots = child.slots;
|
|
367
|
+
child.effect(() => registry.register({ id, kind: id, title: () => title }), id + ": tab type");
|
|
368
|
+
child.effect(() => slots.inject("sidebar.right.pane.tab", () => slots.register({
|
|
369
|
+
name: "sidebar.right.pane.tab",
|
|
370
|
+
key: id
|
|
371
|
+
}, Body)), id + ": tab body");
|
|
372
|
+
child.effect(() => () => {
|
|
373
|
+
sidebar = void 0;
|
|
374
|
+
}, id + ": tab service");
|
|
375
|
+
});
|
|
376
|
+
return {
|
|
377
|
+
open(sessionId) {
|
|
378
|
+
cancel();
|
|
379
|
+
pending = sessionId;
|
|
380
|
+
let attempts = 0;
|
|
381
|
+
const reveal = () => {
|
|
382
|
+
frame = void 0;
|
|
383
|
+
if (disposed || pending !== sessionId) return;
|
|
384
|
+
const sessions = ctx.get("sessions");
|
|
385
|
+
if (String(sessions.list.getSnapshot().current) !== sessionId) {
|
|
386
|
+
cancel();
|
|
387
|
+
notify();
|
|
388
|
+
return;
|
|
389
|
+
}
|
|
390
|
+
try {
|
|
391
|
+
if (sidebar === void 0) throw new Error("Right sidebar is not ready");
|
|
392
|
+
sidebar.openTab(id);
|
|
393
|
+
pending = void 0;
|
|
394
|
+
notify();
|
|
395
|
+
} catch (error) {
|
|
396
|
+
if (++attempts < 30) frame = window.requestAnimationFrame(reveal);
|
|
397
|
+
else {
|
|
398
|
+
cancel();
|
|
399
|
+
notify();
|
|
400
|
+
console.error(title + ": could not open sidebar", error);
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
};
|
|
404
|
+
frame = window.requestAnimationFrame(reveal);
|
|
405
|
+
notify();
|
|
406
|
+
},
|
|
407
|
+
close(sessionId) {
|
|
408
|
+
if (pending === sessionId) cancel();
|
|
409
|
+
for (const entry of [...records.get(sessionId)?.values() ?? []]) entry.close();
|
|
410
|
+
records.delete(sessionId);
|
|
411
|
+
notify();
|
|
412
|
+
},
|
|
413
|
+
isOpen(sessionId) {
|
|
414
|
+
return pending === sessionId || [...records.get(sessionId)?.values() ?? []].some((entry) => entry.visible);
|
|
415
|
+
},
|
|
416
|
+
dispose() {
|
|
417
|
+
disposed = true;
|
|
418
|
+
cancel();
|
|
419
|
+
for (const entries2 of records.values()) for (const entry of [...entries2.values()]) entry.close();
|
|
420
|
+
records.clear();
|
|
421
|
+
void fiber.dispose();
|
|
422
|
+
}
|
|
423
|
+
};
|
|
863
424
|
}
|
|
864
425
|
|
|
865
|
-
|
|
866
|
-
.dsh-knowledge-settings-card,
|
|
867
|
-
.dsh-knowledge-settings-header,
|
|
868
|
-
.dsh-knowledge-settings-summary i { transition: none; }
|
|
869
|
-
}
|
|
426
|
+
// src/client.css
|
|
427
|
+
var client_default = '.dsh-knowledge-trigger,\n.dsh-knowledge-activity-panel,\n.dsh-knowledge-workspace,\n.dsh-knowledge-settings-card,\n.dsh-knowledge-writeback-notice {\n color-scheme: light;\n --knowledge-canvas: transparent;\n --knowledge-accent: var(--accent);\n --knowledge-on-accent: var(--on-accent);\n --knowledge-danger: var(--danger);\n --knowledge-success: var(--success);\n --knowledge-pane: rgba(255, 255, 255, 0.16);\n --knowledge-raised: rgba(255, 255, 255, 0.38);\n --knowledge-control: rgba(255, 255, 255, 0.27);\n --knowledge-border: var(--border);\n --knowledge-text: var(--text);\n --knowledge-text-secondary: var(--text-secondary);\n --knowledge-text-tertiary: var(--text-tertiary);\n --knowledge-hover: var(--surface-hover);\n --knowledge-glare-light: rgb(255 255 255 / 70%);\n --knowledge-glare-rim: rgb(60 60 67 / 11%);\n --knowledge-glass-filter: saturate(1.22) contrast(1.03) blur(32px);\n --knowledge-host-glass-filter: saturate(.18) contrast(1.015) blur(24px);\n --knowledge-glass-shadow: inset 0 1px 0 rgb(255 255 255 / 70%), inset 0 -1px 0 rgb(60 60 67 / 11%), 0 10px 28px rgb(31 31 35 / 8.5%);\n --knowledge-font-family: var(--font-ui);\n color: var(--knowledge-text);\n font-family: var(--knowledge-font-family);\n font-size: 13px;\n line-height: 1.5;\n}\n\nbody[data-ds-dark-theme] :is(\n .dsh-knowledge-trigger,\n .dsh-knowledge-activity-panel,\n .dsh-knowledge-workspace,\n .dsh-knowledge-settings-card,\n .dsh-knowledge-writeback-notice\n) {\n color-scheme: dark;\n --knowledge-canvas: transparent;\n --knowledge-accent: var(--accent);\n --knowledge-on-accent: var(--on-accent);\n --knowledge-danger: var(--danger);\n --knowledge-success: var(--success);\n --knowledge-pane: rgb(25 33 35 / 90%);\n --knowledge-raised: rgb(32 41 43 / 94%);\n --knowledge-control: rgb(39 50 53 / 92%);\n --knowledge-border: var(--border);\n --knowledge-text: var(--text);\n --knowledge-text-secondary: var(--text-secondary);\n --knowledge-text-tertiary: var(--text-tertiary);\n --knowledge-hover: var(--surface-hover);\n --knowledge-glare-light: rgb(255 255 255 / 16%);\n --knowledge-glare-rim: rgb(0 0 0 / 30%);\n --knowledge-host-glass-filter: saturate(.45) contrast(1.02) blur(24px);\n --knowledge-glass-shadow: inset 0 1px 0 rgb(255 255 255 / 16%), inset 0 -1px 0 rgb(0 0 0 / 30%), 0 12px 32px rgb(0 0 0 / 30%);\n}\n\n:is(\n .dsh-knowledge-trigger,\n .dsh-knowledge-activity-panel,\n .dsh-knowledge-workspace,\n .dsh-knowledge-settings-card,\n .dsh-knowledge-writeback-notice\n),\n:is(\n .dsh-knowledge-trigger,\n .dsh-knowledge-activity-panel,\n .dsh-knowledge-workspace,\n .dsh-knowledge-settings-card,\n .dsh-knowledge-writeback-notice\n) * {\n box-sizing: border-box;\n}\n\n:is(\n .dsh-knowledge-trigger,\n .dsh-knowledge-activity-panel,\n .dsh-knowledge-workspace,\n .dsh-knowledge-settings-card,\n .dsh-knowledge-writeback-notice\n) :where(button, input, textarea, select) {\n margin: 0;\n color: inherit;\n font-family: var(--knowledge-font-family);\n font-size: inherit;\n font-weight: inherit;\n line-height: inherit;\n letter-spacing: inherit;\n}\n\n.dsh-knowledge-trigger,\n.dsh-knowledge-activity-panel button,\n.dsh-knowledge-activity-panel input,\n.dsh-knowledge-panel-state button,\n.dsh-knowledge-settings-card button,\n.dsh-knowledge-writeback-notice button {\n -webkit-appearance: none;\n appearance: none;\n margin: 0;\n}\n\n/* The official footer slot is a horizontal list. Only opt its immediate\n container into wrapping; leave neighboring plugin controls untouched. */\n:has(> .dsh-knowledge-launcher) { flex-wrap: wrap; }\n/* In rail mode the host centers a 36px settings row. Use that same row\n geometry, rather than forcing a percentage-width footer. */\n:has(> .dsh-knowledge-launcher--rail) { flex-direction: column; align-items: center; }\n\n.dsh-knowledge-launcher {\n display: flex;\n flex: 0 0 calc(100% + 4px);\n order: -1;\n min-width: 0;\n gap: 4px;\n width: calc(100% + 4px);\n margin: 4px -2px;\n box-sizing: border-box;\n}\n\n.dsh-knowledge-launcher--rail { flex: none; width: 36px; margin: 8px 0 10px; flex-direction: column; align-items: center; }\n\n.dsh-knowledge-trigger {\n position: relative;\n flex: 1 1 auto;\n min-width: 0;\n display: flex;\n align-items: center;\n gap: 8px;\n width: auto;\n height: 36px;\n margin: 0;\n padding: 0 10px 0 8px;\n box-sizing: border-box;\n border: 0;\n border-radius: 12px;\n overflow: hidden;\n background: transparent;\n color: var(--knowledge-text);\n cursor: pointer;\n font: inherit;\n font-size: 14px;\n line-height: 22px;\n white-space: nowrap;\n isolation: isolate;\n transition:\n color 120ms ease,\n background-color 120ms ease,\n box-shadow 160ms ease;\n}\n\n.dsh-knowledge-trigger:hover {\n background: var(--knowledge-hover);\n}\n\n.dsh-knowledge-trigger:focus-visible,\n.dsh-knowledge-writeback-notice button:focus-visible {\n outline: 2px solid var(--knowledge-accent);\n outline-offset: 2px;\n}\n\n.dsh-knowledge-trigger.is-active {\n background: var(--knowledge-control);\n color: var(--knowledge-text);\n box-shadow: 0 1px 2px rgb(0 0 0 / 7%), inset 0 1px 0 rgb(255 255 255 / 28%);\n}\n\n.dsh-knowledge-trigger--rail {\n width: 36px;\n height: 36px;\n margin: 8px 0 10px;\n padding: 0;\n justify-content: center;\n gap: 0;\n border-radius: 50%;\n}\n\n.dsh-knowledge-trigger--rail { margin-inline: auto; }\n\n.dsh-knowledge-launcher .dsh-knowledge-trigger--rail { flex: none; margin-block: 0; }\n.dsh-knowledge-panel-trigger { flex: 0 0 36px; width: 36px; padding: 0; justify-content: center; }\n.dsh-knowledge-panel-trigger:disabled { opacity: .4; cursor: default; background: transparent; }\n.dsh-knowledge-launcher--rail .dsh-knowledge-panel-trigger { flex: none; border-radius: 50%; }\n\n@media (prefers-reduced-motion: reduce) {\n .dsh-knowledge-trigger { transition: none; }\n}\n\n.dsh-knowledge-workspace {\n width: 100%;\n height: 100%;\n min-width: 0;\n min-height: 0;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n background: var(--knowledge-canvas);\n}\n\n.dsh-knowledge-workspace-header {\n position: relative;\n z-index: 2;\n flex: none;\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 16px;\n min-height: 52px;\n margin: 8px 10px 0;\n padding: 7px 14px;\n box-sizing: border-box;\n border: 1px solid var(--knowledge-border);\n border-radius: 14px 14px 11px 11px;\n background: transparent;\n box-shadow: var(--knowledge-glass-shadow);\n -webkit-backdrop-filter: var(--knowledge-host-glass-filter);\n backdrop-filter: var(--knowledge-host-glass-filter);\n}\n\n.dsh-knowledge-workspace-header > div {\n display: flex;\n align-items: center;\n gap: 10px;\n min-width: 0;\n}\n\n.dsh-knowledge-workspace-header [data-knowledge-workspace-close] {\n -webkit-appearance: none;\n appearance: none;\n display: grid;\n place-items: center;\n box-sizing: border-box;\n flex: none;\n width: 30px;\n height: 30px;\n margin: 0;\n padding: 0;\n border: 1px solid transparent;\n border-radius: 9px;\n color: var(--knowledge-text-secondary);\n background: transparent;\n font: inherit;\n line-height: 1;\n -webkit-tap-highlight-color: transparent;\n cursor: pointer;\n transition: color 120ms ease, background-color 120ms ease, border-color 120ms ease;\n}\n\n.dsh-knowledge-workspace-header [data-knowledge-workspace-close]:hover {\n border-color: var(--knowledge-border);\n color: var(--knowledge-text);\n background: var(--knowledge-control);\n}\n\n.dsh-knowledge-workspace-header [data-knowledge-workspace-close]:active { border-color: var(--knowledge-text-secondary); }\n.dsh-knowledge-workspace-header [data-knowledge-workspace-close]:focus-visible {\n outline: 2px solid var(--knowledge-accent);\n outline-offset: 2px;\n}\n.dsh-knowledge-workspace-header [data-knowledge-workspace-close] > svg {\n display: block;\n pointer-events: none;\n}\n\n.dsh-knowledge-workspace-header > div > span {\n display: grid;\n min-width: 0;\n gap: 2px;\n}\n\n.dsh-knowledge-workspace-header h2,\n.dsh-knowledge-workspace-header p {\n margin: 0;\n}\n\n.dsh-knowledge-workspace-header h2 {\n color: var(--knowledge-text);\n font-size: 15px;\n line-height: 22px;\n font-weight: 600;\n}\n\n.dsh-knowledge-workspace-header p {\n color: var(--knowledge-text-secondary);\n font-size: 11px;\n line-height: 16px;\n}\n\n.dsh-knowledge-frame {\n flex: 1;\n display: block;\n width: 100%;\n min-height: 0;\n margin: 0;\n border: 0;\n border-radius: 0;\n background: transparent;\n box-shadow: none;\n -webkit-backdrop-filter: none;\n backdrop-filter: none;\n}\n\n.dsh-knowledge-panel-state {\n flex: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 16px;\n min-height: 0;\n margin: 8px 10px 10px;\n padding: 32px;\n box-sizing: border-box;\n border: 1px solid var(--knowledge-border);\n border-radius: 15px;\n background: var(--knowledge-pane);\n box-shadow: var(--knowledge-glass-shadow);\n -webkit-backdrop-filter: var(--knowledge-host-glass-filter);\n backdrop-filter: var(--knowledge-host-glass-filter);\n color: var(--knowledge-text);\n}\n\n.dsh-knowledge-panel-state-icon {\n flex: none;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 40px;\n height: 40px;\n border-radius: 12px;\n background: var(--knowledge-hover);\n color: var(--knowledge-text-secondary);\n font-size: 18px;\n font-weight: 600;\n}\n\n.dsh-knowledge-panel-state > div { max-width: 560px; }\n.dsh-knowledge-panel-state h3 { margin: 0 0 6px; font-size: 17px; line-height: 24px; font-weight: 600; }\n.dsh-knowledge-panel-state p { margin: 0; color: var(--knowledge-text-secondary); font-size: 13px; line-height: 20px; }\n.dsh-knowledge-panel-state button {\n min-width: 72px;\n min-height: 32px;\n margin-top: 16px;\n padding: 6px 14px;\n border: 0;\n border-radius: 10px;\n background: var(--knowledge-accent);\n color: var(--knowledge-on-accent);\n cursor: pointer;\n font: inherit;\n}\n.dsh-knowledge-panel-state button:focus-visible {\n outline: 2px solid var(--knowledge-accent);\n outline-offset: 2px;\n}\n\n.dsh-knowledge-settings-card {\n list-style: none;\n overflow: hidden;\n border: 1px solid var(--knowledge-border);\n border-radius: 14px;\n background:\n linear-gradient(145deg, color-mix(in srgb, var(--knowledge-glare-light) 16%, transparent), transparent 58%),\n var(--knowledge-pane);\n color: var(--knowledge-text);\n box-shadow: var(--knowledge-glass-shadow), 0 8px 24px rgb(0 0 0 / 5%);\n -webkit-backdrop-filter: var(--knowledge-glass-filter);\n backdrop-filter: var(--knowledge-glass-filter);\n transition: border-color 120ms ease, background-color 120ms ease;\n}\n.dsh-knowledge-settings-card:hover {\n border-color: color-mix(in srgb, var(--knowledge-border) 68%, var(--knowledge-text-secondary));\n}\n.dsh-knowledge-settings-card--open {\n border-color: color-mix(in srgb, var(--knowledge-border) 68%, var(--knowledge-text-secondary));\n background: var(--knowledge-pane);\n}\n.dsh-knowledge-settings-header { display: flex; width: 100%; align-items: center; gap: 12px; padding: 14px 16px; border: 0; border-radius: 12px; background: transparent; color: inherit; text-align: left; cursor: pointer; font: inherit; }\n.dsh-knowledge-settings-header:focus-visible {\n outline: 2px solid var(--knowledge-accent);\n outline-offset: -2px;\n}\n.dsh-knowledge-settings-actions button:focus-visible,\n.dsh-knowledge-settings-load-error button:focus-visible {\n outline: 2px solid var(--knowledge-accent);\n outline-offset: 2px;\n}\n.dsh-knowledge-settings-header > span:first-child { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 4px; }\n.dsh-knowledge-settings-header strong { font-size: 15px; font-weight: 600; line-height: 1.4; }\n.dsh-knowledge-settings-header small { color: var(--knowledge-text-tertiary); font-size: 13px; line-height: 1.5; }\n.dsh-knowledge-source-picker small,\n.dsh-knowledge-remote-fields small { color: var(--knowledge-text-secondary); font-size: 12px; }\n.dsh-knowledge-settings-summary { display: flex; flex: none; align-items: center; gap: 10px; color: var(--knowledge-text-tertiary); font-size: 12px; }\n.dsh-knowledge-settings-summary i { width: 8px; height: 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform 160ms ease; }\n.dsh-knowledge-settings-card--open .dsh-knowledge-settings-summary i { transform: rotate(225deg); }\n\n.dsh-knowledge-settings-body {\n display: grid;\n gap: 18px;\n margin: 0 16px;\n padding-bottom: 8px;\n border-top: 1px solid var(--knowledge-border);\n}\n\n.dsh-knowledge-source-picker {\n min-width: 0;\n display: grid;\n grid-template-columns: repeat(2, minmax(0, 1fr));\n gap: 10px;\n margin: 18px 0 0;\n padding: 0;\n border: 0;\n}\n\n.dsh-knowledge-source-picker legend { margin-bottom: 8px; padding: 0; color: inherit; font-size: 13px; font-weight: 600; }\n.dsh-knowledge-source-picker label {\n display: flex;\n gap: 10px;\n padding: 13px;\n border: 1px solid var(--knowledge-border);\n border-radius: 14px;\n cursor: pointer;\n}\n.dsh-knowledge-source-picker label.is-selected {\n border-color: var(--knowledge-accent);\n background: color-mix(in srgb, var(--knowledge-accent) 7%, transparent);\n}\n.dsh-knowledge-source-picker label.is-disabled {\n cursor: default;\n opacity: .55;\n}\n.dsh-knowledge-source-picker label:focus-within {\n outline: 2px solid var(--knowledge-accent);\n outline-offset: 2px;\n}\n.dsh-knowledge-source-picker input {\n -webkit-appearance: none;\n appearance: none;\n width: 16px;\n height: 16px;\n display: inline-grid;\n place-content: center;\n flex: none;\n margin: 2px 0 0;\n border: 1px solid var(--knowledge-border);\n border-radius: 50%;\n background: var(--knowledge-control);\n color: var(--knowledge-on-accent);\n cursor: pointer;\n transition: border-color .15s ease, background-color .15s ease;\n}\n.dsh-knowledge-source-picker input::before {\n content: "";\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background: currentColor;\n opacity: 0;\n transform: scale(.55);\n transition: opacity .12s ease, transform .15s cubic-bezier(.2, .8, .2, 1);\n}\n.dsh-knowledge-source-picker input:checked { border-color: var(--knowledge-accent); background: var(--knowledge-accent); }\n.dsh-knowledge-source-picker input:checked::before { opacity: 1; transform: scale(1); }\n.dsh-knowledge-source-picker input:disabled { cursor: default; }\n.dsh-knowledge-source-picker span { display: grid; gap: 3px; }\n\n.dsh-knowledge-remote-fields { display: grid; grid-template-columns: 1.25fr 1fr; gap: 12px; }\n.dsh-knowledge-remote-fields label,\n.dsh-knowledge-timeout-field { display: grid; gap: 6px; color: var(--knowledge-text-secondary); font-size: 12px; }\n.dsh-knowledge-remote-fields input,\n.dsh-knowledge-timeout-field input {\n -webkit-appearance: none;\n appearance: none;\n min-height: 38px;\n box-sizing: border-box;\n padding: 8px 11px;\n border: 1px solid var(--knowledge-border);\n border-radius: 10px;\n outline: none;\n background: var(--knowledge-control);\n color: var(--knowledge-text);\n font: inherit;\n}\n.dsh-knowledge-remote-fields input:focus,\n.dsh-knowledge-timeout-field input:focus { border-color: var(--knowledge-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--knowledge-accent) 16%, transparent); }\n.dsh-knowledge-remote-fields input:-webkit-autofill,\n.dsh-knowledge-remote-fields input:-webkit-autofill:hover,\n.dsh-knowledge-remote-fields input:-webkit-autofill:focus {\n -webkit-text-fill-color: var(--knowledge-text);\n box-shadow: 0 0 0 1000px var(--knowledge-control) inset;\n caret-color: var(--knowledge-text);\n}\n.dsh-knowledge-timeout-field input::-webkit-inner-spin-button,\n.dsh-knowledge-timeout-field input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }\n.dsh-knowledge-timeout-field { max-width: 240px; }\n.dsh-knowledge-field-error { color: var(--knowledge-danger) !important; }\n\n.dsh-knowledge-settings-message,\n.dsh-knowledge-settings-note { margin: 0; color: var(--knowledge-text-secondary); font-size: 12px; }\n.dsh-knowledge-settings-message.is-success { color: var(--knowledge-success); }\n.dsh-knowledge-settings-message.is-error { color: var(--knowledge-danger); }\n.dsh-knowledge-settings-load-error {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n margin-top: 18px;\n padding: 12px 14px;\n border-radius: 12px;\n background: color-mix(in srgb, var(--knowledge-danger) 8%, transparent);\n color: var(--knowledge-danger);\n font-size: 13px;\n}\n.dsh-knowledge-settings-load-error p { margin: 0; }\n.dsh-knowledge-settings-load-error button {\n flex: none;\n min-height: 30px;\n padding: 5px 10px;\n border: 0;\n border-radius: 9px;\n background: var(--knowledge-control);\n color: var(--knowledge-text);\n cursor: pointer;\n font: inherit;\n}\n.dsh-knowledge-settings-actions { display: flex; justify-content: flex-end; gap: 8px; }\n.dsh-knowledge-settings-actions button {\n min-height: 34px;\n padding: 7px 13px;\n border: 0;\n border-radius: 10px;\n background: var(--knowledge-hover);\n color: var(--knowledge-text);\n cursor: pointer;\n font: inherit;\n font-size: 13px;\n}\n.dsh-knowledge-settings-actions button.is-primary { background: var(--knowledge-accent); color: var(--knowledge-on-accent); }\n.dsh-knowledge-settings-actions button:disabled { cursor: default; opacity: .45; }\n\n@media (max-width: 720px) {\n .dsh-knowledge-source-picker,\n .dsh-knowledge-remote-fields { grid-template-columns: 1fr; }\n .dsh-knowledge-settings-summary { font-size: 0; }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .dsh-knowledge-settings-card,\n .dsh-knowledge-settings-header,\n .dsh-knowledge-settings-summary i { transition: none; }\n}\n\n.dsh-knowledge-writeback-notice {\n display: grid;\n gap: 5px;\n min-width: 0;\n color: var(--knowledge-text-tertiary);\n font-size: 12px;\n line-height: 1.5;\n}\n.dsh-knowledge-writeback-summary {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: 8px;\n min-width: 0;\n}\n.dsh-knowledge-writeback-notice strong {\n color: var(--knowledge-text-secondary);\n font-weight: 600;\n}\n.dsh-knowledge-writeback-notice button {\n min-height: 24px;\n padding: 0 9px;\n border: 1px solid var(--knowledge-border);\n border-radius: 7px;\n color: var(--knowledge-text-secondary);\n background: var(--knowledge-control);\n cursor: pointer;\n font: inherit;\n}\n.dsh-knowledge-writeback-notice button:disabled { cursor: default; opacity: .5; }\n.dsh-knowledge-writeback-destinations {\n display: flex;\n flex-wrap: wrap;\n gap: 2px 12px;\n min-width: 0;\n margin: 0;\n padding: 0;\n list-style: none;\n}\n.dsh-knowledge-writeback-destinations li {\n display: inline-flex;\n align-items: center;\n gap: 5px;\n min-width: 0;\n max-width: 100%;\n padding: 0;\n border: 0;\n background: transparent;\n}\n.dsh-knowledge-writeback-base,\n.dsh-knowledge-writeback-separator {\n flex: none;\n}\n.dsh-knowledge-writeback-separator {\n color: var(--knowledge-text-tertiary);\n}\n.dsh-knowledge-writeback-destinations strong {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.dsh-knowledge-writeback-notice .dsh-knowledge-writeback-document {\n display: inline-flex;\n align-items: center;\n min-width: 0;\n min-height: 24px;\n padding: 0 3px;\n border: 0;\n border-radius: 4px;\n background: transparent;\n color: var(--knowledge-text-secondary);\n text-decoration: underline;\n text-decoration-color: transparent;\n text-underline-offset: 3px;\n transition: color 120ms ease, background-color 120ms ease, text-decoration-color 120ms ease;\n}\n.dsh-knowledge-writeback-notice .dsh-knowledge-writeback-document:hover {\n background: var(--knowledge-hover);\n color: var(--knowledge-text);\n text-decoration-color: currentColor;\n}\n.dsh-knowledge-writeback-document strong { color: inherit; }\n.dsh-knowledge-writeback-destinations small {\n flex: none;\n color: var(--knowledge-text-secondary);\n font: inherit;\n white-space: nowrap;\n}\n.dsh-knowledge-writeback-destinations small[data-disposition="written"] { color: var(--knowledge-success); }\n.dsh-knowledge-writeback-error {\n max-width: min(720px, 100%);\n margin: 0;\n color: var(--knowledge-danger);\n overflow-wrap: anywhere;\n}\n.dsh-knowledge-panel-right-icon {\n transform: rotate(180deg);\n}\n';
|
|
870
428
|
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
}
|
|
879
|
-
.
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
}
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
.
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
margin: 0;
|
|
907
|
-
padding: 0;
|
|
908
|
-
list-style: none;
|
|
909
|
-
}
|
|
910
|
-
.dsh-knowledge-writeback-destinations li {
|
|
911
|
-
display: inline-flex;
|
|
912
|
-
align-items: center;
|
|
913
|
-
gap: 5px;
|
|
914
|
-
min-width: 0;
|
|
915
|
-
max-width: 100%;
|
|
916
|
-
padding: 0;
|
|
917
|
-
border: 0;
|
|
918
|
-
background: transparent;
|
|
919
|
-
}
|
|
920
|
-
.dsh-knowledge-writeback-base,
|
|
921
|
-
.dsh-knowledge-writeback-separator {
|
|
922
|
-
flex: none;
|
|
923
|
-
}
|
|
924
|
-
.dsh-knowledge-writeback-separator {
|
|
925
|
-
color: var(--knowledge-text-tertiary);
|
|
926
|
-
}
|
|
927
|
-
.dsh-knowledge-writeback-destinations strong {
|
|
928
|
-
min-width: 0;
|
|
929
|
-
overflow: hidden;
|
|
930
|
-
text-overflow: ellipsis;
|
|
931
|
-
white-space: nowrap;
|
|
932
|
-
}
|
|
933
|
-
.dsh-knowledge-writeback-notice .dsh-knowledge-writeback-document {
|
|
934
|
-
display: inline-flex;
|
|
935
|
-
align-items: center;
|
|
936
|
-
min-width: 0;
|
|
937
|
-
min-height: 24px;
|
|
938
|
-
padding: 0 3px;
|
|
939
|
-
border: 0;
|
|
940
|
-
border-radius: 4px;
|
|
941
|
-
background: transparent;
|
|
942
|
-
color: var(--knowledge-text-secondary);
|
|
943
|
-
text-decoration: underline;
|
|
944
|
-
text-decoration-color: transparent;
|
|
945
|
-
text-underline-offset: 3px;
|
|
946
|
-
transition: color 120ms ease, background-color 120ms ease, text-decoration-color 120ms ease;
|
|
947
|
-
}
|
|
948
|
-
.dsh-knowledge-writeback-notice .dsh-knowledge-writeback-document:hover {
|
|
949
|
-
background: var(--knowledge-hover);
|
|
950
|
-
color: var(--knowledge-text);
|
|
951
|
-
text-decoration-color: currentColor;
|
|
952
|
-
}
|
|
953
|
-
.dsh-knowledge-writeback-document strong { color: inherit; }
|
|
954
|
-
.dsh-knowledge-writeback-destinations small {
|
|
955
|
-
flex: none;
|
|
956
|
-
color: var(--knowledge-text-secondary);
|
|
957
|
-
font: inherit;
|
|
958
|
-
white-space: nowrap;
|
|
959
|
-
}
|
|
960
|
-
.dsh-knowledge-writeback-destinations small[data-disposition="written"] { color: var(--knowledge-success); }
|
|
961
|
-
.dsh-knowledge-writeback-error {
|
|
962
|
-
max-width: min(720px, 100%);
|
|
963
|
-
margin: 0;
|
|
964
|
-
color: var(--knowledge-danger);
|
|
965
|
-
overflow-wrap: anywhere;
|
|
429
|
+
// src/main-panel-compat.ts
|
|
430
|
+
var import_react2 = require("react");
|
|
431
|
+
function registerMainPanel(ctx, id, priority, render, onHidden = () => {
|
|
432
|
+
}) {
|
|
433
|
+
const layout = ctx.layout;
|
|
434
|
+
if (typeof layout.selectPanel !== "function") {
|
|
435
|
+
return ctx.slots.register({ name: "conversation", priority }, render);
|
|
436
|
+
}
|
|
437
|
+
const slots = ctx.slots;
|
|
438
|
+
let disposed = false;
|
|
439
|
+
let generation = 0;
|
|
440
|
+
const Body = (props) => {
|
|
441
|
+
(0, import_react2.useEffect)(() => {
|
|
442
|
+
const current = ++generation;
|
|
443
|
+
return () => {
|
|
444
|
+
queueMicrotask(() => {
|
|
445
|
+
if (!disposed && generation === current) onHidden();
|
|
446
|
+
});
|
|
447
|
+
};
|
|
448
|
+
}, []);
|
|
449
|
+
return render(props);
|
|
450
|
+
};
|
|
451
|
+
const remove = slots.register({ name: "main", key: id }, Body);
|
|
452
|
+
const dispose = () => {
|
|
453
|
+
if (disposed) return;
|
|
454
|
+
disposed = true;
|
|
455
|
+
remove();
|
|
456
|
+
};
|
|
457
|
+
try {
|
|
458
|
+
layout.selectPanel(id);
|
|
459
|
+
} catch (error) {
|
|
460
|
+
dispose();
|
|
461
|
+
throw error;
|
|
462
|
+
}
|
|
463
|
+
return dispose;
|
|
966
464
|
}
|
|
967
|
-
`;
|
|
968
465
|
|
|
969
466
|
// src/knowledge-activity.css
|
|
970
|
-
var knowledge_activity_default = '.dsh-knowledge-activity-viewport {\n width: 100%;\n height: 100%;\n min-width: 0;\n overflow: hidden;\n contain: layout paint;\n}\n\n.dsh-knowledge-activity-panel {\n display: flex;\n width: 100%;\n height: 100%;\n min-width: 0;\n min-height: 0;\n flex-direction: column;\n overflow: hidden;\n color: var(--knowledge-text);\n background: var(--activity-surface);\n -webkit-backdrop-filter: var(--knowledge-embedded-filter);\n backdrop-filter: var(--knowledge-embedded-filter);\n box-shadow: inset 1px 0 0 var(--knowledge-border);\n font-family: var(--knowledge-font-family);\n font-size: 13px;\n line-height: 1.5;\n}\n\n.dsh-knowledge-activity-panel *,\n.dsh-knowledge-activity-panel *::before,\n.dsh-knowledge-activity-panel *::after { box-sizing: border-box; }\n\n.dsh-knowledge-activity-panel ::selection { background: var(--selection-background); color: var(--selection-text); }\n\n.dsh-knowledge-activity-panel :where(button, input) {\n -webkit-appearance: none;\n appearance: none;\n margin: 0;\n color: inherit;\n font: inherit;\n letter-spacing: inherit;\n}\n\n.dsh-knowledge-activity-header {\n display: flex;\n min-height: 58px;\n padding: 0 12px 0 15px;\n align-items: center;\n justify-content: space-between;\n gap: 10px;\n border-bottom: 1px solid var(--knowledge-border);\n background: transparent;\n}\n\n.dsh-knowledge-activity-tabs {\n display: grid;\n min-height: 43px;\n flex: none;\n grid-template-columns: 1fr 1fr;\n gap: 4px;\n padding: 5px 10px;\n border-bottom: 1px solid var(--knowledge-border);\n background: transparent;\n}\n.dsh-knowledge-activity-tabs button {\n display: inline-flex;\n min-width: 0;\n min-height: 32px;\n align-items: center;\n justify-content: center;\n gap: 6px;\n padding: 0 10px;\n border: 1px solid transparent;\n border-radius: 9px;\n color: var(--knowledge-text-tertiary);\n background: transparent;\n cursor: pointer;\n font-size: 12px;\n font-weight: 580;\n}\n.dsh-knowledge-activity-tabs button:hover { color: var(--knowledge-text); background: var(--knowledge-hover); }\n.dsh-knowledge-activity-tabs button.is-active {\n border-color: var(--knowledge-border);\n color: var(--knowledge-text);\n background: var(--knowledge-embedded-control);\n box-shadow: inset 0 1px 0 var(--knowledge-glare-light);\n}\n\n.dsh-knowledge-activity-title,\n.dsh-knowledge-activity-header-actions { display: flex; min-width: 0; align-items: center; gap: 9px; }\n.dsh-knowledge-activity-title > span:last-child { display: grid; min-width: 0; gap: 1px; }\n.dsh-knowledge-activity-title strong { overflow: hidden; font-size: 14px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }\n.dsh-knowledge-activity-title small { overflow: hidden; color: var(--knowledge-text-tertiary); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }\n\n.dsh-knowledge-activity-mark,\n.dsh-knowledge-activity-document-icon,\n.dsh-knowledge-activity-row-icon {\n display: grid;\n flex: none;\n place-items: center;\n border: 1px solid color-mix(in srgb, var(--knowledge-accent) 18%, transparent);\n color: var(--knowledge-accent);\n background: color-mix(in srgb, var(--knowledge-accent) 6%, transparent);\n}\n\n.dsh-knowledge-activity-mark { width: 27px; height: 27px; border: 0; border-radius: 8px; background: transparent; }\n.dsh-knowledge-activity-icon-button {\n display: grid;\n width: 32px;\n height: 32px;\n flex: none;\n place-items: center;\n padding: 0;\n border: 1px solid transparent;\n border-radius: 9px;\n color: var(--knowledge-text-secondary);\n background: transparent;\n cursor: pointer;\n}\n.dsh-knowledge-activity-icon-button:hover { border-color: var(--knowledge-border); color: var(--knowledge-text); background: var(--knowledge-hover); }\n.dsh-knowledge-activity-icon-button:focus-visible,\n.dsh-knowledge-activity-panel button:focus-visible,\n.dsh-knowledge-activity-panel input:focus-visible { outline: 2px solid var(--knowledge-accent); outline-offset: 2px; }\n\n.dsh-knowledge-activity-browser,\n.dsh-knowledge-activity-reader {\n display: flex;\n min-height: 0;\n flex: 1;\n flex-direction: column;\n overflow: hidden;\n padding: 14px 14px 16px;\n}\n\n.dsh-knowledge-activity-search {\n display: flex;\n min-height: 40px;\n flex: none;\n align-items: center;\n gap: 8px;\n padding: 0 10px;\n border: 1px solid var(--knowledge-border);\n border-radius: 10px;\n color: var(--knowledge-text-tertiary);\n background: var(--knowledge-embedded-control);\n}\n.dsh-knowledge-activity-search:focus-within { border-color: color-mix(in srgb, var(--knowledge-accent) 50%, var(--knowledge-border)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--knowledge-accent) 10%, transparent); }\n.dsh-knowledge-activity-search input { min-width: 0; height: 38px; flex: 1; padding: 0; border: 0; outline: 0 !important; color: var(--knowledge-text); background: transparent; box-shadow: none; }\n.dsh-knowledge-activity-search input::placeholder { color: var(--knowledge-text-tertiary); opacity: 1; }\n.dsh-knowledge-activity-search > button { display: grid; width: 28px; height: 28px; place-items: center; padding: 0; border: 0; border-radius: 8px; color: var(--knowledge-text-tertiary); background: transparent; cursor: pointer; }\n.dsh-knowledge-activity-search > button:hover { color: var(--knowledge-text); background: var(--knowledge-hover); }\n\n.dsh-knowledge-activity-scope { position: relative; z-index: 3; flex: none; margin-top: 10px; }\n.dsh-knowledge-activity-breadcrumbs {\n display: flex;\n min-height: 37px;\n flex: none;\n align-items: center;\n gap: 1px;\n overflow-x: auto;\n padding: 5px 1px 2px;\n color: var(--knowledge-text-tertiary);\n scrollbar-width: none;\n}\n.dsh-knowledge-activity-breadcrumbs::-webkit-scrollbar { display: none; }\n.dsh-knowledge-activity-breadcrumbs span { display: inline-flex; flex: none; align-items: center; gap: 1px; }\n.dsh-knowledge-activity-breadcrumbs button {\n max-width: 130px;\n min-height: 28px;\n overflow: hidden;\n padding: 0 7px;\n border: 0;\n border-radius: 7px;\n color: inherit;\n text-overflow: ellipsis;\n white-space: nowrap;\n background: transparent;\n cursor: pointer;\n font-size: 11px;\n}\n.dsh-knowledge-activity-breadcrumbs button:hover { color: var(--knowledge-text); background: var(--knowledge-hover); }\n.dsh-knowledge-activity-breadcrumbs button[aria-current="location"] { color: var(--knowledge-text-secondary); font-weight: 620; }\n.dsh-knowledge-activity-scope-trigger {\n display: grid;\n width: 100%;\n min-height: 48px;\n grid-template-columns: 30px minmax(0, 1fr) 20px;\n align-items: center;\n gap: 8px;\n padding: 5px 9px;\n border: 1px solid var(--knowledge-border);\n border-radius: 10px;\n text-align: left;\n background: color-mix(in srgb, var(--knowledge-embedded-control) 72%, transparent);\n cursor: pointer;\n}\n.dsh-knowledge-activity-scope-trigger:hover { background: var(--knowledge-embedded-control); }\n.dsh-knowledge-activity-scope-trigger > span:nth-child(2) { display: grid; min-width: 0; gap: 1px; }\n.dsh-knowledge-activity-scope-trigger small { color: var(--knowledge-text-tertiary); font-size: 10px; }\n.dsh-knowledge-activity-scope-trigger strong { overflow: hidden; font-size: 12px; font-weight: 620; text-overflow: ellipsis; white-space: nowrap; }\n.dsh-knowledge-activity-scope-trigger > svg { color: var(--knowledge-text-tertiary); transition: transform 140ms ease; }\n.dsh-knowledge-activity-scope-trigger > svg.is-open { transform: rotate(180deg); }\n.dsh-knowledge-activity-scope-icon { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 8px; color: var(--knowledge-accent); background: color-mix(in srgb, var(--knowledge-accent) 8%, transparent); }\n.dsh-knowledge-activity-scope-menu {\n position: absolute;\n z-index: 6;\n top: calc(100% + 6px);\n right: 0;\n left: 0;\n max-height: min(320px, 44vh);\n overflow-y: auto;\n padding: 5px;\n border: 1px solid var(--knowledge-border);\n border-radius: 12px;\n background: var(--dialog-surface);\n box-shadow: 0 16px 38px rgb(24 30 32 / 18%), inset 0 1px 0 var(--knowledge-glare-light);\n -webkit-backdrop-filter: none;\n backdrop-filter: none;\n}\n.dsh-knowledge-activity-scope-menu button { display: flex; width: 100%; min-height: 46px; align-items: center; gap: 9px; padding: 6px 9px; border: 0; border-radius: 8px; text-align: left; background: transparent; cursor: pointer; }\n.dsh-knowledge-activity-scope-menu button:hover { background: var(--knowledge-hover); }\n.dsh-knowledge-activity-scope-menu button.is-active { background: var(--knowledge-embedded-control); }\n.dsh-knowledge-activity-scope-menu button > svg { flex: none; color: var(--knowledge-text-secondary); }\n.dsh-knowledge-activity-scope-menu button > span { display: grid; min-width: 0; gap: 1px; }\n.dsh-knowledge-activity-scope-menu button strong { overflow: hidden; font-size: 12px; font-weight: 620; text-overflow: ellipsis; white-space: nowrap; }\n.dsh-knowledge-activity-scope-menu button small { color: var(--knowledge-text-tertiary); font-size: 10px; }\n\n.dsh-knowledge-activity-list-heading {\n display: flex;\n min-height: 46px;\n flex: none;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n padding: 8px 2px 6px;\n border-bottom: 1px solid var(--knowledge-border);\n}\n.dsh-knowledge-activity-list-heading > span { display: grid; min-width: 0; }\n.dsh-knowledge-activity-list-heading strong { overflow: hidden; font-size: 13px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }\n.dsh-knowledge-activity-list-heading small { color: var(--knowledge-text-tertiary); font-size: 11px; }\n\n.dsh-knowledge-activity-list {\n min-height: 0;\n flex: 1;\n overflow-y: auto;\n overscroll-behavior: contain;\n padding: 0 0 20px;\n scrollbar-color: color-mix(in srgb, var(--knowledge-text-tertiary) 35%, transparent) transparent;\n scrollbar-width: thin;\n}\n.dsh-knowledge-activity-row {\n display: flex;\n width: 100%;\n min-height: 61px;\n align-items: center;\n gap: 9px;\n padding: 8px 6px;\n border: 0;\n border-bottom: 1px solid color-mix(in srgb, var(--knowledge-border) 72%, transparent);\n border-radius: 0;\n text-align: left;\n background: transparent;\n cursor: pointer;\n}\n.dsh-knowledge-activity-row:hover { border-radius: 8px; background: var(--knowledge-hover); }\n.dsh-knowledge-activity-row:disabled { cursor: default; opacity: .58; }\n.dsh-knowledge-activity-row:disabled:hover { border-radius: 0; background: transparent; }\n.dsh-knowledge-activity-row-icon { width: 27px; height: 27px; border: 0; border-radius: 0; background: transparent; }\n.dsh-knowledge-activity-row-copy { display: grid; min-width: 0; flex: 1; gap: 2px; }\n.dsh-knowledge-activity-row-copy strong,\n.dsh-knowledge-activity-row-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.dsh-knowledge-activity-row-copy strong { color: var(--knowledge-text); font-size: 13px; font-weight: 600; }\n.dsh-knowledge-activity-row-copy small { color: var(--knowledge-text-tertiary); font-size: 10px; }\n.dsh-knowledge-activity-row-meta { display: grid; flex: none; justify-items: end; align-items: center; gap: 3px; color: var(--knowledge-text-tertiary); font-size: 10px; }\n.dsh-knowledge-activity-row-meta em { padding: 1px 5px; border-radius: 999px; color: var(--knowledge-text-secondary); background: var(--knowledge-embedded-control); font-style: normal; }\n.dsh-knowledge-activity-load-more { display: block; min-height: 36px; margin: 8px auto 0; padding: 0 14px; border: 1px solid var(--knowledge-border); border-radius: 10px; color: var(--knowledge-text-secondary); background: var(--knowledge-embedded-control); cursor: pointer; }\n.dsh-knowledge-activity-load-more:hover:not(:disabled) { color: var(--knowledge-text); background: var(--knowledge-hover); }\n\n.dsh-knowledge-activity-reader-bar {\n display: flex;\n min-height: 38px;\n flex: none;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n border-bottom: 1px solid var(--knowledge-border);\n color: var(--knowledge-text-tertiary);\n font-size: 11px;\n}\n.dsh-knowledge-activity-back { display: inline-flex; min-height: 32px; align-items: center; gap: 4px; padding: 0 7px 0 4px; border: 0; border-radius: 8px; color: var(--knowledge-text-secondary); background: transparent; cursor: pointer; font-size: 12px !important; }\n.dsh-knowledge-activity-back:hover { color: var(--knowledge-text); background: var(--knowledge-hover); }\n.dsh-knowledge-activity-document-heading { display: flex; flex: none; align-items: center; gap: 10px; padding: 16px 4px 13px; }\n.dsh-knowledge-activity-document-icon { width: 36px; height: 36px; border-radius: 11px; }\n.dsh-knowledge-activity-document-heading > div { min-width: 0; }\n.dsh-knowledge-activity-document-heading h2 { overflow: hidden; margin: 0; font-size: 16px; line-height: 22px; font-weight: 680; text-overflow: ellipsis; white-space: nowrap; }\n.dsh-knowledge-activity-document-heading p { overflow: hidden; margin: 1px 0 0; color: var(--knowledge-text-tertiary); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }\n\n.dsh-knowledge-activity-markdown {\n min-height: 0;\n flex: 1;\n overflow-y: auto;\n padding: 0 5px 44px;\n color: var(--knowledge-text);\n font-size: 13px;\n line-height: 1.75;\n overflow-wrap: anywhere;\n scrollbar-color: color-mix(in srgb, var(--knowledge-text-tertiary) 35%, transparent) transparent;\n scrollbar-width: thin;\n}\n.dsh-knowledge-activity-markdown :where(h1, h2, h3, h4, h5, h6) { margin: 1.35em 0 .55em; color: var(--knowledge-text); line-height: 1.35; font-weight: 650; }\n.dsh-knowledge-activity-markdown h1 { font-size: 18px; }\n.dsh-knowledge-activity-markdown h2 { padding-bottom: .35em; border-bottom: 1px solid var(--knowledge-border); font-size: 16px; }\n.dsh-knowledge-activity-markdown h3 { font-size: 14px; }\n.dsh-knowledge-activity-markdown :where(h4, h5, h6) { font-size: 13px; }\n.dsh-knowledge-activity-markdown hr { height: 1px; margin: 18px 0; border: 0; background: var(--knowledge-border); }\n.dsh-knowledge-activity-markdown summary { cursor: pointer; color: var(--knowledge-text); }\n.dsh-knowledge-activity-markdown :where(p, ul, ol, blockquote, pre, table) { margin: .7em 0; }\n.dsh-knowledge-activity-markdown :where(ul, ol) { padding-left: 1.5em; }\n.dsh-knowledge-activity-markdown a { color: var(--knowledge-accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }\n.dsh-knowledge-activity-markdown blockquote { margin-left: 0; padding: .15em 0 .15em 12px; border-left: 3px solid color-mix(in srgb, var(--knowledge-accent) 40%, transparent); color: var(--knowledge-text-secondary); }\n.dsh-knowledge-activity-markdown :where(code, pre) { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }\n.dsh-knowledge-activity-markdown code { padding: .14em .32em; border-radius: 5px; background: var(--knowledge-embedded-control); font-size: .92em; }\n.dsh-knowledge-activity-markdown pre { overflow-x: auto; padding: 11px 12px; border: 1px solid var(--knowledge-border); border-radius: 10px; background: var(--knowledge-embedded-control); }\n.dsh-knowledge-activity-markdown pre code { padding: 0; background: transparent; }\n.dsh-knowledge-activity-markdown table { width: 100%; border-collapse: collapse; font-size: 12px; }\n.dsh-knowledge-activity-markdown :where(th, td) { padding: 6px 7px; border: 1px solid var(--knowledge-border); text-align: left; }\n.dsh-knowledge-activity-markdown img { display: block; max-width: 100%; height: auto; border-radius: 10px; }\n\n.dsh-knowledge-activity-state,\n.dsh-knowledge-activity-error,\n.dsh-knowledge-activity-empty { margin: auto; text-align: center; }\n.dsh-knowledge-activity-state { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 28px 10px; color: var(--knowledge-text-tertiary); }\n.dsh-knowledge-activity-state > span { width: 8px; height: 8px; border: 2px solid var(--knowledge-border); border-top-color: var(--knowledge-accent); border-radius: 50%; animation: dsh-knowledge-activity-spin .8s linear infinite; }\n.dsh-knowledge-activity-error,\n.dsh-knowledge-activity-empty { display: grid; max-width: 260px; justify-items: center; gap: 6px; padding: 32px 12px; }\n.dsh-knowledge-activity-error strong,\n.dsh-knowledge-activity-empty strong { font-size: 13px; font-weight: 650; }\n.dsh-knowledge-activity-error p,\n.dsh-knowledge-activity-empty p { margin: 0; color: var(--knowledge-text-tertiary); font-size: 11px; line-height: 1.65; }\n.dsh-knowledge-activity-empty > span { display: grid; width: 40px; height: 40px; margin-bottom: 3px; place-items: center; border-radius: 13px; color: var(--knowledge-text-secondary); background: var(--knowledge-embedded-control); }\n.dsh-knowledge-activity-error > button { min-height: 34px; margin-top: 6px; padding: 0 13px; border: 1px solid var(--knowledge-border); border-radius: 9px; background: var(--knowledge-embedded-control); cursor: pointer; }\n.dsh-knowledge-activity-error > button:hover { background: var(--knowledge-hover); }\n\n@keyframes dsh-knowledge-activity-spin { to { transform: rotate(360deg); } }\n\n@media (max-width: 460px) {\n .dsh-knowledge-activity-header { padding-inline: 10px; }\n .dsh-knowledge-activity-browser,\n .dsh-knowledge-activity-reader { padding: 10px 10px max(14px, env(safe-area-inset-bottom)); }\n .dsh-knowledge-activity-search input { font-size: 16px; }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .dsh-knowledge-activity-panel,\n .dsh-knowledge-activity-state > span,\n .dsh-knowledge-activity-scope-trigger > svg { animation: none; transition: none; }\n}\n';
|
|
467
|
+
var knowledge_activity_default = '.dsh-knowledge-activity-viewport {\n width: 100%;\n height: 100%;\n min-width: 0;\n overflow: hidden;\n contain: layout paint;\n}\n\n.dsh-knowledge-activity-panel {\n display: flex;\n width: 100%;\n height: 100%;\n min-width: 0;\n min-height: 0;\n flex-direction: column;\n overflow: hidden;\n color: var(--knowledge-text);\n background: var(--activity-surface);\n -webkit-backdrop-filter: var(--knowledge-embedded-filter);\n backdrop-filter: var(--knowledge-embedded-filter);\n box-shadow: inset 1px 0 0 var(--knowledge-border);\n font-family: var(--knowledge-font-family);\n font-size: 13px;\n line-height: 1.5;\n}\n\n.dsh-knowledge-activity-panel *,\n.dsh-knowledge-activity-panel *::before,\n.dsh-knowledge-activity-panel *::after { box-sizing: border-box; }\n\n.dsh-knowledge-activity-panel ::selection { background: var(--selection-background); color: var(--selection-text); }\n\n.dsh-knowledge-activity-panel :where(button, input) {\n -webkit-appearance: none;\n appearance: none;\n margin: 0;\n color: inherit;\n font: inherit;\n letter-spacing: inherit;\n}\n\n.dsh-knowledge-activity-header {\n display: flex;\n min-height: 58px;\n padding: 0 12px 0 15px;\n align-items: center;\n justify-content: space-between;\n gap: 10px;\n border-bottom: 1px solid var(--knowledge-border);\n background: transparent;\n}\n\n.dsh-knowledge-activity-tabs {\n display: grid;\n min-height: 43px;\n flex: none;\n grid-template-columns: 1fr 1fr;\n gap: 4px;\n padding: 5px 10px;\n border-bottom: 1px solid var(--knowledge-border);\n background: transparent;\n}\n.dsh-knowledge-activity-tabs button {\n display: inline-flex;\n min-width: 0;\n min-height: 32px;\n align-items: center;\n justify-content: center;\n gap: 6px;\n padding: 0 10px;\n border: 1px solid transparent;\n border-radius: 9px;\n color: var(--knowledge-text-tertiary);\n background: transparent;\n cursor: pointer;\n font-size: 12px;\n font-weight: 580;\n}\n.dsh-knowledge-activity-tabs button:hover { color: var(--knowledge-text); background: var(--knowledge-hover); }\n.dsh-knowledge-activity-tabs button.is-active {\n border-color: var(--knowledge-border);\n color: var(--knowledge-text);\n background: var(--knowledge-embedded-control);\n box-shadow: inset 0 1px 0 var(--knowledge-glare-light);\n}\n\n.dsh-knowledge-activity-title,\n.dsh-knowledge-activity-header-actions { display: flex; min-width: 0; align-items: center; gap: 9px; }\n.dsh-knowledge-activity-title > span:last-child { display: grid; min-width: 0; gap: 1px; }\n.dsh-knowledge-activity-title strong { overflow: hidden; font-size: 14px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }\n.dsh-knowledge-activity-title small { overflow: hidden; color: var(--knowledge-text-tertiary); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }\n\n.dsh-knowledge-activity-mark,\n.dsh-knowledge-activity-document-icon,\n.dsh-knowledge-activity-row-icon {\n display: grid;\n flex: none;\n place-items: center;\n border: 1px solid color-mix(in srgb, var(--knowledge-accent) 18%, transparent);\n color: var(--knowledge-accent);\n background: color-mix(in srgb, var(--knowledge-accent) 6%, transparent);\n}\n\n.dsh-knowledge-activity-mark { width: 27px; height: 27px; border: 0; border-radius: 8px; background: transparent; }\n.dsh-knowledge-activity-icon-button {\n display: grid;\n width: 32px;\n height: 32px;\n flex: none;\n place-items: center;\n padding: 0;\n border: 1px solid transparent;\n border-radius: 9px;\n color: var(--knowledge-text-secondary);\n background: transparent;\n cursor: pointer;\n}\n.dsh-knowledge-activity-icon-button:hover { border-color: var(--knowledge-border); color: var(--knowledge-text); background: var(--knowledge-hover); }\n.dsh-knowledge-activity-icon-button:focus-visible,\n.dsh-knowledge-activity-panel button:focus-visible,\n.dsh-knowledge-activity-panel input:focus-visible { outline: 2px solid var(--knowledge-accent); outline-offset: 2px; }\n\n.dsh-knowledge-activity-browser,\n.dsh-knowledge-activity-reader {\n display: flex;\n min-height: 0;\n flex: 1;\n flex-direction: column;\n overflow: hidden;\n padding: 14px 14px 16px;\n}\n\n.dsh-knowledge-activity-search {\n display: flex;\n min-height: 40px;\n flex: none;\n align-items: center;\n gap: 8px;\n padding: 0 10px;\n border: 1px solid var(--knowledge-border);\n border-radius: 10px;\n color: var(--knowledge-text-tertiary);\n background: var(--knowledge-embedded-control);\n}\n.dsh-knowledge-activity-search:focus-within { border-color: var(--knowledge-border); box-shadow: none; background: color-mix(in srgb, var(--knowledge-text) 5%, var(--knowledge-embedded-control)); }\n.dsh-knowledge-activity-search input { min-width: 0; height: 38px; flex: 1; padding: 0; border: 0; outline: 0 !important; color: var(--knowledge-text); background: transparent; box-shadow: none; }\n.dsh-knowledge-activity-search input::placeholder { color: var(--knowledge-text-tertiary); opacity: 1; }\n/* Host themes can force a focus outline with #root and !important. */\n#root .dsh-knowledge-activity-search input:is(:focus, :focus-visible) {\n outline: none !important;\n outline-offset: 0 !important;\n border: 0;\n box-shadow: none !important;\n}\n.dsh-knowledge-activity-search > button { display: grid; width: 28px; height: 28px; place-items: center; padding: 0; border: 0; border-radius: 8px; color: var(--knowledge-text-tertiary); background: transparent; cursor: pointer; }\n.dsh-knowledge-activity-search > button:hover { color: var(--knowledge-text); background: var(--knowledge-hover); }\n\n.dsh-knowledge-activity-scope { position: relative; z-index: 3; flex: none; margin-top: 10px; }\n.dsh-knowledge-activity-breadcrumbs {\n display: flex;\n min-height: 37px;\n flex: none;\n align-items: center;\n gap: 1px;\n overflow-x: auto;\n padding: 5px 1px 2px;\n color: var(--knowledge-text-tertiary);\n scrollbar-width: none;\n}\n.dsh-knowledge-activity-breadcrumbs::-webkit-scrollbar { display: none; }\n.dsh-knowledge-activity-breadcrumbs span { display: inline-flex; flex: none; align-items: center; gap: 1px; }\n.dsh-knowledge-activity-breadcrumbs button {\n max-width: 130px;\n min-height: 28px;\n overflow: hidden;\n padding: 0 7px;\n border: 0;\n border-radius: 7px;\n color: inherit;\n text-overflow: ellipsis;\n white-space: nowrap;\n background: transparent;\n cursor: pointer;\n font-size: 11px;\n}\n.dsh-knowledge-activity-breadcrumbs button:hover { color: var(--knowledge-text); background: var(--knowledge-hover); }\n.dsh-knowledge-activity-breadcrumbs button[aria-current="location"] { color: var(--knowledge-text-secondary); font-weight: 620; }\n.dsh-knowledge-activity-scope-trigger {\n display: grid;\n width: 100%;\n min-height: 48px;\n grid-template-columns: 30px minmax(0, 1fr) 20px;\n align-items: center;\n gap: 8px;\n padding: 5px 9px;\n border: 1px solid var(--knowledge-border);\n border-radius: 10px;\n text-align: left;\n background: color-mix(in srgb, var(--knowledge-embedded-control) 72%, transparent);\n cursor: pointer;\n}\n.dsh-knowledge-activity-scope-trigger:hover { background: var(--knowledge-embedded-control); }\n.dsh-knowledge-activity-scope-trigger > span:nth-child(2) { display: grid; min-width: 0; gap: 1px; }\n.dsh-knowledge-activity-scope-trigger small { color: var(--knowledge-text-tertiary); font-size: 10px; }\n.dsh-knowledge-activity-scope-trigger strong { overflow: hidden; font-size: 12px; font-weight: 620; text-overflow: ellipsis; white-space: nowrap; }\n.dsh-knowledge-activity-scope-trigger > svg { color: var(--knowledge-text-tertiary); transition: transform 140ms ease; }\n.dsh-knowledge-activity-scope-trigger > svg.is-open { transform: rotate(180deg); }\n.dsh-knowledge-activity-scope-icon { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 8px; color: var(--knowledge-accent); background: color-mix(in srgb, var(--knowledge-accent) 8%, transparent); }\n.dsh-knowledge-activity-scope-menu {\n position: absolute;\n z-index: 6;\n top: calc(100% + 6px);\n right: 0;\n left: 0;\n max-height: min(320px, 44vh);\n overflow-y: auto;\n padding: 5px;\n border: 1px solid var(--knowledge-border);\n border-radius: 12px;\n background: var(--dialog-surface);\n box-shadow: 0 16px 38px rgb(24 30 32 / 18%), inset 0 1px 0 var(--knowledge-glare-light);\n -webkit-backdrop-filter: none;\n backdrop-filter: none;\n}\n.dsh-knowledge-activity-scope-menu button { display: flex; width: 100%; min-height: 46px; align-items: center; gap: 9px; padding: 6px 9px; border: 0; border-radius: 8px; text-align: left; background: transparent; cursor: pointer; }\n.dsh-knowledge-activity-scope-menu button:hover { background: var(--knowledge-hover); }\n.dsh-knowledge-activity-scope-menu button.is-active { background: var(--knowledge-embedded-control); }\n.dsh-knowledge-activity-scope-menu button > svg { flex: none; color: var(--knowledge-text-secondary); }\n.dsh-knowledge-activity-scope-menu button > span { display: grid; min-width: 0; gap: 1px; }\n.dsh-knowledge-activity-scope-menu button strong { overflow: hidden; font-size: 12px; font-weight: 620; text-overflow: ellipsis; white-space: nowrap; }\n.dsh-knowledge-activity-scope-menu button small { color: var(--knowledge-text-tertiary); font-size: 10px; }\n\n.dsh-knowledge-activity-list-heading {\n display: flex;\n min-height: 46px;\n flex: none;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n padding: 8px 2px 6px;\n border-bottom: 1px solid var(--knowledge-border);\n}\n.dsh-knowledge-activity-list-heading > span { display: grid; min-width: 0; }\n.dsh-knowledge-activity-list-heading strong { overflow: hidden; font-size: 13px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }\n.dsh-knowledge-activity-list-heading small { color: var(--knowledge-text-tertiary); font-size: 11px; }\n\n.dsh-knowledge-activity-list {\n min-height: 0;\n flex: 1;\n overflow-y: auto;\n overscroll-behavior: contain;\n padding: 0 0 20px;\n scrollbar-color: color-mix(in srgb, var(--knowledge-text-tertiary) 35%, transparent) transparent;\n scrollbar-width: thin;\n}\n.dsh-knowledge-activity-row {\n display: flex;\n width: 100%;\n min-height: 61px;\n align-items: center;\n gap: 9px;\n padding: 8px 6px;\n border: 0;\n border-bottom: 1px solid color-mix(in srgb, var(--knowledge-border) 72%, transparent);\n border-radius: 0;\n text-align: left;\n background: transparent;\n cursor: pointer;\n}\n.dsh-knowledge-activity-row:hover { border-radius: 8px; background: var(--knowledge-hover); }\n.dsh-knowledge-activity-row:disabled { cursor: default; opacity: .58; }\n.dsh-knowledge-activity-row:disabled:hover { border-radius: 0; background: transparent; }\n.dsh-knowledge-activity-row-icon { width: 27px; height: 27px; border: 0; border-radius: 0; background: transparent; }\n.dsh-knowledge-activity-row-copy { display: grid; min-width: 0; flex: 1; gap: 2px; }\n.dsh-knowledge-activity-row-copy strong,\n.dsh-knowledge-activity-row-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.dsh-knowledge-activity-row-copy strong { color: var(--knowledge-text); font-size: 13px; font-weight: 600; }\n.dsh-knowledge-activity-row-copy small { color: var(--knowledge-text-tertiary); font-size: 10px; }\n.dsh-knowledge-activity-row-meta { display: grid; flex: none; justify-items: end; align-items: center; gap: 3px; color: var(--knowledge-text-tertiary); font-size: 10px; }\n.dsh-knowledge-activity-row-meta em { padding: 1px 5px; border-radius: 999px; color: var(--knowledge-text-secondary); background: var(--knowledge-embedded-control); font-style: normal; }\n.dsh-knowledge-activity-load-more { display: block; min-height: 36px; margin: 8px auto 0; padding: 0 14px; border: 1px solid var(--knowledge-border); border-radius: 10px; color: var(--knowledge-text-secondary); background: var(--knowledge-embedded-control); cursor: pointer; }\n.dsh-knowledge-activity-load-more:hover:not(:disabled) { color: var(--knowledge-text); background: var(--knowledge-hover); }\n\n.dsh-knowledge-activity-reader-bar {\n display: flex;\n min-height: 38px;\n flex: none;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n border-bottom: 1px solid var(--knowledge-border);\n color: var(--knowledge-text-tertiary);\n font-size: 11px;\n}\n.dsh-knowledge-activity-back { display: inline-flex; min-height: 32px; align-items: center; gap: 4px; padding: 0 7px 0 4px; border: 0; border-radius: 8px; color: var(--knowledge-text-secondary); background: transparent; cursor: pointer; font-size: 12px !important; }\n.dsh-knowledge-activity-back:hover { color: var(--knowledge-text); background: var(--knowledge-hover); }\n.dsh-knowledge-activity-document-heading { display: flex; flex: none; align-items: center; gap: 10px; padding: 16px 4px 13px; }\n.dsh-knowledge-activity-document-icon { width: 36px; height: 36px; border-radius: 11px; }\n.dsh-knowledge-activity-document-heading > div { min-width: 0; }\n.dsh-knowledge-activity-document-heading h2 { overflow: hidden; margin: 0; font-size: 16px; line-height: 22px; font-weight: 680; text-overflow: ellipsis; white-space: nowrap; }\n.dsh-knowledge-activity-document-heading p { overflow: hidden; margin: 1px 0 0; color: var(--knowledge-text-tertiary); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }\n\n.dsh-knowledge-activity-markdown {\n min-height: 0;\n flex: 1;\n overflow-y: auto;\n padding: 0 5px 44px;\n color: var(--knowledge-text);\n font-size: 13px;\n line-height: 1.75;\n overflow-wrap: anywhere;\n scrollbar-color: color-mix(in srgb, var(--knowledge-text-tertiary) 35%, transparent) transparent;\n scrollbar-width: thin;\n}\n.dsh-knowledge-activity-markdown :where(h1, h2, h3, h4, h5, h6) { margin: 1.35em 0 .55em; color: var(--knowledge-text); line-height: 1.35; font-weight: 650; }\n.dsh-knowledge-activity-markdown h1 { font-size: 18px; }\n.dsh-knowledge-activity-markdown h2 { padding-bottom: .35em; border-bottom: 1px solid var(--knowledge-border); font-size: 16px; }\n.dsh-knowledge-activity-markdown h3 { font-size: 14px; }\n.dsh-knowledge-activity-markdown :where(h4, h5, h6) { font-size: 13px; }\n.dsh-knowledge-activity-markdown hr { height: 1px; margin: 18px 0; border: 0; background: var(--knowledge-border); }\n.dsh-knowledge-activity-markdown summary { cursor: pointer; color: var(--knowledge-text); }\n.dsh-knowledge-activity-markdown :where(p, ul, ol, blockquote, pre, table) { margin: .7em 0; }\n.dsh-knowledge-activity-markdown :where(ul, ol) { padding-left: 1.5em; }\n.dsh-knowledge-activity-markdown a { color: var(--knowledge-accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }\n.dsh-knowledge-activity-markdown blockquote { margin-left: 0; padding: .15em 0 .15em 12px; border-left: 3px solid color-mix(in srgb, var(--knowledge-accent) 40%, transparent); color: var(--knowledge-text-secondary); }\n.dsh-knowledge-activity-markdown :where(code, pre) { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }\n.dsh-knowledge-activity-markdown code { padding: .14em .32em; border-radius: 5px; background: var(--knowledge-embedded-control); font-size: .92em; }\n.dsh-knowledge-activity-markdown pre { overflow-x: auto; padding: 11px 12px; border: 1px solid var(--knowledge-border); border-radius: 10px; background: var(--knowledge-embedded-control); }\n.dsh-knowledge-activity-markdown pre code { padding: 0; background: transparent; }\n.dsh-knowledge-activity-markdown table { width: 100%; border-collapse: collapse; font-size: 12px; }\n.dsh-knowledge-activity-markdown :where(th, td) { padding: 6px 7px; border: 1px solid var(--knowledge-border); text-align: left; }\n.dsh-knowledge-activity-markdown img { display: block; max-width: 100%; height: auto; border-radius: 10px; }\n\n.dsh-knowledge-activity-state,\n.dsh-knowledge-activity-error,\n.dsh-knowledge-activity-empty { margin: auto; text-align: center; }\n.dsh-knowledge-activity-state { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 28px 10px; color: var(--knowledge-text-tertiary); }\n.dsh-knowledge-activity-state > span { width: 8px; height: 8px; border: 2px solid var(--knowledge-border); border-top-color: var(--knowledge-accent); border-radius: 50%; animation: dsh-knowledge-activity-spin .8s linear infinite; }\n.dsh-knowledge-activity-error,\n.dsh-knowledge-activity-empty { display: grid; max-width: 260px; justify-items: center; gap: 6px; padding: 32px 12px; }\n.dsh-knowledge-activity-error strong,\n.dsh-knowledge-activity-empty strong { font-size: 13px; font-weight: 650; }\n.dsh-knowledge-activity-error p,\n.dsh-knowledge-activity-empty p { margin: 0; color: var(--knowledge-text-tertiary); font-size: 11px; line-height: 1.65; }\n.dsh-knowledge-activity-empty > span { display: grid; width: 40px; height: 40px; margin-bottom: 3px; place-items: center; border-radius: 13px; color: var(--knowledge-text-secondary); background: var(--knowledge-embedded-control); }\n.dsh-knowledge-activity-error > button { min-height: 34px; margin-top: 6px; padding: 0 13px; border: 1px solid var(--knowledge-border); border-radius: 9px; background: var(--knowledge-embedded-control); cursor: pointer; }\n.dsh-knowledge-activity-error > button:hover { background: var(--knowledge-hover); }\n\n@keyframes dsh-knowledge-activity-spin { to { transform: rotate(360deg); } }\n\n@media (max-width: 460px) {\n .dsh-knowledge-activity-header { padding-inline: 10px; }\n .dsh-knowledge-activity-browser,\n .dsh-knowledge-activity-reader { padding: 10px 10px max(14px, env(safe-area-inset-bottom)); }\n .dsh-knowledge-activity-search input { font-size: 16px; }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .dsh-knowledge-activity-panel,\n .dsh-knowledge-activity-state > span,\n .dsh-knowledge-activity-scope-trigger > svg { animation: none; transition: none; }\n}\n';
|
|
971
468
|
|
|
972
469
|
// src/knowledge-activity-panel.tsx
|
|
973
|
-
var
|
|
470
|
+
var import_react4 = require("react");
|
|
974
471
|
var import_dsh_client_ui_primitives2 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
975
472
|
|
|
976
473
|
// src/knowledge-activity-api.ts
|
|
@@ -1050,7 +547,7 @@ function isRecord(value) {
|
|
|
1050
547
|
}
|
|
1051
548
|
|
|
1052
549
|
// src/knowledge-activity-notes.tsx
|
|
1053
|
-
var
|
|
550
|
+
var import_react3 = require("react");
|
|
1054
551
|
var import_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
1055
552
|
|
|
1056
553
|
// src/latest-request.ts
|
|
@@ -3938,19 +3435,19 @@ function renderMarkdown(markdown) {
|
|
|
3938
3435
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
3939
3436
|
function KnowledgeActivityNotes({ sessionId, projectId, controller }) {
|
|
3940
3437
|
const initial = controller.selection(sessionId);
|
|
3941
|
-
const [folderId, setFolderId] = (0,
|
|
3942
|
-
const [crumbs, setCrumbs] = (0,
|
|
3943
|
-
const [selectedId, setSelectedId] = (0,
|
|
3944
|
-
const [nodes, setNodes] = (0,
|
|
3945
|
-
const [content, setContent] = (0,
|
|
3946
|
-
const [queryInput, setQueryInput] = (0,
|
|
3947
|
-
const [query, setQuery] = (0,
|
|
3948
|
-
const [listState, setListState] = (0,
|
|
3949
|
-
const [contentState, setContentState] = (0,
|
|
3950
|
-
const [error, setError] = (0,
|
|
3951
|
-
const listRequest = (0,
|
|
3952
|
-
const [refresh, setRefresh] = (0,
|
|
3953
|
-
const loadNodes = (0,
|
|
3438
|
+
const [folderId, setFolderId] = (0, import_react3.useState)(initial.noteFolderId ?? null);
|
|
3439
|
+
const [crumbs, setCrumbs] = (0, import_react3.useState)(initial.noteCrumbs ?? [{ id: null, name: "\u5168\u90E8\u7B14\u8BB0" }]);
|
|
3440
|
+
const [selectedId, setSelectedId] = (0, import_react3.useState)(initial.noteDocumentId);
|
|
3441
|
+
const [nodes, setNodes] = (0, import_react3.useState)([]);
|
|
3442
|
+
const [content, setContent] = (0, import_react3.useState)();
|
|
3443
|
+
const [queryInput, setQueryInput] = (0, import_react3.useState)("");
|
|
3444
|
+
const [query, setQuery] = (0, import_react3.useState)("");
|
|
3445
|
+
const [listState, setListState] = (0, import_react3.useState)("loading");
|
|
3446
|
+
const [contentState, setContentState] = (0, import_react3.useState)("idle");
|
|
3447
|
+
const [error, setError] = (0, import_react3.useState)("");
|
|
3448
|
+
const listRequest = (0, import_react3.useRef)(new LatestRequest());
|
|
3449
|
+
const [refresh, setRefresh] = (0, import_react3.useState)(0);
|
|
3450
|
+
const loadNodes = (0, import_react3.useCallback)(async () => {
|
|
3954
3451
|
const signal = listRequest.current.start();
|
|
3955
3452
|
setListState("loading");
|
|
3956
3453
|
setError("");
|
|
@@ -3971,13 +3468,13 @@ function KnowledgeActivityNotes({ sessionId, projectId, controller }) {
|
|
|
3971
3468
|
setError(message(reason));
|
|
3972
3469
|
}
|
|
3973
3470
|
}, [folderId, projectId, query, sessionId]);
|
|
3974
|
-
(0,
|
|
3471
|
+
(0, import_react3.useEffect)(() => {
|
|
3975
3472
|
void loadNodes();
|
|
3976
3473
|
return () => {
|
|
3977
3474
|
listRequest.current.cancel();
|
|
3978
3475
|
};
|
|
3979
3476
|
}, [loadNodes, refresh]);
|
|
3980
|
-
(0,
|
|
3477
|
+
(0, import_react3.useEffect)(() => {
|
|
3981
3478
|
if (selectedId === void 0) {
|
|
3982
3479
|
setContent(void 0);
|
|
3983
3480
|
setContentState("idle");
|
|
@@ -4081,7 +3578,7 @@ function KnowledgeActivityNotes({ sessionId, projectId, controller }) {
|
|
|
4081
3578
|
] });
|
|
4082
3579
|
}
|
|
4083
3580
|
function NoteReader({ value, state, error, onBack, onRetry }) {
|
|
4084
|
-
const html2 = (0,
|
|
3581
|
+
const html2 = (0, import_react3.useMemo)(() => value === void 0 ? "" : renderMarkdown(value.content), [value]);
|
|
4085
3582
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-knowledge-activity-reader", children: [
|
|
4086
3583
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsh-knowledge-activity-reader-bar", children: [
|
|
4087
3584
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", { type: "button", className: "dsh-knowledge-activity-back", onClick: onBack, children: [
|
|
@@ -4148,25 +3645,25 @@ function KnowledgeActivityPanel(props) {
|
|
|
4148
3645
|
const sessionId = String(props.sessionId);
|
|
4149
3646
|
const projectId = props.useSessions((state) => state.byId[props.sessionId]?.cwd);
|
|
4150
3647
|
const initial = props.controller.selection(sessionId);
|
|
4151
|
-
const [mode, setMode] = (0,
|
|
4152
|
-
const [mounts, setMounts] = (0,
|
|
4153
|
-
const [selectedBaseId, setSelectedBaseId] = (0,
|
|
4154
|
-
const [selectedDocumentId, setSelectedDocumentId] = (0,
|
|
4155
|
-
const [documents, setDocuments] = (0,
|
|
4156
|
-
const [documentValue, setDocumentValue] = (0,
|
|
4157
|
-
const [queryInput, setQueryInput] = (0,
|
|
4158
|
-
const [query, setQuery] = (0,
|
|
4159
|
-
const [mountState, setMountState] = (0,
|
|
4160
|
-
const [listState, setListState] = (0,
|
|
4161
|
-
const [documentState, setDocumentState] = (0,
|
|
4162
|
-
const [documentRefresh, setDocumentRefresh] = (0,
|
|
4163
|
-
const [error, setError] = (0,
|
|
4164
|
-
const [nextCursor, setNextCursor] = (0,
|
|
4165
|
-
const [baseMenuOpen, setBaseMenuOpen] = (0,
|
|
4166
|
-
const indexRequest = (0,
|
|
4167
|
-
const mountRequest = (0,
|
|
4168
|
-
const scopeRef = (0,
|
|
4169
|
-
(0,
|
|
3648
|
+
const [mode, setMode] = (0, import_react4.useState)(initial.mode ?? "knowledge");
|
|
3649
|
+
const [mounts, setMounts] = (0, import_react4.useState)([]);
|
|
3650
|
+
const [selectedBaseId, setSelectedBaseId] = (0, import_react4.useState)(initial.knowledgeBaseId);
|
|
3651
|
+
const [selectedDocumentId, setSelectedDocumentId] = (0, import_react4.useState)(initial.documentId);
|
|
3652
|
+
const [documents, setDocuments] = (0, import_react4.useState)([]);
|
|
3653
|
+
const [documentValue, setDocumentValue] = (0, import_react4.useState)();
|
|
3654
|
+
const [queryInput, setQueryInput] = (0, import_react4.useState)("");
|
|
3655
|
+
const [query, setQuery] = (0, import_react4.useState)("");
|
|
3656
|
+
const [mountState, setMountState] = (0, import_react4.useState)("loading");
|
|
3657
|
+
const [listState, setListState] = (0, import_react4.useState)("idle");
|
|
3658
|
+
const [documentState, setDocumentState] = (0, import_react4.useState)("idle");
|
|
3659
|
+
const [documentRefresh, setDocumentRefresh] = (0, import_react4.useState)(0);
|
|
3660
|
+
const [error, setError] = (0, import_react4.useState)("");
|
|
3661
|
+
const [nextCursor, setNextCursor] = (0, import_react4.useState)();
|
|
3662
|
+
const [baseMenuOpen, setBaseMenuOpen] = (0, import_react4.useState)(false);
|
|
3663
|
+
const indexRequest = (0, import_react4.useRef)(new LatestRequest());
|
|
3664
|
+
const mountRequest = (0, import_react4.useRef)(new LatestRequest());
|
|
3665
|
+
const scopeRef = (0, import_react4.useRef)(null);
|
|
3666
|
+
(0, import_react4.useEffect)(() => {
|
|
4170
3667
|
if (!baseMenuOpen) return;
|
|
4171
3668
|
const closeOutside = (event) => {
|
|
4172
3669
|
if (!scopeRef.current?.contains(event.target)) setBaseMenuOpen(false);
|
|
@@ -4181,7 +3678,7 @@ function KnowledgeActivityPanel(props) {
|
|
|
4181
3678
|
document.removeEventListener("keydown", closeOnEscape);
|
|
4182
3679
|
};
|
|
4183
3680
|
}, [baseMenuOpen]);
|
|
4184
|
-
const refreshMounts = (0,
|
|
3681
|
+
const refreshMounts = (0, import_react4.useCallback)(async () => {
|
|
4185
3682
|
const signal = mountRequest.current.start();
|
|
4186
3683
|
setMountState("loading");
|
|
4187
3684
|
setError("");
|
|
@@ -4207,13 +3704,13 @@ function KnowledgeActivityPanel(props) {
|
|
|
4207
3704
|
setError(message2(reason));
|
|
4208
3705
|
}
|
|
4209
3706
|
}, [projectId, props.controller, sessionId]);
|
|
4210
|
-
(0,
|
|
3707
|
+
(0, import_react4.useEffect)(() => {
|
|
4211
3708
|
void refreshMounts();
|
|
4212
3709
|
return () => {
|
|
4213
3710
|
mountRequest.current.cancel();
|
|
4214
3711
|
};
|
|
4215
3712
|
}, [refreshMounts]);
|
|
4216
|
-
const loadIndex = (0,
|
|
3713
|
+
const loadIndex = (0, import_react4.useCallback)(async (cursor, append = false) => {
|
|
4217
3714
|
const signal = indexRequest.current.start();
|
|
4218
3715
|
if (mounts.length === 0 || query.length === 0 && selectedBaseId === void 0) {
|
|
4219
3716
|
setDocuments([]);
|
|
@@ -4242,13 +3739,13 @@ function KnowledgeActivityPanel(props) {
|
|
|
4242
3739
|
setError(message2(reason));
|
|
4243
3740
|
}
|
|
4244
3741
|
}, [mounts, projectId, query, selectedBaseId, sessionId]);
|
|
4245
|
-
(0,
|
|
3742
|
+
(0, import_react4.useEffect)(() => {
|
|
4246
3743
|
void loadIndex();
|
|
4247
3744
|
return () => {
|
|
4248
3745
|
indexRequest.current.cancel();
|
|
4249
3746
|
};
|
|
4250
3747
|
}, [loadIndex]);
|
|
4251
|
-
(0,
|
|
3748
|
+
(0, import_react4.useEffect)(() => {
|
|
4252
3749
|
if (selectedDocumentId === void 0) {
|
|
4253
3750
|
setDocumentValue(void 0);
|
|
4254
3751
|
setDocumentState("idle");
|
|
@@ -4442,7 +3939,7 @@ function DocumentRow({ document: document2, baseName, onClick }) {
|
|
|
4442
3939
|
] });
|
|
4443
3940
|
}
|
|
4444
3941
|
function DocumentReader({ value, state, error, onBack, onRetry }) {
|
|
4445
|
-
const html2 = (0,
|
|
3942
|
+
const html2 = (0, import_react4.useMemo)(() => value === void 0 ? "" : renderMarkdown(readableMarkdown(value.content)), [value]);
|
|
4446
3943
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-knowledge-activity-reader", children: [
|
|
4447
3944
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsh-knowledge-activity-reader-bar", children: [
|
|
4448
3945
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("button", { type: "button", className: "dsh-knowledge-activity-back", onClick: onBack, children: [
|
|
@@ -4502,12 +3999,12 @@ function message2(reason) {
|
|
|
4502
3999
|
}
|
|
4503
4000
|
|
|
4504
4001
|
// src/knowledge-activity-presentation.tsx
|
|
4505
|
-
var
|
|
4002
|
+
var import_react5 = require("react");
|
|
4506
4003
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
4507
4004
|
function KnowledgeActivityPresentation({ controller, sessionId, onClosed, children }) {
|
|
4508
|
-
const root = (0,
|
|
4509
|
-
const open = (0,
|
|
4510
|
-
(0,
|
|
4005
|
+
const root = (0, import_react5.useRef)(null);
|
|
4006
|
+
const open = (0, import_react5.useSyncExternalStore)(controller.subscribe, () => controller.isOpen(sessionId));
|
|
4007
|
+
(0, import_react5.useLayoutEffect)(() => {
|
|
4511
4008
|
const viewport = root.current;
|
|
4512
4009
|
const panel = viewport?.firstElementChild;
|
|
4513
4010
|
if (!viewport || !panel) return;
|
|
@@ -4565,6 +4062,7 @@ function KnowledgeActivityPresentation({ controller, sessionId, onClosed, childr
|
|
|
4565
4062
|
// src/knowledge-activity-controller.tsx
|
|
4566
4063
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
4567
4064
|
function createKnowledgeActivityController(ctx, options) {
|
|
4065
|
+
if (supportsDockedPanels(ctx)) return createDockedKnowledgeController(ctx, options);
|
|
4568
4066
|
const runtime = ctx;
|
|
4569
4067
|
const listeners = /* @__PURE__ */ new Set();
|
|
4570
4068
|
const states = /* @__PURE__ */ new Map();
|
|
@@ -4688,6 +4186,58 @@ function createKnowledgeActivityController(ctx, options) {
|
|
|
4688
4186
|
function normalizeSessionId(value) {
|
|
4689
4187
|
return typeof value === "string" && value.length > 0 ? value : void 0;
|
|
4690
4188
|
}
|
|
4189
|
+
function createDockedKnowledgeController(ctx, options) {
|
|
4190
|
+
const selections = /* @__PURE__ */ new Map();
|
|
4191
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
4192
|
+
const notify = () => {
|
|
4193
|
+
for (const listener of listeners) listener();
|
|
4194
|
+
};
|
|
4195
|
+
const current = () => normalizeSessionId(ctx.sessions.list.getSnapshot().current);
|
|
4196
|
+
const panel = createDockedPanel(
|
|
4197
|
+
ctx,
|
|
4198
|
+
"@lemoncat7/dsh-knowledge/activity",
|
|
4199
|
+
"\u77E5\u8BC6\u5E93",
|
|
4200
|
+
(props) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(KnowledgeActivityPanel, { ...props, controller }),
|
|
4201
|
+
notify
|
|
4202
|
+
);
|
|
4203
|
+
const controller = {
|
|
4204
|
+
open(sessionId, selection) {
|
|
4205
|
+
if (selection !== void 0) controller.select(sessionId, selection);
|
|
4206
|
+
options.beforeOpen();
|
|
4207
|
+
panel.open(sessionId);
|
|
4208
|
+
},
|
|
4209
|
+
toggle(sessionId) {
|
|
4210
|
+
if (panel.isOpen(sessionId)) controller.close(sessionId);
|
|
4211
|
+
else controller.open(sessionId);
|
|
4212
|
+
},
|
|
4213
|
+
close(sessionId) {
|
|
4214
|
+
const target = sessionId ?? current();
|
|
4215
|
+
if (target !== void 0) panel.close(target);
|
|
4216
|
+
},
|
|
4217
|
+
isOpen: panel.isOpen,
|
|
4218
|
+
selection: (sessionId) => selections.get(sessionId) ?? {},
|
|
4219
|
+
select(sessionId, selection) {
|
|
4220
|
+
selections.set(sessionId, mergeActivitySelection(selections.get(sessionId) ?? {}, selection));
|
|
4221
|
+
notify();
|
|
4222
|
+
},
|
|
4223
|
+
openWorkspace(target) {
|
|
4224
|
+
controller.close();
|
|
4225
|
+
options.openWorkspace(target);
|
|
4226
|
+
},
|
|
4227
|
+
subscribe(listener) {
|
|
4228
|
+
listeners.add(listener);
|
|
4229
|
+
return () => {
|
|
4230
|
+
listeners.delete(listener);
|
|
4231
|
+
};
|
|
4232
|
+
},
|
|
4233
|
+
dispose() {
|
|
4234
|
+
panel.dispose();
|
|
4235
|
+
selections.clear();
|
|
4236
|
+
listeners.clear();
|
|
4237
|
+
}
|
|
4238
|
+
};
|
|
4239
|
+
return controller;
|
|
4240
|
+
}
|
|
4691
4241
|
|
|
4692
4242
|
// src/constants.ts
|
|
4693
4243
|
var KNOWLEDGE_SETTINGS_NAMESPACE = "dsh-knowledge-connection";
|
|
@@ -4714,12 +4264,15 @@ var cachedConnectionView;
|
|
|
4714
4264
|
var inject = ["slots", "theme", "layout", "sessions"];
|
|
4715
4265
|
function apply2(ctx) {
|
|
4716
4266
|
ctx.effect(installStyles, "dsh-knowledge: client styles");
|
|
4267
|
+
const docked = supportsDockedPanels(ctx);
|
|
4717
4268
|
let activity;
|
|
4718
|
-
const workspace = createKnowledgeWorkspaceController(ctx, () =>
|
|
4269
|
+
const workspace = createKnowledgeWorkspaceController(ctx, () => {
|
|
4270
|
+
if (!docked) activity?.close(void 0, true);
|
|
4271
|
+
});
|
|
4719
4272
|
activity = createKnowledgeActivityController(ctx, {
|
|
4720
4273
|
beforeOpen: () => {
|
|
4721
4274
|
workspace.close();
|
|
4722
|
-
activatePluginWorkspace(PLUGIN_ID);
|
|
4275
|
+
if (!docked) activatePluginWorkspace(PLUGIN_ID);
|
|
4723
4276
|
},
|
|
4724
4277
|
openWorkspace: (target) => {
|
|
4725
4278
|
if (target === void 0) workspace.open();
|
|
@@ -4728,7 +4281,7 @@ function apply2(ctx) {
|
|
|
4728
4281
|
});
|
|
4729
4282
|
ctx.effect(() => observePluginWorkspace(PLUGIN_ID, () => {
|
|
4730
4283
|
workspace.close();
|
|
4731
|
-
activity?.close(void 0, true);
|
|
4284
|
+
if (!docked) activity?.close(void 0, true);
|
|
4732
4285
|
}), "dsh-knowledge: exclusive workspace");
|
|
4733
4286
|
ctx.effect(() => () => {
|
|
4734
4287
|
workspace.close();
|
|
@@ -4738,7 +4291,7 @@ function apply2(ctx) {
|
|
|
4738
4291
|
name: "sidebar.footer.action",
|
|
4739
4292
|
id: "knowledge",
|
|
4740
4293
|
order: -10
|
|
4741
|
-
}, (props) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(KnowledgeLauncher, { ...props, workspace, activity })));
|
|
4294
|
+
}, (props) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(KnowledgeLauncher, { ...props, workspace, activity, docked: supportsDockedPanels(ctx) })));
|
|
4742
4295
|
ctx.slots.inject("settings.plugin.item", () => ctx.slots.register({
|
|
4743
4296
|
name: "settings.plugin.item",
|
|
4744
4297
|
key: KNOWLEDGE_SETTINGS_NAMESPACE
|
|
@@ -4753,12 +4306,12 @@ function KnowledgeWritebackStatus({
|
|
|
4753
4306
|
turn,
|
|
4754
4307
|
workspace
|
|
4755
4308
|
}) {
|
|
4756
|
-
const [state, setState] = (0,
|
|
4757
|
-
const [retrying, setRetrying] = (0,
|
|
4758
|
-
const [readError, setReadError] = (0,
|
|
4759
|
-
const client = (0,
|
|
4760
|
-
const container = (0,
|
|
4761
|
-
(0,
|
|
4309
|
+
const [state, setState] = (0, import_react6.useState)();
|
|
4310
|
+
const [retrying, setRetrying] = (0, import_react6.useState)(false);
|
|
4311
|
+
const [readError, setReadError] = (0, import_react6.useState)();
|
|
4312
|
+
const client = (0, import_react6.useRef)();
|
|
4313
|
+
const container = (0, import_react6.useRef)(null);
|
|
4314
|
+
(0, import_react6.useEffect)(() => {
|
|
4762
4315
|
setState(void 0);
|
|
4763
4316
|
setRetrying(false);
|
|
4764
4317
|
setReadError(void 0);
|
|
@@ -4851,7 +4404,7 @@ function createKnowledgeWorkspaceController(client, beforeOpen) {
|
|
|
4851
4404
|
if (disposeWorkspace !== void 0) return;
|
|
4852
4405
|
beforeOpen();
|
|
4853
4406
|
activatePluginWorkspace(PLUGIN_ID);
|
|
4854
|
-
disposeWorkspace = client
|
|
4407
|
+
disposeWorkspace = registerMainPanel(client, PLUGIN_ID, -1, (props) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(KnowledgeWorkspace, { ...props, client, workspace: controller }), close);
|
|
4855
4408
|
};
|
|
4856
4409
|
controller = {
|
|
4857
4410
|
isOpen: () => disposeWorkspace !== void 0,
|
|
@@ -4883,18 +4436,18 @@ function createKnowledgeWorkspaceController(client, beforeOpen) {
|
|
|
4883
4436
|
return controller;
|
|
4884
4437
|
}
|
|
4885
4438
|
function KnowledgeConnectionCard() {
|
|
4886
|
-
const [current, setCurrent] = (0,
|
|
4887
|
-
const [loadState, setLoadState] = (0,
|
|
4888
|
-
const [loadError, setLoadError] = (0,
|
|
4889
|
-
const [open, setOpen] = (0,
|
|
4890
|
-
const [backend, setBackend] = (0,
|
|
4891
|
-
const [remoteUrl, setRemoteUrl] = (0,
|
|
4892
|
-
const [remoteToken, setRemoteToken] = (0,
|
|
4893
|
-
const [timeout, setTimeoutValue] = (0,
|
|
4894
|
-
const [dirty, setDirty] = (0,
|
|
4895
|
-
const [saving, setSaving] = (0,
|
|
4896
|
-
const [message3, setMessage] = (0,
|
|
4897
|
-
const load = (0,
|
|
4439
|
+
const [current, setCurrent] = (0, import_react6.useState)();
|
|
4440
|
+
const [loadState, setLoadState] = (0, import_react6.useState)("loading");
|
|
4441
|
+
const [loadError, setLoadError] = (0, import_react6.useState)("");
|
|
4442
|
+
const [open, setOpen] = (0, import_react6.useState)(false);
|
|
4443
|
+
const [backend, setBackend] = (0, import_react6.useState)("local");
|
|
4444
|
+
const [remoteUrl, setRemoteUrl] = (0, import_react6.useState)("");
|
|
4445
|
+
const [remoteToken, setRemoteToken] = (0, import_react6.useState)("");
|
|
4446
|
+
const [timeout, setTimeoutValue] = (0, import_react6.useState)("10000");
|
|
4447
|
+
const [dirty, setDirty] = (0, import_react6.useState)(false);
|
|
4448
|
+
const [saving, setSaving] = (0, import_react6.useState)(false);
|
|
4449
|
+
const [message3, setMessage] = (0, import_react6.useState)();
|
|
4450
|
+
const load = (0, import_react6.useCallback)(async (signal) => {
|
|
4898
4451
|
setLoadState("loading");
|
|
4899
4452
|
setLoadError("");
|
|
4900
4453
|
try {
|
|
@@ -4907,14 +4460,14 @@ function KnowledgeConnectionCard() {
|
|
|
4907
4460
|
setLoadState("error");
|
|
4908
4461
|
}
|
|
4909
4462
|
}, []);
|
|
4910
|
-
(0,
|
|
4463
|
+
(0, import_react6.useEffect)(() => {
|
|
4911
4464
|
const controller = new AbortController();
|
|
4912
4465
|
void load(controller.signal);
|
|
4913
4466
|
return () => {
|
|
4914
4467
|
controller.abort();
|
|
4915
4468
|
};
|
|
4916
4469
|
}, [load]);
|
|
4917
|
-
(0,
|
|
4470
|
+
(0, import_react6.useEffect)(() => {
|
|
4918
4471
|
if (dirty || current === void 0) return;
|
|
4919
4472
|
setBackend(current.backend);
|
|
4920
4473
|
setRemoteUrl(current.remoteUrl ?? "");
|
|
@@ -5076,14 +4629,14 @@ function isConnectionView(value) {
|
|
|
5076
4629
|
function isManagementPath(value) {
|
|
5077
4630
|
return typeof value === "string" && value.startsWith("/") && !value.startsWith("//");
|
|
5078
4631
|
}
|
|
5079
|
-
function KnowledgeLauncher({ wide, useSessions, workspace, activity }) {
|
|
5080
|
-
const [open, setOpen] = (0,
|
|
5081
|
-
const currentSessionId = useSessions(availableActivitySession);
|
|
5082
|
-
const [activityOpen, setActivityOpen] = (0,
|
|
5083
|
-
(0,
|
|
4632
|
+
function KnowledgeLauncher({ wide, useSessions, workspace, activity, docked }) {
|
|
4633
|
+
const [open, setOpen] = (0, import_react6.useState)(workspace.isOpen());
|
|
4634
|
+
const currentSessionId = useSessions((state) => availableActivitySession(state, docked));
|
|
4635
|
+
const [activityOpen, setActivityOpen] = (0, import_react6.useState)(currentSessionId === void 0 ? false : activity.isOpen(currentSessionId));
|
|
4636
|
+
(0, import_react6.useEffect)(() => workspace.subscribe(() => {
|
|
5084
4637
|
setOpen(workspace.isOpen());
|
|
5085
4638
|
}), [workspace]);
|
|
5086
|
-
(0,
|
|
4639
|
+
(0, import_react6.useEffect)(() => {
|
|
5087
4640
|
const sync = () => {
|
|
5088
4641
|
setActivityOpen(currentSessionId === void 0 ? false : activity.isOpen(currentSessionId));
|
|
5089
4642
|
};
|
|
@@ -5118,30 +4671,29 @@ function KnowledgeLauncher({ wide, useSessions, workspace, activity }) {
|
|
|
5118
4671
|
onClick: () => {
|
|
5119
4672
|
if (currentSessionId !== void 0) activity.toggle(currentSessionId);
|
|
5120
4673
|
},
|
|
5121
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime5.
|
|
5122
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("rect", { x: "3", y: "4", width: "18", height: "16", rx: "3" }),
|
|
5123
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M14 4v16M17 9v6" })
|
|
5124
|
-
] })
|
|
4674
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_dsh_client_ui_primitives3.IconPanelLeftOutline16, { size: 16, className: "dsh-knowledge-panel-right-icon" })
|
|
5125
4675
|
}
|
|
5126
4676
|
)
|
|
5127
4677
|
] });
|
|
5128
4678
|
}
|
|
5129
4679
|
function KnowledgeWorkspace({
|
|
5130
|
-
sessionId,
|
|
4680
|
+
sessionId: scopedSessionId,
|
|
5131
4681
|
useSessions,
|
|
5132
4682
|
client,
|
|
5133
4683
|
workspace
|
|
5134
4684
|
}) {
|
|
5135
4685
|
const cachedManagementPath = cachedConnectionView?.managementAvailable ? cachedConnectionView.managementPath : void 0;
|
|
5136
|
-
const [panelState, setPanelState] = (0,
|
|
5137
|
-
const [managementPath, setManagementPath] = (0,
|
|
5138
|
-
const [panelError, setPanelError] = (0,
|
|
5139
|
-
const [target, setTarget] = (0,
|
|
4686
|
+
const [panelState, setPanelState] = (0, import_react6.useState)(cachedConnectionView === void 0 ? "loading" : cachedManagementPath === void 0 ? "unavailable" : "ready");
|
|
4687
|
+
const [managementPath, setManagementPath] = (0, import_react6.useState)(cachedManagementPath);
|
|
4688
|
+
const [panelError, setPanelError] = (0, import_react6.useState)("");
|
|
4689
|
+
const [target, setTarget] = (0, import_react6.useState)(workspace.currentTarget());
|
|
4690
|
+
const selectedSessionId = useSessions((state) => state.current);
|
|
4691
|
+
const sessionId = scopedSessionId ?? selectedSessionId;
|
|
5140
4692
|
const projectId = useSessions((state) => sessionId === void 0 ? void 0 : state.byId[sessionId]?.cwd);
|
|
5141
4693
|
const knowledgeUrl = managementPath === void 0 ? void 0 : knowledgePanelUrl(managementPath, sessionId, projectId, target);
|
|
5142
|
-
const frame = (0,
|
|
5143
|
-
const themeFrame = (0,
|
|
5144
|
-
const loadManagement = (0,
|
|
4694
|
+
const frame = (0, import_react6.useRef)(null);
|
|
4695
|
+
const themeFrame = (0, import_react6.useRef)(0);
|
|
4696
|
+
const loadManagement = (0, import_react6.useCallback)(async (background = false) => {
|
|
5145
4697
|
if (!background) setPanelState("loading");
|
|
5146
4698
|
setPanelError("");
|
|
5147
4699
|
try {
|
|
@@ -5159,13 +4711,13 @@ function KnowledgeWorkspace({
|
|
|
5159
4711
|
setPanelState("error");
|
|
5160
4712
|
}
|
|
5161
4713
|
}, []);
|
|
5162
|
-
(0,
|
|
4714
|
+
(0, import_react6.useEffect)(() => {
|
|
5163
4715
|
void loadManagement(cachedConnectionView !== void 0);
|
|
5164
4716
|
}, [loadManagement]);
|
|
5165
|
-
(0,
|
|
4717
|
+
(0, import_react6.useEffect)(() => workspace.subscribe(() => {
|
|
5166
4718
|
setTarget(workspace.currentTarget());
|
|
5167
4719
|
}), [workspace]);
|
|
5168
|
-
const sendTheme = (0,
|
|
4720
|
+
const sendTheme = (0, import_react6.useCallback)(() => {
|
|
5169
4721
|
const currentFrame = frame.current;
|
|
5170
4722
|
if (currentFrame === null) return;
|
|
5171
4723
|
const target2 = currentFrame.contentWindow;
|
|
@@ -5175,14 +4727,14 @@ function KnowledgeWorkspace({
|
|
|
5175
4727
|
frameOrigin(currentFrame) ?? "*"
|
|
5176
4728
|
);
|
|
5177
4729
|
}, [client]);
|
|
5178
|
-
const scheduleTheme = (0,
|
|
4730
|
+
const scheduleTheme = (0, import_react6.useCallback)(() => {
|
|
5179
4731
|
if (themeFrame.current !== 0) window.cancelAnimationFrame(themeFrame.current);
|
|
5180
4732
|
themeFrame.current = window.requestAnimationFrame(() => {
|
|
5181
4733
|
themeFrame.current = 0;
|
|
5182
4734
|
sendTheme();
|
|
5183
4735
|
});
|
|
5184
4736
|
}, [sendTheme]);
|
|
5185
|
-
(0,
|
|
4737
|
+
(0, import_react6.useEffect)(() => {
|
|
5186
4738
|
const off = client.on("theme/change", scheduleTheme);
|
|
5187
4739
|
const onMessage = (event) => {
|
|
5188
4740
|
const currentFrame = frame.current;
|