@altafusion/fugue-content 0.5.0 → 0.6.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/CHANGELOG.md +22 -0
- package/README.md +2 -2
- package/app/components/FugueContentQeToolsDrafts.vue +71 -0
- package/app/plugins/qe-tools.client.ts +30 -5
- package/package.json +11 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @altafusion/fugue-content
|
|
2
2
|
|
|
3
|
+
## 0.6.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- @altafusion/fugue-simple-auth@0.6.1
|
|
8
|
+
- @altafusion/fugue-theme@0.6.1
|
|
9
|
+
- @altafusion/nuxt-base@0.6.1
|
|
10
|
+
- @altafusion/shell@0.6.1
|
|
11
|
+
|
|
12
|
+
## 0.6.0
|
|
13
|
+
|
|
14
|
+
### Minor Changes
|
|
15
|
+
|
|
16
|
+
- ae2d33b: Make `DevToolsPanel` self-contained: mount `<DevToolsPanel />` once and it owns its open state, shows a draggable dock, and opens the drawer on `?qetools` (the new default `openParams`; `?qetools=off` turns it off). Sections now register through `useDevTools().registerSection()` or `nuxtApp.$fugueDevtools`, each `public` or `privileged`, with a reactive `setAccessResolver`. `@altafusion/fugue-content` registers its Studio drafts as a privileged section when fugue-devtools is installed.
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- @altafusion/shell@0.6.0
|
|
21
|
+
- @altafusion/fugue-simple-auth@0.6.0
|
|
22
|
+
- @altafusion/fugue-theme@0.6.0
|
|
23
|
+
- @altafusion/nuxt-base@0.6.0
|
|
24
|
+
|
|
3
25
|
## 0.5.0
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -332,7 +332,7 @@ Feature walkthrough: **[Auth Mode](/fugue-content/starter-template/studio-access
|
|
|
332
332
|
|
|
333
333
|
### qeTools (operator console)
|
|
334
334
|
|
|
335
|
-
Every Fugue Content app registers **`window.qeTools`** in the browser (dev and production).
|
|
335
|
+
Every Fugue Content app registers **`window.qeTools`** in the browser (dev and production). It is a console API; the on-page UI is the **`@altafusion/fugue-devtools`** drawer (see below). **`studioDrafts`** targets **production** IndexedDB drafts (Netlify); **local dev** writes to disk — use **`git restore`** instead.
|
|
336
336
|
|
|
337
337
|
Open **DevTools → Console**, then:
|
|
338
338
|
|
|
@@ -341,7 +341,7 @@ qeTools.help()
|
|
|
341
341
|
await qeTools.studioDrafts.list()
|
|
342
342
|
```
|
|
343
343
|
|
|
344
|
-
Optional discovery: add **`?qetools`** to the URL
|
|
344
|
+
Optional discovery: add **`?qetools`** to the URL. If the site also extends **`@altafusion/fugue-devtools`** and mounts `<DevToolsPanel />`, the drawer opens and shows **Studio drafts** (list and delete, a *privileged* section, so it shows in development or when the site's `setAccessResolver` allows it). Without devtools, the help text prints to the console on load (still requires DevTools open).
|
|
345
345
|
|
|
346
346
|
Import in code: **`@altafusion/fugue-content/qe-tools`** or **`@altafusion/fugue-content/qe-tools/studio-drafts`**.
|
|
347
347
|
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { StudioDraftSummary } from '../../lib/qe-tools'
|
|
3
|
+
|
|
4
|
+
/** The Studio drafts section of the dev tools drawer: the UI over `window.qeTools.studioDrafts`. */
|
|
5
|
+
const drafts = ref<StudioDraftSummary[]>([])
|
|
6
|
+
const loading = ref(false)
|
|
7
|
+
const error = ref('')
|
|
8
|
+
|
|
9
|
+
async function refresh() {
|
|
10
|
+
const api = window.qeTools?.studioDrafts
|
|
11
|
+
if (!api)
|
|
12
|
+
return
|
|
13
|
+
loading.value = true
|
|
14
|
+
error.value = ''
|
|
15
|
+
try {
|
|
16
|
+
drafts.value = await api.list()
|
|
17
|
+
} catch (e) {
|
|
18
|
+
error.value = e instanceof Error ? e.message : String(e)
|
|
19
|
+
} finally {
|
|
20
|
+
loading.value = false
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
async function remove(key: string) {
|
|
25
|
+
await window.qeTools?.studioDrafts.deleteOne(key)
|
|
26
|
+
await refresh()
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
onMounted(refresh)
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<template>
|
|
33
|
+
<div class="space-y-2 text-sm">
|
|
34
|
+
<div class="flex items-center justify-between">
|
|
35
|
+
<span class="text-muted">{{ drafts.length }} draft(s) in this browser</span>
|
|
36
|
+
<UButton
|
|
37
|
+
label="Refresh"
|
|
38
|
+
size="xs"
|
|
39
|
+
color="neutral"
|
|
40
|
+
variant="ghost"
|
|
41
|
+
:loading="loading"
|
|
42
|
+
@click="refresh"
|
|
43
|
+
/>
|
|
44
|
+
</div>
|
|
45
|
+
<p
|
|
46
|
+
v-if="error"
|
|
47
|
+
class="text-error"
|
|
48
|
+
>
|
|
49
|
+
{{ error }}
|
|
50
|
+
</p>
|
|
51
|
+
<ul class="divide-y divide-default">
|
|
52
|
+
<li
|
|
53
|
+
v-for="draft in drafts"
|
|
54
|
+
:key="draft.key"
|
|
55
|
+
class="flex items-center justify-between gap-2 py-1"
|
|
56
|
+
>
|
|
57
|
+
<span class="truncate font-mono text-xs">{{ draft.key }}</span>
|
|
58
|
+
<UButton
|
|
59
|
+
label="Delete"
|
|
60
|
+
size="xs"
|
|
61
|
+
color="error"
|
|
62
|
+
variant="ghost"
|
|
63
|
+
@click="remove(draft.key)"
|
|
64
|
+
/>
|
|
65
|
+
</li>
|
|
66
|
+
</ul>
|
|
67
|
+
<p class="text-xs text-muted">
|
|
68
|
+
After deleting, hard refresh the page.
|
|
69
|
+
</p>
|
|
70
|
+
</div>
|
|
71
|
+
</template>
|
|
@@ -1,7 +1,19 @@
|
|
|
1
|
+
import type { Component } from 'vue'
|
|
1
2
|
import { createQeTools } from '../../lib/qe-tools'
|
|
3
|
+
import FugueContentQeToolsDrafts from '../components/FugueContentQeToolsDrafts.vue'
|
|
2
4
|
|
|
3
5
|
const QE_TOOLS_URL_PARAM = 'qetools'
|
|
4
6
|
|
|
7
|
+
/** The slice of the fugue-devtools API used here. fugue-content never imports that package; it is only there when a site installs it. */
|
|
8
|
+
interface DevToolsRegistrar {
|
|
9
|
+
registerSection: (section: {
|
|
10
|
+
id: string
|
|
11
|
+
label: string
|
|
12
|
+
component: Component
|
|
13
|
+
access?: 'public' | 'privileged'
|
|
14
|
+
}) => () => void
|
|
15
|
+
}
|
|
16
|
+
|
|
5
17
|
function hasQeToolsUrlParam(): boolean {
|
|
6
18
|
return [
|
|
7
19
|
...new URLSearchParams(window.location.search).keys()
|
|
@@ -11,18 +23,31 @@ function hasQeToolsUrlParam(): boolean {
|
|
|
11
23
|
|
|
12
24
|
/**
|
|
13
25
|
* Registers `window.qeTools` for operator troubleshooting (dev + production).
|
|
14
|
-
*
|
|
15
|
-
*
|
|
26
|
+
* When `@altafusion/fugue-devtools` is installed, the drawer is the UI over it: the Studio drafts become a (privileged)
|
|
27
|
+
* section and `?qetools` opens the drawer. Without it, `?qetools` or `?qetools=1` prints the console help on load.
|
|
16
28
|
*/
|
|
17
29
|
export default defineNuxtPlugin({
|
|
18
30
|
name: 'fugue-content:qe-tools',
|
|
19
|
-
setup() {
|
|
31
|
+
setup(nuxtApp) {
|
|
20
32
|
if (typeof indexedDB === 'undefined')
|
|
21
33
|
return
|
|
22
34
|
|
|
23
35
|
window.qeTools = createQeTools()
|
|
24
36
|
|
|
25
|
-
|
|
26
|
-
|
|
37
|
+
// `app:created` runs after every plugin has set up, so the order of the layers does not matter.
|
|
38
|
+
nuxtApp.hook('app:created', () => {
|
|
39
|
+
const devtools = (nuxtApp as unknown as { $fugueDevtools?: DevToolsRegistrar }).$fugueDevtools
|
|
40
|
+
if (devtools) {
|
|
41
|
+
devtools.registerSection({
|
|
42
|
+
id: 'studio-drafts',
|
|
43
|
+
label: 'Studio drafts',
|
|
44
|
+
component: FugueContentQeToolsDrafts,
|
|
45
|
+
access: 'privileged'
|
|
46
|
+
})
|
|
47
|
+
return
|
|
48
|
+
}
|
|
49
|
+
if (hasQeToolsUrlParam())
|
|
50
|
+
window.qeTools?.help()
|
|
51
|
+
})
|
|
27
52
|
}
|
|
28
53
|
})
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@altafusion/fugue-content",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.6.1",
|
|
5
5
|
"description": "Nuxt layer for Fugue Content sites — editorial pages, Studio, and MDC, composed with shell.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://github.com/altafusion/fugue/tree/main/packages-consumer/fugue-content#readme",
|
|
@@ -26,17 +26,17 @@
|
|
|
26
26
|
},
|
|
27
27
|
"main": "./nuxt.config.ts",
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"@altafusion/fugue-theme": "0.
|
|
29
|
+
"@altafusion/fugue-theme": "0.6.1",
|
|
30
30
|
"better-sqlite3": "^12.11.1",
|
|
31
31
|
"h3": "^1.15.0",
|
|
32
32
|
"nuxt": "^4.7.0",
|
|
33
33
|
"vue": "^3.5.46",
|
|
34
|
-
"vue-router": "^5.5.
|
|
34
|
+
"vue-router": "^5.5.3"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@altafusion/fugue-simple-auth": "0.
|
|
38
|
-
"@altafusion/nuxt-base": "0.
|
|
39
|
-
"@altafusion/shell": "0.
|
|
37
|
+
"@altafusion/fugue-simple-auth": "0.6.1",
|
|
38
|
+
"@altafusion/nuxt-base": "0.6.1",
|
|
39
|
+
"@altafusion/shell": "0.6.1",
|
|
40
40
|
"@nuxt/content": "^3.17.0",
|
|
41
41
|
"@nuxt/kit": "^4.7.0",
|
|
42
42
|
"@nuxtjs/i18n": "^10.7.0",
|
|
@@ -45,17 +45,17 @@
|
|
|
45
45
|
"ufo": "^1.6.4"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@altafusion/eslint-config": "0.
|
|
49
|
-
"@altafusion/fugue-theme": "0.
|
|
50
|
-
"@iconify-json/lucide": "^1.2.
|
|
51
|
-
"@types/node": "^26.6.
|
|
48
|
+
"@altafusion/eslint-config": "0.6.1",
|
|
49
|
+
"@altafusion/fugue-theme": "0.6.1",
|
|
50
|
+
"@iconify-json/lucide": "^1.2.160",
|
|
51
|
+
"@types/node": "^26.6.11",
|
|
52
52
|
"better-sqlite3": "^12.11.1",
|
|
53
53
|
"eslint": "^10.15.0",
|
|
54
54
|
"nuxt": "^4.7.0",
|
|
55
55
|
"typescript": "^6.0.3",
|
|
56
56
|
"vitest": "^5.1.2",
|
|
57
57
|
"vue": "^3.5.46",
|
|
58
|
-
"vue-router": "^5.5.
|
|
58
|
+
"vue-router": "^5.5.3"
|
|
59
59
|
},
|
|
60
60
|
"files": [
|
|
61
61
|
"**",
|