@revenexx/studio-shared 0.1.2 → 0.3.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/README.md +22 -12
- package/dist/module.d.mts +15 -0
- package/dist/module.json +9 -0
- package/dist/module.mjs +58 -0
- package/dist/runtime/components/DataTable/ColumnsMenu.d.vue.ts +12 -0
- package/{components → dist/runtime/components}/DataTable/ColumnsMenu.vue +13 -19
- package/dist/runtime/components/DataTable/ColumnsMenu.vue.d.ts +12 -0
- package/dist/runtime/components/DataTable/DataTable.d.vue.ts +87 -0
- package/dist/runtime/components/DataTable/DataTable.vue +510 -0
- package/dist/runtime/components/DataTable/DataTable.vue.d.ts +87 -0
- package/dist/runtime/components/DataTable/FilterMenu.d.vue.ts +21 -0
- package/dist/runtime/components/DataTable/FilterMenu.vue +46 -0
- package/dist/runtime/components/DataTable/FilterMenu.vue.d.ts +21 -0
- package/dist/runtime/components/DataTable/SavedViewsMenu.d.vue.ts +6 -0
- package/dist/runtime/components/DataTable/SavedViewsMenu.vue +189 -0
- package/dist/runtime/components/DataTable/SavedViewsMenu.vue.d.ts +6 -0
- package/dist/runtime/components/DataTable/SortMenu.d.vue.ts +13 -0
- package/dist/runtime/components/DataTable/SortMenu.vue +47 -0
- package/dist/runtime/components/DataTable/SortMenu.vue.d.ts +13 -0
- package/dist/runtime/components/DataTable/ViewModeSwitch.d.vue.ts +20 -0
- package/dist/runtime/components/DataTable/ViewModeSwitch.vue +26 -0
- package/dist/runtime/components/DataTable/ViewModeSwitch.vue.d.ts +20 -0
- package/dist/runtime/components/DataTable/types.d.ts +104 -0
- package/dist/runtime/components/DataTable/types.js +0 -0
- package/dist/runtime/components/Media/MediaFolderTree.d.vue.ts +17 -0
- package/dist/runtime/components/Media/MediaFolderTree.vue +65 -0
- package/dist/runtime/components/Media/MediaFolderTree.vue.d.ts +17 -0
- package/dist/runtime/components/Media/MediaPickerDialog.d.vue.ts +18 -0
- package/dist/runtime/components/Media/MediaPickerDialog.vue +163 -0
- package/dist/runtime/components/Media/MediaPickerDialog.vue.d.ts +18 -0
- package/dist/runtime/components/Media/MediaUploader.d.vue.ts +29 -0
- package/dist/runtime/components/Media/MediaUploader.vue +161 -0
- package/dist/runtime/components/Media/MediaUploader.vue.d.ts +29 -0
- package/dist/runtime/components/Shared/BuildLogsFlyout.d.vue.ts +30 -0
- package/{components → dist/runtime/components}/Shared/BuildLogsFlyout.vue +37 -54
- package/dist/runtime/components/Shared/BuildLogsFlyout.vue.d.ts +30 -0
- package/dist/runtime/components/Shared/GitDeploymentSettings.d.vue.ts +17 -0
- package/dist/runtime/components/Shared/GitDeploymentSettings.vue +75 -0
- package/dist/runtime/components/Shared/GitDeploymentSettings.vue.d.ts +17 -0
- package/dist/runtime/components/Shared/KpiTile.d.vue.ts +13 -0
- package/{components → dist/runtime/components}/Shared/KpiTile.vue +11 -19
- package/dist/runtime/components/Shared/KpiTile.vue.d.ts +13 -0
- package/dist/runtime/components/Shared/ListSurface.d.vue.ts +38 -0
- package/dist/runtime/components/Shared/ListSurface.vue +27 -0
- package/dist/runtime/components/Shared/ListSurface.vue.d.ts +38 -0
- package/dist/runtime/components/Shared/PageHeader.d.vue.ts +23 -0
- package/{components → dist/runtime/components}/Shared/PageHeader.vue +6 -8
- package/dist/runtime/components/Shared/PageHeader.vue.d.ts +23 -0
- package/dist/runtime/components/Shared/RecordLayout.d.vue.ts +52 -0
- package/dist/runtime/components/Shared/RecordLayout.vue +63 -0
- package/dist/runtime/components/Shared/RecordLayout.vue.d.ts +52 -0
- package/dist/runtime/components/Shared/RecordRailCard.d.vue.ts +26 -0
- package/dist/runtime/components/Shared/RecordRailCard.vue +20 -0
- package/dist/runtime/components/Shared/RecordRailCard.vue.d.ts +26 -0
- package/dist/runtime/components/Shared/SidebarNav.d.vue.ts +41 -0
- package/dist/runtime/components/Shared/SidebarNav.vue +48 -0
- package/dist/runtime/components/Shared/SidebarNav.vue.d.ts +41 -0
- package/dist/runtime/components/Shared/SidebarNavLink.d.vue.ts +15 -0
- package/dist/runtime/components/Shared/SidebarNavLink.vue +49 -0
- package/dist/runtime/components/Shared/SidebarNavLink.vue.d.ts +15 -0
- package/dist/runtime/components/Shared/SortHeader.d.vue.ts +23 -0
- package/dist/runtime/components/Shared/SortHeader.vue +35 -0
- package/dist/runtime/components/Shared/SortHeader.vue.d.ts +23 -0
- package/dist/runtime/components/Shared/StateCard.d.vue.ts +32 -0
- package/{components → dist/runtime/components}/Shared/StateCard.vue +21 -36
- package/dist/runtime/components/Shared/StateCard.vue.d.ts +32 -0
- package/dist/runtime/components/Shared/StudioCard.d.vue.ts +15 -0
- package/dist/runtime/components/Shared/StudioCard.vue +19 -0
- package/dist/runtime/components/Shared/StudioCard.vue.d.ts +15 -0
- package/dist/runtime/components/Shared/TabBar.d.vue.ts +23 -0
- package/{components → dist/runtime/components}/Shared/TabBar.vue +7 -16
- package/dist/runtime/components/Shared/TabBar.vue.d.ts +23 -0
- package/dist/runtime/components/Shared/ViewTab.d.vue.ts +7 -0
- package/{components → dist/runtime/components}/Shared/ViewTab.vue +7 -9
- package/dist/runtime/components/Shared/ViewTab.vue.d.ts +7 -0
- package/dist/runtime/components/Shared/Wizard.d.vue.ts +47 -0
- package/dist/runtime/components/Shared/Wizard.vue +66 -0
- package/dist/runtime/components/Shared/Wizard.vue.d.ts +47 -0
- package/dist/runtime/composables/useListRail.d.ts +9 -0
- package/dist/runtime/composables/useListRail.js +19 -0
- package/dist/runtime/composables/useMediaLibrary.d.ts +41 -0
- package/dist/runtime/composables/useMediaLibrary.js +36 -0
- package/dist/runtime/composables/usePlatformAuth.d.ts +35 -0
- package/dist/runtime/composables/usePlatformAuth.js +17 -0
- package/dist/runtime/composables/usePlatformTalkback.d.ts +29 -0
- package/dist/runtime/composables/usePlatformTalkback.js +54 -0
- package/dist/runtime/composables/usePlatformTenant.d.ts +14 -0
- package/dist/runtime/composables/usePlatformTenant.js +18 -0
- package/dist/runtime/composables/useT.d.ts +11 -0
- package/dist/runtime/composables/useT.js +8 -0
- package/dist/runtime/composables/useTalkbackChannels.d.ts +78 -0
- package/dist/runtime/composables/useTalkbackChannels.js +52 -0
- package/dist/runtime/lib/formatBridge.d.ts +50 -0
- package/dist/runtime/lib/formatBridge.js +54 -0
- package/dist/runtime/lib/i18nBridge.d.ts +31 -0
- package/dist/runtime/lib/i18nBridge.js +17 -0
- package/dist/runtime/lib/isoLists.d.ts +61 -0
- package/dist/runtime/lib/isoLists.js +62 -0
- package/dist/runtime/lib/sidebarNav.d.ts +34 -0
- package/dist/runtime/lib/sidebarNav.js +22 -0
- package/dist/runtime/lib/talkback.d.ts +59 -0
- package/dist/runtime/lib/talkback.js +49 -0
- package/dist/runtime/types/nav.d.ts +37 -0
- package/dist/runtime/types/nav.js +0 -0
- package/dist/runtime/types/storage.d.ts +67 -0
- package/dist/runtime/types/storage.js +0 -0
- package/dist/types.d.mts +27 -0
- package/package.json +41 -13
- package/components/DataTable/DataTable.vue +0 -518
- package/components/DataTable/FilterMenu.vue +0 -40
- package/components/DataTable/types.ts +0 -82
- package/components/Shared/GitDeploymentSettings.vue +0 -87
- package/components/Shared/SidebarNav.vue +0 -100
- package/components/Shared/SortHeader.vue +0 -50
- package/components/Shared/StudioCard.vue +0 -24
- package/components/Shared/Wizard.vue +0 -80
- package/composables/usePlatformAuth.ts +0 -35
- package/composables/usePlatformTenant.ts +0 -35
- package/index.ts +0 -16
- package/nuxt.config.ts +0 -23
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
/**
|
|
3
|
-
* Deployment-trigger settings for a git-connected resource (app / site /
|
|
4
|
-
* integration). Two orthogonal controls, mapped to the platform attributes
|
|
5
|
-
* added in V33 (26.1.9):
|
|
6
|
-
*
|
|
7
|
-
* - vcsTriggerMode ('push' | 'tag'): when a deployment is triggered — on every
|
|
8
|
-
* branch push, or only when a tag is pushed / a GitHub release is published.
|
|
9
|
-
* - vcsPreviewsEnabled: whether pull requests get a preview deployment + a
|
|
10
|
-
* status comment. Hidden via `showPreviews=false` for resources where it
|
|
11
|
-
* makes no sense.
|
|
12
|
-
*
|
|
13
|
-
* Presentational only — two v-models, parent owns persistence.
|
|
14
|
-
*/
|
|
15
|
-
import {
|
|
16
|
-
Card, CardContent, CardDescription, CardHeader, CardTitle,
|
|
17
|
-
Label,
|
|
18
|
-
Select, SelectContent, SelectItem, SelectTrigger, SelectValue,
|
|
19
|
-
Switch,
|
|
20
|
-
} from '@revenexx/studio'
|
|
21
|
-
|
|
22
|
-
withDefaults(defineProps<{
|
|
23
|
-
triggerMode: string
|
|
24
|
-
previewsEnabled: boolean
|
|
25
|
-
disabled?: boolean
|
|
26
|
-
showPreviews?: boolean
|
|
27
|
-
}>(), {
|
|
28
|
-
disabled: false,
|
|
29
|
-
showPreviews: true,
|
|
30
|
-
})
|
|
31
|
-
|
|
32
|
-
defineEmits<{
|
|
33
|
-
'update:triggerMode': [value: string]
|
|
34
|
-
'update:previewsEnabled': [value: boolean]
|
|
35
|
-
}>()
|
|
36
|
-
</script>
|
|
37
|
-
|
|
38
|
-
<template>
|
|
39
|
-
<Card class="bg-white/60 backdrop-blur-sm">
|
|
40
|
-
<CardHeader>
|
|
41
|
-
<CardTitle class="text-sm">Deployment triggers</CardTitle>
|
|
42
|
-
<CardDescription class="text-sm">
|
|
43
|
-
Control when a git push deploys this resource.
|
|
44
|
-
</CardDescription>
|
|
45
|
-
</CardHeader>
|
|
46
|
-
<CardContent class="space-y-4">
|
|
47
|
-
<div class="space-y-1">
|
|
48
|
-
<Label for="vcs-trigger-mode">When to deploy</Label>
|
|
49
|
-
<Select
|
|
50
|
-
:model-value="triggerMode"
|
|
51
|
-
:disabled="disabled"
|
|
52
|
-
@update:model-value="(v) => $emit('update:triggerMode', v as string)"
|
|
53
|
-
>
|
|
54
|
-
<SelectTrigger id="vcs-trigger-mode">
|
|
55
|
-
<SelectValue placeholder="On every push" />
|
|
56
|
-
</SelectTrigger>
|
|
57
|
-
<SelectContent>
|
|
58
|
-
<SelectItem value="push">On every push</SelectItem>
|
|
59
|
-
<SelectItem value="tag">Only on tag / release</SelectItem>
|
|
60
|
-
</SelectContent>
|
|
61
|
-
</Select>
|
|
62
|
-
<p class="text-sm text-muted-foreground">
|
|
63
|
-
<template v-if="triggerMode === 'tag'">
|
|
64
|
-
Builds only when you push a tag or publish a GitHub release.
|
|
65
|
-
</template>
|
|
66
|
-
<template v-else>
|
|
67
|
-
Builds on every push to the production branch.
|
|
68
|
-
</template>
|
|
69
|
-
</p>
|
|
70
|
-
</div>
|
|
71
|
-
|
|
72
|
-
<div v-if="showPreviews" class="flex items-center gap-2 pt-1">
|
|
73
|
-
<Switch
|
|
74
|
-
:model-value="previewsEnabled"
|
|
75
|
-
:disabled="disabled"
|
|
76
|
-
@update:model-value="(v) => $emit('update:previewsEnabled', v as boolean)"
|
|
77
|
-
/>
|
|
78
|
-
<div class="text-sm">
|
|
79
|
-
<div class="font-medium">Preview deployments</div>
|
|
80
|
-
<div class="text-sm text-muted-foreground">
|
|
81
|
-
Build a preview and comment the status on every pull request.
|
|
82
|
-
</div>
|
|
83
|
-
</div>
|
|
84
|
-
</div>
|
|
85
|
-
</CardContent>
|
|
86
|
-
</Card>
|
|
87
|
-
</template>
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { Component } from 'vue'
|
|
3
|
-
|
|
4
|
-
export type SidebarNavItem = {
|
|
5
|
-
label: string
|
|
6
|
-
to: string
|
|
7
|
-
icon?: Component
|
|
8
|
-
badge?: number | string | null
|
|
9
|
-
/** Dim + show a "soon" tag (not-yet-shipped surfaces). */
|
|
10
|
-
preview?: boolean
|
|
11
|
-
/** Match the route exactly (for studio roots like `/settings`). */
|
|
12
|
-
exact?: boolean
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export type SidebarNavSection = {
|
|
16
|
-
key: string
|
|
17
|
-
/** Empty/omitted → no group label (pinned items at the top). */
|
|
18
|
-
label?: string
|
|
19
|
-
items: SidebarNavItem[]
|
|
20
|
-
}
|
|
21
|
-
</script>
|
|
22
|
-
|
|
23
|
-
<script setup lang="ts">
|
|
24
|
-
/**
|
|
25
|
-
* Shared studio sidebar.
|
|
26
|
-
*
|
|
27
|
-
* Header (icon + title) + a sectioned, link list driven by data. Every
|
|
28
|
-
* studio sidebar (Settings, Integrations, Commerce, Apps, …) renders
|
|
29
|
-
* through this so spacing, active state, badges and "soon" tags stay
|
|
30
|
-
* identical. Pass `sections`; use `#notice` for loading/empty hints.
|
|
31
|
-
*/
|
|
32
|
-
import type { Component } from 'vue'
|
|
33
|
-
|
|
34
|
-
defineProps<{
|
|
35
|
-
title: string
|
|
36
|
-
icon?: Component
|
|
37
|
-
sections: SidebarNavSection[]
|
|
38
|
-
/** Hide the header icon and use a lighter header title weight. */
|
|
39
|
-
minimal?: boolean
|
|
40
|
-
}>()
|
|
41
|
-
|
|
42
|
-
const route = useRoute()
|
|
43
|
-
function isActive(item: SidebarNavItem): boolean {
|
|
44
|
-
if (item.exact) return route.path === item.to
|
|
45
|
-
return route.path === item.to || route.path.startsWith(`${item.to}/`)
|
|
46
|
-
}
|
|
47
|
-
</script>
|
|
48
|
-
|
|
49
|
-
<template>
|
|
50
|
-
<aside class="h-full flex flex-col">
|
|
51
|
-
<div class="flex items-center gap-2 px-4 pt-4 pb-3 shrink-0 border-b border-black/[0.06]">
|
|
52
|
-
<slot v-if="!minimal" name="icon">
|
|
53
|
-
<component :is="icon" v-if="icon" :size="18" :stroke-width="2" class="text-foreground/70 shrink-0" />
|
|
54
|
-
</slot>
|
|
55
|
-
<h2 class="text-lg text-[#0B0522] truncate" :class="minimal ? 'font-medium' : 'font-semibold'">
|
|
56
|
-
{{ title }}
|
|
57
|
-
</h2>
|
|
58
|
-
</div>
|
|
59
|
-
|
|
60
|
-
<div class="flex-1 overflow-y-auto pt-3 pb-3">
|
|
61
|
-
<slot name="top" />
|
|
62
|
-
|
|
63
|
-
<template v-for="section in sections" :key="section.key">
|
|
64
|
-
<div v-if="section.label" class="mt-3 px-4 pb-1">
|
|
65
|
-
<div class="text-mono text-muted-foreground">
|
|
66
|
-
{{ section.label }}
|
|
67
|
-
</div>
|
|
68
|
-
</div>
|
|
69
|
-
<nav class="flex flex-col gap-0.5 px-2">
|
|
70
|
-
<NuxtLink
|
|
71
|
-
v-for="item in section.items"
|
|
72
|
-
:key="item.to"
|
|
73
|
-
:to="item.to"
|
|
74
|
-
class="group flex items-center gap-2.5 rounded-md px-2 py-1.5 text-sm transition-colors hover:text-primary"
|
|
75
|
-
:class="[
|
|
76
|
-
isActive(item)
|
|
77
|
-
? 'bg-primary/10 text-[#0B0522] font-medium'
|
|
78
|
-
: 'text-foreground/80 hover:bg-primary/5',
|
|
79
|
-
item.preview ? 'opacity-70' : '',
|
|
80
|
-
]"
|
|
81
|
-
>
|
|
82
|
-
<component :is="item.icon" v-if="item.icon" :size="14" :stroke-width="2" class="shrink-0 text-foreground/60 group-hover:text-primary" />
|
|
83
|
-
<span class="flex-1 truncate flex items-center gap-1.5">
|
|
84
|
-
{{ item.label }}
|
|
85
|
-
<span
|
|
86
|
-
v-if="item.preview"
|
|
87
|
-
class="rounded bg-muted px-1 text-mono text-muted-foreground"
|
|
88
|
-
title="Coming soon"
|
|
89
|
-
>
|
|
90
|
-
soon
|
|
91
|
-
</span>
|
|
92
|
-
</span>
|
|
93
|
-
</NuxtLink>
|
|
94
|
-
</nav>
|
|
95
|
-
</template>
|
|
96
|
-
|
|
97
|
-
<slot name="notice" />
|
|
98
|
-
</div>
|
|
99
|
-
</aside>
|
|
100
|
-
</template>
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { RoundSortVertical, SortFromBottomToTop, SortFromTopToBottom } from '#solar-icons'
|
|
3
|
-
|
|
4
|
-
// Clickable column header for data tables (datatable-ux). One Solar sort
|
|
5
|
-
// glyph that switches with the sort state — matching cover's tokens:
|
|
6
|
-
// idle → round-sort-vertical
|
|
7
|
-
// asc → sort-from-bottom-to-top
|
|
8
|
-
// desc → sort-from-top-to-bottom
|
|
9
|
-
// Outline weight (Linear), never duotone. Active = primary accent;
|
|
10
|
-
// inactive = dimmed, revealed on hover.
|
|
11
|
-
//
|
|
12
|
-
// <SortHeader column="name" :active="sort.column"
|
|
13
|
-
// :direction="sort.direction" @toggle="toggle">Name</SortHeader>
|
|
14
|
-
|
|
15
|
-
const props = defineProps<{
|
|
16
|
-
column: string
|
|
17
|
-
active: string | null
|
|
18
|
-
direction: 'asc' | 'desc' | null
|
|
19
|
-
/** Right-align the indicator for numeric columns. */
|
|
20
|
-
alignRight?: boolean
|
|
21
|
-
}>()
|
|
22
|
-
|
|
23
|
-
const emit = defineEmits<{ toggle: [column: string] }>()
|
|
24
|
-
|
|
25
|
-
const isActive = computed(() => props.active === props.column && !!props.direction)
|
|
26
|
-
const sortIcon = computed(() => {
|
|
27
|
-
if (isActive.value && props.direction === 'asc') return SortFromBottomToTop
|
|
28
|
-
if (isActive.value && props.direction === 'desc') return SortFromTopToBottom
|
|
29
|
-
return RoundSortVertical
|
|
30
|
-
})
|
|
31
|
-
</script>
|
|
32
|
-
|
|
33
|
-
<template>
|
|
34
|
-
<button
|
|
35
|
-
type="button"
|
|
36
|
-
class="group inline-flex cursor-pointer items-center gap-1.5 -m-1 p-1 rounded-md text-left transition-colors hover:text-primary"
|
|
37
|
-
:class="alignRight ? 'flex-row-reverse w-full justify-end' : ''"
|
|
38
|
-
@click="emit('toggle', column)"
|
|
39
|
-
>
|
|
40
|
-
<slot />
|
|
41
|
-
<component
|
|
42
|
-
:is="sortIcon"
|
|
43
|
-
weight="Linear"
|
|
44
|
-
:size="14"
|
|
45
|
-
class="shrink-0 transition-colors"
|
|
46
|
-
:class="isActive ? 'text-primary' : 'text-foreground/30 group-hover:text-primary'"
|
|
47
|
-
aria-hidden="true"
|
|
48
|
-
/>
|
|
49
|
-
</button>
|
|
50
|
-
</template>
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
/**
|
|
3
|
-
* The standard cockpit card — the 2-layer "glass" used on the dashboard:
|
|
4
|
-
* an outer transparent ring (hairline border + white outline) wrapping a solid
|
|
5
|
-
* white inner pane clipped to the radius. Use everywhere instead of a single
|
|
6
|
-
* bordered div. Optional `to` makes the whole card a link.
|
|
7
|
-
*/
|
|
8
|
-
import { NuxtLink } from '#components'
|
|
9
|
-
|
|
10
|
-
defineProps<{ to?: string }>()
|
|
11
|
-
</script>
|
|
12
|
-
|
|
13
|
-
<template>
|
|
14
|
-
<component
|
|
15
|
-
:is="to ? NuxtLink : 'div'"
|
|
16
|
-
:to="to"
|
|
17
|
-
class="block rounded-lg border border-gray-400/10 outline-1 outline-white/30"
|
|
18
|
-
:class="to ? 'transition-transform hover:-translate-y-0.5' : ''"
|
|
19
|
-
>
|
|
20
|
-
<div class="relative h-full overflow-hidden rounded-lg bg-white">
|
|
21
|
-
<slot />
|
|
22
|
-
</div>
|
|
23
|
-
</component>
|
|
24
|
-
</template>
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
/**
|
|
3
|
-
* Multi-step wizard shell (PE-114). Renders a Stepper header and a slot
|
|
4
|
-
* for the active step's content, with Back / Next / Finish controls.
|
|
5
|
-
* Steps are declarative; the parent owns each step's fields and can
|
|
6
|
-
* gate advancement with `canAdvance`. A reusable replacement for the
|
|
7
|
-
* inline-cards pattern used by the create flows.
|
|
8
|
-
*
|
|
9
|
-
* Usage:
|
|
10
|
-
* <Wizard :steps="steps" v-model="step" :can-advance="valid" @finish="submit">
|
|
11
|
-
* <template #default="{ step }">…fields for `step.key`…</template>
|
|
12
|
-
* </Wizard>
|
|
13
|
-
*/
|
|
14
|
-
import { Button } from '@revenexx/studio'
|
|
15
|
-
|
|
16
|
-
interface Step { key: string, title: string, description?: string }
|
|
17
|
-
|
|
18
|
-
const props = withDefaults(defineProps<{
|
|
19
|
-
steps: Step[]
|
|
20
|
-
modelValue?: number
|
|
21
|
-
/** Gate the Next/Finish button for the current step. */
|
|
22
|
-
canAdvance?: boolean
|
|
23
|
-
busy?: boolean
|
|
24
|
-
}>(), { modelValue: 0, canAdvance: true, busy: false })
|
|
25
|
-
|
|
26
|
-
const emit = defineEmits<{ 'update:modelValue': [number], 'finish': [] }>()
|
|
27
|
-
|
|
28
|
-
const index = computed({
|
|
29
|
-
get: () => props.modelValue,
|
|
30
|
-
set: v => emit('update:modelValue', v),
|
|
31
|
-
})
|
|
32
|
-
|
|
33
|
-
const isFirst = computed(() => index.value === 0)
|
|
34
|
-
const isLast = computed(() => index.value === props.steps.length - 1)
|
|
35
|
-
const activeStep = computed(() => props.steps[index.value]!)
|
|
36
|
-
|
|
37
|
-
function back() { if (!isFirst.value) index.value-- }
|
|
38
|
-
function next() {
|
|
39
|
-
if (!props.canAdvance || props.busy) return
|
|
40
|
-
if (isLast.value) emit('finish')
|
|
41
|
-
else index.value++
|
|
42
|
-
}
|
|
43
|
-
// Allow jumping back to a completed step via the stepper header.
|
|
44
|
-
function goTo(i: number) { if (i < index.value) index.value = i }
|
|
45
|
-
</script>
|
|
46
|
-
|
|
47
|
-
<template>
|
|
48
|
-
<div class="space-y-5">
|
|
49
|
-
<!-- Go-Live-style stepper: a fill bar + label per step, completed steps
|
|
50
|
-
are clickable to jump back. -->
|
|
51
|
-
<div class="flex gap-3">
|
|
52
|
-
<div
|
|
53
|
-
v-for="(s, i) in steps"
|
|
54
|
-
:key="s.key"
|
|
55
|
-
class="flex-1"
|
|
56
|
-
:class="i < index ? 'cursor-pointer' : ''"
|
|
57
|
-
@click="goTo(i)"
|
|
58
|
-
>
|
|
59
|
-
<div class="h-1 rounded-full transition-colors" :class="i <= index ? 'bg-primary' : 'bg-border'" />
|
|
60
|
-
<div class="mt-2 text-xs font-medium" :class="i <= index ? 'text-primary' : 'text-muted-foreground'">Step {{ i + 1 }}</div>
|
|
61
|
-
<div class="text-sm" :class="i <= index ? 'text-[#0B0522]' : 'text-muted-foreground'">{{ s.title }}</div>
|
|
62
|
-
</div>
|
|
63
|
-
</div>
|
|
64
|
-
|
|
65
|
-
<div>
|
|
66
|
-
<slot :step="activeStep" :index="index" />
|
|
67
|
-
</div>
|
|
68
|
-
|
|
69
|
-
<div class="flex items-center justify-between border-t pt-3">
|
|
70
|
-
<!-- Custom footer (e.g. multiple finish actions on a review step). Falls
|
|
71
|
-
back to the standard Back / Next·Finish pair. -->
|
|
72
|
-
<slot name="footer" :back="back" :next="next" :is-first="isFirst" :is-last="isLast" :can-advance="canAdvance" :busy="busy" :index="index">
|
|
73
|
-
<Button variant="ghost" :disabled="isFirst || busy" @click="back">Back</Button>
|
|
74
|
-
<Button :disabled="!canAdvance || busy" class="gap-1" @click="next">
|
|
75
|
-
{{ isLast ? 'Finish' : 'Next' }}
|
|
76
|
-
</Button>
|
|
77
|
-
</slot>
|
|
78
|
-
</div>
|
|
79
|
-
</div>
|
|
80
|
-
</template>
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Platform auth provider — the seam that lets a studio surface run either
|
|
3
|
-
* inside the full cockpit or standalone.
|
|
4
|
-
*
|
|
5
|
-
* This is the **standalone default**: it sources a bearer token from runtime
|
|
6
|
-
* config (`NUXT_PUBLIC_DEV_TOKEN`) or `localStorage['console.token']`. The
|
|
7
|
-
* full cockpit ships an override at `app/composables/usePlatformAuth.ts`
|
|
8
|
-
* (app-level auto-imports take precedence over this layer) that returns the
|
|
9
|
-
* real Appwrite/Console-sourced operator token.
|
|
10
|
-
*
|
|
11
|
-
* Studio modules (e.g. `@revenexx/studio-integrations`) call this instead of
|
|
12
|
-
* `useConsoleAuth` directly, so they carry no cockpit-only dependency.
|
|
13
|
-
*/
|
|
14
|
-
export interface PlatformAuth {
|
|
15
|
-
getToken: () => Promise<string | null>
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export function usePlatformAuth(): PlatformAuth {
|
|
19
|
-
const config = useRuntimeConfig()
|
|
20
|
-
return {
|
|
21
|
-
async getToken() {
|
|
22
|
-
const fromConfig = (config.public.devToken as string | undefined) || null
|
|
23
|
-
if (fromConfig) return fromConfig
|
|
24
|
-
if (import.meta.client) {
|
|
25
|
-
try {
|
|
26
|
-
return localStorage.getItem('console.token')
|
|
27
|
-
}
|
|
28
|
-
catch {
|
|
29
|
-
return null
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return null
|
|
33
|
-
},
|
|
34
|
-
}
|
|
35
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { computed, ref } from 'vue'
|
|
2
|
-
import type { Ref } from 'vue'
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Platform tenant provider — companion to `usePlatformAuth`.
|
|
6
|
-
*
|
|
7
|
-
* Standalone default: the active tenant slug comes from runtime config
|
|
8
|
-
* (`NUXT_PUBLIC_DEV_TENANT`) or `localStorage['cockpit.devTenant']`. The full
|
|
9
|
-
* cockpit overrides this at `app/composables/usePlatformTenant.ts` to return
|
|
10
|
-
* the real active-tenant slug from `useConsoleTenants`.
|
|
11
|
-
*/
|
|
12
|
-
export interface PlatformTenant {
|
|
13
|
-
slug: Ref<string | null>
|
|
14
|
-
load: () => Promise<void>
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export function usePlatformTenant(): PlatformTenant {
|
|
18
|
-
const config = useRuntimeConfig()
|
|
19
|
-
const stored = ref<string | null>(null)
|
|
20
|
-
if (import.meta.client) {
|
|
21
|
-
try {
|
|
22
|
-
stored.value = localStorage.getItem('cockpit.devTenant')
|
|
23
|
-
}
|
|
24
|
-
catch {
|
|
25
|
-
stored.value = null
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
const slug = computed<string | null>(() => (config.public.devTenant as string | undefined) || stored.value)
|
|
29
|
-
return {
|
|
30
|
-
slug: slug as unknown as Ref<string | null>,
|
|
31
|
-
async load() {
|
|
32
|
-
// no-op in standalone; the slug is static from config/localStorage.
|
|
33
|
-
},
|
|
34
|
-
}
|
|
35
|
-
}
|
package/index.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Type-level barrel for `@revenexx/studio-shared`.
|
|
3
|
-
*
|
|
4
|
-
* The shell primitive *components* auto-import by bare name via the Nuxt
|
|
5
|
-
* layer (see `nuxt.config.ts`). This barrel exposes the *types* consumers
|
|
6
|
-
* need to import explicitly — DataTable column/filter/sort types and the
|
|
7
|
-
* SidebarNav section/item shapes.
|
|
8
|
-
*/
|
|
9
|
-
export type * from './components/DataTable/types'
|
|
10
|
-
export type { SidebarNavItem, SidebarNavSection } from './components/Shared/SidebarNav.vue'
|
|
11
|
-
export type { PlatformAuth } from './composables/usePlatformAuth'
|
|
12
|
-
export type { PlatformTenant } from './composables/usePlatformTenant'
|
|
13
|
-
// NOTE: components are NOT value-exported here — this barrel is loaded in node
|
|
14
|
-
// contexts (types/config) where a `.vue` import fails. The studio modules that
|
|
15
|
-
// need a component explicitly import it via the `./components/*` subpath export
|
|
16
|
-
// (Vite-only), e.g. `@revenexx/studio-shared/components/Shared/SidebarNav.vue`.
|
package/nuxt.config.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { fileURLToPath } from 'node:url'
|
|
2
|
-
import { dirname, join } from 'node:path'
|
|
3
|
-
|
|
4
|
-
const currentDir = dirname(fileURLToPath(import.meta.url))
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Shared cockpit shell primitives, provided as a Nuxt layer.
|
|
8
|
-
*
|
|
9
|
-
* Components are auto-imported by their **bare** name (`pathPrefix: false`),
|
|
10
|
-
* so `<PageHeader>`, `<DataTable>`, `<SidebarNav>`, `<StateCard>`, `<TabBar>`,
|
|
11
|
-
* … resolve without an explicit import — matching how the cockpit already
|
|
12
|
-
* uses them. Type-level exports (DataTable column/filter types,
|
|
13
|
-
* SidebarNavSection) come from the package barrel `@revenexx/studio-shared`.
|
|
14
|
-
*/
|
|
15
|
-
export default defineNuxtConfig({
|
|
16
|
-
$meta: {
|
|
17
|
-
name: 'studio-shared',
|
|
18
|
-
description: 'Shared cockpit shell primitives + design-system wiring.',
|
|
19
|
-
},
|
|
20
|
-
components: [
|
|
21
|
-
{ path: join(currentDir, 'components'), pathPrefix: false },
|
|
22
|
-
],
|
|
23
|
-
})
|