@altafusion/fugue-devtools 0.6.1 → 0.6.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.
- package/CHANGELOG.md +26 -0
- package/README.md +25 -0
- package/assets/css/devtools-panel.css +24 -1
- package/components/DevTools/Nav.vue +3 -2
- package/components/DevTools/Panel.client.vue +49 -26
- package/components/DevTools/Section.vue +5 -2
- package/components/DevTools/ToggleButton.vue +3 -1
- package/composables/devtoolsTypes.ts +8 -0
- package/package.json +4 -4
- package/utils/devtoolsLayers.ts +32 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @altafusion/fugue-devtools
|
|
2
2
|
|
|
3
|
+
## 0.6.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 431c0d0: Add buttons to the Studio drafts section of the dev tools drawer, and show it to signed-in editors in production.
|
|
8
|
+
|
|
9
|
+
- **Delete Matching** removes every draft whose key contains some text (`qeTools.studioDrafts.deleteMatching`), **Clear All Drafts** removes them all after a second click to confirm (`clearAll`), each row shows its status, and a **Reload Page To Apply** button appears after a delete (Studio keeps a merged copy in memory).
|
|
10
|
+
- The section is privileged, and without an access resolver it only showed in development. `fugue-content` now sets one: development, or a signed-in Studio editor (the `studio-session-check` cookie). A site that wants a different rule calls `setAccessResolver` after it. It is a UI convenience, not a security boundary: the section only touches the browser's own drafts.
|
|
11
|
+
- The section is now called **Studio Drafts**, comes first so it opens by default, and sits in a thin bordered card (`max-w-xl`) with Refresh and Clear All Drafts at the top, Delete Matching under them, then the list.
|
|
12
|
+
- The drawer's section switcher is a Nuxt UI `UTabs` (pill, no content) instead of a row of buttons, and a section no longer repeats its title under the tabs; with a single section there are no tabs, so the title still shows.
|
|
13
|
+
- @altafusion/fugue-ui@0.6.3
|
|
14
|
+
|
|
15
|
+
## 0.6.2
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- daa45b0: Fix the dev tools drawer showing the page through it, and put the dev tools above everything on the site.
|
|
20
|
+
|
|
21
|
+
- The drawer surface was `bg-muted`, which a theme may make translucent (fugue-theme's black canvas sets `--ui-bg-muted` to `rgb(255 255 255 / 0.05)`), so photo tiles, their buttons and other docks showed through its text. It is now painted over a solid `--ui-bg` base.
|
|
22
|
+
- A drag that ends over the open drawer no longer drops onto a tile behind it, and dragging across it starts no drawer gesture.
|
|
23
|
+
- Stacking is explicit and lives in one place (CSS variables in `devtools-panel.css`): site docks 40, site overlays 50, dev tools dock 70, drawer 75, tooltips and menus 80. The scattered `z-50` and `z-[60]` are gone.
|
|
24
|
+
- `FloatingDock` gets a `zIndex` prop (default `40`, applied to the wrapper). The dev tools dock passes its own.
|
|
25
|
+
- The drawer and the dock's bar are `#1e1e77` in dark mode (solid, so the theme cannot make them translucent). Both are restyled with Nuxt UI's `ui` convention: `<DevToolsPanel :ui="{ bar, panel }" />`. `FloatingDock` gets the same: `ui: { bar, panel }`, merged over its defaults.
|
|
26
|
+
- Updated dependencies [daa45b0]
|
|
27
|
+
- @altafusion/fugue-ui@0.6.2
|
|
28
|
+
|
|
3
29
|
## 0.6.1
|
|
4
30
|
|
|
5
31
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -34,6 +34,31 @@ Add **`?qetools`** to any URL. That turns the dev tools on and opens the drawer,
|
|
|
34
34
|
|
|
35
35
|
Config (`runtimeConfig.public.fugueDevtools`): `openParams` (default `['qetools']`), `innerToggleParams`, `persistNamespace`, `persistKey`, `defaultPosition` (`'bottom'`).
|
|
36
36
|
|
|
37
|
+
### Stacking
|
|
38
|
+
|
|
39
|
+
The dev tools always sit above the site, including Nuxt UI modals and overlays. Lowest to highest:
|
|
40
|
+
|
|
41
|
+
| Level | z-index |
|
|
42
|
+
|---|---|
|
|
43
|
+
| page content and sticky bars | up to 30 |
|
|
44
|
+
| site `FloatingDock`s such as an editing-controls dock | 40 (the `FloatingDock` default) |
|
|
45
|
+
| site overlays and modals (Nuxt UI defaults) | 50 |
|
|
46
|
+
| dev tools dock | 70 |
|
|
47
|
+
| dev tools drawer | 75 |
|
|
48
|
+
| dev tools tooltips and menus | 80 |
|
|
49
|
+
|
|
50
|
+
The numbers are CSS variables (`--devtools-z-dock`, `--devtools-z-drawer`, `--devtools-z-menu`) declared once in `assets/css/devtools-panel.css`; `utils/devtoolsLayers.ts` names them and nothing else in the layer hard-codes a z-index. A site can override a variable in its own CSS. Keep a site's own dock at 40 and its overlays at 50 and the order holds.
|
|
51
|
+
|
|
52
|
+
In dark mode the drawer and the dock's bar are `#1e1e77` (a class, `dark:bg-[#1e1e77]`). `DevToolsPanel` takes Nuxt UI's `ui` prop with the same two slots as `FloatingDock` (`bar` and `panel`), merged over the defaults so your classes win. Use the same object for an editing-controls dock and the dev tools:
|
|
53
|
+
|
|
54
|
+
```vue
|
|
55
|
+
<DevToolsPanel :ui="{ bar: 'dark:bg-[#102040]', panel: 'dark:bg-[#102040]' }" />
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
`panel` is the drawer, `bar` is the dock's toggle bar. As with any Tailwind class, the literal has to appear in your app's source.
|
|
59
|
+
|
|
60
|
+
The open drawer is an opaque surface that takes the pointer: it is painted over a solid `--ui-bg` base, so a theme that makes `--ui-bg-muted` translucent (fugue-theme's black canvas does) cannot make it see-through, and a drag that ends over it is refused (`dropEffect: none`, the event stops there) instead of landing on a tile behind it. Drawer drags are off (`handle-only` with no handle), so dragging something across it starts no drawer gesture. Popovers and menus a section opens portal at Nuxt UI's z-50 and so open beneath the drawer; give those content `class="devtools-z-menu"`.
|
|
61
|
+
|
|
37
62
|
### Sections: registry first
|
|
38
63
|
|
|
39
64
|
```ts
|
|
@@ -5,16 +5,39 @@
|
|
|
5
5
|
* their own scoped prefix for domain sections (e.g. `qe-panel__*` in a product adapter).
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
/*
|
|
9
|
+
* Stacking order (see utils/devtoolsLayers.ts). The dev tools always sit above the site, including Nuxt UI modals (z-50):
|
|
10
|
+
* page content <= 30 < site FloatingDocks 40 < site overlays 50 < dock 70 < drawer 75 < tooltips and menus 80
|
|
11
|
+
*/
|
|
12
|
+
:root {
|
|
13
|
+
--devtools-z-dock: 70;
|
|
14
|
+
--devtools-z-drawer: 75;
|
|
15
|
+
--devtools-z-menu: 80;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.devtools-z-dock {
|
|
19
|
+
z-index: var(--devtools-z-dock);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.devtools-z-drawer {
|
|
23
|
+
z-index: var(--devtools-z-drawer);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.devtools-z-menu {
|
|
27
|
+
z-index: var(--devtools-z-menu);
|
|
28
|
+
}
|
|
29
|
+
|
|
8
30
|
.devtools-panel {
|
|
9
31
|
min-height: 100%;
|
|
10
32
|
background-color: inherit;
|
|
11
33
|
}
|
|
12
34
|
|
|
13
35
|
.devtools-panel__surface--drawer {
|
|
14
|
-
background-color: var(--ui-bg-muted) !important;
|
|
15
36
|
box-shadow: var(--shadow-lg, 0 10px 15px -3px rgb(0 0 0 / 0.1));
|
|
16
37
|
filter: drop-shadow(0 10px 8px rgb(0 0 0 / 0.04));
|
|
17
38
|
outline: 1px solid var(--ui-border);
|
|
39
|
+
/* The drawer takes the pointer itself (non-modal drawers leave it to the page otherwise), so nothing under it reacts. */
|
|
40
|
+
pointer-events: auto;
|
|
18
41
|
}
|
|
19
42
|
|
|
20
43
|
.devtools-panel__nav {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { DevToolsPanelPosition } from '#devtools/persist'
|
|
3
|
+
import { DEVTOOLS_LAYER_CLASSES } from '#devtools/utils/devtoolsLayers'
|
|
3
4
|
|
|
4
5
|
const {
|
|
5
6
|
brand = 'Dev Tools',
|
|
@@ -25,8 +26,8 @@ const dockOptions: { pos: DevToolsPanelPosition, icon: string, label: string }[]
|
|
|
25
26
|
{ pos: 'left', icon: 'i-lucide-panel-left', label: 'Dock left' },
|
|
26
27
|
]
|
|
27
28
|
|
|
28
|
-
// The
|
|
29
|
-
const tooltipUi = { content:
|
|
29
|
+
// The tooltip theme sets no z-index of its own, so without this the tooltip would open underneath the drawer.
|
|
30
|
+
const tooltipUi = { content: DEVTOOLS_LAYER_CLASSES.menu }
|
|
30
31
|
</script>
|
|
31
32
|
|
|
32
33
|
<template>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import type { DevToolsPanelPosition } from '#devtools/composables/devtoolsTypes'
|
|
2
|
+
import type { DevToolsPanelPosition, DevToolsPanelUi } from '#devtools/composables/devtoolsTypes'
|
|
3
3
|
import { isHorizontalDevToolsDock } from '#devtools/persist'
|
|
4
|
+
import { DEVTOOLS_LAYER_CLASSES, devToolsLayerValue } from '#devtools/utils/devtoolsLayers'
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* The whole dev tools UI. The `.client.vue` suffix keeps it off the server: the API it reads is provided by a client-only plugin. Mount `<DevToolsPanel />` once (app.vue) and it works alone: it reads `useDevTools()`, shows a
|
|
@@ -17,12 +18,15 @@ const {
|
|
|
17
18
|
bodyGridClass = '',
|
|
18
19
|
sectionClass = '',
|
|
19
20
|
brand = 'Dev Tools',
|
|
21
|
+
ui,
|
|
20
22
|
} = defineProps<{
|
|
21
23
|
/** Extra grid classes on the section container (e.g. 3-column bottom dock). */
|
|
22
24
|
bodyGridClass?: string
|
|
23
25
|
/** Extra class on sections passed through `sectionClass` slot prop. */
|
|
24
26
|
sectionClass?: string
|
|
25
27
|
brand?: string
|
|
28
|
+
/** Classes for the `panel` (the drawer) and the `bar` (the dock's toggle bar), the same slots as `FloatingDock`'s `ui`, merged over the defaults (Nuxt UI's `ui` convention). */
|
|
29
|
+
ui?: DevToolsPanelUi
|
|
26
30
|
}>()
|
|
27
31
|
|
|
28
32
|
const api = useDevTools()
|
|
@@ -40,28 +44,52 @@ const panelPosition = computed<DevToolsPanelPosition>({
|
|
|
40
44
|
|
|
41
45
|
const isHorizontalDock = computed(() => isHorizontalDevToolsDock(panelPosition.value))
|
|
42
46
|
|
|
47
|
+
// The tab strip names the active section, so the section only repeats its title when there are no tabs (a single section).
|
|
48
|
+
const tabItems = computed(() => visibleSections.value.map(section => ({ label: section.label, value: section.id })))
|
|
49
|
+
const activeTab = computed({
|
|
50
|
+
get: () => activeSection.value?.id,
|
|
51
|
+
set: (id) => {
|
|
52
|
+
if (id !== undefined)
|
|
53
|
+
api.activeId.value = String(id)
|
|
54
|
+
},
|
|
55
|
+
})
|
|
56
|
+
|
|
43
57
|
function toggle() {
|
|
44
58
|
open.value = !open.value
|
|
45
59
|
}
|
|
46
60
|
|
|
47
|
-
|
|
48
|
-
|
|
61
|
+
// The defaults are solid colours, not `bg-muted`: a theme may make that translucent (fugue-theme's black canvas does), which left the drawer see-through. The z-index comes from `devtools-panel.css`.
|
|
62
|
+
const DEFAULT_PANEL_CLASS = 'dark:bg-[#1e1e77]'
|
|
63
|
+
const DEFAULT_BAR_CLASS = 'dark:bg-[#1e1e77]'
|
|
64
|
+
|
|
65
|
+
const drawerSurfaceClass = computed(() =>
|
|
66
|
+
`devtools-panel__surface--drawer ${DEVTOOLS_LAYER_CLASSES.drawer} ring-default shadow-lg drop-shadow-xl ${DEFAULT_PANEL_CLASS} ${ui?.panel ?? ''}`)
|
|
67
|
+
|
|
68
|
+
// A drag that ends over the drawer is not a drop on the page behind it. Stopping the events here also keeps page-level (document) drag handlers from seeing them.
|
|
69
|
+
function refuseDrop(event: DragEvent) {
|
|
70
|
+
event.stopPropagation()
|
|
71
|
+
if (event.dataTransfer)
|
|
72
|
+
event.dataTransfer.dropEffect = 'none'
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// `content` is typed as the dialog content's props, which leave out DOM listeners; they still reach the element as attributes.
|
|
76
|
+
const drawerContentListeners = { onDragenter: refuseDrop, onDragover: refuseDrop, onDrop: refuseDrop } as unknown as Record<string, never>
|
|
49
77
|
|
|
50
78
|
// `bottom-12` leaves room for the dock bar under a bottom-docked drawer, so the two never overlap. The drawer is inset 1rem from the sides, and the dock's margin (16) lines the bar's right end up with it.
|
|
51
79
|
const drawerUi = computed(() => {
|
|
52
|
-
const surface = drawerSurfaceClass
|
|
80
|
+
const surface = drawerSurfaceClass.value
|
|
53
81
|
const body = 'devtools-panel overflow-y-auto px-3 py-2'
|
|
54
82
|
const container = 'gap-0'
|
|
55
83
|
|
|
56
84
|
switch (panelPosition.value) {
|
|
57
85
|
case 'left':
|
|
58
|
-
return { content: `top-22 left-4 bottom-4 max-w-96
|
|
86
|
+
return { content: `top-22 left-4 bottom-4 max-w-96 ${surface}`, body, container }
|
|
59
87
|
case 'top':
|
|
60
|
-
return { content: `inset-x-4 top-22 max-h-[min(24rem,70vh)] sm:max-h-[min(28rem,75vh)]
|
|
88
|
+
return { content: `inset-x-4 top-22 max-h-[min(24rem,70vh)] sm:max-h-[min(28rem,75vh)] ${surface}`, body, container }
|
|
61
89
|
case 'bottom':
|
|
62
|
-
return { content: `inset-x-4 bottom-12 max-h-[min(24rem,70vh)] sm:max-h-[min(28rem,75vh)]
|
|
90
|
+
return { content: `inset-x-4 bottom-12 max-h-[min(24rem,70vh)] sm:max-h-[min(28rem,75vh)] ${surface}`, body, container }
|
|
63
91
|
default:
|
|
64
|
-
return { content: `top-22 right-4 bottom-4 max-w-96
|
|
92
|
+
return { content: `top-22 right-4 bottom-4 max-w-96 ${surface}`, body, container }
|
|
65
93
|
}
|
|
66
94
|
})
|
|
67
95
|
</script>
|
|
@@ -78,6 +106,8 @@ const drawerUi = computed(() => {
|
|
|
78
106
|
storage-key="fugue-devtools:dock"
|
|
79
107
|
label="Dev tools"
|
|
80
108
|
bottom-class="bottom-2"
|
|
109
|
+
:ui="{ bar: [DEFAULT_BAR_CLASS, ui?.bar] }"
|
|
110
|
+
:z-index="devToolsLayerValue('dock')"
|
|
81
111
|
:default-percent="100"
|
|
82
112
|
align="end"
|
|
83
113
|
:margin="16"
|
|
@@ -92,6 +122,8 @@ const drawerUi = computed(() => {
|
|
|
92
122
|
:overlay="false"
|
|
93
123
|
:dismissible="false"
|
|
94
124
|
:handle="false"
|
|
125
|
+
handle-only
|
|
126
|
+
:content="drawerContentListeners"
|
|
95
127
|
inset
|
|
96
128
|
:ui="drawerUi"
|
|
97
129
|
>
|
|
@@ -111,24 +143,15 @@ const drawerUi = computed(() => {
|
|
|
111
143
|
</template>
|
|
112
144
|
</DevToolsNav>
|
|
113
145
|
|
|
114
|
-
<
|
|
146
|
+
<UTabs
|
|
115
147
|
v-if="visibleSections.length > 1"
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
:color="activeSection?.id === section.id ? 'primary' : 'neutral'"
|
|
124
|
-
:variant="activeSection?.id === section.id ? 'soft' : 'ghost'"
|
|
125
|
-
size="xs"
|
|
126
|
-
role="tab"
|
|
127
|
-
:aria-selected="activeSection?.id === section.id"
|
|
128
|
-
:data-testid="`devtools-tab-${section.id}`"
|
|
129
|
-
@click="api.activeId.value = section.id"
|
|
130
|
-
/>
|
|
131
|
-
</div>
|
|
148
|
+
v-model="activeTab"
|
|
149
|
+
:items="tabItems"
|
|
150
|
+
:content="false"
|
|
151
|
+
variant="pill"
|
|
152
|
+
size="xs"
|
|
153
|
+
class="mt-2"
|
|
154
|
+
/>
|
|
132
155
|
|
|
133
156
|
<div
|
|
134
157
|
class="mt-3 grid grid-cols-1 gap-4"
|
|
@@ -142,7 +165,7 @@ const drawerUi = computed(() => {
|
|
|
142
165
|
:is-horizontal-dock="isHorizontalDock"
|
|
143
166
|
>
|
|
144
167
|
<DevToolsSection
|
|
145
|
-
:title="activeSection.label"
|
|
168
|
+
:title="visibleSections.length > 1 ? undefined : activeSection.label"
|
|
146
169
|
:class="sectionClass"
|
|
147
170
|
>
|
|
148
171
|
<component :is="activeSection.component" />
|
|
@@ -3,14 +3,17 @@ const {
|
|
|
3
3
|
title,
|
|
4
4
|
class: className,
|
|
5
5
|
} = defineProps<{
|
|
6
|
-
title
|
|
6
|
+
title?: string
|
|
7
7
|
class?: string
|
|
8
8
|
}>()
|
|
9
9
|
</script>
|
|
10
10
|
|
|
11
11
|
<template>
|
|
12
12
|
<section class="devtools-panel__section" :class="className">
|
|
13
|
-
<div
|
|
13
|
+
<div
|
|
14
|
+
v-if="title"
|
|
15
|
+
class="devtools-panel__section-title"
|
|
16
|
+
>
|
|
14
17
|
{{ title }}
|
|
15
18
|
</div>
|
|
16
19
|
<slot />
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { DEVTOOLS_LAYER_CLASSES } from '#devtools/utils/devtoolsLayers'
|
|
3
|
+
|
|
2
4
|
const {
|
|
3
5
|
open,
|
|
4
6
|
ariaLabel = 'Dev Tools',
|
|
@@ -15,7 +17,7 @@ const emit = defineEmits<{
|
|
|
15
17
|
<template>
|
|
16
18
|
<UTooltip
|
|
17
19
|
text="Toggle Dev Tools"
|
|
18
|
-
:ui="{ content:
|
|
20
|
+
:ui="{ content: DEVTOOLS_LAYER_CLASSES.menu }"
|
|
19
21
|
>
|
|
20
22
|
<UButton
|
|
21
23
|
icon="i-lucide-settings"
|
|
@@ -35,3 +35,11 @@ export interface DevToolsApi extends DevToolsRegistry {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
export const DEVTOOLS_INJECTION_KEY: InjectionKey<DevToolsApi> = Symbol('fugue-devtools')
|
|
38
|
+
|
|
39
|
+
/** Classes a site can add to or override on the dev tools, as Nuxt UI's `ui` prop does: later classes win over the defaults. */
|
|
40
|
+
export interface DevToolsPanelUi {
|
|
41
|
+
/** The drawer surface. Default `dark:bg-[#1e1e77]`: a site's own `dark:bg-…` replaces it. */
|
|
42
|
+
panel?: string
|
|
43
|
+
/** The dock's bar (the toggle). Default `dark:bg-[#1e1e77]`. Same slot names as `FloatingDock`'s `ui`. */
|
|
44
|
+
bar?: string
|
|
45
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@altafusion/fugue-devtools",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.6.
|
|
4
|
+
"version": "0.6.3",
|
|
5
5
|
"description": "Generic non-modal dev tools drawer for Nuxt apps — Fugue family",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://github.com/altafusion/fugue/tree/main/packages-fugue/fugue-devtools#readme",
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
"vue-router": "^5.0.0"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@altafusion/fugue-ui": "0.6.
|
|
39
|
+
"@altafusion/fugue-ui": "0.6.3"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@altafusion/eslint-config": "0.6.
|
|
43
|
-
"@altafusion/nuxt-base": "0.6.
|
|
42
|
+
"@altafusion/eslint-config": "0.6.3",
|
|
43
|
+
"@altafusion/nuxt-base": "0.6.3",
|
|
44
44
|
"@types/node": "^26.6.11",
|
|
45
45
|
"eslint": "^10.15.0",
|
|
46
46
|
"nuxt": "^4.7.0",
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where the dev tools sit in the page's stacking order. Lowest to highest:
|
|
3
|
+
*
|
|
4
|
+
* page content and sticky bars <= 30
|
|
5
|
+
* site FloatingDocks 40 (FloatingDock's default)
|
|
6
|
+
* site overlays, Nuxt UI modals 50
|
|
7
|
+
* dev tools dock 70
|
|
8
|
+
* dev tools drawer 75
|
|
9
|
+
* dev tools tooltips and menus 80
|
|
10
|
+
*
|
|
11
|
+
* The numbers live in `assets/css/devtools-panel.css` as CSS variables, so a plain stylesheet and the Vue components read the
|
|
12
|
+
* same values. This file names those variables and the classes that apply them; nothing else in the layer hard-codes a z-index.
|
|
13
|
+
*/
|
|
14
|
+
export const DEVTOOLS_LAYER_VARS = {
|
|
15
|
+
dock: '--devtools-z-dock',
|
|
16
|
+
drawer: '--devtools-z-drawer',
|
|
17
|
+
menu: '--devtools-z-menu',
|
|
18
|
+
} as const
|
|
19
|
+
|
|
20
|
+
export type DevToolsLayer = keyof typeof DEVTOOLS_LAYER_VARS
|
|
21
|
+
|
|
22
|
+
/** A CSS value for `FloatingDock`'s `zIndex` prop (or any `z-index`). */
|
|
23
|
+
export function devToolsLayerValue(layer: DevToolsLayer): string {
|
|
24
|
+
return `var(${DEVTOOLS_LAYER_VARS[layer]})`
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** Plain classes (defined in `devtools-panel.css`, not Tailwind) that apply a layer, for the `ui` slots of Nuxt UI components. */
|
|
28
|
+
export const DEVTOOLS_LAYER_CLASSES = {
|
|
29
|
+
dock: 'devtools-z-dock',
|
|
30
|
+
drawer: 'devtools-z-drawer',
|
|
31
|
+
menu: 'devtools-z-menu',
|
|
32
|
+
} as const satisfies Record<DevToolsLayer, string>
|