@commonpub/layer 0.63.0 → 0.64.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commonpub/layer",
3
- "version": "0.63.0",
3
+ "version": "0.64.1",
4
4
  "type": "module",
5
5
  "main": "./nuxt.config.ts",
6
6
  "files": [
@@ -53,16 +53,16 @@
53
53
  "vue": "^3.4.0",
54
54
  "vue-router": "^4.3.0",
55
55
  "zod": "^4.3.6",
56
- "@commonpub/auth": "0.8.0",
57
56
  "@commonpub/config": "0.19.0",
58
- "@commonpub/editor": "0.7.11",
59
- "@commonpub/schema": "0.35.0",
57
+ "@commonpub/auth": "0.8.0",
58
+ "@commonpub/explainer": "0.7.15",
60
59
  "@commonpub/docs": "0.6.3",
61
- "@commonpub/learning": "0.5.2",
62
- "@commonpub/server": "2.82.0",
63
- "@commonpub/ui": "0.10.0",
60
+ "@commonpub/schema": "0.35.0",
61
+ "@commonpub/editor": "0.7.11",
64
62
  "@commonpub/protocol": "0.13.0",
65
- "@commonpub/explainer": "0.7.15"
63
+ "@commonpub/server": "2.82.0",
64
+ "@commonpub/ui": "0.11.1",
65
+ "@commonpub/learning": "0.5.2"
66
66
  },
67
67
  "devDependencies": {
68
68
  "@testing-library/jest-dom": "^6.9.1",
@@ -155,14 +155,45 @@ async function removeTheme(themeId: string): Promise<void> {
155
155
  // --- Create / Capture / Import ---
156
156
 
157
157
  function createBlank(): void {
158
+ // "New custom theme" forks the CURRENTLY ACTIVE theme so you start from the
159
+ // look on screen, not a blank Classic slate. (It previously seeded an empty,
160
+ // base-parented theme — which is why saving reverted everything to Classic.)
161
+ const active = instanceDefault.value;
162
+ const customId = parseCustomThemeId(active);
163
+
164
+ // Active theme is itself a custom theme → copy its stored tokens directly
165
+ // (computed-style capture can't reconstruct a custom theme's full set).
166
+ if (customId && themesApi.data.value) {
167
+ const src = themesApi.data.value.custom.find((t) => t.id === customId);
168
+ if (src) {
169
+ const seed = {
170
+ id: nextAvailableId(`${src.id}-copy`),
171
+ name: `${src.name} (copy)`,
172
+ description: src.description ?? '',
173
+ family: 'custom',
174
+ isDark: src.isDark,
175
+ parentTheme: src.parentTheme,
176
+ tokens: { ...src.tokens },
177
+ };
178
+ sessionStorage.setItem('cpub-theme-editor-seed', JSON.stringify(seed));
179
+ router.push('/admin/theme/edit/__new');
180
+ return;
181
+ }
182
+ }
183
+
184
+ // Built-in / registered active theme → capture its applied tokens so the new
185
+ // theme reproduces the current look (a custom theme renders as base + tokens,
186
+ // so a complete capture is what keeps it from falling back to Classic).
187
+ const detected = detectAppliedOverrides();
188
+ const isBuiltInParent = themesApi.data.value?.builtIn.some((t) => t.id === active) ?? false;
158
189
  const seed = {
159
190
  id: nextAvailableId('my-theme'),
160
191
  name: 'My theme',
161
- description: '',
192
+ description: detected.count ? `Forked from the active theme (${detected.count} tokens).` : '',
162
193
  family: 'custom',
163
- isDark: false,
164
- parentTheme: 'base',
165
- tokens: {},
194
+ isDark: detected.isDark,
195
+ parentTheme: isBuiltInParent ? active : 'base',
196
+ tokens: detected.tokens,
166
197
  };
167
198
  sessionStorage.setItem('cpub-theme-editor-seed', JSON.stringify(seed));
168
199
  router.push('/admin/theme/edit/__new');
package/theme/stoa.css CHANGED
@@ -340,6 +340,40 @@
340
340
  }
341
341
 
342
342
 
343
+ /* ═══════════════════════════════════════════
344
+ UNIVERSAL-RADIUS GUARD
345
+ base.css applies `* { border-radius: var(--radius) }`. With Stoa's rounded
346
+ --radius that rounds things that must stay sharp — most visibly it clipped
347
+ the Town Square logo SVG into a blob. Keep SVG marks / icons / illustrations
348
+ square (avatars use <img> + --radius-full, so they're unaffected). Also pin
349
+ media inside cards to the card's own corners so the rounded, overflow-hidden
350
+ card clips them cleanly instead of leaving wedge gaps.
351
+ ═══════════════════════════════════════════ */
352
+
353
+ [data-theme="stoa"] svg,
354
+ [data-theme="stoa-dark"] svg { border-radius: 0; }
355
+
356
+ [data-theme="stoa"] .cpub-content-card img,
357
+ [data-theme="stoa-dark"] .cpub-content-card img,
358
+ [data-theme="stoa"] .cpub-card-cover,
359
+ [data-theme="stoa-dark"] .cpub-card-cover { border-radius: 0; }
360
+
361
+
362
+ /* ═══════════════════════════════════════════
363
+ EDGE DEFINITION
364
+ Slightly firmer card/panel borders so cards read as objects on the warm
365
+ grounds rather than floating tints.
366
+ ═══════════════════════════════════════════ */
367
+
368
+ [data-theme="stoa"] .cpub-content-card,
369
+ [data-theme="stoa"] .cpub-sb-card,
370
+ [data-theme="stoa"] .cpub-stat-card { border-color: rgba(42, 38, 32, 0.18); }
371
+
372
+ [data-theme="stoa-dark"] .cpub-content-card,
373
+ [data-theme="stoa-dark"] .cpub-sb-card,
374
+ [data-theme="stoa-dark"] .cpub-stat-card { border-color: rgba(241, 235, 218, 0.16); }
375
+
376
+
343
377
  /* ═══════════════════════════════════════════
344
378
  LOGO SWITCH
345
379
  Stoa shares Agora's Town Square mark (hide