@stonecrop/nuxt 0.55.2 → 0.56.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.
- package/dist/module.json +1 -1
- package/package.json +14 -13
- package/templates/index.vue +22 -2
package/dist/module.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stonecrop/nuxt",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.56.0",
|
|
4
4
|
"description": "Nuxt module for Stonecrop",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"nuxt",
|
|
@@ -60,18 +60,18 @@
|
|
|
60
60
|
"pathe": "^2.0.3",
|
|
61
61
|
"pinia": "^3.0.4",
|
|
62
62
|
"prompts": "^2.4.2",
|
|
63
|
-
"@stonecrop/aform": "0.
|
|
64
|
-
"@stonecrop/atable": "0.
|
|
65
|
-
"@stonecrop/casl-middleware": "0.
|
|
66
|
-
"@stonecrop/code-editor": "0.
|
|
67
|
-
"@stonecrop/desktop": "0.
|
|
68
|
-
"@stonecrop/graphql-client": "0.
|
|
69
|
-
"@stonecrop/
|
|
70
|
-
"@stonecrop/
|
|
71
|
-
"@stonecrop/nuxt-grafserv": "0.
|
|
72
|
-
"@stonecrop/stonecrop": "0.
|
|
73
|
-
"@stonecrop/schema": "0.
|
|
74
|
-
"@stonecrop/themes": "0.
|
|
63
|
+
"@stonecrop/aform": "0.56.0",
|
|
64
|
+
"@stonecrop/atable": "0.56.0",
|
|
65
|
+
"@stonecrop/casl-middleware": "0.56.0",
|
|
66
|
+
"@stonecrop/code-editor": "0.56.0",
|
|
67
|
+
"@stonecrop/desktop": "0.56.0",
|
|
68
|
+
"@stonecrop/graphql-client": "0.56.0",
|
|
69
|
+
"@stonecrop/graphql-middleware": "0.56.0",
|
|
70
|
+
"@stonecrop/node-editor": "0.56.0",
|
|
71
|
+
"@stonecrop/nuxt-grafserv": "0.56.0",
|
|
72
|
+
"@stonecrop/stonecrop": "0.56.0",
|
|
73
|
+
"@stonecrop/schema": "0.56.0",
|
|
74
|
+
"@stonecrop/themes": "0.56.0"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
77
|
"@eslint/js": "^10.0.1",
|
|
@@ -113,6 +113,7 @@
|
|
|
113
113
|
"node": ">=24.0.0"
|
|
114
114
|
},
|
|
115
115
|
"scripts": {
|
|
116
|
+
"check:documentation": "node scripts/check-documentation-content.mjs",
|
|
116
117
|
"dev": "node --run dev:documentation",
|
|
117
118
|
"dev:build": "nuxi build documentation",
|
|
118
119
|
"dev:documentation": "node --run dev:prepare:documentation && nuxi dev documentation --host",
|
package/templates/index.vue
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<ClientOnly>
|
|
3
|
-
<Desktop
|
|
3
|
+
<Desktop
|
|
4
|
+
:available-doctypes="availableDoctypes"
|
|
5
|
+
:route-adapter="routeAdapter"
|
|
6
|
+
:host-actions="hostActions"
|
|
7
|
+
@action="run" />
|
|
4
8
|
<template #fallback>
|
|
5
9
|
<div class="sc-loading">
|
|
6
10
|
<p>Loading...</p>
|
|
@@ -10,7 +14,8 @@
|
|
|
10
14
|
</template>
|
|
11
15
|
|
|
12
16
|
<script setup lang="ts">
|
|
13
|
-
import { Desktop } from '@stonecrop/desktop'
|
|
17
|
+
import { Desktop, type ActionElements } from '@stonecrop/desktop'
|
|
18
|
+
import { DRAFT_RECORD_ID } from '@stonecrop/stonecrop'
|
|
14
19
|
|
|
15
20
|
import { useRouteAdapter } from '~/composables/useRouteAdapter'
|
|
16
21
|
import { doctypeMap } from '~/composables/useDoctypes'
|
|
@@ -28,6 +33,21 @@ const { run } = useClientAction()
|
|
|
28
33
|
// declared identity. A handler here would only race that fetch with a second copy of the same rule,
|
|
29
34
|
// which is how a hardcoded `record.id` once dropped every row of a natural-keyed doctype.
|
|
30
35
|
const availableDoctypes = computed(() => Array.from(doctypeMap.keys()))
|
|
36
|
+
|
|
37
|
+
// A list shows every action its doctype declares, and task and project are records' doctypes too, so a
|
|
38
|
+
// list gets this app's New instead, which keeps Save and the rest off it. Unset on other views, never
|
|
39
|
+
// `[]`, which would hide a record's own actions.
|
|
40
|
+
const hostActions = computed((): ActionElements[] | undefined => {
|
|
41
|
+
if (routeAdapter.getCurrentView() !== 'records') return undefined
|
|
42
|
+
const doctype = routeAdapter.getCurrentDoctype()
|
|
43
|
+
return [
|
|
44
|
+
{
|
|
45
|
+
type: 'button',
|
|
46
|
+
label: 'New Record',
|
|
47
|
+
action: () => void routeAdapter.navigate({ view: 'record', doctype, recordId: DRAFT_RECORD_ID }),
|
|
48
|
+
},
|
|
49
|
+
]
|
|
50
|
+
})
|
|
31
51
|
</script>
|
|
32
52
|
|
|
33
53
|
<style>
|