@plutocms/core 0.39.1 → 0.40.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/CHANGELOG.md +14 -0
- package/README.md +1 -1
- package/app/assets/css/pluto-layer.css +8 -5
- package/app/components/Pluto/Admin/PlutoAdminUserMenu.vue +5 -1
- package/app/components/Pluto/Content/PlutoContentBarActions.vue +5 -2
- package/app/components/Pluto/Markdown/PlutoMarkdownCodeEditor.vue +1 -1
- package/app/components/Pluto/Post/PlutoFieldPostCanvas.vue +1 -1
- package/app/composables/pluto-admin-nav.ts +17 -8
- package/app/composables/pluto-admin-portal.ts +5 -0
- package/app/pages/_pluto/post-preview.vue +1 -1
- package/layers.ts +1 -1
- package/package.json +1 -1
- package/shared/types/registry.ts +2 -0
- package/shared/utils/preview-path.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
## [0.40.0](https://github.com/plutocms/pluto/compare/v0.39.2...v0.40.0) (2026-10-31)
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **admin:** navbar menus in the bar color, palette overlay class, nav children with enabled ([#310](https://github.com/plutocms/pluto/issues/310)) ([cec92ac](https://github.com/plutocms/pluto/commit/cec92ac7061fdb8a209d832344328fae8838f826))
|
|
10
|
+
|
|
11
|
+
## [0.39.2](https://github.com/plutocms/pluto/compare/v0.39.1...v0.39.2) (2026-10-31)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* plutoLayer finds the checkout of @plutocms/docs (the renamed nuxt-content layer) ([#306](https://github.com/plutocms/pluto/issues/306)) ([ef9707e](https://github.com/plutocms/pluto/commit/ef9707e551176973c00acd4102fe55a2e5d07c87))
|
|
17
|
+
|
|
4
18
|
## [0.39.1](https://github.com/plutocms/pluto/compare/v0.39.0...v0.39.1) (2026-10-31)
|
|
5
19
|
|
|
6
20
|
|
package/README.md
CHANGED
|
@@ -51,7 +51,7 @@ See [Public API](https://pluto.vulmix.dev/docs/core/public-api).
|
|
|
51
51
|
| Package | What it adds |
|
|
52
52
|
| ------------------------- | ----------------------------------------------------------- |
|
|
53
53
|
| `@plutocms/core` | The core: the admin, the content model, and the GitHub CMS. |
|
|
54
|
-
| `@plutocms/
|
|
54
|
+
| `@plutocms/docs` | A visual editor for the pages of a Nuxt Content site. |
|
|
55
55
|
| `@plutocms/supabase` | A Supabase backend: database, auth, users, and roles. |
|
|
56
56
|
| `@plutocms/supabase-blog` | Blog posts on Supabase. |
|
|
57
57
|
| `@plutocms/supabase-shop` | Products on Supabase. |
|
|
@@ -69,12 +69,15 @@
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
/*
|
|
72
|
-
* The overlay of the admin search
|
|
73
|
-
*
|
|
74
|
-
* the
|
|
75
|
-
*
|
|
72
|
+
* The overlay of a palette (the admin search, Cmd/Ctrl+K, and the palettes of
|
|
73
|
+
* the layers, such as the block palette) is darker than the Nuxt UI default and
|
|
74
|
+
* blurs the page under it. The overlay is the sibling just before the modal
|
|
75
|
+
* content. The content carries `pluto-admin-search` (app/layouts/admin.vue) or
|
|
76
|
+
* `pluto-palette`: a layer sets `:ui="{ content: 'pluto-palette' }"` on the
|
|
77
|
+
* `UModal` of its palette. Other modals keep the Nuxt UI overlay.
|
|
76
78
|
*/
|
|
77
|
-
:root[data-pluto-admin]
|
|
79
|
+
:root[data-pluto-admin]
|
|
80
|
+
[data-slot='overlay']:has(+ :is(.pluto-admin-search, .pluto-palette)) {
|
|
78
81
|
background-color: oklch(13% 0.03 273 / 0.6);
|
|
79
82
|
backdrop-filter: blur(6px);
|
|
80
83
|
}
|
|
@@ -135,7 +135,11 @@ const portalTarget = usePlutoAdminPortal()
|
|
|
135
135
|
<div class="h-full">
|
|
136
136
|
<UDropdownMenu
|
|
137
137
|
:items="items"
|
|
138
|
-
:
|
|
138
|
+
:content="{ sideOffset: 2 }"
|
|
139
|
+
:ui="{
|
|
140
|
+
content: 'w-64 bg-(--pluto-admin-navbar)',
|
|
141
|
+
arrow: 'fill-(--pluto-admin-navbar)',
|
|
142
|
+
}"
|
|
139
143
|
:modal="false"
|
|
140
144
|
:portal="portalTarget ?? true"
|
|
141
145
|
:arrow="{ width: 14, height: 7 }"
|
|
@@ -214,10 +214,13 @@ const editButton = computed(() => {
|
|
|
214
214
|
<UDropdownMenu
|
|
215
215
|
:open="menuOpen"
|
|
216
216
|
:items="newMenuItems"
|
|
217
|
-
:content="{ align: 'start', onCloseAutoFocus }"
|
|
217
|
+
:content="{ align: 'start', sideOffset: 2, onCloseAutoFocus }"
|
|
218
218
|
:modal="false"
|
|
219
219
|
:portal="portalTarget ?? true"
|
|
220
|
-
:ui="{
|
|
220
|
+
:ui="{
|
|
221
|
+
content: 'min-w-48 bg-(--pluto-admin-navbar)',
|
|
222
|
+
arrow: 'fill-(--pluto-admin-navbar)',
|
|
223
|
+
}"
|
|
221
224
|
:arrow="{ width: 14, height: 7 }"
|
|
222
225
|
@update:open="onUpdateOpen"
|
|
223
226
|
>
|
|
@@ -5,7 +5,7 @@ import type { Extension, Range } from '@codemirror/state'
|
|
|
5
5
|
// headings, links and code. The marks (`**`, `#`, `[`) stay, a little dimmed.
|
|
6
6
|
// The MDC lines get a color: the components (`::name`), the slots (`#title`)
|
|
7
7
|
// and the YAML props. A toolbar has the quick formats, with their shortcuts.
|
|
8
|
-
// The post editor and the page editor of the
|
|
8
|
+
// The post editor and the page editor of the docs layer use it.
|
|
9
9
|
//
|
|
10
10
|
// The model value is the Markdown text, as it is: the editor changes only what
|
|
11
11
|
// the author types. `insert`, `focus`, `reveal` and `goToLine` are exposed, and
|
|
@@ -5,7 +5,7 @@ import PlutoPostOutline from './PlutoPostOutline.vue'
|
|
|
5
5
|
import PlutoPostPreviewFrame from './PlutoPostPreviewFrame.vue'
|
|
6
6
|
|
|
7
7
|
// The `post-canvas` widget: the body of a post (a Markdown `richtext` field) in the
|
|
8
|
-
// canvas layout of the content form, like the page editor of the
|
|
8
|
+
// canvas layout of the content form, like the page editor of the docs layer.
|
|
9
9
|
//
|
|
10
10
|
// The canvas is a split: the compose panel on the left, the live preview of the site
|
|
11
11
|
// on the right. The compose panel shows one of two editors, and the switch in its
|
|
@@ -57,14 +57,23 @@ export function usePlutoAdminNav() {
|
|
|
57
57
|
|
|
58
58
|
const items = computed<PlutoNavItem[]>(() => {
|
|
59
59
|
const registered = registry.nav.list.value
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
60
|
+
// A child with `enabled` shows only when the test passes (for example a
|
|
61
|
+
// child for admins only). An item with its own `to` and one visible child
|
|
62
|
+
// stays a plain link, like Settings with one page.
|
|
63
|
+
const resolveLabels = (item: PlutoNavItem): PlutoNavItem => {
|
|
64
|
+
const children = item.children
|
|
65
|
+
?.filter((child) => child.enabled?.() ?? true)
|
|
66
|
+
.map((child) => ({
|
|
67
|
+
...child,
|
|
68
|
+
label: tx(child.label),
|
|
69
|
+
}))
|
|
70
|
+
return {
|
|
71
|
+
...item,
|
|
72
|
+
label: tx(item.label),
|
|
73
|
+
children:
|
|
74
|
+
item.to && children && children.length < 2 ? undefined : children,
|
|
75
|
+
}
|
|
76
|
+
}
|
|
68
77
|
|
|
69
78
|
const isVisible = (type: PlutoContentType): boolean =>
|
|
70
79
|
!type.capabilities?.read || can(type.capabilities.read)
|
|
@@ -8,12 +8,17 @@
|
|
|
8
8
|
* The composable makes the element itself. A target that Vue renders can
|
|
9
9
|
* appear after the portal looks for it. Pass `portalTarget ?? true` to the
|
|
10
10
|
* `portal` prop of `UDropdownMenu`.
|
|
11
|
+
*
|
|
12
|
+
* The menus look like the bar: the target also carries `data-pluto-admin-dark`
|
|
13
|
+
* (the dark tokens in both color modes), and a menu sets the bar color
|
|
14
|
+
* (`bg-(--pluto-admin-navbar)`, also on its arrow) and `sideOffset: 2`.
|
|
11
15
|
*/
|
|
12
16
|
export function usePlutoAdminPortal() {
|
|
13
17
|
const portalTarget = shallowRef<HTMLElement>()
|
|
14
18
|
onMounted(() => {
|
|
15
19
|
const el = document.createElement('div')
|
|
16
20
|
el.setAttribute('data-pluto-admin-scope', '')
|
|
21
|
+
el.setAttribute('data-pluto-admin-dark', '')
|
|
17
22
|
document.body.append(el)
|
|
18
23
|
portalTarget.value = el
|
|
19
24
|
})
|
|
@@ -16,7 +16,7 @@ useHead({
|
|
|
16
16
|
{ textContent: 'a { pointer-events: none; }' },
|
|
17
17
|
{
|
|
18
18
|
// A thin scrollbar that fits the editor, in both color modes: a gray thumb on no track.
|
|
19
|
-
// The same as the page preview of the
|
|
19
|
+
// The same as the page preview of the docs layer.
|
|
20
20
|
textContent: [
|
|
21
21
|
'html { scrollbar-width: thin; scrollbar-color: rgb(128 128 128 / 0.45) transparent; }',
|
|
22
22
|
'html::-webkit-scrollbar { width: 10px; }',
|
package/layers.ts
CHANGED
|
@@ -33,7 +33,7 @@ export const PLUTO_LAYER_PATHS: Readonly<Record<string, string>> = {
|
|
|
33
33
|
supabase: 'supabase',
|
|
34
34
|
'supabase-shop': 'supabase-shop',
|
|
35
35
|
'supabase-blog': 'supabase-blog',
|
|
36
|
-
|
|
36
|
+
docs: 'docs',
|
|
37
37
|
'3d': 'pluto/packages/layers/addons/3d',
|
|
38
38
|
}
|
|
39
39
|
|
package/package.json
CHANGED
package/shared/types/registry.ts
CHANGED
|
@@ -59,6 +59,8 @@ export interface PlutoNavChild {
|
|
|
59
59
|
newTo?: string
|
|
60
60
|
/** The text of that "+" (`New <type>`). */
|
|
61
61
|
newLabel?: string
|
|
62
|
+
/** Reactive visibility test, like `PlutoEntry.enabled`. A child without it shows. */
|
|
63
|
+
enabled?: () => boolean
|
|
62
64
|
}
|
|
63
65
|
|
|
64
66
|
export interface PlutoNavItem extends PlutoEntry {
|
|
@@ -3,7 +3,7 @@ export const PLUTO_PREVIEW_PATH = '/_pluto/preview'
|
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* The path of the post preview that the post editor (`post-canvas`) shows in an iframe. It is not
|
|
6
|
-
* below `PLUTO_PREVIEW_PATH`: the
|
|
6
|
+
* below `PLUTO_PREVIEW_PATH`: the docs layer has a page there, and a page below it would
|
|
7
7
|
* be a child route of that page.
|
|
8
8
|
*/
|
|
9
9
|
export const PLUTO_POST_PREVIEW_PATH = '/_pluto/post-preview'
|