@hintergrund/ui 0.1.1 → 0.1.3
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 +25253 -12570
- package/dist/{global-D2DXJZaD.js → global-zkva5W_x.js} +857 -796
- package/dist/login.js +78 -78
- package/package.json +56 -55
package/dist/login.js
CHANGED
|
@@ -1,135 +1,135 @@
|
|
|
1
|
-
import {
|
|
2
|
-
var
|
|
3
|
-
const
|
|
1
|
+
import { a3 as se, aa as le, ah as ie, a4 as ue, u as ne, al as n, ai as m, am as v, ad as l, a7 as w, a8 as u, a9 as de, ak as x, x as ve, a0 as e, ae as i, y as q, an as P, ab as R, aj as ce, ao as be, ap as me, aK as ge, aw as N, av as fe, aD as T, au as W, a5 as he, a6 as pe } from "./global-zkva5W_x.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>"), ye = 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>'), _e = 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 _ =
|
|
9
|
+
function Ge(A, U) {
|
|
10
|
+
le(U, !0), ie(A, Se);
|
|
11
|
+
let _ = ue(U, "config", 7), Z = R(() => {
|
|
12
12
|
if (!_()) return null;
|
|
13
13
|
try {
|
|
14
14
|
return JSON.parse(_());
|
|
15
15
|
} catch {
|
|
16
16
|
return null;
|
|
17
17
|
}
|
|
18
|
-
}), k =
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
|
|
18
|
+
}), k = R(() => e(Z)?.loginMethod ?? "password"), S = R(() => e(Z)?.userGroups ?? []), G = x(""), L = x(""), z = x(""), h = x(""), C = x(""), p = x(!1);
|
|
19
|
+
ne(() => {
|
|
20
|
+
const a = new URLSearchParams(window.location.search).get("error");
|
|
21
|
+
a && (n(h, a, !0), window.history.replaceState({}, "", window.location.pathname));
|
|
22
22
|
});
|
|
23
|
-
async function
|
|
24
|
-
t.preventDefault(),
|
|
23
|
+
async function K(t) {
|
|
24
|
+
t.preventDefault(), n(h, ""), n(C, ""), n(p, !0);
|
|
25
25
|
try {
|
|
26
|
-
const
|
|
27
|
-
e(k) === "magic-link" ?
|
|
28
|
-
const
|
|
26
|
+
const a = {};
|
|
27
|
+
e(k) === "magic-link" ? a.email = e(L) : a.password = e(G), e(S).length > 0 && e(z) && (a.userGroup = e(z));
|
|
28
|
+
const b = await (await fetch("/api/admin/login", {
|
|
29
29
|
method: "POST",
|
|
30
30
|
headers: { "Content-Type": "application/json" },
|
|
31
|
-
body: JSON.stringify(
|
|
31
|
+
body: JSON.stringify(a)
|
|
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 F = {
|
|
41
41
|
get config() {
|
|
42
42
|
return _();
|
|
43
43
|
},
|
|
44
44
|
set config(t) {
|
|
45
|
-
_(t),
|
|
45
|
+
_(t), ve();
|
|
46
46
|
}
|
|
47
|
-
},
|
|
47
|
+
}, B = ke(), E = l(B), J = v(l(E), 2);
|
|
48
48
|
{
|
|
49
|
-
var
|
|
50
|
-
var
|
|
51
|
-
|
|
49
|
+
var I = (t) => {
|
|
50
|
+
var a = we(), g = v(l(a));
|
|
51
|
+
i(a), q(() => P(g, ` ${e(h) ?? ""}`)), u(t, a);
|
|
52
52
|
};
|
|
53
|
-
w(
|
|
54
|
-
e(
|
|
53
|
+
w(J, (t) => {
|
|
54
|
+
e(h) && t(I);
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
|
-
var
|
|
57
|
+
var Q = v(J, 2);
|
|
58
58
|
{
|
|
59
|
-
var
|
|
60
|
-
var
|
|
61
|
-
|
|
62
|
-
},
|
|
63
|
-
var
|
|
59
|
+
var V = (t) => {
|
|
60
|
+
var a = xe(), g = v(l(a));
|
|
61
|
+
i(a), q(() => P(g, ` ${e(C) ?? ""}`)), u(t, a);
|
|
62
|
+
}, X = (t) => {
|
|
63
|
+
var a = Ce(), g = l(a), b = l(g), O = l(b);
|
|
64
64
|
{
|
|
65
|
-
var
|
|
66
|
-
var o =
|
|
65
|
+
var Y = (r) => {
|
|
66
|
+
var o = ye(), s = v(l(o), 2), c = l(s);
|
|
67
67
|
c.value = c.__value = "";
|
|
68
|
-
var
|
|
69
|
-
|
|
70
|
-
var y =
|
|
71
|
-
|
|
72
|
-
var
|
|
68
|
+
var j = v(c);
|
|
69
|
+
be(j, 17, () => e(S), me, (d, f) => {
|
|
70
|
+
var y = qe(), te = l(y, !0);
|
|
71
|
+
i(y);
|
|
72
|
+
var H = {};
|
|
73
73
|
q(() => {
|
|
74
|
-
|
|
75
|
-
}),
|
|
76
|
-
}),
|
|
74
|
+
P(te, e(f)), H !== (H = e(f)) && (y.value = (y.__value = e(f)) ?? "");
|
|
75
|
+
}), u(d, y);
|
|
76
|
+
}), i(s), i(o), ge(s, () => e(z), (d) => n(z, d)), u(r, o);
|
|
77
77
|
};
|
|
78
|
-
w(
|
|
79
|
-
e(S).length > 0 &&
|
|
78
|
+
w(O, (r) => {
|
|
79
|
+
e(S).length > 0 && r(Y);
|
|
80
80
|
});
|
|
81
81
|
}
|
|
82
|
-
var
|
|
82
|
+
var D = v(O, 2);
|
|
83
83
|
{
|
|
84
|
-
var
|
|
85
|
-
var o =
|
|
86
|
-
N(s),
|
|
87
|
-
},
|
|
88
|
-
var o =
|
|
89
|
-
N(s),
|
|
84
|
+
var $ = (r) => {
|
|
85
|
+
var o = _e(), s = v(l(o), 2);
|
|
86
|
+
N(s), fe(2), i(o), q(() => s.disabled = e(p)), T(s, () => e(L), (c) => n(L, c)), u(r, o);
|
|
87
|
+
}, ee = (r) => {
|
|
88
|
+
var o = ze(), s = v(l(o), 2);
|
|
89
|
+
N(s), i(o), q(() => s.disabled = e(p)), T(s, () => e(G), (c) => n(G, c)), u(r, o);
|
|
90
90
|
};
|
|
91
|
-
w(
|
|
92
|
-
e(k) === "magic-link" ?
|
|
91
|
+
w(D, (r) => {
|
|
92
|
+
e(k) === "magic-link" ? r($) : r(ee, !1);
|
|
93
93
|
});
|
|
94
94
|
}
|
|
95
|
-
var
|
|
95
|
+
var M = v(D, 2), ae = l(M);
|
|
96
96
|
{
|
|
97
|
-
var
|
|
98
|
-
var o =
|
|
99
|
-
|
|
100
|
-
},
|
|
101
|
-
var o =
|
|
97
|
+
var re = (r) => {
|
|
98
|
+
var o = W("Signing in...");
|
|
99
|
+
u(r, o);
|
|
100
|
+
}, oe = (r) => {
|
|
101
|
+
var o = he(), s = pe(o);
|
|
102
102
|
{
|
|
103
103
|
var c = (d) => {
|
|
104
|
-
var
|
|
105
|
-
|
|
106
|
-
},
|
|
107
|
-
var
|
|
108
|
-
|
|
104
|
+
var f = W("Send Magic Link");
|
|
105
|
+
u(d, f);
|
|
106
|
+
}, j = (d) => {
|
|
107
|
+
var f = W("Sign in");
|
|
108
|
+
u(d, f);
|
|
109
109
|
};
|
|
110
110
|
w(
|
|
111
111
|
s,
|
|
112
112
|
(d) => {
|
|
113
|
-
e(k) === "magic-link" ? d(c) : d(
|
|
113
|
+
e(k) === "magic-link" ? d(c) : d(j, !1);
|
|
114
114
|
},
|
|
115
115
|
!0
|
|
116
116
|
);
|
|
117
117
|
}
|
|
118
|
-
|
|
118
|
+
u(r, o);
|
|
119
119
|
};
|
|
120
|
-
w(
|
|
121
|
-
e(
|
|
120
|
+
w(ae, (r) => {
|
|
121
|
+
e(p) ? r(re) : r(oe, !1);
|
|
122
122
|
});
|
|
123
123
|
}
|
|
124
|
-
|
|
124
|
+
i(M), i(b), i(g), i(a), q(() => M.disabled = e(p)), ce("submit", b, K), u(t, a);
|
|
125
125
|
};
|
|
126
|
-
w(
|
|
127
|
-
e(
|
|
126
|
+
w(Q, (t) => {
|
|
127
|
+
e(C) ? t(V) : t(X, !1);
|
|
128
128
|
});
|
|
129
129
|
}
|
|
130
|
-
return
|
|
130
|
+
return i(E), i(B), u(A, B), de(F);
|
|
131
131
|
}
|
|
132
|
-
customElements.define("hintergrund-login",
|
|
132
|
+
customElements.define("hintergrund-login", se(Ge, { config: {} }, [], [], !1));
|
|
133
133
|
export {
|
|
134
|
-
|
|
134
|
+
Ge 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.3",
|
|
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.3"
|
|
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
|
+
}
|