@commonpub/layer 0.4.4 → 0.4.6

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.
@@ -1,14 +1,13 @@
1
1
  <template>
2
2
  <span class="cpub-site-logo">
3
- <!-- Classic logo: shown by default, hidden when Agora active -->
3
+ <!-- Classic logo -->
4
4
  <span class="cpub-logo-classic">
5
5
  <span class="cpub-logo-bracket">[</span>C<span class="cpub-logo-bracket">]</span>
6
6
  <span class="cpub-logo-name">CommonPub</span>
7
7
  </span>
8
8
 
9
- <!-- Agora logo: hidden by default, shown when Agora active via CSS -->
9
+ <!-- Agora logo: Town Square mark + Fraunces wordmark -->
10
10
  <span class="cpub-logo-agora">
11
- <!-- Town Square mark: 4 blocks with content lines + green center -->
12
11
  <svg class="cpub-logo-mark" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200" width="22" height="22" aria-hidden="true">
13
12
  <rect x="18" y="18" width="72" height="72" fill="none" stroke="currentColor" stroke-width="7" stroke-linejoin="round"/>
14
13
  <rect x="110" y="18" width="72" height="72" fill="none" stroke="currentColor" stroke-width="7" stroke-linejoin="round"/>
@@ -34,7 +33,6 @@
34
33
  white-space: nowrap;
35
34
  }
36
35
 
37
- /* Classic logo */
38
36
  .cpub-logo-classic {
39
37
  display: flex;
40
38
  align-items: center;
@@ -45,7 +43,7 @@
45
43
  .cpub-logo-bracket { color: var(--accent); font-size: 15px; }
46
44
  .cpub-logo-name { margin-left: 2px; }
47
45
 
48
- /* Agora logo hidden by default */
46
+ /* Agora logo hidden by default — shown via agora.css */
49
47
  .cpub-logo-agora {
50
48
  display: none;
51
49
  align-items: center;
@@ -60,15 +58,3 @@
60
58
  }
61
59
  .cpub-logo-pub { color: var(--accent); }
62
60
  </style>
63
-
64
- <style>
65
- /* Switch logos based on data-theme — pure CSS, no JS hydration needed */
66
- [data-theme="agora"] .cpub-logo-classic,
67
- [data-theme="agora-dark"] .cpub-logo-classic {
68
- display: none !important;
69
- }
70
- [data-theme="agora"] .cpub-logo-agora,
71
- [data-theme="agora-dark"] .cpub-logo-agora {
72
- display: flex !important;
73
- }
74
- </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commonpub/layer",
3
- "version": "0.4.4",
3
+ "version": "0.4.6",
4
4
  "type": "module",
5
5
  "main": "./nuxt.config.ts",
6
6
  "files": [
@@ -55,9 +55,9 @@
55
55
  "@commonpub/docs": "0.5.2",
56
56
  "@commonpub/editor": "0.5.0",
57
57
  "@commonpub/server": "2.22.0",
58
- "@commonpub/ui": "0.8.2",
59
- "@commonpub/protocol": "0.9.5",
58
+ "@commonpub/ui": "0.8.4",
60
59
  "@commonpub/learning": "0.5.0",
60
+ "@commonpub/protocol": "0.9.5",
61
61
  "@commonpub/schema": "0.8.13"
62
62
  },
63
63
  "devDependencies": {
package/pages/index.vue CHANGED
@@ -157,6 +157,32 @@ async function handleHubJoin(hubSlug: string): Promise<void> {
157
157
  <div v-if="activeContest?.endDate" class="cpub-hero-aside">
158
158
  <CountdownTimer :target-date="activeContest.endDate" />
159
159
  </div>
160
+ <!-- Large Town Square logo — shown for Agora theme when no contest -->
161
+ <div v-if="!activeContest" class="cpub-hero-aside cpub-hero-logo-aside">
162
+ <svg class="cpub-hero-logo" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200" aria-hidden="true">
163
+ <rect x="18" y="18" width="72" height="72" fill="none" stroke="currentColor" stroke-width="5.5" stroke-linejoin="round"/>
164
+ <rect x="110" y="18" width="72" height="72" fill="none" stroke="currentColor" stroke-width="5.5" stroke-linejoin="round"/>
165
+ <rect x="18" y="110" width="72" height="72" fill="none" stroke="currentColor" stroke-width="5.5" stroke-linejoin="round"/>
166
+ <rect x="110" y="110" width="72" height="72" fill="none" stroke="currentColor" stroke-width="5.5" stroke-linejoin="round"/>
167
+ <rect x="90" y="90" width="20" height="20" fill="var(--accent, #3d8b5e)"/>
168
+ <rect x="84" y="84" width="6" height="6" fill="var(--accent, #3d8b5e)" opacity="0.6"/>
169
+ <rect x="110" y="84" width="6" height="6" fill="var(--accent, #3d8b5e)" opacity="0.6"/>
170
+ <rect x="84" y="110" width="6" height="6" fill="var(--accent, #3d8b5e)" opacity="0.6"/>
171
+ <rect x="110" y="110" width="6" height="6" fill="var(--accent, #3d8b5e)" opacity="0.6"/>
172
+ <line x1="32" y1="40" x2="76" y2="40" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" opacity="0.15"/>
173
+ <line x1="32" y1="52" x2="66" y2="52" stroke="var(--accent, #3d8b5e)" stroke-width="2.5" stroke-linecap="round" opacity="0.7"/>
174
+ <line x1="32" y1="64" x2="72" y2="64" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" opacity="0.15"/>
175
+ <line x1="124" y1="40" x2="168" y2="40" stroke="var(--accent, #3d8b5e)" stroke-width="2.5" stroke-linecap="round" opacity="0.7"/>
176
+ <line x1="124" y1="52" x2="158" y2="52" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" opacity="0.15"/>
177
+ <line x1="124" y1="64" x2="164" y2="64" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" opacity="0.15"/>
178
+ <line x1="32" y1="132" x2="76" y2="132" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" opacity="0.15"/>
179
+ <line x1="32" y1="144" x2="62" y2="144" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" opacity="0.15"/>
180
+ <line x1="32" y1="156" x2="70" y2="156" stroke="var(--accent, #3d8b5e)" stroke-width="2.5" stroke-linecap="round" opacity="0.7"/>
181
+ <line x1="124" y1="132" x2="168" y2="132" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" opacity="0.15"/>
182
+ <line x1="124" y1="144" x2="160" y2="144" stroke="var(--accent, #3d8b5e)" stroke-width="2.5" stroke-linecap="round" opacity="0.7"/>
183
+ <line x1="124" y1="156" x2="152" y2="156" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" opacity="0.15"/>
184
+ </svg>
185
+ </div>
160
186
  </div>
161
187
  </section>
162
188
 
@@ -464,6 +490,14 @@ async function handleHubJoin(hubSlug: string): Promise<void> {
464
490
 
465
491
  .cpub-hero-aside { flex-shrink: 0; }
466
492
 
493
+ /* Hero logo — hidden by default, shown by Agora theme CSS */
494
+ .cpub-hero-logo-aside { display: none; }
495
+ .cpub-hero-logo {
496
+ width: 160px;
497
+ height: 160px;
498
+ opacity: 0.6;
499
+ }
500
+
467
501
  /* ─── TABS BAR ─── */
468
502
  .cpub-tabs-bar {
469
503
  position: sticky;
@@ -1,81 +1,8 @@
1
1
  <script setup lang="ts">
2
- definePageMeta({ middleware: 'auth' });
3
- useSeoMeta({ title: `Settings — ${useSiteName()}` });
4
-
5
- // Redirect bare /settings to /settings/profile on mount
6
- onMounted(() => {
7
- const route = useRoute();
8
- if (route.path === '/settings') {
9
- navigateTo('/settings/profile', { replace: true });
10
- }
11
- });
2
+ // Default child route — redirect to profile
3
+ navigateTo('/settings/profile', { replace: true });
12
4
  </script>
13
5
 
14
6
  <template>
15
- <div class="cpub-settings-page">
16
- <div class="cpub-settings-layout">
17
- <aside class="cpub-settings-nav">
18
- <h2 class="cpub-sidebar-heading">Settings</h2>
19
- <nav>
20
- <NuxtLink to="/settings/profile" class="cpub-settings-link">
21
- <i class="fa-solid fa-user" style="width: 14px"></i> Profile
22
- </NuxtLink>
23
- <NuxtLink to="/settings/account" class="cpub-settings-link">
24
- <i class="fa-solid fa-shield-halved" style="width: 14px"></i> Account
25
- </NuxtLink>
26
- <NuxtLink to="/settings/notifications" class="cpub-settings-link">
27
- <i class="fa-solid fa-bell" style="width: 14px"></i> Notifications
28
- </NuxtLink>
29
- <NuxtLink to="/settings/appearance" class="cpub-settings-link">
30
- <i class="fa-solid fa-palette" style="width: 14px"></i> Appearance
31
- </NuxtLink>
32
- </nav>
33
- </aside>
34
- <div class="cpub-settings-content">
35
- <NuxtPage />
36
- </div>
37
- </div>
38
- </div>
7
+ <div />
39
8
  </template>
40
-
41
- <style scoped>
42
- .cpub-settings-layout {
43
- display: grid;
44
- grid-template-columns: 200px 1fr;
45
- gap: 32px;
46
- }
47
-
48
- .cpub-settings-nav nav {
49
- display: flex;
50
- flex-direction: column;
51
- gap: 2px;
52
- }
53
-
54
- .cpub-settings-link {
55
- display: flex;
56
- align-items: center;
57
- gap: 8px;
58
- padding: 6px 10px;
59
- font-size: 13px;
60
- color: var(--text-dim);
61
- text-decoration: none;
62
- border: var(--border-width-default) solid transparent;
63
- }
64
-
65
- .cpub-settings-link:hover {
66
- background: var(--surface2);
67
- color: var(--text);
68
- }
69
-
70
- .cpub-settings-link.router-link-active {
71
- background: var(--accent-bg);
72
- border-color: var(--accent-border);
73
- color: var(--accent);
74
- }
75
-
76
- @media (max-width: 768px) {
77
- .cpub-settings-layout {
78
- grid-template-columns: 1fr;
79
- }
80
- }
81
- </style>
@@ -0,0 +1,73 @@
1
+ <script setup lang="ts">
2
+ definePageMeta({ middleware: 'auth' });
3
+ useSeoMeta({ title: `Settings — ${useSiteName()}` });
4
+ </script>
5
+
6
+ <template>
7
+ <div class="cpub-settings-page">
8
+ <div class="cpub-settings-layout">
9
+ <aside class="cpub-settings-nav">
10
+ <h2 class="cpub-sidebar-heading">Settings</h2>
11
+ <nav>
12
+ <NuxtLink to="/settings/profile" class="cpub-settings-link">
13
+ <i class="fa-solid fa-user" style="width: 14px"></i> Profile
14
+ </NuxtLink>
15
+ <NuxtLink to="/settings/account" class="cpub-settings-link">
16
+ <i class="fa-solid fa-shield-halved" style="width: 14px"></i> Account
17
+ </NuxtLink>
18
+ <NuxtLink to="/settings/notifications" class="cpub-settings-link">
19
+ <i class="fa-solid fa-bell" style="width: 14px"></i> Notifications
20
+ </NuxtLink>
21
+ <NuxtLink to="/settings/appearance" class="cpub-settings-link">
22
+ <i class="fa-solid fa-palette" style="width: 14px"></i> Appearance
23
+ </NuxtLink>
24
+ </nav>
25
+ </aside>
26
+ <div class="cpub-settings-content">
27
+ <NuxtPage />
28
+ </div>
29
+ </div>
30
+ </div>
31
+ </template>
32
+
33
+ <style scoped>
34
+ .cpub-settings-layout {
35
+ display: grid;
36
+ grid-template-columns: 200px 1fr;
37
+ gap: 32px;
38
+ }
39
+
40
+ .cpub-settings-nav nav {
41
+ display: flex;
42
+ flex-direction: column;
43
+ gap: 2px;
44
+ }
45
+
46
+ .cpub-settings-link {
47
+ display: flex;
48
+ align-items: center;
49
+ gap: 8px;
50
+ padding: 6px 10px;
51
+ font-size: 13px;
52
+ color: var(--text-dim);
53
+ text-decoration: none;
54
+ border: var(--border-width-default) solid transparent;
55
+ }
56
+
57
+ .cpub-settings-link:hover {
58
+ background: var(--surface2);
59
+ color: var(--text);
60
+ }
61
+
62
+ .cpub-settings-link.router-link-active {
63
+ background: var(--accent-bg);
64
+ border-color: var(--accent-border);
65
+ color: var(--accent);
66
+ }
67
+
68
+ @media (max-width: 768px) {
69
+ .cpub-settings-layout {
70
+ grid-template-columns: 1fr;
71
+ }
72
+ }
73
+ </style>
@@ -6,7 +6,7 @@ import { eq } from 'drizzle-orm';
6
6
  import { instanceSettings } from '@commonpub/schema';
7
7
  import { THEME_TO_FAMILY, FAMILY_VARIANTS, IS_DARK, VALID_THEME_IDS } from '../../utils/themeConfig';
8
8
 
9
- const CACHE_TTL = 60_000; // 1 minute
9
+ const CACHE_TTL = 300_000; // 5 minutes — admin changes take up to 5 min to propagate
10
10
 
11
11
  let cached: string | null = null;
12
12
  let cacheTime = 0;
@@ -357,3 +357,10 @@
357
357
  [data-theme="agora-dark"] [data-content-type="explainer"] { --badge-color: #3dbcab; --badge-bg: rgba(61, 188, 171, 0.12); }
358
358
  [data-theme="agora-dark"] [data-content-type="video"] { --badge-color: #d85e55; --badge-bg: rgba(216, 94, 85, 0.12); }
359
359
  [data-theme="agora-dark"] [data-content-type="tutorial"] { --badge-color: #daa040; --badge-bg: rgba(218, 160, 64, 0.12); }
360
+
361
+ /* Logo switch */
362
+ [data-theme="agora-dark"] .cpub-logo-classic { display: none !important; }
363
+ [data-theme="agora-dark"] .cpub-logo-agora { display: flex !important; }
364
+
365
+ /* Show Town Square logo in hero section */
366
+ [data-theme="agora-dark"] .cpub-hero-logo-aside { display: flex !important; align-items: center; justify-content: center; }
package/theme/agora.css CHANGED
@@ -460,3 +460,16 @@
460
460
  [data-theme="agora"] [data-content-type="explainer"] { --badge-color: #2a9d8f; --badge-bg: rgba(42, 157, 143, 0.08); }
461
461
  [data-theme="agora"] [data-content-type="video"] { --badge-color: #c4443a; --badge-bg: rgba(196, 68, 58, 0.08); }
462
462
  [data-theme="agora"] [data-content-type="tutorial"] { --badge-color: #c4882a; --badge-bg: rgba(196, 136, 42, 0.08); }
463
+
464
+
465
+ /* ═══════════════════════════════════════════
466
+ LOGO SWITCH
467
+ Hide Classic logo, show Agora Town Square
468
+ mark + Fraunces wordmark.
469
+ ═══════════════════════════════════════════ */
470
+
471
+ [data-theme="agora"] .cpub-logo-classic { display: none !important; }
472
+ [data-theme="agora"] .cpub-logo-agora { display: flex !important; }
473
+
474
+ /* Show Town Square logo in hero section */
475
+ [data-theme="agora"] .cpub-hero-logo-aside { display: flex !important; align-items: center; justify-content: center; }