@lobb-js/studio 0.33.0 → 0.34.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/applyUITheme.d.ts +2 -0
- package/dist/{applyStudioTheme.js → applyUITheme.js} +4 -4
- package/dist/components/LlmButton.svelte +4 -2
- package/dist/components/LlmButton.svelte.d.ts +1 -0
- package/dist/components/Studio.svelte +15 -7
- package/dist/components/createManyButton.svelte +2 -2
- package/dist/components/dataTable/dataTable.svelte +1 -1
- package/dist/components/dataTable/dataTableTabs.svelte +1 -1
- package/dist/components/dataTable/filter.svelte +3 -2
- package/dist/components/dataTable/filterButton.svelte +1 -1
- package/dist/components/dataTable/footer.svelte +1 -1
- package/dist/components/dataTable/header.svelte +14 -21
- package/dist/components/dataTable/listViewChildren.svelte +1 -1
- package/dist/components/dataTable/sort.svelte +1 -1
- package/dist/components/dataTable/sortButton.svelte +1 -1
- package/dist/components/dataTable/table.svelte +4 -4
- package/dist/components/dataTablePopup/dataTablePopup.svelte +1 -1
- package/dist/components/detailView/create/createDetailView.svelte +2 -2
- package/dist/components/detailView/create/createDetailViewButton.svelte +2 -0
- package/dist/components/detailView/create/createDetailViewButton.svelte.d.ts +1 -0
- package/dist/components/detailView/create/createDetailViewChildren.svelte +3 -3
- package/dist/components/detailView/create/createManyView.svelte +2 -2
- package/dist/components/detailView/update/updateDetailView.svelte +2 -2
- package/dist/components/detailView/update/updateDetailViewButton.svelte +2 -0
- package/dist/components/detailView/update/updateDetailViewButton.svelte.d.ts +1 -0
- package/dist/components/detailView/update/updateDetailViewChildren.svelte +3 -3
- package/dist/components/drawer.svelte +2 -2
- package/dist/components/horizontalNav.svelte +85 -0
- package/dist/components/horizontalNav.svelte.d.ts +3 -0
- package/dist/components/importButton.svelte +6 -6
- package/dist/components/mainNav.svelte +15 -0
- package/dist/components/mainNav.svelte.d.ts +6 -0
- package/dist/components/mainNavShared.d.ts +10 -0
- package/dist/components/mainNavShared.js +62 -0
- package/dist/components/rangeCalendarButton.svelte +1 -2
- package/dist/components/routes/home.svelte +1 -1
- package/dist/components/routes/workflows/workflows.svelte +1 -1
- package/dist/components/setServerPage.svelte +1 -1
- package/dist/components/sidebar/sidebar.svelte +2 -2
- package/dist/components/sidebar/sidebarElements.svelte +3 -3
- package/dist/components/singletone.svelte +2 -2
- package/dist/components/ui/skeleton/skeleton.svelte +1 -1
- package/dist/components/ui/tooltip/tooltip-content.svelte +1 -1
- package/dist/components/verticalNav.svelte +174 -0
- package/dist/components/verticalNav.svelte.d.ts +3 -0
- package/dist/components/workflowEditor.svelte +2 -2
- package/dist/store.types.d.ts +4 -3
- package/package.json +2 -2
- package/src/app.css +52 -75
- package/src/lib/{applyStudioTheme.ts → applyUITheme.ts} +5 -5
- package/src/lib/components/LlmButton.svelte +4 -2
- package/src/lib/components/Studio.svelte +15 -7
- package/src/lib/components/createManyButton.svelte +2 -2
- package/src/lib/components/dataTable/dataTable.svelte +1 -1
- package/src/lib/components/dataTable/dataTableTabs.svelte +1 -1
- package/src/lib/components/dataTable/filter.svelte +3 -2
- package/src/lib/components/dataTable/filterButton.svelte +1 -1
- package/src/lib/components/dataTable/footer.svelte +1 -1
- package/src/lib/components/dataTable/header.svelte +14 -21
- package/src/lib/components/dataTable/listViewChildren.svelte +1 -1
- package/src/lib/components/dataTable/sort.svelte +1 -1
- package/src/lib/components/dataTable/sortButton.svelte +1 -1
- package/src/lib/components/dataTable/table.svelte +4 -4
- package/src/lib/components/dataTablePopup/dataTablePopup.svelte +1 -1
- package/src/lib/components/detailView/create/createDetailView.svelte +2 -2
- package/src/lib/components/detailView/create/createDetailViewButton.svelte +2 -0
- package/src/lib/components/detailView/create/createDetailViewChildren.svelte +3 -3
- package/src/lib/components/detailView/create/createManyView.svelte +2 -2
- package/src/lib/components/detailView/update/updateDetailView.svelte +2 -2
- package/src/lib/components/detailView/update/updateDetailViewButton.svelte +2 -0
- package/src/lib/components/detailView/update/updateDetailViewChildren.svelte +3 -3
- package/src/lib/components/drawer.svelte +2 -2
- package/src/lib/components/horizontalNav.svelte +85 -0
- package/src/lib/components/importButton.svelte +6 -6
- package/src/lib/components/mainNav.svelte +15 -0
- package/src/lib/components/mainNavShared.ts +67 -0
- package/src/lib/components/rangeCalendarButton.svelte +1 -2
- package/src/lib/components/routes/home.svelte +1 -1
- package/src/lib/components/routes/workflows/workflows.svelte +1 -1
- package/src/lib/components/setServerPage.svelte +1 -1
- package/src/lib/components/sidebar/sidebar.svelte +2 -2
- package/src/lib/components/sidebar/sidebarElements.svelte +3 -3
- package/src/lib/components/singletone.svelte +2 -2
- package/src/lib/components/ui/skeleton/skeleton.svelte +1 -1
- package/src/lib/components/ui/tooltip/tooltip-content.svelte +1 -1
- package/src/lib/components/verticalNav.svelte +174 -0
- package/src/lib/components/workflowEditor.svelte +2 -2
- package/src/lib/store.types.ts +2 -2
- package/dist/applyStudioTheme.d.ts +0 -2
- package/dist/components/miniSidebar.svelte +0 -300
- package/dist/components/miniSidebar.svelte.d.ts +0 -5
- package/src/lib/components/miniSidebar.svelte +0 -300
|
@@ -170,7 +170,7 @@
|
|
|
170
170
|
}
|
|
171
171
|
</script>
|
|
172
172
|
|
|
173
|
-
<Button variant={rest.variant} class={rest.class} onclick={showDrawer}>
|
|
173
|
+
<Button variant={rest.variant} size={rest.size} class={rest.class} onclick={showDrawer}>
|
|
174
174
|
<ExtensionsComponents
|
|
175
175
|
name="collections.import.button.content"
|
|
176
176
|
utils={getExtensionUtils(lobb, ctx)}
|
|
@@ -264,11 +264,11 @@
|
|
|
264
264
|
</div>
|
|
265
265
|
|
|
266
266
|
<div class="flex h-12 shrink-0 items-center justify-end gap-2 border-t px-4">
|
|
267
|
-
<Button variant="outline" onclick={hideDrawer}
|
|
267
|
+
<Button variant="outline" onclick={hideDrawer} size="sm" Icon={X}>
|
|
268
268
|
Cancel
|
|
269
269
|
</Button>
|
|
270
270
|
{#if activeTab === "paste"}
|
|
271
|
-
<Button onclick={() => processContent(pasteContent)}
|
|
271
|
+
<Button onclick={() => processContent(pasteContent)} size="sm" Icon={FileText}>
|
|
272
272
|
Parse
|
|
273
273
|
</Button>
|
|
274
274
|
{/if}
|
|
@@ -289,10 +289,10 @@
|
|
|
289
289
|
</div>
|
|
290
290
|
|
|
291
291
|
<div class="flex h-12 shrink-0 items-center justify-end gap-2 border-t px-4">
|
|
292
|
-
<Button variant="outline" onclick={() => (step = "input")}
|
|
292
|
+
<Button variant="outline" onclick={() => (step = "input")} size="sm" Icon={X}>
|
|
293
293
|
Cancel
|
|
294
294
|
</Button>
|
|
295
|
-
<Button onclick={handleImport}
|
|
295
|
+
<Button onclick={handleImport} size="sm" Icon={Check}>
|
|
296
296
|
Import {transformedRows.length} records
|
|
297
297
|
</Button>
|
|
298
298
|
</div>
|
|
@@ -345,7 +345,7 @@
|
|
|
345
345
|
</div>
|
|
346
346
|
{/if}
|
|
347
347
|
<div class="flex h-12 shrink-0 items-center justify-end gap-2 border-t px-4">
|
|
348
|
-
<Button onclick={hideDrawer}
|
|
348
|
+
<Button onclick={hideDrawer} size="sm" Icon={Check}>
|
|
349
349
|
Done
|
|
350
350
|
</Button>
|
|
351
351
|
</div>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import VerticalNav from "./verticalNav.svelte";
|
|
3
|
+
import HorizontalNav from "./horizontalNav.svelte";
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
orientation?: "vertical" | "horizontal";
|
|
7
|
+
}
|
|
8
|
+
const { orientation = "vertical" }: Props = $props();
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
{#if orientation === "horizontal"}
|
|
12
|
+
<HorizontalNav />
|
|
13
|
+
{:else}
|
|
14
|
+
<VerticalNav />
|
|
15
|
+
{/if}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type NavItem = {
|
|
2
|
+
label: string;
|
|
3
|
+
href?: string;
|
|
4
|
+
icon: any;
|
|
5
|
+
represents?: string;
|
|
6
|
+
onclick?: () => void;
|
|
7
|
+
navs?: NavItem[];
|
|
8
|
+
};
|
|
9
|
+
export declare function buildNavSections(lobb: any, ctx: any): Promise<NavItem[][]>;
|
|
10
|
+
export declare function isItemActive(currentPath: string, item: NavItem): boolean;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { House, Layers, Library, Workflow } from "lucide-svelte";
|
|
2
|
+
import { emitEvent } from "../eventSystem";
|
|
3
|
+
import { getDashboardNavs } from "../extensions/extensionUtils";
|
|
4
|
+
async function isItemVisible(lobb, ctx, item) {
|
|
5
|
+
if (!item.represents)
|
|
6
|
+
return true;
|
|
7
|
+
const res = await emitEvent({ lobb, ctx }, "auth.canAccess", {
|
|
8
|
+
collection: item.represents,
|
|
9
|
+
action: "read",
|
|
10
|
+
});
|
|
11
|
+
return res === true;
|
|
12
|
+
}
|
|
13
|
+
export async function buildNavSections(lobb, ctx) {
|
|
14
|
+
const rawSections = [
|
|
15
|
+
[
|
|
16
|
+
{ label: "Home", href: "/studio", icon: House },
|
|
17
|
+
{ label: "Collections", href: "/studio/collections", icon: Library },
|
|
18
|
+
{ label: "Data Model", href: "/studio/datamodel", icon: Layers, represents: "core_data_model" },
|
|
19
|
+
{ label: "Workflows", href: "/studio/workflows", icon: Workflow, represents: "core_workflows" },
|
|
20
|
+
],
|
|
21
|
+
[],
|
|
22
|
+
[],
|
|
23
|
+
];
|
|
24
|
+
const navs = getDashboardNavs(ctx);
|
|
25
|
+
if (navs.top)
|
|
26
|
+
rawSections[0].push(...navs.top);
|
|
27
|
+
if (navs.middle)
|
|
28
|
+
rawSections[1].push(...navs.middle);
|
|
29
|
+
if (navs.bottom)
|
|
30
|
+
rawSections[2].push(...navs.bottom);
|
|
31
|
+
const result = [[], [], []];
|
|
32
|
+
for (let i = 0; i < rawSections.length; i++) {
|
|
33
|
+
for (const item of rawSections[i]) {
|
|
34
|
+
if (item.navs) {
|
|
35
|
+
const visibleChildren = [];
|
|
36
|
+
for (const child of item.navs) {
|
|
37
|
+
if (await isItemVisible(lobb, ctx, child))
|
|
38
|
+
visibleChildren.push(child);
|
|
39
|
+
}
|
|
40
|
+
if (visibleChildren.length && (await isItemVisible(lobb, ctx, item))) {
|
|
41
|
+
result[i].push({ ...item, navs: visibleChildren });
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
else if (await isItemVisible(lobb, ctx, item)) {
|
|
45
|
+
result[i].push(item);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return result;
|
|
50
|
+
}
|
|
51
|
+
export function isItemActive(currentPath, item) {
|
|
52
|
+
if (item.navs)
|
|
53
|
+
return item.navs.some((c) => isItemActive(currentPath, c));
|
|
54
|
+
if (!item.href)
|
|
55
|
+
return false;
|
|
56
|
+
const itemHref = item.href.replace(/\/$/, "") || "/";
|
|
57
|
+
// "/studio" needs an exact match — it's a prefix of every other
|
|
58
|
+
// route, so startsWith would always light it up.
|
|
59
|
+
if (itemHref === "/studio")
|
|
60
|
+
return currentPath === "/studio";
|
|
61
|
+
return currentPath === itemHref || currentPath.startsWith(itemHref + "/");
|
|
62
|
+
}
|
|
@@ -33,9 +33,8 @@
|
|
|
33
33
|
<Popover.Root>
|
|
34
34
|
<Popover.Trigger
|
|
35
35
|
class={cn(
|
|
36
|
-
buttonVariants({ variant: "outline" }),
|
|
36
|
+
buttonVariants({ variant: "outline", size: "sm" }),
|
|
37
37
|
!value && "text-muted-foreground",
|
|
38
|
-
"h-7 px-3 text-xs font-normal",
|
|
39
38
|
)}
|
|
40
39
|
>
|
|
41
40
|
<CalendarIcon class="mr-2 size-4" />
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
<div class="text-4xl">Welcome back</div>
|
|
35
35
|
<div>Sign in to your account</div>
|
|
36
36
|
</div>
|
|
37
|
-
<div class="flex flex-col gap-6 rounded-md border bg-
|
|
37
|
+
<div class="flex flex-col gap-6 rounded-md border bg-card p-6">
|
|
38
38
|
<div class="flex flex-col gap-2">
|
|
39
39
|
<div>
|
|
40
40
|
<div class="mb-1 text-sm font-medium">Server</div>
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
>
|
|
91
91
|
<div
|
|
92
92
|
class="
|
|
93
|
-
bg-
|
|
93
|
+
bg-card border-r overflow-hidden
|
|
94
94
|
"
|
|
95
95
|
style="
|
|
96
96
|
{sidebarProperties.collapsed ? 'border-right-width: 0px; padding: 0px;' : ''}
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
</div>
|
|
124
124
|
<div
|
|
125
125
|
class="
|
|
126
|
-
text-
|
|
126
|
+
text-foreground p-2 overflow-y-auto overflow-x-clip
|
|
127
127
|
"
|
|
128
128
|
style="max-height: {sidebarBodyHeight}px;"
|
|
129
129
|
>
|
|
@@ -89,8 +89,8 @@
|
|
|
89
89
|
href={node.href}
|
|
90
90
|
variant="ghost"
|
|
91
91
|
class="
|
|
92
|
-
flex items-center justify-between p-2 gap-2
|
|
93
|
-
rounded-md {isselected ? 'bg-muted' : ''}
|
|
92
|
+
flex items-center justify-between p-2 gap-2 text-muted-foreground
|
|
93
|
+
rounded-md {isselected ? 'bg-muted' : 'hover:bg-muted-soft'}
|
|
94
94
|
"
|
|
95
95
|
title={node.name}
|
|
96
96
|
>
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
{#if node.icon}
|
|
99
99
|
<node.icon size="17.5" />
|
|
100
100
|
{/if}
|
|
101
|
-
<div class="text-xs {isselected ? 'text-
|
|
101
|
+
<div class="text-xs {isselected ? 'text-foreground font-medium' : ''}">
|
|
102
102
|
{node.name}
|
|
103
103
|
</div>
|
|
104
104
|
</div>
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
</script>
|
|
40
40
|
|
|
41
41
|
<div class="flex flex-col h-full bg-background">
|
|
42
|
-
<div class="flex justify-between items-center gap-2 p-2 border-b h-
|
|
42
|
+
<div class="flex justify-between items-center gap-2 p-2 border-b h-12 shrink-0">
|
|
43
43
|
<div class="flex items-center gap-1">
|
|
44
44
|
<SidebarTrigger />
|
|
45
45
|
</div>
|
|
46
46
|
<div>
|
|
47
|
-
<Button
|
|
47
|
+
<Button size="sm" Icon={Save} onclick={handleSave}>
|
|
48
48
|
Save
|
|
49
49
|
</Button>
|
|
50
50
|
</div>
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
bind:ref
|
|
15
15
|
{sideOffset}
|
|
16
16
|
class={cn(
|
|
17
|
-
"bg-
|
|
17
|
+
"bg-popover text-popover-foreground border shadow-sm animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 overflow-hidden rounded-md px-3 py-1.5 text-xs",
|
|
18
18
|
className
|
|
19
19
|
)}
|
|
20
20
|
{...restProps}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { X } from "lucide-svelte";
|
|
3
|
+
import { onMount } from "svelte";
|
|
4
|
+
import { page } from "$app/state";
|
|
5
|
+
import { goto } from "$app/navigation";
|
|
6
|
+
import Button from "./ui/button/button.svelte";
|
|
7
|
+
import Separator from "./ui/separator/separator.svelte";
|
|
8
|
+
import * as Tooltip from "./ui/tooltip";
|
|
9
|
+
import * as Accordion from "./ui/accordion/index.js";
|
|
10
|
+
import * as Popover from "./ui/popover";
|
|
11
|
+
import { getStudioContext } from "../context";
|
|
12
|
+
import { mediaQueries } from "../utils";
|
|
13
|
+
import { buildNavSections, isItemActive, type NavItem } from "./mainNavShared";
|
|
14
|
+
|
|
15
|
+
const { lobb, ctx } = getStudioContext();
|
|
16
|
+
|
|
17
|
+
let isSmallScreen = $derived(!mediaQueries.sm.current);
|
|
18
|
+
let isCollapsed = $state(true);
|
|
19
|
+
$effect(() => {
|
|
20
|
+
isCollapsed = isSmallScreen;
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
let sections: NavItem[][] = $state([[], [], []]);
|
|
24
|
+
onMount(async () => {
|
|
25
|
+
sections = await buildNavSections(lobb, ctx);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
const currentPath = $derived(page.url.pathname.replace(/\/$/, "") || "/");
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
{#snippet section(section: NavItem[])}
|
|
32
|
+
<div class="flex flex-col {isSmallScreen ? 'gap-0' : 'gap-2'}">
|
|
33
|
+
{#each section as item}
|
|
34
|
+
{@const active = isItemActive(currentPath, item)}
|
|
35
|
+
{#if isSmallScreen}
|
|
36
|
+
{#if !item.navs}
|
|
37
|
+
<Button
|
|
38
|
+
onclick={() => {
|
|
39
|
+
if (item.onclick) item.onclick();
|
|
40
|
+
else if (item.href) goto(item.href);
|
|
41
|
+
isCollapsed = true;
|
|
42
|
+
}}
|
|
43
|
+
class="flex items-center justify-start flex-nowrap text-nowrap h-10 w-full {active
|
|
44
|
+
? 'bg-accent text-foreground'
|
|
45
|
+
: 'text-foreground/70 hover:bg-accent/50 hover:text-foreground'}"
|
|
46
|
+
variant="ghost"
|
|
47
|
+
size="icon"
|
|
48
|
+
Icon={item.icon}
|
|
49
|
+
>
|
|
50
|
+
{item.label}
|
|
51
|
+
</Button>
|
|
52
|
+
{:else}
|
|
53
|
+
<Accordion.Root type="single">
|
|
54
|
+
<Accordion.Item class="border-b-0">
|
|
55
|
+
<Accordion.Trigger class="justify-between p-0 h-10">
|
|
56
|
+
<div
|
|
57
|
+
class="flex items-center gap-2 {active
|
|
58
|
+
? 'text-accent-foreground'
|
|
59
|
+
: 'text-foreground/70'}"
|
|
60
|
+
>
|
|
61
|
+
<item.icon size="18" />
|
|
62
|
+
<div class="text-nowrap">{item.label}</div>
|
|
63
|
+
</div>
|
|
64
|
+
</Accordion.Trigger>
|
|
65
|
+
<Accordion.Content class="pl-2 border-l border-border">
|
|
66
|
+
{#each item.navs as childItem}
|
|
67
|
+
{@const childActive = isItemActive(currentPath, childItem)}
|
|
68
|
+
<Button
|
|
69
|
+
onclick={() => {
|
|
70
|
+
if (childItem.onclick) childItem.onclick();
|
|
71
|
+
else if (childItem.href) goto(childItem.href);
|
|
72
|
+
isCollapsed = true;
|
|
73
|
+
}}
|
|
74
|
+
class="flex items-center justify-start flex-nowrap text-nowrap h-8 w-full {childActive
|
|
75
|
+
? 'bg-accent text-foreground'
|
|
76
|
+
: 'text-foreground/70 hover:bg-accent/50 hover:text-foreground'}"
|
|
77
|
+
variant="ghost"
|
|
78
|
+
size="icon"
|
|
79
|
+
Icon={childItem.icon}
|
|
80
|
+
>
|
|
81
|
+
{childItem.label}
|
|
82
|
+
</Button>
|
|
83
|
+
{/each}
|
|
84
|
+
</Accordion.Content>
|
|
85
|
+
</Accordion.Item>
|
|
86
|
+
</Accordion.Root>
|
|
87
|
+
{/if}
|
|
88
|
+
{:else}
|
|
89
|
+
<Tooltip.Root>
|
|
90
|
+
<Tooltip.Trigger>
|
|
91
|
+
{#if !item.navs}
|
|
92
|
+
<Button
|
|
93
|
+
onclick={() => { if (item.onclick) item.onclick(); }}
|
|
94
|
+
href={item.href}
|
|
95
|
+
class={active
|
|
96
|
+
? 'bg-accent text-foreground'
|
|
97
|
+
: 'text-foreground/70 hover:bg-accent/50 hover:text-foreground'}
|
|
98
|
+
variant="ghost"
|
|
99
|
+
size="icon"
|
|
100
|
+
Icon={item.icon}
|
|
101
|
+
></Button>
|
|
102
|
+
{:else}
|
|
103
|
+
<Popover.Root>
|
|
104
|
+
<Popover.Trigger>
|
|
105
|
+
<Button
|
|
106
|
+
class={active
|
|
107
|
+
? 'bg-accent text-foreground'
|
|
108
|
+
: 'text-foreground/70 hover:bg-accent/50 hover:text-foreground'}
|
|
109
|
+
variant="ghost"
|
|
110
|
+
size="icon"
|
|
111
|
+
Icon={item.icon}
|
|
112
|
+
></Button>
|
|
113
|
+
</Popover.Trigger>
|
|
114
|
+
<Popover.Content sideOffset={17.5} side="right" class="popover_content w-60 mb-4 p-0">
|
|
115
|
+
<div class="py-1">
|
|
116
|
+
{#each item.navs as childItem}
|
|
117
|
+
{@const childActive = isItemActive(currentPath, childItem)}
|
|
118
|
+
<div class="px-1 text-xs text-muted-foreground">
|
|
119
|
+
<Button
|
|
120
|
+
variant="ghost"
|
|
121
|
+
class="flex h-7 w-full justify-start p-2 text-xs font-normal {childActive
|
|
122
|
+
? 'bg-accent text-accent-foreground'
|
|
123
|
+
: 'text-muted-foreground'}"
|
|
124
|
+
Icon={childItem.icon}
|
|
125
|
+
onclick={() => { if (childItem.onclick) childItem.onclick(); }}
|
|
126
|
+
href={childItem.href}
|
|
127
|
+
>
|
|
128
|
+
{childItem.label}
|
|
129
|
+
</Button>
|
|
130
|
+
</div>
|
|
131
|
+
{/each}
|
|
132
|
+
</div>
|
|
133
|
+
</Popover.Content>
|
|
134
|
+
</Popover.Root>
|
|
135
|
+
{/if}
|
|
136
|
+
</Tooltip.Trigger>
|
|
137
|
+
<Tooltip.Content side="right" sideOffset={15}>
|
|
138
|
+
{item.label}
|
|
139
|
+
</Tooltip.Content>
|
|
140
|
+
</Tooltip.Root>
|
|
141
|
+
{/if}
|
|
142
|
+
{/each}
|
|
143
|
+
</div>
|
|
144
|
+
{/snippet}
|
|
145
|
+
|
|
146
|
+
<div
|
|
147
|
+
class="
|
|
148
|
+
{isSmallScreen ? 'fixed top-0 left-0 h-full z-50' : 'relative'}
|
|
149
|
+
border-r border-border bg-card text-foreground w-screen
|
|
150
|
+
{isCollapsed
|
|
151
|
+
? 'max-w-0 p-0'
|
|
152
|
+
: `max-w-14 ${isSmallScreen ? 'px-3 pb-3' : 'p-2'}`}"
|
|
153
|
+
style="transition: max-width 150ms, padding 150ms; {isSmallScreen && !isCollapsed ? 'max-width: 100vw' : ''}"
|
|
154
|
+
>
|
|
155
|
+
{#if isSmallScreen && !isCollapsed}
|
|
156
|
+
<X
|
|
157
|
+
class="absolute h-10 text-foreground/70 hover:bg-transparent cursor-pointer hover:text-foreground"
|
|
158
|
+
style="left: 0.6rem; top: 0rem;"
|
|
159
|
+
size="18"
|
|
160
|
+
onclick={() => (isCollapsed = !isCollapsed)}
|
|
161
|
+
/>
|
|
162
|
+
{/if}
|
|
163
|
+
<div class="flex h-full flex-col justify-between gap-2 w-full overflow-hidden">
|
|
164
|
+
<div class="flex flex-col gap-2 {isSmallScreen ? 'pt-8' : ''}">
|
|
165
|
+
{@render section(sections[0])}
|
|
166
|
+
<Separator class="bg-border" />
|
|
167
|
+
{@render section(sections[1])}
|
|
168
|
+
</div>
|
|
169
|
+
<div class="flex flex-col gap-2">
|
|
170
|
+
<Separator class="bg-border" />
|
|
171
|
+
{@render section(sections[2])}
|
|
172
|
+
</div>
|
|
173
|
+
</div>
|
|
174
|
+
</div>
|
|
@@ -157,7 +157,7 @@
|
|
|
157
157
|
<div>
|
|
158
158
|
{#if workflow.id}
|
|
159
159
|
<Button
|
|
160
|
-
class="
|
|
160
|
+
size="sm" class="w-full"
|
|
161
161
|
variant="default"
|
|
162
162
|
onclick={handleUpdateWorkflow}
|
|
163
163
|
Icon={Edit}
|
|
@@ -167,7 +167,7 @@
|
|
|
167
167
|
</Button>
|
|
168
168
|
{:else}
|
|
169
169
|
<Button
|
|
170
|
-
class="
|
|
170
|
+
size="sm" class="w-full"
|
|
171
171
|
variant="default"
|
|
172
172
|
onclick={handleCreateWorkflow}
|
|
173
173
|
Icon={Plus}
|
package/dist/store.types.d.ts
CHANGED
|
@@ -30,14 +30,15 @@ interface Collection {
|
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
32
|
type Collections = Record<string, Collection>;
|
|
33
|
-
export interface
|
|
33
|
+
export interface UITheme {
|
|
34
34
|
light?: Record<string, string>;
|
|
35
35
|
dark?: Record<string, string>;
|
|
36
36
|
}
|
|
37
37
|
interface Meta {
|
|
38
38
|
version: string;
|
|
39
|
-
|
|
40
|
-
theme?:
|
|
39
|
+
ui?: {
|
|
40
|
+
theme?: UITheme;
|
|
41
|
+
horizontalNav?: boolean;
|
|
41
42
|
};
|
|
42
43
|
relations: Array<any>;
|
|
43
44
|
collections: Collections;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobb-js/studio",
|
|
3
3
|
"license": "UNLICENSED",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.34.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"postpublish": "./scripts/postpublish.sh"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@lobb-js/core": "^0.
|
|
45
|
+
"@lobb-js/core": "^0.35.0",
|
|
46
46
|
"@chromatic-com/storybook": "^4.1.2",
|
|
47
47
|
"@storybook/addon-a11y": "^10.0.1",
|
|
48
48
|
"@storybook/addon-docs": "^10.0.1",
|
package/src/app.css
CHANGED
|
@@ -7,74 +7,64 @@
|
|
|
7
7
|
@custom-variant dark (&:is(.dark *));
|
|
8
8
|
|
|
9
9
|
:root {
|
|
10
|
-
--radius: 0.
|
|
10
|
+
--radius: 0.5rem;
|
|
11
|
+
|
|
11
12
|
--background: oklch(1 0 0);
|
|
12
|
-
--foreground: oklch(0.
|
|
13
|
+
--foreground: oklch(0.20 0.012 138);
|
|
14
|
+
|
|
13
15
|
--card: oklch(1 0 0);
|
|
14
|
-
--card-foreground: oklch(0.
|
|
16
|
+
--card-foreground: oklch(0.20 0.012 138);
|
|
15
17
|
--popover: oklch(1 0 0);
|
|
16
|
-
--popover-foreground: oklch(0.
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
--
|
|
20
|
-
--
|
|
21
|
-
|
|
22
|
-
--
|
|
23
|
-
--
|
|
24
|
-
|
|
25
|
-
--
|
|
26
|
-
--
|
|
27
|
-
--
|
|
28
|
-
|
|
29
|
-
--
|
|
30
|
-
--
|
|
31
|
-
|
|
32
|
-
--
|
|
33
|
-
|
|
34
|
-
--
|
|
35
|
-
--
|
|
36
|
-
--
|
|
37
|
-
--sidebar-primary: oklch(0.208 0.042 265.755);
|
|
38
|
-
--sidebar-primary-foreground: oklch(0.984 0.003 247.858);
|
|
39
|
-
--sidebar-accent: oklch(0.968 0.007 247.896);
|
|
40
|
-
--sidebar-accent-foreground: oklch(0.208 0.042 265.755);
|
|
41
|
-
--sidebar-border: oklch(0.929 0.013 255.508);
|
|
42
|
-
--sidebar-ring: oklch(0.704 0.04 256.788);
|
|
18
|
+
--popover-foreground: oklch(0.20 0.012 138);
|
|
19
|
+
|
|
20
|
+
/* Brand green — used for primary buttons, focus rings, active accents. */
|
|
21
|
+
--primary: oklch(0.62 0.18 138);
|
|
22
|
+
--primary-foreground: oklch(1 0 0);
|
|
23
|
+
|
|
24
|
+
--secondary: oklch(0.97 0.001 138);
|
|
25
|
+
--secondary-foreground: oklch(0.20 0.012 138);
|
|
26
|
+
|
|
27
|
+
--muted: oklch(0.97 0.001 138);
|
|
28
|
+
--muted-foreground: oklch(0.55 0.012 138);
|
|
29
|
+
--muted-soft: oklch(0.985 0.001 138);
|
|
30
|
+
|
|
31
|
+
--accent: oklch(0.95 0.001 138);
|
|
32
|
+
--accent-foreground: oklch(0.20 0.012 138);
|
|
33
|
+
|
|
34
|
+
--destructive: oklch(0.62 0.24 27);
|
|
35
|
+
|
|
36
|
+
--border: oklch(0.91 0.001 138);
|
|
37
|
+
--input: oklch(0.91 0.001 138);
|
|
38
|
+
--ring: oklch(0.62 0.18 138);
|
|
43
39
|
}
|
|
44
40
|
|
|
45
41
|
.dark {
|
|
46
|
-
--background: oklch(0.
|
|
47
|
-
--foreground: oklch(0.
|
|
48
|
-
|
|
49
|
-
--card
|
|
50
|
-
--
|
|
51
|
-
--popover
|
|
52
|
-
--
|
|
53
|
-
|
|
54
|
-
--
|
|
55
|
-
--
|
|
56
|
-
|
|
57
|
-
--
|
|
58
|
-
--
|
|
59
|
-
|
|
60
|
-
--
|
|
61
|
-
--
|
|
62
|
-
--
|
|
63
|
-
|
|
64
|
-
--
|
|
65
|
-
--
|
|
66
|
-
|
|
67
|
-
--
|
|
68
|
-
|
|
69
|
-
--
|
|
70
|
-
--
|
|
71
|
-
--
|
|
72
|
-
--sidebar-primary: oklch(0.488 0.243 264.376);
|
|
73
|
-
--sidebar-primary-foreground: oklch(0.984 0.003 247.858);
|
|
74
|
-
--sidebar-accent: oklch(0.279 0.041 260.031);
|
|
75
|
-
--sidebar-accent-foreground: oklch(0.984 0.003 247.858);
|
|
76
|
-
--sidebar-border: oklch(1 0 0 / 10%);
|
|
77
|
-
--sidebar-ring: oklch(0.551 0.027 264.364);
|
|
42
|
+
--background: oklch(0.16 0.012 138);
|
|
43
|
+
--foreground: oklch(0.94 0.012 138);
|
|
44
|
+
|
|
45
|
+
--card: oklch(0.18 0.012 138);
|
|
46
|
+
--card-foreground: oklch(0.94 0.012 138);
|
|
47
|
+
--popover: oklch(0.18 0.012 138);
|
|
48
|
+
--popover-foreground: oklch(0.94 0.012 138);
|
|
49
|
+
|
|
50
|
+
--primary: oklch(0.72 0.20 140);
|
|
51
|
+
--primary-foreground: oklch(0.16 0.012 138);
|
|
52
|
+
|
|
53
|
+
--secondary: oklch(0.24 0.012 138);
|
|
54
|
+
--secondary-foreground: oklch(0.94 0.012 138);
|
|
55
|
+
|
|
56
|
+
--muted: oklch(0.24 0.012 138);
|
|
57
|
+
--muted-foreground: oklch(0.65 0.012 138);
|
|
58
|
+
--muted-soft: oklch(0.20 0.012 138);
|
|
59
|
+
|
|
60
|
+
--accent: oklch(0.27 0.012 138);
|
|
61
|
+
--accent-foreground: oklch(0.94 0.012 138);
|
|
62
|
+
|
|
63
|
+
--destructive: oklch(0.70 0.22 27);
|
|
64
|
+
|
|
65
|
+
--border: oklch(1 0 0 / 8%);
|
|
66
|
+
--input: oklch(1 0 0 / 12%);
|
|
67
|
+
--ring: oklch(0.72 0.20 140);
|
|
78
68
|
}
|
|
79
69
|
|
|
80
70
|
@theme inline {
|
|
@@ -101,19 +91,6 @@
|
|
|
101
91
|
--color-border: var(--border);
|
|
102
92
|
--color-input: var(--input);
|
|
103
93
|
--color-ring: var(--ring);
|
|
104
|
-
--color-chart-1: var(--chart-1);
|
|
105
|
-
--color-chart-2: var(--chart-2);
|
|
106
|
-
--color-chart-3: var(--chart-3);
|
|
107
|
-
--color-chart-4: var(--chart-4);
|
|
108
|
-
--color-chart-5: var(--chart-5);
|
|
109
|
-
--color-sidebar: var(--sidebar);
|
|
110
|
-
--color-sidebar-foreground: var(--sidebar-foreground);
|
|
111
|
-
--color-sidebar-primary: var(--sidebar-primary);
|
|
112
|
-
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
|
113
|
-
--color-sidebar-accent: var(--sidebar-accent);
|
|
114
|
-
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
|
115
|
-
--color-sidebar-border: var(--sidebar-border);
|
|
116
|
-
--color-sidebar-ring: var(--sidebar-ring);
|
|
117
94
|
}
|
|
118
95
|
|
|
119
96
|
@layer base {
|