@acms-subir/core 0.3.14 → 0.3.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/package.json +1 -1
- package/src/components/AdminLogo.astro +23 -0
- package/src/layouts/Admin.astro +2 -13
- package/src/pages/admin/login.astro +6 -8
- package/src/styles/admin.css +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @acms-subir/core
|
|
2
2
|
|
|
3
|
+
## 0.3.15
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 8e89435: Show the published site logo and site name on the admin login page, including its dark-mode logo. Share logo rendering with the admin sidebar so both surfaces retain the framework fallback when no site logo is configured.
|
|
8
|
+
|
|
3
9
|
## 0.3.14
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { BRAND } from '../lib/brand';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
logo?: string;
|
|
6
|
+
logoDark?: string;
|
|
7
|
+
size?: number;
|
|
8
|
+
}
|
|
9
|
+
const { logo, logoDark, size = 20 } = Astro.props;
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
{logo ? (
|
|
13
|
+
<>
|
|
14
|
+
<img class:list={['brand-logo', { 'logo-light': !!logoDark }]} src={logo} alt="" />
|
|
15
|
+
{logoDark && <img class="brand-logo logo-dark" src={logoDark} alt="" />}
|
|
16
|
+
</>
|
|
17
|
+
) : (
|
|
18
|
+
<svg width={size} height={size} viewBox="0 0 24 24" role="img" aria-label={BRAND.name}>
|
|
19
|
+
<rect x="1" y="3" width="22" height="4.4" rx="1.9" fill="currentColor" opacity="0.85" />
|
|
20
|
+
<rect x="1" y="10" width="12.5" height="4.4" rx="1.9" fill="var(--accent)" />
|
|
21
|
+
<rect x="1" y="17" width="17.5" height="4.4" rx="1.9" fill="currentColor" opacity="0.35" />
|
|
22
|
+
</svg>
|
|
23
|
+
)}
|
package/src/layouts/Admin.astro
CHANGED
|
@@ -10,6 +10,7 @@ import { accessFor } from '../lib/permissions/access';
|
|
|
10
10
|
import { AUTH } from '../lib/auth/config';
|
|
11
11
|
import ClerkSession from '../components/auth/ClerkSession.astro';
|
|
12
12
|
import ThemeScript from '../components/ThemeScript.astro';
|
|
13
|
+
import AdminLogo from '../components/AdminLogo.astro';
|
|
13
14
|
import CommandPalette from '../components/CommandPalette';
|
|
14
15
|
import '../styles/admin.css';
|
|
15
16
|
|
|
@@ -185,19 +186,7 @@ const themeOpts = [
|
|
|
185
186
|
<div class="shell" id="acms-shell">
|
|
186
187
|
<aside class="sidebar" aria-label="Admin navigation">
|
|
187
188
|
<div class="brand">
|
|
188
|
-
|
|
189
|
-
{settings.siteLogo ? (
|
|
190
|
-
<>
|
|
191
|
-
<img class:list={['brand-logo', { 'logo-light': !!settings.siteLogoDark }]} src={settings.siteLogo} alt="" />
|
|
192
|
-
{settings.siteLogoDark && <img class="brand-logo logo-dark" src={settings.siteLogoDark} alt="" />}
|
|
193
|
-
</>
|
|
194
|
-
) : (
|
|
195
|
-
<svg width="20" height="20" viewBox="0 0 24 24" role="img" aria-label={BRAND.name}>
|
|
196
|
-
<rect x="1" y="3" width="22" height="4.4" rx="1.9" fill="currentColor" opacity="0.85" />
|
|
197
|
-
<rect x="1" y="10" width="12.5" height="4.4" rx="1.9" fill="var(--accent)" />
|
|
198
|
-
<rect x="1" y="17" width="17.5" height="4.4" rx="1.9" fill="currentColor" opacity="0.35" />
|
|
199
|
-
</svg>
|
|
200
|
-
)}
|
|
189
|
+
<AdminLogo logo={settings.siteLogo} logoDark={settings.siteLogoDark} />
|
|
201
190
|
<span class="brand-name" title={`v${BRAND.version} · ${BRAND.stack}`}>{siteName}</span>
|
|
202
191
|
<button class="icon-btn" type="button" id="acms-rail-toggle" aria-label="Collapse sidebar" title="Collapse sidebar">
|
|
203
192
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d={icons.side} /></svg>
|
|
@@ -7,6 +7,7 @@ import { allowLogin } from '../../lib/auth/login-limit';
|
|
|
7
7
|
import { getRepo } from '../../lib/repo';
|
|
8
8
|
import { BRAND } from '../../lib/brand';
|
|
9
9
|
import ThemeScript from '../../components/ThemeScript.astro';
|
|
10
|
+
import AdminLogo from '../../components/AdminLogo.astro';
|
|
10
11
|
import ClerkSession from '../../components/auth/ClerkSession.astro';
|
|
11
12
|
import '../../styles/admin.css';
|
|
12
13
|
|
|
@@ -55,7 +56,8 @@ const logoutAction = `/admin/logout${next ? `?next=${encodeURIComponent(next)}`
|
|
|
55
56
|
// the destination query every sign-in link on this page carries forward
|
|
56
57
|
const keep = next ? `next=${encodeURIComponent(next)}` : back ? `return=${encodeURIComponent(back)}` : '';
|
|
57
58
|
const retryHref = `/admin/login${keep ? `?${keep}` : ''}`;
|
|
58
|
-
const
|
|
59
|
+
const settings = await (await getRepo(Astro.locals)).getSettings();
|
|
60
|
+
const siteName = settings.siteTitle || BRAND.name;
|
|
59
61
|
|
|
60
62
|
let error = '';
|
|
61
63
|
if (!clerkMode && Astro.request.method === 'POST') {
|
|
@@ -105,7 +107,7 @@ if (!clerkMode && Astro.request.method === 'POST') {
|
|
|
105
107
|
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
|
|
106
108
|
<ThemeScript />
|
|
107
109
|
<meta name="robots" content="noindex" />
|
|
108
|
-
<title>{clerkView === 'sign-up' ? 'Accept invitation' : 'Sign in'} · {
|
|
110
|
+
<title>{clerkView === 'sign-up' ? 'Accept invitation' : 'Sign in'} · {siteName} admin</title>
|
|
109
111
|
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
110
112
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet" />
|
|
111
113
|
<ClerkSession />
|
|
@@ -114,12 +116,8 @@ if (!clerkMode && Astro.request.method === 'POST') {
|
|
|
114
116
|
<div class="login-wrap">
|
|
115
117
|
<main class:list={['card card-pad login-card', { 'is-clerk': clerkMode }]}>
|
|
116
118
|
<div class="brand">
|
|
117
|
-
<
|
|
118
|
-
|
|
119
|
-
<rect x="1" y="10" width="12.5" height="4.4" rx="1.9" fill="var(--accent)" />
|
|
120
|
-
<rect x="1" y="17" width="17.5" height="4.4" rx="1.9" fill="currentColor" opacity="0.35" />
|
|
121
|
-
</svg>
|
|
122
|
-
<div class="brand-name">{BRAND.name}</div>
|
|
119
|
+
<AdminLogo logo={settings.siteLogo} logoDark={settings.siteLogoDark} size={26} />
|
|
120
|
+
<div class="brand-name">{siteName}</div>
|
|
123
121
|
</div>
|
|
124
122
|
|
|
125
123
|
{!clerkMode && (
|
package/src/styles/admin.css
CHANGED
|
@@ -756,6 +756,7 @@ dialog.modal[open] { animation: modal-in 0.16s ease-out; }
|
|
|
756
756
|
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
|
|
757
757
|
.login-card { width: 100%; max-width: 360px; }
|
|
758
758
|
.login-card .brand { justify-content: center; padding-bottom: 20px; }
|
|
759
|
+
.login-card .brand-logo { height: 26px; max-width: 128px; }
|
|
759
760
|
.login-card .brand-name { color: var(--text); flex: none; }
|
|
760
761
|
.login-wrap { background: var(--bg); }
|
|
761
762
|
.btn.block { width: 100%; justify-content: center; min-height: 38px; }
|