@hintergrund/ui 0.1.1 → 0.1.2
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/admin.js +23987 -11751
- package/dist/{global-D2DXJZaD.js → global-Dn8cBAWs.js} +999 -953
- package/dist/login.js +74 -74
- package/package.json +56 -55
package/dist/login.js
CHANGED
|
@@ -1,111 +1,111 @@
|
|
|
1
|
-
import {
|
|
2
|
-
var
|
|
3
|
-
const
|
|
1
|
+
import { X as se, a2 as le, a9 as ie, Y as ue, u as ne, ad as n, aa as m, ae as v, a5 as l, $ as w, a0 as u, a1 as de, ac as x, t as ve, R as e, a6 as i, v as q, af as P, a3 as W, ab as ce, ag as be, ah as me, aB as ge, al as T, am as fe, av as D, aq as Z, Z as he, _ as pe } from "./global-Dn8cBAWs.js";
|
|
2
|
+
var we = m('<div class="flash flash-error mb-3 svelte-uxwqu2"><svg class="octicon svelte-uxwqu2" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path d="M2.343 13.657A8 8 0 1 1 13.658 2.343 8 8 0 0 1 2.343 13.657ZM6.03 4.97a.751.751 0 0 0-1.042.018.751.751 0 0 0-.018 1.042L6.94 8 4.97 9.97a.749.749 0 0 0 .326 1.275.749.749 0 0 0 .734-.215L8 9.06l1.97 1.97a.749.749 0 0 0 1.275-.326.749.749 0 0 0-.215-.734L9.06 8l1.97-1.97a.749.749 0 0 0-.326-1.275.749.749 0 0 0-.734.215L8 6.94Z"></path></svg> </div>'), xe = m('<div class="flash flash-success svelte-uxwqu2"><svg class="octicon svelte-uxwqu2" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path d="M8 16A8 8 0 1 1 8 0a8 8 0 0 1 0 16Zm3.78-9.72a.751.751 0 0 0-.018-1.042.751.751 0 0 0-1.042-.018L6.75 9.19 5.28 7.72a.751.751 0 0 0-1.042.018.751.751 0 0 0-.018 1.042l2 2a.75.75 0 0 0 1.06 0Z"></path></svg> </div>'), qe = m("<option> </option>"), _e = m('<div class="form-group svelte-uxwqu2"><label for="userGroup" class="svelte-uxwqu2">User Group</label> <select id="userGroup" name="userGroup" class="form-control svelte-uxwqu2" required><option>Select a group...</option><!></select></div>'), ye = m(`<div class="form-group svelte-uxwqu2"><label for="email" class="svelte-uxwqu2">Email</label> <input type="email" id="email" name="email" class="form-control form-control-lg svelte-uxwqu2" required placeholder="you@example.com"/> <p class="form-hint svelte-uxwqu2">We'll send you a magic link to sign in.</p></div>`), ze = m('<div class="form-group svelte-uxwqu2"><label for="password" class="svelte-uxwqu2">Password</label> <input type="password" id="password" name="password" class="form-control form-control-lg svelte-uxwqu2" required placeholder="••••••••"/></div>'), Ce = m('<div class="Box svelte-uxwqu2"><div class="Box-body svelte-uxwqu2"><form autocomplete="off"><!> <!> <button type="submit" class="btn btn-primary btn-block btn-lg svelte-uxwqu2"><!></button></form></div></div>'), ke = m('<main class="auth-wrapper svelte-uxwqu2"><div class="auth-container svelte-uxwqu2"><div class="auth-header svelte-uxwqu2"><svg class="auth-logo svelte-uxwqu2" viewBox="0 0 90 90" width="48" height="48" fill="currentColor"><rect x="12" y="12" width="66" height="66" fill="currentColor"></rect></svg> <h1 class="svelte-uxwqu2">Sign in to Hintergrund</h1></div> <!> <!></div></main>');
|
|
3
|
+
const Se = {
|
|
4
4
|
hash: "svelte-uxwqu2",
|
|
5
|
-
code:
|
|
6
|
-
box-shadow 0.2s ease;}.form-control.svelte-uxwqu2:focus {border-color:var(--borderColor-accent-emphasis);outline:2px solid var(--borderColor-accent-emphasis);outline-offset:-1px;box-shadow:none;}.
|
|
7
|
-
border-color 0.2s ease;}.btn.svelte-uxwqu2:disabled {cursor:not-allowed;}.btn-primary.svelte-uxwqu2 {color:var(--button-primary-fgColor-rest);background-color:var(--button-primary-bgColor-rest);border-color:var(--button-primary-borderColor-rest);
|
|
5
|
+
code: `.auth-wrapper.svelte-uxwqu2 {min-height:100vh;display:flex;align-items:center;justify-content:center;background-color:var(--bgColor-muted);padding:var(--base-size-24);}.auth-container.svelte-uxwqu2 {width:100%;max-width:340px;}.auth-header.svelte-uxwqu2 {text-align:center;margin-bottom:var(--base-size-24);}.auth-logo.svelte-uxwqu2 {color:var(--fgColor-default);margin-bottom:var(--base-size-16);}.auth-header.svelte-uxwqu2 h1:where(.svelte-uxwqu2) {font-size:var(--text-title-size-medium);font-weight:var(--base-text-weight-light);color:var(--fgColor-default);margin:0;}.Box.svelte-uxwqu2 {background-color:var(--bgColor-default);border:var(--borderWidth-thin) solid var(--borderColor-default);border-radius:var(--borderRadius-medium);}.Box-body.svelte-uxwqu2 {padding:var(--base-size-16);}.flash.svelte-uxwqu2 {display:flex;align-items:flex-start;gap:var(--base-size-8);padding:var(--base-size-16);margin-bottom:var(--base-size-16);border:var(--borderWidth-thin) solid;border-radius:var(--borderRadius-medium);font-size:var(--text-body-size-medium);line-height:var(--text-body-lineHeight-medium);}.flash-error.svelte-uxwqu2 {color:var(--fgColor-danger);background-color:var(--bgColor-danger-muted);border-color:var(--borderColor-danger-muted);}.flash-success.svelte-uxwqu2 {color:var(--fgColor-success, #1a7f37);background-color:var(--bgColor-success-muted, #dafbe1);border-color:var(--borderColor-success-muted, #aceebb);}.flash.svelte-uxwqu2 .octicon:where(.svelte-uxwqu2) {flex-shrink:0;margin-top:2px;}.form-group.svelte-uxwqu2 {margin-bottom:var(--base-size-16);}.form-group.svelte-uxwqu2 label:where(.svelte-uxwqu2) {display:block;margin-bottom:var(--base-size-8);font-weight:var(--base-text-weight-semibold);font-size:var(--text-body-size-medium);color:var(--fgColor-default);}.form-control.svelte-uxwqu2 {display:block;width:100%;padding:var(--base-size-8) var(--base-size-12);font-size:var(--text-body-size-medium);line-height:1.5;color:var(--fgColor-default);background-color:var(--bgColor-default);border:var(--borderWidth-thin) solid var(--borderColor-default);border-radius:var(--borderRadius-medium);outline:none;box-shadow:var(--shadow-inset);transition:border-color 0.2s ease,
|
|
6
|
+
box-shadow 0.2s ease;}.form-control.svelte-uxwqu2:focus {border-color:var(--borderColor-accent-emphasis);outline:2px solid var(--borderColor-accent-emphasis);outline-offset:-1px;box-shadow:none;}.form-control-lg.svelte-uxwqu2 {padding:var(--base-size-12) var(--base-size-12);font-size:var(--text-body-size-large);}.form-hint.svelte-uxwqu2 {font-size:var(--text-body-size-small, 12px);color:var(--fgColor-muted, #656d76);margin-top:var(--base-size-8);}.btn.svelte-uxwqu2 {display:inline-flex;align-items:center;justify-content:center;padding:var(--base-size-8) var(--base-size-16);font-size:var(--text-body-size-medium);font-weight:var(--base-text-weight-medium);line-height:1.5;white-space:nowrap;vertical-align:middle;cursor:pointer;user-select:none;border:var(--borderWidth-thin) solid transparent;border-radius:var(--borderRadius-medium);transition:background-color 0.2s ease,
|
|
7
|
+
border-color 0.2s ease;}.btn.svelte-uxwqu2:disabled {cursor:not-allowed;opacity:0.5;}.btn-primary.svelte-uxwqu2 {color:var(--button-primary-fgColor-rest);background-color:var(--button-primary-bgColor-rest);border-color:var(--button-primary-borderColor-rest);}.btn-primary.svelte-uxwqu2:hover:not(:disabled) {background-color:var(--button-primary-bgColor-hover);}.btn-primary.svelte-uxwqu2:active:not(:disabled) {background-color:var(--button-primary-bgColor-active);}.btn-block.svelte-uxwqu2 {display:flex;width:100%;}.btn-lg.svelte-uxwqu2 {padding:var(--base-size-12) var(--base-size-24);}.mb-3.svelte-uxwqu2 {margin-bottom:var(--base-size-16);}`
|
|
8
8
|
};
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
let
|
|
12
|
-
if (!
|
|
9
|
+
function Be(j, A) {
|
|
10
|
+
le(A, !0), ie(j, Se);
|
|
11
|
+
let y = ue(A, "config", 7), U = W(() => {
|
|
12
|
+
if (!y()) return null;
|
|
13
13
|
try {
|
|
14
|
-
return JSON.parse(
|
|
14
|
+
return JSON.parse(y());
|
|
15
15
|
} catch {
|
|
16
16
|
return null;
|
|
17
17
|
}
|
|
18
|
-
}), k =
|
|
19
|
-
|
|
18
|
+
}), k = W(() => e(U)?.loginMethod ?? "password"), S = W(() => e(U)?.userGroups ?? []), B = x(""), G = x(""), z = x(""), h = x(""), C = x(""), p = x(!1);
|
|
19
|
+
ne(() => {
|
|
20
20
|
const r = new URLSearchParams(window.location.search).get("error");
|
|
21
|
-
r && (
|
|
21
|
+
r && (n(h, r, !0), window.history.replaceState({}, "", window.location.pathname));
|
|
22
22
|
});
|
|
23
|
-
async function
|
|
24
|
-
t.preventDefault(),
|
|
23
|
+
async function X(t) {
|
|
24
|
+
t.preventDefault(), n(h, ""), n(C, ""), n(p, !0);
|
|
25
25
|
try {
|
|
26
26
|
const r = {};
|
|
27
|
-
e(k) === "magic-link" ? r.email = e(
|
|
28
|
-
const
|
|
27
|
+
e(k) === "magic-link" ? r.email = e(G) : r.password = e(B), e(S).length > 0 && e(z) && (r.userGroup = e(z));
|
|
28
|
+
const b = await (await fetch("/api/admin/login", {
|
|
29
29
|
method: "POST",
|
|
30
30
|
headers: { "Content-Type": "application/json" },
|
|
31
31
|
body: JSON.stringify(r)
|
|
32
32
|
})).json();
|
|
33
|
-
|
|
33
|
+
b.success ? b.emailSent ? n(C, b.message || "Check your email for the login link.", !0) : window.location.href = "/admin" : n(h, b.message ?? "An error occurred. Please try again.", !0);
|
|
34
34
|
} catch {
|
|
35
|
-
|
|
35
|
+
n(h, "An error occurred. Please try again.");
|
|
36
36
|
} finally {
|
|
37
|
-
|
|
37
|
+
n(p, !1);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
var
|
|
40
|
+
var Y = {
|
|
41
41
|
get config() {
|
|
42
|
-
return
|
|
42
|
+
return y();
|
|
43
43
|
},
|
|
44
44
|
set config(t) {
|
|
45
|
-
|
|
45
|
+
y(t), ve();
|
|
46
46
|
}
|
|
47
|
-
},
|
|
47
|
+
}, L = ke(), E = l(L), J = v(l(E), 2);
|
|
48
48
|
{
|
|
49
|
-
var
|
|
50
|
-
var r =
|
|
51
|
-
|
|
49
|
+
var F = (t) => {
|
|
50
|
+
var r = we(), g = v(l(r));
|
|
51
|
+
i(r), q(() => P(g, ` ${e(h) ?? ""}`)), u(t, r);
|
|
52
52
|
};
|
|
53
|
-
w(
|
|
54
|
-
e(
|
|
53
|
+
w(J, (t) => {
|
|
54
|
+
e(h) && t(F);
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
|
-
var
|
|
57
|
+
var I = v(J, 2);
|
|
58
58
|
{
|
|
59
|
-
var
|
|
60
|
-
var r =
|
|
61
|
-
|
|
62
|
-
},
|
|
63
|
-
var r =
|
|
59
|
+
var K = (t) => {
|
|
60
|
+
var r = xe(), g = v(l(r));
|
|
61
|
+
i(r), q(() => P(g, ` ${e(C) ?? ""}`)), u(t, r);
|
|
62
|
+
}, Q = (t) => {
|
|
63
|
+
var r = Ce(), g = l(r), b = l(g), O = l(b);
|
|
64
64
|
{
|
|
65
|
-
var
|
|
66
|
-
var o =
|
|
65
|
+
var V = (a) => {
|
|
66
|
+
var o = _e(), s = v(l(o), 2), c = l(s);
|
|
67
67
|
c.value = c.__value = "";
|
|
68
68
|
var R = v(c);
|
|
69
|
-
|
|
70
|
-
var
|
|
71
|
-
|
|
72
|
-
var
|
|
69
|
+
be(R, 17, () => e(S), me, (d, f) => {
|
|
70
|
+
var _ = qe(), te = l(_, !0);
|
|
71
|
+
i(_);
|
|
72
|
+
var N = {};
|
|
73
73
|
q(() => {
|
|
74
|
-
|
|
75
|
-
}),
|
|
76
|
-
}),
|
|
74
|
+
P(te, e(f)), N !== (N = e(f)) && (_.value = (_.__value = e(f)) ?? "");
|
|
75
|
+
}), u(d, _);
|
|
76
|
+
}), i(s), i(o), ge(s, () => e(z), (d) => n(z, d)), u(a, o);
|
|
77
77
|
};
|
|
78
|
-
w(
|
|
79
|
-
e(S).length > 0 && a(
|
|
78
|
+
w(O, (a) => {
|
|
79
|
+
e(S).length > 0 && a(V);
|
|
80
80
|
});
|
|
81
81
|
}
|
|
82
|
-
var H = v(
|
|
82
|
+
var H = v(O, 2);
|
|
83
83
|
{
|
|
84
|
-
var
|
|
85
|
-
var o =
|
|
86
|
-
|
|
87
|
-
},
|
|
88
|
-
var o =
|
|
89
|
-
|
|
84
|
+
var $ = (a) => {
|
|
85
|
+
var o = ye(), s = v(l(o), 2);
|
|
86
|
+
T(s), fe(2), i(o), q(() => s.disabled = e(p)), D(s, () => e(G), (c) => n(G, c)), u(a, o);
|
|
87
|
+
}, ee = (a) => {
|
|
88
|
+
var o = ze(), s = v(l(o), 2);
|
|
89
|
+
T(s), i(o), q(() => s.disabled = e(p)), D(s, () => e(B), (c) => n(B, c)), u(a, o);
|
|
90
90
|
};
|
|
91
91
|
w(H, (a) => {
|
|
92
|
-
e(k) === "magic-link" ? a(
|
|
92
|
+
e(k) === "magic-link" ? a($) : a(ee, !1);
|
|
93
93
|
});
|
|
94
94
|
}
|
|
95
|
-
var
|
|
95
|
+
var M = v(H, 2), re = l(M);
|
|
96
96
|
{
|
|
97
|
-
var
|
|
98
|
-
var o =
|
|
99
|
-
|
|
100
|
-
},
|
|
101
|
-
var o =
|
|
97
|
+
var ae = (a) => {
|
|
98
|
+
var o = Z("Signing in...");
|
|
99
|
+
u(a, o);
|
|
100
|
+
}, oe = (a) => {
|
|
101
|
+
var o = he(), s = pe(o);
|
|
102
102
|
{
|
|
103
103
|
var c = (d) => {
|
|
104
|
-
var
|
|
105
|
-
|
|
104
|
+
var f = Z("Send Magic Link");
|
|
105
|
+
u(d, f);
|
|
106
106
|
}, R = (d) => {
|
|
107
|
-
var
|
|
108
|
-
|
|
107
|
+
var f = Z("Sign in");
|
|
108
|
+
u(d, f);
|
|
109
109
|
};
|
|
110
110
|
w(
|
|
111
111
|
s,
|
|
@@ -115,21 +115,21 @@ function ke(O, U) {
|
|
|
115
115
|
!0
|
|
116
116
|
);
|
|
117
117
|
}
|
|
118
|
-
|
|
118
|
+
u(a, o);
|
|
119
119
|
};
|
|
120
|
-
w(
|
|
121
|
-
e(
|
|
120
|
+
w(re, (a) => {
|
|
121
|
+
e(p) ? a(ae) : a(oe, !1);
|
|
122
122
|
});
|
|
123
123
|
}
|
|
124
|
-
|
|
124
|
+
i(M), i(b), i(g), i(r), q(() => M.disabled = e(p)), ce("submit", b, X), u(t, r);
|
|
125
125
|
};
|
|
126
|
-
w(
|
|
127
|
-
e(
|
|
126
|
+
w(I, (t) => {
|
|
127
|
+
e(C) ? t(K) : t(Q, !1);
|
|
128
128
|
});
|
|
129
129
|
}
|
|
130
|
-
return
|
|
130
|
+
return i(E), i(L), u(j, L), de(Y);
|
|
131
131
|
}
|
|
132
|
-
customElements.define("hintergrund-login",
|
|
132
|
+
customElements.define("hintergrund-login", se(Be, { config: {} }, [], [], !1));
|
|
133
133
|
export {
|
|
134
|
-
|
|
134
|
+
Be as default
|
|
135
135
|
};
|
package/package.json
CHANGED
|
@@ -1,56 +1,57 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
2
|
+
"name": "@hintergrund/ui",
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"files": [
|
|
5
|
+
"dist"
|
|
6
|
+
],
|
|
7
|
+
"type": "module",
|
|
8
|
+
"exports": {
|
|
9
|
+
"./admin.js": "./dist/admin.js",
|
|
10
|
+
"./login.js": "./dist/login.js",
|
|
11
|
+
"./ui.css": "./dist/ui.css"
|
|
12
|
+
},
|
|
13
|
+
"devDependencies": {
|
|
14
|
+
"@sveltejs/package": "^2.5.4",
|
|
15
|
+
"@sveltejs/vite-plugin-svelte": "^6.2.0",
|
|
16
|
+
"concurrently": "^9.2.1",
|
|
17
|
+
"publint": "^0.3.15",
|
|
18
|
+
"sirv-cli": "^3.0.0",
|
|
19
|
+
"svelte": "^5.39.5",
|
|
20
|
+
"svelte-check": "^4.3.2",
|
|
21
|
+
"typescript": "^5.9.2",
|
|
22
|
+
"vite": "^7.1.7"
|
|
23
|
+
},
|
|
24
|
+
"keywords": [
|
|
25
|
+
"svelte"
|
|
26
|
+
],
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@primer/css": "^22.0.2",
|
|
29
|
+
"@primer/octicons": "^19.19.0",
|
|
30
|
+
"@tiptap/core": "^3.7.2",
|
|
31
|
+
"@tiptap/extension-bold": "^3.7.2",
|
|
32
|
+
"@tiptap/extension-bullet-list": "^3.7.2",
|
|
33
|
+
"@tiptap/extension-document": "^3.7.2",
|
|
34
|
+
"@tiptap/extension-gapcursor": "^3.11.1",
|
|
35
|
+
"@tiptap/extension-heading": "^3.7.2",
|
|
36
|
+
"@tiptap/extension-history": "^3.7.2",
|
|
37
|
+
"@tiptap/extension-image": "^3.7.2",
|
|
38
|
+
"@tiptap/extension-italic": "^3.7.2",
|
|
39
|
+
"@tiptap/extension-link": "^3.7.2",
|
|
40
|
+
"@tiptap/extension-list-item": "^3.7.2",
|
|
41
|
+
"@tiptap/extension-ordered-list": "^3.7.2",
|
|
42
|
+
"@tiptap/extension-paragraph": "^3.7.2",
|
|
43
|
+
"@tiptap/extension-text": "^3.7.2",
|
|
44
|
+
"@tiptap/extension-text-align": "^3.7.2",
|
|
45
|
+
"@tiptap/extension-underline": "^3.7.2",
|
|
46
|
+
"@tiptap/pm": "^3.7.2",
|
|
47
|
+
"browser-image-compression": "^2.0.2",
|
|
48
|
+
"pdf-lib": "^1.17.1",
|
|
49
|
+
"@hintergrund/shared": "0.1.1"
|
|
50
|
+
},
|
|
51
|
+
"scripts": {
|
|
52
|
+
"dev": "concurrently \"vite build --watch\" \"sirv dist --port 5188 --cors --dev\"",
|
|
53
|
+
"build": "vite build",
|
|
54
|
+
"check": "svelte-check --tsconfig ./tsconfig.json",
|
|
55
|
+
"check:watch": "svelte-check --tsconfig ./tsconfig.json --watch"
|
|
56
|
+
}
|
|
57
|
+
}
|