@campminder/components 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +198 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +11 -0
- package/dist/menu-tree.upstream.test.d.ts +1 -0
- package/dist/property-B5JHHBCF.js +603 -0
- package/dist/side-nav/MegaMenu.d.ts +50 -0
- package/dist/side-nav/MegaMenu.styles.d.ts +33 -0
- package/dist/side-nav/SideNav.d.ts +89 -0
- package/dist/side-nav/SideNav.styles.d.ts +42 -0
- package/dist/side-nav/Utils/helpers.d.ts +57 -0
- package/dist/side-nav/assets/MegaMenuIcons/AccountsGrayIcon.d.ts +2 -0
- package/dist/side-nav/assets/MegaMenuIcons/AdminGrayIcon.d.ts +2 -0
- package/dist/side-nav/assets/MegaMenuIcons/AlumniGrayIcon.d.ts +2 -0
- package/dist/side-nav/assets/MegaMenuIcons/CampInTouchGrayIcon.d.ts +2 -0
- package/dist/side-nav/assets/MegaMenuIcons/CamperGrayIcon.d.ts +2 -0
- package/dist/side-nav/assets/MegaMenuIcons/CommunicationGrayIcon.d.ts +2 -0
- package/dist/side-nav/assets/MegaMenuIcons/DefaultMMIcon.d.ts +2 -0
- package/dist/side-nav/assets/MegaMenuIcons/FinancialGrayIcon.d.ts +2 -0
- package/dist/side-nav/assets/MegaMenuIcons/MedicalGrayIcon.d.ts +2 -0
- package/dist/side-nav/assets/MegaMenuIcons/OpenInNewIcon.d.ts +2 -0
- package/dist/side-nav/assets/MegaMenuIcons/ReportsGrayIcon.d.ts +2 -0
- package/dist/side-nav/assets/MegaMenuIcons/SchedulingGrayIcon.d.ts +2 -0
- package/dist/side-nav/assets/MegaMenuIcons/StaffGrayIcon.d.ts +2 -0
- package/dist/side-nav/assets/MegaMenuIcons/TravelGrayIcon.d.ts +2 -0
- package/dist/side-nav/assets/MegaMenuIcons/index.d.ts +16 -0
- package/dist/side-nav/assets/SideNavIcons/AccountsIcon.d.ts +2 -0
- package/dist/side-nav/assets/SideNavIcons/AdminIcon.d.ts +2 -0
- package/dist/side-nav/assets/SideNavIcons/AlumniIcon.d.ts +2 -0
- package/dist/side-nav/assets/SideNavIcons/CampInTouch.d.ts +2 -0
- package/dist/side-nav/assets/SideNavIcons/CamperIcon.d.ts +2 -0
- package/dist/side-nav/assets/SideNavIcons/ChevronRightIcon.d.ts +2 -0
- package/dist/side-nav/assets/SideNavIcons/CloseIcon.d.ts +2 -0
- package/dist/side-nav/assets/SideNavIcons/CommunicationIcon.d.ts +2 -0
- package/dist/side-nav/assets/SideNavIcons/DefaultNavIcon.d.ts +2 -0
- package/dist/side-nav/assets/SideNavIcons/FinancialIcon.d.ts +2 -0
- package/dist/side-nav/assets/SideNavIcons/HomeIcon.d.ts +2 -0
- package/dist/side-nav/assets/SideNavIcons/MedicalIcon.d.ts +2 -0
- package/dist/side-nav/assets/SideNavIcons/MenuCollapseIcon.d.ts +2 -0
- package/dist/side-nav/assets/SideNavIcons/MenuIcon.d.ts +10 -0
- package/dist/side-nav/assets/SideNavIcons/ReportsIcon.d.ts +2 -0
- package/dist/side-nav/assets/SideNavIcons/SchedulingIcon.d.ts +2 -0
- package/dist/side-nav/assets/SideNavIcons/StaffIcon.d.ts +2 -0
- package/dist/side-nav/assets/SideNavIcons/TravelIcon.d.ts +2 -0
- package/dist/side-nav/assets/SideNavIcons/index.d.ts +20 -0
- package/dist/side-nav/icon-map.d.ts +17 -0
- package/dist/side-nav/index.d.ts +5 -0
- package/dist/side-nav/mega-menu-icon-map.d.ts +20 -0
- package/dist/side-nav/mega-menu-layout.d.ts +9 -0
- package/dist/side-nav/mega-menu.test.d.ts +1 -0
- package/dist/side-nav/side-nav.test.d.ts +1 -0
- package/dist/side-nav.d.ts +1 -0
- package/dist/side-nav.js +1198 -0
- package/dist/state-Ns9O6R8g.js +12 -0
- package/dist/super-user-banner/SuperUserBanner.d.ts +43 -0
- package/dist/super-user-banner/SuperUserBanner.styles.d.ts +21 -0
- package/dist/super-user-banner/index.d.ts +2 -0
- package/dist/super-user-banner/super-user-banner.test.d.ts +1 -0
- package/dist/super-user-banner.d.ts +1 -0
- package/dist/super-user-banner.js +178 -0
- package/dist/top-bar/TopBar.d.ts +39 -0
- package/dist/top-bar/TopBar.styles.d.ts +1 -0
- package/dist/top-bar/Utils/helpers.d.ts +3 -0
- package/dist/top-bar/Utils/safe-url.d.ts +56 -0
- package/dist/top-bar/Utils/safe-url.test.d.ts +1 -0
- package/dist/top-bar/Utils/types.d.ts +50 -0
- package/dist/top-bar/assets/TopBarIcons/CheckIcon.d.ts +2 -0
- package/dist/top-bar/assets/TopBarIcons/CrossIcon.d.ts +2 -0
- package/dist/top-bar/assets/TopBarIcons/DropDownIcon.d.ts +2 -0
- package/dist/top-bar/assets/TopBarIcons/InfoIcon.d.ts +2 -0
- package/dist/top-bar/assets/TopBarIcons/OpenInNewIcon.d.ts +2 -0
- package/dist/top-bar/assets/TopBarIcons/index.d.ts +7 -0
- package/dist/top-bar/index.d.ts +3 -0
- package/dist/top-bar/top-bar.test.d.ts +1 -0
- package/dist/top-bar.d.ts +1 -0
- package/dist/top-bar.js +615 -0
- package/package.json +52 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* `<cm-super-user-banner>` — the impersonation / non-production banner.
|
|
5
|
+
*
|
|
6
|
+
* Ported Floor 8, 2026-09-08, from core-js's `Banner.ts` (`<super-user-banner>`).
|
|
7
|
+
* Renamed per the 2026-09-02 amendment: nothing in this repo consumes what upstream's
|
|
8
|
+
* build serves, so the port is free to take this repo's naming. The old tag and
|
|
9
|
+
* attribute names are recorded in the package `README.md` for whoever cuts the monolith
|
|
10
|
+
* over.
|
|
11
|
+
*
|
|
12
|
+
* What did not come across, and why, is in `SuperUserBanner.styles.ts` — the fixed
|
|
13
|
+
* positioning and the `ResizeObserver`, both because the shell owns layout.
|
|
14
|
+
*/
|
|
15
|
+
export declare class SuperUserBanner extends LitElement {
|
|
16
|
+
static readonly styles: import('lit').CSSResult;
|
|
17
|
+
client: string;
|
|
18
|
+
superUser: string;
|
|
19
|
+
activeEnvironment: string;
|
|
20
|
+
/**
|
|
21
|
+
* Which badge the environment gets, of three.
|
|
22
|
+
*
|
|
23
|
+
* **Upstream had two and failed open**: anything that was not exactly `staging` got
|
|
24
|
+
* the calm `local` badge. That is the wrong direction for a status indicator, and it
|
|
25
|
+
* was reachable rather than theoretical — the host emits this banner whenever
|
|
26
|
+
* `IsStaging || IsDevMachine || user is ICMMUser`, so a super-user impersonating
|
|
27
|
+
* someone **in production** gets it with `activeEnvironment="production"`, and
|
|
28
|
+
* upstream rendered that identically to a laptop. `undefined` — what
|
|
29
|
+
* `GetEnvironmentName()` returns when it cannot identify the host — did the same.
|
|
30
|
+
*
|
|
31
|
+
* So the unrecognised case now fails **loud**: only a known-quiet name gets the quiet
|
|
32
|
+
* badge, and everything else lands on `alert`. A new test tier added upstream will
|
|
33
|
+
* therefore over-warn until it is added to the pattern above, which is the failure
|
|
34
|
+
* direction to prefer for a banner whose entire job is to be noticed.
|
|
35
|
+
*/
|
|
36
|
+
private get environmentBadgeClass();
|
|
37
|
+
render(): import('lit').TemplateResult<1>;
|
|
38
|
+
}
|
|
39
|
+
declare global {
|
|
40
|
+
interface HTMLElementTagNameMap {
|
|
41
|
+
'cm-super-user-banner': SuperUserBanner;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Two things upstream did are gone, and the reasons are recorded once each — here,
|
|
3
|
+
* because this file is where the replacement lives. Everything else that references
|
|
4
|
+
* them links to this file rather than restating it.
|
|
5
|
+
*
|
|
6
|
+
* **`position: fixed; top: 0; left: 0; width: 100%`.** It took the banner out of flow
|
|
7
|
+
* entirely, which is why `ReactAppController` also has to emit a `hasSuperUserBanner`
|
|
8
|
+
* class and prepend container markup — a page must be pushed down behind an element
|
|
9
|
+
* occupying no space. The shell gives the banner an `auto` grid row, so declaring a
|
|
10
|
+
* height is now the whole contract. `display: block` below is load-bearing rather than
|
|
11
|
+
* incidental: a custom element is `display: inline` by default, and upstream's height
|
|
12
|
+
* only took effect because `position: fixed` forces block-level layout.
|
|
13
|
+
*
|
|
14
|
+
* **The `ResizeObserver`.** It compared `scrollWidth` against `window.innerWidth` and
|
|
15
|
+
* toggled an `overflowed` class. Two reasons it is not missed: the comparison was
|
|
16
|
+
* against the *window*, which stopped being the banner's own width the moment the shell
|
|
17
|
+
* owned layout; and the observer was constructed in `connectedCallback` but only ever
|
|
18
|
+
* attached in `firstUpdated`, which Lit runs once per instance, so a disconnect and
|
|
19
|
+
* reconnect left a live observer watching nothing.
|
|
20
|
+
*/
|
|
21
|
+
export declare const SuperUserBannerStyles: import('lit').CSSResult;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './super-user-banner/index'
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { i as p, n as h, a as g, b as d, t as c } from "./property-B5JHHBCF.js";
|
|
2
|
+
const b = p`
|
|
3
|
+
* {
|
|
4
|
+
padding: 0;
|
|
5
|
+
margin: 0;
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
:host {
|
|
10
|
+
display: block;
|
|
11
|
+
height: 32px;
|
|
12
|
+
min-height: 32px;
|
|
13
|
+
max-height: 32px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.banner {
|
|
17
|
+
height: inherit;
|
|
18
|
+
min-height: inherit;
|
|
19
|
+
max-height: inherit;
|
|
20
|
+
background-color: rgb(40, 40, 40);
|
|
21
|
+
display: flex;
|
|
22
|
+
overflow-x: auto;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/*
|
|
26
|
+
* Centred when the content fits, flush-left when it does not: auto margins collapse
|
|
27
|
+
* to zero once there is no free space, so the start of the content stays reachable
|
|
28
|
+
* instead of being clipped off the left edge.
|
|
29
|
+
*/
|
|
30
|
+
.content {
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-wrap: nowrap;
|
|
33
|
+
align-items: center;
|
|
34
|
+
gap: 1rem;
|
|
35
|
+
margin: auto;
|
|
36
|
+
padding: 0 8px;
|
|
37
|
+
white-space: nowrap;
|
|
38
|
+
/*
|
|
39
|
+
* Load-bearing, and measured. Without it '.content' grows unbounded inside the
|
|
40
|
+
* scroll container, so the names never come under pressure and never ellipsize --
|
|
41
|
+
* the badge just leaves the viewport instead. Constraining the row to the banner
|
|
42
|
+
* is what makes the shrinking below actually happen.
|
|
43
|
+
*/
|
|
44
|
+
max-width: 100%;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.banner-text {
|
|
48
|
+
font-family: 'Inter', sans-serif;
|
|
49
|
+
font-size: 14px;
|
|
50
|
+
font-weight: 400;
|
|
51
|
+
line-height: 20px;
|
|
52
|
+
letter-spacing: -0.001em;
|
|
53
|
+
color: rgba(240, 240, 240, 1);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/*
|
|
57
|
+
* The names give up space before the badge does.
|
|
58
|
+
*
|
|
59
|
+
* This banner exists to make the environment and the impersonation unmistakable, and
|
|
60
|
+
* the badge is the last flex child -- so without this, a merely long client name (a
|
|
61
|
+
* real org name is enough; no attacker required) pushes the badge out of view. The
|
|
62
|
+
* names truncate with an ellipsis instead, which loses nothing that is not still
|
|
63
|
+
* visible in the page itself.
|
|
64
|
+
*/
|
|
65
|
+
.name {
|
|
66
|
+
min-width: 0;
|
|
67
|
+
overflow: hidden;
|
|
68
|
+
text-overflow: ellipsis;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.text-bold {
|
|
72
|
+
font-weight: 600;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.environment-badge {
|
|
76
|
+
flex-shrink: 0;
|
|
77
|
+
height: 24px;
|
|
78
|
+
border-radius: 12px;
|
|
79
|
+
padding: 2px 8px;
|
|
80
|
+
text-transform: uppercase;
|
|
81
|
+
font-size: 14px;
|
|
82
|
+
font-weight: 600;
|
|
83
|
+
line-height: 20px;
|
|
84
|
+
letter-spacing: 0.0025em;
|
|
85
|
+
text-align: left;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.staging-badge {
|
|
89
|
+
background: rgba(206, 52, 0, 1);
|
|
90
|
+
color: rgba(240, 240, 240, 1);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.local-badge {
|
|
94
|
+
color: rgba(119, 61, 189, 1);
|
|
95
|
+
background: rgba(240, 240, 240, 1);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/*
|
|
99
|
+
* The loud one, for 'production' and for an environment nobody recognises. Deliberately
|
|
100
|
+
* not styled like 'staging': a staging session is expected, and these two are the
|
|
101
|
+
* cases where someone should stop and look. See 'environmentBadgeClass' for which
|
|
102
|
+
* values land here and why.
|
|
103
|
+
*/
|
|
104
|
+
.alert-badge {
|
|
105
|
+
background: rgba(140, 0, 0, 1);
|
|
106
|
+
color: rgba(255, 240, 240, 1);
|
|
107
|
+
box-shadow: 0 0 0 2px rgba(255, 200, 200, 0.9);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/* Narrow enough that the label costs more than it explains. */
|
|
111
|
+
@media (max-width: 530px) {
|
|
112
|
+
.user-label {
|
|
113
|
+
display: none;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
`;
|
|
117
|
+
var m = Object.defineProperty, u = Object.getOwnPropertyDescriptor, i = (n, a, r, s) => {
|
|
118
|
+
for (var e = s > 1 ? void 0 : s ? u(a, r) : a, o = n.length - 1, l; o >= 0; o--)
|
|
119
|
+
(l = n[o]) && (e = (s ? l(a, r, e) : l(e)) || e);
|
|
120
|
+
return s && e && m(a, r, e), e;
|
|
121
|
+
};
|
|
122
|
+
const x = /^(local|localhost|dev|develop(ment)?|qa\d*|test\d*|demo|sandbox|uat)$/;
|
|
123
|
+
let t = class extends g {
|
|
124
|
+
constructor() {
|
|
125
|
+
super(...arguments), this.client = "", this.superUser = "", this.activeEnvironment = "";
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Which badge the environment gets, of three.
|
|
129
|
+
*
|
|
130
|
+
* **Upstream had two and failed open**: anything that was not exactly `staging` got
|
|
131
|
+
* the calm `local` badge. That is the wrong direction for a status indicator, and it
|
|
132
|
+
* was reachable rather than theoretical — the host emits this banner whenever
|
|
133
|
+
* `IsStaging || IsDevMachine || user is ICMMUser`, so a super-user impersonating
|
|
134
|
+
* someone **in production** gets it with `activeEnvironment="production"`, and
|
|
135
|
+
* upstream rendered that identically to a laptop. `undefined` — what
|
|
136
|
+
* `GetEnvironmentName()` returns when it cannot identify the host — did the same.
|
|
137
|
+
*
|
|
138
|
+
* So the unrecognised case now fails **loud**: only a known-quiet name gets the quiet
|
|
139
|
+
* badge, and everything else lands on `alert`. A new test tier added upstream will
|
|
140
|
+
* therefore over-warn until it is added to the pattern above, which is the failure
|
|
141
|
+
* direction to prefer for a banner whose entire job is to be noticed.
|
|
142
|
+
*/
|
|
143
|
+
get environmentBadgeClass() {
|
|
144
|
+
const n = this.activeEnvironment.trim().toLowerCase();
|
|
145
|
+
return n === "staging" ? "staging" : x.test(n) ? "local" : "alert";
|
|
146
|
+
}
|
|
147
|
+
render() {
|
|
148
|
+
return d`
|
|
149
|
+
<section class="banner banner-text">
|
|
150
|
+
<div class="content">
|
|
151
|
+
<span class="text-bold name"
|
|
152
|
+
><span class="user-label">Logged in as:</span> ${this.superUser}</span
|
|
153
|
+
>
|
|
154
|
+
<span class="text-bold name">Client: ${this.client}</span>
|
|
155
|
+
<span class="environment-badge ${this.environmentBadgeClass}-badge"
|
|
156
|
+
>${this.activeEnvironment}</span
|
|
157
|
+
>
|
|
158
|
+
</div>
|
|
159
|
+
</section>
|
|
160
|
+
`;
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
t.styles = b;
|
|
164
|
+
i([
|
|
165
|
+
h({ type: String })
|
|
166
|
+
], t.prototype, "client", 2);
|
|
167
|
+
i([
|
|
168
|
+
h({ type: String, attribute: "super-user" })
|
|
169
|
+
], t.prototype, "superUser", 2);
|
|
170
|
+
i([
|
|
171
|
+
h({ type: String, attribute: "active-environment" })
|
|
172
|
+
], t.prototype, "activeEnvironment", 2);
|
|
173
|
+
t = i([
|
|
174
|
+
c("cm-super-user-banner")
|
|
175
|
+
], t);
|
|
176
|
+
export {
|
|
177
|
+
t as SuperUserBanner
|
|
178
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { Data } from './Utils/types';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* `<cm-top-bar>` — the top navigation bar.
|
|
6
|
+
*
|
|
7
|
+
* Ported Floor 7, 2026-09-08, from core-js's `TopBar.ts` (`<top-bar>`). Search is a
|
|
8
|
+
* named `<slot>` rather than a registry-name probe for `search-bar`, all CDN script
|
|
9
|
+
* loading is gone, and the shell owns layout — this component sets no inline
|
|
10
|
+
* position on its own section and reads no side-nav state out of `localStorage`.
|
|
11
|
+
* See the package `README.md` for the full list of what did not come across.
|
|
12
|
+
*/
|
|
13
|
+
export declare class TopBar extends LitElement {
|
|
14
|
+
static readonly styles: import('lit').CSSResult;
|
|
15
|
+
data: Data | null;
|
|
16
|
+
isDropdownOpen: boolean;
|
|
17
|
+
isSuperUserDropdownOpen: boolean;
|
|
18
|
+
connectedCallback(): void;
|
|
19
|
+
disconnectedCallback(): void;
|
|
20
|
+
private initEventListeners;
|
|
21
|
+
private removeEventListeners;
|
|
22
|
+
private handleOutsideClick;
|
|
23
|
+
private closeAllDropdowns;
|
|
24
|
+
private toggleDropdown;
|
|
25
|
+
private toggleSuperUserDropdown;
|
|
26
|
+
private renderFeatureValue;
|
|
27
|
+
private renderFeature;
|
|
28
|
+
private renderFeatureSection;
|
|
29
|
+
private renderSearch;
|
|
30
|
+
private renderNavigationLink;
|
|
31
|
+
private renderSuperUserDropdown;
|
|
32
|
+
private renderUserDropdown;
|
|
33
|
+
render(): import('lit').TemplateResult<1>;
|
|
34
|
+
}
|
|
35
|
+
declare global {
|
|
36
|
+
interface HTMLElementTagNameMap {
|
|
37
|
+
'cm-top-bar': TopBar;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TopBarStyles: import('lit').CSSResult;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Guards for host-supplied URLs and markup.
|
|
3
|
+
*
|
|
4
|
+
* Lit escapes text and attribute *content*, but it does not police URL *schemes*:
|
|
5
|
+
* `href="javascript:…"` is a valid attribute value as far as a template is concerned,
|
|
6
|
+
* and it executes on click. That is the gap these functions close.
|
|
7
|
+
*
|
|
8
|
+
* The values they guard arrive in the `data` property, which is a base64 HTML
|
|
9
|
+
* attribute — so every one of them crosses a boundary this component cannot see the
|
|
10
|
+
* other side of, and this package is meant to publish, which makes "the host" whoever
|
|
11
|
+
* installs it. Treating that input as trusted is not available to us.
|
|
12
|
+
*/
|
|
13
|
+
/** What a refused URL becomes. */
|
|
14
|
+
export declare const REFUSED_HREF = "#";
|
|
15
|
+
/**
|
|
16
|
+
* Whether `url` is safe to navigate to.
|
|
17
|
+
*
|
|
18
|
+
* Callers that need the yes/no answer must use this rather than comparing a returned
|
|
19
|
+
* value against `REFUSED_HREF` — a link whose URL is legitimately `'#'` is refused by
|
|
20
|
+
* that comparison and not by this function, and the two answers must not diverge.
|
|
21
|
+
*/
|
|
22
|
+
export declare function isNavigable(url: string | undefined | null): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Returns `url` if it is safe to put in an `href`, and `'#'` if it is not.
|
|
25
|
+
*
|
|
26
|
+
* The original string is returned rather than the parsed `href`, deliberately:
|
|
27
|
+
* normalising would resolve every relative URL against `PARSE_BASE` and rewrite
|
|
28
|
+
* `/camper/list` into `https://portal.invalid/camper/list`, breaking the majority of
|
|
29
|
+
* this chrome's links. Only the scheme needs to survive parsing, and `new URL()`
|
|
30
|
+
* implements the same WHATWG algorithm the browser applies to the attribute later, so
|
|
31
|
+
* the check and the eventual consumer agree on what the scheme is.
|
|
32
|
+
*/
|
|
33
|
+
export declare function safeHref(url: string | undefined | null): string;
|
|
34
|
+
/**
|
|
35
|
+
* Returns `url` if it is safe to put in an `<img src>`, and `''` if it is not.
|
|
36
|
+
*
|
|
37
|
+
* A `javascript:` URL in `src` does not execute in any current browser, so this is
|
|
38
|
+
* about egress rather than execution: an image source is an outbound request to a host
|
|
39
|
+
* of the data's choosing, made automatically on render. Pair it with
|
|
40
|
+
* `referrerpolicy="no-referrer"` at the call site so the request carries no page URL.
|
|
41
|
+
*/
|
|
42
|
+
export declare function safeImageSrc(url: string | undefined | null): string;
|
|
43
|
+
export declare function safePopupFeatures(features: string | undefined | null): string;
|
|
44
|
+
/**
|
|
45
|
+
* Splits a value on `<br>` so the pieces can be rendered as text with real line breaks.
|
|
46
|
+
*
|
|
47
|
+
* This exists to retire lit's `unsafeHTML`. Upstream ran `feature.value` through it
|
|
48
|
+
* after a `.replace(/<br>/g, '<br/>')`, which says plainly what the directive was for:
|
|
49
|
+
* line breaks. Nothing else in the value was ever meant to be markup, so nothing else
|
|
50
|
+
* needs to be — the caller renders these segments as text, and lit escapes them.
|
|
51
|
+
*
|
|
52
|
+
* The pattern accepts attributes (`<br class="x">`) because upstream's HTML parser did,
|
|
53
|
+
* and a variant that failed to match would silently lose a line break rather than
|
|
54
|
+
* failing loudly.
|
|
55
|
+
*/
|
|
56
|
+
export declare function splitOnLineBreaks(value: string | undefined | null): string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export interface Data {
|
|
2
|
+
logo_url: string;
|
|
3
|
+
page_title: string;
|
|
4
|
+
account_data: AccountData;
|
|
5
|
+
client_data: ClientData;
|
|
6
|
+
reset_password_url: string;
|
|
7
|
+
super_user_data?: SuperUserData | null;
|
|
8
|
+
}
|
|
9
|
+
export interface AccountData {
|
|
10
|
+
person_data: PersonData;
|
|
11
|
+
links: Link[];
|
|
12
|
+
}
|
|
13
|
+
export interface PersonData {
|
|
14
|
+
id: number;
|
|
15
|
+
name: string;
|
|
16
|
+
profile_url: string;
|
|
17
|
+
}
|
|
18
|
+
export interface Link {
|
|
19
|
+
name: string;
|
|
20
|
+
url: string;
|
|
21
|
+
icon_url: string;
|
|
22
|
+
sort_order: number;
|
|
23
|
+
popup?: boolean;
|
|
24
|
+
popup_properties?: string;
|
|
25
|
+
new_tab?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface ClientData {
|
|
28
|
+
id: number;
|
|
29
|
+
name: string;
|
|
30
|
+
domain: string;
|
|
31
|
+
current_season_id: number;
|
|
32
|
+
country: string;
|
|
33
|
+
}
|
|
34
|
+
export interface Feature {
|
|
35
|
+
name?: string;
|
|
36
|
+
value?: string;
|
|
37
|
+
enabled?: boolean;
|
|
38
|
+
display?: 'inline' | 'block';
|
|
39
|
+
sort_order: number;
|
|
40
|
+
}
|
|
41
|
+
export interface FeatureSection {
|
|
42
|
+
title?: string;
|
|
43
|
+
sub_title?: string;
|
|
44
|
+
icon_url?: string;
|
|
45
|
+
sort_order: number;
|
|
46
|
+
features: Feature[];
|
|
47
|
+
}
|
|
48
|
+
export interface SuperUserData {
|
|
49
|
+
sections: FeatureSection[];
|
|
50
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { default as CheckSvgIcon } from './CheckIcon';
|
|
2
|
+
import { default as CrossSvgIcon } from './CrossIcon';
|
|
3
|
+
import { default as DropDownSvgIcon } from './DropDownIcon';
|
|
4
|
+
import { default as InfoSvgIcon } from './InfoIcon';
|
|
5
|
+
import { default as OpenInNewSvgIcon } from './OpenInNewIcon';
|
|
6
|
+
|
|
7
|
+
export { CheckSvgIcon, CrossSvgIcon, DropDownSvgIcon, InfoSvgIcon, OpenInNewSvgIcon };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './top-bar/index'
|