solid-ui 3.1.3-7 → 3.1.3-8
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/dist/_virtual/~icons/app/solid-emblem.cjs.js +3 -0
- package/dist/_virtual/~icons/app/solid-emblem.cjs.js.map +1 -0
- package/dist/_virtual/~icons/app/solid-emblem.esm.js +11 -0
- package/dist/_virtual/~icons/app/solid-emblem.esm.js.map +1 -0
- package/dist/breakpoints.css +1 -0
- package/dist/breakpoints.css.d.ts +1 -0
- package/dist/chunks/{account-BZ2rYQhV.js → account-jSZP2tZ5.js} +72 -56
- package/dist/chunks/account-jSZP2tZ5.js.map +1 -0
- package/dist/chunks/{auth-RHyQ2iIl.js → auth-CZOEEeJ8.js} +15 -15
- package/dist/chunks/{auth-RHyQ2iIl.js.map → auth-CZOEEeJ8.js.map} +1 -1
- package/dist/chunks/{avatar-Jx8xm2Op.js → avatar-BugsRJZg.js} +2 -2
- package/dist/chunks/{avatar-Jx8xm2Op.js.map → avatar-BugsRJZg.js.map} +1 -1
- package/dist/chunks/{footer-D64T6XLO.js → footer-kVa_uMeQ.js} +3 -3
- package/dist/chunks/{footer-D64T6XLO.js.map → footer-kVa_uMeQ.js.map} +1 -1
- package/dist/chunks/{guard-CjUBGVDk.js → guard-Cml6dHTv.js} +2 -2
- package/dist/chunks/{guard-CjUBGVDk.js.map → guard-Cml6dHTv.js.map} +1 -1
- package/dist/chunks/{headerFooterHelpers-7O_ln1QD.js → headerFooterHelpers-BiZ6X10e.js} +15 -15
- package/dist/chunks/{headerFooterHelpers-7O_ln1QD.js.map → headerFooterHelpers-BiZ6X10e.js.map} +1 -1
- package/dist/chunks/{jsonld-DRZuoyoU.js → jsonld-Cd-ZhJmZ.js} +2 -2
- package/dist/chunks/{jsonld-DRZuoyoU.js.map → jsonld-Cd-ZhJmZ.js.map} +1 -1
- package/dist/chunks/{login-button-DPeMi00d.js → login-button-pe1-DVNZ.js} +2 -2
- package/dist/chunks/{login-button-DPeMi00d.js.map → login-button-pe1-DVNZ.js.map} +1 -1
- package/dist/chunks/{logout-button-CbiLE7jO.js → logout-button-C5dtQiBB.js} +2 -2
- package/dist/chunks/{logout-button-CbiLE7jO.js.map → logout-button-C5dtQiBB.js.map} +1 -1
- package/dist/chunks/{menu-item-Ck0l-uEI.js → menu-item-CWg-eS4V.js} +7 -5
- package/dist/chunks/menu-item-CWg-eS4V.js.map +1 -0
- package/dist/chunks/{provider-C4eSzopG.js → provider-DRxSExO6.js} +2 -2
- package/dist/chunks/{provider-C4eSzopG.js.map → provider-DRxSExO6.js.map} +1 -1
- package/dist/chunks/{signup-button-BfIxbpwa.js → signup-button-QvYELqb6.js} +2 -2
- package/dist/chunks/{signup-button-BfIxbpwa.js.map → signup-button-QvYELqb6.js.map} +1 -1
- package/dist/chunks/solid-emblem-BDzhMTjL.js +185 -0
- package/dist/chunks/solid-emblem-BDzhMTjL.js.map +1 -0
- package/dist/chunks/{solid-logic.esm-T70qfHAr.js → solid-logic.esm-BhVcNu8u.js} +7 -28
- package/dist/chunks/{solid-logic.esm-T70qfHAr.js.map → solid-logic.esm-BhVcNu8u.js.map} +1 -1
- package/dist/chunks/{src-Bx4GAnWq.js → src-DYvSns7X.js} +2375 -2351
- package/dist/chunks/src-DYvSns7X.js.map +1 -0
- package/dist/components/account/Account.cjs.js +7 -2
- package/dist/components/account/Account.cjs.js.map +1 -1
- package/dist/components/account/Account.d.ts +8 -1
- package/dist/components/account/Account.d.ts.map +1 -1
- package/dist/components/account/Account.esm.js +64 -48
- package/dist/components/account/Account.esm.js.map +1 -1
- package/dist/components/account/Account.stories.d.ts +3 -8
- package/dist/components/account/Account.stories.d.ts.map +1 -1
- package/dist/components/account/index.cjs.js.map +1 -1
- package/dist/components/account/index.d.ts +2 -2
- package/dist/components/account/index.d.ts.map +1 -1
- package/dist/components/account/index.esm.js.map +1 -1
- package/dist/components/account.js +1 -1
- package/dist/components/avatar.js +1 -1
- package/dist/components/footer.js +1 -1
- package/dist/components/guard.js +1 -1
- package/dist/components/index.cjs.js +1 -1
- package/dist/components/index.esm.js +2 -2
- package/dist/components/login-button.js +1 -1
- package/dist/components/login-modal.js +1 -1
- package/dist/components/logout-button.js +1 -1
- package/dist/components/menu-item/MenuItem.cjs.js +5 -3
- package/dist/components/menu-item/MenuItem.cjs.js.map +1 -1
- package/dist/components/menu-item/MenuItem.d.ts.map +1 -1
- package/dist/components/menu-item/MenuItem.esm.js +5 -3
- package/dist/components/menu-item/MenuItem.esm.js.map +1 -1
- package/dist/components/menu-item/MenuItem.styles.cjs.js +1 -1
- package/dist/components/menu-item/MenuItem.styles.cjs.js.map +1 -1
- package/dist/components/menu-item/MenuItem.styles.esm.js +1 -1
- package/dist/components/menu-item/MenuItem.styles.esm.js.map +1 -1
- package/dist/components/menu-item.js +1 -1
- package/dist/components/provider.js +1 -1
- package/dist/components/signup-button.js +1 -1
- package/dist/components/solid-emblem/SolidEmblem.cjs.js +2 -0
- package/dist/components/solid-emblem/SolidEmblem.cjs.js.map +1 -0
- package/dist/components/solid-emblem/SolidEmblem.d.ts +6 -0
- package/dist/components/solid-emblem/SolidEmblem.d.ts.map +1 -0
- package/dist/components/solid-emblem/SolidEmblem.esm.js +178 -0
- package/dist/components/solid-emblem/SolidEmblem.esm.js.map +1 -0
- package/dist/components/solid-emblem/SolidEmblem.styles.cjs.js +2 -0
- package/dist/components/solid-emblem/SolidEmblem.styles.cjs.js.map +1 -0
- package/dist/components/solid-emblem/SolidEmblem.styles.esm.js +7 -0
- package/dist/components/solid-emblem/SolidEmblem.styles.esm.js.map +1 -0
- package/dist/components/solid-emblem/index.cjs.js +2 -0
- package/dist/components/solid-emblem/index.cjs.js.map +1 -0
- package/dist/components/solid-emblem/index.d.ts +4 -0
- package/dist/components/solid-emblem/index.d.ts.map +1 -0
- package/dist/components/solid-emblem/index.esm.js +7 -0
- package/dist/components/solid-emblem/index.esm.js.map +1 -0
- package/dist/components/solid-emblem.js +2 -0
- package/dist/components.js +11 -11
- package/dist/index.js +4 -5
- package/dist/lib/forms/rdfHelper.d.ts +4 -0
- package/dist/lib/forms/rdfHelper.d.ts.map +1 -0
- package/dist/loader.js +4 -5
- package/dist/solid-ui.js +78 -1169
- package/dist/solid-ui.min.js +78 -1169
- package/dist/solid-ui.min.js.map +1 -1
- package/dist/theme.css +1 -1
- package/package.json +7 -2
- package/dist/chunks/account-BZ2rYQhV.js.map +0 -1
- package/dist/chunks/header-COBaJDdB.js +0 -1486
- package/dist/chunks/header-COBaJDdB.js.map +0 -1
- package/dist/chunks/iconBase-DJ0zbNSL.js +0 -31
- package/dist/chunks/iconBase-DJ0zbNSL.js.map +0 -1
- package/dist/chunks/menu-item-Ck0l-uEI.js.map +0 -1
- package/dist/chunks/src-Bx4GAnWq.js.map +0 -1
- package/dist/components/header/index.cjs.js +0 -1
- package/dist/components/header/index.d.ts +0 -2
- package/dist/components/header/index.d.ts.map +0 -1
- package/dist/components/header/index.esm.js +0 -3
- package/dist/components/header.js +0 -2
- package/dist/lib/features.cjs.js +0 -2
- package/dist/lib/features.cjs.js.map +0 -1
- package/dist/lib/features.d.ts +0 -8
- package/dist/lib/features.d.ts.map +0 -1
- package/dist/lib/features.esm.js +0 -6
- package/dist/lib/features.esm.js.map +0 -1
- package/dist/v2/components/actions/button/Button.d.ts +0 -97
- package/dist/v2/components/actions/button/Button.d.ts.map +0 -1
- package/dist/v2/components/actions/button/Button.test.d.ts +0 -1
- package/dist/v2/components/actions/button/Button.test.d.ts.map +0 -1
- package/dist/v2/components/actions/button/index.d.ts +0 -8
- package/dist/v2/components/actions/button/index.d.ts.map +0 -1
- package/dist/v2/components/auth/loginButton/LoginButton.cjs.js +0 -414
- package/dist/v2/components/auth/loginButton/LoginButton.cjs.js.map +0 -1
- package/dist/v2/components/auth/loginButton/LoginButton.esm.js +0 -519
- package/dist/v2/components/auth/loginButton/LoginButton.esm.js.map +0 -1
- package/dist/v2/components/auth/loginButton/downArrow.cjs.js +0 -9
- package/dist/v2/components/auth/loginButton/downArrow.cjs.js.map +0 -1
- package/dist/v2/components/auth/loginButton/downArrow.esm.js +0 -14
- package/dist/v2/components/auth/loginButton/downArrow.esm.js.map +0 -1
- package/dist/v2/components/auth/loginButton/index.cjs.js +0 -2
- package/dist/v2/components/auth/loginButton/index.cjs.js.map +0 -1
- package/dist/v2/components/auth/loginButton/index.esm.js +0 -8
- package/dist/v2/components/auth/loginButton/index.esm.js.map +0 -1
- package/dist/v2/components/auth/signupButton/SignupButton.cjs.js +0 -59
- package/dist/v2/components/auth/signupButton/SignupButton.cjs.js.map +0 -1
- package/dist/v2/components/auth/signupButton/SignupButton.esm.js +0 -98
- package/dist/v2/components/auth/signupButton/SignupButton.esm.js.map +0 -1
- package/dist/v2/components/auth/signupButton/index.cjs.js +0 -2
- package/dist/v2/components/auth/signupButton/index.cjs.js.map +0 -1
- package/dist/v2/components/auth/signupButton/index.esm.js +0 -8
- package/dist/v2/components/auth/signupButton/index.esm.js.map +0 -1
- package/dist/v2/components/forms/combobox/Combobox.d.ts +0 -82
- package/dist/v2/components/forms/combobox/Combobox.d.ts.map +0 -1
- package/dist/v2/components/forms/combobox/Combobox.test.d.ts +0 -1
- package/dist/v2/components/forms/combobox/Combobox.test.d.ts.map +0 -1
- package/dist/v2/components/forms/combobox/comboboxTypes.d.ts +0 -6
- package/dist/v2/components/forms/combobox/comboboxTypes.d.ts.map +0 -1
- package/dist/v2/components/forms/combobox/index.d.ts +0 -3
- package/dist/v2/components/forms/combobox/index.d.ts.map +0 -1
- package/dist/v2/components/forms/select/Select.d.ts +0 -68
- package/dist/v2/components/forms/select/Select.d.ts.map +0 -1
- package/dist/v2/components/forms/select/Select.test.d.ts +0 -1
- package/dist/v2/components/forms/select/Select.test.d.ts.map +0 -1
- package/dist/v2/components/forms/select/index.d.ts +0 -3
- package/dist/v2/components/forms/select/index.d.ts.map +0 -1
- package/dist/v2/components/forms/shared/downArrow.d.ts +0 -2
- package/dist/v2/components/forms/shared/downArrow.d.ts.map +0 -1
- package/dist/v2/components/forms/shared/keyboard.d.ts +0 -7
- package/dist/v2/components/forms/shared/keyboard.d.ts.map +0 -1
- package/dist/v2/components/forms/shared/listboxStyles.d.ts +0 -2
- package/dist/v2/components/forms/shared/listboxStyles.d.ts.map +0 -1
- package/dist/v2/components/forms/shared/listboxTemplate.d.ts +0 -11
- package/dist/v2/components/forms/shared/listboxTemplate.d.ts.map +0 -1
- package/dist/v2/components/forms/shared/optionTypes.d.ts +0 -6
- package/dist/v2/components/forms/shared/optionTypes.d.ts.map +0 -1
- package/dist/v2/components/layout/header/Header.cjs.js +0 -625
- package/dist/v2/components/layout/header/Header.cjs.js.map +0 -1
- package/dist/v2/components/layout/header/Header.d.ts +0 -160
- package/dist/v2/components/layout/header/Header.d.ts.map +0 -1
- package/dist/v2/components/layout/header/Header.esm.js +0 -873
- package/dist/v2/components/layout/header/Header.esm.js.map +0 -1
- package/dist/v2/components/layout/header/header.test.d.ts +0 -1
- package/dist/v2/components/layout/header/header.test.d.ts.map +0 -1
- package/dist/v2/components/layout/header/index.cjs.js +0 -2
- package/dist/v2/components/layout/header/index.cjs.js.map +0 -1
- package/dist/v2/components/layout/header/index.d.ts +0 -4
- package/dist/v2/components/layout/header/index.d.ts.map +0 -1
- package/dist/v2/components/layout/header/index.esm.js +0 -8
- package/dist/v2/components/layout/header/index.esm.js.map +0 -1
|
@@ -1,873 +0,0 @@
|
|
|
1
|
-
import { icons as e } from "../../../../lib/iconBase.esm.js";
|
|
2
|
-
import "../../../../components/account/index.esm.js";
|
|
3
|
-
import "../../auth/loginButton/index.esm.js";
|
|
4
|
-
import "../../auth/signupButton/index.esm.js";
|
|
5
|
-
import "../../../../components/provider/index.esm.js";
|
|
6
|
-
import t from "../../../../lib/features.esm.js";
|
|
7
|
-
import { authSession as n, authn as r, performServerSideLogout as i } from "solid-logic";
|
|
8
|
-
import { LitElement as a, css as o, html as s } from "lit";
|
|
9
|
-
import { ifDefined as c } from "lit/directives/if-defined.js";
|
|
10
|
-
//#region src/v2/components/layout/header/Header.ts
|
|
11
|
-
var l = "", u = "https://solidproject.org/assets/img/solid-emblem.svg", d = "https://solidproject.org/get_a_pod", f = e.iconBase + "emptyProfileAvatar.png";
|
|
12
|
-
async function p() {
|
|
13
|
-
if (!(typeof window > "u")) {
|
|
14
|
-
for (let e of ["loginIssuer", "preLoginRedirectHash"]) window.localStorage.removeItem(e), window.sessionStorage.removeItem(e);
|
|
15
|
-
if (!(typeof indexedDB > "u")) for (let e of [
|
|
16
|
-
"soidc",
|
|
17
|
-
"solid-client-authn-store",
|
|
18
|
-
"solid-client-authn"
|
|
19
|
-
]) await new Promise((t) => {
|
|
20
|
-
try {
|
|
21
|
-
let n = indexedDB.deleteDatabase(e);
|
|
22
|
-
n.onsuccess = () => t(), n.onerror = () => t(), n.onblocked = () => t();
|
|
23
|
-
} catch {
|
|
24
|
-
t();
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
var m = class extends a {
|
|
30
|
-
static properties = {
|
|
31
|
-
logo: {
|
|
32
|
-
type: String,
|
|
33
|
-
reflect: !0
|
|
34
|
-
},
|
|
35
|
-
helpIcon: {
|
|
36
|
-
type: String,
|
|
37
|
-
attribute: "help-icon",
|
|
38
|
-
reflect: !0
|
|
39
|
-
},
|
|
40
|
-
layout: {
|
|
41
|
-
type: String,
|
|
42
|
-
reflect: !0
|
|
43
|
-
},
|
|
44
|
-
theme: {
|
|
45
|
-
type: String,
|
|
46
|
-
reflect: !0
|
|
47
|
-
},
|
|
48
|
-
brandLink: {
|
|
49
|
-
type: String,
|
|
50
|
-
attribute: "brand-link",
|
|
51
|
-
reflect: !0
|
|
52
|
-
},
|
|
53
|
-
authState: {
|
|
54
|
-
type: String,
|
|
55
|
-
attribute: "auth-state",
|
|
56
|
-
reflect: !0
|
|
57
|
-
},
|
|
58
|
-
loginAction: {
|
|
59
|
-
type: Object,
|
|
60
|
-
attribute: !1
|
|
61
|
-
},
|
|
62
|
-
signUpAction: {
|
|
63
|
-
type: Object,
|
|
64
|
-
attribute: !1
|
|
65
|
-
},
|
|
66
|
-
accountMenu: {
|
|
67
|
-
type: Array,
|
|
68
|
-
attribute: !1
|
|
69
|
-
},
|
|
70
|
-
logoutLabel: {
|
|
71
|
-
type: String,
|
|
72
|
-
attribute: "logout-label",
|
|
73
|
-
reflect: !0
|
|
74
|
-
},
|
|
75
|
-
logoutIcon: {
|
|
76
|
-
type: String,
|
|
77
|
-
attribute: "logout-icon",
|
|
78
|
-
reflect: !0
|
|
79
|
-
},
|
|
80
|
-
accountIcon: {
|
|
81
|
-
type: String,
|
|
82
|
-
attribute: "account-icon",
|
|
83
|
-
reflect: !0
|
|
84
|
-
},
|
|
85
|
-
accountAvatar: {
|
|
86
|
-
type: String,
|
|
87
|
-
attribute: "account-avatar",
|
|
88
|
-
reflect: !0
|
|
89
|
-
},
|
|
90
|
-
accountAvatarFallback: {
|
|
91
|
-
type: String,
|
|
92
|
-
attribute: "account-avatar-fallback",
|
|
93
|
-
reflect: !0
|
|
94
|
-
},
|
|
95
|
-
loginIcon: {
|
|
96
|
-
type: String,
|
|
97
|
-
attribute: "login-icon",
|
|
98
|
-
reflect: !0
|
|
99
|
-
},
|
|
100
|
-
signUpIcon: {
|
|
101
|
-
type: String,
|
|
102
|
-
attribute: "sign-up-icon",
|
|
103
|
-
reflect: !0
|
|
104
|
-
},
|
|
105
|
-
helpMenuList: { type: Array },
|
|
106
|
-
accountMenuOpen: { state: !0 },
|
|
107
|
-
helpMenuOpen: { state: !0 },
|
|
108
|
-
hasSlottedAccountMenu: { state: !0 },
|
|
109
|
-
hasSlottedHelpMenu: { state: !0 },
|
|
110
|
-
authResolved: { state: !0 }
|
|
111
|
-
};
|
|
112
|
-
static styles = o`
|
|
113
|
-
:host { /* default theme */
|
|
114
|
-
display: block;
|
|
115
|
-
--header-bg: var(--color-header-row-bg, #332746);
|
|
116
|
-
--header-text: var(--color-header-text, #ffffff);
|
|
117
|
-
--header-border: var(--color-border, #efecf3);
|
|
118
|
-
--header-line: var(--color-header-menu-separator-line, #5e546d);
|
|
119
|
-
--header-link: var(--color-text-heading, #000000);
|
|
120
|
-
--header-menu-item-hover: var(--color-header-menu-item-hover, #e6dcff);
|
|
121
|
-
--header-menu-item-selected: var(--color-header-menu-item-selected, #cbb9ff);
|
|
122
|
-
--header-menu-bg: var(--color-menu-bg, #f6f5f9);
|
|
123
|
-
--header-menu-loggedin-bg: var(--color-header-menu-loggedin-bg, #5e546d);
|
|
124
|
-
--header-menu-text: var(--color-menu-item-text, #654d6c);
|
|
125
|
-
--header-border-radius: var(--border-radius-sm, 0.2rem);
|
|
126
|
-
--header-button-bg: var(--color-menu-bg, #ffffff);
|
|
127
|
-
--header-button-text: var(--color-header-button-text, #0F172B);
|
|
128
|
-
--header-button-detail-text: var(--color-header-button-detail-text, #99A1AF);
|
|
129
|
-
--header-shadow: var(--color-header-shadow, 2px 6px 10px 0 rgba(0, 0, 0, 0.4), 2px 8px 24px 0 rgba(0, 0, 0, 0.19));
|
|
130
|
-
font-family: var(--font-family-base, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
/* for now light and dark are the same */
|
|
134
|
-
:host([theme='dark']) {
|
|
135
|
-
display: block;
|
|
136
|
-
--header-bg: var(--color-header-row-bg, #332746);
|
|
137
|
-
--header-text: var(--color-header-text, #ffffff);
|
|
138
|
-
--header-border: var(--color-border, #efecf3);
|
|
139
|
-
--header-line: var(--color-header-menu-separator-line, #5e546d);
|
|
140
|
-
--header-link: var(--color-text-heading, #000000);
|
|
141
|
-
--header-menu-item-hover: var(--color-header-menu-item-hover, #e6dcff);
|
|
142
|
-
--header-menu-item-selected: var(--color-header-menu-item-selected, #cbb9ff);
|
|
143
|
-
--header-menu-bg: var(--color-menu-bg, #f6f5f9);
|
|
144
|
-
--header-menu-loggedin-bg: var(--color-header-menu-loggedin-bg, #5e546d);
|
|
145
|
-
--header-menu-text: var(--color-menu-item-text, #654d6c);
|
|
146
|
-
--header-border-radius: var(--border-radius-sm, 0.2rem);
|
|
147
|
-
--header-button-bg: var(--color-menu-bg, #ffffff);
|
|
148
|
-
--header-button-text: var(--color-header-button-text, #0f172a);
|
|
149
|
-
--header-button-detail-text: var(--color-header-button-detail-text, #878192);
|
|
150
|
-
--header-icon-filter: invert(1) brightness(1.3); /* special way to invert SVG color of icons, from white to black */
|
|
151
|
-
--header-shadow: var(--color-header-shadow, 2px 6px 10px 0 rgba(0, 0, 0, 0.4), 2px 8px 24px 0 rgba(0, 0, 0, 0.19));
|
|
152
|
-
font-family: var(--font-family-base, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
:host([layout='mobile']) .headerInner {
|
|
156
|
-
flex-wrap: wrap;
|
|
157
|
-
text-align: center;
|
|
158
|
-
gap: 0.5rem;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
.headerInner {
|
|
162
|
-
display: flex;
|
|
163
|
-
align-items: center;
|
|
164
|
-
justify-content: space-between;
|
|
165
|
-
background: var(--header-bg);
|
|
166
|
-
color: var(--header-text);
|
|
167
|
-
padding: 0 1.5rem;
|
|
168
|
-
height: 3.75rem;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
::slotted([slot='navigation-toggle']) {
|
|
172
|
-
display: inline-flex;
|
|
173
|
-
align-items: center;
|
|
174
|
-
justify-content: center;
|
|
175
|
-
flex-shrink: 0;
|
|
176
|
-
margin-right: 0.75rem;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
:host([layout='desktop']) ::slotted([slot='navigation-toggle']) {
|
|
180
|
-
display: none !important;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
.brand {
|
|
184
|
-
display: flex;
|
|
185
|
-
align-items: center;
|
|
186
|
-
gap: 0.5rem;
|
|
187
|
-
text-decoration: none;
|
|
188
|
-
color: inherit;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
.brand-not-displayed {
|
|
192
|
-
display: none;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
.brand img {
|
|
196
|
-
height: 50px;
|
|
197
|
-
width: 55px;
|
|
198
|
-
object-fit: contain;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
.menu {
|
|
202
|
-
display: flex;
|
|
203
|
-
align-items: center;
|
|
204
|
-
gap: 0.625rem;
|
|
205
|
-
margin-left: auto;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
.auth-actions {
|
|
209
|
-
display: flex;
|
|
210
|
-
align-items: center;
|
|
211
|
-
gap: 0.625rem;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
.auth-button {
|
|
215
|
-
display: inline-flex;
|
|
216
|
-
align-items: center;
|
|
217
|
-
justify-content: center;
|
|
218
|
-
gap: 0.5rem;
|
|
219
|
-
min-height: 2.25rem;
|
|
220
|
-
padding: 0.5rem 0.875rem;
|
|
221
|
-
border: 1px solid var(--header-border);
|
|
222
|
-
border-radius: 999px;
|
|
223
|
-
background: var(--header-menu-bg);
|
|
224
|
-
color: var(--header-button-text);
|
|
225
|
-
cursor: pointer;
|
|
226
|
-
font: inherit;
|
|
227
|
-
line-height: 1;
|
|
228
|
-
text-decoration: none;
|
|
229
|
-
box-sizing: border-box;
|
|
230
|
-
transition: border-color 0.2s ease, transform 0.2s ease;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
.auth-button:hover {
|
|
234
|
-
border-color: var(--header-menu-item-hover);
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
.auth-button:active {
|
|
238
|
-
transform: translateY(1px);
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
.auth-button-sign-up {
|
|
242
|
-
background: color-mix(in srgb, var(--header-menu-bg) 78%, var(--header-menu-item-selected) 22%);
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
.header-menu-separator {
|
|
246
|
-
background: var(--header-line);
|
|
247
|
-
width: 1px;
|
|
248
|
-
height: 2.3rem;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
.account-menu-container {
|
|
252
|
-
position: relative;
|
|
253
|
-
display: flex;
|
|
254
|
-
align-items: center;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
.account-menu-trigger {
|
|
258
|
-
display: inline-flex;
|
|
259
|
-
align-items: center;
|
|
260
|
-
gap: 0.625rem;
|
|
261
|
-
min-height: 2.5rem;
|
|
262
|
-
border: 1px solid var(--header-menu-loggedin-bg);
|
|
263
|
-
border-radius: 999px;
|
|
264
|
-
background: var(--header-menu-loggedin-bg);
|
|
265
|
-
color: var(--header-button-text);
|
|
266
|
-
cursor: pointer;
|
|
267
|
-
font: inherit;
|
|
268
|
-
line-height: 1;
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
:host([layout='mobile']) .account-menu-trigger {
|
|
272
|
-
gap: 0;
|
|
273
|
-
min-height: auto;
|
|
274
|
-
padding: 0;
|
|
275
|
-
border: 1.5px solid var(--header-border);
|
|
276
|
-
background: var(--header-menu-loggedin-bg);
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
:host([layout='mobile']) .account-menu-trigger-label {
|
|
280
|
-
display: none;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
.account-menu-trigger:disabled {
|
|
284
|
-
cursor: default;
|
|
285
|
-
opacity: 0.7;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
.account-menu-trigger-icon {
|
|
289
|
-
width: 1rem;
|
|
290
|
-
height: 1rem;
|
|
291
|
-
object-fit: contain;
|
|
292
|
-
flex-shrink: 0;
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
.account-avatar,
|
|
296
|
-
.account-menu-avatar {
|
|
297
|
-
display: inline-flex;
|
|
298
|
-
align-items: center;
|
|
299
|
-
justify-content: center;
|
|
300
|
-
flex-shrink: 0;
|
|
301
|
-
overflow: hidden;
|
|
302
|
-
background: color-mix(in srgb, var(--header-bg) 18%, #ded8e7 82%);
|
|
303
|
-
color: var(--header-button-text);
|
|
304
|
-
font-size: 0.75rem;
|
|
305
|
-
font-weight: 600;
|
|
306
|
-
text-transform: uppercase;
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
.account-avatar {
|
|
310
|
-
width: 1.75rem;
|
|
311
|
-
height: 1.75rem;
|
|
312
|
-
border-radius: 999px;
|
|
313
|
-
border: 1.5px solid var(--header-border);
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
.account-menu-avatar {
|
|
317
|
-
width: 2rem;
|
|
318
|
-
height: 2rem;
|
|
319
|
-
border-radius: 0.5rem;
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
.account-avatar img,
|
|
323
|
-
.account-menu-avatar img {
|
|
324
|
-
width: 100%;
|
|
325
|
-
height: 100%;
|
|
326
|
-
object-fit: cover;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
.account-avatar-img {
|
|
330
|
-
width: 1.75rem;
|
|
331
|
-
height: 1.75rem;
|
|
332
|
-
border-radius: 999px;
|
|
333
|
-
object-fit: cover;
|
|
334
|
-
background-color: var(--header-border);
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
.account-dropdown {
|
|
338
|
-
position: absolute;
|
|
339
|
-
top: calc(100% + 0.9rem);
|
|
340
|
-
right: 0;
|
|
341
|
-
min-width: 15rem;
|
|
342
|
-
padding: 0.5rem;
|
|
343
|
-
background: var(--header-button-bg);
|
|
344
|
-
border: 1px solid var(--header-border);
|
|
345
|
-
border-radius: var(--header-border-radius);
|
|
346
|
-
box-shadow: var(--header-shadow);
|
|
347
|
-
z-index: 10;
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
.account-dropdown[hidden] {
|
|
351
|
-
display: none;
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
.account-menu-list {
|
|
355
|
-
list-style: none;
|
|
356
|
-
margin: 0;
|
|
357
|
-
padding: 0;
|
|
358
|
-
display: flex;
|
|
359
|
-
flex-direction: column;
|
|
360
|
-
gap: 0.25rem;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
.account-menu-item-link,
|
|
364
|
-
.account-menu-item-button,
|
|
365
|
-
::slotted([slot='account-menu']) {
|
|
366
|
-
display: flex;
|
|
367
|
-
align-items: center;
|
|
368
|
-
gap: 0.625rem;
|
|
369
|
-
width: 100%;
|
|
370
|
-
box-sizing: border-box;
|
|
371
|
-
color: var(--header-link);
|
|
372
|
-
text-decoration: none;
|
|
373
|
-
background: transparent;
|
|
374
|
-
border: 1px solid transparent;
|
|
375
|
-
border-radius: 10px;
|
|
376
|
-
padding: 0.5rem;
|
|
377
|
-
cursor: pointer;
|
|
378
|
-
font: inherit;
|
|
379
|
-
text-align: left;
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
.account-menu-item-link:hover,
|
|
383
|
-
.account-menu-item-button:hover {
|
|
384
|
-
color: var(--header-link);
|
|
385
|
-
background: var(--header-menu-item-hover);
|
|
386
|
-
border-color: var(--header-menu-item-hover);
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
.account-menu-item-link:active,
|
|
390
|
-
.account-menu-item-button:active {
|
|
391
|
-
color: var(--header-link);
|
|
392
|
-
background: var(--header-menu-item-selected);
|
|
393
|
-
border-color: var(--header-menu-item-selected);
|
|
394
|
-
transform: translateY(1px);
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
.account-switch {
|
|
398
|
-
display: block;
|
|
399
|
-
width: 100%;
|
|
400
|
-
color: var(--header-menu-text);
|
|
401
|
-
text-align: left;
|
|
402
|
-
text-transform: uppercase;
|
|
403
|
-
font-size: 80%;
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
.dropdown-menu-separator {
|
|
407
|
-
display: block;
|
|
408
|
-
width: calc(100% + 1rem);
|
|
409
|
-
margin: 0.5rem -0.5rem;
|
|
410
|
-
border: 0;
|
|
411
|
-
border-top: 1px solid var(--header-border);
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
.account-menu-copy {
|
|
415
|
-
display: flex;
|
|
416
|
-
flex-direction: column;
|
|
417
|
-
min-width: 0;
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
.account-menu-label {
|
|
421
|
-
color: var(--header-button-text);
|
|
422
|
-
overflow: hidden;
|
|
423
|
-
text-overflow: ellipsis;
|
|
424
|
-
white-space: nowrap;
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
.account-menu-webid {
|
|
428
|
-
color: var(--header-button-detail-text);
|
|
429
|
-
font-size: 0.5rem;
|
|
430
|
-
overflow: hidden;
|
|
431
|
-
text-overflow: ellipsis;
|
|
432
|
-
white-space: nowrap;
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
.help-menu-container {
|
|
436
|
-
position: relative;
|
|
437
|
-
display: flex;
|
|
438
|
-
align-items: center;
|
|
439
|
-
background: transparent;
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
.help-menu-trigger {
|
|
443
|
-
display: inline-flex;
|
|
444
|
-
align-items: center;
|
|
445
|
-
justify-content: center;
|
|
446
|
-
padding: 0;
|
|
447
|
-
border: 0;
|
|
448
|
-
background: transparent;
|
|
449
|
-
cursor: pointer;
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
.help-menu-trigger:disabled {
|
|
453
|
-
cursor: default;
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
.help-dropdown {
|
|
457
|
-
position: absolute;
|
|
458
|
-
top: calc(100% + 0.9rem);
|
|
459
|
-
right: 0;
|
|
460
|
-
min-width: 12rem;
|
|
461
|
-
padding: 0.5rem;
|
|
462
|
-
background: var(--header-button-bg);
|
|
463
|
-
border: 1px solid var(--header-border);
|
|
464
|
-
border-radius: var(--header-border-radius);
|
|
465
|
-
box-shadow: var(--header-shadow);
|
|
466
|
-
z-index: 10;
|
|
467
|
-
}
|
|
468
|
-
|
|
469
|
-
.help-dropdown[hidden] {
|
|
470
|
-
display: none;
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
.help-dropdown-content {
|
|
474
|
-
display: flex;
|
|
475
|
-
flex-direction: column;
|
|
476
|
-
gap: 0.25rem;
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
.help-menu-list {
|
|
480
|
-
list-style: none;
|
|
481
|
-
margin: 0;
|
|
482
|
-
padding: 0;
|
|
483
|
-
display: flex;
|
|
484
|
-
flex-direction: column;
|
|
485
|
-
gap: 0.25rem;
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
.help-menu-list a,
|
|
489
|
-
.help-menu-list button,
|
|
490
|
-
::slotted([slot='help-menu']) {
|
|
491
|
-
display: block;
|
|
492
|
-
width: 100%;
|
|
493
|
-
box-sizing: border-box;
|
|
494
|
-
color: var(--header-link);
|
|
495
|
-
text-decoration: none;
|
|
496
|
-
background: transparent;
|
|
497
|
-
border: 1px solid transparent;
|
|
498
|
-
border-radius: 4px;
|
|
499
|
-
padding: 0.375rem 0.5rem;
|
|
500
|
-
cursor: pointer;
|
|
501
|
-
font: inherit;
|
|
502
|
-
text-align: left;
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
.help-menu-list a:hover,
|
|
506
|
-
.help-menu-list button:hover {
|
|
507
|
-
color: var(--header-link);
|
|
508
|
-
background: var(--header-menu-item-hover);
|
|
509
|
-
border-color: var(--header-menu-item-hover);
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
.help-menu-list a:active,
|
|
513
|
-
.help-menu-list button:active {
|
|
514
|
-
color: var(--header-link);
|
|
515
|
-
background: var(--header-menu-item-selected);
|
|
516
|
-
border-color: var(--header-menu-item-selected);
|
|
517
|
-
transform: translateY(1px);
|
|
518
|
-
}
|
|
519
|
-
|
|
520
|
-
::slotted(a), ::slotted(button) {
|
|
521
|
-
color: var(--header-link);
|
|
522
|
-
text-decoration: none;
|
|
523
|
-
background: var(--header-button-bg);
|
|
524
|
-
border: 1px solid var(--header-border);
|
|
525
|
-
border-radius: 4px;
|
|
526
|
-
padding: 0.25rem 0.5rem;
|
|
527
|
-
cursor: pointer;
|
|
528
|
-
font: inherit;
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
.help-icon {
|
|
532
|
-
width: 35px;
|
|
533
|
-
height: 35px;
|
|
534
|
-
cursor: pointer;
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
.help-text {
|
|
538
|
-
color: var(--header-text, #ffffff);
|
|
539
|
-
font: inherit;
|
|
540
|
-
}
|
|
541
|
-
|
|
542
|
-
.logout-action-icon {
|
|
543
|
-
width: 16px;
|
|
544
|
-
height: 16px;
|
|
545
|
-
display: inline-block;
|
|
546
|
-
object-fit: contain;
|
|
547
|
-
margin-right: 0.5rem;
|
|
548
|
-
}
|
|
549
|
-
`;
|
|
550
|
-
_refreshPromise = null;
|
|
551
|
-
handleAuthSessionChange = () => {
|
|
552
|
-
this.refreshAuthStateFromSession().catch(() => {});
|
|
553
|
-
};
|
|
554
|
-
constructor() {
|
|
555
|
-
super(), this.logo = u, this.helpIcon = l, this.layout = "desktop", this.theme = "light", this.brandLink = "#", this.authState = "logged-out", this.loginAction = {
|
|
556
|
-
label: "Log In",
|
|
557
|
-
action: "login"
|
|
558
|
-
}, this.signUpAction = {
|
|
559
|
-
label: "Sign Up",
|
|
560
|
-
action: "sign-up",
|
|
561
|
-
url: d
|
|
562
|
-
}, this.accountMenu = [], this.logoutLabel = "Log Out", this.logoutIcon = "", this.accountIcon = "▼", this.accountAvatar = "", this.accountAvatarFallback = "", this.loginIcon = "", this.signUpIcon = "", this.helpMenuList = [], this.accountMenuOpen = !1, this.helpMenuOpen = !1, this.hasSlottedAccountMenu = !1, this.hasSlottedHelpMenu = !1, this.authResolved = !1;
|
|
563
|
-
}
|
|
564
|
-
connectedCallback() {
|
|
565
|
-
super.connectedCallback(), document.addEventListener("click", this.handleDocumentClick), window.addEventListener("keydown", this.handleWindowKeydown), typeof n.events?.on == "function" && (n.events.on("login", this.handleAuthSessionChange), n.events.on("logout", this.handleAuthSessionChange), n.events.on("sessionRestore", this.handleAuthSessionChange)), this.refreshAuthStateFromSession().catch(() => {});
|
|
566
|
-
}
|
|
567
|
-
disconnectedCallback() {
|
|
568
|
-
document.removeEventListener("click", this.handleDocumentClick), window.removeEventListener("keydown", this.handleWindowKeydown), typeof n.events?.off == "function" && (n.events.off("login", this.handleAuthSessionChange), n.events.off("logout", this.handleAuthSessionChange), n.events.off("sessionRestore", this.handleAuthSessionChange)), super.disconnectedCallback();
|
|
569
|
-
}
|
|
570
|
-
async refreshAuthStateFromSession() {
|
|
571
|
-
this._refreshPromise ||= (async () => {
|
|
572
|
-
try {
|
|
573
|
-
await r.checkUser(), r.currentUser() || await r.checkUser();
|
|
574
|
-
} catch {}
|
|
575
|
-
})();
|
|
576
|
-
try {
|
|
577
|
-
await this._refreshPromise;
|
|
578
|
-
} finally {
|
|
579
|
-
this._refreshPromise = null;
|
|
580
|
-
}
|
|
581
|
-
this.authState = r.currentUser() ? "logged-in" : "logged-out", this.authResolved = !0;
|
|
582
|
-
}
|
|
583
|
-
handleHelpMenuClick(e, t) {
|
|
584
|
-
if (t.preventDefault(), this.helpMenuOpen = !1, this.dispatchEvent(new CustomEvent("help-menu-select", {
|
|
585
|
-
detail: e,
|
|
586
|
-
bubbles: !0,
|
|
587
|
-
composed: !0
|
|
588
|
-
})), e.url) {
|
|
589
|
-
let t = e.target || "_blank", n = t === "_blank" ? "noopener,noreferrer" : void 0;
|
|
590
|
-
window.open(e.url, t, n);
|
|
591
|
-
}
|
|
592
|
-
}
|
|
593
|
-
handleAccountMenuClick(e) {
|
|
594
|
-
this.accountMenuOpen = !1, this.dispatchEvent(new CustomEvent("account-menu-select", {
|
|
595
|
-
detail: e,
|
|
596
|
-
bubbles: !0,
|
|
597
|
-
composed: !0
|
|
598
|
-
}));
|
|
599
|
-
}
|
|
600
|
-
handleDocumentClick = (e) => {
|
|
601
|
-
e.composedPath().includes(this) || (this.accountMenuOpen = !1, this.helpMenuOpen = !1);
|
|
602
|
-
};
|
|
603
|
-
handleWindowKeydown = (e) => {
|
|
604
|
-
e.key === "Escape" && (this.accountMenuOpen || this.helpMenuOpen) && (this.accountMenuOpen = !1, this.helpMenuOpen = !1);
|
|
605
|
-
};
|
|
606
|
-
handleAccountSlotChange(e) {
|
|
607
|
-
let t = e.target;
|
|
608
|
-
this.hasSlottedAccountMenu = t.assignedElements({ flatten: !0 }).length > 0;
|
|
609
|
-
}
|
|
610
|
-
handleHelpSlotChange(e) {
|
|
611
|
-
let t = e.target;
|
|
612
|
-
this.hasSlottedHelpMenu = t.assignedElements({ flatten: !0 }).length > 0;
|
|
613
|
-
}
|
|
614
|
-
toggleAccountMenu(e) {
|
|
615
|
-
e.preventDefault(), this.hasAccountMenuItems() && (this.helpMenuOpen = !1, this.accountMenuOpen = !this.accountMenuOpen);
|
|
616
|
-
}
|
|
617
|
-
toggleHelpMenu(e) {
|
|
618
|
-
e.preventDefault(), this.hasHelpMenuItems() && (this.accountMenuOpen = !1, this.helpMenuOpen = !this.helpMenuOpen);
|
|
619
|
-
}
|
|
620
|
-
hasAccountMenuItems() {
|
|
621
|
-
return !!(this.accountMenu?.length || this.hasSlottedAccountMenu || this.logoutLabel);
|
|
622
|
-
}
|
|
623
|
-
hasHelpMenuItems() {
|
|
624
|
-
return !!(this.helpMenuList?.length || this.hasSlottedHelpMenu);
|
|
625
|
-
}
|
|
626
|
-
shouldRenderHelpMenu() {
|
|
627
|
-
return this.layout !== "mobile" && this.hasHelpMenuItems();
|
|
628
|
-
}
|
|
629
|
-
renderLoggedInAvatar(e, t = "account-avatar") {
|
|
630
|
-
let n = !!e, r = n ? e : this.accountAvatarFallback || f, i = n ? "Profile Avatar" : "Default Avatar";
|
|
631
|
-
return this.layout === "mobile" && t === "account-avatar" ? s`<img class="account-avatar-img" src="${r}" alt="${i}" />` : s`
|
|
632
|
-
<span class="${t}" aria-hidden="true">
|
|
633
|
-
<img src="${r}" alt="${i}" />
|
|
634
|
-
</span>
|
|
635
|
-
`;
|
|
636
|
-
}
|
|
637
|
-
renderLoggedOutActions() {
|
|
638
|
-
return s`
|
|
639
|
-
<div class="auth-actions" part="auth-actions">
|
|
640
|
-
<slot name="login-action">
|
|
641
|
-
<solid-ui-login-button
|
|
642
|
-
label="${this.loginAction.label}"
|
|
643
|
-
icon=${c(this.layout === "mobile" ? void 0 : this.loginIcon || this.loginAction.icon)}
|
|
644
|
-
layout="${this.layout}"
|
|
645
|
-
theme="${this.theme}"
|
|
646
|
-
part="login-action"
|
|
647
|
-
@login-success="${() => this.handleLoginSuccess()}"
|
|
648
|
-
></solid-ui-login-button>
|
|
649
|
-
</slot>
|
|
650
|
-
<slot name="sign-up-action">
|
|
651
|
-
<solid-ui-signup-button
|
|
652
|
-
label="${this.signUpAction.label}"
|
|
653
|
-
signup-url="${c(this.signUpAction.url)}"
|
|
654
|
-
layout="${this.layout}"
|
|
655
|
-
.icon=${c(this.layout === "mobile" ? void 0 : this.signUpIcon || this.signUpAction.icon)}
|
|
656
|
-
theme="${this.theme}"
|
|
657
|
-
part="sign-up-action"
|
|
658
|
-
></solid-ui-signup-button>
|
|
659
|
-
</slot>
|
|
660
|
-
</div>
|
|
661
|
-
`;
|
|
662
|
-
}
|
|
663
|
-
async handleLoginSuccess() {
|
|
664
|
-
await this.refreshAuthStateFromSession(), this.dispatchEvent(new CustomEvent("auth-action-select", {
|
|
665
|
-
detail: { role: "login" },
|
|
666
|
-
bubbles: !0,
|
|
667
|
-
composed: !0
|
|
668
|
-
}));
|
|
669
|
-
}
|
|
670
|
-
async handleLogout() {
|
|
671
|
-
this.accountMenuOpen = !1;
|
|
672
|
-
let e = window.localStorage.getItem("loginIssuer") || "";
|
|
673
|
-
try {
|
|
674
|
-
await n.logout();
|
|
675
|
-
} catch {}
|
|
676
|
-
await p(), !await i({
|
|
677
|
-
issuer: e,
|
|
678
|
-
postLogoutRedirectPath: "/"
|
|
679
|
-
}) && (await this.refreshAuthStateFromSession(), this.dispatchEvent(new CustomEvent("logout-select", {
|
|
680
|
-
detail: { role: "logout" },
|
|
681
|
-
bubbles: !0,
|
|
682
|
-
composed: !0
|
|
683
|
-
})));
|
|
684
|
-
}
|
|
685
|
-
renderAccountMenuItem(e) {
|
|
686
|
-
let t = s`
|
|
687
|
-
${this.renderLoggedInAvatar(e.avatar, "account-menu-avatar")}
|
|
688
|
-
<span class="account-menu-copy">
|
|
689
|
-
<span class="account-menu-label">${e.label}</span>
|
|
690
|
-
${e.webid && this.layout !== "mobile" ? s`<span class="account-menu-webid">${e.webid}</span>` : ""}
|
|
691
|
-
</span>
|
|
692
|
-
`;
|
|
693
|
-
return e.url ? s`
|
|
694
|
-
<a
|
|
695
|
-
class="account-menu-item-link"
|
|
696
|
-
href="${e.url}"
|
|
697
|
-
@click="${() => this.handleAccountMenuClick(e)}"
|
|
698
|
-
part="account-menu-item"
|
|
699
|
-
role="menuitem"
|
|
700
|
-
>
|
|
701
|
-
${t}
|
|
702
|
-
</a>
|
|
703
|
-
` : s`
|
|
704
|
-
<button
|
|
705
|
-
class="account-menu-item-button"
|
|
706
|
-
type="button"
|
|
707
|
-
@click="${() => this.handleAccountMenuClick(e)}"
|
|
708
|
-
part="account-menu-item"
|
|
709
|
-
role="menuitem"
|
|
710
|
-
>
|
|
711
|
-
${t}
|
|
712
|
-
</button>
|
|
713
|
-
`;
|
|
714
|
-
}
|
|
715
|
-
renderLoggedInActions() {
|
|
716
|
-
return s`
|
|
717
|
-
<div class="account-menu-container" part="account-menu-container">
|
|
718
|
-
<slot name="account-trigger">
|
|
719
|
-
<button
|
|
720
|
-
id="accountMenuTrigger"
|
|
721
|
-
class="account-menu-trigger"
|
|
722
|
-
type="button"
|
|
723
|
-
aria-haspopup="menu"
|
|
724
|
-
aria-expanded="${this.accountMenuOpen ? "true" : "false"}"
|
|
725
|
-
?disabled="${!this.hasAccountMenuItems()}"
|
|
726
|
-
@click="${(e) => this.toggleAccountMenu(e)}"
|
|
727
|
-
part="account-menu-trigger"
|
|
728
|
-
>
|
|
729
|
-
${this.renderLoggedInAvatar(this.accountAvatar)}
|
|
730
|
-
${this.layout !== "mobile" && this.accountIcon ? s`
|
|
731
|
-
<img class="account-menu-trigger-icon" src="${this.accountIcon}" alt="" aria-hidden="true" />` : ""}
|
|
732
|
-
</button>
|
|
733
|
-
</slot>
|
|
734
|
-
|
|
735
|
-
<nav
|
|
736
|
-
id="accountMenu"
|
|
737
|
-
class="account-dropdown"
|
|
738
|
-
role="menu"
|
|
739
|
-
?inert="${!this.accountMenuOpen || !this.hasAccountMenuItems()}"
|
|
740
|
-
?hidden="${!this.accountMenuOpen || !this.hasAccountMenuItems()}"
|
|
741
|
-
part="account-dropdown"
|
|
742
|
-
>
|
|
743
|
-
<slot name="account-switch" class="account-switch">Switch account</slot>
|
|
744
|
-
<hr class="dropdown-menu-separator" />
|
|
745
|
-
<slot name="account-menu" @slotchange="${(e) => this.handleAccountSlotChange(e)}"></slot>
|
|
746
|
-
${this.accountMenu && this.accountMenu.length ? s`
|
|
747
|
-
<ul class="account-menu-list">
|
|
748
|
-
${this.accountMenu.map((e) => s`
|
|
749
|
-
<li>${this.renderAccountMenuItem(e)}</li>
|
|
750
|
-
`)}
|
|
751
|
-
</ul>
|
|
752
|
-
` : ""}
|
|
753
|
-
${this.logoutLabel ? s`
|
|
754
|
-
<hr class="dropdown-menu-separator" />
|
|
755
|
-
<button
|
|
756
|
-
class="account-menu-item-button"
|
|
757
|
-
type="button"
|
|
758
|
-
@click="${() => this.handleLogout()}"
|
|
759
|
-
part="logout-action"
|
|
760
|
-
role="menuitem"
|
|
761
|
-
>
|
|
762
|
-
${this.logoutIcon && this.layout !== "mobile" ? s`<img class="logout-action-icon" src="${this.logoutIcon}" alt="" aria-hidden="true" part="logout-action-icon" />` : ""}
|
|
763
|
-
${this.logoutLabel}
|
|
764
|
-
</button>
|
|
765
|
-
` : ""}
|
|
766
|
-
</nav>
|
|
767
|
-
</div>
|
|
768
|
-
`;
|
|
769
|
-
}
|
|
770
|
-
renderUserArea() {
|
|
771
|
-
return t.DESIGN_SYSTEM_HEADER_ACCOUNT ? s`
|
|
772
|
-
<solid-ui-provider>
|
|
773
|
-
<solid-ui-account></solid-ui-account>
|
|
774
|
-
</solid-ui-provider>
|
|
775
|
-
` : this.authResolved ? this.authState === "logged-out" ? this.renderLoggedOutActions() : this.renderLoggedInActions() : s`<div class="auth-actions" part="auth-actions"></div>`;
|
|
776
|
-
}
|
|
777
|
-
firstUpdated() {
|
|
778
|
-
let e = this.shadowRoot?.getElementById("brandLink");
|
|
779
|
-
e && e.classList.toggle("brand-not-displayed", this.layout === "mobile");
|
|
780
|
-
}
|
|
781
|
-
updated(e) {
|
|
782
|
-
if (e.has("layout")) {
|
|
783
|
-
let e = this.shadowRoot?.getElementById("brandLink");
|
|
784
|
-
e && e.classList.toggle("brand-not-displayed", this.layout === "mobile");
|
|
785
|
-
}
|
|
786
|
-
}
|
|
787
|
-
render() {
|
|
788
|
-
return s`
|
|
789
|
-
<div class="headerInner">
|
|
790
|
-
<slot name="navigation-toggle"></slot>
|
|
791
|
-
<a
|
|
792
|
-
id="brandLink"
|
|
793
|
-
class="brand"
|
|
794
|
-
href="${this.brandLink}"
|
|
795
|
-
part="brand"
|
|
796
|
-
>
|
|
797
|
-
<img id="brandImg" src="${this.logo}" alt="Logo" part="logo" />
|
|
798
|
-
</a>
|
|
799
|
-
|
|
800
|
-
<div class="menu" part="menu">
|
|
801
|
-
${this.renderUserArea()}
|
|
802
|
-
|
|
803
|
-
${this.shouldRenderHelpMenu() ? s`
|
|
804
|
-
<div class="header-menu-separator" />` : ""}
|
|
805
|
-
|
|
806
|
-
${this.shouldRenderHelpMenu() ? s`
|
|
807
|
-
<div class="help-menu-container" part="help-menu-container">
|
|
808
|
-
<button
|
|
809
|
-
id="helpMenuTrigger"
|
|
810
|
-
class="help-menu-trigger"
|
|
811
|
-
type="button"
|
|
812
|
-
aria-haspopup="menu"
|
|
813
|
-
aria-expanded="${this.helpMenuOpen ? "true" : "false"}"
|
|
814
|
-
?disabled="${!this.hasHelpMenuItems()}"
|
|
815
|
-
@click="${(e) => this.toggleHelpMenu(e)}"
|
|
816
|
-
part="help-menu-trigger"
|
|
817
|
-
>
|
|
818
|
-
${this.helpIcon ? s`<img id="helpIcon" class="help-icon" src="${this.helpIcon}" alt="Help" part="help-icon" />` : s`<span class="help-text" part="help-text">Help</span>`}
|
|
819
|
-
</button>
|
|
820
|
-
|
|
821
|
-
<nav
|
|
822
|
-
id="helpMenu"
|
|
823
|
-
class="help-dropdown"
|
|
824
|
-
role="menu"
|
|
825
|
-
?inert="${!this.helpMenuOpen || !this.hasHelpMenuItems()}"
|
|
826
|
-
?hidden="${!this.helpMenuOpen || !this.hasHelpMenuItems()}"
|
|
827
|
-
part="help-dropdown"
|
|
828
|
-
>
|
|
829
|
-
<div class="help-dropdown-content" @click="${() => {
|
|
830
|
-
this.helpMenuOpen = !1;
|
|
831
|
-
}}">
|
|
832
|
-
<slot name="help-menu" @slotchange="${(e) => this.handleHelpSlotChange(e)}"></slot>
|
|
833
|
-
${this.helpMenuList && this.helpMenuList.length ? s`
|
|
834
|
-
<ul class="help-menu-list">
|
|
835
|
-
${this.helpMenuList.map((e) => s`
|
|
836
|
-
<li>
|
|
837
|
-
${e.url ? s`
|
|
838
|
-
<a
|
|
839
|
-
href="${e.url}"
|
|
840
|
-
target="${e.target || "_blank"}"
|
|
841
|
-
rel="${c((e.target || "_blank") === "_blank" ? "noopener noreferrer" : void 0)}"
|
|
842
|
-
@click="${(t) => this.handleHelpMenuClick(e, t)}"
|
|
843
|
-
part="help-menu-item"
|
|
844
|
-
role="menuitem"
|
|
845
|
-
>
|
|
846
|
-
${e.label}
|
|
847
|
-
</a>
|
|
848
|
-
` : s`
|
|
849
|
-
<button
|
|
850
|
-
type="button"
|
|
851
|
-
@click="${(t) => this.handleHelpMenuClick(e, t)}"
|
|
852
|
-
part="help-menu-item"
|
|
853
|
-
role="menuitem"
|
|
854
|
-
>
|
|
855
|
-
${e.label}
|
|
856
|
-
</button>
|
|
857
|
-
`}
|
|
858
|
-
</li>
|
|
859
|
-
`)}
|
|
860
|
-
</ul>
|
|
861
|
-
` : ""}
|
|
862
|
-
</div>
|
|
863
|
-
</nav>
|
|
864
|
-
</div>` : ""}
|
|
865
|
-
</div>
|
|
866
|
-
</div>
|
|
867
|
-
`;
|
|
868
|
-
}
|
|
869
|
-
};
|
|
870
|
-
//#endregion
|
|
871
|
-
export { m as Header };
|
|
872
|
-
|
|
873
|
-
//# sourceMappingURL=Header.esm.js.map
|