@commonpub/layer 0.73.1 → 0.73.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.
|
@@ -65,6 +65,11 @@ onMounted(() => {
|
|
|
65
65
|
resizeObserver = new ResizeObserver(() => measure());
|
|
66
66
|
resizeObserver.observe(containerEl.value);
|
|
67
67
|
}
|
|
68
|
+
// Web fonts widen the ITEMS without resizing the container, so the
|
|
69
|
+
// ResizeObserver alone misses the post-FOUT width change.
|
|
70
|
+
if (typeof document !== 'undefined' && document.fonts?.ready) {
|
|
71
|
+
document.fonts.ready.then(() => measure()).catch(() => {});
|
|
72
|
+
}
|
|
68
73
|
});
|
|
69
74
|
onUnmounted(() => resizeObserver?.disconnect());
|
|
70
75
|
watch(shownItems, () => nextTick(measure));
|
|
@@ -19,8 +19,12 @@ const BUILTIN_COOKIES: CookieDefinition[] = [
|
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
name: 'cpub-color-scheme',
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
// Essential, not functional: it's a preference the user explicitly
|
|
23
|
+
// requests by pressing the Light/Dark toggle (consent-exempt class:
|
|
24
|
+
// stores no identifier, does no tracking). When it was consent-gated,
|
|
25
|
+
// anyone on "Essential only" lost their theme on every refresh.
|
|
26
|
+
category: 'essential',
|
|
27
|
+
description: 'Remembers your light/dark mode preference. Set only when you use the theme toggle.',
|
|
24
28
|
duration: '1 year',
|
|
25
29
|
},
|
|
26
30
|
];
|
package/composables/useTheme.ts
CHANGED
|
@@ -8,8 +8,11 @@ import { THEME_TO_FAMILY, FAMILY_VARIANTS } from '../utils/themeConfig';
|
|
|
8
8
|
* between light and dark mode within that theme's family. The server middleware
|
|
9
9
|
* resolves the correct theme on every request — no theme-selection cookie needed.
|
|
10
10
|
*
|
|
11
|
-
* The dark mode preference cookie (`cpub-color-scheme`) is
|
|
12
|
-
*
|
|
11
|
+
* The dark mode preference cookie (`cpub-color-scheme`) is an ESSENTIAL
|
|
12
|
+
* preference cookie (set only by the user pressing the toggle, no
|
|
13
|
+
* identifier) — always persisted, no consent gate. It used to be gated on
|
|
14
|
+
* functional consent, which silently dropped the preference on refresh for
|
|
15
|
+
* anyone who chose "Essential only".
|
|
13
16
|
*
|
|
14
17
|
* Custom themes (`cpub-custom-*`) and code-registered themes pass through —
|
|
15
18
|
* the user's cookie toggle is recorded but the server picks the actual variant
|
|
@@ -35,15 +38,12 @@ export function useTheme(): {
|
|
|
35
38
|
path: '/',
|
|
36
39
|
sameSite: 'lax',
|
|
37
40
|
});
|
|
38
|
-
const { allowsFunctional } = useCookieConsent();
|
|
39
|
-
|
|
40
41
|
function setDarkMode(dark: boolean): void {
|
|
41
42
|
isDark.value = dark;
|
|
42
43
|
|
|
43
|
-
//
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
44
|
+
// Always persist — pressing the toggle IS the consent for this
|
|
45
|
+
// preference cookie (registered as essential in useCookieConsent).
|
|
46
|
+
schemeCookie.value = dark ? 'dark' : 'light';
|
|
47
47
|
|
|
48
48
|
// Custom light/dark PAIR: both variants' tokens are injected (scoped to
|
|
49
49
|
// their data-theme attr), so flip the attribute client-side for an instant
|
package/layouts/default.vue
CHANGED
|
@@ -385,7 +385,15 @@ const userUsername = computed(() => user.value?.username ?? '');
|
|
|
385
385
|
:deep(.cpub-mobile-link--indent) { padding-left: 36px; }
|
|
386
386
|
:deep(.cpub-mobile-link--disabled) { opacity: 0.35; cursor: not-allowed; pointer-events: none; }
|
|
387
387
|
|
|
388
|
-
|
|
388
|
+
/* The spacer takes NO share of the free space — the nav does (flex:1). This
|
|
389
|
+
is load-bearing for the priority nav: its measurement reads the nav's
|
|
390
|
+
allocated width, and a flex-basis:auto item that SPLITS slack with a
|
|
391
|
+
spacer gets an allocation that depends on its own content — collapsing
|
|
392
|
+
links shrinks the nav, which re-justifies the collapse (a ratchet: links
|
|
393
|
+
hidden beside a huge empty gap). With the spacer inert, the nav's
|
|
394
|
+
allocation is `row minus everything else`, independent of what's
|
|
395
|
+
collapsed, so the measurement is stable in both directions. */
|
|
396
|
+
.cpub-topbar-spacer { flex: 0 0 0; }
|
|
389
397
|
.cpub-topbar-actions { display: flex; align-items: center; gap: 6px; }
|
|
390
398
|
|
|
391
399
|
.cpub-search-btn { display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: var(--surface2); border: var(--border-width-default) solid var(--border2); color: var(--text-dim); font-size: 12px; min-width: 180px; text-decoration: none; transition: border-color 0.15s, box-shadow 0.15s; cursor: text; }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commonpub/layer",
|
|
3
|
-
"version": "0.73.
|
|
3
|
+
"version": "0.73.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./nuxt.config.ts",
|
|
6
6
|
"files": [
|
|
@@ -54,16 +54,16 @@
|
|
|
54
54
|
"vue-router": "^4.3.0",
|
|
55
55
|
"zod": "^4.3.6",
|
|
56
56
|
"@commonpub/auth": "0.8.0",
|
|
57
|
+
"@commonpub/docs": "0.6.3",
|
|
57
58
|
"@commonpub/config": "0.22.1",
|
|
58
59
|
"@commonpub/editor": "0.7.11",
|
|
60
|
+
"@commonpub/explainer": "0.7.15",
|
|
59
61
|
"@commonpub/learning": "0.5.2",
|
|
60
62
|
"@commonpub/protocol": "0.13.0",
|
|
61
63
|
"@commonpub/schema": "0.40.1",
|
|
62
|
-
"@commonpub/theme-studio": "0.6.1",
|
|
63
64
|
"@commonpub/server": "2.84.1",
|
|
64
|
-
"@commonpub/
|
|
65
|
-
"@commonpub/ui": "0.13.1"
|
|
66
|
-
"@commonpub/docs": "0.6.3"
|
|
65
|
+
"@commonpub/theme-studio": "0.6.1",
|
|
66
|
+
"@commonpub/ui": "0.13.1"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@testing-library/jest-dom": "^6.9.1",
|
package/pages/privacy.vue
CHANGED
|
@@ -67,7 +67,7 @@ const { federation: federationEnabled } = useFeatures();
|
|
|
67
67
|
<ul>
|
|
68
68
|
<li><strong>Session cookie</strong> (<code>better-auth.session_token</code>): strictly necessary, authenticates your login session. HttpOnly, secure, 7-day expiry.</li>
|
|
69
69
|
<li><strong>Consent cookie</strong> (<code>cpub-consent</code>): strictly necessary, stores your cookie consent choice.</li>
|
|
70
|
-
<li><strong>Color scheme</strong> (<code>cpub-color-scheme</code>):
|
|
70
|
+
<li><strong>Color scheme</strong> (<code>cpub-color-scheme</code>): strictly necessary preference, remembers your light/dark mode choice. Set only when you use the theme toggle. No identifier, no tracking.</li>
|
|
71
71
|
</ul>
|
|
72
72
|
<p>We do not use any advertising or tracking cookies. Your instance operator may add analytics cookies, these require your explicit consent. For the full list of cookies and to manage your preferences, visit our <NuxtLink to="/cookies">Cookie Policy</NuxtLink>.</p>
|
|
73
73
|
</section>
|