@stnd/launcher 1.0.16 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/Launcher.svelte +17 -116
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/Launcher.svelte
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* Integrated with the Standard Garden OS aesthetic.
|
|
6
6
|
*/
|
|
7
7
|
import Icon from "@stnd/icon/Icon.svelte";
|
|
8
|
-
import Avatar from "@stnd/account/ui/Avatar.svelte";
|
|
9
8
|
import {
|
|
10
9
|
registry,
|
|
11
10
|
palette,
|
|
@@ -36,21 +35,6 @@
|
|
|
36
35
|
// Props exist only for backward compat or one-off overrides.
|
|
37
36
|
let { WelcomeView = null, load = null, hideLogin = false } = $props();
|
|
38
37
|
|
|
39
|
-
// Login only makes sense if an app actually wired up authentication —
|
|
40
|
-
// otherwise this is the same assumption-bleed as a hardcoded "ask AI"
|
|
41
|
-
// item: a button pointing at a "::login" view that doesn't exist for
|
|
42
|
-
// apps with no account system at all (presence-of-data = mode).
|
|
43
|
-
let hasAuthProvider = $derived(
|
|
44
|
-
has("user") ||
|
|
45
|
-
(typeof window !== "undefined" && !!window.__INITIAL_USER__),
|
|
46
|
-
);
|
|
47
|
-
|
|
48
|
-
// Check global window variable as fallback (set via window.__HIDE_LAUNCHER_LOGIN__)
|
|
49
|
-
let shouldHideLogin = $derived(
|
|
50
|
-
hideLogin ||
|
|
51
|
-
(typeof window !== "undefined" && window.__HIDE_LAUNCHER_LOGIN__),
|
|
52
|
-
);
|
|
53
|
-
|
|
54
38
|
// --- STATE (Synced with Engine) ---
|
|
55
39
|
let pState = $state({
|
|
56
40
|
open: false,
|
|
@@ -655,66 +639,6 @@
|
|
|
655
639
|
<div class="std-launcher-empty">Nothing came up.</div>
|
|
656
640
|
{/if}
|
|
657
641
|
</div>
|
|
658
|
-
|
|
659
|
-
<!-- Footer -->
|
|
660
|
-
<footer class="std-launcher-footer mt-0">
|
|
661
|
-
<div>
|
|
662
|
-
{#if currentUser && currentUser.isAuthenticated}
|
|
663
|
-
<div
|
|
664
|
-
class="std-launcher-user flex items-center gap-xs"
|
|
665
|
-
role="button"
|
|
666
|
-
tabindex="0"
|
|
667
|
-
onclick={() => {
|
|
668
|
-
if (registryState.views["::account-settings"]) {
|
|
669
|
-
launcherView("::account-settings");
|
|
670
|
-
} else if (registryState.views["::settings"]) {
|
|
671
|
-
launcherView("::settings");
|
|
672
|
-
} else {
|
|
673
|
-
launcherView("::my-space");
|
|
674
|
-
}
|
|
675
|
-
}}
|
|
676
|
-
onkeydown={(e) => {
|
|
677
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
678
|
-
if (registryState.views["::account-settings"]) {
|
|
679
|
-
launcherView("::account-settings");
|
|
680
|
-
} else if (registryState.views["::settings"]) {
|
|
681
|
-
launcherView("::settings");
|
|
682
|
-
} else {
|
|
683
|
-
launcherView("::my-space");
|
|
684
|
-
}
|
|
685
|
-
}
|
|
686
|
-
}}
|
|
687
|
-
style="cursor: pointer;"
|
|
688
|
-
>
|
|
689
|
-
<Avatar
|
|
690
|
-
src={currentUser.image}
|
|
691
|
-
name={currentUser.username || currentUser.name}
|
|
692
|
-
email={currentUser.email}
|
|
693
|
-
size="18px"
|
|
694
|
-
border={false}
|
|
695
|
-
/>
|
|
696
|
-
<span class="smaller muted">
|
|
697
|
-
{currentUser.name || currentUser.username || currentUser.email}
|
|
698
|
-
</span>
|
|
699
|
-
</div>
|
|
700
|
-
{:else if hasAuthProvider && !shouldHideLogin}
|
|
701
|
-
<button
|
|
702
|
-
class="no-decoration smaller ghost text-subtle"
|
|
703
|
-
onclick={() => launcherView("::login")}
|
|
704
|
-
>
|
|
705
|
-
Login
|
|
706
|
-
</button>
|
|
707
|
-
{/if}
|
|
708
|
-
<div class="std-launcher-mode smaller inline hidden">
|
|
709
|
-
{ActiveViewComponent ? "SYSTEM VIEW" : "COMMAND MODE"}
|
|
710
|
-
</div>
|
|
711
|
-
</div>
|
|
712
|
-
|
|
713
|
-
<div class="std-launcher-hints sm:hidden hidden">
|
|
714
|
-
<span><kbd>↑</kbd> <kbd>↓</kbd> navigate</span>
|
|
715
|
-
<span><kbd>esc</kbd> close</span>
|
|
716
|
-
</div>
|
|
717
|
-
</footer>
|
|
718
642
|
</div>
|
|
719
643
|
</div>
|
|
720
644
|
{/if}
|
|
@@ -921,10 +845,27 @@
|
|
|
921
845
|
--launcher-pad: var(--space);
|
|
922
846
|
}
|
|
923
847
|
|
|
848
|
+
/* Full-bleed views (settings, welcome horizon) manage their own internal layout */
|
|
849
|
+
.std-launcher-body:has(.settings-window),
|
|
850
|
+
.std-launcher-body:has(.full-bleed),
|
|
851
|
+
.std-launcher-body:has(.welcome) {
|
|
852
|
+
overflow-y: hidden;
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
.std-launcher-view {
|
|
856
|
+
width: 100%;
|
|
857
|
+
height: 100%;
|
|
858
|
+
}
|
|
859
|
+
|
|
924
860
|
.std-launcher-view > :first-child {
|
|
925
861
|
padding: var(--launcher-pad);
|
|
926
862
|
}
|
|
927
863
|
|
|
864
|
+
.std-launcher-view > .settings-window,
|
|
865
|
+
.std-launcher-view > .full-bleed {
|
|
866
|
+
padding: 0;
|
|
867
|
+
}
|
|
868
|
+
|
|
928
869
|
/* Height is bounded at BOTH ends on purpose. A pure `vh` cap measured the
|
|
929
870
|
window while the content measured itself — on a short viewport the welcome
|
|
930
871
|
view (~16rem) was cut off mid-descender, on a tall one the panel floated in
|
|
@@ -1043,46 +984,6 @@
|
|
|
1043
984
|
font-size: var(--scale-d2);
|
|
1044
985
|
}
|
|
1045
986
|
|
|
1046
|
-
/* Footer */
|
|
1047
|
-
.std-launcher-footer {
|
|
1048
|
-
display: flex;
|
|
1049
|
-
justify-content: space-between;
|
|
1050
|
-
align-items: center;
|
|
1051
|
-
padding: var(--space-d2) var(--space-d2);
|
|
1052
|
-
font-size: var(--size-xs);
|
|
1053
|
-
color: var(--color-muted);
|
|
1054
|
-
border-top: var(--border);
|
|
1055
|
-
background-color: var(--color-surface-high);
|
|
1056
|
-
|
|
1057
|
-
box-shadow: var(--shadow-raised);
|
|
1058
|
-
}
|
|
1059
|
-
|
|
1060
|
-
.std-launcher-user {
|
|
1061
|
-
display: flex;
|
|
1062
|
-
align-items: center;
|
|
1063
|
-
gap: var(--space-d4);
|
|
1064
|
-
color: var(--color-foreground-muted);
|
|
1065
|
-
padding: var(--space-d4);
|
|
1066
|
-
border-radius: var(--radius);
|
|
1067
|
-
transition: all var(--transition-fast);
|
|
1068
|
-
}
|
|
1069
|
-
|
|
1070
|
-
.std-launcher-user:hover {
|
|
1071
|
-
background: var(--color-surface-highest);
|
|
1072
|
-
color: var(--color-foreground);
|
|
1073
|
-
}
|
|
1074
|
-
|
|
1075
|
-
.std-launcher-user span {
|
|
1076
|
-
max-width: 150px;
|
|
1077
|
-
white-space: nowrap;
|
|
1078
|
-
overflow: hidden;
|
|
1079
|
-
text-overflow: ellipsis;
|
|
1080
|
-
}
|
|
1081
|
-
|
|
1082
|
-
.std-launcher-hints {
|
|
1083
|
-
display: flex;
|
|
1084
|
-
gap: 1rem;
|
|
1085
|
-
}
|
|
1086
987
|
|
|
1087
988
|
/* Mobile: Bottom Sheet */
|
|
1088
989
|
@media (max-width: 640px) {
|