@skillcdn/console 0.4.6 → 0.4.7
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 -4
- package/dist/api.d.ts +2 -2
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +2 -2
- package/dist/api.js.map +1 -1
- package/dist/cli/cli.d.ts +6 -0
- package/dist/cli/cli.d.ts.map +1 -1
- package/dist/cli/cli.js +60 -30
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/format.d.ts.map +1 -1
- package/dist/cli/format.js +1 -0
- package/dist/cli/format.js.map +1 -1
- package/dist/cli/help.js +5 -5
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/keys.d.ts +10 -0
- package/dist/cli/keys.d.ts.map +1 -0
- package/dist/cli/keys.js +59 -0
- package/dist/cli/keys.js.map +1 -0
- package/dist/cli/main.js +2 -1
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/terminal.d.ts +7 -0
- package/dist/cli/terminal.d.ts.map +1 -1
- package/dist/cli/terminal.js +39 -0
- package/dist/cli/terminal.js.map +1 -1
- package/dist/client.d.ts +7 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +4 -1
- package/dist/client.js.map +1 -1
- package/dist/components/plugin-frame.d.ts.map +1 -1
- package/dist/components/plugin-frame.js +53 -10
- package/dist/components/plugin-frame.js.map +1 -1
- package/dist/components/sessions.d.ts +15 -0
- package/dist/components/sessions.d.ts.map +1 -0
- package/dist/components/sessions.js +17 -0
- package/dist/components/sessions.js.map +1 -0
- package/dist/components/shell.d.ts.map +1 -1
- package/dist/components/shell.js +198 -28
- package/dist/components/shell.js.map +1 -1
- package/dist/components/workspace.d.ts +2 -0
- package/dist/components/workspace.d.ts.map +1 -1
- package/dist/components/workspace.js +19 -4
- package/dist/components/workspace.js.map +1 -1
- package/dist/console.css +228 -21
- package/dist/console.d.ts +5 -2
- package/dist/console.d.ts.map +1 -1
- package/dist/console.js +106 -21
- package/dist/console.js.map +1 -1
- package/dist/data.d.ts +7 -1
- package/dist/data.d.ts.map +1 -1
- package/dist/data.js +26 -5
- package/dist/data.js.map +1 -1
- package/dist/i18n/en.d.ts +24 -0
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +21 -0
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/index.d.ts +2 -2
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/index.js +7 -3
- package/dist/i18n/index.js.map +1 -1
- package/dist/i18n/ko.d.ts.map +1 -1
- package/dist/i18n/ko.js +23 -2
- package/dist/i18n/ko.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/plugin/bridge.d.ts +3 -0
- package/dist/plugin/bridge.d.ts.map +1 -1
- package/dist/plugin/bridge.js +1 -0
- package/dist/plugin/bridge.js.map +1 -1
- package/dist/plugin/context.d.ts +9 -0
- package/dist/plugin/context.d.ts.map +1 -1
- package/dist/plugin/define.d.ts.map +1 -1
- package/dist/plugin/define.js +6 -3
- package/dist/plugin/define.js.map +1 -1
- package/dist/plugin/sandbox.d.ts.map +1 -1
- package/dist/plugin/sandbox.js +8 -1
- package/dist/plugin/sandbox.js.map +1 -1
- package/dist/router.d.ts +6 -0
- package/dist/router.d.ts.map +1 -1
- package/dist/router.js +5 -0
- package/dist/router.js.map +1 -1
- package/dist/routes.d.ts +3 -1
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +2 -0
- package/dist/routes.js.map +1 -1
- package/dist/schemas.d.ts +38 -0
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +37 -1
- package/dist/schemas.js.map +1 -1
- package/dist/tokens.d.ts.map +1 -1
- package/dist/tokens.js +1 -0
- package/dist/tokens.js.map +1 -1
- package/dist/vocabulary.d.ts +6 -0
- package/dist/vocabulary.d.ts.map +1 -1
- package/dist/vocabulary.js +7 -0
- package/dist/vocabulary.js.map +1 -1
- package/docs/specs/cli.md +3 -3
- package/docs/specs/plugins.md +7 -6
- package/docs/specs/rest.md +9 -5
- package/package.json +1 -1
- package/skills/building-a-plugin/SKILL.md +2 -2
- package/skills/planning-the-board/references/setting-up.md +1 -1
- package/src/api.ts +6 -0
- package/src/cli/cli.ts +81 -29
- package/src/cli/format.ts +1 -0
- package/src/cli/help.ts +5 -5
- package/src/cli/keys.ts +69 -0
- package/src/cli/main.ts +2 -1
- package/src/cli/terminal.ts +40 -0
- package/src/client.ts +14 -0
- package/src/components/plugin-frame.tsx +72 -17
- package/src/components/sessions.tsx +108 -0
- package/src/components/shell.tsx +265 -52
- package/src/components/workspace.tsx +46 -2
- package/src/console.tsx +181 -16
- package/src/data.ts +33 -5
- package/src/i18n/en.ts +25 -0
- package/src/i18n/index.ts +11 -3
- package/src/i18n/ko.ts +27 -2
- package/src/index.ts +1 -0
- package/src/plugin/bridge.ts +4 -0
- package/src/plugin/context.ts +9 -0
- package/src/plugin/define.ts +10 -2
- package/src/plugin/sandbox.ts +9 -1
- package/src/router.ts +7 -0
- package/src/routes.ts +3 -1
- package/src/schemas.ts +41 -0
- package/src/styles/console.css +228 -21
- package/src/tokens.ts +1 -0
- package/src/vocabulary.ts +9 -0
package/dist/console.css
CHANGED
|
@@ -86,6 +86,8 @@
|
|
|
86
86
|
0 0.5rem 1.25rem -0.5rem color-mix(in srgb, var(--sc-color-accent-solid) 22%, transparent),
|
|
87
87
|
0 1.25rem 3rem -1rem color-mix(in srgb, var(--sc-color-accent-solid) 11%, transparent);
|
|
88
88
|
--sc-shadow-stage: 0 1.25rem 3.5rem #1a2b552e;
|
|
89
|
+
/* What a menu casts, open over the page: close under it, and soft. */
|
|
90
|
+
--sc-shadow-menu: 0 0.75rem 2rem -0.5rem #1a2b5533, 0 0.125rem 0.375rem #1a2b5514;
|
|
89
91
|
|
|
90
92
|
/* Type. The Korean face comes first where the page provides it; the Latin stays with the
|
|
91
93
|
system's faces. */
|
|
@@ -487,25 +489,38 @@ table {
|
|
|
487
489
|
color: var(--sc-color-text);
|
|
488
490
|
}
|
|
489
491
|
|
|
490
|
-
/* A tab that opens a list of pages: a group of several plugins (ADR-0054).
|
|
492
|
+
/* A tab that opens a list of pages: a group of several plugins (ADR-0054). A button; its list is
|
|
493
|
+
a popover, .sc-tab-group-panel below the menu's panel. */
|
|
491
494
|
|
|
492
495
|
.sc-tab-group {
|
|
493
|
-
|
|
496
|
+
display: inline-flex;
|
|
494
497
|
}
|
|
495
498
|
|
|
496
499
|
.sc-tab-summary {
|
|
497
|
-
|
|
500
|
+
font-family: inherit;
|
|
501
|
+
line-height: inherit;
|
|
498
502
|
cursor: pointer;
|
|
499
503
|
}
|
|
500
504
|
|
|
501
|
-
.
|
|
502
|
-
|
|
505
|
+
/* The caret turns while the list is open. */
|
|
506
|
+
.sc-tab-summary .sc-menu-caret {
|
|
507
|
+
transition: transform var(--sc-transition);
|
|
503
508
|
}
|
|
504
509
|
|
|
505
|
-
.sc-tab-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
510
|
+
.sc-tab-summary[aria-expanded="true"] .sc-menu-caret {
|
|
511
|
+
transform: rotate(180deg);
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
.sc-tab-summary[aria-expanded="true"] {
|
|
515
|
+
color: var(--sc-color-text);
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
/* A tab's name: a long one stops short with an ellipsis, and the tab's title says it whole. */
|
|
519
|
+
.sc-tab-label {
|
|
520
|
+
min-width: 0;
|
|
521
|
+
max-width: 15rem;
|
|
522
|
+
overflow: hidden;
|
|
523
|
+
text-overflow: ellipsis;
|
|
509
524
|
}
|
|
510
525
|
|
|
511
526
|
/* The pages of a plugin: the header's tabs going on a row lower, on the same gutters, the line
|
|
@@ -548,25 +563,45 @@ table {
|
|
|
548
563
|
color: var(--sc-color-text);
|
|
549
564
|
}
|
|
550
565
|
|
|
551
|
-
/* A plugin's frame: the width of the page, as tall as the frame
|
|
566
|
+
/* A plugin's frame, in a box the console draws: the width of the page, as tall as the frame
|
|
567
|
+
says; until the plugin's page has drawn, a spinner stands in the box, over a frame not shown. */
|
|
552
568
|
|
|
553
|
-
.sc-plugin-frame {
|
|
569
|
+
.sc-plugin-frame-box {
|
|
570
|
+
position: relative;
|
|
554
571
|
display: block;
|
|
555
572
|
width: 100%;
|
|
556
573
|
min-height: 2.5rem;
|
|
557
|
-
border: 0;
|
|
558
|
-
border-radius: var(--sc-radius-lg);
|
|
559
|
-
background: transparent;
|
|
560
574
|
}
|
|
561
575
|
|
|
562
576
|
/* A page pads itself by a step, for the shadows of what is in it, which the frame would cut. The
|
|
563
577
|
frame stands that step outside the page's column, so that the page's first words line up with
|
|
564
578
|
the tabs above it, and with every other page's. */
|
|
565
|
-
.sc-plugin-frame-page {
|
|
579
|
+
.sc-plugin-frame-box-page {
|
|
566
580
|
width: calc(100% + 2 * var(--sc-space-4));
|
|
567
581
|
margin: calc(var(--sc-space-4) * -1);
|
|
568
582
|
}
|
|
569
583
|
|
|
584
|
+
.sc-plugin-frame {
|
|
585
|
+
display: block;
|
|
586
|
+
width: 100%;
|
|
587
|
+
height: 100%;
|
|
588
|
+
border: 0;
|
|
589
|
+
border-radius: var(--sc-radius-lg);
|
|
590
|
+
background: transparent;
|
|
591
|
+
transition: opacity var(--sc-transition);
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
.sc-plugin-frame-loading .sc-plugin-frame {
|
|
595
|
+
opacity: 0;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
.sc-plugin-frame-wait {
|
|
599
|
+
position: absolute;
|
|
600
|
+
inset: 0;
|
|
601
|
+
display: grid;
|
|
602
|
+
place-items: center;
|
|
603
|
+
}
|
|
604
|
+
|
|
570
605
|
/* A plugin's frame document, which the console serves marked with data-console: it paints no
|
|
571
606
|
background and is as tall as its content, so that the box the console draws shows through and
|
|
572
607
|
the frame shrinks as well as grows; no room is kept for a scrollbar it never shows. */
|
|
@@ -659,8 +694,67 @@ html[data-console] body {
|
|
|
659
694
|
padding: var(--sc-space-1);
|
|
660
695
|
border: var(--sc-border);
|
|
661
696
|
border-radius: var(--sc-radius-lg);
|
|
662
|
-
background: var(--sc-color-bg-
|
|
663
|
-
box-shadow: var(--sc-shadow-
|
|
697
|
+
background: var(--sc-color-bg-raised);
|
|
698
|
+
box-shadow: var(--sc-shadow-menu);
|
|
699
|
+
/* A menu longer than the window has room for under the header scrolls within itself, so that
|
|
700
|
+
its last items, the way out among them, are always reached. */
|
|
701
|
+
max-height: calc(100dvh - 4.5rem);
|
|
702
|
+
overflow-y: auto;
|
|
703
|
+
overscroll-behavior: contain;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
/* The list a group tab opens: a popover in the top layer, placed under its tab by the shell, so
|
|
707
|
+
that the row of tabs, which scrolls sideways and clips whatever hangs out of it, clips nothing
|
|
708
|
+
of the list. In the type of the tabs; as wide as its names, within a column a name reads at a
|
|
709
|
+
glance in, and within the window. */
|
|
710
|
+
.sc-tab-group-panel {
|
|
711
|
+
position: fixed;
|
|
712
|
+
inset: auto;
|
|
713
|
+
min-width: 11rem;
|
|
714
|
+
max-width: min(18rem, calc(100vw - 1rem));
|
|
715
|
+
margin: 0;
|
|
716
|
+
color: var(--sc-color-text);
|
|
717
|
+
font-size: var(--sc-text-sm);
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
/* Where the browser has no popover, the tab shows and hides the list itself. */
|
|
721
|
+
.sc-tab-group-panel[hidden] {
|
|
722
|
+
display: none;
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
.sc-tab-group-panel:popover-open {
|
|
726
|
+
animation: sc-menu-in 120ms ease-out;
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
@keyframes sc-menu-in {
|
|
730
|
+
from {
|
|
731
|
+
opacity: 0;
|
|
732
|
+
transform: translateY(-0.25rem);
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
@media (prefers-reduced-motion: reduce) {
|
|
737
|
+
.sc-tab-group-panel:popover-open {
|
|
738
|
+
animation: none;
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
/* A plugin in a group's list: its name alone, lined up under the tab's, which wraps rather than
|
|
743
|
+
run out of the list. The one the page is on is in the accent. */
|
|
744
|
+
.sc-menu-link.sc-group-link {
|
|
745
|
+
padding: var(--sc-space-2) 0.625rem;
|
|
746
|
+
color: var(--sc-color-text);
|
|
747
|
+
line-height: var(--sc-leading-snug);
|
|
748
|
+
overflow-wrap: anywhere;
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
.sc-group-link + .sc-group-link {
|
|
752
|
+
margin-top: 0.125rem;
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
.sc-group-link[aria-current="page"] {
|
|
756
|
+
background: color-mix(in srgb, var(--sc-color-accent-subtle) 55%, transparent);
|
|
757
|
+
color: var(--sc-color-accent);
|
|
664
758
|
}
|
|
665
759
|
|
|
666
760
|
.sc-menu-who {
|
|
@@ -702,7 +796,7 @@ html[data-console] body {
|
|
|
702
796
|
}
|
|
703
797
|
|
|
704
798
|
.sc-menu-link:hover {
|
|
705
|
-
background: var(--sc-color-bg-
|
|
799
|
+
background: var(--sc-color-bg-inset);
|
|
706
800
|
color: var(--sc-color-text);
|
|
707
801
|
}
|
|
708
802
|
|
|
@@ -2923,6 +3017,119 @@ select.sc-input-quiet {
|
|
|
2923
3017
|
align-items: baseline;
|
|
2924
3018
|
}
|
|
2925
3019
|
|
|
3020
|
+
/* The views of the settings: the workspace's, and the browsers the person is signed in on. */
|
|
3021
|
+
.sc-settings-views {
|
|
3022
|
+
margin-bottom: var(--sc-space-5);
|
|
3023
|
+
}
|
|
3024
|
+
|
|
3025
|
+
/* The sessions (board #309): a row for each browser in the panel, parted by hairlines, a screen or
|
|
3026
|
+
a phone drawn before it, the current one in the accent; what it is first, then when it was
|
|
3027
|
+
last used, where from and the day it signed in, in the small type of a row's facts. */
|
|
3028
|
+
.sc-session-list {
|
|
3029
|
+
margin: var(--sc-space-4) 0 0;
|
|
3030
|
+
padding: 0;
|
|
3031
|
+
list-style: none;
|
|
3032
|
+
}
|
|
3033
|
+
|
|
3034
|
+
.sc-session {
|
|
3035
|
+
display: flex;
|
|
3036
|
+
align-items: center;
|
|
3037
|
+
gap: var(--sc-space-3);
|
|
3038
|
+
padding-block: var(--sc-space-3);
|
|
3039
|
+
border-top: var(--sc-hairline);
|
|
3040
|
+
}
|
|
3041
|
+
|
|
3042
|
+
.sc-session:last-child {
|
|
3043
|
+
padding-bottom: 0;
|
|
3044
|
+
}
|
|
3045
|
+
|
|
3046
|
+
.sc-session-icon {
|
|
3047
|
+
display: inline-flex;
|
|
3048
|
+
flex: none;
|
|
3049
|
+
align-items: center;
|
|
3050
|
+
justify-content: center;
|
|
3051
|
+
width: 2.25rem;
|
|
3052
|
+
height: 2.25rem;
|
|
3053
|
+
border-radius: var(--sc-radius-md);
|
|
3054
|
+
background: var(--sc-color-bg-inset);
|
|
3055
|
+
color: var(--sc-color-text-muted);
|
|
3056
|
+
}
|
|
3057
|
+
|
|
3058
|
+
.sc-session-current .sc-session-icon {
|
|
3059
|
+
background: var(--sc-color-accent-subtle);
|
|
3060
|
+
color: var(--sc-color-accent);
|
|
3061
|
+
}
|
|
3062
|
+
|
|
3063
|
+
.sc-session-icon svg {
|
|
3064
|
+
width: 1.25rem;
|
|
3065
|
+
height: 1.25rem;
|
|
3066
|
+
fill: none;
|
|
3067
|
+
stroke: currentColor;
|
|
3068
|
+
stroke-width: 1.5;
|
|
3069
|
+
stroke-linecap: round;
|
|
3070
|
+
stroke-linejoin: round;
|
|
3071
|
+
}
|
|
3072
|
+
|
|
3073
|
+
.sc-session-body {
|
|
3074
|
+
flex: 1;
|
|
3075
|
+
min-width: 0;
|
|
3076
|
+
}
|
|
3077
|
+
|
|
3078
|
+
.sc-session-name {
|
|
3079
|
+
display: flex;
|
|
3080
|
+
flex-wrap: wrap;
|
|
3081
|
+
align-items: center;
|
|
3082
|
+
gap: var(--sc-space-1) var(--sc-space-2);
|
|
3083
|
+
font-weight: var(--sc-weight-medium);
|
|
3084
|
+
}
|
|
3085
|
+
|
|
3086
|
+
.sc-session-meta {
|
|
3087
|
+
display: flex;
|
|
3088
|
+
flex-wrap: wrap;
|
|
3089
|
+
gap: 0 var(--sc-space-2);
|
|
3090
|
+
margin-top: 0.125rem;
|
|
3091
|
+
color: var(--sc-color-text-faint);
|
|
3092
|
+
font-size: var(--sc-text-xs);
|
|
3093
|
+
}
|
|
3094
|
+
|
|
3095
|
+
.sc-session-meta > span {
|
|
3096
|
+
white-space: nowrap;
|
|
3097
|
+
}
|
|
3098
|
+
|
|
3099
|
+
.sc-session-meta > span + span {
|
|
3100
|
+
padding-inline-start: var(--sc-space-2);
|
|
3101
|
+
border-inline-start: var(--sc-hairline);
|
|
3102
|
+
}
|
|
3103
|
+
|
|
3104
|
+
.sc-session-end {
|
|
3105
|
+
flex: none;
|
|
3106
|
+
align-self: center;
|
|
3107
|
+
}
|
|
3108
|
+
|
|
3109
|
+
/* On a phone the facts of a row stand one under another, where a line has no room for them. */
|
|
3110
|
+
@media (max-width: 40rem) {
|
|
3111
|
+
.sc-session {
|
|
3112
|
+
align-items: flex-start;
|
|
3113
|
+
}
|
|
3114
|
+
|
|
3115
|
+
.sc-session-meta {
|
|
3116
|
+
flex-direction: column;
|
|
3117
|
+
}
|
|
3118
|
+
|
|
3119
|
+
.sc-session-meta > span {
|
|
3120
|
+
white-space: normal;
|
|
3121
|
+
}
|
|
3122
|
+
|
|
3123
|
+
.sc-session-meta > span + span {
|
|
3124
|
+
padding-inline-start: 0;
|
|
3125
|
+
border-inline-start: 0;
|
|
3126
|
+
}
|
|
3127
|
+
|
|
3128
|
+
.sc-session-end {
|
|
3129
|
+
align-self: flex-start;
|
|
3130
|
+
}
|
|
3131
|
+
}
|
|
3132
|
+
|
|
2926
3133
|
.sc-tab-count {
|
|
2927
3134
|
color: var(--sc-color-text-faint);
|
|
2928
3135
|
font-size: var(--sc-text-xs);
|
|
@@ -5417,8 +5624,8 @@ select.sc-input-quiet {
|
|
|
5417
5624
|
padding: var(--sc-space-1);
|
|
5418
5625
|
border: var(--sc-border);
|
|
5419
5626
|
border-radius: var(--sc-radius-md);
|
|
5420
|
-
background: var(--sc-color-bg-
|
|
5421
|
-
box-shadow: var(--sc-shadow-
|
|
5627
|
+
background: var(--sc-color-bg-raised);
|
|
5628
|
+
box-shadow: var(--sc-shadow-menu);
|
|
5422
5629
|
font-size: var(--sc-text-sm);
|
|
5423
5630
|
}
|
|
5424
5631
|
|
|
@@ -6653,7 +6860,7 @@ a.sc-tile-project:focus-visible {
|
|
|
6653
6860
|
white-space: nowrap;
|
|
6654
6861
|
}
|
|
6655
6862
|
|
|
6656
|
-
.sc-tile-widget .sc-plugin-frame-
|
|
6863
|
+
.sc-tile-widget .sc-plugin-frame-box {
|
|
6657
6864
|
height: 100%;
|
|
6658
6865
|
min-height: 0;
|
|
6659
6866
|
}
|
package/dist/console.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { type GoalListProps } from "./components/goals.js";
|
|
|
9
9
|
import { type HomeGridProps } from "./components/home.js";
|
|
10
10
|
import { type PeopleListProps, type TeamListProps } from "./components/people.js";
|
|
11
11
|
import { type MemberListProps } from "./components/projects.js";
|
|
12
|
+
import { type SessionListProps } from "./components/sessions.js";
|
|
12
13
|
import { type Brand, type ShellProps } from "./components/shell.js";
|
|
13
14
|
import { type SignInProps } from "./components/sign-in.js";
|
|
14
15
|
import { type SkillListProps } from "./components/skills.js";
|
|
@@ -27,6 +28,7 @@ export interface ConsoleComponents {
|
|
|
27
28
|
readonly EventFeed: ComponentType<EventFeedProps>;
|
|
28
29
|
readonly SignIn: ComponentType<SignInProps>;
|
|
29
30
|
readonly TokenList: ComponentType<TokenListProps>;
|
|
31
|
+
readonly SessionList: ComponentType<SessionListProps>;
|
|
30
32
|
readonly PeopleList: ComponentType<PeopleListProps>;
|
|
31
33
|
readonly TeamList: ComponentType<TeamListProps>;
|
|
32
34
|
readonly SkillList: ComponentType<SkillListProps>;
|
|
@@ -101,8 +103,9 @@ export interface ConsoleApp {
|
|
|
101
103
|
export declare function languageToKeep(me: RestMe | undefined, browser: readonly string[], packs: readonly LanguagePack[]): string | undefined;
|
|
102
104
|
/**
|
|
103
105
|
* The pages a console that holds a token does not offer: the tokens themselves, and the
|
|
104
|
-
* approval of an agent's connection, which makes one; a person's own
|
|
105
|
-
* own pages, signed in. Everything else a person may do, their agent may
|
|
106
|
+
* approval of an agent's connection, which makes one; the browsers signed in; a person's own
|
|
107
|
+
* doing on the console's own pages, signed in. Everything else a person may do, their agent may
|
|
108
|
+
* (ADR-0021).
|
|
106
109
|
*/
|
|
107
110
|
export declare function onlyOnOwnPages(route: Route): boolean;
|
|
108
111
|
export declare function createConsole(config?: ConsoleConfig): ConsoleApp;
|
package/dist/console.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"console.d.ts","sourceRoot":"","sources":["../src/console.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AAEf,OAAO,EAEL,KAAK,aAAa,EAYlB,KAAK,MAAM,EAGX,KAAK,WAAW,
|
|
1
|
+
{"version":3,"file":"console.d.ts","sourceRoot":"","sources":["../src/console.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AAEf,OAAO,EAEL,KAAK,aAAa,EAYlB,KAAK,MAAM,EAGX,KAAK,WAAW,EAgBjB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAuB,KAAK,UAAU,EAAsB,MAAM,uBAAuB,CAAC;AACjG,OAAO,EAAY,KAAK,aAAa,EAAY,MAAM,0BAA0B,CAAC;AAClF,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAGlF,OAAO,EAA8B,KAAK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,MAAM,WAAW,UAAU;IACzB,sEAAsE;IACtE,QAAQ,CAAC,GAAG,EAAE,aAAa,CAAC;QAAE,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,CAAC,CAAC;IAC3E,mFAAmF;IACnF,KAAK,CAAC,SAAS,EAAE,OAAO,GAAG,MAAM,IAAI,CAAC;CACvC;AAqID;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,EAAE,EAAE,MAAM,GAAG,SAAS,EACtB,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,KAAK,EAAE,SAAS,YAAY,EAAE,GAC7B,MAAM,GAAG,SAAS,CAIpB;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAQpD;AAw9ED,wBAAgB,aAAa,CAAC,MAAM,GAAE,aAAkB,GAAG,UAAU,CAqYpE"}
|
package/dist/console.js
CHANGED
|
@@ -21,6 +21,7 @@ import { MemberList, ProjectForm, ProjectMark, } from "./components/projects.js"
|
|
|
21
21
|
import { RemotePicturesContext } from "./components/remote-pictures.js";
|
|
22
22
|
import { GoalTimeline } from "./components/roadmap.js";
|
|
23
23
|
import { RulesForm, RulesView } from "./components/rules.js";
|
|
24
|
+
import { SessionList } from "./components/sessions.js";
|
|
24
25
|
import { isPlainClick, Shell, } from "./components/shell.js";
|
|
25
26
|
import { SignIn } from "./components/sign-in.js";
|
|
26
27
|
import { SkillList } from "./components/skills.js";
|
|
@@ -48,6 +49,7 @@ export const DEFAULT_COMPONENTS = {
|
|
|
48
49
|
EventFeed,
|
|
49
50
|
SignIn,
|
|
50
51
|
TokenList,
|
|
52
|
+
SessionList,
|
|
51
53
|
PeopleList,
|
|
52
54
|
TeamList,
|
|
53
55
|
SkillList,
|
|
@@ -198,11 +200,13 @@ export function languageToKeep(me, browser, packs) {
|
|
|
198
200
|
}
|
|
199
201
|
/**
|
|
200
202
|
* The pages a console that holds a token does not offer: the tokens themselves, and the
|
|
201
|
-
* approval of an agent's connection, which makes one; a person's own
|
|
202
|
-
* own pages, signed in. Everything else a person may do, their agent may
|
|
203
|
+
* approval of an agent's connection, which makes one; the browsers signed in; a person's own
|
|
204
|
+
* doing on the console's own pages, signed in. Everything else a person may do, their agent may
|
|
205
|
+
* (ADR-0021).
|
|
203
206
|
*/
|
|
204
207
|
export function onlyOnOwnPages(route) {
|
|
205
208
|
return (route.name === "agents" ||
|
|
209
|
+
route.name === "sessions" ||
|
|
206
210
|
route.name === "new-token" ||
|
|
207
211
|
route.name === "person-agents" ||
|
|
208
212
|
route.name === "connect");
|
|
@@ -683,6 +687,59 @@ function ProjectSettingsPage(props) {
|
|
|
683
687
|
})
|
|
684
688
|
: undefined, busy: busy }))] }), _jsxs("section", { className: "sc-panel", "aria-label": words.rules.workspaceRules, children: [_jsxs("div", { className: "sc-section-head", children: [_jsx("h2", { className: "sc-section-title", children: words.rules.workspaceRules }), _jsx("a", { className: "sc-muted", href: settingsHref(), children: words.rules.onWorkspaceSettings })] }), rules !== undefined && _jsx(RulesView, { rules: rules.workspace, scope: "workspace", folded: true })] })] }));
|
|
685
689
|
}
|
|
690
|
+
/**
|
|
691
|
+
* The views of the settings: the workspace's, read by everyone, and the browsers the person is
|
|
692
|
+
* signed in on (board #309), which a console that holds a token does not offer, and so does not
|
|
693
|
+
* name.
|
|
694
|
+
*/
|
|
695
|
+
function SettingsViews(props) {
|
|
696
|
+
const views = useWords().settings.views;
|
|
697
|
+
return (_jsxs("nav", { className: "sc-subtabs sc-settings-views", "aria-label": views.aria, children: [_jsx("a", { className: cx("sc-tab", props.on === "workspace" && "sc-tab-current"), href: PATHS.settings, "aria-current": props.on === "workspace" ? "page" : undefined, children: views.workspace }), _jsx("a", { className: cx("sc-tab", props.on === "sessions" && "sc-tab-current"), href: PATHS.sessions, "aria-current": props.on === "sessions" ? "page" : undefined, children: views.sessions })] }));
|
|
698
|
+
}
|
|
699
|
+
/**
|
|
700
|
+
* The browsers whoever is signed in is signed in on (board #309): read when the page opens, and
|
|
701
|
+
* again once one of them, or all the others, are signed out.
|
|
702
|
+
*/
|
|
703
|
+
function SessionsPage(props) {
|
|
704
|
+
const words = useWords();
|
|
705
|
+
const { data, components } = props;
|
|
706
|
+
const { busy, error, act } = useAction();
|
|
707
|
+
const [sessions, setSessions] = useState(undefined);
|
|
708
|
+
const [failure, setFailure] = useState(undefined);
|
|
709
|
+
const read = data.actions.sessions;
|
|
710
|
+
useEffect(() => {
|
|
711
|
+
const controller = new AbortController();
|
|
712
|
+
read(controller.signal)
|
|
713
|
+
.then((found) => {
|
|
714
|
+
if (!controller.signal.aborted) {
|
|
715
|
+
setSessions(found);
|
|
716
|
+
}
|
|
717
|
+
})
|
|
718
|
+
.catch((caught) => {
|
|
719
|
+
if (!controller.signal.aborted) {
|
|
720
|
+
setFailure(errorWords(caught, words.common.somethingWentWrong, words));
|
|
721
|
+
}
|
|
722
|
+
});
|
|
723
|
+
return () => controller.abort();
|
|
724
|
+
}, [read, words]);
|
|
725
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { className: "sc-page-head", children: _jsx("h1", { className: "sc-page-title", children: words.settings.title }) }), _jsx(SettingsViews, { on: "sessions" }), (error ?? failure) !== undefined && _jsx(Callout, { tone: "danger", children: error ?? failure }), sessions === undefined ? (failure === undefined && (_jsx("div", { className: "sc-loading", children: _jsx(Spinner, { label: words.sessions.loading }) }))) : (_jsx(components.SessionList, { sessions: sessions.items, idleDays: sessions.idleDays, busy: busy, onEnd: (session) => void act(async () => {
|
|
726
|
+
// Read again whether it went or not: one ended from elsewhere, or whose time
|
|
727
|
+
// ended, is not found, and its row goes all the same.
|
|
728
|
+
try {
|
|
729
|
+
await data.actions.endSession(session.id);
|
|
730
|
+
}
|
|
731
|
+
finally {
|
|
732
|
+
setSessions(await read());
|
|
733
|
+
}
|
|
734
|
+
}), onEndOthers: () => void act(async () => {
|
|
735
|
+
try {
|
|
736
|
+
await data.actions.endOtherSessions();
|
|
737
|
+
}
|
|
738
|
+
finally {
|
|
739
|
+
setSessions(await read());
|
|
740
|
+
}
|
|
741
|
+
}) }))] }));
|
|
742
|
+
}
|
|
686
743
|
/**
|
|
687
744
|
* The workspace's settings (ADR-0023): its rules, the console's own until an administrator
|
|
688
745
|
* writes the organization's; its categories, kept on their own page; and where its skills come
|
|
@@ -750,7 +807,7 @@ function WorkspaceSettingsPage(props) {
|
|
|
750
807
|
navigation.replace(PATHS.settings);
|
|
751
808
|
}), onCancel: () => navigation.back(PATHS.settings) })] })] }));
|
|
752
809
|
}
|
|
753
|
-
return (_jsxs(_Fragment, { children: [head, error !== undefined && _jsx(Callout, { tone: "danger", children: error }), workspace !== undefined && (_jsxs("section", { className: "sc-panel", "aria-label": words.settings.workspace.aria, children: [_jsxs("div", { className: "sc-section-head", children: [_jsx("h2", { className: "sc-section-title", children: words.settings.workspace.title }), administrator && (_jsx("a", { className: "sc-button sc-button-secondary sc-button-sm", href: settingsHref("workspace"), children: words.common.edit }))] }), _jsx(WorkspaceSettingsView, { workspace: workspace, console: data.me?.console })] })), _jsxs("section", { className: "sc-panel", "aria-label": words.rules.title, children: [_jsx("h2", { className: "sc-section-title", children: words.rules.title }), rules === undefined ? (_jsx(Spinner, { label: words.rules.loading })) : (_jsx(RulesView, { rules: rules, scope: "workspace", editHref: administrator ? settingsHref("rules") : undefined, onArchive: administrator
|
|
810
|
+
return (_jsxs(_Fragment, { children: [head, !holdsToken(data) && _jsx(SettingsViews, { on: "workspace" }), error !== undefined && _jsx(Callout, { tone: "danger", children: error }), workspace !== undefined && (_jsxs("section", { className: "sc-panel", "aria-label": words.settings.workspace.aria, children: [_jsxs("div", { className: "sc-section-head", children: [_jsx("h2", { className: "sc-section-title", children: words.settings.workspace.title }), administrator && (_jsx("a", { className: "sc-button sc-button-secondary sc-button-sm", href: settingsHref("workspace"), children: words.common.edit }))] }), _jsx(WorkspaceSettingsView, { workspace: workspace, console: data.me?.console })] })), _jsxs("section", { className: "sc-panel", "aria-label": words.rules.title, children: [_jsx("h2", { className: "sc-section-title", children: words.rules.title }), rules === undefined ? (_jsx(Spinner, { label: words.rules.loading })) : (_jsx(RulesView, { rules: rules, scope: "workspace", editHref: administrator ? settingsHref("rules") : undefined, onArchive: administrator
|
|
754
811
|
? () => void act(async () => {
|
|
755
812
|
setRules(await data.actions.archiveRules());
|
|
756
813
|
})
|
|
@@ -808,20 +865,30 @@ function PersonAgentsPage(props) {
|
|
|
808
865
|
* A plate, read when the page is opened: the person's own, or another person's for whoever
|
|
809
866
|
* oversees them. The week at the top is the address's.
|
|
810
867
|
*/
|
|
868
|
+
/**
|
|
869
|
+
* What a person's own pages showed last, by what each read: come back to, a page stands at once
|
|
870
|
+
* with what it showed and reads again behind it, rather than wait on the server every time a
|
|
871
|
+
* tab is pressed. Forgotten when the person signs out.
|
|
872
|
+
*/
|
|
873
|
+
const shownBefore = new Map();
|
|
874
|
+
function rememberedAs(key) {
|
|
875
|
+
return shownBefore.get(key);
|
|
876
|
+
}
|
|
811
877
|
function PlatePage(props) {
|
|
812
878
|
const words = useWords();
|
|
813
|
-
const { components, load, couldNotLoad, refused } = props;
|
|
814
|
-
const [plate, setPlate] = useState(
|
|
879
|
+
const { components, load, couldNotLoad, refused, remember } = props;
|
|
880
|
+
const [plate, setPlate] = useState(() => rememberedAs(remember));
|
|
815
881
|
const [problem, setProblem] = useState(undefined);
|
|
816
882
|
const [forbidden, setForbidden] = useState(false);
|
|
817
883
|
useEffect(() => {
|
|
818
884
|
const controller = new AbortController();
|
|
819
|
-
setPlate(
|
|
885
|
+
setPlate(rememberedAs(remember));
|
|
820
886
|
setProblem(undefined);
|
|
821
887
|
setForbidden(false);
|
|
822
888
|
load(controller.signal)
|
|
823
889
|
.then((answer) => {
|
|
824
890
|
if (!controller.signal.aborted) {
|
|
891
|
+
shownBefore.set(remember, answer);
|
|
825
892
|
setPlate(answer);
|
|
826
893
|
}
|
|
827
894
|
})
|
|
@@ -839,7 +906,7 @@ function PlatePage(props) {
|
|
|
839
906
|
}
|
|
840
907
|
});
|
|
841
908
|
return () => controller.abort();
|
|
842
|
-
}, [load, couldNotLoad, refused]);
|
|
909
|
+
}, [load, couldNotLoad, refused, remember]);
|
|
843
910
|
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "sc-page-head", children: [_jsx("h1", { className: "sc-page-title", children: props.title }), props.aside] }), problem !== undefined && _jsx(Callout, { tone: "danger", children: problem }), forbidden && refused !== undefined ? (_jsx(EmptyState, { title: refused.title, body: refused.body, action: _jsx(LinkButton, { href: PATHS.work, children: words.nav.work }) })) : plate === undefined ? (problem === undefined && (_jsx("div", { className: "sc-loading", children: _jsx(Spinner, { label: props.loading }) }))) : plate.tasks.length === 0 &&
|
|
844
911
|
(plate.closed?.length ?? 0) === 0 &&
|
|
845
912
|
(plate.decisions?.length ?? 0) === 0 ? (_jsx(EmptyState, { title: props.empty.title, body: props.empty.body })) : (_jsx(components.WorkList, { work: plate, week: props.week, weekStart: props.weekStart, taskHref: (projectKey, task) => taskHref(projectKey, task.number), decisionHref: (projectKey, decisionId) => decisionHref(projectKey, decisionId), weekHref: props.weekHref }))] }));
|
|
@@ -882,10 +949,11 @@ function MyDecisionPage(props) {
|
|
|
882
949
|
/** What is on the person's own plate, across their projects. */
|
|
883
950
|
/** How many of a person's decisions are read at a time. */
|
|
884
951
|
const MY_DECISIONS_PAGE = 50;
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
const [
|
|
952
|
+
function useMyDecisions(myDecisions, raised, couldNotLoad,
|
|
953
|
+
/** What the first page is remembered by, with whose it is. */
|
|
954
|
+
remember) {
|
|
955
|
+
const [items, setItems] = useState(() => rememberedAs(remember)?.items);
|
|
956
|
+
const [more, setMore] = useState(() => rememberedAs(remember)?.more ?? false);
|
|
889
957
|
const [busy, setBusy] = useState(false);
|
|
890
958
|
const [problem, setProblem] = useState(undefined);
|
|
891
959
|
const read = useCallback(async (offset, signal) => {
|
|
@@ -895,6 +963,9 @@ function useMyDecisions(myDecisions, raised, couldNotLoad) {
|
|
|
895
963
|
if (signal?.aborted === true) {
|
|
896
964
|
return;
|
|
897
965
|
}
|
|
966
|
+
if (offset === 0) {
|
|
967
|
+
shownBefore.set(remember, { items: page.items, more: page.more });
|
|
968
|
+
}
|
|
898
969
|
setItems((before) => (offset === 0 ? page.items : [...(before ?? []), ...page.items]));
|
|
899
970
|
setMore(page.more);
|
|
900
971
|
}
|
|
@@ -908,14 +979,16 @@ function useMyDecisions(myDecisions, raised, couldNotLoad) {
|
|
|
908
979
|
setBusy(false);
|
|
909
980
|
}
|
|
910
981
|
}
|
|
911
|
-
}, [myDecisions, raised, couldNotLoad]);
|
|
982
|
+
}, [myDecisions, raised, couldNotLoad, remember]);
|
|
912
983
|
useEffect(() => {
|
|
913
984
|
const controller = new AbortController();
|
|
914
|
-
|
|
985
|
+
const kept = rememberedAs(remember);
|
|
986
|
+
setItems(kept?.items);
|
|
987
|
+
setMore(kept?.more ?? false);
|
|
915
988
|
setProblem(undefined);
|
|
916
989
|
void read(0, controller.signal);
|
|
917
990
|
return () => controller.abort();
|
|
918
|
-
}, [read]);
|
|
991
|
+
}, [read, remember]);
|
|
919
992
|
const readMore = useCallback(() => void read(items?.length ?? 0), [read, items]);
|
|
920
993
|
const reload = useCallback(() => void read(0), [read]);
|
|
921
994
|
return { items, more, busy, problem, readMore, reload };
|
|
@@ -927,8 +1000,9 @@ function useMyDecisions(myDecisions, raised, couldNotLoad) {
|
|
|
927
1000
|
function MyDecisionsPage(props) {
|
|
928
1001
|
const words = useWords();
|
|
929
1002
|
const { myDecisions, answerReachedDecision } = props.data.actions;
|
|
930
|
-
const
|
|
931
|
-
const
|
|
1003
|
+
const whose = props.data.me?.person?.id ?? "";
|
|
1004
|
+
const addressed = useMyDecisions(myDecisions, false, words.myDecisions.couldNotLoad, `decisions:${whose}:addressed`);
|
|
1005
|
+
const raised = useMyDecisions(myDecisions, true, words.myDecisions.couldNotLoad, `decisions:${whose}:raised`);
|
|
932
1006
|
const { busy, error, act } = useAction();
|
|
933
1007
|
const problem = addressed.problem ?? raised.problem ?? error;
|
|
934
1008
|
// Answered at the decision's own address (ADR-0068), so that one that reaches the person from a
|
|
@@ -946,7 +1020,7 @@ function MyDecisionsPage(props) {
|
|
|
946
1020
|
function WorkPage(props) {
|
|
947
1021
|
const words = useWords();
|
|
948
1022
|
const { work } = props.data.actions;
|
|
949
|
-
return (_jsx(PlatePage, { components: props.components, load: work, title: words.work.title, week: props.week, weekStart: weekStartOf(props.data.me?.workspace), weekHref: workHref, loading: words.work.loading, couldNotLoad: words.work.couldNotLoad, empty: words.work.empty }));
|
|
1023
|
+
return (_jsx(PlatePage, { components: props.components, load: work, remember: `work:${props.data.me?.person?.id ?? ""}`, title: words.work.title, week: props.week, weekStart: weekStartOf(props.data.me?.workspace), weekHref: workHref, loading: words.work.loading, couldNotLoad: words.work.couldNotLoad, empty: words.work.empty }));
|
|
950
1024
|
}
|
|
951
1025
|
/** Another person's plate, for whoever oversees them: an administrator, or an owner of a project they are in. */
|
|
952
1026
|
function PersonWorkPage(props) {
|
|
@@ -956,7 +1030,7 @@ function PersonWorkPage(props) {
|
|
|
956
1030
|
const name = person === undefined ? "?" : personName(person);
|
|
957
1031
|
const { personWork } = data.actions;
|
|
958
1032
|
const load = useCallback((signal) => personWork(id, signal), [personWork, id]);
|
|
959
|
-
return (_jsx(PlatePage, { components: props.components, load: load, title: words.people.workOf(name), aside: _jsx(LinkButton, { href: PATHS.people, children: words.nav.people }), week: props.week, weekStart: weekStartOf(data.me?.workspace), weekHref: (day) => personWorkHref(id, day), loading: words.people.loadingWork, couldNotLoad: words.people.couldNotLoadWork, empty: { title: words.people.noWork.title(name), body: words.people.noWork.body }, refused: words.people.notOverseen }));
|
|
1033
|
+
return (_jsx(PlatePage, { components: props.components, load: load, remember: `work:${data.me?.person?.id ?? ""}:${id}`, title: words.people.workOf(name), aside: _jsx(LinkButton, { href: PATHS.people, children: words.nav.people }), week: props.week, weekStart: weekStartOf(data.me?.workspace), weekHref: (day) => personWorkHref(id, day), loading: words.people.loadingWork, couldNotLoad: words.people.couldNotLoadWork, empty: { title: words.people.noWork.title(name), body: words.people.noWork.body }, refused: words.people.notOverseen }));
|
|
960
1034
|
}
|
|
961
1035
|
function WorkspacePage(props) {
|
|
962
1036
|
const words = useWords();
|
|
@@ -981,6 +1055,9 @@ function WorkspacePage(props) {
|
|
|
981
1055
|
if (route.name === "person-work") {
|
|
982
1056
|
return _jsx(PersonWorkPage, { id: route.id, data: data, components: components, week: route.week });
|
|
983
1057
|
}
|
|
1058
|
+
if (route.name === "sessions") {
|
|
1059
|
+
return _jsx(SessionsPage, { data: data, components: components });
|
|
1060
|
+
}
|
|
984
1061
|
if (route.name === "workspace-settings") {
|
|
985
1062
|
return (_jsx(WorkspaceSettingsPage, { form: route.form, data: data, navigation: navigation, language: language }));
|
|
986
1063
|
}
|
|
@@ -1082,9 +1159,11 @@ export function createConsole(config = {}) {
|
|
|
1082
1159
|
const failure = signInFailureOf(location.search);
|
|
1083
1160
|
const title = data.me?.workspace.name ?? fallbackTitle;
|
|
1084
1161
|
const viaToken = holdsToken(data);
|
|
1085
|
-
// The language: the person's own, else the browser's, else the
|
|
1162
|
+
// The language: the person's own, else the browser's, else the workspace's (ADR-0081), else
|
|
1163
|
+
// the first the console speaks.
|
|
1086
1164
|
const chosen = data.me?.language;
|
|
1087
|
-
const
|
|
1165
|
+
const fallback = data.me?.workspace.language;
|
|
1166
|
+
const pack = useMemo(() => chooseLanguage(chosen, typeof navigator === "undefined" ? [] : navigator.languages, languages, fallback), [chosen, fallback]);
|
|
1088
1167
|
const words = pack.messages;
|
|
1089
1168
|
const toKeep = languageToKeep(data.me, typeof navigator === "undefined" ? [] : navigator.languages, languages);
|
|
1090
1169
|
useEffect(() => {
|
|
@@ -1171,6 +1250,7 @@ export function createConsole(config = {}) {
|
|
|
1171
1250
|
href: PATHS.settings,
|
|
1172
1251
|
label: words.nav.settings,
|
|
1173
1252
|
current: route.name === "workspace-settings" ||
|
|
1253
|
+
route.name === "sessions" ||
|
|
1174
1254
|
route.name === "categories" ||
|
|
1175
1255
|
route.name === "plugins-settings",
|
|
1176
1256
|
},
|
|
@@ -1299,7 +1379,12 @@ export function createConsole(config = {}) {
|
|
|
1299
1379
|
(route.name === "plugin" &&
|
|
1300
1380
|
data.plugins.some((candidate) => candidate.key === route.plugin &&
|
|
1301
1381
|
pluginPagesAt(candidate, route.level).some((candidate, index) => candidate.wide &&
|
|
1302
|
-
(route.page === undefined ? index === 0 : candidate.key === route.page)))), onNavigate: (href) => navigation.go(href), onSignOut: viaToken
|
|
1382
|
+
(route.page === undefined ? index === 0 : candidate.key === route.page)))), onNavigate: (href) => navigation.go(href), onSignOut: viaToken
|
|
1383
|
+
? undefined
|
|
1384
|
+
: () => {
|
|
1385
|
+
shownBefore.clear();
|
|
1386
|
+
void data.actions.signOut();
|
|
1387
|
+
}, children: page }));
|
|
1303
1388
|
}
|
|
1304
1389
|
return (_jsx(LanguageContext.Provider, { value: pack, children: _jsx(RemotePicturesContext.Provider, { value: pictureSrc, children: content }) }));
|
|
1305
1390
|
}
|