@altafusion/fugue-content 0.0.0-stage → 0.2.0

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.
Files changed (92) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/LICENSE +21 -0
  3. package/README.md +352 -2
  4. package/app/components/FugueContent404Page.vue +48 -0
  5. package/app/components/FugueContentAuthSignOut.vue +16 -0
  6. package/app/components/FugueContentContentPage.vue +33 -0
  7. package/app/components/FugueContentEditContent.vue +76 -0
  8. package/app/components/FugueContentEditorMenu.vue +60 -0
  9. package/app/components/FugueContentFooterActions.vue +32 -0
  10. package/app/components/FugueContentFragment.vue +53 -0
  11. package/app/components/FugueContentHeaderActions.vue +37 -0
  12. package/app/components/FugueContentLandingPage.vue +69 -0
  13. package/app/components/FugueContentLayoutArticle.vue +22 -0
  14. package/app/components/FugueContentLayoutArticleAside.vue +88 -0
  15. package/app/components/FugueContentLayoutLanding.vue +5 -0
  16. package/app/components/LandingHeroMedia.vue +91 -0
  17. package/app/components/content/CallToAction.vue +35 -0
  18. package/app/components/content/Hero.vue +34 -0
  19. package/app/composables/useFugueContentCatchAllRoute.ts +91 -0
  20. package/app/composables/useFugueContentFragment.ts +70 -0
  21. package/app/composables/useFugueContentI18n.ts +77 -0
  22. package/app/composables/useFugueContentLanding.ts +24 -0
  23. package/app/composables/useFugueContentPage.ts +37 -0
  24. package/app/composables/useFugueContentSettings.ts +140 -0
  25. package/app/composables/useFugueContentStudioEdit.ts +38 -0
  26. package/app/pages/[...slug].vue +7 -0
  27. package/app/pages/fragments/[slug].vue +25 -0
  28. package/app/pages/index.vue +7 -0
  29. package/app/pages/login.vue +70 -0
  30. package/app/plugins/auth-session-sync.client.ts +33 -0
  31. package/app/plugins/landing-component-registry.ts +15 -0
  32. package/app/plugins/landing-nav.ts +26 -0
  33. package/app/plugins/qe-tools.client.ts +28 -0
  34. package/app/plugins/seo-defaults.ts +4 -0
  35. package/app/plugins/settings-bridge.ts +14 -0
  36. package/app/plugins/shell-display-name.ts +18 -0
  37. package/app/plugins/studio-auto-open.client.ts +30 -0
  38. package/app/plugins/studio-dev-shortcut.client.ts +24 -0
  39. package/app/plugins/studio-footer-actions.client.ts +27 -0
  40. package/app/plugins/studio-footer-actions.server.ts +11 -0
  41. package/app/plugins/studio-hash-cleanup.client.ts +12 -0
  42. package/app/plugins/studio-header-actions.client.ts +30 -0
  43. package/app/plugins/studio-header-actions.server.ts +13 -0
  44. package/app/utils/studio-mount.ts +72 -0
  45. package/composables/useFugueContentAuthMode.ts +16 -0
  46. package/composables/useFugueContentAuthSignOut.ts +82 -0
  47. package/composables/useFugueContentPeekSession.ts +31 -0
  48. package/composables/useFugueContentStudioEditorEntry.ts +112 -0
  49. package/composables/useFugueContentStudioSession.ts +81 -0
  50. package/content.config.ts +199 -0
  51. package/content.d.ts +25 -0
  52. package/eslint.config.mjs +4 -0
  53. package/lib/404-defaults.ts +41 -0
  54. package/lib/article-i18n.ts +10 -0
  55. package/lib/auth-resolve.ts +74 -0
  56. package/lib/auth-utils.ts +44 -0
  57. package/lib/define-site.ts +156 -0
  58. package/lib/header-actions-registration.ts +42 -0
  59. package/lib/i18n-locales.ts +22 -0
  60. package/lib/i18n-utils.ts +136 -0
  61. package/lib/i18n.ts +2 -0
  62. package/lib/landing.ts +129 -0
  63. package/lib/login-redirect.ts +12 -0
  64. package/lib/netlify-ssr.ts +113 -0
  65. package/lib/page-toc.ts +14 -0
  66. package/lib/qe-tools/index.ts +36 -0
  67. package/lib/qe-tools/studio-drafts.ts +315 -0
  68. package/lib/qe-tools/types.ts +14 -0
  69. package/lib/settings-state.ts +1 -0
  70. package/lib/site-config-registry.ts +80 -0
  71. package/lib/studio-activation-gated.d.ts +20 -0
  72. package/lib/studio-activation-gated.js +127 -0
  73. package/lib/studio-auto-open.ts +26 -0
  74. package/lib/studio-cookies.d.ts +10 -0
  75. package/lib/studio-cookies.js +11 -0
  76. package/lib/studio-document-edit.ts +61 -0
  77. package/lib/studio-editor-visibility.ts +54 -0
  78. package/lib/studio-open.ts +7 -0
  79. package/lib/studio-session.ts +91 -0
  80. package/modules/i18n.ts +80 -0
  81. package/modules/landing-components.ts +95 -0
  82. package/modules/studio-auth-gate.ts +48 -0
  83. package/modules/studio-entry.ts +23 -0
  84. package/nuxt.config.ts +90 -0
  85. package/package.json +66 -3
  86. package/schemas/site-settings.schema.json +127 -0
  87. package/server/middleware/studio-oauth-redirect.ts +36 -0
  88. package/server/middleware/studio-provider-check.ts +59 -0
  89. package/server/plugins/studio-hash-cleanup.ts +8 -0
  90. package/tsconfig.build.json +22 -0
  91. package/tsconfig.json +20 -0
  92. package/types/site.ts +79 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,25 @@
1
+ # @altafusion/fugue-content
2
+
3
+ ## 0.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 7767e60: Rebrand for the public release. In `@altafusion/shell`, `CODERMAR_BRANDS`, `CODERMAR_BRAND_THEME` and `utils/codermarBrandTheme` become `ALTAFUSION_*` and `utils/altafusionBrandTheme`, and the brand cookie key is now `altafusion:brand`. In `@altafusion/msw`, the `codermarMsw*` exports become `altafusionMsw*`. The site settings schema `$id` is now `https://altafusion.com/schemas/site-settings.json`. Package descriptions and docs no longer reference private sites.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [7767e60]
12
+ - @altafusion/fugue-simple-auth@0.2.0
13
+ - @altafusion/fugue-theme@0.2.0
14
+ - @altafusion/nuxt-base@0.2.0
15
+ - @altafusion/shell@0.2.0
16
+
17
+ ## 0.1.1
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies [cd1a639]
22
+ - @altafusion/shell@0.1.1
23
+ - @altafusion/fugue-simple-auth@0.1.1
24
+ - @altafusion/fugue-theme@0.1.1
25
+ - @altafusion/nuxt-base@0.1.1
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Altafusion
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,353 @@
1
- # Temporary Holding Version
1
+ # @altafusion/fugue-content
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Nuxt layer for **Fugue Content sites** — Nuxt Content, MDC blocks, and content routing. Composes with **`@altafusion/shell`** (site chrome stays in shell).
4
+
5
+ Blueprint: developer-docs **`/fugue-content`**. Starter app: **`templates/fugue-content-site/`**.
6
+
7
+ ## Layer stack
8
+
9
+ ```text
10
+ app extends @altafusion/fugue-theme + @altafusion/shell (+ @altafusion/fugue-content, …)
11
+ shell → fugue-ui → fugue-nuxt-ui → nuxt-base
12
+ fugue-theme → fugue-nuxt-ui → nuxt-base
13
+ @altafusion/fugue-content → shell → app
14
+ ```
15
+
16
+ ## Setup
17
+
18
+ Use **`defineFugueContentSite()`** so the consumer stack, Studio, and `createAppConfig` merge in one place.
19
+
20
+ **Config registry (recommended):** keep **`site.config.ts`** as the alias-style registry (named sections + combined export). **`nuxt.config.ts`** stays a thin entry:
21
+
22
+ ```ts
23
+ // nuxt.config.ts
24
+ import { defineFugueContentSite } from '@altafusion/fugue-content/define-site'
25
+ import { siteConfig, siteConfigTheme } from './site.config'
26
+
27
+ export default defineNuxtConfig(defineFugueContentSite(siteConfig, siteConfigTheme))
28
+ ```
29
+
30
+ ```ts
31
+ // site.config.ts — section order: theme → identity → content → studio → dev
32
+ import { fugueContentStudioSection } from '@altafusion/fugue-content/site-config-registry'
33
+ import { siteConfigThemeFromPalette } from '@altafusion/nuxt-base/ui-theme'
34
+ import { sitePalette } from './palette'
35
+
36
+ export const siteConfigTheme = siteConfigThemeFromPalette(sitePalette)
37
+
38
+ export const siteConfigIdentity = {
39
+ runtimeConfig: { public: { appName: 'My Site', appNav: [/* … */] } },
40
+ app: { head: { link: [{ rel: 'icon', type: 'image/svg+xml', href: '/favicon.svg' }] } },
41
+ css: ['~/assets/css/main.css'],
42
+ }
43
+
44
+ export const siteConfigContent = {
45
+ i18n: {
46
+ defaultLocale: 'en',
47
+ locales: [
48
+ { code: 'en', name: 'English', file: 'en.yaml', isCatchallLocale: true },
49
+ { code: 'es', name: 'Español', file: 'es.yaml' },
50
+ ],
51
+ },
52
+ }
53
+
54
+ export const siteConfigStudio = fugueContentStudioSection({
55
+ rootDir: 'apps/my-site',
56
+ messagePrefix: 'content(my-site):',
57
+ })
58
+
59
+ export const siteConfigDev = { /* devServer, vite — see templates/fugue-content-site */ }
60
+
61
+ export const siteConfig = {
62
+ ...siteConfigIdentity,
63
+ ...siteConfigContent,
64
+ ...siteConfigStudio,
65
+ ...siteConfigDev,
66
+ }
67
+ ```
68
+
69
+ **Shared builder:** **`fugueContentStudioSection()`** from **`@altafusion/fugue-content/site-config-registry`** — standard monorepo Studio block (`owner`, `repo`, `rootDir`, commit prefix).
70
+
71
+ **Theming:** export **`sitePalette`** from **`palette.ts`**; wire with **`siteConfigThemeFromPalette`** and **`mirrorAppUiThemeFromPalette`** — see **`templates/fugue-content-site/palette.ts`** and **[Theming](/fugue-content/theming#named-palette-collections)** in developer-docs.
72
+
73
+ Reference implementation: **`templates/fugue-content-site/site.config.ts`** + **`templates/fugue-content-site/palette.ts`**.
74
+
75
+ Or extend the layer manually with `createAppConfig` — see **`templates/fugue-content-site/nuxt.config.ts`**.
76
+
77
+ **Styling:** `@altafusion/fugue-theme` must be a **direct** `extends` entry (same as `templates/fugue-content-site`). That registers `@nuxt/ui`, theme CSS, and Tailwind. MDC blocks in this layer use **`UButton`** and semantic utilities (`text-highlighted`, `text-muted`) — not bespoke scoped CSS.
78
+
79
+ **Dependencies** (app or template `package.json`):
80
+
81
+ ```json
82
+ {
83
+ "dependencies": {
84
+ "@altafusion/fugue-theme": "workspace:*",
85
+ "@altafusion/shell": "workspace:*",
86
+ "@altafusion/fugue-content": "workspace:*",
87
+ "better-sqlite3": "catalog:content"
88
+ },
89
+ "devDependencies": {
90
+ "debug": "catalog:utils",
91
+ "extend": "catalog:utils",
92
+ "slugify": "catalog:utils"
93
+ }
94
+ }
95
+ ```
96
+
97
+ Root **`pnpm-workspace.yaml`** must set **`nodeLinker: hoisted`** for Content SQLite (same as `developer-docs`).
98
+
99
+ ## Routing
100
+
101
+ Content routes ship in **`@altafusion/fugue-content`** (`app/pages/index.vue`, `app/pages/[...slug].vue`). Apps add **`pages/**` only** for interactive product routes that must override content paths.
102
+
103
+ Logic lives in **`useFugueContentCatchAllRoute()`**, **`FugueContentContentPage`**, **`FugueContent404Page`**, and **`FugueContentLayout*`** components.
104
+
105
+ Missing content paths render **`FugueContent404Page`** (404 status + generic copy). Override in the consumer app with **`app/components/FugueContent404Page.vue`** — same component name, optional props (`title`, `description`, `actionLabel`, `actionTo`).
106
+
107
+ Add markdown under the app **`content/`** directory.
108
+
109
+ **Monolingual** (default):
110
+
111
+ ```text
112
+ content/
113
+ index.md → /
114
+ about.md → /about
115
+ ```
116
+
117
+ **Multilingual** — set `i18n.locales` in `defineFugueContentSite()` and use locale folders (see **`templates/fugue-content-site`**):
118
+
119
+ ```text
120
+ content/
121
+ en/
122
+ index.md → /
123
+ about.md → /about
124
+ es/
125
+ index.md → /es
126
+ about.md → /es/about
127
+ ```
128
+
129
+ UI chrome strings live in **`i18n/locales/*.yaml`** (not in markdown). Full design: developer-docs **`/fugue-content/starter-template/i18n`**.
130
+
131
+ ### Fragments (embed in Vue pages)
132
+
133
+ Studio-editable sections inside product routes — not served by the catch-all:
134
+
135
+ ```text
136
+ content/en/fragments/app-demo.md → fragments_en collection
137
+ app/pages/app/demo.vue → <FugueContentFragment slug="app-demo" />
138
+ /fragments/app-demo → Studio preview route (pages/fragments/[slug].vue)
139
+ ```
140
+
141
+ | Piece | Role |
142
+ |-------|------|
143
+ | **`fragments` / `fragments_{locale}`** | Markdown under `content/{locale}/fragments/`; excluded from `pages_*` |
144
+ | **`useFugueContentFragment(slug)`** | Loads fragment by file stem for the active locale |
145
+ | **`FugueContentFragment`** | `ContentRenderer` wrapper with loading / error states |
146
+
147
+ ## Site settings and SEO
148
+
149
+ Locale-aware site metadata — **`siteName`** (header title), phone, address, hours, social links, default OG — lives in a **`settings_{locale}`** data collection (not routed). **Developer-docs:** **[Settings & Metadata](/fugue-content/starter-template/settings-and-metadata)**.
150
+
151
+ ```text
152
+ content/en/settings/site.yml → settings_en collection
153
+ content/es/settings/site.yml → settings_es collection
154
+ ```
155
+
156
+ IDE validation: `packages-consumer/fugue-content/schemas/site-settings.schema.json` (wired in workspace `.vscode/settings.json`). Add the modeline at the top of `site.yml` when editing outside this repo layout.
157
+
158
+ | Piece | Role |
159
+ |-------|------|
160
+ | **`settings` / `settings_{locale}`** | YAML under `content/{locale}/settings/`; Studio-editable |
161
+ | **`useFugueContentSettings()`** | Loads active locale settings document |
162
+ | **`landing.sections` in settings** | One-page manifest — order, anchors, `component`, optional `nav` |
163
+ | **`FugueContentLandingPage`** | Renders manifest sections with dynamic components (default `FugueContentFragment`) |
164
+ | **`useFugueContentLanding()`** | Computed sections from `settings.landing` |
165
+ | **`landing-nav` plugin** | Registers shell nav from sections that define `nav` |
166
+ | **`shell-display-name` plugin** | Header title from `settings.siteName` (logo in `app.config` `brand`) |
167
+ | **`useFugueContentSiteSeo(overrides?)`** | Merges settings `seo`, `app.config` `seo`, and per-page title/description; sets OG/Twitter meta |
168
+ | **`seo-defaults` plugin** | Applies site-wide SEO defaults on every route |
169
+
170
+ Per-page meta still comes from content frontmatter (`title`, `description`) or explicit `useFugueContentSiteSeo()` on Vue routes. Fallbacks: **`app/app.config.ts`** → `seo` block.
171
+
172
+ **One-page landings** — `landing.sections` in `site.yml`:
173
+
174
+ ```yaml
175
+ landing:
176
+ sections:
177
+ - slug: hero
178
+ anchor: home
179
+ component: FugueContentFragment
180
+ nav: { labelKey: nav.home, label: Home, icon: i-lucide-home, id: home }
181
+ - slug: activities
182
+ anchor: activities
183
+ component: FugueContentFragment
184
+ variant: alt
185
+ - slug: hero
186
+ anchor: home
187
+ sectionClass: landing-hero
188
+ component:
189
+ name: LandingHeroMedia
190
+ props:
191
+ src: /assets/img/hero.jpg
192
+ alt: Example hero
193
+ slug: hero
194
+ ```
195
+
196
+ **`component`** — string shorthand (`FugueContentFragment`) or an object with **`name`** and nested **`props`**. Keep props under the component they configure; do not use a sibling top-level `props` key on the section row.
197
+
198
+ **`LandingHeroMedia`** — responsive bookend hero shell (image above on mobile, content, image below on desktop). Pass `src` and `alt` in `component.props`. Slot content: `slug` (defaults to the section `slug` for `FugueContentFragment`) or `contentComponent` for an app hero (e.g. `MyHero`).
199
+
200
+ Per-section `sectionClass` overrides the page-level `section-class` on `<FugueContentLandingPage />` for that row only. `variant` still appends `{sectionClass}--{variant}` using the resolved base class.
201
+
202
+ Vue route: `<FugueContentLandingPage section-class="my-section" />`. Add a section by creating `fragments/{slug}.md` and a new manifest row — no `index.vue` edit.
203
+
204
+ **Custom landing components** (e.g. `MyHero` instead of `FugueContentFragment`) — list the PascalCase name in `landing.sections[].component`. The **`fugue-content-landing-components`** module scans `site.yml` and registers those app components globally so SSR includes them for dynamic `:is`. Override or extend with the **`components`** prop on `FugueContentLandingPage` when needed.
205
+
206
+ ## Internationalization
207
+
208
+ When the app passes **`i18n.locales`** to **`defineFugueContentSite()`**:
209
+
210
+ | Piece | Role |
211
+ |-------|------|
212
+ | **`modules/i18n`** | Registers `@nuxtjs/i18n` when locales are configured |
213
+ | **`content.config.ts`** | Builds **`pages_en`**, **`pages_es`**, **`fragments_*`**, **`settings_*`**, … per locale folder |
214
+ | **`useFugueContentI18n()`** | Locale + pages/fragments/settings collection names |
215
+ | **`useFugueContentCatchAllRoute()`** | Queries the active locale’s collection |
216
+ | **`useFugueContentI18n().localePath()`** | Resolves MDC / in-content links (`CallToAction`, `Hero`) |
217
+ | **`FugueContent404Page`** | **`useShellI18n().t()`** for copy (`fugueContent404.*` keys); **`localePath('/')`** for home link |
218
+ | **`@altafusion/shell`** | **`ShellLangToggle`**, **`useShellI18n`**, **`useAppNav`** (`labelKey` + `localePath`) |
219
+
220
+ Defaults merged by **`defineFugueContentSite()`**: `strategy: 'prefix_except_default'`, `langDir: 'locales'` (files in `i18n/locales/`), **`detectBrowserLanguage: false`** ( **`/`** stays default locale until the user opens **`/es`** or the header language link). Omit **`i18n`** for single-locale apps — flat **`pages`** collection unchanged.
221
+
222
+ ### Header nav (multilingual)
223
+
224
+ | File | Role |
225
+ |------|------|
226
+ | App **`site.config.ts`** → `appNav` | Locale-neutral **`to`**, **`labelKey`**, **`id`**, icon |
227
+ | App **`i18n/locales/*.yaml`** | **`nav.*`** nav labels; **`fugueContent404.*`** 404 page copy (English fallbacks in layer when keys are absent) |
228
+
229
+ See developer-docs **`/fugue-content/starter-template/i18n`** for full examples.
230
+
231
+
232
+ ### Frontmatter
233
+
234
+ ```yaml
235
+ ---
236
+ title: About us
237
+ description: Short summary for SEO
238
+ layout: landing # landing | article | article-aside (default: landing)
239
+ nav:
240
+ primary: about # matches shell header active id
241
+ ---
242
+ ```
243
+
244
+ Long-form pages: **`layout: article`** (prose + per-page **Edit**) or **`layout: article-aside`** (+ **On This Page** TOC from markdown headings). See developer-docs **[Article Layouts](/fugue-content/starter-template/article-layouts)**.
245
+
246
+ ## MDC blocks
247
+
248
+ Shared marketing blocks live in `app/components/content/`. Apps override by the **same component name** only when branding or layout requires it — not by default.
249
+
250
+ ### Naming
251
+
252
+ | Audience | Convention |
253
+ |----------|------------|
254
+ | **Editors (Studio)** | Pick blocks from the `/` menu; prop labels should read plainly (`label`, `to`, `actionLabel`) |
255
+ | **Shared blocks (Fugue Content)** | Plain PascalCase — `Hero`, `CallToAction`, `FeatureGrid` — no `FugueContent` prefix |
256
+ | **Package internals** | `FugueContent*` prefix — `useFugueContentI18n`, `FugueContentContentPage`, `defineFugueContentSite` |
257
+ | **App-only blocks** | Site-specific names — `OverrideDemo`, `EnrollmentForm` |
258
+ | **Dev shorthand** | Optional `mdc.components.map` alias — e.g. `cta` → `CallToAction` |
259
+
260
+ | Component | MDC tag | Props |
261
+ |-----------|---------|-------|
262
+ | `Hero` | `::hero` | `title`, `description`, `actionLabel`, `actionTo` (locale-neutral; resolved at render) |
263
+ | `CallToAction` | `::call-to-action` (alias `:cta`) | `label`, `to`, `variant` (locale-neutral `to`) |
264
+
265
+ Example:
266
+
267
+ ```md
268
+ ::hero
269
+ ---
270
+ title: Welcome
271
+ description: Fugue Content Starter
272
+ actionLabel: Learn more
273
+ actionTo: /about
274
+ ---
275
+ ::
276
+ ```
277
+
278
+ ## Studio
279
+
280
+ **`nuxt-studio`** is registered in this layer. Apps enable editing via **`defineFugueContentSite({ studio: { … } })`** (see **`templates/fugue-content-site`**).
281
+
282
+ | Piece | Role |
283
+ |-------|------|
284
+ | **Layer** | `modules: ['@nuxt/content', 'nuxt-studio']` |
285
+ | **App config** | `studio.repository` — `owner`, `repo`, `branch`, optional `rootDir` for monorepo apps |
286
+ | **Env vars** | `STUDIO_GOOGLE_*` or `STUDIO_GITHUB_*`, `STUDIO_GITHUB_TOKEN` for publish — see **[Docus Studio requirements](/docs-site/setup/requirements)** (same module) |
287
+ | **Dev deps** | `debug`, `extend`, `slugify` in the app `package.json` |
288
+
289
+ Open **`/_studio`** in dev after setting OAuth env vars. Production editing requires **`nuxt build` + Netlify SSR** (not static/`nuxt generate` alone). Editors sign in at **`/login`** — Google OAuth in production; dev establishes a local session and redirects back.
290
+
291
+ **Auth mode:** Default pilots set **`fugueContentAuthModeSection('studio')`** in **`site.config.ts`** — Google OAuth only. Optional peek gate: **`authMode: 'peek'`** + **`fugueContentAuthSection()`** — see **[Auth Mode](/fugue-content/starter-template/studio-access-setup#auth-mode-site-manifest)**.
292
+
293
+ **Deploy checklist:** developer-docs **[Pilot deploy checklist](/fugue-content/starter-template/pilot-deploy-checklist)** — applies to all Fugue Content pilots.
294
+
295
+ ### Auth Mode (`site.config.ts`)
296
+
297
+ | `authMode` | Manifest | Peek (`SITE_ACCESS_KEY`) | Production editing |
298
+ |------------|----------|--------------------------|-------------------|
299
+ | **`studio`** | **`fugueContentAuthModeSection('studio')`** | Off — env ignored | **`/login`** → Google OAuth → avatar menu |
300
+ | **`peek`** | **`authMode: 'peek'`** + **`fugueContentAuthSection()`** | **`/login`** access key | Peek → **`/login`** / Google → avatar menu |
301
+ | **`auto`** | Omit or peek helper | Studio env wins when both set | See **[Auth Mode](/fugue-content/starter-template/studio-access-setup#auth-mode-site-manifest)** |
302
+
303
+ **`defineFugueContentSite()`** resolves mode at build → **`runtimeConfig.public.fugueContent.authMode`**. fugue-simple-auth loads **only** when mode is **`peek`**.
304
+
305
+ ### Optional Peek Gate (`authMode: 'peek'`)
306
+
307
+ For pre-launch or staging, add **`fugueContentAuthSection()`** with **`authMode: 'peek'`** and set **`SITE_ACCESS_KEY`** on Netlify **Functions**. **`routes`** peek scope keeps the brochure public; **`full`** locks the whole site.
308
+
309
+ ```ts
310
+ export const siteConfigAuth = {
311
+ authMode: 'peek' as const,
312
+ ...fugueContentAuthSection({
313
+ cookieSlug: 'my-app',
314
+ loginDescription: 'Enter the access key to open the content editor.',
315
+ }),
316
+ }
317
+ ```
318
+
319
+ | Piece | Role |
320
+ |-------|------|
321
+ | **`resolveFugueContentSiteAuth()`** | Manifest + env hierarchy |
322
+ | **`defineFugueContentSite({ auth, studio, authMode })`** | Extends fugue-simple-auth only for **`peek`** |
323
+ | **`useFugueContentAuthMode()`** | Runtime **`hasPeekGate`**, **`authMode`** |
324
+ | **`useFugueContentStudioSession()`** | Studio Google/dev session + avatar user |
325
+ | **`/login`** | Unified editor entry (OAuth or peek access key) |
326
+ | **`FugueContentEditorMenu`** + **`useFugueContentStudioEditorEntry`** | Avatar menu — **Edit content**, **Sign Out** |
327
+ | **Env vars** | **`STUDIO_GOOGLE_*`** (Functions); **`SITE_ACCESS_KEY`** only for peek — see **[Site env vars](/monorepo/development/site-env-vars)** |
328
+
329
+ Feature walkthrough: **[Auth Mode](/fugue-content/starter-template/studio-access-setup#auth-mode-site-manifest)** · **[Configure Google OAuth](/fugue-content/starter-template/studio-access-setup#configure-google-oauth)** · **[User Content Workflows](/fugue-content/starter-template/user-content-workflows)** · **[Studio Module](https://nuxt.studio/setup)** on developer-docs.
330
+
331
+ **Upstream fixes:** validate a local nuxt-studio checkout before catalog bumps — developer-docs **[Upstream watch](/priority-compass/upstream-watch#nuxt-studio-fugue-content)** (`pnpm link:nuxt-studio` / `pnpm unlink:nuxt-studio`).
332
+
333
+ ### qeTools (operator console)
334
+
335
+ Every Fugue Content app registers **`window.qeTools`** in the browser (dev and production). **Console-only** — there is no on-page panel. **`studioDrafts`** targets **production** IndexedDB drafts (Netlify); **local dev** writes to disk — use **`git restore`** instead.
336
+
337
+ Open **DevTools → Console**, then:
338
+
339
+ ```text
340
+ qeTools.help()
341
+ await qeTools.studioDrafts.list()
342
+ ```
343
+
344
+ Optional discovery: add **`?qetools`** to the URL — help text prints to the console on load (still requires DevTools open).
345
+
346
+ Import in code: **`@altafusion/fugue-content/qe-tools`** or **`@altafusion/fugue-content/qe-tools/studio-drafts`**.
347
+
348
+ Developer-docs: **[User Content Workflows — qeTools](/fugue-content/starter-template/user-content-workflows#qetools-operator-console)** · **[User Guide — Undo and Recover](/fugue-content/user-guide/undo-and-recover)** · **[Priority Compass — Editing Pilot](/priority-compass/now)**.
349
+
350
+ ## Related
351
+
352
+ - **`@altafusion/shell`** — headers, footers, `useAppNav`
353
+ - **`templates/fugue-content-site`** — copy to `apps/<name>` when scaffolding a site
@@ -0,0 +1,48 @@
1
+ <script setup lang="ts">
2
+ import { FUGUE_CONTENT_404_DEFAULTS, resolveFugueContent404Copy } from '../../lib/404-defaults';
3
+
4
+ const props = defineProps<{
5
+ statusCode?: number
6
+ title?: string
7
+ description?: string
8
+ actionLabel?: string
9
+ actionTo?: string
10
+ }>()
11
+
12
+ const { localePath, t } = useShellI18n()
13
+
14
+ const copy = computed(() => resolveFugueContent404Copy(t))
15
+ const statusCode = computed(() => props.statusCode ?? FUGUE_CONTENT_404_DEFAULTS.statusCode)
16
+ const title = computed(() => props.title ?? copy.value.title)
17
+ const description = computed(() => props.description ?? copy.value.description)
18
+ const actionLabel = computed(() => props.actionLabel ?? copy.value.actionLabel)
19
+ const actionTo = computed(() => props.actionTo ?? FUGUE_CONTENT_404_DEFAULTS.actionTo)
20
+
21
+ const homeHref = computed(() => localePath(actionTo.value))
22
+ </script>
23
+
24
+ <template>
25
+ <section
26
+ class="flex flex-col items-center gap-4 py-8 mt-18 sm:py-12"
27
+ aria-labelledby="fugue-content-404-title"
28
+ >
29
+ <!-- <p class="text-sm font-medium uppercase tracking-wide text-muted">
30
+ {{ statusCode }}
31
+ </p> -->
32
+ <h1
33
+ id="fugue-content-404-title"
34
+ class="text-4xl font-bold tracking-tight text-highlighted sm:text-5xl"
35
+ >
36
+ {{ title }}
37
+ </h1>
38
+ <p class="max-w-2xl text-lg text-muted">
39
+ {{ description }}
40
+ </p>
41
+ <UButton
42
+ :to="homeHref"
43
+ :label="actionLabel"
44
+ size="lg"
45
+ class="self-center"
46
+ />
47
+ </section>
48
+ </template>
@@ -0,0 +1,16 @@
1
+ <script setup lang="ts">
2
+ const { showPeekSignOut, signOut } = useFugueContentAuthSignOut()
3
+ </script>
4
+
5
+ <template>
6
+ <UButton
7
+ v-if="showPeekSignOut"
8
+ variant="ghost"
9
+ color="neutral"
10
+ size="sm"
11
+ icon="i-lucide-door-open"
12
+ label="Sign Out"
13
+ class="px-1.5"
14
+ @click="signOut"
15
+ />
16
+ </template>
@@ -0,0 +1,33 @@
1
+ <script setup lang="ts">
2
+ const { contentPage, error, loading } = useFugueContentCatchAllRoute()
3
+ </script>
4
+
5
+ <template>
6
+ <div
7
+ v-if="error"
8
+ class="p-6 text-muted"
9
+ >
10
+ <p>Failed to load content.</p>
11
+ </div>
12
+ <div
13
+ v-else-if="loading"
14
+ class="p-6 text-muted"
15
+ aria-busy="true"
16
+ />
17
+ <FugueContent404Page v-else-if="!contentPage" />
18
+ <FugueContentLayoutArticleAside
19
+ v-else-if="contentPage.layout === 'article-aside'"
20
+ :page="contentPage"
21
+ >
22
+ <ContentRenderer :value="contentPage" />
23
+ </FugueContentLayoutArticleAside>
24
+ <FugueContentLayoutArticle
25
+ v-else-if="contentPage.layout === 'article'"
26
+ :stem="typeof contentPage.stem === 'string' ? contentPage.stem : undefined"
27
+ >
28
+ <ContentRenderer :value="contentPage" />
29
+ </FugueContentLayoutArticle>
30
+ <FugueContentLayoutLanding v-else>
31
+ <ContentRenderer :value="contentPage" />
32
+ </FugueContentLayoutLanding>
33
+ </template>
@@ -0,0 +1,76 @@
1
+ <script setup lang="ts">
2
+ import { FUGUE_CONTENT_ARTICLE_DEFAULTS, FUGUE_CONTENT_ARTICLE_I18N_KEYS } from '../../lib/article-i18n'
3
+
4
+ const {
5
+ pageStem,
6
+ fragmentSlug,
7
+ requireSession = true,
8
+ } = defineProps<{
9
+ /** Open a routed page markdown file in Studio (e.g. `policies`). */
10
+ pageStem?: string
11
+ /** Open a fragment markdown file in Studio (e.g. `activities`). */
12
+ fragmentSlug?: string
13
+ /**
14
+ * When true (default), hide until signed in — use on inline content chrome.
15
+ * Footer chrome sets false so anonymous users route through `/login`.
16
+ */
17
+ requireSession?: boolean
18
+ }>()
19
+
20
+ const { handleEditEntry } = useFugueContentStudioEditorEntry()
21
+ const { page } = useFugueContentPage()
22
+ const { canEdit, editPage, editFragment } = useFugueContentStudioEdit()
23
+ const { t } = useShellI18n()
24
+
25
+ const editLabel = computed(() =>
26
+ t(FUGUE_CONTENT_ARTICLE_I18N_KEYS.editPage, FUGUE_CONTENT_ARTICLE_DEFAULTS.editPage),
27
+ )
28
+
29
+ const routedPageStem = computed(() => {
30
+ const layout = page.value?.layout
31
+ if (layout !== 'article' && layout !== 'article-aside')
32
+ return ''
33
+ const stem = page.value?.stem
34
+ return typeof stem === 'string' ? stem : ''
35
+ })
36
+
37
+ const visible = computed(() => !requireSession || canEdit.value)
38
+
39
+ async function onEdit() {
40
+ if (fragmentSlug) {
41
+ if (canEdit.value)
42
+ await editFragment(fragmentSlug)
43
+ else
44
+ await handleEditEntry()
45
+ return
46
+ }
47
+
48
+ const stem = pageStem ?? routedPageStem.value
49
+ if (stem) {
50
+ if (canEdit.value)
51
+ await editPage(stem)
52
+ else
53
+ await handleEditEntry()
54
+ return
55
+ }
56
+
57
+ await handleEditEntry()
58
+ }
59
+ </script>
60
+
61
+ <template>
62
+ <UButton
63
+ v-if="visible"
64
+ variant="outline"
65
+ color="neutral"
66
+ size="xs"
67
+ icon="i-lucide-edit-2"
68
+ :label="editLabel"
69
+ class="group px-2"
70
+ :ui="{
71
+ base: 'bg-transparent border border-default/50 text-muted hover:bg-transparent hover:text-primary hover:border-primary/70 active:bg-transparent active:text-primary active:border-primary focus-visible:bg-transparent transition-colors duration-200',
72
+ leadingIcon: 'size-3.5 opacity-80 transition-colors group-hover:text-primary group-hover:opacity-100',
73
+ }"
74
+ @click="onEdit"
75
+ />
76
+ </template>
@@ -0,0 +1,60 @@
1
+ <script setup lang="ts">
2
+ const { user } = useFugueContentStudioSession()
3
+ const { signOut } = useFugueContentAuthSignOut()
4
+
5
+ const menuOpen = ref(false)
6
+
7
+ const accountLabel = computed(() => user.value?.name ?? user.value?.email ?? 'Account')
8
+
9
+ const avatarFallback = computed(() => {
10
+ const label = user.value?.name ?? user.value?.email ?? '?'
11
+ return label.charAt(0).toUpperCase()
12
+ })
13
+
14
+ const avatarSrc = computed(() => user.value?.avatar || undefined)
15
+
16
+ function onSignOut() {
17
+ menuOpen.value = false
18
+ void signOut()
19
+ }
20
+ </script>
21
+
22
+ <template>
23
+ <UPopover
24
+ v-model:open="menuOpen"
25
+ :content="{ align: 'end' }"
26
+ >
27
+ <button
28
+ type="button"
29
+ class="inline-flex size-8 shrink-0 items-center justify-center rounded-full text-highlighted ring-1 ring-border transition-colors hover:bg-elevated focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary"
30
+ :aria-label="accountLabel"
31
+ :aria-expanded="menuOpen"
32
+ >
33
+ <UAvatar
34
+ :src="avatarSrc"
35
+ :alt="accountLabel"
36
+ size="sm"
37
+ :text="avatarFallback"
38
+ />
39
+ </button>
40
+
41
+ <template #content>
42
+ <ul class="flex min-w-40 flex-col py-1">
43
+ <li>
44
+ <button
45
+ type="button"
46
+ class="flex w-full items-center gap-2 px-3 py-1.5 text-sm hover:bg-muted"
47
+ @click="onSignOut"
48
+ >
49
+ <UIcon
50
+ name="i-lucide-door-open"
51
+ class="size-4 shrink-0"
52
+ aria-hidden="true"
53
+ />
54
+ Sign Out
55
+ </button>
56
+ </li>
57
+ </ul>
58
+ </template>
59
+ </UPopover>
60
+ </template>
@@ -0,0 +1,32 @@
1
+ <script setup lang="ts">
2
+ import {
3
+ resolveFugueContentShowFooterEdit,
4
+ } from '../../lib/studio-editor-visibility'
5
+
6
+ const runtimeConfig = useRuntimeConfig()
7
+ const { authMode, hasPeekGate } = useFugueContentAuthMode()
8
+ const { isActive, isClientReady } = useFugueContentStudioEditorEntry()
9
+ const { isAuthenticated } = useFugueContentStudioSession()
10
+ const { showPeekSignOut } = useFugueContentAuthSignOut()
11
+
12
+ const editorChrome = computed(() => ({
13
+ authMode,
14
+ hasStudioRoute: Boolean(runtimeConfig.public.studio?.route),
15
+ isClientReady: isClientReady.value,
16
+ isStudioActive: isActive.value,
17
+ hasStudioSession: isAuthenticated.value,
18
+ hasPeekGate,
19
+ peekSession: null,
20
+ peekPending: false,
21
+ showPeekSignOut: showPeekSignOut.value,
22
+ }))
23
+
24
+ const showEdit = computed(() => resolveFugueContentShowFooterEdit(editorChrome.value))
25
+ </script>
26
+
27
+ <template>
28
+ <FugueContentEditContent
29
+ v-if="showEdit"
30
+ :require-session="false"
31
+ />
32
+ </template>